/* =========================================================
   MINIJUEGO "DEFENSA CIBERNÉTICA" — vista tipo Doom (raycasting)
   Tema matrix: verde fosforescente sobre negro.
   ========================================================= */
.cib-juego {
    max-width: 900px;
    margin: 0 auto;
    border: 1px solid rgba(0, 255, 106, .3);
    border-radius: 14px;
    overflow: hidden;
    background: #020806;
    box-shadow: 0 0 40px rgba(0, 255, 106, .12);
}

/* barra superior: vidas + progreso */
.cib-juego-barra {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(0, 255, 106, .25);
    font-family: 'Courier New', monospace;
    color: #7dffb0;
    font-size: .9rem;
    flex-wrap: wrap;
    gap: 10px;
}
.cib-juego-vidas { display: flex; align-items: center; gap: 6px; }
.cib-vida {
    width: 20px; height: 20px;
    display: inline-block;
    transition: transform .2s ease, opacity .3s ease;
}
.cib-vida.perdida { opacity: .2; transform: scale(.7); }
.cib-juego-progreso { letter-spacing: .1em; }

/* el "lienzo" del juego */
.cib-juego-pantalla {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #000;
    overflow: hidden;
}
.cib-juego-pantalla canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: pixelated;   /* look retro */
}

/* destello de daño (rojo/verde) */
.cib-dano-flash {
    position: absolute;
    inset: 0;
    background: rgba(255, 40, 40, .35);
    opacity: 0;
    pointer-events: none;
    z-index: 5;
}
.cib-dano-flash.activo { animation: cib-flash .4s ease; }
@keyframes cib-flash {
    0% { opacity: 0; }
    30% { opacity: 1; }
    100% { opacity: 0; }
}

/* destello de acierto (verde) */
.cib-acierto-flash {
    position: absolute;
    inset: 0;
    background: rgba(0, 255, 106, .25);
    opacity: 0;
    pointer-events: none;
    z-index: 5;
}
.cib-acierto-flash.activo { animation: cib-flash .4s ease; }

/* capa de mensajes (inicio, fin) — cubre todo */
.cib-juego-capa {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    background: rgba(2, 12, 8, .82);
    -webkit-backdrop-filter: blur(3px);
            backdrop-filter: blur(3px);
    font-family: 'Courier New', monospace;
}
.cib-juego-capa.oculto { display: none; }

/* modo PREGUNTA: no tapa el centro. La pregunta va arriba y las
   respuestas abajo, dejando ver el enemigo y el camino en medio. */
.cib-juego-capa.modo-pregunta {
    background: transparent;
    -webkit-backdrop-filter: none;
            backdrop-filter: none;
    justify-content: space-between;
    padding: 0;
}
.cib-juego-capa.modo-pregunta .cib-pregunta-zona {
    width: 100%;
    background: linear-gradient(180deg, rgba(2,12,8,.92), rgba(2,12,8,.75) 70%, rgba(2,12,8,0));
    padding: 16px 18px 26px;
}
.cib-juego-capa.modo-pregunta .cib-respuestas-zona {
    width: 100%;
    background: linear-gradient(0deg, rgba(2,12,8,.95), rgba(2,12,8,.78) 60%, rgba(2,12,8,0));
    padding: 26px 18px 16px;
    display: flex;
    justify-content: center;
}

.cib-juego-capa h3 {
    color: #eafff1;
    font-size: clamp(1.2rem, 3vw, 1.7rem);
    margin: 0 0 12px;
    text-shadow: 0 0 12px rgba(0, 255, 106, .5);
}
.cib-juego-capa p { color: #9fd7b8; margin: 0 0 18px; line-height: 1.6; max-width: 560px; }

/* la pregunta */
.cib-pregunta-texto {
    color: #eafff1;
    font-size: clamp(1rem, 2.4vw, 1.3rem);
    margin: 0 0 20px;
    max-width: 620px;
    line-height: 1.5;
}
.cib-pregunta-texto::before { content: '> '; color: #00ff6a; }

/* botones de respuesta */
.cib-respuestas {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 520px;
}
.cib-respuesta {
    background: rgba(0, 255, 106, .08);
    border: 1px solid rgba(0, 255, 106, .4);
    color: #cffce0;
    font-family: 'Courier New', monospace;
    font-size: .98rem;
    text-align: left;
    padding: 13px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.cib-respuesta:hover {
    background: rgba(0, 255, 106, .18);
    border-color: #00ff6a;
}
.cib-respuesta:active { transform: scale(.98); }
.cib-respuesta.correcta {
    background: rgba(0, 255, 106, .35);
    border-color: #00ff6a;
    color: #fff;
}
.cib-respuesta.incorrecta {
    background: rgba(255, 40, 40, .25);
    border-color: #ff5555;
    color: #ffd5d5;
}
.cib-respuesta:disabled { cursor: default; }

/* botón principal (empezar / reiniciar) */
.cib-juego-btn {
    background: rgba(0, 255, 106, .15);
    border: 1px solid #00ff6a;
    color: #00ff6a;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    letter-spacing: .05em;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    transition: background .2s ease, box-shadow .2s ease;
}
.cib-juego-btn:hover {
    background: rgba(0, 255, 106, .3);
    box-shadow: 0 0 20px rgba(0, 255, 106, .4);
}

/* nombre del enemigo actual */
.cib-enemigo-nombre {
    color: #00ff6a;
    font-family: 'Courier New', monospace;
    font-size: .82rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

/* pie con instrucciones */
.cib-juego-pie {
    padding: 10px 18px;
    border-top: 1px solid rgba(0, 255, 106, .2);
    color: #6fbf95;
    font-family: 'Courier New', monospace;
    font-size: .78rem;
    text-align: center;
}
