* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #e3dac9;
    /* Fuente por defecto para textos base, opciones y descripciones */
    font-family: 'Inter', sans-serif;
    overflow: hidden; 
}

.container {
    width: 100vw;
    min-height: 100vh;
    --color: rgba(0, 0, 0, 0.08); 
    background-color: #e3dac9;
    background-image: 
        linear-gradient(0deg, transparent 24%, var(--color) 25%, var(--color) 26%, transparent 27%, transparent 74%, var(--color) 75%, var(--color) 76%, transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, var(--color) 25%, var(--color) 26%, transparent 27%, transparent 74%, var(--color) 75%, var(--color) 76%, transparent 77%, transparent);
    background-size: 55px 55px;
    position: relative;
}

#welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    background-color: transparent;
}

/* --- WELCOME ANIMATION --- */
/* --- BUSCÁ ESTA SECCIÓN EN TU STYLE.CSS Y REEMPLAZALA --- */
.welcome-text {
    font-family: 'Gravitas One', serif;
    font-size: 4rem; /* Se redujo de 6rem a 4rem para un look más estilizado */
    color: #004643;
    display: flex;
    gap: 12px; /* Se achicó un pelín el espacio entre letras en consonancia */
    letter-spacing: 2px;
}

.welcome-text span {
    opacity: 0;
    transform: translateY(100px) scale(0.7);
    animation: superSmoothEntrance 2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.welcome-text span:nth-child(1) { animation-delay: 0.1s; }
.welcome-text span:nth-child(2) { animation-delay: 0.2s; }
.welcome-text span:nth-child(3) { animation-delay: 0.3s; }
.welcome-text span:nth-child(4) { animation-delay: 0.4s; }
.welcome-text span:nth-child(5) { animation-delay: 0.5s; }
.welcome-text span:nth-child(6) { animation-delay: 0.6s; }
.welcome-text span:nth-child(7) { animation-delay: 0.7s; }

@keyframes superSmoothEntrance {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

#welcome-screen.fade-out {
    opacity: 0;
    transform: translateY(-80px);
    transition: opacity 2.2s cubic-bezier(0.25, 1, 0.2, 1), transform 2.2s cubic-bezier(0.25, 1, 0.2, 1);
    pointer-events: none;
}

/* --- CONTENIDO PRINCIPAL --- */
#main-menu {
    opacity: 0;
    transform: translateY(60px);
    pointer-events: none;
    transition: opacity 2.5s cubic-bezier(0.25, 1, 0.2, 1), transform 2.5s cubic-bezier(0.25, 1, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 140px 40px 60px 40px;
}

#main-menu.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.brand-title {
    position: absolute;
    top: 40px;
    left: 40px;
    font-family: 'Gravitas One', serif; /* Marca destacada */
    font-size: 1.8rem;
    color: #004643;
}

.page-subtitle {
    position: absolute;
    top: 45px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    color: #004643;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* --- SECCIÓN DE INTRODUCCIÓN --- */
.intro-section {
    width: 100%;
    max-width: 750px;
    margin: 40px auto 100px auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 40vh;
}

.intro-section h1 {
    font-family: 'Gravitas One', serif; /* Título principal impactante */
    font-size: 3.2rem;
    color: #004643;
    margin-bottom: 25px;
    line-height: 1.2;
}

.intro-section p {
    font-size: 1.15rem;
    color: rgba(0, 70, 67, 0.85);
    line-height: 1.6;
    margin-bottom: 40px;
}

.scroll-indicator {
    font-size: 0.9rem;
    color: #004643;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
    opacity: 0.6;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

/* --- GRILLA DE CARDS --- */
.cards-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important; /* Fuerza máximo 3 por fila */
    gap: 25px !important;                             /* Separación entre tarjetas */
    max-width: 1200px !important;                     /* Evita que se estiren de más */
    margin: 0 auto !important;                        /* Centra el bloque */
}
/* Opcional: Si querés que en pantallas chicas (celulares) no se rompa y pase a 1 columna */
@media (max-width: 900px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
}

.topic-card {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 70, 67, 0.12);
    border-radius: 20px;
    padding: 35px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.topic-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 70, 67, 0.3);
    box-shadow: 0 25px 50px rgba(0, 70, 67, 0.06);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.card-icon {
    font-size: 1.8rem;
    color: #004643;
    font-weight: 700;
}

.card-title {
    font-family: 'Gravitas One', serif; /* Título de la tarjeta */
    font-size: 1.25rem;
    color: #004643;
}

.card-description {
    font-size: 0.95rem;
    color: rgba(0, 70, 67, 0.75);
    margin-bottom: 30px;
    line-height: 1.5;
    flex-grow: 1;
}

.card-btn {
    background-color: transparent;
    border: 1px solid #004643;
    color: #004643;
    padding: 14px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    border-radius: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.topic-card:hover .card-btn {
    background-color: #004643;
    color: #e3dac9;
}

/* --- PANTALLA DE EJERCICIOS --- */
#exercise-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    padding: 140px 40px 60px 40px;
    opacity: 0;
    transform: translateY(40px);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity 1.2s cubic-bezier(0.25, 1, 0.2, 1), transform 1.2s cubic-bezier(0.25, 1, 0.2, 1);
}

#exercise-screen.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#main-menu.fade-out-menu {
    opacity: 0;
    transform: translateY(-40px);
    pointer-events: none;
}

#back-btn {
    position: absolute;
    top: 40px;
    left: 40px;
    background: transparent;
    border: none;
    color: #004643;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.3s ease;
}

#back-btn:hover {
    transform: translateX(-5px);
}

#exercise-topic-title {
    font-family: 'Gravitas One', serif; /* Título de la materia activa */
    font-size: 2.8rem;
    color: #004643;
    margin-bottom: 50px;
    text-align: center;
}

#exercises-container {
    width: 100%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.exercise-box {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 70, 67, 0.15);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 70, 67, 0.02);
}

.exercise-box h4 {
    font-size: 1.1rem;
    color: #004643;
    margin-bottom: 15px;
    font-weight: 700;
}

.exercise-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.custom-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border: 1px solid rgba(0, 70, 67, 0.15);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #004643;
    font-weight: 500;
    transition: all 0.25s ease;
}

.custom-option input { display: none; }

.custom-option:hover {
    background: rgba(255, 255, 255, 0.5);
}

.custom-option:has(input:checked) {
    background-color: #004643;
    color: #e3dac9;
    font-weight: 700;
}

/* --- AGREGAR ESTO AL FINAL DE TU ARCHIVO STYLE.CSS --- */

/* Botón de verificar respuestas */
#check-btn {
    margin-top: 40px;
    background-color: #004643;
    color: #e3dac9;
    border: none;
    padding: 16px 40px;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 70, 67, 0.15);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#check-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(0, 70, 67, 0.25);
    background-color: #003331;
}

/* ESTADOS DE VALIDACIÓN (VERDE Y ROJO) */

/* Opción Correcta */
.custom-option.correct-answer {
    background-color: rgba(46, 139, 87, 0.15) !important;
    border-color: #2e8b57 !important;
    color: #1e5c36 !important;
    font-weight: 700;
}
.custom-option.correct-answer::after {
    content: " ✓";
    margin-left: auto;
    color: #2e8b57;
}

/* Opción Incorrecta Seleccionada */
.custom-option.wrong-answer {
    background-color: rgba(178, 34, 34, 0.12) !important;
    border-color: #b22222 !important;
    color: #7a1515 !important;
}
.custom-option.wrong-answer::after {
    content: " ✗";
    margin-left: auto;
    color: #b22222;
}

/* Bloque de Feedback */
.feedback-box {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
    display: none; /* Se activa por JS */
    animation: slideInUp 0.4s ease forwards;
}

.feedback-box.show {
    display: block;
}

.feedback-box.success-fb {
    background-color: rgba(46, 139, 87, 0.08);
    border-left: 4px solid #2e8b57;
    color: #1e5c36;
}

.feedback-box.error-fb {
    background-color: rgba(178, 34, 34, 0.06);
    border-left: 4px solid #b22222;
    color: #7a1515;
}

/* Deshabilitar clics una vez verificado */
.exercise-options.disabled {
    pointer-events: none;
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- BUSCÁ ".page-subtitle" EN TU CSS, ELIMINALO Y AGREGÁ ESTO AL FINAL --- */

/* Mueve el contenedor de las banderas a la esquina superior derecha */
.subtitle-container {
    position: absolute;
    top: 20px !important;       /* Lo pega arriba de todo */
    right: 20px !important;     /* Lo manda bien a la derecha */
    left: auto !important;      /* Rompe el centrado anterior */
    transform: none !important; /* Quita el desplazamiento del centro */
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10;
}

/* Fuerza a que todos los textos descriptivos y de introducción se justifiquen */
.intro-section p,
.card-description,
.exercise-box p {
    text-align: justify !important;
    text-justify: inter-word; /* Mejora el espaciado entre palabras al justificar */
}

.page-subtitle {
    font-size: 1rem;
    color: #004643;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.lang-switcher {
    display: flex;
    gap: 8px;
}

.flag-btn {
    font-size: 1.3rem;
    cursor: pointer;
    opacity: 0.35;
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

.flag-btn:hover {
    opacity: 0.7;
    transform: scale(1.05);
}

.flag-btn.active {
    opacity: 1;
    transform: scale(1.15);
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

/* ==========================================================================
   AGREGADO EXCLUSIVO PARA CELULARES (NO CAMBIA TUS COLORES NI FUENTES)
   ========================================================================== */

/* Evita que la pantalla se mueva hacia los costados en teléfonos */
body {
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent; /* Saca el parpadeo azul feo al tocar opciones */
}

/* Fuerza a que tus tarjetas se organicen en 3 columnas en computadoras */
.cards-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
}

/* Si la pantalla es una Tablet (menos de 900px de ancho) */
@media (max-width: 900px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr) !important; /* Pasa a 2 columnas */
    }
}

/* Si la pantalla es un Celular (menos de 600px de ancho) */
@media (max-width: 600px) {
    /* Tus tarjetas se apilan una debajo de la otra ocupando el ancho del celu */
    .cards-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    /* Hace tus opciones de respuestas un poquito más altas para que sea fácil tocar con el pulgar */
    .custom-option {
        padding: 15px !important;
    }

    /* Achica un toque el texto del Welcome por si la pantalla es muy chica, así no se corta */
    .welcome-text {
        font-size: 2.3rem !important;
        letter-spacing: 3px !important;
    }
}

/* ==========================================================================
   TEXTO SALUDO EN LA ESQUINA INFERIOR DERECHA
   ========================================================================== */
.container::after {
    content: "enquiries.davidr@gmail.com";
    position: fixed;
    bottom: 5px;
    right: 5px;
    font-family: 'Gravitas One', cursive;
    font-size: 0.8rem;
    font-weight: 700;
    color: #004643;
    letter-spacing: 1px;
    text-transform: capitalize;
    opacity: 0; /* Sutil para que no moleste al leer */
    z-index: 10;
    pointer-events: none; /* Para que si clickeas arriba no bloquee nada */
}