/* ==========================================================================
   1. TIPOGRAFÍAS LOCALES (@font-face)
   ========================================================================== */
@font-face {
    font-family: 'cairo';
    src: url('../tipografias/Cairopixel.ttf') format('truetype');
}
@font-face {
    font-family: 'retrobank';
    src: url('../tipografias/retrobank.ttf') format('truetype');
}
@font-face {
    font-family: 'romantic';
    src: url('../tipografias/romantic.ttf') format('truetype');
}

/* ==========================================================================
   2. ESTILOS GENERALES Y ESTRUCTURA BASE
   ========================================================================== */
html, body {
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Evita que aparezca barra de desplazamiento horizontal */
    font-family: 'cairo', sans-serif;
    font-size: 25px;
    padding-left: 50px;
    padding-right: 50px;
}

/* ==========================================================================
   3. FONDOS Y CAPAS FIJAS
   ========================================================================== */
/* Fondo fijo de estrellas */
.fondo-estrellas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: url("../fondos/stars3.gif");
    background-repeat: repeat;
    z-index: -2; /* Al fondo de todo */
}

/* Capa de figuras en movimiento */
.capa-movimiento {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: url("../fondos/figures.png");
    background-repeat: repeat-x;
    background-size: auto 100%;
    z-index: -1;
    animation: carrusel-infinito 30s linear infinite;
}

/* ==========================================================================
   4. CINTAS VERTICALES LATERALES
   ========================================================================== */
.cinta-vertical {
    position: fixed;
    top: 0;
    width: 40px;
    height: 100vh;
    background-color: rgba(15, 5, 25, 0.85); /* Fondo púrpura muy oscuro */
    overflow: hidden;
    z-index: 99;
}

.cinta-izquierda {
    left: 0;
    border-right: 2px dashed DarkOrchid;
}

.cinta-derecha {
    right: 0;
    border-left: 2px dashed DarkOrchid;
}

.cinta-contenido {
    display: flex;
    flex-direction: column;
    white-space: nowrap;
    animation: moverCintaArriba 10s linear infinite;
}

.cinta-contenido.cinta-invertida {
    animation: moverCintaAbajo 15s linear infinite;
}

.cinta-vertical span {
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-family: 'cairo', monospace;
    font-size: 25px;
    color: MediumOrchid;
    letter-spacing: 3px;
    padding: 20px 0;
    text-align: center;
    text-shadow: 0 0 8px rgba(153, 50, 204, 0.8);
}

/* ==========================================================================
   5. LAYOUT PRINCIPAL (MOSAICO Y CAJAS)
   ========================================================================== */
.contenedor-mosaico {
    display: grid;
    grid-template-columns: 1fr 3fr; 
    gap: 25px;
    max-width: 1200px;
    margin: 40px auto;
    align-items: start; /* Evita que la caja pequeña se estire hacia abajo */
}

.caja-lateral {
    background-color: MidnightBlue;
    color: white;
    padding: 20px;
    border-radius: 12px;
    border: 6px ridge DarkOrchid;
    position: sticky;
    top: 20px;
    max-height: 80vh;
    overflow-y: auto;
}

.caja-principal {
    background-color: Indigo;
    color: GhostWhite;
    padding: 40px;
    border-radius: 12px;
    border: 7px double DarkOrchid;
    min-height: 150vh;
}

/* ==========================================================================
   6. NAVEGACIÓN Y SECCIONES
   ========================================================================== */
/* Menú lateral izquierdo */
.menu-biblioteca a {
    display: block;
    color: GhostWhite;
    text-decoration: none;
    padding: 10px;
    margin-bottom: 5px;
    border-bottom: 1px dashed #ddd;
    transition: 0.3s;
}

.menu-biblioteca a:hover {
    background: #f0f0f0;
    padding-left: 15px;
}

/* Control de secciones de lectura */
.seccion-lectura {
    display: none; 
    animation: aparecer 0.5s ease;
}

.seccion-lectura:target {
    display: block;
}

#inicio {
    display: block;
}

:target ~ .caja-principal #inicio, 
.seccion-lectura:target ~ #inicio {
    display: none;
}

/* Sub-menú de botones (Unificado) */
.sub-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid DarkOrchid;
    padding-bottom: 10px;
}

.sub-menu button {
    background-color: rgba(0, 0, 0, 0.7);
    color: DarkOrchid;
    border: 2px solid DarkOrchid;
    padding: 6px 16px;
    font-family: 'cairo', sans-serif;
    font-size: 18px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.sub-menu button:hover {
    background-color: DarkOrchid;
    color: white;
    box-shadow: 0 0 8px DarkOrchid;
}

.sub-contenido {
    display: none;
    padding: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    margin-top: 15px;
}

/* Bloques de listas de series */
.bloque-lista {
    display: block;
    width: 100%;
    margin-bottom: 25px;
}

.bloque-lista h2 {
    margin-bottom: 10px; 
    display: block;
}

.bloque-lista ul {
    margin-top: 0;
    padding-left: 20px;
}

/* ==========================================================================
   7. TABLAS
   ========================================================================== */
table {
    width: 100%;
    border-collapse: collapse;
    font-family: Arial, sans-serif;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: indigo;
    color: white;
}

tr:hover {
    background-color: black;
}

/* ==========================================================================
   8. STICKERS Y ELEMENTOS DECORATIVOS
   ========================================================================== */
.sticker-l {
    position: absolute;
    top: 300px;
    left: 360px;
    width: 50px;
    z-index: 100;
}

.sticker-cuerpo {
    position: absolute;
    top: 500px;
    left: 50px;
    width: 100px;
    image-rendering: pixelated;
    z-index: 999;
}

/* ==========================================================================
   9. ANIMACIONES (@keyframes)
   ========================================================================== */
@keyframes moverCintaArriba {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

@keyframes moverCintaAbajo {
    0% { transform: translateY(-50%); }
    100% { transform: translateY(0); }
}

@keyframes carrusel-infinito {
    from { background-position: 0 0; }
    to { background-position: -2000px 0; }
}

@keyframes aparecer {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   10. MEDIA QUERIES (ADAPTACIÓN A MÓVILES)
   ========================================================================== */
@media (max-width: 768px) {
    .contenedor-mosaico {
        grid-template-columns: 1fr;
    }
}