/* --- RESET BÁSICO --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: #000F1F; /* Azul Tocka muy oscuro */
    color: #ffffff;
    overflow-x: hidden;
}

/* --- NAVEGACIÓN --- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    position: absolute;
    width: 100%;
    top: 0;
    z-index: 10;
}

.logo-img {
    height: 50px;
    width: auto;
    display: block;
}

/* Contenedor de la derecha (Selector + Botón) */
.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* --- ESTILOS DEL SELECTOR DE IDIOMAS --- */
.lang-selector select {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    outline: none;
    transition: 0.3s;
    font-family: 'Outfit', sans-serif;
}

.lang-selector select:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #14B8A6; /* Borde turquesa al pasar el ratón */
}

/* Las opciones del menú desplegable */
.lang-selector option {
    background: #000F1F; /* Fondo oscuro para que se lea */
    color: white;
}

.btn-nav {
    text-decoration: none;
    color: white;
    font-weight: bold;
    border: 2px solid white;
    padding: 10px 20px;
    border-radius: 50px;
    transition: 0.3s;
}

.btn-nav:hover {
    background: white;
    color: #000F1F;
}

/* --- HERO SECTION (PORTADA) --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center; /* En PC centra el texto verticalmente */
    justify-content: flex-start;
    padding: 120px 10% 50px 10%;

    /* Desktop */
    background-image: url('../img/portada_web.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    /* Parallax SOLO desktop (en iOS lo anulamos abajo) */
    background-attachment: fixed;

    position: relative; /* para overlay */
}

/* Overlay para legibilidad (sobre todo móvil) */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(
        90deg,
        rgba(0, 10, 25, 0.92) 0%,
        rgba(0, 10, 25, 0.78) 35%,
        rgba(0, 10, 25, 0.35) 60%,
        rgba(0, 10, 25, 0.10) 100%
    );
}

.hero-content {
    max-width: 550px;
    position: relative;
    z-index: 1; /* por encima del overlay */
}

.badge {
    background: rgba(20, 184, 166, 0.2);
    color: #14B8A6;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
}

h1 {
    font-size: 60px;
    line-height: 1.1;
    margin: 20px 0;
    font-weight: 900;
    text-shadow: 0 4px 10px rgba(0,0,0,0.8);
}

.gradient-text {
    background: linear-gradient(to right, #14B8A6, #FCD34D);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none !important;
}

p {
    font-size: 18px;
    color: #ffffff;
    line-height: 1.6;
    margin-bottom: 30px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.9);
}

/* --- BOTONES TIENDAS --- */
.cta-buttons {
    display: flex;
    gap: 15px;
}

.btn-store {
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.google {
    background: #14B8A6;
    color: #001F3F;
}

.apple {
    background: #1f2937;
    color: white;
    border: 1px solid #374151;
}

.btn-store:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(20, 184, 166, 0.5);
}

.small-text {
    font-size: 12px;
    margin-top: 10px;
    opacity: 0.9;
    text-shadow: 0 1px 3px rgba(0,0,0,1);
}

/* --- SECCIÓN RANKING (CARRUSEL APP) --- */
.ranking-section {
    padding: 100px 10%;
    background-color: #000F1F;
    border-top: 1px solid rgba(255,255,255,0.05);
    position: relative;
    z-index: 2;
}

.ranking-container {
    display: flex;
    align-items: center;
    gap: 80px;
    max-width: 1400px;
    margin: 0 auto;
}

.ranking-text {
    flex: 1;
    min-width: 300px;
}

.ranking-text h2 {
    font-size: 45px;
    margin-bottom: 20px;
    line-height: 1.1;
    font-weight: 900;
}

.badge-dark {
    background: #1f2937;
    color: #FCD34D; /* Dorado */
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 15px;
    border: 1px solid #374151;
}

.ranking-list {
    list-style: none;
    margin-top: 30px;
}

.ranking-list li {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #cbd5e1;
    font-size: 16px;
    text-shadow: none;
}

.ranking-list i {
    color: #14B8A6; /* Turquesa */
}

/* IMAGEN DEL CARRUSEL */
.ranking-image {
    flex: 2;
    display: flex;
    justify-content: center;
}

.ranking-image img {
    width: 100%;
    max-width: 900px;
    filter: drop-shadow(0 30px 60px rgba(20, 184, 166, 0.4));
    transition: transform 0.3s ease;
    animation: flotar 6s ease-in-out infinite;
}

.ranking-image img:hover {
    transform: scale(1.02);
    animation-play-state: paused;
}

@keyframes flotar {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

/* --- ESTILO GENERAL DE TARJETAS DE CRISTAL --- */
.glass-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: left;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.glass-card:hover {
    transform: translateY(-5px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
    box-shadow: 0 15px 40px 0 rgba(20, 184, 166, 0.2);
    border-color: rgba(20, 184, 166, 0.4);
}

.glass-card h3, .glass-card h4 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 10px;
    color: white;
}

.glass-card p {
    font-size: 15px;
    color: #cbd5e1;
    line-height: 1.5;
    margin-bottom: 0;
    text-shadow: none;
    font-weight: 400;
}

.glass-card i {
    font-size: 35px;
    margin-bottom: 20px;
    background: linear-gradient(to bottom right, #2DD4BF, #0F766E);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(20, 184, 166, 0.4));
    display: inline-block;
}

/* --- SECCIÓN TOOLBOX (HERRAMIENTAS) --- */
.toolbox-section {
    padding: 100px 10%;
    background: radial-gradient(circle at 50% 50%, #0f172a 0%, #000F1F 100%);
    position: relative;
    z-index: 2;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.toolbox-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 60px auto;
}

.toolbox-header h2 {
    font-size: 40px;
    margin-bottom: 15px;
    font-weight: 900;
}

.toolbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

/* --- FEATURES (CARACTERÍSTICAS) --- */
.features {
    padding: 100px 10%;
    background: #000913;
    position: relative;
    z-index: 2;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* --- FOOTER --- */
footer {
    padding: 40px 10%;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 14px;
    color: #64748b;
    background-color: #000F1F;
    position: relative;
    z-index: 2;
}

.links a {
    color: #64748b;
    margin: 0 10px;
    text-decoration: none;
}

/* --- PÁGINA DE PRIVACIDAD Y LEGAL --- */
.legal-section {
    padding: 80px 20px;
    background-color: #000F1F;
    min-height: 80vh;
}

.legal-container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.03);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.legal-container h1 {
    font-size: 40px;
    margin-bottom: 10px;
    color: #14B8A6;
}

.legal-container h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: #FCD34D;
    font-size: 22px;
}

.legal-container p, .legal-container ul li {
    font-size: 16px;
    line-height: 1.8;
    color: #cbd5e1;
    margin-bottom: 15px;
    text-shadow: none;
}

.legal-container ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

.legal-container a {
    color: #14B8A6;
    text-decoration: underline;
}

.last-updated {
    font-size: 14px;
    color: #64748b;
    font-style: italic;
}

.legal-container hr {
    border: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 30px 0;
}

/* --- ESTILOS ESPECIALES PARA TARJETAS CON FOTO --- */
.toolbox-grid .glass-card {
    background-color: transparent !important;
    background-size: cover !important;            /* ✅ evita deformación */
    background-position: center right !important; /* ✅ se ve mejor */
    background-repeat: no-repeat !important;
    border: none;
    box-shadow: none;

    min-height: 220px;

    justify-content: center;
    align-items: flex-start;
    padding-left: 30px;
    padding-right: 120px;
    transition: all 0.3s ease;
}

.toolbox-grid .glass-card:hover {
    background-color: transparent !important;
    transform: translateY(-5px) scale(1.02);
    border: 1px solid #14B8A6;
    box-shadow: 0 0 25px rgba(20, 184, 166, 0.5), inset 0 0 10px rgba(20, 184, 166, 0.2);
}

.card-dice { background-image: url('../img/fondo_dados.png') !important; }
.card-calc { background-image: url('../img/fondo_calc.png') !important; }
.card-roulette { background-image: url('../img/fondo_ruleta.png') !important; }
.card-timer { background-image: url('../img/fondo_reloj.png') !important; }

.text-content h4 {
    font-size: 26px;
    font-weight: 900;
    margin-bottom: 8px;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.text-content p {
    font-size: 16px;
    color: #e2e8f0;
    line-height: 1.4;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* =========================================================
   ✅ OPTIMIZACIÓN REAL iOS (iPad/iPhone): sin zoom y sin parallax
   ========================================================= */
@media (hover: none) and (pointer: coarse) {
    .hero {
        min-height: 100svh;
        height: 100svh;

        background-attachment: scroll !important;
        background-image: url('../img/portada_web_movil.jpg') !important;
        background-repeat: no-repeat !important;

        /* ✅ anti-zoom estable */
        background-size: auto 100% !important;
        background-position: right center !important;
    }
}

/* Portrait táctil: texto arriba */
@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
    .hero {
        align-items: flex-start !important;
        padding-top: clamp(110px, 18vh, 190px) !important;
    }
}

/* Landscape táctil: base (luego iPad override abajo) */
@media (hover: none) and (pointer: coarse) and (orientation: landscape) {
    .hero {
        align-items: center !important;
        padding-top: 60px !important;
    }

    .hero-content { max-width: 85%; }

    h1 { font-size: 34px !important; margin: 10px 0 !important; }
    p  { font-size: 15px !important; margin-bottom: 15px !important; }

    .cta-buttons {
        flex-direction: row !important;
        justify-content: center !important;
    }

    .btn-store {
        padding: 10px 20px !important;
        font-size: 14px !important;
    }
}

/* =========================================================
   📱 Teléfono portrait general (menos de 600): nav en columna
   ========================================================= */
@media (max-width: 600px) and (orientation: portrait) {
    nav {
        flex-direction: column;
        gap: 12px;
        position: relative;
        padding: 16px 18px;
    }

    .nav-right {
        flex-direction: column;
        gap: 12px;
    }

    .hero {
        text-align: center;
        align-items: center !important;
        padding-top: 110px !important;
        background-position: right 55% !important;
    }

    .cta-buttons {
        justify-content: center;
        flex-direction: column;
    }
}

/* =========================================================
   ✅ iPhone SE / muy pequeños (≤375px) -> reglas compactas
   ========================================================= */
@media (hover: none) and (pointer: coarse) and (max-width: 375px) and (orientation: portrait) {
    nav{
        position: absolute !important;
        top: 0; left: 0; width: 100%;
        flex-direction: row !important;
        justify-content: space-between !important;
        padding: 12px 14px !important;
    }

    .nav-right{ flex-direction: row !important; gap: 10px !important; }
    .logo-img{ height: 34px !important; }

    .lang-selector select{ padding: 6px 10px !important; font-size: 12px !important; }
    .btn-nav{ padding: 7px 12px !important; font-size: 13px !important; }

    .hero{
        padding-top: 92px !important;
        padding-left: 6% !important;
        padding-right: 6% !important;
        text-align: left !important;
        align-items: flex-start !important;
        background-position: right 55% !important;
    }

    .hero-content{ max-width: 340px !important; }

    h1{ font-size: 32px !important; line-height: 1.05 !important; margin: 10px 0 !important; }
    p { font-size: 14.5px !important; line-height: 1.45 !important; margin-bottom: 14px !important; }
    .badge{ font-size: 10.5px !important; padding: 4px 10px !important; }

    .cta-buttons{
        flex-direction: column !important;
        gap: 10px !important;
        align-items: flex-start !important;
    }

    .btn-store{
        width: 100% !important;
        justify-content: center !important;
        padding: 12px 16px !important;
        font-size: 14px !important;
    }

    .small-text{ font-size: 11px !important; margin-top: 8px !important; }
}

/* =========================================================
   ✅ iPhone 15 / móviles “modernos” (376–430px)
   (IMPORTANTE: ya NO se comen las reglas del SE)
   ========================================================= */
@media (hover: none) and (pointer: coarse) and (min-width: 376px) and (max-width: 430px) and (orientation: portrait) {
    /* nav: misma idea, pero con un pelín más de aire */
    nav{
        position: absolute !important;
        top: 0; left: 0; width: 100%;
        flex-direction: row !important;
        justify-content: space-between !important;
        padding: 14px 16px !important;
    }

    .nav-right{ flex-direction: row !important; gap: 12px !important; }
    .logo-img{ height: 38px !important; }

    .lang-selector select{ padding: 7px 11px !important; font-size: 13px !important; }
    .btn-nav{ padding: 8px 14px !important; font-size: 14px !important; }

    .hero{
        padding-top: 102px !important;
        padding-left: 7% !important;
        padding-right: 7% !important;
        text-align: left !important;
        align-items: flex-start !important;

        /* ✅ evita que el móvil del fondo se meta en el texto */
        background-position: right 58% !important;
    }

    .hero-content{ max-width: 380px !important; }

    h1{ font-size: 38px !important; line-height: 1.06 !important; margin: 12px 0 !important; }
    p { font-size: 15.5px !important; line-height: 1.5 !important; margin-bottom: 16px !important; }

    .cta-buttons{
        flex-direction: column !important;
        gap: 12px !important;
        align-items: flex-start !important;
    }

    .btn-store{
        width: 100% !important;
        justify-content: center !important;
        padding: 13px 18px !important;
        font-size: 15px !important;
    }
}

/* =========================================================
   ✅ Landscape con poco alto: tarjetas a 1 columna para que no “bailen”
   ========================================================= */
@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
    .toolbox-grid, .features-grid{
        grid-template-columns: 1fr !important;
        gap: 18px !important;
    }

    .toolbox-grid .glass-card{
        padding-right: 40px !important;
        padding-left: 24px !important;
        min-height: 180px !important;
    }
}

/* =========================================================
   ✅ iPad HORIZONTAL: recuperar tamaño de texto (sin tocar iPhone)
   ========================================================= */
@media (hover: none) and (pointer: coarse) and (min-width: 900px) and (max-width: 1180px) and (orientation: landscape) {
    h1{
        font-size: 44px !important;
        line-height: 1.08 !important;
        margin: 14px 0 !important;
    }

    p{
        font-size: 17px !important;
        line-height: 1.55 !important;
        margin-bottom: 20px !important;
    }

    .hero-content{
        max-width: 560px !important;
    }

    .btn-store{
        padding: 13px 22px !important;
        font-size: 15px !important;
    }
}
