/* ==========================================================
   1. CONFIGURACIÓN GENERAL Y RESET (Tipografía Redonda)
   ========================================================== */
   :root {
    --escala-juego: 1;
    --turquesa-forro: #46999a; 
    --morado-forro: #6a3093;
    --naranja-forro: #f39200;
    --verde-exito: #4caf50;
    --azul-opcion: #2b3a8c;
}

body, html {
    margin: 0; padding: 0;
    width: 100%; height: 100%;
    overflow: hidden; 
    font-family: 'Quicksand', 'Nunito', sans-serif;
    background-color: #2c6e6f; 
    display: flex; align-items: center; justify-content: center;
}

.hidden { display: none !important; }

/* ==========================================================
   2. PANTALLA DE INICIO
   ========================================================== */
#pantalla-inicio {
    display: flex; align-items: center; justify-content: center;
    width: 100vw; height: 100vh;
}

#contenedor-inicio {
    position: relative;
    width: 1024px; height: 768px;  
    background-color: var(--turquesa-forro);
    border: 10px solid #ffffff; 
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transform: scale(var(--escala-juego));
    transform-origin: center center;
}

.logo-titulo { width: 65%; max-width: 550px; margin-bottom: 20px; animation: flotar 3s ease-in-out infinite; }
.img-comunidad { width: 40%; max-width: 350px; border-radius: 25px; border: 5px solid white; margin-bottom: 30px; }
.contenedor-botones { display: flex; gap: 25px; margin-bottom: 60px; z-index: 10; }

.btn-menu { padding: 18px 45px; font-size: 1.4rem; cursor: pointer; border: none; border-radius: 50px; color: white; font-weight: bold; text-transform: uppercase; transition: transform 0.2s; }
.btn-menu:hover { transform: scale(1.05); }

#btn-jugar { background-color: var(--morado-forro); box-shadow: 0 6px #4a1d6d; }
#btn-instrucciones { background-color: var(--naranja-forro); box-shadow: 0 6px #b36b00; }

.footer-derechos { position: absolute; bottom: 0; left: 0; width: 100%; height: 80px; display: flex; justify-content: center; align-items: center; pointer-events: none; }
.footer-derechos p { font-size: 11px; color: white; background: rgba(0,0,0,0.2); padding: 5px 15px; border-radius: 15px; margin: 0; }
.logo-footer { position: absolute; right: 20px; bottom: 15px; height: 55px; pointer-events: auto; }

/* ==========================================================
   3. ESCENARIOS Y ZONAS DE JUEGO
   ========================================================== */
#escenario-juego, #escenario-zona2, #escenario-zona3 {
    width: 100vw; height: 100vh;
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: 0; left: 0;
    overflow: visible; 
}

/* CAMBIO 1: overflow visible para que el checklist pueda salir del marco */
#contenedor-mision, #contenedor-pistas, #contenedor-runner {
    position: relative; 
    width: 1024px; height: 768px;  
    background: white;
    border: 10px solid #ff9800; 
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    overflow: visible; /* Modificado de hidden a visible */
    transform: scale(var(--escala-juego));
    transform-origin: center center;
    flex-shrink: 0;
}

/* Aseguramos que la imagen no se salga de las esquinas redondeadas */
#fondo-busqueda { 
    width: 100%; height: 100%; 
    object-fit: fill; 
    border-radius: 10px; /* Para que respete el borde del contenedor */
}

#capa-iconos {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 5; pointer-events: auto; 
}

.pista-icono {
    position: absolute;
    width: 45px; height: 45px;
    z-index: 10; cursor: pointer;
    transform: translate(-50%, -50%);
}

/* ==========================================================
   CHECKLIST: POSICIÓN Y DISEÑO ADAPTATIVO
   ========================================================== */

/* CAMBIO 2: En pantallas grandes, lo sacamos a la derecha del juego */
#checklist-tesoros {
    position: absolute;
    left: 100%; /* Lo empuja completamente fuera del marco a la derecha */
    margin-left: 20px; /* Separación del marco */
    top: 50%;
    transform: translateY(-50%);
    background: #fdf5e6; 
    padding: 15px;
    border-radius: 15px;
    border: 4px solid #8b4513;
    width: 200px;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

#checklist-tesoros h3 {
    margin: 0 0 10px 0; font-size: 1.1rem;
    color: #5d4037; text-align: center;
    text-decoration: underline;
}

.item-check { 
    font-size: 0.85rem; margin-bottom: 6px; 
    color: #333; display: flex; align-items: center; gap: 8px;
}

.item-check.logrado { color: #2e7d32; font-weight: bold; }

/* ==========================================================
   4. INTERFAZ, MODALES Y RESPUESTAS DEL DILEMA
   ========================================================== */
#marcador-puntos {
    position: absolute;
    right: 25px; top: 25px; 
    color: white; background: var(--verde-exito);
    padding: 12px 25px; border-radius: 30px;
    font-weight: 800; border: 3px solid white;
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.modal {
    position: fixed; z-index: 2000;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.85);
    display: flex; justify-content: center; align-items: center;
}

.modal-contenido {
    background-color: #fff; padding: 30px;
    border-radius: 35px; width: 90%; max-width: 580px; 
    border: 8px solid var(--morado-forro); text-align: center;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-sizing: border-box;
}

.contenedor-opciones-dilema, #modal-opciones {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    width: 100%;
}

.btn-opcion-dilema, .btn-opcion {
    width: 100%;
    min-height: 58px; 
    padding: 14px 20px;
    background-color: #f4f6fb;
    border: 3px solid var(--azul-opcion);
    border-radius: 20px;
    color: var(--azul-opcion);
    font-family: 'Quicksand', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.2s ease, box-shadow 0.15s ease;
    box-shadow: 0 5px 0 var(--azul-opcion);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.btn-opcion-dilema:hover, .btn-opcion:hover {
    background-color: #e8ecf8;
    transform: translateY(-2px);
    box-shadow: 0 7px 0 var(--azul-opcion);
}

.btn-opcion-dilema:active, .btn-opcion:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 var(--azul-opcion);
}

.modal-img-nivel {
    width: 180px; 
    height: auto;
    max-height: 180px;
    object-fit: contain;
    margin: 0 auto 20px auto;
    display: block;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.2));
}

.modal-img-pista {
    width: 110px !important; 
    height: 110px !important;
    object-fit: contain;
    margin-bottom: 10px;
}

.badge-mision {
    background: var(--naranja-forro);
    color: white;
    padding: 10px 20px;
    border-radius: 15px;
    display: inline-block;
    font-weight: 800;
    font-size: 1.3rem;
    margin-bottom: 15px;
    border: 3px solid white;
    box-shadow: 0 4px 0 rgba(0,0,0,0.2);
    text-transform: uppercase;
}

#modal-titulo {
    font-size: 1.8rem;
    color: var(--morado-forro);
    margin-bottom: 12px;
    font-weight: 800;
    line-height: 1.25;
}

#btn-cerrar-modal {
    background: var(--verde-exito);
    box-shadow: 0 6px 0 #2e7d32;
    padding: 15px 35px;
    font-size: 1.3rem;
    border-radius: 50px;
    border: 3px solid white;
    color: white;
    cursor: pointer;
    font-weight: 800;
    transition: 0.2s;
    margin-top: 20px;
    font-family: 'Quicksand', sans-serif;
}

#btn-cerrar-modal:hover { transform: scale(1.05); }
#btn-cerrar-modal:active { transform: translateY(4px); box-shadow: 0 2px 0 #2e7d32; }

.score-llamativo {
    display: block;
    animation: bounce 1s infinite;
}

/* ==========================================================
   5. ANIMACIONES Y MEDIA QUERIES
   ========================================================== */
@keyframes flotar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes popIn { 0% { transform: scale(0.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes bounce { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

/* CAMBIO 3: Corregida la sintaxis del @media (usar coma en vez de 'or') */
/* En pantallas que no son lo suficientemente anchas, pasamos el checklist abajo */
@media (max-width: 1300px), (max-height: 800px) {
    
    /* Volvemos a ocultar el desborde para que el checklist no se salga por abajo */
    #contenedor-mision, #contenedor-pistas, #contenedor-runner {
        overflow: hidden;
    }

    #checklist-tesoros {
        left: 0;
        top: auto; 
        bottom: 0; /* Pegado a la parte inferior */
        margin-left: 0;
        transform: none;
        width: 100%; 
        flex-direction: row; /* Elementos en fila */
        flex-wrap: wrap; /* Si no caben, saltan de línea */
        justify-content: center; 
        align-items: center;
        gap: 5px 15px; /* Espaciado entre items */
        padding: 10px;
        border-radius: 0 0 10px 10px; /* Redondeado solo abajo para encajar */
        border: none;
        border-top: 3px solid #8b4513; /* Borde superior para separar */
        background: rgba(253, 245, 230, 0.95); /* Un poco transparente para ver si hay algo debajo */
        box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
    }

    #checklist-tesoros h3 { 
        display: none; /* Ocultamos el título para ahorrar espacio vertical */
    }
    
    .item-check { 
        margin-bottom: 0; 
        font-size: 0.8rem; /* Letra un poco más pequeña */
    }
}