/* ============================================
   VARIABLES Y RESET
============================================ */
:root {
    --red: #cc0000;
    --red-dim: #880000;
    --gold: #ffaa00;
    --bg: #0a0a0a;
    --bg-panel: #0f0f0f;
    --bg-card: #141414;
    --border: #2a2a2a;
    --border-light: #333;
    --text: #d0d0d0;
    --text-dim: #888;
    --text-bright: #f0f0f0;
    --font-display: 'Special Elite', 'Courier New', monospace;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
    --font-names: 'IBM Plex Mono', 'Courier New', monospace;
}

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

/* ============================================
   SPLASH SCREEN
============================================ */
#splash {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    overflow: hidden;
}

#splash::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255,255,255,0.015) 2px,
        rgba(255,255,255,0.015) 4px
    );
    pointer-events: none;
}

#splash .splash-logo {
    width: 130px;
    height: 130px;
    opacity: 0;
    transform: scale(0.7);
    animation: splashLogoIn 0.8s ease forwards 0.4s;
    filter: drop-shadow(0 0 30px rgba(204,0,0,0.5));
}

#splash .splash-line {
    width: 0;
    height: 1px;
    background: var(--red);
    margin: 22px 0;
    animation: splashLineExpand 0.6s ease forwards 1.4s;
    max-width: 340px;
}

#splash .splash-title {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 8px;
    text-transform: uppercase;
    opacity: 0;
    text-align: center;
    animation: splashTextIn 0.7s ease forwards 1.2s;
}

#splash .splash-subtitle {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--red);
    letter-spacing: 4px;
    text-transform: uppercase;
    opacity: 0;
    text-align: center;
    animation: splashTextIn 0.7s ease forwards 1.7s;
}

#splash .splash-bar-wrap {
    margin-top: 40px;
    width: 260px;
    height: 2px;
    background: #1a1a1a;
    border: 1px solid #333;
    overflow: hidden;
    opacity: 0;
    animation: splashTextIn 0s ease forwards 2.1s;
}

#splash .splash-bar-fill {
    height: 100%;
    width: 0;
    background: var(--red);
    animation: splashBarFill 1.2s ease forwards 2.2s;
    box-shadow: 0 0 8px var(--red);
}

#splash .splash-status {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: #555;
    letter-spacing: 2px;
    margin-top: 8px;
    opacity: 0;
    animation: splashTextIn 0s ease forwards 2.1s;
}

#splash.fade-out {
    animation: splashFadeOut 0.8s ease forwards;
}

@keyframes splashLogoIn {
    to { opacity: 1; transform: scale(1); }
}
@keyframes splashLineExpand {
    to { width: 340px; }
}
@keyframes splashTextIn {
    to { opacity: 1; }
}
@keyframes splashBarFill {
    to { width: 100%; }
}
@keyframes splashFadeOut {
    to { opacity: 0; pointer-events: none; }
}

/* ============================================
   BODY Y LAYOUT
============================================ */
body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-mono);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    background-size: 160px;
    pointer-events: none;
    z-index: 8888;
    opacity: 0.35;
}

/* ============================================
   SIDEBAR
============================================ */
.sidebar {
    width: 270px;
    min-width: 270px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border-light);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, var(--red), transparent 60%);
}

.sidebar-logo {
    width: 100px;
    display: block;
    margin: 0 auto 18px auto;
    filter: drop-shadow(0 0 12px rgba(204,0,0,0.3));
    transition: filter 0.3s;
}
.sidebar-logo:hover { filter: drop-shadow(0 0 20px rgba(204,0,0,0.6)); }

.sidebar-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: normal;
    color: #fff;
    text-align: center;
    letter-spacing: 3px;
    line-height: 1.3;
    text-transform: uppercase;
}

.sidebar-subtitle {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-dim);
    text-align: center;
    margin-top: 4px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.stamp {
    border: 1.5px solid var(--red);
    color: var(--red);
    padding: 4px 12px;
    display: block;
    width: fit-content;
    margin: 16px auto;
    transform: rotate(-4deg);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(204,0,0,0.15);
    position: relative;
}

.sidebar-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 14px 0;
}

.menu-label {
    font-size: 0.62rem;
    color: #444;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.menu li {
    cursor: pointer;
    color: #777;
    font-size: 0.78rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 8px 10px;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0;
}

.menu li::before {
    content: '> ';
    color: #333;
    transition: color 0.2s;
    flex-shrink: 0;
    white-space: pre;
}

.menu li:hover {
    color: var(--text-bright);
    border-left-color: #555;
    background: rgba(255,255,255,0.02);
}

.menu li:hover::before { color: #777; }

.menu li.active {
    color: #fff;
    border-left-color: var(--red);
    background: rgba(204,0,0,0.05);
}

.menu li.active::before { color: var(--red); }

.sidebar-footer {
    margin-top: auto;
    font-size: 0.6rem;
    color: #333;
    line-height: 1.8;
    letter-spacing: 1px;
    border-top: 1px solid var(--border);
    padding-top: 14px;
}

/* ============================================
   MAIN CONTENT
============================================ */
.main-content {
    flex: 1;
    padding: 36px 52px;
    overflow-y: auto;
    position: relative;
}

.main-content::-webkit-scrollbar { width: 4px; }
.main-content::-webkit-scrollbar-track { background: var(--bg); }
.main-content::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 2px; }
.main-content::-webkit-scrollbar-thumb:hover { background: #444; }

/* ============================================
   SECCIONES
============================================ */
.section { display: none; animation: sectionFadeIn 0.35s ease; }
.section.active { display: block; }

@keyframes sectionFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: #fff;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 12px;
    margin-bottom: 24px;
    margin-top: 0;
    position: relative;
}

h2::before {
    content: '';
    position: absolute;
    bottom: -1px; left: 0;
    width: 60px; height: 1px;
    background: var(--red);
}

p {
    text-align: justify;
    color: #b0b0b0;
    line-height: 1.85;
    margin-top: 5px;
    font-size: 0.88rem;
}

.intro-text {
    background: rgba(255,255,255,0.02);
    border-left: 2px solid #444;
    padding: 10px 16px;
    margin-bottom: 28px;
    font-size: 0.88rem;
    color: #888;
    font-style: italic;
    letter-spacing: 0.5px;
}

/* ============================================
   REPORT CARDS
============================================ */
.report-card {
    border: 1px solid var(--border-light);
    border-top: 2px solid var(--red);
    background: var(--bg-card);
    padding: 28px;
    margin-bottom: 28px;
    position: relative;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
    transition: box-shadow 0.3s;
}

.report-card:hover {
    box-shadow: 0 6px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(204,0,0,0.1);
}

.report-card::after {
    content: attr(data-case);
    position: absolute;
    top: 10px; right: 18px;
    font-size: 0.6rem;
    color: #2a2a2a;
    letter-spacing: 2px;
    font-family: var(--font-mono);
}

.report-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: normal;
    letter-spacing: 2px;
    margin-top: 0;
    margin-bottom: 4px;
    color: #fff;
    text-transform: uppercase;
}

/* In movimientos, boost report-title even more */
#movimientos .report-title {
    font-size: 1.4rem;
    color: #fff;
    letter-spacing: 3px;
}

.report-date {
    color: #555;
    font-size: 0.82rem;
    display: block;
    margin-bottom: 22px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ============================================
   HISTORIA LAYOUT
============================================ */
.historia-layout {
    display: flex;
    gap: 36px;
    align-items: flex-start;
}

/* Historia section uses the standard two-column historia-layout */

.historia-textos { flex: 6.5; }

.historia-evidencia {
    flex: 3.5;
    background: #0a0a0a;
    border: 1px solid var(--border);
    border-top: 2px solid var(--red);
    padding: 18px;
    position: sticky;
    top: 0;
}

.fase-bloque { margin-bottom: 32px; }

.fase-titulo {
    background: rgba(204,0,0,0.07);
    border-left: 3px solid var(--red);
    padding: 8px 14px;
    margin: 0 0 14px 0;
    color: var(--text-bright);
    letter-spacing: 1.5px;
    font-size: 0.92rem;
    width: fit-content;
    padding-right: 28px;
    text-transform: uppercase;
    font-family: var(--font-mono);
}

/* In movimientos, fase-titulo is secondary — make it subtler */
#movimientos .fase-titulo {
    background: transparent;
    border-left: 2px solid #333;
    color: #555;
    font-size: 0.72rem;
    letter-spacing: 2px;
}

/* ============================================
   HISTORIA SLIDER
============================================ */
.slider-content-wrap {
    position: relative;
    min-height: 220px; /* baseline; JS will override with measured max */
}

.historia-slide {
    display: none;
}

.historia-slide.active {
    display: block;
    animation: historiaSlideIn 0.38s ease;
}

.historia-slide.exiting {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0;
    pointer-events: none;
    animation: historiaSlideOut 0.32s ease forwards;
}

@keyframes historiaSlideIn {
    from { opacity: 0; transform: translateX(14px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes historiaSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(-14px); }
}

.slider-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.slider-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    color: #555;
    font-size: 1.3rem;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    font-family: var(--font-mono);
    flex-shrink: 0;
    line-height: 1;
}

.slider-btn:hover {
    border-color: var(--red);
    color: var(--red);
    background: rgba(204,0,0,0.05);
}

.slider-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.slider-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #333;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    display: inline-block;
}

.slider-dot.active {
    background: var(--red);
    transform: scale(1.3);
}

.slider-dot:hover:not(.active) {
    background: #666;
}

.slider-phase-info {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.slider-counter {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: #444;
    letter-spacing: 2px;
}

.slider-counter span {
    color: var(--red);
}

/* ============================================
   EVIDENCIA THUMBNAILS
============================================ */
.anexo-header {
    text-align: center;
    margin-bottom: 16px;
}

.anexo-stamp {
    display: inline-block;
    border: 1.5px solid var(--gold);
    color: var(--gold);
    padding: 3px 10px;
    font-size: 0.65rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-family: var(--font-mono);
    margin-bottom: 6px;
}

.anexo-sub {
    font-size: 0.62rem;
    color: #444;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.anexo-hr { border: none; border-top: 1px dashed #2a2a2a; margin: 12px 0; }

.thumbnail-grid { display: flex; flex-wrap: wrap; gap: 6px; justify-content: space-between; }

.thumbnail-grid .mov-box:last-child:nth-child(odd),
.thumbnail-grid .hist-box:last-child:nth-child(odd) {
    margin-left: auto;
    margin-right: auto;
}

.hist-box, .mov-box {
    width: calc(50% - 3px);
    background: #111;
    border: 1px solid #222;
    padding: 4px;
    padding-bottom: 8px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
}

.hist-box:hover, .mov-box:hover {
    border-color: var(--red);
    transform: scale(1.01);
}

.hist-box img {
    width: 100%; height: 100px;
    object-fit: cover; object-position: center;
    display: block;
    transition: opacity 0.2s;
}

.mov-box img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover; object-position: center;
    display: block;
    transition: opacity 0.2s;
}

.hist-box:hover img, .mov-box:hover img { opacity: 0.75; }

.hist-caption, .mov-caption {
    font-size: 0.6rem;
    color: #555;
    margin-top: 6px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* ============================================
   SPOTS
============================================ */
.image-grid { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; }

.image-box {
    width: 230px;
    background: #111;
    border: 1px solid var(--border);
    padding: 5px;
    padding-bottom: 10px;
    transition: border-color 0.2s, transform 0.2s;
}

.image-box:hover { border-color: #555; transform: translateY(-2px); }

.image-box img {
    width: 100%; height: 128px;
    object-fit: cover; object-position: top;
    display: block;
    cursor: pointer;
    transition: opacity 0.2s;
}

.image-box:hover img { opacity: 0.8; }
.image-caption { font-size: 0.7rem; color: #666; margin-top: 8px; text-transform: uppercase; letter-spacing: 1px; text-align: center; padding: 0 4px; }

/* ============================================
   MAPA JERÁRQUICO
============================================ */
.org-chart { display: flex; flex-direction: column; align-items: center; gap: 0; margin-top: 16px; }

.org-group {
    border: 1px solid var(--border);
    background: var(--bg-card);
    padding: 28px 20px;
    margin-bottom: 28px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.org-group::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
}

.org-group:nth-child(1)::before { background: var(--red); }
.org-group:nth-child(2)::before { background: var(--red-dim); }
.org-group:nth-child(3)::before { background: #444; }
.org-group:nth-child(4)::before { background: #333; }

.org-category-title {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 22px;
    padding: 5px 16px;
    border: 1px solid var(--border);
    background: var(--bg);
}

.org-level { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; width: 100%; }

.org-node, .mugshot {
    background: var(--bg);
    border: 1px solid var(--border-light);
    padding: 14px;
    width: 160px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.org-node:hover, .mugshot:hover {
    border-color: #666;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}

.org-node img, .mugshot-photo {
    width: 80px; height: 80px;
    object-fit: cover; object-position: top;
    border: 1px solid var(--border-light);
    display: block;
    margin: 0 auto;
}

/* NOMBRES en mapa jerárquico y mugshots: Oswald — legible, mixed case */
.org-node strong, .mugshot strong {
    display: block;
    font-size: 1rem;
    color: var(--text-bright);
    margin-top: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Oswald', 'Arial Narrow', sans-serif;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: none;
}

.org-title {
    font-size: 0.6rem;
    color: #444;
    display: block;
    margin-top: 4px;
    border-top: 1px solid var(--border);
    padding-top: 5px;
    letter-spacing: 1px;
    font-family: var(--font-mono);
}

.don-node { border-top: 3px solid var(--red); width: 185px; }
.don-node img { width: 105px; height: 105px; }
.comision-node { border-top: 2px solid var(--red-dim); }
.desc-node { border-top: 1px solid #333; }

.busqueda-section {
    margin-top: 32px;
    width: 100%;
    text-align: center;
    border-top: 1px dashed #2a2a2a;
    padding-top: 32px;
}

.busqueda-label {
    font-size: 0.65rem;
    color: var(--gold);
    letter-spacing: 3px;
    font-family: var(--font-mono);
    margin-bottom: 20px;
    text-transform: uppercase;
}

.busqueda-node { border-top: 2px solid var(--gold) !important; }

/* ============================================
   POSIBLES MIEMBROS
============================================ */
.panel-miembros {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    padding: 22px;
}

.panel-header { text-align: center; margin-bottom: 20px; }

.panel-stamp {
    display: inline-block;
    border: 1.5px solid var(--red);
    color: var(--red);
    padding: 3px 12px;
    font-size: 0.72rem;
    letter-spacing: 3px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.panel-stamp.gold { border-color: var(--gold); color: var(--gold); }

.panel-sub { font-size: 0.65rem; color: #444; letter-spacing: 2px; }

.panel-hr { border: none; border-top: 1px dashed var(--border); margin: 14px 0; }

.mugshot-grid { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

.mugshot {
    width: 158px;
    padding: 12px;
}

/* Nombre de miembro en mugshot: Oswald */
.mugshot strong {
    font-size: 1rem;
    letter-spacing: 0.5px;
    font-weight: 500;
    font-family: 'Oswald', 'Arial Narrow', sans-serif;
    text-transform: none;
}

.status-stamp {
    color: var(--red);
    font-size: 0.65rem;
    border: 1px solid var(--red);
    margin-top: 8px;
    padding: 2px 6px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
}

/* roles bajo los nombres en mugshots */
.mugshot-role {
    font-size: 0.72rem;
    color: #555;
    letter-spacing: 1px;
    font-family: var(--font-mono);
}

/* ============================================
   ÍNDICE INTERACTIVO LOGROS
============================================ */
.logros-index {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--red);
    padding: 18px 22px;
    margin-bottom: 32px;
}

.logros-index-title {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: #444;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.logros-index-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.logros-index-list a {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #888;
    text-decoration: none;
    letter-spacing: 1px;
    transition: color 0.2s;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.logros-index-list a:hover { color: #fff; }
.logros-index-list a:hover .logros-index-num { color: var(--red); }

.logros-index-num {
    font-size: 0.65rem;
    color: #333;
    min-width: 22px;
    transition: color 0.2s;
}

.logros-index-familia { color: var(--red); }
.logros-index-sep { color: #333; }

/* ============================================
   TIPOGRAFÍA MODAL PERFIL — unificada con tarjetas
============================================ */
.perfil-modal-inner,
.perfil-modal-inner p,
.perfil-data-block p,
#perfilDescripcionGeneral,
#perfilDescripcionGeneral p {
    font-family: var(--font-mono);
}

/* Rol dentro de mugshot — ligeramente más visible */
.mugshot-role,
.mugshot span {
    font-size: 0.70rem;
}

/* ============================================
   MODALES
============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: rgba(0,0,0,0.92);
    justify-content: center;
    align-items: center;
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content { max-width: 90%; max-height: 90%; border: 1px solid #333; box-shadow: 0 0 40px rgba(0,0,0,0.8); }

.close-btn {
    position: absolute;
    top: 18px; right: 32px;
    color: #555;
    font-size: 40px;
    cursor: pointer;
    transition: color 0.2s;
    font-family: var(--font-mono);
    line-height: 1;
}
.close-btn:hover { color: var(--red); }

.prev-btn, .next-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
    font-size: 42px;
    cursor: pointer;
    padding: 16px;
    user-select: none;
    transition: color 0.2s, background 0.2s;
    background: rgba(0,0,0,0.4);
    border-radius: 3px;
}
.prev-btn { left: 2%; }
.next-btn { right: 2%; }
.prev-btn:hover, .next-btn:hover { color: #fff; background: rgba(204,0,0,0.3); }

/* MODAL PERFIL */
.perfil-modal-inner {
    background: var(--bg-card);
    padding: 32px;
    text-align: center;
    max-width: 660px;
    width: 90vw;
    border: 1px solid #2a2a2a;
    border-top: 2px solid var(--red);
    max-height: 88vh;
    overflow-y: auto;
    position: relative;
}

.perfil-modal-inner::-webkit-scrollbar { width: 3px; }
.perfil-modal-inner::-webkit-scrollbar-thumb { background: #333; }

.perfil-img-wrap {
    width: 200px; height: 200px;
    margin: 0 auto 20px;
    border: 1px solid #333;
    position: relative;
    overflow: hidden;
}

.perfil-img-wrap img {
    width: 100%; height: 100%;
    object-fit: cover; object-position: top;
    display: block;
}

#perfilNombreCompleto {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 3px;
    text-transform: uppercase;
}

#perfilRango {
    font-size: 0.7rem;
    color: #555;
    letter-spacing: 3px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
    margin-bottom: 18px;
    margin-top: 4px;
    text-transform: uppercase;
}

.perfil-data-block {
    text-align: left;
    background: #0a0a0a;
    padding: 14px 16px;
    border: 1px solid var(--border);
    margin-bottom: 18px;
}

.perfil-data-label {
    font-size: 0.62rem;
    color: #444;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.perfil-data-block p {
    font-size: 0.8rem;
    color: #aaa;
    margin: 4px 0;
    text-align: left;
}

.perfil-desc-container {
    text-align: left;
}

.perfil-desc-label {
    font-size: 0.62rem;
    color: #444;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-transform: uppercase;
    display: block;
}

#perfilDescripcionGeneral {
    font-size: 0.82rem;
    color: #999;
    line-height: 1.7;
}

#perfilDescripcionGeneral p { font-size: 0.82rem; color: #999; text-align: left; }

/* ============================================
   BARRA DE ESTADO
============================================ */
.status-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 26px;
    background: #080808;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 24px;
    z-index: 500;
    font-size: 0.6rem;
    color: #333;
    letter-spacing: 1.5px;
    font-family: var(--font-mono);
}

.status-bar .status-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #1a5c1a;
    display: inline-block;
    margin-right: 6px;
    animation: statusBlink 2.5s ease-in-out infinite;
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.status-bar .status-right {
    margin-left: auto;
}

/* ============================================
   MÁS INFORMACIÓN — layout de dos columnas
============================================ */

/* Contenedor principal de cada entrada */
.masinfo-entry {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    margin-bottom: 8px;
}

/* Columna izquierda: imagen + título + texto */
.masinfo-main {
    flex: 1;
    min-width: 0;
}

.masinfo-crew-header {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 14px;
}

.masinfo-crew-img-wrap {
    flex-shrink: 0;
    width: 68px;
    height: 68px;
    border: 1px solid var(--border-light);
    overflow: hidden;
    background: #111;
}

.masinfo-crew-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    cursor: pointer;
    transition: opacity 0.2s;
    display: block;
}

.masinfo-crew-img-wrap img:hover { opacity: 0.75; }

/* Columna derecha: ficha de datos */
.masinfo-panel {
    flex-shrink: 0;
    width: 240px;
    background: #0a0a0a;
    border: 1px solid var(--border);
    border-left: 2px solid var(--red);
    padding: 14px 16px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
}

.masinfo-panel-label {
    font-size: 0.6rem;
    color: #444;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.masinfo-panel-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 10px;
}

.masinfo-panel-row:last-child { margin-bottom: 0; }

.masinfo-panel-key {
    font-size: 0.58rem;
    color: #444;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.masinfo-panel-val {
    color: #aaa;
    font-size: 0.72rem;
    line-height: 1.4;
}

/* Nivel de amenaza */
.masinfo-threat { font-weight: 700; letter-spacing: 1px; }
.masinfo-threat--high  { color: var(--red); }
.masinfo-threat--med   { color: var(--gold); }
.masinfo-threat--low   { color: #4a8c4a; }

/* Estado operativo */
.masinfo-status--active {
    color: #4a8c4a;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Responsive: stack on mobile */
@media (max-width: 700px) {
    .masinfo-entry { flex-direction: column; }
    .masinfo-panel { width: 100%; }
}

/* ============================================
   OTROS LOGROS
============================================ */
#logros .historia-textos p {
    font-size: 1rem;
}

.logro-card {
    border: 1px solid var(--border);
    background: #0d0d0d;
    padding: 22px;
    margin-bottom: 16px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    transition: border-color 0.2s;
}

.logro-card:hover { border-color: #444; }

.logro-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    width: 50px;
    text-align: center;
    filter: grayscale(0.4);
}

.logro-body {}
.logro-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-bright);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.logro-desc { font-size: 0.82rem; color: #777; line-height: 1.7; }
.logro-date { font-size: 0.65rem; color: #444; letter-spacing: 2px; margin-top: 6px; text-transform: uppercase; }

.logros-stat-row {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.stat-box {
    flex: 1;
    min-width: 120px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: 2px solid var(--red);
    padding: 18px 16px;
    text-align: center;
}

.stat-num {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--red);
    display: block;
    line-height: 1;
    word-break: break-word;
}

/* Smaller variant for longer stat values like year ranges */
.stat-num.stat-num--sm {
    font-size: 1.5rem;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.6rem;
    color: #444;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 6px;
    display: block;
}

/* ============================================
   PDF VIEWER
============================================ */
.pdf-wrapper {
    border: 1px solid var(--border-light);
    border-top: 2px solid var(--red);
    background: var(--bg-card);
    padding: 22px;
}

.pdf-container {
    display: flex;
    justify-content: center;
    background: #0a0a0a;
    border: 1px solid var(--border);
    padding: 16px;
}

.pdf-frame {
    width: 780px;
    max-width: 100%;
    height: 78vh;
    border: none;
    background: #fff;
    display: block;
    box-shadow: 0 4px 32px rgba(0,0,0,0.6);
}

/* ============================================
   RESPONSIVE (CORREGIDO)
============================================ */
@media (max-width: 1000px) {
    /* Reseteamos el body */
    body { 
        overflow: auto; 
        height: auto; 
        display: block; 
    }

    /* EL ARREGLO PRINCIPAL: Apilamos el dashboard y le quitamos la restricción de altura */
    #dashboard { 
        flex-direction: column; 
        height: auto !important; /* Sobrescribe el 100vh del index.html */
        min-height: 100vh;
    }

    /* Ajustes de la barra lateral (ahora menú superior) */
    .sidebar { 
        width: 100%; 
        min-width: unset; 
        border-right: none; 
        border-bottom: 1px solid var(--border-light); 
        padding: 18px; 
        max-height: unset; /* Evita que el menú se corte si es muy largo */
    }
    
    .sidebar::before { display: none; }
    
    /* Centramos los botones del menú para que se vean mejor */
    .menu { 
        flex-direction: row; 
        flex-wrap: wrap; 
        gap: 6px; 
        justify-content: center; 
    }
    
    .menu li { font-size: 0.7rem; padding: 6px 8px; }
    
    /* El contenido principal ahora puede fluir hacia abajo libremente */
    .main-content { 
        padding: 20px; 
        flex: 1; 
        overflow-y: visible; 
    }
    
    /* Ajustes de los artículos y evidencias */
    .historia-layout { flex-direction: column; }
    .historia-evidencia { position: static; width: 100%; margin-top: 24px; }
    .hist-box, .mov-box { width: calc(50% - 3px); }
    
    /* Ocultamos elementos innecesarios en móvil */
    .status-bar { display: none; }
    body::after { display: none; }

    /* --- PROTECCIÓN EXTRA PARA OTRAS SECCIONES --- */
    
    /* El menú de inicio (directorios) a una sola columna */
    .menu-screen-grid {
        grid-template-columns: 1fr;
    }

    /* Las estadísticas de "Otros Logros" apiladas */
    .logros-stat-row {
        flex-direction: column;
    }

    /* Fichas de información (Crews/Medallas) apiladas */
    .masinfo-entry {
        flex-direction: column;
    }
    .masinfo-panel {
        width: 100%;
    }
}

/* =========================================
   PANTALLA DE MENÚ INTERMEDIO
   ========================================= */
#main-menu-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #0d0d0d;
    background-image: radial-gradient(circle, #1a1a1a 0%, #050505 100%);
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #e0e0e0;
    font-family: 'IBM Plex Mono', monospace;
}

.menu-screen-logo {
    width: 110px;
    margin-bottom: 20px;
    opacity: 0.8;
    filter: grayscale(80%) drop-shadow(0 0 10px rgba(0,0,0,0.5));
}

.menu-screen-title {
    font-family: 'Special Elite', cursive;
    font-size: 2.2rem;
    color: #ffffff;
    margin-bottom: 5px;
    text-align: center;
    letter-spacing: 2px;
}

.menu-screen-subtitle {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 40px;
    letter-spacing: 4px;
}

.menu-screen-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 700px;
    width: 90%;
}

.menu-screen-btn {
    background-color: #111;
    border: 1px solid #333;
    color: #999;
    padding: 16px 20px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    position: relative;
}

.menu-screen-btn::before {
    content: '>';
    color: #8a1c1c; /* Un rojo oscuro y apagado */
    margin-right: 12px;
    font-weight: bold;
    transition: color 0.2s ease;
}

.menu-screen-btn:hover {
    border-color: #8a1c1c;
    color: #fff;
    background-color: #1a0505; /* Fondo rojizo súper oscuro */
    box-shadow: inset 0 0 15px rgba(138, 28, 28, 0.1);
}

.menu-screen-btn:hover::before {
    color: #d12a2a;
}

.menu-screen-footer {
    position: absolute;
    bottom: 30px;
    font-size: 0.75rem;
    color: #1a7a1a; /* Verde terminal */
    letter-spacing: 2px;
}

/* ============================================
   SECCIÓN DE VIDEOS
============================================ */
.video-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.video-gallery .report-card {
    margin-bottom: 0;
    padding: 20px;
}

@media (max-width: 900px) {
    .video-gallery {
        grid-template-columns: 1fr;
    }
}