:root {
            /* PALETA: Clean & Modern */
            --yope-blue: #055E8A;  /* Azul Corporativo */
            --yope-gold: #ffc107;  /* Dorado/Amarillo */
            --bg-body: #f8f9fa;    /* Fondo gris muy claro */
            --bg-card: #ffffff;    /* Tarjetas blancas */
            --text-dark: #2c3e50;  /* Texto principal */
            --text-muted: #6c757d; /* Texto secundario */
            --white: #ffffff;      /* Blanco Puro */
            --shadow: 0 8px 30px rgba(0,0,0,0.08); /* Sombra suave */
            --radius: 16px;
        }

        body { font-family: 'Open Sans', sans-serif; background-color: var(--bg-body); color: var(--text-dark); margin: 0; padding: 0; line-height: 1.6; -webkit-tap-highlight-color: transparent; }
        h1, h2, h3, h4 { font-family: 'Montserrat', sans-serif; margin: 0; font-weight: 700; color: var(--yope-blue); }
        a { text-decoration: none; color: inherit; transition: 0.3s; }
        button { font-family: 'Montserrat', sans-serif; cursor: pointer; transition: 0.3s; }

        /* HEADER MEJORADO */
        .app-header {
            background: var(--yope-blue); 
            height: 70px; 
            display: flex; 
            align-items: center; 
            justify-content: space-between;
            padding: 0 5%; 
            position: sticky; 
            top: 0; 
            z-index: 1000; 
            box-shadow: 0 4px 15px rgba(5, 94, 138, 0.2);
        }
        .brand-logo { font-size: 1.6rem; font-weight: 900; color: var(--white); letter-spacing: -1px; text-transform: uppercase; }
        .brand-logo span { color: var(--yope-gold); }
        .header-actions { display: flex; align-items: center; gap: 20px; }
        
        .nav-links { display: flex; gap: 15px; align-items: center; } /* Gap reducido para nuevos enlaces */
        .nav-link { 
            font-weight: 600; 
            color: var(--white) !important; 
            font-size: 0.95rem; 
            letter-spacing: 0.5px; 
            opacity: 1; 
        }
        .nav-link:hover { color: var(--yope-gold) !important; }
        
        .header-wallet {
            display: flex; align-items: center; gap: 8px; 
            background: rgba(255,255,255,0.15); padding: 6px 14px; 
            border-radius: 50px; color: var(--white); font-weight: 700; font-size: 0.9rem;
            border: 1px solid rgba(255,255,255,0.2);
        }

        /* BOTÓN LOGOUT MÓVIL */
        .mobile-logout-btn {
            display: none; 
            color: var(--white); 
            margin-left: 8px;
            align-items: center;
            justify-content: center;
        }
        .mobile-logout-btn:hover { transform: scale(1.1); color: var(--yope-gold); }

        /* BOTONES DEL HEADER INVERTIDOS */
        .btn-outline {
            border: 2px solid var(--yope-gold); 
            background: var(--yope-gold); 
            color: var(--yope-blue); 
            padding: 8px 24px; 
            border-radius: 50px; 
            font-weight: 700; 
            letter-spacing: 0.5px;
        }
        .btn-outline:hover { 
            background: transparent; 
            color: var(--yope-gold); 
        }

        /* HERO GUEST */
        .hero-guest {
            background: linear-gradient(135deg, #055E8A 0%, #033a56 100%);
            padding: 60px 5% 80px; text-align: center; margin-bottom: 40px; 
            color: #ffffff;
            clip-path: polygon(0 0, 100% 0, 100% 90%, 50% 100%, 0 90%);
        }
        .hero-guest h1 { font-size: 2.5rem; margin-bottom: 15px; text-transform: uppercase; color: #ffffff !important; letter-spacing: 1px; }
        .hero-guest p { font-size: 1.1rem; opacity: 1; max-width: 600px; margin: 0 auto 30px; font-weight: 400; color: #ffffff !important; }
        .btn-hero {
            background: var(--yope-gold); color: #333; padding: 16px 45px; 
            border-radius: 50px; font-weight: 800; border: none; font-size: 1.1rem;
            box-shadow: 0 8px 20px rgba(0,0,0,0.2);
        }
        .btn-hero:hover { transform: translateY(-3px); box-shadow: 0 12px 25px rgba(0,0,0,0.3); background: #ffca2c; }

        /* STEPS */
        .container { max-width: 1200px; margin: 0 auto; padding: 0 20px 50px; }
        .steps-wrapper { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; margin-bottom: 60px; }
        .step-card {
            background: var(--bg-card); padding: 30px 20px; border-radius: var(--radius); width: 280px; 
            text-align: center; transition: 0.3s; border: 1px solid #eee;
            box-shadow: var(--shadow);
        }
        .step-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(5, 94, 138, 0.15); border-color: var(--yope-blue); }
        .step-icon { font-size: 3rem; margin-bottom: 15px; display: block; }
        .step-title { color: var(--yope-blue); font-size: 1.2rem; margin-bottom: 8px; font-weight: 800; text-transform: uppercase; }
        .step-desc { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; }

        /* PREMIOS GRID */
        .section-title { text-align: center; font-size: 2rem; margin-bottom: 40px; color: var(--text-dark); position: relative; display: inline-block; left: 50%; transform: translateX(-50%); }
        .section-title::after { content: ''; display: block; width: 60px; height: 4px; background: var(--yope-gold); margin: 10px auto 0; border-radius: 2px; }
        
        .grid-premios { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; }
        .card { 
            background: var(--bg-card); border-radius: var(--radius); overflow: hidden; 
            transition: 0.3s; position: relative; border: 1px solid #eee;
            box-shadow: var(--shadow);
        }
        .card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); border-color: var(--yope-blue); }
        .card-img { 
            height: 200px; background: #eef2f5; display: flex; align-items: center; justify-content: center; 
            font-size: 4rem; color: #cbd5e0; position: relative; overflow: hidden;
        }
        .card-body { padding: 20px; text-align: center; }
        .card-title { 
            font-size: 1.1rem; margin-bottom: 10px; color: var(--text-dark); 
            height: 45px; overflow: hidden; display: flex; align-items: center; justify-content: center; line-height: 1.3;
        }
        .card-price { display: block; font-size: 1.4rem; color: var(--yope-blue); font-weight: 800; margin-bottom: 15px; }
        
        .timer-badge { 
            position: absolute; top: 10px; right: 10px; 
            background: var(--yope-blue); color: white; 
            padding: 5px 12px; border-radius: 50px; font-size: 0.75rem; font-weight: 700; 
            z-index: 10; box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        }
        
        .btn-card { 
            width: 100%; padding: 12px; border: none; border-radius: 50px; 
            background: linear-gradient(135deg, #ffc107 0%, #ffca2c 100%); 
            color: #333; font-weight: 800; font-size: 0.95rem;
            box-shadow: 0 4px 10px rgba(255, 193, 7, 0.3);
        }
        
        /* DASHBOARD USUARIO */
        .hero-user { background: var(--white); padding: 30px 5%; border-bottom: 1px solid #eee; margin-bottom: 30px; }
        .hero-user h1 { font-size: 1.8rem; color: var(--yope-blue); }
        .hero-user p { color: var(--text-muted); }
        
        .dashboard-stats {
            background: var(--yope-blue); color: var(--white); 
            padding: 25px 30px; border-radius: var(--radius); 
            display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px;
            margin-bottom: 40px; box-shadow: 0 10px 25px rgba(5, 94, 138, 0.3);
        }
        .stat-val { font-size: 2.5rem; font-family: 'Montserrat', sans-serif; font-weight: 800; line-height: 1; color: var(--yope-gold); }
        .stat-label { font-size: 0.85rem; color: rgba(255,255,255,0.8); text-transform: uppercase; letter-spacing: 2px; }
        
        .btn-add { 
            background: var(--yope-gold); 
            color: var(--yope-blue); 
            border: 2px solid var(--yope-gold); 
            padding: 10px 25px; 
            border-radius: 50px; 
            font-weight: 800; 
            font-size: 0.85rem; 
        }

        /* ALERTS */
        .top-alert { padding: 12px; text-align: center; color: white; font-weight: 600; display: flex; justify-content: center; align-items: center; gap: 10px; margin-bottom: 20px; border-radius: 10px; font-size: 0.9rem; }
        .bg-red { background: #ff4d4d; }
        .bg-orange { background: #ff9900; }
        .btn-tiny { background: rgba(255,255,255,0.9); color: #333; border: none; padding: 4px 12px; border-radius: 20px; font-weight: bold; font-size: 0.75rem; cursor: pointer; }

        /* TABLES */
        .panel-box { background: var(--white); border-radius: 15px; padding: 25px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); margin-bottom: 30px; border: 1px solid #eee; }
        .panel-box h3 { margin-bottom: 20px; color: var(--yope-blue); font-size: 1.2rem; border-left: 4px solid var(--yope-gold); padding-left: 15px; }
        .table-simple { width: 100%; border-collapse: collapse; }
        .table-simple th { text-align: left; color: #666; font-size: 0.8rem; padding-bottom: 15px; border-bottom: 1px solid #eee; }
        .table-simple td { padding: 15px 0; border-bottom: 1px solid #f0f0f0; color: var(--text-dark); font-weight: 600; font-size: 0.9rem; }
        .code-ticket { font-family: monospace; font-size: 1rem; color: #e60000; letter-spacing: 1px; background: #fff0f0; padding: 2px 8px; border-radius: 4px; }

        /* MODALS (GENERAL) */
        .modal { 
            display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
            background: rgba(5, 94, 138, 0.6); backdrop-filter: blur(5px); z-index: 2000; 
            justify-content: center; align-items: center; 
        }
        .modal-content { 
            background: #ffffff; width: 90%; max-width: 450px; padding: 40px; 
            border-radius: 20px; position: relative; 
            box-shadow: 0 20px 60px rgba(0,0,0,0.15); 
            text-align: center; animation: slideUp 0.3s ease;
            /* --- CORRECCION PANTALLAS PEQUEÑAS (Laptops) --- */
            max-height: 90vh; /* Máximo el 90% del alto de la pantalla */
            overflow-y: auto; /* Scroll si el contenido es muy largo */
        }
        @keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
        .close-btn { position: absolute; top: 20px; right: 20px; font-size: 1.8rem; cursor: pointer; color: #999; }
        
        /* FORMULARIOS */
        .input-group { margin-bottom: 18px; text-align: left; }
        .input-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #666; font-size: 0.85rem; }
        .input-field { 
            width: 100%; padding: 14px; border: 1px solid #ddd; border-radius: 12px; 
            font-size: 1rem; background: #fdfdfd; color: #333; box-sizing: border-box; transition: 0.3s; 
            min-height: 48px; /* Touch friendly */
        }
        .input-field:focus { border-color: var(--yope-blue); outline: none; background: #fff; box-shadow: 0 0 0 3px rgba(5, 94, 138, 0.1); }
        .phone-row { display: flex; gap: 10px; }
        /* Asegura que Fecha y Hora compartan el ancho 50/50 en escritorio */
        .phone-row > * { flex: 1; }
        
        .select-country { padding: 14px; border: 1px solid #ddd; border-radius: 12px; background: #ffffff; color: #333; cursor: pointer; min-height: 48px; }
        .btn-submit { 
            width: 100%; padding: 16px; background: var(--yope-blue); color: white; border: none; border-radius: 12px; font-weight: 800; font-size: 1rem; margin-top: 10px; cursor: pointer; 
            box-shadow: 0 4px 10px rgba(5, 94, 138, 0.2);
        }
        .btn-submit:active { transform: scale(0.98); }
        .input-otp { font-size: 2rem; letter-spacing: 10px; text-align: center; width: 200px; margin: 0 auto; display: block; color: var(--yope-blue); border: 2px solid var(--yope-blue); background: #ffffff; height: 60px; }

        /* FOOTER */
        #footer-sorteo { 
            background: var(--yope-blue); color: rgba(255,255,255,0.8); 
            padding: 40px 5%; margin-top: 50px; font-size: 0.85rem;
        }
        .footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; max-width: 1200px; margin: 0 auto; }
        .footer-col h4 { color: var(--white); margin-bottom: 15px; font-size: 1rem; }
        .footer-col ul { list-style: none; padding: 0; }
        .footer-col ul li { margin-bottom: 10px; }
        .footer-copy { text-align: center; margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.6); font-size: 0.8rem; }

        .alert { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); padding: 12px 25px; border-radius: 50px; color: white; font-weight: bold; z-index: 3000; box-shadow: 0 5px 15px rgba(0,0,0,0.3); animation: fadeIn 0.5s; transition: opacity 0.5s ease; font-size: 0.9rem; width: 80%; text-align: center; }
        .alert.exito { background: #10b981; } .alert.error { background: #ef4444; }
        .error-msg { color: #c62828; background: #ffebee; padding: 10px; border-radius: 8px; margin-bottom: 15px; font-size: 0.9rem; font-weight: 600; display: block; }
        @keyframes fadeIn { from { opacity: 0; transform: translate(-50%, -20px); } to { opacity: 1; transform: translate(-50%, 0); } }

        /* --- MOBILE APP BOTTOM NAVIGATION --- */
        .mobile-bottom-nav {
            display: none; /* Oculto en escritorio */
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 65px;
            background: #ffffff;
            box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
            z-index: 1900;
            justify-content: space-around;
            align-items: center;
            border-top: 1px solid #f0f0f0;
            padding-bottom: env(safe-area-inset-bottom); /* iPhone X+ safe area */
        }
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-decoration: none;
            color: #999;
            font-size: 0.7rem;
            width: 100%;
            height: 100%;
        }
        .nav-item svg { width: 24px; height: 24px; margin-bottom: 4px; stroke: #999; transition: 0.3s; }
        .nav-item.active { color: var(--yope-blue); font-weight: 700; }
        .nav-item.active svg { stroke: var(--yope-blue); stroke-width: 2.5; }

        /* --- MOBILE RESPONSIVE TWEAKS --- */
        @media (max-width: 768px) { 
            body { padding-bottom: 80px; } /* Espacio para el nav bottom */
            .app-header { padding: 0 15px; height: 60px; }
            .nav-links { display: none; } /* Ocultar nav superior */
            .mobile-bottom-nav { display: flex; } /* Mostrar nav inferior */
            .mobile-logout-btn { display: flex; }
            
            .hero-guest { padding: 40px 20px 60px; clip-path: polygon(0 0, 100% 0, 100% 95%, 50% 100%, 0 95%); }
            .hero-guest h1 { font-size: 1.8rem; }
            
            .container { padding: 0 15px 30px; }
            .section-title { font-size: 1.6rem; margin-bottom: 30px; }
            
            .grid-premios { grid-template-columns: 1fr; gap: 20px; }
            .card-img { height: 180px; }
            
            .dashboard-stats { flex-direction: column; text-align: center; padding: 20px; }
            .stat-val { font-size: 2.2rem; }
            
            .phone-row { flex-direction: column; gap: 0; }
            .input-group { width: 100% !important; margin-bottom: 15px !important; }
            
            /* MODAL BOTTOM SHEET STYLE */
            .modal { align-items: flex-end; } /* Alinear al fondo */
            .modal-content { 
                width: 100%; 
                max-width: 100%; 
                border-radius: 25px 25px 0 0; 
                padding: 30px 20px 40px; 
                margin: 0;
                /* --- CORRECCION: SCROLL EN MOVIL --- */
                max-height: 85vh;
                overflow-y: auto;
                animation: slideUpMobile 0.3s ease-out;
            }
            @keyframes slideUpMobile { from { transform: translateY(100%); } to { transform: translateY(0); } }
            .close-btn { top: 15px; right: 20px; background: #f0f0f0; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
        }