:root {
    --primary-blue: #008CCE;
    --text-black: #000000;
    --text-grey: #666666;
    --bg-white: #FFFFFF;
    --primary-green: #669933;
    --primary-orange-yellow: #FBB03B;
    --font-outfit: 'Outfit', sans-serif;
    --font-opensans: 'Open Sans', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-white);
    font-family: var(--font-outfit);
    user-select: none;
    -webkit-user-select: none;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 2s ease;
    padding-bottom: 110px; /* Leave space for persistent footer */
    overflow-y: auto;
    box-sizing: border-box;
}

#splash-screen {
    z-index: 10;
    cursor: pointer;
}

#main-screen {
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.5s ease;
    justify-content: flex-start;
}

#main-screen.active {
    opacity: 1;
    pointer-events: auto;
}

/* Splash Content */
.splash-content {
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#main-logo {
    width: 250px;
    height: auto;
    margin-bottom: 20px;
    transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 2s ease-in-out;
    will-change: transform, opacity;
}

#tap-text {
    font-size: 1.5rem;
    color: var(--primary-blue);
    font-weight: 700;
    letter-spacing: 1px;
}

/* Main Header */
.main-header {
    text-align: center;
    transition: transform 1s ease-in-out, top 1s ease-in-out;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
}

.main-header.at-top {
    top: 60px;
    transform: translate(-50%, 0);
}

.unit-title {
    font-family: var(--font-opensans);
    color: var(--text-black);
    font-weight: 700;
    font-size: 2.2rem;
    margin-bottom: -5px;
}

.subtheme-title {
    font-family: var(--font-opensans);
    color: var(--text-grey);
    font-weight: 400;
    font-size: 1.2rem;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 145px; /* Pegado justo debajo del subtema */
    opacity: 0;
    transition: opacity 1.5s ease;
    width: 100%;
}

.main-content.visible {
    opacity: 1;
}

.medium-logo {
    width: 200px;
    height: auto;
}

.game-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    width: 100%;
}

.game-button {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 10px 40px; /* Reduced from 15px to 10px to reduce height */
    border-radius: 50px;
    font-family: var(--font-opensans);
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 140, 206, 0.3);
}

.content-text {
    font-family: var(--font-opensans);
    color: var(--text-black);
    font-size: 0.95rem;
    margin-top: 20px;
}

.instruction-label {
    font-family: var(--font-opensans);
    color: var(--text-black);
    font-size: 0.95rem;
    font-weight: 700;
}

.instructions-container {
    text-align: center;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 0 25px; /* Margen de seguridad a los costados */
    box-sizing: border-box;
}

.instruction-body {
    font-family: var(--font-opensans);
    color: var(--text-grey);
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
    padding: 0;
    line-height: 1.45;
    text-align: center; /* Centrado dentro de su lugar delimitado */
}

.instruction-line {
    margin: 0;
    text-align: center;
}

.instruction-game-tag {
    font-weight: 700;
    color: var(--primary-blue);
}

/* Animations */
.pulse {
    animation: pulse-animation 2s infinite ease-in-out;
}

@keyframes pulse-animation {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.fade-out {
    opacity: 0 !important;
}

.hidden {
    display: none !important;
}

/* Footer - Persistent */
.persistent-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    padding-bottom: 15px;
    padding-top: 10px;
    text-align: center;
    width: 100%;
    background-color: transparent;
    z-index: 100;
    pointer-events: none;
    transition: background-color 0.3s ease, border-radius 0.3s ease, box-shadow 0.3s ease;
}

.persistent-footer.scrolled {
    background-color: #FFFFFF;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.08);
    pointer-events: auto; /* Enable clicks if needed when it has background */
}

.powered-by {
    font-family: var(--font-opensans);
    color: var(--text-black);
    font-size: 0.8rem;
    margin-bottom: -5px;
    font-weight: 700;
}

.footer-brand {
    position: relative;
    display: inline-block;
}

.footer-logo {
    height: 16px;
    width: auto;
    position: absolute;
    right: 100%;
    margin-right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.footer-brand span {
    font-family: var(--font-opensans);
    font-size: 0.85rem;
    color: var(--text-grey);
    font-weight: 400;
}

/* --- GAME SCREEN --- */
#game-screen {
    z-index: 20;
    justify-content: flex-start;
    padding: 0 20px 20px 20px;
    background-color: var(--bg-white);
    transition: opacity 2.5s ease-in-out;
    opacity: 1;
}

#game-screen.fade-out {
    opacity: 0 !important;
}

.game-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0; /* Pegado al margen superior de la pantalla */
    padding-top: 10px; /* Ajuste limpio al borde */
    margin-bottom: 25px;
    gap: 8px;
}

.round-counter {
    color: var(--text-grey);
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Help Container & Circle Icon (Grey) */
.help-container {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-grey);
    cursor: pointer;
    user-select: none;
}

.help-label {
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font-opensans);
}

.help-icon-circle {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--text-grey);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
}

/* Effects Container & Speaker Icon (Blue) */
.effects-container {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--primary-blue);
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s ease;
}

.effects-container.muted {
    opacity: 0.4;
}

.effects-container.muted .volume-wave,
.effects-container.muted .volume-wave-outer {
    display: none !important;
}

.effects-container.muted .mute-cross {
    display: block !important;
}

.effects-label {
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font-opensans);
}

.speaker-icon {
    width: 18px;
    height: 18px;
    display: block;
}

/* Exit Button Top (Grey with white text and icon) */
.exit-btn-top {
    background-color: var(--text-grey);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    font-family: var(--font-opensans);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: transform 0.1s, background-color 0.2s;
}

.exit-btn-top:active {
    transform: scale(0.95);
}

.exit-icon {
    width: 14px;
    height: 14px;
    display: block;
}

/* Modal Overlay & Help Card Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    display: none !important;
}

/* Level Transition Banner Overlay (Fade in y Fade out en pantalla completa de 1.5s cada uno) */
.level-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-white);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    pointer-events: none;
}

.level-transition-overlay.no-fade-in {
    transition: none !important;
}

.level-transition-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.level-transition-text {
    font-family: var(--font-opensans);
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--primary-blue);
    letter-spacing: 1px;
    text-transform: capitalize;
    text-align: center;
    padding: 0 20px;
    animation: level-text-pop 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes level-text-pop {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.repeat-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

/* In-game Failure Modal (Aparece en la pantalla del juego al llegar a 3 errores) */
.in-game-failure-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.55);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 20px;
    transition: opacity 0.3s ease;
}

.in-game-failure-modal.hidden {
    display: none !important;
}

.failure-card {
    background-color: var(--bg-white);
    padding: 30px 24px;
    border-radius: 20px;
    width: 90%;
    max-width: 330px;
    text-align: center;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.failure-text {
    font-family: var(--font-opensans);
    font-size: 1.15rem;
    color: var(--text-black);
    font-weight: 700;
    line-height: 1.45;
}

.repeat-level-btn {
    box-shadow: 0 4px 15px rgba(0, 140, 206, 0.35);
}

.help-card {
    background-color: var(--bg-white);
    padding: 30px 24px;
    border-radius: 16px;
    width: 90%;
    max-width: 320px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    text-align: center;
    border: 1px solid #eaeaea;
}

.help-close-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--text-grey);
    cursor: pointer;
    line-height: 1;
}

.help-text {
    font-family: var(--font-opensans);
    font-size: 1.1rem;
    color: var(--text-grey);
    font-weight: 400;
    margin-top: 10px;
}

.animate-zoom {
    animation: animatezoom 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes animatezoom {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Number & Information Card (Reemplazo de recuadro de imagen) */
.game-number-container {
    width: 100%;
    max-width: 360px;
    height: 180px;
    margin: 10px 0 15px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: #FFFFFF;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border: 2px solid #EAEAEA;
}

.number-card {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 15px;
}

.number-display-text {
    font-family: var(--font-outfit);
    font-size: 3.8rem;
    font-weight: 700;
    color: var(--text-black);
    text-align: center;
    line-height: 1.1;
    letter-spacing: 1px;
    transition: transform 0.2s ease;
}

/* Cuando se muestran palabras en inglés (se adapta el tamaño si son frases largas) */
.number-display-text.word-mode {
    font-size: 1.7rem;
    line-height: 1.25;
    padding: 0 10px;
    font-family: var(--font-opensans);
    text-transform: capitalize;
    color: var(--primary-blue);
    letter-spacing: 0.5px;
    word-break: break-word;
}

.number-display-text.word-mode.word-mode-long {
    font-size: 1.35rem;
    line-height: 1.2;
}

/* Signos de interrogación de colores: azul, amarillo y verde */
.q-blue {
    color: var(--primary-blue);
}

.q-yellow {
    color: var(--primary-orange-yellow);
}

.q-green {
    color: var(--primary-green);
}

/* Botón flotante para repetir audio en modo auditivo */
.replay-audio-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 140, 206, 0.1);
    color: var(--primary-blue);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.2s ease;
}

.replay-audio-btn:active {
    transform: scale(0.9);
    background: rgba(0, 140, 206, 0.25);
}

.replay-audio-btn svg {
    width: 20px;
    height: 20px;
}

/* Feedback Overlay on Number Card */
.feedback-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.feedback-overlay.correct {
    background-color: rgba(102, 153, 51, 0.85); /* Verde */
}

.feedback-overlay.wrong {
    background-color: rgba(220, 53, 69, 0.85); /* Rojo */
}

.feedback-text {
    color: #FFFFFF;
    font-family: var(--font-opensans);
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    animation: feedback-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes feedback-pop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* --- GAME INPUT & KEYPAD SECTION --- */
.game-input-container {
    width: 100%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.input-wrapper {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
}

.game-answer-input {
    width: 100%;
    padding: 12px 50px 12px 18px;
    font-family: var(--font-opensans);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-black);
    background-color: #F8F9FA;
    border: 2px solid #E0E0E0;
    border-radius: 30px;
    outline: none;
    text-align: center;
    transition: border-color 0.25s, box-shadow 0.25s, background-color 0.25s;
}

.game-answer-input:focus {
    border-color: var(--primary-blue);
    background-color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(0, 140, 206, 0.15);
}

.btn-submit-answer {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    background-color: var(--primary-green);
    color: #FFFFFF;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
    box-shadow: 0 2px 8px rgba(102, 153, 51, 0.3);
}

.btn-submit-answer:active {
    transform: translateY(-50%) scale(0.92);
}

.btn-submit-answer svg {
    width: 20px;
    height: 20px;
}

/* --- TECLADO NUMÉRICO ESTILO TELÉFONO (0 debajo) --- */
.numeric-keypad {
    width: 100%;
    max-width: 290px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 6px 0;
    user-select: none;
}

.keypad-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.keypad-btn {
    flex: 1;
    height: 50px;
    border: none;
    border-radius: 14px;
    font-family: var(--font-outfit);
    font-size: 1.55rem;
    font-weight: 700;
    color: #FFFFFF;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease, filter 0.2s ease;
}

.keypad-btn:active {
    transform: scale(0.92);
    filter: brightness(0.9);
}

.keypad-btn svg {
    width: 22px;
    height: 22px;
}

/* TECLADO ROTATIVO DE COLOR (Un color por cada reactivo numérico: Azul, Verde, Amarillo) */
.numeric-keypad.theme-blue .keypad-btn {
    background-color: var(--primary-blue);
}

.numeric-keypad.theme-green .keypad-btn {
    background-color: var(--primary-green);
}

.numeric-keypad.theme-yellow .keypad-btn {
    background-color: var(--primary-orange-yellow);
}

/* Botones especiales del teclado numérico */
.numeric-keypad .keypad-btn-backspace {
    background-color: #757575 !important;
}

.numeric-keypad .keypad-btn-enter {
    background-color: var(--primary-green) !important;
}

/* --- GAME TIME 2: ANALOG & DIGITAL CLOCK STYLES --- */
.gt2-container {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.gt2-prompt-banner {
    width: 100%;
    background: #FFFFFF;
    border-radius: 16px;
    padding: 12px 18px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    border: 2px solid #EAEAEA;
    text-align: center;
}

.gt2-prompt-text {
    font-family: var(--font-opensans);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin: 0;
    text-transform: capitalize;
}

.gt2-clock-card {
    width: 250px;
    height: 250px;
    position: relative;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    background: #FFFFFF;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gt2-analog-clock {
    width: 100%;
    height: 100%;
    touch-action: none; /* Prevenir scroll al mover la manecilla */
    user-select: none;
    -webkit-user-select: none;
}

/* Esferas del reloj */
.clock-face {
    fill: #FFFFFF;
    stroke: var(--primary-blue);
    stroke-width: 7;
}

.clock-inner-rim {
    fill: none;
    stroke: #F0F4F8;
    stroke-width: 2;
}

.clock-tick {
    stroke: #B0B0B0;
    stroke-width: 1.5;
    stroke-linecap: round;
}

.clock-tick.hour-tick {
    stroke: var(--text-black);
    stroke-width: 3.5;
}

.clock-number {
    font-family: var(--font-outfit);
    font-size: 17px;
    font-weight: 700;
    fill: var(--text-black);
    text-anchor: middle;
    dominant-baseline: central;
}

/* Manecillas */
.clock-hand {
    stroke-linecap: round;
    pointer-events: none;
}

.clock-hour-hand {
    stroke: var(--text-black);
    stroke-width: 6;
    pointer-events: none;
}

.clock-minute-hand {
    stroke: var(--primary-blue);
    stroke-width: 5;
    pointer-events: none;
}

.clock-minute-knob {
    fill: var(--primary-orange-yellow);
    stroke: #FFFFFF;
    stroke-width: 2.5;
    pointer-events: none; /* Toda la superficie del reloj es interactiva táctilmente */
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.25));
    transform-origin: 130px 40px;
    animation: knob-pulse 1.8s infinite ease-in-out;
}

/* Efecto pulse a la bolita al final del minutero para indicar que es móvil */
@keyframes knob-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.35);
    }
    100% {
        transform: scale(1);
    }
}

.clock-pin-outer {
    fill: var(--primary-blue);
}

.clock-pin-inner {
    fill: #FFFFFF;
}

/* Reloj Digital */
.gt2-digital-clock-container {
    background: #F4F6F8;
    border-radius: 14px;
    padding: 6px 24px;
    border: 2px solid #E2E8F0;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-top: 2px;
}

.gt2-digital-time {
    font-family: var(--font-outfit);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-black);
    letter-spacing: 2px;
}

/* Modo A y Modo B controles */
.gt2-mode-a-container, .gt2-mode-b-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.gt2-instruction-text {
    font-family: var(--font-opensans);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-black);
    margin: 0;
}

.gt2-drag-hint {
    font-family: var(--font-opensans);
    font-size: 0.92rem;
    color: var(--text-grey);
    margin: 0;
    font-weight: 600;
}

.gt2-submit-btn {
    width: 100%;
    padding: 12px 24px;
    font-size: 1.15rem;
    background-color: var(--primary-green) !important;
    box-shadow: 0 4px 15px rgba(102, 153, 51, 0.35);
}

#game-over-screen {
    z-index: 25;
    justify-content: flex-start;
    padding: 20px 20px 110px 20px;
    background-color: var(--bg-white);
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.5s ease-in-out;
}

#game-over-screen.active {
    opacity: 1;
    pointer-events: auto;
}

.game-over-header {
    text-align: center;
    margin-top: 15px; /* Reduced from 40px */
    margin-bottom: 5px; /* Reduced from 20px */
}

.unit-subtitle {
    color: var(--text-black);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.unit-title-grey {
    color: var(--text-grey);
    font-size: 1.1rem;
}

.score-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px; /* Reduced from 10px */
    margin: 5px 0; /* Reduced from 20px */
    padding: 10px; /* Reduced from 20px */
}

.large-logo {
    width: 230px;
    height: auto;
    margin-top: 0px;
    margin-bottom: 5px;
}

.game-time-label {
    color: var(--primary-blue);
    font-size: 1.3rem;
    font-weight: 700;
}

.final-score-label {
    color: var(--text-grey);
    font-weight: 700;
    font-size: 1.2rem;
}

.score-result {
    color: var(--primary-blue);
    font-size: 2.5rem;
    font-weight: 700;
}

/* Pulse animation helper for score container */
.score-card.pulse {
    will-change: transform;
}

#game-over-screen.active .score-card.pulse {
    animation: pulse-animation-light 2s infinite ease-in-out;
}

@keyframes pulse-animation-light {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

.game-over-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 320px;
    margin-top: 0px; /* Reduced from 5px */
}

.whatsapp-instruction {
    color: var(--text-grey);
    font-size: 0.95rem;
    text-align: center;
    margin-bottom: 5px; /* Reduced margin */
}

.action-btn {
    width: 100%;
    padding: 12px 20px; /* Slightly reduced padding */
    border: none;
    border-radius: 50px;
    color: white;
    font-family: var(--font-opensans);
    font-size: 1.1rem; /* Slightly reduced font size */
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    text-decoration: none; /* In case of anchor tags */
    box-sizing: border-box;
}

.btn-green { background-color: var(--primary-green); }
.btn-yellow { background-color: var(--primary-orange-yellow); }
.btn-blue { background-color: var(--primary-blue); }
.btn-grey { background-color: var(--text-grey); }

/* --- REVIEW MISTAKES SCREEN --- */
#review-screen {
    z-index: 30;
    justify-content: flex-start;
    padding: 40px 20px;
    background-color: var(--bg-white);
}

.review-title {
    color: var(--text-black);
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.mistakes-list {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    flex-grow: 1;
    margin-bottom: 20px;
}

.mistake-item {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #eeeeee;
}

.mistake-number {
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 3px;
    font-size: 0.95rem;
}

.mistake-user-answer {
    color: var(--text-black);
    font-size: 0.95rem;
}

.mistake-correct-answer {
    color: var(--primary-green);
    font-weight: 700;
    font-size: 0.95rem;
}

/* Resumen de niveles repetidos en la pantalla final */
.level-repeat-summary {
    font-family: var(--font-opensans);
    color: var(--text-grey);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    margin-top: 8px;
    padding: 0 10px;
    line-height: 1.4;
}

/* Modal de Feedback Instantáneo al Equivocarse */
.mistake-card {
    background-color: var(--bg-white);
    padding: 28px 22px 22px 22px;
    border-radius: 20px;
    width: 90%;
    max-width: 360px;
    text-align: center;
    position: relative;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mistake-card-title {
    font-family: var(--font-opensans);
    color: #DC3545;
    font-size: 1.35rem;
    font-weight: 700;
}

.mistake-detail-box {
    background-color: #F8F9FA;
    border: 1px solid #EAEAEA;
    border-radius: 12px;
    padding: 10px 14px;
    text-align: left;
}

.mistake-label {
    font-family: var(--font-opensans);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-grey);
    margin-bottom: 4px;
}

.mistake-diff-text {
    font-family: var(--font-opensans);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-black);
    word-break: break-word;
}

.mistake-correct-text {
    font-family: var(--font-opensans);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-green);
    word-break: break-word;
}

.mistake-alt-container {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #D0D0D0;
}

.mistake-alt-label {
    font-family: var(--font-opensans);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-grey);
    margin-bottom: 4px;
}

.mistake-alt-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mistake-alt-list li {
    font-family: var(--font-opensans);
    font-size: 0.95rem;
    font-weight: 600;
    color: #2e7d32;
    background-color: rgba(46, 125, 50, 0.08);
    padding: 4px 8px;
    border-radius: 6px;
}

/* Modal de Notificación de Respuestas Alternativas Correctas en GT2 */
.gt2-alt-card {
    background-color: var(--bg-white);
    padding: 24px 20px 20px 20px;
    border-radius: 20px;
    width: 90%;
    max-width: 360px;
    text-align: center;
    position: relative;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gt2-alt-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: rgba(102, 153, 51, 0.12);
    color: var(--primary-green);
    padding: 8px 16px;
    border-radius: 50px;
    align-self: center;
}

.gt2-alt-badge svg {
    width: 24px;
    height: 24px;
}

.gt2-alt-badge span {
    font-family: var(--font-outfit);
    font-size: 1.3rem;
    font-weight: 800;
}

.gt2-alt-content {
    background-color: #F8F9FA;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    padding: 12px 14px;
    text-align: left;
}

.gt2-alt-title {
    font-family: var(--font-opensans);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-grey);
    margin-bottom: 8px;
}

.gt2-alt-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gt2-alt-list li {
    font-family: var(--font-opensans);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-blue);
    background-color: rgba(0, 140, 206, 0.08);
    padding: 6px 10px;
    border-radius: 8px;
    border-left: 3px solid var(--primary-blue);
}

/* Resaltado específico en rojo de los errores */
.diff-error-char, .diff-error-word {
    color: #DC3545 !important;
    background-color: rgba(220, 53, 69, 0.15);
    padding: 1px 3px;
    border-radius: 4px;
    text-decoration: underline;
    font-weight: 800;
}

/* Modal de Review Mistakes con botón X */
.review-modal-card {
    background-color: var(--bg-white);
    padding: 24px 20px 20px 20px;
    border-radius: 20px;
    width: 92%;
    max-width: 400px;
    max-height: 85vh;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    position: relative;
}

.review-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ECECEC;
}

.review-modal-title {
    font-family: var(--font-opensans);
    font-size: 1.35rem;
    color: var(--text-black);
    font-weight: 700;
}

.modal-close-x {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-grey);
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 50%;
    transition: color 0.15s, background-color 0.15s;
}

.modal-close-x:hover {
    color: #000000;
    background-color: #F0F0F0;
}

.review-mistakes-list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 6px 2px 14px 2px;
    flex-grow: 1;
    max-height: 52vh;
}

/* Exit Confirmation Modal Card */
.confirm-modal-card {
    background: #FFFFFF;
    border-radius: 24px;
    width: 90%;
    max-width: 380px;
    padding: 30px 24px 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

.confirm-modal-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background-color: rgba(0, 140, 206, 0.1);
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.confirm-modal-icon svg {
    width: 30px;
    height: 30px;
}

.confirm-modal-title {
    font-family: var(--font-opensans);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-black);
    line-height: 1.35;
    margin-bottom: 8px;
}

.confirm-modal-subtitle {
    font-family: var(--font-opensans);
    font-size: 0.9rem;
    color: var(--text-grey);
    margin-bottom: 22px;
}

.confirm-modal-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
}

.confirm-modal-buttons .action-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 1.05rem;
}

