:root {
    /* Colores Institucionales INE (Más vibrantes) */
    --ine-yellow: #FFD700;  /* Dorado brillante */
    --ine-blue: #003399;    /* Azul fuerte */
    --ine-red: #D32F2F;     /* Rojo intenso */
    
    /* Nueva Base Visual: Blanco Esmerilado */
    --glass-bg: rgba(255, 255, 255, 0.85); /* 85% opacidad para leer texto negro */
    --glass-border: rgba(255, 255, 255, 0.9);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    
    /* Tipografía */
    --text-color: #222222; /* Negro suave (menos cansado que el #000 puro) */
    --text-light: #555555;
    --font-main: 'Poppins', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-main);
    
    /* === NUEVO FONDO AZUL PROFUNDO (Tipo Zafiro Noche) === */
    /* Un gradiente radial que va de un azul intenso en el centro a casi negro en los bordes */
    background: radial-gradient(circle at center, #1034a6 0%, #020f2e 70%, #000000 100%);
    background-attachment: fixed; /* Mantiene el fondo fijo si hubiera scroll */
    background-size: cover;
    /* =================================================== */

    color: var(--text-color); 
    height: 100vh;
    overflow: hidden;
    /* Añadimos un color de fondo de seguridad por si el gradiente falla en algún navegador viejo */
    background-color: #000033; 
}

/* === EL NUEVO CRISTAL (Más blanco y sólido) === */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(15px); /* Más borroso el fondo */
    -webkit-backdrop-filter: blur(15px);
    border: 2px solid var(--glass-border); /* Borde blanco grueso */
    box-shadow: var(--glass-shadow);
    border-radius: 25px; /* Bordes más redondeados */
    color: var(--text-color); /* Forzar texto negro dentro */
}

/* Títulos principales */
h1, h2, h3 {
    color: var(--ine-blue); /* Los títulos en Azul INE */
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: none; /* Quitamos sombras negras sucias */
}
.glass-dark {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.1);
}

.hidden { display: none !important; }

/* === HEADER === */
.app-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    margin: 1rem;
    height: 80px;
}

.brand { display: flex; align-items: center; gap: 15px; font-weight: 900; font-size: 1.2rem; }
.brand .logo { height: 50px; }

.user-widget {
    display: flex;
    align-items: center;
    padding: 5px 20px;
    gap: 15px;
    cursor: pointer;
    transition: 0.3s;
}
.user-widget:hover { background: rgba(0,0,0,0.5); }
.user-score { color: var(--ine-yellow); font-weight: bold; font-size: 1.2rem; }

/* === MAIN CONTAINER === */
.main-stage {
    height: calc(100vh - 120px);
    padding: 0 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* === MENU CARDS === */
.hero-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
}

.card-game {
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s, background 0.3s;
}

.card-game:hover:not(.locked) {
    transform: translateY(-10px);
    background: rgba(255,255,255,0.2);
}

.card-game .icon { font-size: 4rem; margin-bottom: 1rem; color: var(--ine-yellow); }
.card-game.locked { opacity: 0.5; cursor: not-allowed; filter: grayscale(1); }

/* === LEVEL SELECTOR === */
.level-layout { width: 100%; height: 100%; display: flex; flex-direction: column; }
.level-header { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }

.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Más grandes */
    gap: 15px;
    width: 100%;
    max-height: 100vh;
    overflow-y: auto;
    padding: 80px 20px;
}

.level-btn {
    background: white; /* Tarjeta blanca */
    border: 2px solid #eee;
    color: var(--text-color);
    padding: 15px 10px;
    border-radius: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* Estado: Desbloqueado */
.level-btn.lvl-unlocked {
    border-color: var(--ine-blue);
    background: linear-gradient(to bottom, #fff, #f0f4ff);
}
.level-btn.lvl-unlocked i {
    color: var(--ine-blue);
    font-size: 1.5rem;
}
.level-btn.lvl-unlocked:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 51, 153, 0.2);
}

/* Estado: Completado */
.level-btn.lvl-completed {
    background: #e8f5e9;
    border-color: #2ecc71;
    color: #1b5e20;
}
.level-btn.lvl-completed i {
    color: #2ecc71;
}

/* Estado: Bloqueado */
.level-btn.lvl-locked {
    background: #f5f5f5;
    color: #999;
    opacity: 0.7;
    border: 2px dashed #ccc;
    cursor: not-allowed;
}
.level-btn i { font-size: 1.5rem; margin-bottom: 5px; }

/* Estados del nivel */
.lvl-locked { background: rgba(0,0,0,0.5); color: #888; pointer-events: none; }
.lvl-unlocked { background: rgba(255, 204, 0, 0.15); border: 2px solid var(--ine-yellow); }
.lvl-completed { background: rgba(46, 204, 113, 0.2); border: 2px solid #2ecc71; color: #2ecc71; }
.lvl-unlocked:hover { background: var(--ine-yellow); color: #000; }

/* === BOTONES === */
/* Botón Principal (Jugar / Continuar) */
.btn-primary {
    background: linear-gradient(135deg, var(--ine-yellow) 0%, #FFC107 100%);
    color: #000;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 800;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-transform: uppercase;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(255, 215, 0, 0.6);
}

/* Botones de Verdadero / Falso (Gigantes y claros) */
.game-controls {
    display: flex;
    gap: 20px;
    width: 100%;
    margin-top: 15px;
}

.btn-choice {
    flex: 1;
    padding: 20px;
    border: none;
    border-radius: 20px;
    font-size: 1.5rem;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    color: white; /* Texto blanco dentro del botón de color */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-shadow: 0 4px 0 rgba(0,0,0,0.2); /* Efecto 3D abajo */
}

.btn-choice.true {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}
.btn-choice.false {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.btn-choice:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(0,0,0,0.2);
}

.btn-choice:active {
    transform: translateY(2px);
    box-shadow: 0 0 0 rgba(0,0,0,0.2);
}
/* === GAME UI === */
.game-interface {
    width: 100%;
    max-width: 900px;
    padding: 2rem;
    display: grid;
    gap: 20px;
}
.game-header { display: flex; justify-content: space-between; align-items: center; }
.game-content { display: flex; gap: 20px; height: 300px; }

.image-box img { width: 100%; height: 100%; object-fit: contain; }
.question-box { flex: 1; display: flex; align-items: center; font-size: 1.5rem; }
.game-controls { display: flex; gap: 20px; }

/* === MODALES === */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex; justify-content: center; align-items: center;
    z-index: 999;
}
.modal-card { padding: 3rem; text-align: center; max-width: 400px; width: 90%; }
.modal-card input {
    width: 100%; padding: 15px; margin: 20px 0;
    background: rgba(255,255,255,0.1); border: 1px solid #fff;
    color: black; border-radius: 8px; text-align: center;
}

/* === RESULTADOS DEL JUEGO === */
#modal-result .modal-card {
    background: rgba(20, 20, 40, 0.95); /* Un poco más oscuro para leer bien */
    border: 2px solid var(--ine-yellow);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#modal-result h2 {
    font-size: 2rem;
    color: var(--ine-yellow);
    margin-bottom: 10px;
}

#modal-result p {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: white;
}

/* Animación de entrada */
@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.time-bar-container {
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.4); /* Fondo oscuro */
    border-radius: 10px;
    margin-bottom: 20px; /* Separación con la imagen */
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}

.time-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #00ff88, #00b862); /* Verde neón */
    border-radius: 10px;
    /* La transición suave es clave para que no se vea a saltos */
    transition: width 1s linear, background 0.5s ease;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5); /* Brillo */
}

/* === BOTONES DE NAVEGACIÓN MEJORADOS === */

/* 1. Botón SALIR (Dentro del juego) */
.btn-exit {
    background: rgba(255, 75, 75, 0.15); /* Rojo transparente sutil */
    border: 1px solid rgba(255, 75, 75, 0.5);
    color: #ffcccc;
    padding: 8px 16px;
    border-radius: 30px; /* Bordes muy redondos */
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-exit:hover {
    background: rgba(255, 75, 75, 0.8); /* Rojo intenso al tocar */
    color: white;
    transform: translateY(-2px); /* Se eleva un poco */
    box-shadow: 0 6px 15px rgba(255, 50, 50, 0.4); /* Resplandor rojo */
    border-color: transparent;
}

.btn-exit:active {
    transform: scale(0.95); /* Efecto de presión */
}

/* 2. Botón VOLVER (Flotante en el mapa) */
.btn-back-floating {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 100; /* Asegura que esté encima del mapa */
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
}

.btn-back-floating:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    transform: translateX(5px); /* Se mueve un poco a la derecha invitando a salir */
}

.btn-back-floating i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.btn-back-floating:hover i {
    transform: translateX(-3px); /* La flecha se mueve un poco a la izquierda */
}
/* === SALÓN DE LA FAMA === */
.large-modal {
    max-width: 600px; /* Más ancho para la tabla */
    width: 95%;
}

/* Pestañas */
.score-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.tab-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #ccc;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: 0.3s;
}

.tab-btn.active, .tab-btn:hover {
    background: var(--ine-yellow);
    color: #000;
    font-weight: bold;
    transform: scale(1.05);
}

/* Tabla */
.scores-container {
    max-height: 300px;
    overflow-y: auto;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
}

.scores-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.scores-table th, .scores-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.scores-table th {
    background: rgba(0,0,0,0.3);
    color: var(--ine-yellow);
    position: sticky;
    top: 0;
}

.scores-table tr:hover {
    background: rgba(255,255,255,0.05);
}

/* Estilo para el TOP 3 */
.rank-1 { color: #FFD700; font-weight: bold; } /* Oro */
.rank-2 { color: #C0C0C0; font-weight: bold; } /* Plata */
.rank-3 { color: #CD7F32; font-weight: bold; } /* Bronce */

/* Caja de la Pregunta */
.question-box {
    background: rgba(255, 255, 255, 0.6); /* Fondo blanco suave detrás del texto */
    padding: 15px;
    border-radius: 15px;
    margin: 15px 0;
    border: 1px solid rgba(0,0,0,0.05);
}

.question-box h3 {
    font-size: 1.3rem;
    color: #000; /* Negro puro */
    line-height: 1.4;
    font-weight: 600;
}

/* Imagen del juego con marco bonito */
.image-box img {
    border-radius: 15px;
    border: 4px solid white;
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

/* Header del juego (Timer y Nivel) */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 15px;
    color: var(--ine-blue);
    font-weight: bold;
}

/* === MENÚ PRINCIPAL (HOME) === */
.home-container {
    text-align: center;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.hero-text {
    margin-bottom: 40px;
}

.hero-text h1 {
    font-size: 2.5rem;
    color: white; /* El título principal en blanco para resaltar sobre el fondo oscuro */
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
    margin-bottom: 10px;
}

.hero-text p {
    color: #eee;
    font-size: 1.2rem;
}

/* Contenedor de las tarjetas */
.modes-container {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}

/* TARJETA DE MODO DE JUEGO */
.mode-card {
    background: rgba(255, 255, 255, 0.95); /* Blanco casi sólido */
    border-radius: 25px;
    width: 280px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
    border: 3px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* Efecto Hover (Al pasar el mouse) */
.mode-card:hover {
    transform: translateY(-15px); /* Sube mucho */
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border-color: var(--ine-yellow); /* Borde dorado al tocar */
}

/* Iconos Circulares Grandes */
.card-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.c-yellow { background: #fff9c4; color: #fbc02d; }
.c-blue   { background: #e3f2fd; color: #1976d2; }
.c-red    { background: #ffebee; color: #d32f2f; }

/* Textos dentro de la tarjeta */
.card-info h2 {
    font-size: 1.3rem;
    color: #222;
    margin-bottom: 10px;
    font-weight: 800;
}

.card-info p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 20px;
}

/* Botón falso visual */
.btn-fake {
    display: inline-block;
    padding: 8px 20px;
    background: #eee;
    color: #555;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    transition: 0.3s;
}

.mode-card:hover .btn-fake {
    background: var(--ine-blue);
    color: white; /* Se pone azul al pasar el mouse por la tarjeta */
}

/* === ESTILOS DEL MAPA INTERACTIVO === */
.map-mode {
    max-width: 900px !important; /* Más ancho para ver bien el mapa */
}

.map-container {
    width: 100%;
    height: 400px; /* Ajusta según tu SVG */
    background: rgba(255,255,255,0.2); /* Mar azul claro de fondo */
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

svg#venezuela-map {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.2));
}

/* Animación cuando aciertas */
@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

