/* --- CONFIGURACIÓN MAESTRA DE COLORES (VARIABLES) --- */
:root {
    /* MODO DÍA (Invierno) */
    --bg-wall: #546e7a;       /* La pared de fondo (Azul grisáceo) */
    --bg-panel: #eceff1;      /* El color de los paneles (Casi blanco) */
    --bg-element: #ffffff;    /* Elementos internos (como cajas de texto) */
    --text-main: #263238;     /* Color del texto (Gris muy oscuro) */
    --border-color: #263238;  /* Color de los bordes (Hierro) */
    --accent-color: #81d4fa;  /* Color de detalles (Azul hielo) */
    --shadow-color: rgba(0,0,0,0.2);
}

/* MODO NOCHE (Fábrica Apagada) */
body.night-mode {
    --bg-wall: #000000;       /* Fondo: Negro total */
    --bg-panel: #121212;      /* Paneles: Gris carbón muy oscuro */
    --bg-element: #1e1e1e;    /* Elementos: Un poco más claros para resaltar */
    --text-main: #b0bec5;     /* Texto: Gris plata (alto contraste) */
    --border-color: #455a64;  /* Bordes: Gris acero (se nota en lo oscuro) */
    --accent-color: #00e5ff;  /* Detalles: Cian Neón */
    --shadow-color: rgba(0,229,255, 0.1); /* Resplandor sutil */
}

/* --- ESTILOS GENERALES --- */
* {
    box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s; /* Transición suave */
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Courier New', Courier, monospace; 
    background-color: var(--bg-wall); /* Usa variable */
    color: var(--text-main);          /* Usa variable */
    height: 100vh;
    overflow: hidden;
}

/* --- LAYOUT (GRILLA) --- */
.layout-container {
    display: grid;
    grid-template-columns: 220px 1fr 280px;
    grid-template-rows: 100vh;
    gap: 4px;
    background-color: var(--border-color);
    padding: 4px;
    min-width: 1024px; /* Obliga a que siempre tenga tamaño de PC */
    overflow: hidden;  /* Evita que se formen barras de scroll raras afuera */
}

/* --- PANELES COMUNES --- */
.left-sidebar, .center-content, .right-sidebar {
    background-color: var(--bg-panel); /* ¡AQUÍ ESTABA EL ERROR ANTES! */
    color: var(--text-main);
    overflow-y: auto;
    padding: 20px;
}

/* --- IZQUIERDA: MENÚ --- */
.nav-title {
    font-size: 1.2rem;
    font-weight: 900;
    text-transform: uppercase;
    border-bottom: 3px solid var(--border-color);
    margin-bottom: 20px;
    padding-bottom: 5px;
    text-align: center;
    color: var(--text-main);
}

.menu-list { list-style: none; padding: 0; }
.menu-list li { margin-bottom: 12px; }

.menu-btn {
    display: block;
    padding: 10px;
    border: 2px solid var(--border-color);
    background: var(--bg-element); /* Usa variable de elemento */
    color: var(--text-main);
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    box-shadow: 4px 4px 0px var(--border-color); 
}

.menu-btn:hover {
    background: var(--accent-color);
    color: #000; /* Texto negro al pasar el mouse para leer bien */
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--border-color);
    cursor: pointer;
}

/* --- CENTRO: CONTENIDO --- */
.center-content h1 {
    font-size: 2rem;
    text-transform: uppercase;
    border: 3px solid var(--border-color);
    padding: 15px;
    text-align: center;
    background: var(--bg-element); /* Ahora cambiará a oscuro en modo noche */
    box-shadow: 5px 5px 0px var(--shadow-color);
    margin-top: 0;
    color: var(--text-main);
}

/* Estilo para cajas de texto dentro del centro (como la que se ve en tu foto) */
.center-content div {
    background-color: var(--bg-element) !important; /* Fuerza el color oscuro */
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* --- DERECHA: INTERACTIVO --- */
.placeholder-box {
    border: 2px dashed var(--border-color);
    background: var(--bg-element);
    padding: 20px;
    text-align: center;
    margin-top: 20px;
}

/* Botón de Noche/Día */
.interactive-btn {
    width: 100%;
    padding: 15px;
    background: var(--text-main); /* Invierte colores */
    color: var(--bg-panel);
    border: 3px solid var(--border-color);
    cursor: pointer;
    font-weight: bold;
    font-family: inherit;
    box-shadow: 4px 4px 0px var(--border-color);
}

body.night-mode .interactive-btn {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 0 15px var(--accent-color); /* Efecto neón */
    border-color: #fff;
}

/* --- SCROLLBARS --- */
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--bg-wall); }
::-webkit-scrollbar-thumb { 
    background: var(--border-color); 
    border: 2px solid var(--bg-wall);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-color); }

/* --- INDICADOR DE PÁGINA ACTUAL --- */
/* Esto hace que el botón de la página donde estás se vea "presionado" siempre */
.menu-btn.current-page {
    background-color: var(--text-main); /* Color invertido */
    color: var(--bg-panel);
    border-color: var(--accent-color);
    box-shadow: inset 3px 3px 5px rgba(0,0,0,0.5); /* Sombra interna (hundido) */
    transform: translate(2px, 2px); /* Desplazado físicamente */
}

/* Ajuste para que se vea bien en modo noche también */
body.night-mode .menu-btn.current-page {
    background-color: var(--accent-color);
    color: #000;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

/* --- SECCIÓN INTRODUCCIÓN (RPG STYLE) --- */

.intro-container {
    display: flex; /* Pone imagen y texto lado a lado */
    align-items: flex-start;
    gap: 20px;
    margin-top: 20px;
}

/* El área del personaje */
.character-area {
    flex-shrink: 0; /* Evita que la imagen se aplaste */
}

.my-avatar {
    width: 450px; /* Tamaño del dibujo */
    height: auto;
    border: 3px solid var(--border-color);
    background-color: var(--bg-element);
    padding: 5px;
    box-shadow: 4px 4px 0px var(--shadow-color);
}

/* El Globo de Texto */
.speech-bubble {
    position: relative;
    background: var(--bg-element);
    border: 3px solid var(--border-color);
    padding: 20px;
    border-radius: 10px; /* Bordes un poco redondeados */
    box-shadow: 4px 4px 0px var(--shadow-color);
    width: 100%;
}

/* La "colita" del globo (Triángulo CSS) */
.speech-bubble::after {
    content: '';
    position: absolute;
    left: -20px; /* Mueve el triángulo a la izquierda */
    top: 30px;   /* Altura de la flecha */
    border-width: 10px;
    border-style: solid;
    /* Crea el triángulo apuntando a la izquierda */
    border-color: transparent var(--border-color) transparent transparent; 
}

/* Estilos de texto dentro del globo */
.speech-bubble h2 {
    margin-top: 0;
    font-size: 1.5rem;
    border-bottom: 2px dashed var(--border-color);
    padding-bottom: 10px;
}

.divider-line {
    border: 0;
    border-top: 2px solid var(--border-color);
    margin: 20px 0;
}

/* La Lista de Tareas */
.todo-list {
    list-style: none;
    padding: 0;
}

.todo-list li {
    padding: 8px 0;
    padding-left: 25px; /* Espacio para el icono */
    position: relative;
    font-weight: bold;
}

/* Cuadraditos estilo checklist antes de cada item */
.todo-list li::before {
    content: '▢'; /* Un cuadradito vacío */
    position: absolute;
    left: 0;
    color: var(--text-main);
    font-weight: bold;
}

.todo-list li:hover::before {
    content: '▣'; /* Se rellena al pasar el mouse */
    color: var(--accent-color);
}

/* --- RESPONSIVE (Para celulares) --- */
@media (max-width: 600px) {
    .intro-container {
        flex-direction: column; /* Pone uno encima del otro */
        align-items: center;
    }
    
    .speech-bubble::after {
        /* Mueve la flecha hacia arriba en celulares */
        left: 50%;
        top: -20px;
        margin-left: -10px;
        border-color: transparent transparent var(--border-color) transparent;
    }
}

/* --- ESTILOS DE LA PÁGINA DE COMENTARIOS --- */

/* Ajuste del contenedor central para permitir el panel fijo */
.center-content.blog-layout {
    display: flex;
    flex-direction: column;
    padding: 0; /* Quitamos padding del contenedor padre */
    overflow: hidden; /* El scroll lo manejará el hijo */
}

/* Área que se mueve (Posts) */
.blog-scroll-area {
    flex-grow: 1; /* Ocupa todo el espacio disponible */
    overflow-y: auto; /* Aquí está el scroll ahora */
    padding: 20px;
}

/* El Post Individual */
.blog-post {
    display: flex;
    gap: 15px;
    border: 2px solid var(--border-color);
    background: var(--bg-element);
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 4px 4px 0px var(--shadow-color);
}

.post-img img {
    width: 100px;
    height: 100px;
    border: 1px solid var(--border-color);
    object-fit: cover;
}

.post-content {
    flex: 1;
}

.post-footer {
    margin-top: 10px;
    font-weight: bold;
    text-align: right;
    font-style: italic;
    font-size: 0.9rem;
}

/* Publicidad Intermedia */
.ad-space {
    border: 2px dashed var(--border-color);
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
    opacity: 0.7;
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 2px;
}

/* --- EL PANEL FIJO (ROJO EN TU DIBUJO) --- */
.blog-controls {
    flex-shrink: 0;
    border-top: 4px solid var(--border-color);
    background: var(--bg-panel);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Cambio: alineamos arriba */
    height: 180px; /* Hacemos el panel un poco más alto para ver mejor */
}

/* Controles Izquierda (Flechas) */
.nav-arrows {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-arrows button {
    background: var(--bg-element);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    cursor: pointer;
    padding: 5px 10px;
    font-family: inherit;
    font-weight: bold;
}

.nav-arrows button:hover {
    background: var(--accent-color);
    color: #000;
}

/* Controles Derecha (Tabla Calendario) */
.archive-table {
    width: 100%; /* Asegura que se vea bien */
    border: none; /* Quitamos borde doble */
}

/* Modifica el contenedor de la tabla para que tenga SCROLL PROPIO */
.archive-table-container {
    height: 100%;       /* Ocupa todo el alto del panel */
    overflow-y: auto;   /* ¡IMPORTANTE! Esto activa el scroll en la tablita */
    border: 1px solid var(--border-color); /* Borde decorativo */
}

.archive-table td {
    border: 1px solid var(--border-color);
    padding: 4px 8px;
}

.year-cell {
    writing-mode: vertical-lr;
    text-align: center;
    font-weight: bold;
    background: var(--text-main); /* Invertido para destacar */
    color: var(--bg-panel);
    font-size: 1.2rem;
    border-bottom: 4px solid var(--bg-panel); /* Separador entre años */
}

/* Celda de mes */
.month-cell {
    font-size: 0.8rem;
    padding: 2px 5px;
    border-bottom: 1px solid var(--border-color);
}

/* Ajuste Móvil */
@media (max-width: 600px) {
    .blog-post { flex-direction: column; }
    .post-img img { width: 100%; height: auto; }
    .blog-controls { height: auto; flex-direction: column; gap: 10px; }
}

/* --- VISOR DE IMÁGENES (SISTEMA DE INSPECCIÓN) --- */

/* 1. Indicador de que se puede hacer clic */
.post-img img {
    cursor: zoom-in; /* El cursor se convierte en una lupa */
    transition: transform 0.2s, border-color 0.2s;
}

.post-img img:hover {
    transform: scale(1.05); /* Efecto pequeño de zoom al pasar el mouse */
    border-color: var(--accent-color); /* Borde brilla */
}

/* 2. La Capa Oscura (El Modal) */
.image-viewer-modal {
    display: none; /* Oculto por defecto */
    position: fixed;
    z-index: 9999; /* Encima de absolutamente todo */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Fondo casi negro */
    backdrop-filter: blur(5px); /* Desenfoque del fondo industrial */
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

/* Cuando le agregamos la clase 'active', se muestra */
.image-viewer-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

/* 3. La Imagen Grande */
.image-viewer-content {
    max-width: 90%;
    max-height: 80vh; /* Máximo 80% de la altura de la pantalla */
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 20px var(--accent-color); /* Resplandor de neón */
    object-fit: contain; /* Aquí NO recortamos, mostramos todo */
    cursor: zoom-out;
}

/* 4. Texto de estado (Decoración) */
.viewer-caption {
    margin-top: 15px;
    color: var(--accent-color);
    font-family: monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: bold;
}

/* Animación de entrada suave */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- SECCIÓN DE JUEGOS (CATÁLOGO INDUSTRIAL) --- */

/* El Aviso de Precaución (Disclaimer) */
.system-warning {
    border: 2px solid var(--accent-color);
    background: rgba(129, 212, 250, 0.1); /* Azul muy suave transparente */
    padding: 15px;
    margin-bottom: 30px;
    text-align: center;
    border-left: 10px solid var(--accent-color); /* Barra gruesa a la izquierda */
}

/* Títulos de Sección (Estilo etiqueta de archivo) */
.section-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 5px;
    margin-top: 40px;
    margin-bottom: 20px;
    font-size: 1.2rem;
    letter-spacing: 2px;
    color: var(--text-main);
}

/* La Grilla (Grid) de Juegos */
.games-grid {
    display: grid;
    /* Esto crea columnas automáticas. Si la pantalla es grande caben 3, si es chica 1 */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); 
    gap: 20px;
}

/* La Tarjeta del Juego (Card) */
.game-card {
    display: block;
    border: 2px solid var(--border-color);
    background: var(--bg-element);
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* Efecto Hover: Levantar y brillar */
.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 5px 5px 0px var(--accent-color);
    border-color: var(--accent-color);
}

/* Miniatura del juego */
.game-thumb img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-bottom: 2px solid var(--border-color);
    filter: grayscale(80%); /* Desaturado por defecto (estilo invierno) */
    transition: filter 0.3s;
}

.game-card:hover .game-thumb img {
    filter: grayscale(0%); /* A todo color al pasar el mouse */
}

/* Información del texto */
.game-info {
    padding: 15px;
}

.game-info h3 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    text-transform: uppercase;
}

/* Etiquetas (Tags) estilo Steam */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag {
    background: var(--border-color);
    color: var(--bg-panel);
    font-size: 0.7rem;
    padding: 3px 6px;
    border-radius: 2px;
    font-weight: bold;
}

/* --- ESTILOS ESPECÍFICOS POR ESTADO --- */

/* Juegos en Progreso (WIP) */
.game-card.wip {
    border-style: dashed; /* Borde discontinuo para indicar construcción */
}

.game-status {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--accent-color);
    color: #000;
    font-size: 0.7rem;
    text-align: center;
    font-weight: bold;
    padding: 2px 0;
}

/* Conceptos (Más apagados) */
.game-card.concept {
    opacity: 0.7;
}

.game-card.concept:hover {
    opacity: 1;
}

/* --- ESTILOS TIPO BOORU (GALERÍA DE ARTE) --- */

/* Colores de Tags */
.tag-copyright { color: #d084f7; } /* Obra: Violeta */
.tag-character { color: #69f0ae; } /* Personaje: Verde Neon */
.tag-artist { color: #ff5252; }    /* Meta: Rojo */
.tag-general { color: #b0bec5; }   /* General: Gris */

/* 1. PORTADA DE BÚSQUEDA (arte.html) */
.search-landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.featured-art {
    max-width: 400px;
    border: 4px solid var(--border-color);
    margin-bottom: 20px;
    transition: transform 0.3s;
    cursor: pointer;
}
.featured-art:hover { transform: scale(1.02); border-color: var(--accent-color); }

.search-container { position: relative; width: 300px; }
.main-search-bar {
    width: 100%;
    padding: 10px;
    background: var(--bg-element);
    border: 2px solid var(--border-color);
    color: var(--text-main);
    font-family: inherit;
}

/* Sugerencias de búsqueda (Autocompletado) */
.suggestions-box {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-element);
    border: 2px solid var(--border-color);
    border-top: none;
    max-height: 150px;
    overflow-y: auto;
    z-index: 100;
    display: none; /* Oculto por defecto */
}
.suggestion-item {
    padding: 8px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
}
.suggestion-item:hover { background: var(--accent-color); color: #000; }

/* 2. GALERÍA PRINCIPAL (galeria.html) */
.booru-layout {
    display: grid;
    grid-template-columns: 200px 1fr; /* Sidebar Tags | Galería */
    gap: 20px;
    height: 100%;
    overflow: hidden;
}

/* Sidebar de Tags (Izquierda en el contenido) */
.tag-sidebar {
    border-right: 2px dashed var(--border-color);
    padding-right: 15px;
    overflow-y: auto;
    font-size: 0.85rem;
}
.tag-sidebar h3 { font-size: 1rem; border-bottom: 2px solid var(--border-color); }
.tag-list-item { display: block; margin-bottom: 4px; text-decoration: none; }
.tag-list-item:hover { text-decoration: underline; }

/* --- GRID TIPO BOORU (CORREGIDO) --- */
.gallery-grid {
    display: grid;
    /* Cuadrícula automática de 150px */
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); 
    gap: 10px;
    padding-right: 10px;
    align-content: start;
}

.gallery-thumb {
    width: 100%;
    height: 150px; /* Altura fija para que sea una cuadrícula ordenada */
    
    /* 'cover' hace que la imagen llene todo el cuadro. ¡Adiós gaps! */
    object-fit: cover; 
    /* Borde base sutil */
    border: 1px solid var(--border-color);
    cursor: zoom-in;
    transition: box-shadow 0.2s, border-color 0.2s;
}

/* EFECTO HOVER: SOLO RESPLANDOR */
.gallery-thumb:hover {

    border-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
}

/* Paginación (Botones abajo) */
.pagination-bar {
    grid-column: 1 / -1; /* Ocupa todo el ancho */
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding-bottom: 20px;
}
.page-btn {
    padding: 5px 10px;
    background: var(--bg-element);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    cursor: pointer;
}
.page-btn.active { background: var(--accent-color); color: #000; font-weight: bold; }

@media (max-width: 768px) {
    .booru-layout { grid-template-columns: 1fr; }
    .tag-sidebar { display: none; } /* Ocultar sidebar en móvil */
}

/* --- SECCIÓN PERSONAJES (WIKI INDUSTRIAL) --- */

/* Controles de Filtro */
.filter-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.filter-btn {
    background: var(--bg-element);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 15px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    text-transform: uppercase;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--accent-color);
    color: #000;
    box-shadow: 2px 2px 0px var(--border-color);
}

/* Lista de Personajes */
.char-group-title {
    background: var(--border-color);
    color: var(--bg-panel);
    padding: 5px 10px;
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.char-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* La Ficha Individual */
.char-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bg-element);
    border: 1px solid var(--border-color);
    padding: 10px;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.2s;
}

.char-card:hover {
    border-color: var(--accent-color);
    transform: translateX(5px); /* Se mueve un poco a la derecha */
    box-shadow: -4px 0 0 var(--accent-color); /* Barra de luz a la izquierda */
}

.char-icon {
    width: 50px;
    height: 50px;
    border: 1px solid var(--border-color);
    object-fit: cover;
    border-radius: 4px; /* Un poco redondeado como foto de carnet */
}

.char-info h3 {
    margin: 0;
    font-size: 1rem;
}

.char-info span {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* --- SECCIÓN OBRAS (BIBLIOTECA VIRTUAL) --- */

/* La Grilla de Libros (Más estrecha y alta que la de juegos) */
.library-grid {
    display: grid;
    /* Tarjetas de mínimo 200px de ancho (formato vertical) */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); 
    gap: 25px;
    align-items: start;
}

/* La Tarjeta de Libro (Expediente) */
.book-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-element);
    border: 1px solid var(--border-color);
    /* Lomo del libro grueso a la izquierda */
    border-left: 8px solid var(--text-main); 
    text-decoration: none;
    color: var(--text-main);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%; /* Para que todas midan lo mismo en la fila */
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 5px 5px 0px var(--accent-color);
    border-color: var(--accent-color);
    /* El lomo también cambia de color */
    border-left-color: var(--accent-color); 
}

/* Portada Vertical */
.book-cover {
    width: 100%;
    height: 280px; /* Altura fija para que parezca libro */
    overflow: hidden;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cubre todo el espacio */
    transition: filter 0.3s;
    filter: grayscale(80%); /* Estilo invierno desaturado */
}

.book-card:hover .book-cover img {
    filter: grayscale(0%); /* Color al pasar el mouse */
}

/* Info del Libro */
.book-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Ocupa el espacio restante */
}

.book-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    line-height: 1.3;
}

.book-desc {
    font-size: 0.85rem;
    margin-bottom: 15px;
    opacity: 0.8;
    flex-grow: 1;
}

/* Etiquetas específicas para libros */
.book-tag {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.7rem;
    background: var(--border-color);
    color: var(--bg-panel);
    margin-right: 5px;
    font-weight: bold;
}

/* ESTILOS DE ESTADO (Colores del lomo según estado) */
.book-card.wip { border-left-color: #ffd700; border-style: dashed; } /* Amarillo/Dashed */
.book-card.concept { border-left-color: #ff5252; opacity: 0.8; } /* Rojo */

/* --- PANEL DE CONTROL / ASISTENTE (SISTEMA RPG) --- */

.assistant-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: center;
}

/* 1. Nombre del Líder */
.assistant-name {
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 5px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

/* 2. Retrato (Marco) */
.assistant-portrait-frame {
    width: 100%;
    aspect-ratio: 1 / 1; /* Cuadrado perfecto */
    border: 2px solid var(--text-main);
    background: var(--bg-element);
    padding: 5px;
    position: relative;
}

.assistant-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 1px solid var(--border-color);
    transition: filter 0.3s;
}

/* Animación cuando habla o reacciona */
.assistant-img.shaking {
    animation: shake 0.5s;
}

@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

/* 3. Caja de Diálogo */
.dialogue-box {
    background: var(--bg-element);
    border: 2px solid var(--border-color);
    padding: 10px;
    min-height: 80px; /* Altura mínima para que no salte */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 10px;
}

/* El piquito de la burbuja de texto */
.dialogue-box::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 10px 10px 10px;
    border-style: solid;
    border-color: transparent transparent var(--border-color) transparent;
}

.dialogue-text {
    font-family: monospace;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* 4. Botones de Acción */
.action-grid {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 20px; /* Espacio antes del reproductor de música */
}

.action-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 5px;
    font-size: 0.75rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--accent-color);
    color: #000;
    font-weight: bold;
}

/* Estilo especial para "Cambiar Líder" */
.btn-leader { border-color: var(--accent-color); }

/* --- FICHA DE PERSONAJE TRADICIONAL --- */

.char-profile-wrapper {
    background: var(--bg-element);
    border: 2px solid var(--border-color);
    padding: 20px;
    color: var(--text-main);
}

/* Cabecera Central */
.char-profile-header {
    text-align: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.char-name {
    font-size: 2.2rem;
    font-weight: bold;
    margin: 0;
    text-transform: uppercase;
    color: var(--accent-color);
    letter-spacing: 2px;
}

.char-subtitle {
    font-size: 1rem;
    opacity: 0.7;
    text-transform: uppercase;
    font-family: monospace;
}

/* Layout de dos columnas */
.char-profile-grid {
    display: grid;
    grid-template-columns: 250px 1fr; /* Columna izquierda de 250px, el resto para la derecha */
    gap: 25px;
    align-items: start;
}

/* Columna Izquierda: Imagen y Tabla de Datos */
.char-sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.char-image {
    width: 100%;
    border: 2px solid var(--border-color);
    object-fit: cover;
    aspect-ratio: 3/4; /* Formato retrato clásico */
    background: #000;
}

.char-info-table {
    width: 100%;
    border-collapse: collapse;
    font-family: monospace;
    font-size: 0.85rem;
}

.char-info-table th, .char-info-table td {
    border: 1px solid var(--border-color);
    padding: 8px;
    text-align: left;
}

.char-info-table th {
    background: var(--bg-panel);
    width: 40%;
    opacity: 0.8;
}

/* Columna Derecha: Texto e Historia */
.char-main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.char-section {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 20px;
}

.char-section h3 {
    margin-top: 0;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 15px;
    color: var(--accent-color);
    text-transform: uppercase;
    font-size: 1.2rem;
}

.char-section p {
    margin-bottom: 10px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.char-section p:last-child {
    margin-bottom: 0;
}

/* Lista para habilidades o gustos */
.char-list {
    margin: 0;
    padding-left: 20px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.char-list li {
    margin-bottom: 5px;
}

/* --- FICHA DE OBRA LITERARIA / CÓMIC (WIKI) --- */

.work-profile-wrapper {
    background: var(--bg-element);
    border: 2px solid var(--border-color);
    padding: 20px;
    color: var(--text-main);
}

.work-cover {
    width: 100%;
    border: 2px solid var(--border-color);
    object-fit: cover;
    aspect-ratio: 2/3; /* Formato de portada de cómic/libro */
    background: #000;
}

/* Etiquetas de estado para la obra */
.work-status-badge {
    display: inline-block;
    padding: 5px 10px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85rem;
    margin-top: 10px;
    border: 1px solid currentColor;
}

.status-idea { color: #ff5252; } /* Rojo para Conceptos/Ideas */
.status-wip { color: #ffd700; }  /* Amarillo para En Progreso */
.status-done { color: #4caf50; } /* Verde para Terminado */

/* --- PÁGINA DE JUEGO (ESTILO MINI-STEAM) --- */

/* Banner principal (estilo tráiler) */
.game-hero-banner {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border: 2px solid var(--border-color);
    margin-bottom: 20px;
    background: #000;
}

/* Grilla de capturas de pantalla */
.game-screenshots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.game-screenshot {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border: 1px solid var(--border-color);
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
    cursor: pointer;
}

.game-screenshot:hover {
    opacity: 1;
    border-color: var(--accent-color);
}

/* Botón de Descarga / Jugar */
.game-action-btn {
    display: block;
    width: 100%;
    padding: 15px;
    margin-top: 15px;
    background: transparent;
    color: var(--text-main);
    text-align: center;
    border: 2px solid var(--accent-color);
    font-weight: bold;
    font-size: 1.1rem;
    font-family: monospace;
    text-decoration: none;
    text-transform: uppercase;
    transition: all 0.2s;
    box-sizing: border-box;
}

.game-action-btn:hover:not(.disabled) {
    background: var(--accent-color);
    color: #000;
}

.game-action-btn.disabled {
    border-color: var(--border-color);
    color: var(--border-color);
    cursor: not-allowed;
    background: rgba(0,0,0,0.2);
}

/* Caja de requisitos del sistema */
.sys-req-box {
    background: #0a0a0a;
    border: 1px dashed var(--border-color);
    padding: 15px;
    font-family: monospace;
    font-size: 0.85rem;
    color: #4caf50; /* Verde terminal */
    line-height: 1.5;
}