/* --- ESTILOS BASE --- */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Montserrat', sans-serif;
}

.game-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* --- ESCENARIO Y FONDO --- */
.background-blur {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../iconos/isla.png'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(15px);
    transition: filter 1s ease;
    z-index: -1;
}

.world {
    position: absolute;
    bottom: 0; /* Base desde el suelo */
    width: 100%;
    /* Transición suave para el efecto de cámara */
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 5;
}

/* --- JUGADOR Y BLOQUES --- */
#platformStack {
    display: flex;
    flex-direction: column-reverse; 
    align-items: center;
}

.bloque {
    width: 220px;
    height: 40px;
    margin: 1px 0;
    border-radius: 8px;
    box-shadow: inset 0 -5px rgba(0,0,0,0.2);
    animation: aparecerBloque 0.4s ease-out;
}

/* --- JUGADOR REEMPLAZADO POR IMAGEN --- */
.player {
    width: 60px; /* Tamaño ajustado para que se vea mejor el PNG */
    height: 80px;
    /* Usamos la imagen de tu carpeta de iconos */
    background-image: url('../iconos/niño.png'); 
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    position: relative;
    z-index: 10;
    margin-bottom: -5px; /* Para que pise justo el bloque */
    transition: transform 0.3s ease;
}

/* Eliminamos o comentamos estos ya que no los necesitamos con la imagen */
.player-head, .player-body {
    display: none;
}

@keyframes aparecerBloque {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* --- INTERFAZ DE INICIO --- */
.ui-start {
    text-align: center;
    z-index: 100;
}

.titulo-juego {
    color: white;
    font-size: 3.5rem;
    text-shadow: 0 5px 15px rgba(0,0,0,0.4);
    margin-bottom: 50px;
    transition: transform 0.8s ease, opacity 0.8s ease;
}

.btn-inicio {
    padding: 20px 50px;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    background-color: #ff4757;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    animation: latido 1.5s infinite;
    transition: transform 0.8s ease, opacity 0.8s ease;
}

@keyframes latido {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); box-shadow: 0 15px 30px rgba(255, 71, 87, 0.4); }
}

/* --- INTERFAZ DE JUEGO (PREGUNTAS ABAJO) --- */
.ui-juego {
    position: absolute;
    bottom: 30px; /* Anclado a la parte inferior */
    width: 90%;
    max-width: 550px;
    z-index: 100;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

.stats-bar {
    color: white;
    font-weight: bold;
    background: rgba(0,0,0,0.7);
    padding: 8px 20px;
    border-radius: 25px;
    margin-bottom: 15px;
    display: inline-block;
}

.pregunta-card {
    background: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 -5px 30px rgba(0,0,0,0.3);
}

.pregunta-card h2 {
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.opciones-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-opcion {
    padding: 14px;
    border: 2px solid #4facfe;
    border-radius: 12px;
    background: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-opcion:hover {
    background: #4facfe;
    color: white;
}

/* Barra de Tiempo */
.timer-container {
    width: 100%;
    height: 10px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.timer-bar {
    height: 100%;
    background: #ff4757;
    width: 100%;
    transition: width 1s linear;
}

/* --- EL MAR (BASADO EN BLOQUES) --- */
.ocean-container {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 0px; /* Se controla por JS */
    overflow: hidden;
    z-index: 20; 
    background: rgba(0, 119, 190, 0.8);
    /* Quitamos transiciones largas que causan desfase visual */
    transition: height 0.3s ease-out; 
    pointer-events: none; /* Para que no bloquee los clics en los botones */
}

.water {
    width: 200%; 
    height: 100%;
    background-image: url('../iconos/mar.png'); 
    background-repeat: repeat-x;
    background-size: contain;
    position: absolute;
    top: 0; /* Cambiado de bottom a top para que el dibujo no salte */
    animation: oleaje 5s linear infinite;
    opacity: 0.9;
}

@keyframes oleaje {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* --- MODAL DE GAME OVER --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 25px;
    text-align: center;
    max-width: 400px;
}

/* --- ANIMACIONES DE TRANSICIÓN --- */
.fade-up { transform: translateY(-500px); opacity: 0; transition: 0.8s; }
.fade-down { transform: translateY(500px); opacity: 0; transition: 0.8s; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ... (Mantén tus estilos anteriores) ... */

.ui-water-level {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 80, 150, 0.8);
    color: white;
    padding: 15px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid #4facfe;
    z-index: 100;
}

.ui-water-level p {
    margin: 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    font-weight: bold;
}

.ui-water-level span {
    font-size: 2.5rem;
    display: block;
    font-weight: 700;
}

.ui-top-nav {
    position: absolute;
    top: 20px;
    width: 95%;
    display: flex;
    justify-content: space-between;
    z-index: 200;
}

.btn-nav {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    backdrop-filter: blur(5px);
    transition: 0.3s;
}

.btn-nav:hover {
    background: white;
    color: #4facfe;
}

/* --- AJUSTES PARA MÓVIL --- */
@media (max-width: 600px) {
    .ui-juego {
        bottom: 2%; /* Pegamos la UI un poco más al borde inferior */
    }

    .pregunta-card {
        padding: 15px; /* Reducimos el relleno para ganar espacio */
    }

    .pregunta-card h2 {
        font-size: 1.1rem; /* Texto un poco más pequeño */
        margin-bottom: 10px;
    }

    .btn-opcion {
        padding: 25px; /* Botones más compactos */
        font-size: 0.9rem;
    }

    .stats-bar {
        font-size: 0.8rem;
        padding: 5px 15px;
    }
}