/* --- VARIABLES Y CONFIGURACIÓN BASE --- */
:root {
    --bg: #020617;
    --panel: #1e293b;
    --green: #22c55e;
    --blue: #3b82f6;
    --gold: #fbbf24;
    --text: #f8fafc;
    --danger: #ef4444;
}
/* --- BANNER BETA (PUESTO AL PRINCIPIO PARA EVITAR ERRORES) --- */
.beta-banner {
    display: block !important;
    width: 100% !important;
    background-color: #002B5B !important; /* Azul oscuro sólido */
    background-image: linear-gradient(90deg, #002B5B, #0093D0) !important;
    color: #ffffff !important;
    text-align: center !important;
    padding: 12px 0 !important;
    border-bottom: 3px solid #F47920 !important;
    position: relative !important;
    z-index: 9999 !important;
}

.beta-content {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 15px !important;
    margin: 0 auto !important;
}

.beta-content p {
    color: #ffffff !important;
    margin: 0 !important;
    font-size: 14px !important;
    font-family: sans-serif !important;
}

.beta-content strong {
    color: #fbbf24 !important; /* Amarillo oro */
    font-weight: bold !important;
}

.beta-tag {
    background: rgba(255, 255, 255, 0.2) !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
    font-size: 10px !important;
    color: white !important;
}
/* Solo cambiamos el fondo de la página, el resto de estilos se mantienen */
body:not(.fullscreen-mode) {
    background-color: #F7F9FB !important;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, sans-serif;
    min-height: 100vh;
    overflow-x: hidden; /* Permite scroll vertical pero no horizontal */
}

/* --- CABECERA PC (INDEX.HTML) --- */
.main-header {
    background-color: #F7F9FB !important;
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-bottom: 1px solid #e0e4e8;
}

/* OCULTAMOS el logo de móvil en PC */
.logo-mobile {
    display: none;
}

/* El logo de PC (Símbolo + Texto) */
.logo-pc {
    display: flex;
    align-items: center;     
    gap: 20px;
}

.logo-icon {
    height: 90px;
    width: auto;
}

.logo-text-img {
    height: 65px;
    width: auto;
}

.header-right {
    position: absolute;      
    right: 80px;
    top: 50%;
    transform: translateY(-50%); 
}

/* Estilo del botón (ajustado a tus colores de logo) */
.btn-auth {
    background-color: #002B5B; /* Azul oscuro del logo */
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.btn-auth:hover {
    background-color: #0093D0; /* Celeste del logo al pasar el ratón */
}

/* IMPORTANTE: Quitar márgenes por defecto del body */
body {
    margin: 0;
    padding: 0;
}

/* Busca .game-display-area y déjalo así */
.game-display-area {
    background: #000;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    height: 85vh;
    border: 1px solid #1e293b;
    display: flex; /* Cambiamos a flex */
    justify-content: center; /* Centra el juego */
    align-items: center;
    padding: 0 250px; /* IMPORTANTE: Esto crea un "muro" de 250px a los lados para que los paneles no choquen con el cuerpo */
}

/* Ajusta los paneles para que se queden en su sitio */
#timer-wrapper {
    position: absolute;
    left: 40px; /* Lo pegamos a la izquierda del área negra */
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}
/* --- 1. PANEL DERECHO: ESTRUCTURA FLEXBOX --- */
#game-container-full {
    position: relative; /* Mantén esto, es correcto */
    width: 100%;
    height: 100vh;
    overflow: hidden;
}
/* El panel padre */
/* --- 1. PANEL DERECHO (ESTÁNDAR PC) --- */
.ui-panel-right {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 250px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    z-index: 100;
    height: auto;
    min-height: 300px;
}

/* Contenedor interno para asegurar el orden */
.panel-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 15px;
    pointer-events: none; /* Los textos no bloquean clics */
}

/* --- 2. OBJETIVO (SIEMPRE DENTRO, SIN FONDO) --- */
#objetivo {
    width: 100%;
    text-align: center;
    font-size: 20px;
    color: #FFD700;
    font-weight: bold;
    background: transparent !important; /* Sin fondo en NINGÚN caso */
    position: static !important;        /* Fuerza a estar siempre en el flujo */
    margin: 5px 0;
    pointer-events: none;               /* Ignora clics para que no moleste */
}

/* --- 3. BOTONES (SIEMPRE CLICKEABLES) --- */
.panel-buttons-row {
    pointer-events: auto; /* Reactiva clics aquí */
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-reset {
    pointer-events: auto;
    cursor: pointer;
}
@media (max-width: 850px) {
    /* 1. Barra superior fija y compacta */
    .ui-panel-right {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 60px !important;
        
        display: flex !important;
        flex-direction: column !important; /* Columna para que todo entre sin pisarse */
        justify-content: center !important;
        align-items: center !important;
        padding: 5px !important;
        
        background: rgba(0, 43, 91, 0.95) !important;
        border-radius: 0 !important;
        z-index: 1000 !important;
    }

    /* 2. Contenedor de textos en una fila interna */
    .panel-content-wrapper {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        gap: 10px !important;
    }

    /* 3. Ordenamos visualmente */
    .label, #puntos { order: 1; font-size: 10px !important; }
    #objetivo { order: 2; font-size: 14px !important; color: #FFD700 !important; font-weight: bold; flex: 1; text-align: center; }
    #vidas-wrapper, #progreso-texto { order: 3; font-size: 10px !important; }

    /* 4. BOTONES: Los mantenemos en su sitio abajo pero compactos */
    .panel-buttons-row {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        gap: 10px !important;
        margin-top: 5px !important;
        pointer-events: auto !important;
    }
    
    .btn-reset {
        padding: 5px 10px !important;
        font-size: 10px !important;
    }
}
/* --- CONFIGURACIÓN ESPECÍFICA: MODO ESQUELETO EN MÓVIL --- */
@media (max-width: 850px) {
    /* 1. OBJETIVO FUERA DEL PANEL (FLOTANDO ARRIBA) */
    /* 1. OBJETIVO EN MODO ESQUELETO (MÓVIL) */
body.modo-esqueleto #objetivo {
    position: fixed !important;
    top: 10px !important;            /* Pegado al borde superior */
    left: 10px !important;           /* Margen izquierdo */
    right: 90px !important;          /* ¡ESTO ES LA CLAVE! Se detiene antes del panel (80px ancho panel + 10px margen) */
    
    transform: none !important;      /* Quitamos el centrado absoluto */
    background: transparent !important;
    color: #FFD700 !important;
    font-weight: bold;
    font-size: 14px !important;
    
    text-align: left !important;     /* Alineado a la izquierda */
    z-index: 999 !important;
    pointer-events: none !important;
}

/* 2. PANEL LATERAL (Ajustamos para que sea columna limpia) */
body.modo-esqueleto .ui-panel-right {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    width: 80px !important;          /* Ancho fijo para que no moleste */
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important; /* Centra los elementos verticalmente */
    align-items: center !important;
    padding: 10px 0 !important;
    background: rgba(0, 43, 91, 0.9) !important;
    border-radius: 10px 0 0 10px !important;
    z-index: 1000 !important;
}
/* --- CONFIGURACIÓN ESPECÍFICA PARA MODO CRÁNEO --- */
@media (max-width: 850px) {
    /* 1. La barra superior en modo cráneo */
    body.modo-craneo .ui-panel-right {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 50px !important; 
        background: rgba(0, 43, 91, 0.95) !important;
        border-radius: 0 !important;
        z-index: 1000 !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
    }

    /* 2. Botones abajo en modo cráneo */
    body.modo-craneo .panel-buttons-row {
        position: fixed !important;
        bottom: 15px !important;
        left: 0 !important;
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        gap: 15px !important;
        z-index: 1001 !important;
        pointer-events: auto !important;
    }
}
/* --- AJUSTE PARA MÓVIL EN HORIZONTAL (LANDSCAPE) --- */
@media (max-width: 900px) and (orientation: landscape) {
    /* 1. Barra superior mucho más fina */
    .ui-panel-right {
        height: 35px !important; /* Más delgada para ganar espacio de juego */
        padding: 0 5px !important;
        font-size: 10px !important;
    }

    .panel-content-wrapper {
        gap: 5px !important;
    }

    /* 2. Botones más pequeños y en fila para no tapar el juego */
    .panel-buttons-row {
        position: fixed !important;
        bottom: 5px !important;
        right: 5px !important;
        width: auto !important; /* Que ocupen solo lo necesario */
        flex-direction: row !important;
        gap: 5px !important;
    }

    .btn-reset {
        padding: 2px 8px !important;
        font-size: 8px !important;
    }

    /* 3. Ajuste de textos para que no se corten */
    #objetivo {
        font-size: 12px !important;
    }
}

    /* 3. ORDEN EN COLUMNA */
    body.modo-esqueleto .panel-content-wrapper {
        flex-direction: column !important;
        gap: 10px !important;
    }

    /* Aseguramos los textos pequeños */
    body.modo-esqueleto .label, 
    body.modo-esqueleto .value, 
    body.modo-esqueleto #vidas-wrapper, 
    body.modo-esqueleto .progress-value {
        font-size: 10px !important;
        text-align: center !important;
        width: 100% !important;
    }

    /* 4. BOTONES EN COLUMNA ABAJO */
    body.modo-esqueleto .panel-buttons-row {
        flex-direction: column !important;
        gap: 5px !important;
        margin-top: 10px !important;
    }
}
.label { font-size: 12px; letter-spacing: 2px; color: #94a3b8; font-weight: 800; }
.value { font-size: 42px; font-weight: 900; color: var(--blue); }
.target-name { font-size: 22px; font-weight: 900; color: var(--gold); text-transform: uppercase; }
.progress-value { font-size: 24px; font-weight: 900; color: var(--green); }
.btn-reset { background: var(--danger); color: white; border: none; padding: 12px; border-radius: 12px; font-weight: bold; cursor: pointer; }

/* Animación del Timer */
@keyframes blink-red { 0% { opacity: 1; } 50% { opacity: 0.2; } 100% { opacity: 1; } }
.blink-active { animation: blink-red 0.5s infinite; }
#timer-text { font-size: 22px; font-weight: 900; }
.timer-container { width: 12px; height: 100%; background: #0f172a; border-radius: 10px; overflow: hidden; position: relative; }
#timer-bar { width: 100%; height: 100%; background: var(--green); position: absolute; bottom: 0; transition: height 0.3s ease; }

/* --- SECCIONES DE CONTENIDO (CARTAS Y RANKING) --- */

/* Esta regla crea el "muro" de aire a los lados y centra todo en PC */
.game-menu-section, 
.popular-section, 
.ranking-footer-section {
    max-width: 1250px;
    margin: 0 auto;
    padding: 0 60px; /* Esto es el aire que quieres proteger */
}

.game-menu-section h2, .popular-section h2, .ranking-footer-section h2 {
    font-size: 32px; 
    margin-bottom: 30px; 
    color: var(--blue);
    padding-left: 10px; /* Alinea el título con las tarjetas */
}

.menu-grid, .popular-grid { 
    display: flex; 
    flex-direction: row; /* <--- IMPORTANTE: Aseguramos horizontalidad */
    gap: 40px;
    margin-bottom: 60px; 
    justify-content: center; /* Centra las tarjetas si hay pocas */
}

.menu-card, .popular-card {
    flex: 1;
    max-width: 350px;    /* Evita que las tarjetas sean gigantes en pantallas anchas */
    background: #1e293b;
    padding: 40px 25px;  /* Más espacio dentro de la tarjeta */
    border-radius: 20px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s, background 0.3s, border-color 0.3s;
    border: 2px solid #334155;
}

.menu-card:hover, .popular-card:hover { transform: translateY(-5px); background: #334155; }
.menu-card.active { border-color: var(--blue); box-shadow: 0 0 15px rgba(59, 130, 246, 0.3); }
.menu-card.pending { opacity: 0.5; cursor: not-allowed; }

.ranking-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.rank-col { 
    background: #1b263b; /* Un tono azulado muy profesional */
    padding: 20px; 
    border-radius: 12px; 
}

.rank-col h3 { 
    color: #fbbf24; /* Dorado */
    text-align: center;
    border-bottom: 2px solid #2d3e5e;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.rank-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #2d3e5e;
}

.r-name {
    color: #e2e8f0;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.r-pts {
    color: #4ade80; /* Verde */
    font-weight: bold;
    font-family: 'Courier New', monospace; /* Alineación perfecta */
    margin-left: 15px;
}

/* --- MODALES --- */
/*
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}
*/

/* Pantalla Final Estilo Vercel */
.final-screen {
    background: #111827 !important; /* Azul muy oscuro de Vercel */
    border: 2px solid #3b82f6 !important;
    border-radius: 40px !important;
    padding: 50px !important;
    text-align: center;
    min-width: 450px;
}

.final-screen h1 {
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 30px;
    color: white;
}

.results-horizontal {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 30px;
}

.res-inline {
    font-size: 14px;
    font-weight: 800;
    color: #94a3b8;
}

.res-inline span {
    color: white;
    font-size: 20px;
    margin-left: 5px;
}

.bonus-block {
    margin-bottom: 20px;
}

.label-final {
    font-size: 14px;
    font-weight: 700;
    color: #94a3b8;
    margin: 5px 0;
}

.bonus-number {
    font-size: 24px;
    font-weight: 800;
    color: white;
    display: block;
}

.total-huge-number {
    font-size: 110px; /* El tamaño gigante de tu captura */
    font-weight: 950;
    color: #fbbf24; /* El amarillo/oro de Vercel */
    line-height: 1;
    display: block;
    margin: 10px 0 30px 0;
}

/* El botón verde exacto */
.btn-final-green {
    background: #22c55e !important;
    color: white;
    border: none;
    padding: 20px 60px;
    border-radius: 20px;
    font-size: 22px;
    font-weight: 900;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s;
}

.btn-final-green:hover {
    transform: scale(1.03);
    background: #16a34a !important;
}

.btn-final-red {
    background-color: var(--danger); /* O el rojo que uses */
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
/* --- PIE LEGAL, ADS Y COOKIES --- */

/* Contenedor de Publicidad Lateral */
.ads-sidebar-left { 
    background: #070a13; 
    border-radius: 15px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    padding: 20px 10px; 
}

.ad-label { 
    font-size: 10px; 
    color: #475569; 
    margin-bottom: 10px; 
    font-weight: bold; 
    letter-spacing: 1px;
}

/* Pie de página (Footer) */
.legal-subfooter {
    background: #070a13; /* Mantenemos tu color oscuro */
    padding: 60px 20px;
    text-align: center;
    border-top: 1px solid #1e293b;
    margin-top: 60px;
}

.legal-subfooter p {
    color: #94a3b8; /* Gris claro para el copyright */
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.legal-subfooter p strong {
    color: #f8fafc; /* Nombres David y Coral en blanco */
}

.legal-nav { 
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.legal-nav a { 
    color: #64748b; 
    text-decoration: none; 
    font-size: 14px; 
    transition: color 0.3s ease;
}

.legal-nav a:hover { 
    color: var(--blue); /* Usa tu variable azul */
    text-decoration: underline;
}

/* BANNER DE COOKIES (Diseño oscuro para que combine) */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: #1e293b; /* Un gris azulado oscuro */
    border: 1px solid #334155;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    padding: 20px;
    z-index: 99999;
    border-radius: 16px;
    display: none; /* Se activa por JS */
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cookie-content p {
    color: #e2e8f0;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
}

.cookie-content a {
    color: var(--blue);
    text-decoration: underline;
}

.btn-cookies {
    background: var(--blue);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    transition: transform 0.2s ease;
    white-space: nowrap;
}

.btn-cookies:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Ajuste móvil para el banner */
@media (max-width: 768px) {
    .cookie-banner {
        position: fixed;
        bottom: 0 !important; /* Pegado abajo del todo */
        left: 0 !important;
        right: 0 !important;
        padding: 15px !important;
        border-radius: 16px 16px 0 0 !important; /* Solo bordes redondeados arriba */
        margin: 0 !important; /* Eliminamos márgenes que causan scroll */
    }
    
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .btn-cookies {
        width: 100%;
        margin-top: 5px;
    }
}
/* --- OVERLAY DE MENÚ INICIAL --- */
#menu-overlay {
    position: absolute;
    width: 100%; height: 100%;
    background: var(--bg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

#menu-overlay h2 { font-size: 32px; color: white; }
/* Esta clase solo se aplicará cuando estemos jugando */
.modo-juego {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    align-items: center;
    justify-content: center;
}

/* Esto solo se activa en juego.html */
body.fullscreen-mode {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden; /* Bloquea el scroll para que el juego esté fijo */
    justify-content: center;
    align-items: center;
}
/* Estilos para Toasts */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease-out, fadeOut 0.5s ease-in 2.5s forwards;
    border-left: 4px solid #4CAF50; /* Verde por defecto */
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    to { opacity: 0; visibility: hidden; }
}

body.fullscreen-mode #timer-wrapper {
    position: fixed;
    left: 60px;
    top: 50%; /* Lo lleva al centro */
    transform: translateY(-50%); /* Lo centra exactamente */
    height: 70vh; /* Altura proporcional a la pantalla */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    z-index: 100;
}

body.fullscreen-mode .ui-panel-right {
    position: fixed;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    width: 260px;
    height: 80vh;
    background: var(--panel);
    border-radius: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Botones siempre abajo */
    padding: 50px 25px;
    box-sizing: border-box;
    text-align: center;
    box-shadow: -10px 10px 40px rgba(0,0,0,0.6);
    z-index: 100;
}

/* Nueva caja para agrupar los textos */
.panel-content {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Controla la distancia entre Puntos, Objetivo y Vidas */
    width: 100%;
}

#objetivo {
    font-size: 22px;
    color: #FFD700;
    font-weight: bold;
    padding: 10px;
    background: rgba(255,255,255,0.05); /* Le da un toque visual */
    border-radius: 10px;
}

body.fullscreen-mode .game-viewport {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 150px;  /* Margen de seguridad izquierda */
    margin-right: 320px; /* Margen de seguridad derecha */
    height: 100vh;
}

body.fullscreen-mode #svg-container svg {
    max-height: 85vh; /* Evita que el cráneo toque el borde superior/inferior */
    width: auto;
}
/* --- CONFIGURACIÓN PARA ACTIVAR LOS CLICS EN EL JUEGO --- */

/* 1. Desbloquea el contenedor principal */
#svg-container, .game-viewport {
    pointer-events: auto !important;
}

/* 2. Desbloquea el SVG para que el ratón lo detecte */
#svg-container svg {
    pointer-events: auto !important;
}

/* Esto permite jugar pero MANTIENE LA CRUZ gracias a la regla anterior */
svg [id] {
    pointer-events: auto !important;
    /* No pongas cursor: pointer aquí */
}

/* 4. Asegura que nada invisible esté tapando el juego */
#menu-overlay, .modal {
    pointer-events: none;
}
#menu-overlay[style*="display: flex"], 
.modal[style*="display: flex"] {
    pointer-events: auto; /* Solo bloquea cuando están visibles */
}
/* CURSOR DE PRECISIÓN SOLO PARA EL JUEGO */
body.fullscreen-mode, 
body.fullscreen-mode * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><line x1="12" y1="0" x2="12" y2="24" stroke="%23ffffff" stroke-width="2"/><line x1="0" y1="12" x2="24" y2="12" stroke="%23ffffff" stroke-width="2"/></svg>') 12 12, crosshair !important;
}

/* EXCEPCIÓN: Si quieres que los BOTONES de reiniciar/salir sí muestren la mano para saber que se pueden pulsar */
body.fullscreen-mode .btn-reset, 
body.fullscreen-mode .btn-final-green {
    cursor: pointer !important;
}

/* PEGALO AQUÍ (Fuera del bloque media para que funcione en PC) */
.menu-card {
    transition: all 0.3s ease;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 43, 91, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: #1e293b; /* Color oscuro por defecto */
}

.menu-card:hover {
    transform: translateY(-10px);
    border-color: #F47920 !important; /* Naranja del logo */
    box-shadow: 0 10px 25px rgba(244, 121, 32, 0.2);
}

.menu-card i, .menu-card .icon {
    font-size: 40px;
    margin-bottom: 15px;
    color: #0093D0; /* Celeste del logo */
}

/* ============================================================
   CONFIGURACIÓN RESPONSIVE (MÓVIL Y TABLET) - TODO EN UNO
   ============================================================ */

@media (max-width: 1024px) {
  
  
    /* 1. Cabecera de la Home: Apilamos logo arriba y botón abajo */
    .main-header {
        height: auto !important;      /* Deja que crezca según el contenido */
        padding: 20px 10px !important;
        flex-direction: column !important; 
        gap: 20px;                    /* Espacio entre logo y botón */
    }

    /* 2. Contenedor del Logo: Mantenemos el formato horizontal que te gusta */
    .logo-horizontal {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 15px;                    /* Un poco menos de espacio entre piezas */
        width: 100%;
    }

    /* 3. Ajuste de tamaños para que quepa en el ancho del móvil */
    .logo-icon {
        height: 60px !important;      /* El círculo más pequeño para móvil */
        width: auto;
    }

    .logo-text-img {
        height: 45px !important;      /* Las letras se ajustan para ser legibles */
        width: auto;
    }

    /* 4. Botón de Registro: Centrado y bien grande para el dedo */
    .header-right {
        position: static !important;  /* Deja de estar anclado a la derecha */
        transform: none !important;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .btn-auth {
        width: 90%;                   /* Casi todo el ancho del móvil */
        max-width: 300px;
        padding: 15px !important;     /* Más fácil de pulsar */
        text-align: center;
    }
    /* --- 2. PÁGINA DE INICIO (MENÚS) --- */
    body:not(.fullscreen-mode) {
        background-color: #F7F9FB !important;
        overflow-y: auto !important;
    }

    .game-menu-section h2 {
        font-size: 24px !important;
        text-align: center;
        margin-top: 30px;
        color: #002B5B;
    }

    .menu-grid, .popular-grid {
        flex-direction: column !important;
        align-items: center !important;
        padding: 20px !important;
        gap: 20px;
    }

    .menu-card, .popular-card {
        width: 90% !important;
        max-width: 350px !important;
        background: #002B5B !important; 
        border: 2px solid #0093D0 !important;
        margin-bottom: 10px;
        padding: 30px 20px !important;
    }

    .ranking-columns {
        grid-template-columns: 1fr !important;
        padding: 15px !important;
    }

    /* --- 3. MODO JUEGO (CRÁNEO/ESQUELETO) --- */
     body.fullscreen-mode .main-header {
        display: none !important; /* Ganamos espacio vertical */
    }

    body.fullscreen-mode .game-viewport {
        margin: 0 !important;
        padding: 0 !important;
        width: 100vw;
        height: 100vh;
    }

    /* Barra de puntos superior (HUD) */
    body.fullscreen-mode .ui-panel-right {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 75px !important;
        background: rgba(0, 43, 91, 0.95) !important;
        flex-direction: row !important;
        justify-content: space-around !important;
        align-items: center !important;
        padding: 5px 10px !important;
        border-radius: 0 !important;
        border: none !important;
        border-bottom: 2px solid #0093D0 !important;
        transform: none !important;
        box-shadow: 0 4px 10px rgba(0,0,0,0.5) !important;
    }

    /* Ajuste de textos en el HUD móvil */
    .target-name { font-size: 15px !important; color: #F47920 !important; order: 1; }
    #puntos { font-size: 22px !important; order: 2; }
    .label-vidas { font-size: 12px !important; order: 3; }

    /* Botones de control abajo */
    .panel-buttons-row {
        position: fixed !important;
        bottom: 20px !important;
        left: 0; right: 0;
        display: flex;
        justify-content: center;
        gap: 15px;
        z-index: 999;
    }

    .btn-reset {
        padding: 10px 20px !important;
        font-size: 13px !important;
    }

    /* Timer lateral */
    body.fullscreen-mode #timer-wrapper {
        left: 10px !important;
        top: 90px !important;
        height: 40vh !important;
        width: 15px !important;
        transform: none !important;
    }

    /* Ajuste del SVG para que no lo tape nada */
    body.fullscreen-mode #svg-container svg {
        max-width: 95vw;
        max-height: 70vh;
    }

    /* Modal Final */
    .final-screen {
        min-width: 90% !important;
        padding: 20px !important;
    }

    .total-huge-number { font-size: 60px !important; }
       /* AJUSTE AISLADO: El esqueleto ocupa el máximo espacio vertical posible */
    body.modo-esqueleto #svg-container svg {
        max-height: 98vh !important; /* De borde a borde superior/inferior */
        width: auto !important;
        margin: 0 auto;
        display: block;
    }
/* --- MODO ESQUELETO: MENÚ LATERAL DERECHO Y NOMBRE FLOTANTE --- */

    /* 1. Panel lateral derecho (Puntos y progreso) */
    body.modo-esqueleto .ui-panel-right {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: auto !important;
        width: 85px !important;
        height: 100vh !important;
        background: rgba(30, 41, 59, 0.9) !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-around !important; /* Espaciado uniforme ahora que no está el nombre */
        padding: 20px 5px !important;
        border-left: 2px solid var(--blue) !important;
        z-index: 1000;
        transform: none !important;
    }

    /* 2. NOMBRE DEL HUESO: FLOTANTE FUERA DEL MENÚ */
   body.modo-esqueleto .ui-panel-right .target-name {
        position: fixed !important;
        top: 8px !important; /* Más pegado al borde superior */
        right: 95px !important; 
        background: rgba(2, 6, 23, 0.9) !important;
        color: var(--gold) !important;
        padding: 6px 12px !important; /* Menos relleno para que sea más fina */
        border-radius: 8px !important;
        border: 1.5px solid var(--blue) !important;
        
        /* Tipografía más pequeña pero muy legible */
        font-size: 13px !important; 
        font-weight: 800 !important;
        text-align: center !important;
        
        z-index: 1100 !important;
        width: auto !important;
        max-width: 160px !important; /* Limitamos el ancho para que no crezca hacia el centro */
        white-space: normal !important; /* Si el nombre es muy largo, que baje a otra línea en vez de ensancharse */
        box-shadow: 0 4px 10px rgba(0,0,0,0.5) !important;
    }

    /* Textos del panel lateral */
    body.modo-esqueleto .ui-panel-right .label,
    body.modo-esqueleto .ui-panel-right .label-vidas {
        font-size: 9px !important;
        letter-spacing: 0;
    }

    body.modo-esqueleto .ui-panel-right .value, 
    body.modo-esqueleto .ui-panel-right #puntos {
        font-size: 20px !important;
        margin: 5px 0;
    }

    /* Botones apilados al final del panel derecho */
    body.modo-esqueleto .panel-buttons-row {
        position: relative !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
        padding: 0 !important;
    }

    body.modo-esqueleto .btn-reset {
        width: 75px !important;
        font-size: 9px !important;
        padding: 10px 2px !important;
        margin: 0 auto;
    }

    /* 3. EL ESQUELETO: Ajuste de área de juego */
    body.modo-esqueleto .game-viewport {
        margin-right: 85px !important;
        width: calc(100vw - 85px) !important;
        height: 100vh !important;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    body.modo-esqueleto #svg-container svg {
        max-height: 95vh !important;
        max-width: 100% !important;
    }

    /* 4. TIMER: Posición ajustada */
    body.modo-esqueleto #timer-wrapper {
        left: 40px !important;
        width: 12px !important; 
        z-index: 10;
    }

    body.modo-esqueleto #timer-text {
        font-size: 16px !important;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    }
}
/* Botón Rojo de Salida */
.btn-final-red {
    background-color: #e63946; /* Un rojo vibrante */
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 0 #b91c1c; /* Sombra para efecto 3D */
}

.btn-final-red:hover {
    background-color: #f87171;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #b91c1c;
}

.btn-final-red:active {
    transform: translateY(2px);
    box-shadow: 0 0 0 #b91c1c;
}
/* Contenedor principal del Quiz */
#quiz-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* La pregunta */
#pregunta-texto {
    color: white;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 50px;
    font-weight: bold;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
    line-height: 1.2;
}

/* Grid de 2x2 */
#opciones-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Dos columnas */
    gap: 25px; /* Espacio entre botones */
    width: 100%;
}

/* Estilo de los botones (Opciones) */
.btn-quiz-option {
    background: rgba(30, 41, 59, 0.7); /* Azul oscuro traslúcido */
    border: 2px solid #4A90E2;
    color: white;
    padding: 35px 20px;
    font-size: 1.4rem;
    font-weight: 600;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-quiz-option:hover {
    background: #4A90E2;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.4);
}

/* Estados de acierto y error */
.btn-quiz-option.correct {
    background-color: #2D5A27 !important; /* Verde oscuro */
    border-color: #4ade80 !important;
}

.btn-quiz-option.wrong {
    background-color: #7f1d1d !important; /* Rojo oscuro */
    border-color: #ef4444 !important;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    #opciones-grid {
        grid-template-columns: 1fr; /* Una columna en móvil */
        gap: 15px;
    }
    #pregunta-texto {
        font-size: 1.8rem;
    }
    .btn-quiz-option {
        padding: 20px;
    }
}
/* Contenedor del botón volver y título */
.header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    margin-top: 30px;
    width: 100%;
}

.btn-back {
    background: #334155;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    white-space: nowrap; /* Evita que el texto "VOLVER" se parta en dos líneas */
    transition: background 0.2s;
}

.btn-back:hover {
    background: #475569;
}

/* Ajuste móvil: si el título es muy largo, lo apilamos */
@media (max-width: 480px) {
    .header-breadcrumb {
        flex-direction: column; /* Apila el botón y el título en vertical */
        align-items: center;    /* Los centra */
        gap: 10px;
    }
    
    .header-breadcrumb h2 {
        font-size: 1.5rem !important;
        text-align: center;
    }
}
/* --- NUEVOS ESTILOS RANKING --- */
.ranking-section { padding: 40px 20px; max-width: 1200px; margin: 0 auto; }

.ranking-header { display: flex; align-items: center; gap: 20px; width: 100%; margin: 40px 0 30px 0; }
.ranking-header h2 { color: #4A90E2; font-size: 1.8rem; margin: 0; white-space: nowrap; }

.temporada-wrapper { cursor: pointer; position: relative; flex-grow: 1; }
.temporada-badge { background: #0f172a; color: #facc15; padding: 12px 20px; border-radius: 10px; border: 1px solid #334155; font-family: monospace; font-size: 1.1rem; font-weight: bold; text-align: center; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }

.info-desplegable { display: none; position: absolute; top: 55px; right: 0; width: 300px; background: white; color: #333; padding: 20px; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.3); z-index: 100; border: 1px solid #ddd; }
.info-desplegable h4 { margin: 0 0 10px 0; color: #2D5A27; }
.info-desplegable ul { padding: 0; list-style: none; font-size: 0.9rem; line-height: 1.6; }
.info-desplegable li { display: flex; justify-content: space-between; }

.ranking-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.rank-card { background: #1e293b; color: white; padding: 25px; border-radius: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.rank-card.dark { background: #0f172a; border: 1px solid #334155; }
.rank-card h3 { border-bottom: 1px solid #334155; padding-bottom: 15px; margin-bottom: 15px; }
.gold-text { color: #facc15; }
.green-text { color: #4ade80; }
.rank-card ul { list-style: none; padding: 0; margin: 0; }

/* RESPONSIVE MÓVIL */
@media (max-width: 768px) {
    .ranking-header { flex-direction: column; text-align: center; }
    .ranking-grid { grid-template-columns: 1fr; }
    .info-desplegable { width: 90vw; right: 5%; }
}
/* RESET TOTAL PARA MÓVIL */
@media (max-width: 768px) {
    .ui-panel-right {
        /* Reset de todo lo que viene de PC */
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        transform: none !important;
        
        /* Definición de la barra pequeña */
        width: 100% !important;
        height: 50px !important; 
        min-height: 50px !important;
        padding: 0 10px !important;
        
        /* Flexbox plano */
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        
        /* Estética */
        background: rgba(0, 0, 0, 0.9) !important;
        border-radius: 15px 15px 0 0 !important;
        z-index: 9999 !important;
    }

    /* Forzamos que el contenido interno sea una fila plana */
    .panel-content-wrapper {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        gap: 5px !important;
        pointer-events: none !important;
    }

    /* Tamaño de todos los textos */
    #objetivo, #puntos, .value, .label, .label-vidas, .progress-value {
        font-size: 11px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Ocultar botones o reducirlos al mínimo si es necesario */
    .panel-buttons-row {
        display: none !important; 
    }
}
/* Clase base para los avatares pequeños del ranking */
.rank-avatar-slot {
    cursor: pointer;
    transition: transform 0.3s ease, z-index 0.3s;
    position: relative;
    z-index: 1;
}

/* Efecto al pasar el ratón (opcional) */
.rank-avatar-slot:hover {
    transform: scale(1.2);
}

/* Clase para cuando se "abre" o hace grande */
.rank-avatar-slot.active {
    transform: scale(3); /* Se hace 3 veces más grande */
    z-index: 100; /* Lo pone por encima de todo */
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
    border-radius: 50%;
}
.rank-avatar-slot {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.rank-avatar-slot.active {
    transform: scale(4); /* Un poquito más grande para que destaque */
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
/* Estilo del botón naranja */
.main-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* Izquierda, Logo (auto), Derecha */
    align-items: center;
    padding: 10px 20px;
    background: white;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

/* Columna Izquierda: Botón Aula */
.header-left {
    display: flex;
    justify-content: flex-start;
}

/* Columna Central: Logo */
.logo-container {
    display: flex;
    justify-content: center;
    cursor: pointer;
}

/* Columna Derecha: Registro/Perfil */
.header-right {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 600px) {
    .main-header {
        grid-template-columns: 1fr; /* Colapsa en una sola columna */
        gap: 15px;
        text-align: center;
    }
    .header-left, .header-right { justify-content: center; }
}

.btn-naranja {
    background-color: #FF8C00;
    color: white;
    padding: 10px 20px; /* Un poco más de cuerpo al botón */
    border-radius: 8px;
    font-weight: bold;
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-block;
}
.banner-estudio-container {
    background: linear-gradient(90deg, #2D5A27, #3e7a37); /* Verde marca */
    color: white;
    padding: 15px 20px;
    margin: 10px 0; /* Espacio superior e inferior */
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 800px;
}

.banner-icon { font-size: 1.5rem; }

.banner-text {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
}

.btn-banner-estudio {
    background: #FF8C00; /* Naranja marca */
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: background 0.3s;
}

.btn-banner-estudio:hover {
    background: #e07b00;
}

/* Responsivo para móviles */
@media (max-width: 600px) {
    .banner-content { flex-direction: column; text-align: center; }
}
/* --- Estilos para la Landing de Juegos (Video Landing) --- */
/* Corrección de legibilidad para las tarjetas del menú principal */
.menu-card h3 {
    color: #ffffff !important; /* Asegura que el título sea blanco y resalte */
    margin-top: 10px;
    font-size: 1.2rem;
}

.menu-card small, 
.menu-card p {
    color: #e2e8f0 !important; /* Cambia el subtítulo a un tono claro visible */
    font-size: 0.9rem;
    margin-top: 5px;
    display: block;
}

.menu-card .icon {
    font-size: 2.2rem;
}
/* Corrección global de legibilidad para tarjetas oscuras en el index */
.menu-card h3,
.popular-card h4,
.rank-card h3 {
    color: #ffffff !important;
}

.menu-card small, 
.menu-card p,
.popular-card .stats,
.rank-card ul li {
    color: #e2e8f0 !important;
}

.menu-card .icon {
    font-size: 2.2rem;
}
