/* microfilm-carrusel.css - VERSIÓN CORREGIDA CON Z-INDEX FIXED */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'IBM Plex Mono', monospace;
    background: #000;
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.scene-container {
    position: relative;
    width: 1600px;
    height: 1000px;
    overflow: hidden;
    background-color: transparent;
    z-index: 10; /* AÑADIDO: Contenedor principal arriba de esferas */
}

.prison-background {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1; /* FONDO: El más bajo */
    object-fit: cover;
}

.microfilm-machine {
    position: absolute;
    z-index: 30; /* CAMBIADO: De 51 a 30 */
    cursor: pointer;
    width: 800px;
    height: auto;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
}

.microfilm-off {
    display: block;
}

.microfilm-on {
    display: none;
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: auto;
}

.microfilm-screen {
    position: absolute;
    top: 163px;
    left: 477px;
    width: 482px;
    height: 348px;
    background: #ffffff;
    border-radius: 2px;
    z-index: 31; /* CAMBIADO: De 51 a 31 (arriba de la máquina) */
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8);
}

.microfilm-screen.active {
    opacity: 1;
}

.screen-content {
    position: absolute;
    width: 100%;
    height: auto;
    padding: 15px;
    color: #000000;
    font-size: 15px;
    line-height: 1.8;
    text-align: justify;
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    transform: translateY(0);
    transition: transform 0.05s linear;
}

.screen-content p {
    margin-bottom: 12px;
}

.screen-content .title {
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.screen-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(
            rgba(0, 0, 0, 0.05) 50%,
            transparent 50%
        ),
        linear-gradient(
            90deg,
            rgba(0, 0, 0, 0.03) 1px,
            transparent 1px
        );
    background-size: 100% 4px, 10px 100%;
    pointer-events: none;
    z-index: 4;
}

.sound-toggle {
    position: absolute;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100; /* MANTENIDO: El más alto */
}

.sound-toggle:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
}

.sound-toggle.muted {
    opacity: 0.5;
}

.sound-toggle.muted::after {
    content: "🔇";
}

.sound-toggle:not(.muted)::after {
    content: "🔊";
}

.scroll-hint {
    position: absolute;
    top: 530px;
    left: 718px;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    text-align: center;
    z-index: 32; /* CAMBIADO: Arriba de la pantalla */
    opacity: 0.7;
    font-family: 'Courier New', monospace;
    pointer-events: none;
    white-space: nowrap;
    display: none;
}

/* ========== ÁREAS INTERACTIVAS SIMPLIFICADAS ========== */
.areas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 40; /* CAMBIADO: De 10 a 40 (arriba de todo) */
}

.areas-overlay[hidden] {
    display: none;
}

.area-interactiva {
    position: absolute;
    border: 1px solid rgba(255, 0, 0, 0.3);
    cursor: pointer;
    background-color: rgba(255, 0, 0, 0.05);
    z-index: 41; /* CAMBIADO: De 11 a 41 */
}

/* POSICIONES DE LAS ÁREAS */
#area1 {
    top: 365px;
    left: 190px;
    width: 50px;
    height: 110px;
}

#area2 {
    top: 365px;
    left: 250px;
    width: 50px;
    height: 110px;
}

#area3 {
    top: 365px;
    left: 320px;
    width: 50px;
    height: 10px;
}

.texto-area {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 0, 0, 0.3);
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    pointer-events: none;
    z-index: 42; /* CAMBIADO: De 12 a 42 */
}

/* ========== HOVER BÁSICO ========== */
.area-interactiva:hover {
    background-color: rgba(255, 0, 0, 0.15);
    border-color: rgba(255, 0, 0, 0.6);
}

.area-interactiva:hover .texto-area {
    color: #ff0000;
    font-weight: 700;
}

/* ========== CARRUSEL SIMPLIFICADO ========== */
.descripcion-carrusel {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 40px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
}

.descripcion-track {
    display: flex;
    height: 100%;
    align-items: center;
    padding: 0 10px;
}

.concepto-item {
    color: #ff0000;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    margin: 0 20px;
    white-space: nowrap;
    text-transform: uppercase;
}

/* ========== ESTILOS DE ESFERAS ORBITANTES (AL FINAL) ========== */
/* CONTENEDOR DE ESFERAS */
/* ========== ESFERAS IDÉNTICAS AL EJEMPLO ========== */

/* Contenedor para el fondo de esferas */
#esferas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* ESFERAS BLANCAS (6 unidades en el ejemplo) */
.esfera.blanca {
    position: absolute;
    border-radius: 50%;
    background: white;
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.6),
        0 0 40px rgba(255, 255, 255, 0.4),
        0 0 60px rgba(255, 255, 255, 0.2);
    pointer-events: none;
    z-index: 1;
    will-change: transform;
}

/* ESFERA ROJA (1 unidad en el ejemplo) */
.esfera.roja {
    position: absolute;
    border-radius: 50%;
    background: red;
    box-shadow: 
        0 0 20px rgba(255, 0, 0, 0.5),
        0 0 40px rgba(255, 0, 0, 0.4),
        0 0 60px rgba(255, 0, 0, 0.3);
    pointer-events: none;
    z-index: 1;
    will-change: transform;
}

/* ELIMINA la clase .esfera general y .esfera.azul */

/* Asegurar que elementos interactivos estén por encima */
.microfilm-machine,
.microfilm-screen,
.areas-overlay,
.sound-toggle {
    pointer-events: auto !important;
}

/* MEDIA QUERIES */
@media (max-width: 1650px) {
    .scene-container {
        transform: scale(0.9);
    }
}

@media (max-width: 1450px) {
    .scene-container {
        transform: scale(0.8);
    }
    
    .sound-toggle {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

@media (max-width: 1250px) {
    .scene-container {
        transform: scale(0.7);
    }
}