/* === ESTILOS BASE === */
/* === ESTILOS BASE === */
/* 🔹 Quitamos fondo global del body */
body.pagina-juego {
    background: none !important;
    background-color: #000 !important;
}

/* 🔹 Aplicamos el fondo solo al área del juego */
#game-container {
    background: url("assets/game.png") center center no-repeat;
    background-size: cover;
    background-color: black;
    position: relative;
    overflow: hidden;
}


/* === Fondo especial solo para la página del juego === */


/* === ANIMACIONES === */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes floatText {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes fadeScale {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* === VIDEO DE FONDO === */
#video-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    object-fit: fill;
    /* O 'cover', según prefieras */
    z-index: -1;
    pointer-events: none;
    /* evita que el video interfiera con clics */
}


/* === ZONA DE INICIO === */
.landing {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 30px;
}

.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    width: 90%;
    max-width: 1200px;
    gap: 80px;
}

.text-zone {
    max-width: 500px;
    padding: 20px;
    text-align: center;
}

.text-zone h1 {
    font-family: 'Press Start 2P', monospace;
    font-size: 5.6rem;
    background: none;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    /* 🔥 Esto hace que funcione la animación typing */
    text-shadow: 2px 2px #000000;
    animation: typing 6s steps(12, end) infinite, blinkCaret 0.7s step-end infinite;
}


@keyframes typing {
    0% {
        width: 0;
    }

    50% {
        width: 12ch;
    }

    100% {
        width: 0;
    }
}



.botonera {
    display: flex;
    /* flex-wrap: wrap;
    gap: 15px; */
    justify-content: center;
    align-items: center;
    padding-block: 55px;
}



.arcade-btn {
    font-family: 'Press Start 2P', cursive;
    background-color: #4b9d55;
    color: #fff;
    /* border: 4px solid #fff; */
    padding: 15px 25px;
    border-radius: 10px;
    margin: 15px;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 8px 8px 0 #000;
    transition: transform 0.1s;

    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
    /* overflow: hidden; */
    text-overflow: ellipsis;
}

.arcade-btn:hover {
    transform: scale(1.05);
}


.text-zone h1::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: black;
    border-radius: 30px;
    top: 10px;
    left: 10px;
    z-index: -2;
    filter: blur(4px);
}

.subtitle {
    font-family: "Press Start 2P", cursive;
    font-size: 1rem;
    margin-bottom: 25px;
    color: #cccccc;
}

.text-zone h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: #fff;
}

/* === BOTONES === */
.character-selection button,
#play-btn {
    background: linear-gradient(180deg, #ffb347, #ff7b00);
    color: white;
    font-weight: bold;
    font-family: 'Baloo 2', cursive;
    font-size: 18px;
    padding: 12px 30px;
    margin: 10px;
    border: 3px solid white;
    border-radius: 40px;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.character-selection button:hover,
#play-btn:hover {
    transform: scale(1.05);
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.5), 0 6px 16px rgba(0, 0, 0, 0.25);
}

#play-btn {
    margin-top: 25px;
    padding: 15px 50px;
    font-size: 1.2rem;
    background-color: #fb5607;
    border: none;
    border-radius: 15px;
}

#play-btn:hover {
    background-color: #ff006e;
}

/* === IMAGEN PERSONAJE INICIO === */
.image-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 20px;
    margin-left: 40px;
}

.main-character {
    max-width: 500px;
    transform: rotateY(180deg);
    animation: float 3s ease-in-out infinite;
}

/* === ÁREA DE JUEGO === */


#game-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: transparent !important;
    /* ✅ Añade esto */
}

#game-container {
    flex: 1;
    background-color: transparent !important;
    /* ✅ CAMBIAR de #0f2027 a transparent */
    position: relative;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
    background-color: transparent !important;
    /* ✅ Cambiar aquí */
}

/* === HUD lateral === */
aside#hud {
    width: 300px;
    background-color: rgba(31, 31, 31, 0.85);
    /* ✅ Semi-transparente */
    padding: 20px;
    box-shadow: inset 0 0 10px rgba(0, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    gap: 15px;
    color: white;
}

#hud h2 {
    font-size: 1.2rem !important;
    color: #00f0ff !important;
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    border-radius: 8px;
    border: 2px solid #00f0ff;
    text-shadow: 0 0 10px #00f0ff;
}


¡#jugador-activo,
#puntos,
#preguntas-restantes {
    font-size: 0.85rem !important;
    padding: 12px !important;
    background: linear-gradient(135deg, #2a2a2a, #1f1f1f) !important;
    border-radius: 8px !important;
    border-left: 4px solid #00f0ff;
    line-height: 1.6;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

#puntos {
    border-left-color: #4b9d55;
    /* Verde para puntaje */
    font-weight: bold;
}

#preguntas-restantes {
    border-left-color: #ffb347;
    /* Naranja para preguntas */
}


/* === Cámara === */
#camera-wrapper {
    position: relative;
    width: 100%;
    height: 150px;
}

#webcam-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    border: 3px solid white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#camera-status {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
}

.estado-verde {
    background-color: limegreen;
}

.estado-rojo {
    background-color: red;
}

/* === Indicador de nivel === */
#level-indicator {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: #222;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1.2rem;
    box-shadow: 0 0 10px #00f0ff;
    z-index: 10;
    display: none;
    animation: fadeScale 1s ease;
}

/* === Pantalla final === */
#final-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    text-align: center;
}

/* Mejorar las teclas en el modal de pregunta */
.tecla {
    display: inline-block;
    background: linear-gradient(135deg, #00f0ff, #0099cc);
    color: black;
    font-weight: bold;
    padding: 6px 12px;
    border-radius: 8px;
    box-shadow: 0 4px 0 #006080, 0 6px 10px rgba(0, 0, 0, 0.3);
    margin: 0 8px;
    font-family: "Press Start 2P", monospace;
    font-size: 0.9rem;
}

/* Mejorar el texto de las preguntas */
#texto-pregunta {
    font-size: 2.1rem;
    line-height: 1.8;
    color: #fff;
    margin-bottom: 25px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.pregunta-contenido p {
    font-size: 0.9rem;
    color: #cccccc;
    line-height: 2;
}

/* Mejorar feedback modal */
#feedback-texto {
    font-size: 1rem;
    line-height: 1.8;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

#final-screen h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

#final-screen button {
    padding: 10px 20px;
    font-size: 1rem;
    background-color: #00f0ff;
    color: black;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#final-screen button:hover {
    background-color: #118ab2;
}

.oculto {
    display: none;
}

.btn-control {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 25px;
    background-color: #06f0ff;
    color: black;
    text-decoration: none;
    font-weight: bold;
    border-radius: 10px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.btn-control:hover {
    transform: scale(1.05);
    background-color: #00d1d1;
}

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

.pregunta-contenido {
    background: #222;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 600px;
    box-shadow: 0 0 15px #00f0ff;
}

#pregunta-modal.oculto {
    display: none;
}

#feedback-modal {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #222;
    color: #fff;
    padding: 40px;
    /* 👈 Aumenté un poco el padding */
    border-radius: 15px;
    /* 👈 Más redondeado */
    box-shadow: 0 0 20px #0ff;
    z-index: 100;
    display: none;
    max-width: 600px;
    /* 👈 Aumenté para que se vea mejor con la imagen */
    text-align: center;
    font-size: 1.1rem;
    backdrop-filter: blur(8px);
}

#feedback-modal:not(.oculto) {
    display: flex;
    /* 👈 Cambié a flex para centrar mejor */
    flex-direction: column;
    align-items: center;
    animation: fadeScale 0.5s ease;
}

@keyframes fadeScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 🆕 ESTILOS PARA EL TEXTO DE FEEDBACK */
#feedback-modal #feedback-texto {
    color: #00f0ff;
    font-size: 18px;
    line-height: 1.6;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
    margin-top: 10px;
}

/* 🆕 ANIMACIÓN FLOTANTE */
@keyframes floatImage {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

#blur-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    backdrop-filter: blur(6px);
    background-color: rgba(0, 0, 0, 0.2);
    z-index: 90;
    /* detrás del modal */
}

#blur-layer.oculto {
    display: none;
}

#ranking {
    background-color: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    margin: 20px auto;
    box-shadow: 0 0 20px #00f0ff;
    font-family: 'Baloo 2', cursive;
    z-index: 1100;
    position: relative;
}

#ranking h2 {
    margin-bottom: 15px;
    font-size: 1.8rem;
}

#lista-ranking {
    list-style: decimal;
    padding-left: 0;
    margin: 0;
}

#lista-ranking li {
    text-align: left;
    margin: 8px 0;
    font-size: 1.2rem;
    background: #2a2a2a;
    padding: 10px 15px;
    border-radius: 10px;
}

/* === IMAGEN ARRIBA DEL MODAL DE PREGUNTA === */
#imagen-pregunta {
    width: 217px;
    height: 225px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid #00f0ff;
    box-shadow: 0 0 20px #00f0ff, 0 0 40px rgba(0, 240, 255, 0.5);
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    animation: floatImage 3s ease-in-out infinite;
}

@keyframes floatImage {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Ajustar el modal para que se vea mejor con la imagen */
.pregunta-contenido {
    background: #222 !important;
    padding: 53px !important;
    border-radius: 15px !important;
    text-align: center !important;
    max-width: 600px !important;
    box-shadow: 0 0 15px #00f0ff !important;
}

#pregunta-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Contenedor de retroalimentación */
#feedback-container {
    background: #222;
    padding: 53px;
    border-radius: 15px;
    text-align: center;
    max-width: 600px;
    box-shadow: 0 0 15px #00f0ff;
    margin: 20px auto;
}