/* --- SISTEMA DE DISEÑO E HÍBRIDO ESTÉTICO: NEBULOSA LÍQUIDA + CÁPSULA DE CRISTAL --- */
:root {
    --bg-dark: #070612;
    --bg-card: rgba(10, 9, 21, 0.78); /* Cristal esmerilado oscuro abisal */
    --border-color: rgba(0, 168, 204, 0.25);
    
    /* Colores Temáticos */
    --color-primary: #00a8cc;     /* Azul Hielo / Polar */
    --color-secondary: #e0115f;   /* Rosa Supernova / Magenta */
    --color-green: #2ecc71;       /* Verde Éxito */
    --color-orange: #ffb90f;      /* Ámbar Alerta */
    --color-cyan: #00e5ff;        /* Telemetría */
    --color-red: #ff4757;         /* Peligro */
    
    /* Colores de Texto */
    --text-main: #ebf2fa;         /* Texto blanco hielo principal */
    --text-muted: #a0a5c0;        /* Texto secundario gris plateado */
    --text-light: #ffffff;        /* Texto blanco puro */
    
    /* Tipografías Premium */
    --font-sans: 'Montserrat', sans-serif;
    --font-serif: 'Merriweather', serif;
    --font-mono: 'Space Mono', monospace;
    --transition-speed: 0.25s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    /* Gradientes dinámicos de nebulosa líquida en el fondo */
    background-image: 
        radial-gradient(circle at 15% 20%, rgba(224, 17, 95, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 85% 80%, rgba(0, 168, 204, 0.13) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(30, 20, 50, 0.15) 0%, transparent 70%);
    color: var(--text-main);
    font-family: var(--font-sans);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
}

/* --- CONTENEDOR PRINCIPAL --- */
.app-container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* --- CABECERA TRASLÚCIDA (CÁPSULA DE CRISTAL) --- */
.diegetic-header {
    background-color: rgba(10, 9, 21, 0.85);
    border-bottom: 1.5px solid var(--color-primary);
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 30px rgba(0, 168, 204, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 20;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo h1 {
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 1.1rem;
    color: #ffffff;
    letter-spacing: 2px;
}

.header-logo h1 em {
    color: var(--color-secondary);
    font-style: normal;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background-color: var(--color-primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--color-primary);
    animation: pulse 1.8s infinite;
}

.header-status {
    display: flex;
    gap: 24px;
}

.status-indicator {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.status-indicator .lbl {
    font-size: 0.65rem;
    color: #8fa0b5;
    font-family: var(--font-mono);
    letter-spacing: 1px;
}

.status-indicator .val {
    font-family: var(--font-mono);
    font-weight: bold;
    font-size: 0.95rem;
}

.status-indicator .val.green { color: var(--color-green); text-shadow: 0 0 6px rgba(46, 204, 113, 0.4); }
.status-indicator .val.orange { color: var(--color-orange); text-shadow: 0 0 6px rgba(255, 185, 15, 0.4); }
.status-indicator .val.cyan { color: var(--color-cyan); text-shadow: 0 0 6px rgba(0, 229, 255, 0.4); }

/* --- GRID PRINCIPAL --- */
.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* BARRA LATERAL NAV */
.sidebar-nav {
    width: 260px;
    background-color: rgba(10, 9, 21, 0.55);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    padding: 24px 12px;
    gap: 10px;
    overflow-y: auto;
}

.nav-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #9ea4b0;
    font-family: var(--font-sans);
    font-weight: 500;
    text-align: left;
    padding: 12px 16px;
    font-size: 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-btn:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
    color: #ffffff;
    background-color: rgba(0, 168, 204, 0.18);
    border-color: rgba(0, 168, 204, 0.4);
    box-shadow: inset 0 0 10px rgba(0, 168, 204, 0.1);
    text-shadow: 0 0 4px rgba(0, 168, 204, 0.3);
}

/* CONTENIDO PRINCIPAL */
.content-viewport {
    flex: 1;
    padding: 28px;
    overflow-y: auto;
    position: relative;
}

.tab-panel {
    display: none;
    animation: fade-in 0.3s ease-out;
}

.tab-panel.active {
    display: block;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 12px;
    margin-bottom: 24px;
}

.panel-header h2 {
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.chapter-code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-primary);
    border: 1px solid rgba(0, 168, 204, 0.4);
    padding: 3px 10px;
    border-radius: 4px;
    background-color: rgba(0, 168, 204, 0.05);
}

/* --- TARJETAS CRISTALINAS (CÁPSULA DE CRISTAL) --- */
.card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: var(--text-main);
    font-family: var(--font-serif);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.welcome-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    background: rgba(10, 9, 21, 0.55);
    border: 1px solid rgba(0, 168, 204, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 15px rgba(0, 168, 204, 0.08);
}

.welcome-text h3 {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 12px;
    color: #ffffff;
}

.welcome-text p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 14px;
}

.capsule-visualizer {
    width: 130px;
    height: 130px;
    flex-shrink: 0;
}

.capsule-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 6px var(--color-primary));
}

/* GRIDS RESPONSIVOS */
.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.card h4 {
    font-family: var(--font-sans);
    color: #ffffff;
    font-weight: 700;
    font-size: 1.08rem;
    margin-bottom: 16px;
    border-left: 3.5px solid var(--color-primary);
    padding-left: 12px;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 14px;
}

.clean-list {
    list-style: none;
}

.clean-list.bullets li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.clean-list.bullets li::before {
    content: "✦";
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: bold;
}

.clean-list.bullets li strong {
    color: var(--text-main);
}

/* --- TABS ESPECÍFICOS --- */

/* 🧬 SIMULADOR DE SEMILLAS */
.seed-generator-bar {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    background: rgba(10, 9, 21, 0.55);
    border: 1px solid rgba(0, 168, 204, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 15px rgba(0, 168, 204, 0.08);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.input-group label {
    font-size: 0.72rem;
    color: #a0a5c0;
    font-family: var(--font-sans);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group input, .input-group select {
    background-color: rgba(7, 6, 18, 0.6);
    border: 1px solid rgba(0, 168, 204, 0.3);
    color: #ebf2fa;
    padding: 10px 14px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    transition: all var(--transition-speed);
}

.input-group input:focus, .input-group select:focus {
    outline: none;
    border-color: var(--color-cyan);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.35);
    background-color: rgba(7, 6, 18, 0.95);
}

.btn {
    padding: 11px 22px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    border: 1px solid transparent;
    transition: all var(--transition-speed);
}

.btn.primary {
    background-color: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

.btn.primary:hover {
    box-shadow: 0 0 12px rgba(0, 168, 204, 0.4);
    transform: translateY(-1px);
}

.btn.secondary {
    background-color: transparent;
    color: #a0a5c0;
    border: 1px solid rgba(0, 168, 204, 0.3);
}

.btn.secondary:hover {
    color: #ffffff;
    border-color: var(--color-primary);
    background-color: rgba(0, 168, 204, 0.15);
}

.block-card {
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.card-header h3 {
    font-family: var(--font-sans);
    font-size: 1rem;
    color: #1d1e2c;
    font-weight: 700;
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid;
    font-weight: bold;
}

.tag.cyan { color: var(--color-primary); border-color: rgba(0, 168, 204, 0.3); background: rgba(0, 168, 204, 0.06); }
.tag.orange { color: #d68100; border-color: rgba(255, 185, 15, 0.4); background: rgba(255, 185, 15, 0.06); }
.tag.green { color: #1e7e34; border-color: rgba(46, 204, 113, 0.4); background: rgba(46, 204, 113, 0.06); }

.terminal-text {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
    color: #ebf2fa;
}

.terminal-text .row {
    margin-bottom: 8px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    padding-bottom: 6px;
}

.terminal-text .label {
    color: var(--text-muted);
}

.terminal-text .val {
    font-weight: bold;
    color: #ffffff;
}

.val-identidad {
    font-weight: bold;
    color: #ffffff;
}

.val-secreto {
    font-weight: bold;
    color: var(--color-secondary);
}

.timeline-card {
    border: 1px solid rgba(0, 168, 204, 0.25);
}

.timeline-container {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 20px 0;
    margin-top: 10px;
}

.timeline-container::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: rgba(0, 168, 204, 0.2);
    z-index: 1;
    transform: translateY(-50%);
}

.timeline-step {
    position: relative;
    z-index: 2;
    background-color: rgba(10, 9, 21, 0.85);
    border: 1px solid rgba(0, 168, 204, 0.3);
    padding: 12px 16px;
    border-radius: 6px;
    width: 18%;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    transition: all var(--transition-speed);
}

.timeline-step:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 12px rgba(0, 168, 204, 0.35);
}

.timeline-step .time {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-primary);
    display: block;
    margin-bottom: 4px;
    font-weight: bold;
}

.timeline-step .desc {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: #a0a5c0;
    font-weight: 500;
    line-height: 1.3;
}

/* 💬 TRABAJO CON FRASES (EXPLORADOR) */
.phrase-workbench-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
    height: 520px;
    overflow: hidden;
}

.scrollable {
    overflow-y: auto;
    border: 1px solid rgba(0, 168, 204, 0.2);
    border-radius: 8px;
    background-color: rgba(7, 6, 18, 0.55);
}

.phrases-list-container {
    height: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th, .data-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table th {
    background-color: rgba(15, 14, 30, 0.95);
    font-family: var(--font-sans);
    color: var(--color-primary);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 5;
    border-bottom: 2px solid var(--color-primary);
}

.data-table tbody tr {
    cursor: pointer;
    transition: all 0.15s;
    color: #a0a5c0;
}

.data-table tbody tr:hover {
    background-color: rgba(0, 168, 204, 0.15);
    color: #ffffff;
}

.data-table tbody tr.selected {
    background-color: rgba(0, 168, 204, 0.25);
    color: var(--color-cyan);
    border-left: 3px solid var(--color-primary);
}

.data-table .mono {
    font-family: var(--font-mono);
    color: var(--color-primary);
    font-weight: bold;
}

/* MONITORES CRT DIEGÉTICOS (Oscuros para contraste de cabina) */
.phrase-preview-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.crt-monitor {
    background-color: #0c0c16;
    border: 3px solid #1f2035;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.crt-monitor.green-monitor {
    border-color: rgba(0, 168, 204, 0.4);
}

.monitor-header {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: #6a6b8c;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 6px;
}

.monitor-screen {
    flex: 1;
    background-color: #040409;
    border-radius: 6px;
    padding: 18px;
    overflow-y: auto;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.85);
}

.phrase-preview-panel .monitor-screen {
    color: var(--color-cyan);
    text-shadow: 0 0 5px rgba(0, 229, 255, 0.45);
    font-family: var(--font-mono);
}

.preview-text {
    line-height: 1.6;
    font-size: 0.95rem;
}

.monitor-controls {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.knob {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #1b1c2b;
    border: 1px solid #2e304a;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.slots-card {
    padding: 18px;
    margin-bottom: 0;
}

.slots-card h5 {
    color: #1d1e2c;
    font-size: 0.8rem;
    margin-bottom: 10px;
    font-family: var(--font-sans);
    font-weight: 700;
}

.slots-inputs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.slot-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.slot-input-group label {
    font-size: 0.65rem;
    color: #5c6370;
    font-family: var(--font-mono);
    font-weight: bold;
}

.slot-input-group input {
    background-color: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    color: #1a1c2d;
    padding: 8px 10px;
    font-size: 0.8rem;
    font-family: var(--font-sans);
}

.slot-input-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    background-color: #ffffff;
}

/* 🚨 EVENTOS */
.filters-card {
    padding: 18px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(240, 244, 248, 0.94) 100%);
}

.filters-grid {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
}

.results-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.results-meta strong {
    color: var(--color-primary);
}

.table-wrapper {
    height: 480px;
}

/* 🎬 CALCULADORA DE FINALES */
.ending-calculator-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px;
    height: auto;
}

.ending-variables-panel h3 {
    font-size: 1.15rem;
    color: #1d1e2c;
    margin-bottom: 6px;
}

.ending-variables-panel .subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.sliders-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-sans);
    font-size: 0.82rem;
}

.slider-labels .label {
    color: #1d1e2c;
    font-weight: 600;
}

.slider-labels .val {
    color: var(--color-primary);
    font-weight: bold;
    font-family: var(--font-mono);
}

.slider-group input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 5px;
    background: rgba(0, 168, 204, 0.2);
    border-radius: 3px;
    outline: none;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    box-shadow: 0 0 6px rgba(0, 168, 204, 0.4);
    transition: transform 0.1s;
}

.slider-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-group .description {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.checkbox-group {
    margin-top: 5px;
}

.switch-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    color: #ebf2fa;
}

.switch-container input {
    display: none;
}

.slider-check {
    position: relative;
    width: 38px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: background-color var(--transition-speed);
}

.slider-check::before {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    left: 3px;
    bottom: 3px;
    background-color: #6c757d;
    border-radius: 50%;
    transition: transform var(--transition-speed), background-color var(--transition-speed);
}

.switch-container input:checked + .slider-check {
    background-color: rgba(0, 168, 204, 0.3);
}

.switch-container input:checked + .slider-check::before {
    transform: translateX(18px);
    background-color: var(--color-primary);
}

.ending-output-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ending-output-panel .crt-monitor {
    height: 300px;
}

.ending-output-panel .monitor-screen {
    color: var(--color-cyan);
    text-shadow: 0 0 5px rgba(0, 229, 255, 0.45);
}

.teletype-output {
    white-space: pre-wrap;
    line-height: 1.65;
    font-size: 0.95rem;
    font-family: var(--font-mono);
}

.active-blocks-card {
    padding: 18px;
    margin-bottom: 0;
}

.active-blocks-card h4 {
    font-size: 0.8rem;
    font-family: var(--font-sans);
    color: var(--text-muted);
    margin-bottom: 12px;
    border-left: none;
    padding-left: 0;
    font-weight: 700;
}

.blocks-badges-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.badge-block {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #8fa0b5;
    padding: 5px 10px;
    font-size: 0.72rem;
    font-family: var(--font-mono);
    border-radius: 4px;
    transition: all var(--transition-speed);
    font-weight: bold;
}

.badge-block.active {
    background-color: rgba(0, 168, 204, 0.18);
    border-color: rgba(0, 168, 204, 0.4);
    color: var(--color-cyan);
}

/* 📐 DIAGRAMAS */
.diagram-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.diagram-card {
    padding: 24px;
}

.svg-container {
    margin-top: 15px;
    background-color: rgba(10, 9, 21, 0.6);
    border: 1px solid rgba(0, 168, 204, 0.2);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    justify-content: center;
}

.flow-svg {
    width: 100%;
    max-width: 600px;
    height: auto;
}

/* Clases específicas SVG (Adaptadas al color Hielo y Magenta) */
.node-seed { fill: rgba(0, 168, 204, 0.12); stroke: var(--color-primary); stroke-width: 1.5; }
.node-sys { fill: rgba(255, 255, 255, 0.03); stroke: rgba(255, 255, 255, 0.15); stroke-width: 1.2; }
.node-output { fill: rgba(224, 17, 95, 0.12); stroke: var(--color-secondary); stroke-width: 1.5; }

.layer-bg { fill: rgba(0, 168, 204, 0.05); stroke: var(--color-primary); stroke-width: 1.2; }
.layer-mid { fill: rgba(255, 185, 15, 0.05); stroke: var(--color-orange); stroke-width: 1.2; }
.layer-fg { fill: rgba(255, 255, 255, 0.02); stroke: rgba(255, 255, 255, 0.15); stroke-width: 1.2; }
.layer-ui { fill: rgba(224, 17, 95, 0.05); stroke: var(--color-secondary); stroke-width: 1.2; }

.svg-txt {
    fill: #ebf2fa;
    font-family: var(--font-sans);
    font-size: 11px;
}

.svg-txt.center {
    text-anchor: middle;
}

.svg-txt.sub {
    font-size: 8px;
    fill: var(--text-muted);
}

.svg-txt.font-bold {
    font-weight: bold;
    fill: #ffffff;
}

/* --- BARRA DE ESTADO INFERIOR --- */
.diegetic-footer {
    background-color: rgba(10, 9, 21, 0.85);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #6c757d;
    letter-spacing: 1px;
}

.blink {
    animation: blink-anim 1.5s infinite;
}

/* --- ANIMACIONES --- */
@keyframes pulse {
    0% { box-shadow: 0 0 2px var(--color-primary); }
    50% { box-shadow: 0 0 10px var(--color-primary); }
    100% { box-shadow: 0 0 2px var(--color-primary); }
}

@keyframes blink-anim {
    0% { opacity: 0.2; }
    50% { opacity: 1; }
    100% { opacity: 0.2; }
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- ADAPTACIONES DE SCROLLBAR --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* --- RESPONSIVIDAD (MOBILE & TV) --- */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
    }
    .sidebar-nav {
        width: 100%;
        height: auto;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        padding: 10px;
        white-space: nowrap;
    }
    .nav-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    .grid-3col {
        grid-template-columns: 1fr;
    }
    .grid-2col {
        grid-template-columns: 1fr;
    }
    .grid-4col {
        grid-template-columns: repeat(2, 1fr);
    }
    .phrase-workbench-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    .gdd-workbench-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    .ending-calculator-layout {
        grid-template-columns: 1fr;
    }
    body {
        overflow-y: auto;
    }
    .app-container {
        height: auto;
        min-height: 100vh;
    }
}

/* --- ESTILOS DE LA WIKI GDD Y EL SIMULADOR DE ESCENAS --- */
.gdd-workbench-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    height: 600px;
    overflow: hidden;
}

.gdd-nav-list {
    list-style: none;
    padding: 10px;
}

.gdd-nav-item {
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    transition: all 0.15s;
    color: #a0a5c0;
    margin-bottom: 6px;
    border: 1px solid transparent;
    font-family: var(--font-sans);
    line-height: 1.3;
}

.gdd-nav-item:hover {
    background-color: rgba(0, 168, 204, 0.15);
    color: #ffffff;
}

.gdd-nav-item.active {
    background-color: rgba(0, 168, 204, 0.18);
    border-color: rgba(0, 168, 204, 0.4);
    color: var(--color-cyan);
    font-weight: bold;
}

.gdd-content-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-bottom: 0;
    overflow: hidden;
}

.gdd-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.gdd-content-header h3 {
    font-family: var(--font-sans);
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 700;
}

.gdd-markdown-body {
    flex: 1;
    overflow-y: auto;
    font-family: var(--font-serif);
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-main);
    padding-right: 10px;
}

.gdd-markdown-body h1, .gdd-markdown-body h2, .gdd-markdown-body h3, .gdd-markdown-body h4 {
    font-family: var(--font-sans);
    color: #ffffff;
    margin-top: 20px;
    margin-bottom: 10px;
}

.gdd-markdown-body h1 { font-size: 1.35rem; border-bottom: 1px solid rgba(0, 168, 204, 0.25); padding-bottom: 6px; }
.gdd-markdown-body h2 { font-size: 1.15rem; }
.gdd-markdown-body h3 { font-size: 1rem; }
.gdd-markdown-body h4 { font-size: 0.9rem; }
.gdd-markdown-body p { margin-bottom: 14px; }
.gdd-markdown-body ul, .gdd-markdown-body ol { margin-bottom: 14px; padding-left: 20px; }
.gdd-markdown-body li { margin-bottom: 6px; }
.gdd-markdown-body strong { color: var(--color-cyan); }
.gdd-markdown-body blockquote {
    border-left: 3.5px solid var(--color-secondary);
    padding-left: 12px;
    margin: 14px 0;
    color: var(--text-muted);
    font-style: italic;
}
.gdd-markdown-body pre {
    background-color: rgba(7, 6, 18, 0.85);
    border: 1px solid rgba(0, 168, 204, 0.25);
    padding: 12px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    overflow-x: auto;
    margin-bottom: 14px;
    white-space: pre-wrap;
}

.red-alarm-border {
    border-color: var(--color-red) !important;
    animation: alarm-glow 1.5s infinite alternate !important;
}

@keyframes alarm-glow {
    from { box-shadow: 0 0 10px rgba(255, 71, 87, 0.2); }
    to { box-shadow: 0 0 25px rgba(255, 71, 87, 0.7); }
}

/* --- ESTILOS DE ESTADÍSTICAS Y GRIDS --- */
.grid-4col {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.mini-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
    background: rgba(10, 9, 21, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.02);
}

.mini-stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 168, 204, 0.35);
    box-shadow: 0 0 15px rgba(0, 168, 204, 0.25), inset 0 0 12px rgba(255, 255, 255, 0.03);
}

.stat-number {
    font-size: 2.1rem;
    font-family: var(--font-mono);
    font-weight: bold;
    margin-bottom: 4px;
    text-shadow: 0 0 8px currentColor;
    line-height: 1.1;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* 🔗 MAPA DE NODOS */
.nodes-view-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 20px;
    height: calc(100vh - 180px);
    min-height: 600px;
}

@media (max-width: 1024px) {
    .nodes-view-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
}

.canvas-card {
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: rgba(10, 9, 21, 0.45);
    border: 1px solid rgba(0, 168, 204, 0.15);
}

.nodes-control-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

.nodes-canvas-container {
    flex: 1;
    position: relative;
    background: radial-gradient(circle at center, rgba(10, 25, 50, 0.3) 0%, rgba(5, 5, 15, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    overflow: hidden;
    cursor: crosshair;
}

.nodes-canvas-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.nodes-inspector-card {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: rgba(10, 9, 21, 0.7);
}

.nodes-inspector-card h3 {
    margin-bottom: 4px;
    color: var(--color-cyan);
    font-family: var(--font-mono);
}

.node-detail-section {
    margin-bottom: 12px;
}

.node-detail-title {
    font-weight: bold;
    color: #fff;
    margin-bottom: 4px;
}

.node-detail-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}
