* {
    box-sizing: border-box;
}

:root {
    --bg-color: #0a0a0b;
    --card-bg: #141417;
    --text-color: #33ff33;
    --accent: #ff4757;
    --glow: 0 0 10px rgba(51, 255, 51, 0.4);
}

body {
    font-family: 'Courier New', Courier, monospace;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Efecto de líneas de escaneo CRT - Capa Superior */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 100;
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
}

/* Barra de Navegación */
nav {
    background: #000;
    border-bottom: 2px solid var(--text-color);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(51, 255, 51, 0.1);
    position: relative;
    z-index: 10;
    flex-wrap: wrap;
}

.logo { font-weight: bold; font-size: 1.2rem; text-transform: uppercase; letter-spacing: 2px; text-decoration:none; color: var(--text-color);}

.menu { display: flex; gap: 20px; }
.menu a, .btn-neon {
    color: var(--text-color);
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.9rem;
    padding: 8px 15px;
    border: 1px solid transparent;
    transition: all 0.3s;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    display: inline-block;
}

.menu a:hover, .btn-neon:hover {
    border: 1px solid var(--text-color);
    background: rgba(51, 255, 51, 0.1);
    box-shadow: var(--glow);
}

/* Variaciones Neón para el Menú */
.btn-neon.btn-red, .menu a.btn-red { color: #ff4757; }
.btn-neon.btn-red:hover, .menu a.btn-red:hover { 
    border-color: #ff4757; 
    background: rgba(255, 71, 87, 0.1); 
    box-shadow: 0 0 10px rgba(255, 71, 87, 0.4); 
}

.btn-neon.btn-yellow, .menu a.btn-yellow { color: #f1c40f; }
.btn-neon.btn-yellow:hover, .menu a.btn-yellow:hover { 
    border-color: #f1c40f; 
    background: rgba(241, 196, 15, 0.1); 
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.4); 
}

.btn-neon.btn-cyan, .menu a.btn-cyan { color: #00d2ff; }
.btn-neon.btn-cyan:hover, .menu a.btn-cyan:hover { 
    border-color: #00d2ff; 
    background: rgba(0, 210, 255, 0.1); 
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.4); 
}

.btn-neon.btn-purple, .menu a.btn-purple { color: #a55eea; }
.btn-neon.btn-purple:hover, .menu a.btn-purple:hover { 
    border-color: #a55eea; 
    background: rgba(165, 94, 234, 0.1); 
    box-shadow: 0 0 10px rgba(165, 94, 234, 0.4); 
}

/* Estructura de página y Sticky Footer */
main {
    flex: 1; /* Esto hace que el main crezca y empuje el footer al fondo */
}

footer {
    background-color: #000;
    border-top: 1px solid var(--text-color);
    padding: 20px 0;
    text-align: center;
    position: relative;
    z-index: 10;
}

/* Contenedores */
.container { 
    width: 90%;
    max-width: 1000px; 
    margin: 40px auto; 
    border: 1px solid var(--text-color); 
    padding: 40px; 
    background: #000; 
    box-shadow: 0 0 20px rgba(51, 255, 51, 0.1); 
    position: relative;
    z-index: 10;
}

/* Utilidades para Layout de Login */
.login-layout { justify-content: center; align-items: center; height: 100vh; overflow: hidden; }
.login-container { max-width: 400px; text-align: center; margin: 0; }

/* Tipografía */
h1 { 
    border-bottom: 2px solid var(--text-color); 
    padding-bottom: 10px; 
    text-transform: uppercase; 
    font-size: 1.5rem;
    margin-top: 0;
    letter-spacing: 2px;
}

h2 { text-transform: uppercase; letter-spacing: 1px; }

.welcome-section {
    border-left: 4px solid var(--text-color);
    padding-left: 25px;
    margin-bottom: 30px;
}

.form-group { margin-bottom: 25px; text-align: left; }
label { display: block; margin-bottom: 10px; font-weight: bold; }

input[type="text"], input[type="password"] {
    width: 100%;
    background: #111;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 12px;
    box-sizing: border-box;
    font-family: inherit;
    outline: none;
}

input[type="text"]:focus, input[type="password"]:focus {
    box-shadow: var(--glow);
}

.login-btn {
    width: 100%;
    background: var(--text-color);
    color: black;
    border: none;
    padding: 15px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1.1rem;
    text-transform: uppercase;
    transition: all 0.2s;
}

.login-btn:hover {
    background: #2ecc71;
    box-shadow: var(--glow);
}

/* Animaciones */
.flicker { animation: flicker 0.15s infinite; }
@keyframes flicker {
    0% { opacity: 0.9; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

/* Cursor Terminal */
.cursor {
    display: inline-block;
    width: 10px;
    height: 20px;
    background: var(--text-color);
    animation: blink 1s step-end infinite;
    vertical-align: middle;
    margin-left: 5px;
}

@keyframes blink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

/* Clases de Utilidad */
.mt-40 { margin-top: 40px !important; }
.mb-0 { margin-bottom: 0 !important; }
.flex-grow { flex-grow: 1; }
.uppercase { text-transform: uppercase; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; }
.btn-auto { width: auto !important; padding: 12px 25px !important; }

.version {
    font-size: 0.7rem;
    margin-top: 20px;
    opacity: 0.5;
}

/* RESPONSIVIDAD */

@media (max-width: 1000px) {
    nav {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .menu {
        justify-content: center;
        width: 100%;
        flex-wrap: wrap;
    }

    .container {
        width: 95%;
        padding: 20px;
        margin: 20px auto;
    }
}

@media (max-width: 600px) {
    .menu {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .menu a {
        text-align: center;
        padding: 10px 5px;
    }

    h1 { font-size: 1.2rem; }
    h2 { font-size: 1.1rem; }
    
    .login-layout {
        overflow-y: auto; /* Permite scroll si el teclado virtual del móvil tapa el form */
        height: auto;
        min-height: 100vh;
    }
}

/* --- ESTILOS SECCIÓN HISTORIA --- */
.history-log {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.history-entry {
    border-left: 3px solid var(--text-color);
    padding: 0 0 10px 25px;
    position: relative;
    transition: all 0.3s ease;
}

.history-entry:hover {
    background: rgba(51, 255, 51, 0.03);
    box-shadow: -5px 0 10px rgba(51, 255, 51, 0.1);
}

.entry-meta {
    font-size: 0.75rem;
    color: var(--text-color);
    opacity: 0.6;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.entry-title {
    margin: 0 0 10px 0;
    font-size: 1.4rem;
    color: #fff;
    text-shadow: var(--glow);
    border: none;
    padding: 0;
}

/* --- NUEVOS ESTILOS HISTORIA --- */
.markup-dict {
    background: rgba(51, 255, 51, 0.05);
    border: 1px dashed var(--text-color);
    padding: 15px;
    margin-bottom: 20px;
    font-size: 0.75rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.markup-dict code { color: #fff; background: #222; padding: 2px 4px; }

textarea.odisea-input {
    width: 100%;
    min-height: 150px;
    background: #111;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 15px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: box-shadow 0.3s ease;
}

textarea.odisea-input:focus {
    box-shadow: var(--glow);
}

.search-box {
    margin: 30px 0;
    display: flex;
    gap: 10px;
    border-bottom: 1px solid rgba(51, 255, 51, 0.3);
    padding-bottom: 20px;
}

/* Interpretación de Tags */
.otag-b { font-weight: bold; }
.otag-i { font-style: italic; }
.otag-u { text-decoration: underline; }
.otag-red { color: #ff4757; text-shadow: 0 0 5px rgba(255, 71, 87, 0.5); }
.otag-yellow { color: #f1c40f; text-shadow: 0 0 5px rgba(241, 196, 15, 0.5); }
.otag-cyan { color: #00d2ff; text-shadow: 0 0 5px rgba(0, 210, 255, 0.5); }
.otag-purple { color: #a55eea; text-shadow: 0 0 5px rgba(165, 94, 234, 0.5); }

/* --- ESTILOS 90s BLOG REPLICA --- */
.blog-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
    margin-top: 20px;
}

.sidebar-retro {
    border: 2px inset #33ff33;
    background: #050505;
    padding: 15px;
    font-size: 0.85rem;
}

.sidebar-retro h3 {
    background: #33ff33;
    color: #000;
    padding: 5px;
    font-size: 0.9rem;
    margin-top: 0;
    text-align: center;
}

.topic-list { list-style: none; padding: 0; margin: 0; }
.topic-list li { margin-bottom: 8px; }
.topic-list a { 
    color: #33ff33; 
    text-decoration: none; 
}
.topic-list a:before { content: "> "; }
.topic-list a:hover { text-decoration: underline; background: #33ff33; color: #000; }

.main-content-retro {
    border: 2px outset #33ff33;
    padding: 20px;
    background: #000;
    min-height: 500px;
}

.blink-text {
    animation: blinker 1s linear infinite;
    color: #ff4757;
    font-weight: bold;
}

@keyframes blinker {
    50% { opacity: 0; }
}

.hit-counter {
    font-family: 'Courier New', monospace;
    background: #222;
    color: #0f0;
    padding: 5px 10px;
    border: 1px solid #555;
    display: inline-block;
    margin-top: 15px;
}

/* --- REPLICA FORO BB AÑOS 90 (THE TRUTH SEEKER) --- */
.blog-root-container {
    background-color: #000040 !important; /* Azul Profundo */
    background-image: url('https://www.transparenttextures.com/patterns/stardust.png'); /* Fondo de estrellas */
    color: #ffffff !important;
    font-family: "Times New Roman", Times, serif !important;
    padding: 20px;
    border: 4px ridge #c0c0c0;
}

/* Desactivar líneas CRT solo para este contenedor si es necesario */
.blog-root-container * { text-shadow: none !important; }

.bb-header {
    background: linear-gradient(to right, #000080, #0080ff, #000080);
    border: 3px outset #ffffff;
    padding: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.bb-header h1 {
    font-family: "Impact", sans-serif;
    color: #ffff00;
    text-transform: none;
    border-bottom: none;
    letter-spacing: normal;
    margin: 0;
}

.bb-table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #c0c0c0;
    background-color: #f0f0f0;
    color: #000;
}

.bb-table th {
    background-color: #000080;
    color: #ffffff;
    padding: 8px;
    text-align: left;
    font-size: 0.9rem;
    border: 1px solid #c0c0c0;
}

.bb-table td {
    padding: 10px;
    border: 1px solid #c0c0c0;
    vertical-align: top;
}

.bb-category-row {
    background-color: #d3d3d3;
    font-weight: bold;
}

.bb-post-preview {
    background-color: #ffffff;
    margin-bottom: 5px;
    color: #000;
}

.bb-link {
    color: #0000ff;
    font-weight: bold;
    text-decoration: underline;
}

.bb-table tbody tr:not(.bb-category-row):hover {
    background-color: #ffffcc;
    cursor: pointer;
}

/* --- ESTILOS LISTADO DE CAMPAÑAS --- */
.campaign-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.campaign-entry {
    border: 1px solid var(--border-color, var(--text-color));
    border-left: 5px solid var(--border-color, var(--text-color));
    padding: 15px;
    background: var(--bg-alpha, rgba(51, 255, 51, 0.05));
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    transition: transform 0.2s ease;
}

.campaign-entry.gm {
    --border-color: #9d4edd;
    --bg-alpha: rgba(157, 78, 221, 0.05);
}

.campaign-entry.player {
    --border-color: #00d4ff;
    --bg-alpha: rgba(0, 212, 255, 0.05);
}

.entry-label {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.7rem;
    padding: 2px 8px;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 5px;
    border: 1px solid var(--border-color);
    color: var(--border-color);
}

.gm .entry-label {
    background: var(--border-color);
    color: #000;
}

.entry-title {
    margin: 5px 0;
    letter-spacing: 2px;
    color: #fff;
    font-size: 1.1rem;
    text-shadow: 0 0 8px rgba(255,255,255,0.2);
}

.entry-subtitle {
    font-size: 0.75rem;
    color: var(--border-color);
    opacity: 0.9;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 1px;
}

.empty-list {
    color: #666;
    text-align: center;
    padding: 20px;
    font-family: monospace;
}
