/* Cambia el color cuando el usuario selecciona texto con el mouse */
::-moz-selection {
    background: #222;
    color: #00ffcc;
}
::selection {
    background: #222;
    color: #00ffcc;
}
/* --- CONFIGURACIÓN GENERAL --- */
* {
    box-sizing: border-box;
    cursor: none; /* Oculta por completo el cursor estándar */
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    background-color: #050505; /* Negro profundo (hollín de mina) */
    color: rgba(255, 255, 255, 0.08); /* Texto casi invisible en la oscuridad */
    font-family: 'Courier New', Courier, monospace; /* Estética de máquina de escribir / expediente */
    scroll-behavior: smooth;
}

/* --- CAPA DE LA LINTERNA --- */
#linterna {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none; /* Permite hacer clic "a través" de la capa oscura */
    /* Gradial inicial centrado por defecto */
    background: radial-gradient(circle 150px at 50% 50%, transparent 100%, rgba(5, 5, 5, 0.98) 100%);
    z-index: 999;
    transition: background 0.05s ease;
}

/* --- CONTENEDORES Y NARRATIVA --- */
.contenedor {
    max-width: 750px;
    margin: 0 auto;
    padding: 60px 20px;
    position: relative;
    z-index: 10;
}

header {
    text-align: center;
    margin-bottom: 80px;
}

h1 {
    color: #3a3530; /* Color apagado, se revela con la luz */
    font-size: 2.4em;
    letter-spacing: 6px;
    margin: 0;
    transition: color 0.3s ease;
}

.subtitulo {
    font-size: 0.9em;
    letter-spacing: 2px;
    color: #222;
}

.epoca {
    margin-bottom: 60px;
    line-height: 1.8;
    font-size: 1.1em;
    text-align: justify;
}

.marca-tiempo {
    display: block;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 15px;
    color: #444;
}

.cita {
    font-style: italic;
    color: #333;
    border-left: 2px solid #222;
    padding-left: 15px;
    margin-bottom: 20px;
}

.separador-temporal {
    border: 0;
    height: 1px;
    background: #111;
    margin: 60px 0;
}

/* --- ELEMENTOS DE TEXTO ILUMINADOS POR JS --- */
.texto-iluminado {
    color: #d1c7bd !important; /* El texto se aclara sutilmente bajo la linterna */
}

/* --- HUEVOS DE PASCUA (EFECTO LUZ UV) --- */
.huevo-pascua {
    color: inherit;
    font-weight: bold;
    text-decoration: underline dashed #222;
    /* Suaviza la transición tanto al entrar como al salir de la luz */
    transition: color 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), text-shadow 0.4s ease;
}

.huevo-pascua:hover {
    color: #00ffcc !important; 
    text-shadow: 0 0 8px rgba(0, 255, 204, 0.8), 0 0 20px rgba(0, 255, 204, 0.4);
    text-decoration: underline solid #00ffcc;
}

/* --- REPRODUCTOR DE AUDIO --- */
#reproductor-contenedor {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #0d0d0d;
    border: 1px solid #1a1a1a;
    padding: 12px 18px;
    z-index: 1000;
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(0,0,0,0.7);
}

.cassette-info {
    font-size: 11px;
    color: #666;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.parpadeo {
    color: #8b0000;
    animation: latido 1.5s infinite;
}

#btn-audio {
    background: #151515;
    border: 1px solid #333;
    color: #aaa;
    font-family: monospace;
    padding: 5px 10px;
    font-size: 11px;
    width: 100%;
    transition: all 0.3s;
}

#btn-audio:hover {
    background: #222;
    color: #fff;
    box-shadow: 0 0 5px rgba(255,255,255,0.1);
}

audio { display: none; } /* Ocultamos los controles nativos feos */

/* --- VENTANA EMERGENTE (MODAL EXPENDIENTE) --- */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(5, 5, 5, 0.95);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-contenido {
    background: #0a0a0a;
    border: 1px solid #222;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    color: #b5a89b;
    position: relative;
    box-shadow: 0 0 30px rgba(0,0,0,0.9);
}

.cerrar-modal {
    position: absolute;
    top: 15px; right: 20px;
    color: #555;
    font-size: 28px;
    font-weight: bold;
    transition: color 0.2s;
}

.cerrar-modal:hover { color: #00ffcc; }

/* --- ANIMACIONES Y GIRO FINAL --- */
@keyframes latido {
    0% { opacity: 0.2; }
    50% { opacity: 1; }
    100% { opacity: 0.2; }
}

.alerta-bucle {
    color: #ff3333 !important;
    text-shadow: 0 0 10px #ff3333;
    font-weight: bold;
}
/* --- ESTILOS DEL ÁRBOL GENEALÓGICO --- */
#seccion-arbol {
    margin-top: 80px;
    text-align: center;
}

#seccion-arbol h2 {
    color: #444;
    letter-spacing: 4px;
    font-size: 1.2em;
}

.arbol-contenedor {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 30px;
}

.nodo {
    border: 1px dashed #222;
    padding: 15px;
    background: #0a0a0a;
    color: #333;
    width: 250px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.5s ease;
}

/* Clases dinámicas que activará JavaScript */
.nodo-revelado {
    border: 1px solid #d1c7bd !important;
    color: #d1c7bd !important;
    box-shadow: 0 0 10px rgba(209, 199, 189, 0.2);
}

.nodo-paradoja {
    border: 1px solid #ff3333 !important;
    color: #ff3333 !important;
    text-shadow: 0 0 5px #ff3333;
    box-shadow: 0 0 15px rgba(255, 51, 51, 0.3);
    animation: latido 2s infinite;
}

.linea {
    width: 2px;
    height: 30px;
    background: #111;
    transition: background 0.5s;
}

.linea-activa {
    background: #00ffcc;
    box-shadow: 0 0 8px #00ffcc;
}
/* Animación de distorsión temporal */
@keyframes glitch-apertura {
    0% { transform: scale(1) translate(0); opacity: 0.8; filter: hue-rotate(0deg); }
    10% { transform: scale(1.02) translate(-5px, 2px); opacity: 0.9; filter: hue-rotate(90deg); }
    20% { transform: scale(0.99) translate(3px, -2px); opacity: 0.8; }
    30% { transform: scale(1) translate(0); opacity: 1; filter: hue-rotate(0deg); }
}

.modal-contenido {
    animation: glitch-apertura 0.4s ease-out;
    border-left: 4px solid #00ffcc; /* Línea de acento neón que le da un toque premium */
}