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

html, body {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #000000;
    color: #e2e8f0;
    font-family: 'Consolas', 'Segoe UI', monospace;
}

/* 100% FULLSCREEN CONTAINER */
#game-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =============================================================
   1. MAIN ROOM VIEW (FULLSCREEN COVER 16:9 CONTAINER)
   ============================================================= */
#room-view {
    position: relative;
    width: 177.78vh;
    height: 100vh;
    min-width: 100vw;
    min-height: 56.25vw;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    z-index: 1;
}

.bg-layer {
    width: 100%;
    height: 100%;
    object-fit: fill;
    position: absolute;
    top: 0;
    left: 0;
}

#room-bg-img {
    z-index: 1;
}

#room-bg-lamp-off {
    z-index: 2;
    opacity: 0;
    transition: opacity 0.15s ease-out;
    pointer-events: none;
}

/* ATMOSPHERIC LAMP FLICKER & ROOM AMBIENT LIGHT OVERLAY (100% FULLSCREEN BLEND) */
#lamp-flicker-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    mix-blend-mode: color-dodge;
    background: radial-gradient(circle at 64% 48%, rgba(253, 224, 71, 0.22) 0%, rgba(245, 158, 11, 0.10) 35%, transparent 75%);
    opacity: 0.85;
    transition: opacity 0.15s ease-out;
    animation: lampFlicker 9s infinite ease-in-out;
    will-change: opacity;
    transform: translateZ(0);
}

@keyframes lampFlicker {
    0%, 28%, 34%, 72%, 78%, 100% { opacity: 0.7; }
    30% { opacity: 0.45; }
    31% { opacity: 0.90; }
    32% { opacity: 0.80; }
    88% { opacity: 0.70; }
    89% { opacity: 0.92; }
    90% { opacity: 0.35; }
}

/* DYNAMIC RAIN CANVAS CLIPPED TO EXACT RIVETED WINDOW FRAME INNER INNER EDGE */
#rain-window-mask {
    position: absolute;
    top: 0%;
    left: 3.8%;
    width: 46.8%;
    height: 83.4%;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
    border-radius: 12px;
    clip-path: polygon(10% 0%, 38% 3% ,100% 18%, 100% 71.1%, 10% 93%);
    transform: translateZ(0);
    will-change: contents;
}

/* ANIMATED DESK COFFEE STEAM PARTICLES */
#coffee-steam-container {
    position: absolute;
    top: 50.0%;
    left: 54.2%;
    width: 3.5%;
    height: 10.0%;
    z-index: 8;
    pointer-events: none;
    overflow: visible;
}

.steam-particle {
    position: absolute;
    bottom: 0;
    width: 3px;
    height: 38px;
    background: linear-gradient(to top, rgba(180, 190, 200, 0.35), rgba(150, 160, 170, 0.15) 70%, transparent);
    border-radius: 40% 40% 50% 50%;
    filter: blur(1.0px);
    opacity: 0;
    animation: steamRise 4.5s infinite cubic-bezier(0.25, 0.1, 0.25, 1);
}

.steam-particle.p1 {
    left: 20%;
    animation-delay: 0s;
}

.steam-particle.p2 {
    left: 50%;
    animation-delay: 1.5s;
}

.steam-particle.p3 {
    left: 78%;
    animation-delay: 3.0s;
}

@keyframes steamRise {
    0% {
        transform: translateY(0) scaleY(0.4) scaleX(0.9);
        opacity: 0;
    }
    18% {
        opacity: 0.38;
    }
    60% {
        transform: translateY(-22px) scaleY(1.4) scaleX(1.1) translateX(-3px);
        opacity: 0.20;
    }
    100% {
        transform: translateY(-48px) scaleY(2.0) scaleX(1.2) translateX(4px);
        opacity: 0;
    }
}

/* CLICKABLE ANGLED PERSPECTIVE LAPTOP HOTSPOT ON DESK */
#laptop-hotspot {
    position: absolute;
    top: 46.2%;
    left: 71.0%;
    width: 13.5%;
    height: 17.6%;
    z-index: 10;
    cursor: pointer;
    /* Angled Quadrilateral Perspective Polygon matching screen bezel */
    clip-path: polygon(18% 12%, 94% 15%, 88% 108%, 10% 97%);
    background: rgba(34, 197, 94, 0.05);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#laptop-hotspot::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    transition: all 0.25s ease;
    z-index: -1;
}

#laptop-hotspot:hover::before {
    filter: blur(8px);
    
}

.hotspot-tooltip {
    background: rgba(2, 13, 6, 0.95);
    color: #4ade80;
    border: 1px solid #22c55e;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.5px;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.25s ease;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.9);
    text-align: center;
}

#laptop-pwr-hint {
    color: #facc15;
    margin-left: 4px;
    font-family: monospace;
}

#laptop-hotspot:hover .hotspot-tooltip {
    opacity: 1;
    transform: translateY(0);
}

/* INTERACTIVE CREW LEDGER (PAPER ON WALL BEHIND MONITOR) */
#crew-ledger-hotspot {
    position: absolute;
    top: 25.8%;
    left: 74.0%;
    width: 10.5%;
    height: 21%;
    z-index: 15;
    cursor: pointer;
    background: rgba(245, 245, 240, 0);
    border-radius: 2px;
    transition: all 0.2s ease;
}

#crew-ledger-hotspot:hover {
    background: rgba(254, 243, 199, 0.08);
    box-shadow: 0 0 14px rgba(254, 243, 199, 0.25);
}

.tooltip-ledger {
    top: 50%;
    transform: translateX(-50%) translateY(4px);
    border-color: #a8a29e;
    color: #f5f5f4;
    background: rgba(28, 25, 23, 0.95);
    font-family: monospace;
    font-size: 10px;
}

#crew-ledger-hotspot:hover .tooltip-ledger {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* PHYSICAL WALL BUTTON HOTSPOTS (GREEN ACCEPT & RED REJECT) */
.wall-btn-hotspot {
    position: absolute;
    z-index: 12;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.wall-btn-hotspot.disabled-btn {
    pointer-events: none !important;
    cursor: not-allowed !important;
    opacity: 0.3 !important;
    filter: grayscale(1) !important;
}

#wall-button-accept {
    top: 30.5%;
    left: 54.2%;
    width: 4.8%;
    height: 11.5%;
    background: rgba(34, 197, 94, 0.05);
}

#wall-button-accept:hover {
    background: rgba(34, 197, 94, 0.25);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.6);
}

#wall-button-reject {
    top: 42.4%;
    left: 54.2%;
    width: 4.8%;
    height: 11.5%;
    background: rgba(239, 68, 68, 0.05);
}

#wall-button-reject:hover {
    background: rgba(239, 68, 68, 0.25);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.wall-btn-tooltip {
    position: absolute;
    left: 115%;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.5px;
    opacity: 0;
    transform: translateX(-4px);
    transition: all 0.2s ease;
    pointer-events: none;
    box-shadow: 0 3px 10px rgba(0,0,0,0.85);
}

.tooltip-accept {
    background: rgba(2, 20, 10, 0.92);
    color: #4ade80;
    border: 1px solid #22c55e;
}

.tooltip-reject {
    background: rgba(25, 4, 8, 0.92);
    color: #f87171;
    border: 1px solid #ef4444;
}

.tooltip-lamp {
    border-color: #f59e0b;
    color: #fef3c7;
    background: rgba(20, 16, 4, 0.95);
}

#desk-lamp-hotspot:hover .tooltip-lamp {
    opacity: 1;
    transform: translateX(0);
}

/* INTERACTIVE DESK LAMP TOGGLE HOTSPOT */
#desk-lamp-hotspot {
    position: absolute;
    top: 36.5%;
    left: 58.5%;
    width: 13.5%;
    height: 25.5%;
    z-index: 11;
    cursor: pointer;
    background: rgba(253, 224, 71, 0);
    border-radius: 50% 50% 10% 10%;
    transition: all 0.2s ease;
}

#desk-lamp-hotspot:hover {
    background: rgba(253, 224, 71, 0.05);
    box-shadow: 0 0 20px rgba(253, 224, 71, 0.1);
}

/* INTERACTIVE BROWN LEATHER BOOK HOTSPOT ON DESK */
#book-hotspot {
    position: absolute;
    top: 65.5%;
    left: 56.5%;
    width: 11.0%;
    height: 10.5%;
    z-index: 25;
    cursor: pointer;
    background: rgba(217, 119, 6, 0);
    border-radius: 4px;
    transition: all 0.2s ease;

}

#book-hotspot:hover {
    background: rgba(217, 119, 6, 0.0);
    box-shadow: 0 0 15px rgba(217, 119, 6, 0);
}

.tooltip-book {
    border-color: #d97706;
    color: #fef3c7;
    background: rgba(26, 17, 10, 0.95);
    left:35%;
    top:25%;
}

#book-hotspot:hover .tooltip-book {
    opacity: 1;
    transform: translateX(0);
}

/* =============================================================
   3. SHIP OPERATIONS MANUAL MODAL OVERLAY & AGED PARCHMENT THEME
   ============================================================= */
#manual-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    background: rgba(4, 8, 12, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.35s ease;
    opacity: 1;
    pointer-events: auto;
}

#manual-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.manual-book-container {
    width: 78%;
    max-width: 850px;
    height: 85vh;
    background: #f4ebd8;
    background-image: linear-gradient(to right, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.02) 4%, transparent 8%, transparent 92%, rgba(0,0,0,0.06) 100%);
    border: none;
    border-left: 32px solid #2a1610; /* Heavy leather spine */
    border-radius: 4px 12px 12px 4px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(1);
    transform-origin: center center;
    transition: transform 0.35s ease;
    will-change: transform;
    backface-visibility: hidden;
}

#manual-modal.hidden .manual-book-container {
    transform: scale(0.96);
}

.manual-book-header {
    background: transparent;
    color: #3b2314;
    padding: 24px 40px 12px 60px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    border-bottom: 1px solid rgba(59, 35, 20, 0.15);
    margin: 0 30px 0 10px;
}

.manual-header-left {
    display: flex;
    align-items: center;
}

.chapter-tag {
    font-family: 'Georgia', serif;
    font-size: 13px;
    font-style: italic;
    color: #5c3a21;
    background: transparent;
    padding: 0;
    border-radius: 0;
    letter-spacing: 0.5px;
}

.manual-header-title {
    font-family: 'Georgia', serif;
    font-weight: bold;
    letter-spacing: 0.5px;
    font-size: 14px;
    color: #2a1610;
    text-transform: uppercase;
}

.manual-btn-close {
    background: transparent;
    border: none;
    color: #7c2d12;
    font-size: 13px;
    font-family: 'Georgia', serif;
    font-style: italic;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease;
}

.manual-btn-close:hover {
    background: transparent;
    color: #000;
    text-decoration: underline;
}

/* BOOK CONTENT VIEWPORT */
.manual-content-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 35px 70px 40px 75px;
    color: #2b1f17;
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.7;
}

.section-stamp {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    color: #5c3a21;
    letter-spacing: 1px;
    margin-bottom: 18px;
    text-transform: uppercase;
    border-bottom: none;
    padding-bottom: 0;
}

.manual-heading {
    font-family: 'Georgia', serif;
    color: #1a0f09;
    font-size: 19px;
    font-weight: bold;
    margin-top: 26px;
    margin-bottom: 12px;
    letter-spacing: 0px;
}

.manual-callout-box {
    background: transparent;
    border-left: 2px solid #5c3a21;
    padding: 10px 20px;
    margin: 22px 0;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #2b1f17;
    border-radius: 0;
}

.manual-callout-box.warning-box {
    border-left-color: #9a3412;
    color: #431407;
}

.manual-bullet-list {
    margin: 14px 0 18px 24px;
    list-style-type: square;
}

.manual-bullet-list li {
    margin-bottom: 8px;
}

/* TABLE OF CONTENTS GRID */
.manual-toc-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.toc-header-stamp {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    font-weight: bold;
    color: #5c3a21;
    letter-spacing: 1px;
}

.toc-intro {
    font-size: 14px;
    color: #3b2314;
}

.toc-grid {
    display: flex;
    flex-direction: column;
    gap: 22px;
    margin-top: 14px;
}

.toc-section-title {
    font-weight: bold;
    font-family: 'Georgia', serif;
    font-size: 15px;
    color: #1a0f09;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(59, 35, 20, 0.2);
    padding-bottom: 4px;
}

.toc-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.toc-list li {
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 0;
    transition: none;
    color: #2b1f17;
    font-family: 'Georgia', serif;
    font-size: 14.5px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toc-list li:hover {
    background: transparent;
    color: #000;
    text-decoration: underline;
    font-weight: normal;
}

.toc-page-num {
    background: transparent;
    color: #5c3a21;
    font-size: 13px;
    padding: 0;
    margin-right: 4px;
    font-style: italic;
    font-weight: normal;
}
.toc-page-num::after {
    content: '.';
}

/* BOOK FOOTER NAVIGATION BAR */
.manual-book-footer {
    background: transparent;
    padding: 16px 40px 24px 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(59, 35, 20, 0.15);
    margin: 0 30px 0 10px;
}

.manual-nav-btn {
    background: transparent;
    color: #5c3a21;
    border: none;
    padding: 5px 10px;
    border-radius: 0;
    font-family: 'Georgia', serif;
    font-weight: bold;
    font-style: italic;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.manual-nav-btn:hover:not(:disabled) {
    background: transparent;
    color: #000;
    text-decoration: underline;
    box-shadow: none;
}

.manual-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.manual-nav-btn.toc-btn {
    background: transparent;
    color: #5c3a21;
}

.manual-page-indicator {
    color: #5c3a21;
    font-family: 'Georgia', serif;
    font-weight: normal;
    font-style: italic;
    font-size: 13px;
}

.tooltip-lamp {
    background: rgba(20, 18, 2, 0.92);
    color: #fde047;
    border: 1px solid #eab308;
    left: 75%;
    top: 40%;
    transform: translateX(-50%);
}

#desk-lamp-hotspot:hover .tooltip-lamp {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.wall-btn-hotspot:hover .wall-btn-tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* =============================================================
   2. FULL TERMINAL SCREEN VIEW (ZOOMED CRT INTERFACE)
   ============================================================= */
#terminal-screen-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
    background: #020d06;
    color: #22c55e;
    display: flex;
    flex-direction: column;
    padding: 24px;
    gap: 16px;
    transition: opacity 0.35s ease, transform 0.35s ease;
    box-shadow: inset 0 0 60px rgba(34, 197, 94, 0.2);
}

#terminal-screen-view.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.96);
}

.crt-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg, rgba(0,0,0,0.18), rgba(0,0,0,0.18) 1px, transparent 1px, transparent 3px);
    pointer-events: none;
    z-index: 100;
}

.term-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #052e16;
    padding-bottom: 12px;
}

.btn-return {
    background: #052e16;
    border: 1px solid #22c55e;
    color: #4ade80;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-return:hover {
    background: #166534;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}

.term-header-center {
    display: flex;
    align-items: center;
    gap: 16px;
}

.term-header-title {
    font-size: 16px;
    font-weight: bold;
    color: #4ade80;
    letter-spacing: 1px;
}

.term-sys-clock {
    font-size: 11px;
    font-weight: bold;
    color: #4ade80;
    background: rgba(5, 46, 22, 0.6);
    border: 1px solid #052e16;
    padding: 3px 8px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    font-family: monospace;
}

.term-status-badge {
    background: #166534;
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.term-status-badge.queue-badge {
    background: #1e293b;
    color: #38bdf8;
    border: 1px solid #0284c7;
}

.term-status-badge.queue-badge.queue-low {
    background: #422006;
    color: #fde047;
    border-color: #ca8a04;
}

.term-status-badge.queue-badge.queue-depleted {
    background: #450a0a;
    color: #fca5a5;
    border-color: #dc2626;
}

.term-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.term-power-gauge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(1, 15, 7, 0.9);
    border: 1px solid #166534;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-family: monospace;
    font-weight: bold;
    color: #4ade80;
    transition: all 0.3s ease;
}

.term-power-gauge .pwr-bolt {
    color: #facc15;
    font-size: 12px;
    text-shadow: 0 0 6px rgba(250, 204, 21, 0.6);
}

.term-power-gauge .pwr-lbl {
    color: #86efac;
    letter-spacing: 0.5px;
}

.pwr-bar-track {
    width: 70px;
    height: 9px;
    background: rgba(5, 46, 22, 0.8);
    border: 1px solid #166534;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.pwr-bar-fill {
    height: 100%;
    width: 100%;
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.pwr-val {
    color: #f8fafc;
    min-width: 78px;
    text-align: right;
    letter-spacing: 0.5px;
}

/* Power State Themes */
.term-power-gauge.pwr-normal .pwr-bar-fill {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

.term-power-gauge.pwr-warn {
    border-color: #ca8a04;
    background: rgba(26, 20, 2, 0.9);
}
.term-power-gauge.pwr-warn .pwr-lbl {
    color: #fde047;
}
.term-power-gauge.pwr-warn .pwr-bar-fill {
    background: #eab308;
    box-shadow: 0 0 6px rgba(234, 179, 8, 0.6);
}
.term-power-gauge.pwr-warn .pwr-bar-track {
    border-color: #854d0e;
}

.term-power-gauge.pwr-crit {
    border-color: #dc2626;
    background: rgba(30, 8, 8, 0.9);
    animation: pwrPulse 1.2s infinite alternate;
}
.term-power-gauge.pwr-crit .pwr-lbl {
    color: #fca5a5;
}
.term-power-gauge.pwr-crit .pwr-bar-fill {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}
.term-power-gauge.pwr-crit .pwr-bar-track {
    border-color: #991b1b;
}

.term-power-gauge.pwr-empty {
    border-color: #7f1d1d;
    background: rgba(20, 5, 5, 0.95);
    color: #991b1b;
}
.term-power-gauge.pwr-empty .pwr-bolt {
    color: #7f1d1d;
    text-shadow: none;
}
.term-power-gauge.pwr-empty .pwr-lbl {
    color: #f87171;
}
.term-power-gauge.pwr-empty .pwr-val {
    color: #ef4444;
    font-weight: bold;
}
.term-power-gauge.pwr-empty .pwr-bar-fill {
    background: #7f1d1d;
}

@keyframes pwrPulse {
    0% { border-color: #dc2626; box-shadow: 0 0 4px rgba(220, 38, 38, 0.3); }
    100% { border-color: #ef4444; box-shadow: 0 0 12px rgba(239, 68, 68, 0.6); }
}

.terminal-grid {
    flex: 1;
    display: flex;
    gap: 20px;
    height: calc(100% - 60px);
}

.term-panel {
    background: rgba(1, 15, 7, 0.85);
    border: 1px solid #052e16;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-panel { flex: 1.1; }
.doc-panel { flex: 1.8; }
.log-panel { flex: 1.1; }

.panel-title {
    font-size: 14px;
    font-weight: bold;
    color: #4ade80;
    border-bottom: 1px dashed #052e16;
    padding-bottom: 6px;
}

#current-cand-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(2, 20, 9, 0.6);
    border: 1px solid #052e16;
    border-radius: 6px;
    padding: 14px;
    font-size: 13px;
}

.cand-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.cand-row .lbl {
    color: #166534;
    font-weight: bold;
}

.cand-row .val {
    color: #f8fafc;
}

.cand-row .val-highlight {
    color: #f59e0b;
    font-weight: bold;
}

.cand-quote-box {
    margin-top: 4px;
    background: rgba(5, 46, 22, 0.4);
    border-left: 3px solid #22c55e;
    padding: 10px 14px;
    color: #86efac;
    font-style: italic;
    font-size: 12px;
    border-radius: 0 4px 4px 0;
}

/* COMMAND REFERENCE GUIDE BOX */
.cmd-guide-box {
    margin-top: auto;
    background: rgba(1, 15, 7, 0.9);
    border: 1px solid #052e16;
    border-radius: 4px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cmd-guide-title {
    font-size: 11px;
    font-weight: bold;
    color: #38bdf8;
    letter-spacing: 0.5px;
    border-bottom: 1px dashed #052e16;
    padding-bottom: 4px;
}

.cmd-item {
    font-size: 11px;
    color: #94a3b8;
}

.cmd-item code {
    color: #4ade80;
    font-weight: bold;
    background: rgba(34, 197, 94, 0.1);
    padding: 1px 4px;
    border-radius: 2px;
}

.cmd-pwr-cost {
    color: #facc15;
    font-weight: bold;
    font-size: 10px;
    letter-spacing: 0.5px;
    margin-left: 2px;
}

.cmd-free {
    color: #4ade80;
    font-size: 10px;
    opacity: 0.75;
    margin-left: 2px;
}

/* =============================================================
   DOCUMENT VIEWER PANEL & RETRO CRT DOCUMENT STYLING
   ============================================================= */
#doc-viewer-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.doc-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    border: 1px dashed #052e16;
    border-radius: 6px;
    padding: 20px;
    color: #334155;
}

.placeholder-icon { font-size: 32px; opacity: 0.4; }
.placeholder-text { font-size: 14px; font-weight: bold; color: #1e293b; letter-spacing: 1px; }
.placeholder-sub { font-size: 11px; color: #475569; }
.placeholder-cmds { font-size: 12px; font-weight: bold; color: #166534; font-family: monospace; margin-top: 4px; }

/* STRUCTURED DOCUMENT CARD */
.doc-card {
    background: rgba(2, 20, 9, 0.9);
    border: 1px solid #166534;
    border-radius: 6px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    animation: fadeIn 0.25s ease;
}

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

.doc-card-header {
    border-bottom: 2px solid #052e16;
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.doc-title-area {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.doc-title {
    font-size: 13px;
    font-weight: bold;
    color: #4ade80;
    letter-spacing: 0.5px;
}

.doc-issuer {
    font-size: 10px;
    color: #166534;
    font-weight: bold;
}

.doc-status-badge {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.5px;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid #166534;
    color: #4ade80;
}

.doc-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.doc-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: rgba(1, 15, 7, 0.6);
    border: 1px solid #052e16;
    border-radius: 4px;
    padding: 6px 10px;
}

.doc-lbl {
    font-size: 10px;
    font-weight: bold;
    color: #166534;
    letter-spacing: 0.5px;
}

.doc-val {
    font-size: 12px;
    color: #e2e8f0;
    word-break: break-word;
}

#log-console {
    flex: 1;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
}

.log-line {
    color: #22c55e;
    display: flex;
    align-items: flex-start;
    line-height: 1.5;
}

.log-line .time {
    color: #166534;
    margin-right: 8px;
    font-weight: bold;
    flex-shrink: 0;
}

.log-line.cmd-echo {
    color: #38bdf8;
    font-weight: bold;
    margin-top: 6px;
}

/* TABBED INCOMING SYSTEM LINE INDENTATION */
.log-line.log-indented {
    margin-left: 24px;
    padding-left: 8px;
    border-left: 2px solid rgba(34, 197, 94, 0.25);
}

.log-line.log-indented.warning {
    color: #f87171;
    border-left: 2px solid rgba(239, 68, 68, 0.6);
}

/* CLI INPUT PROMPT WRAPPER */
.cli-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #011409;
    border: 1px solid #166534;
    border-radius: 4px;
    padding: 4px 8px;
    margin-top: 6px;
}

.cli-prompt {
    color: #4ade80;
    font-weight: bold;
    font-size: 14px;
}

#cli-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #4ade80;
    font-family: 'Consolas', monospace;
    font-size: 13px;
}

#cli-input::placeholder {
    color: #15803d;
}

#cli-send-btn {
    background: #166534;
    border: 1px solid #22c55e;
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
}

#cli-send-btn:hover {
    background: #22c55e;
    color: #020d06;
}

/* AVATAR SYSTEM & WINDOW DUAL-LAYER RAIN PARALLAX */
.rain-canvas-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#rain-canvas-back {
    z-index: 1; /* Distant rain falls BEHIND the candidate */
}

#candidate-avatar-container {
    position: absolute;
    left: 53%;
    bottom: 7%;
    width: 26.4%;
    height: 47.1%;
    z-index: 2; /* Sits naturally in the middle of the rain depth */
    opacity: 1;
    transition: bottom 0.65s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.65s ease;
    pointer-events: none;
}

#rain-canvas-front {
    z-index: 3; /* Foreground rain streaks IN FRONT of the candidate & across glass */
}

#candidate-avatar-container.hidden {
    bottom: -50%;
    opacity: 0;
    pointer-events: none;
}

#avatar-canvas {
    width: 110%;
    height: 110%;
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    /* Atmospheric color grade: blends the hazmat suit with the stormy outdoor palette */
    filter: brightness(0.74) contrast(1.12) hue-rotate(-6deg) drop-shadow(0 0 14px rgba(10, 25, 30, 0.75));
}

/* =============================================================
   CINEMATIC FULLSCREEN TRANSITION OVERLAY (FADE TO BLACK)
   ============================================================= */
#transition-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    z-index: 600;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease-in-out;
}

#transition-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* =============================================================
   CREW LEDGER MODAL (ANALOG MANIFEST PAPER ON WALL)
   ============================================================= */
#crew-ledger-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 8, 12, 0.88);
    z-index: 550;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.35s ease;
    opacity: 1;
    pointer-events: auto;
}

#crew-ledger-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.ledger-paper-container {
    position: relative;
    width: 86%;
    max-width: 980px;
    background: #fbf8ee;
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(240, 230, 205, 0.4) 0%, transparent 70%),
        repeating-linear-gradient(transparent, transparent 27px, rgba(160, 145, 120, 0.08) 28px);
    color: #1e1b18;
    padding: 34px 46px 28px 46px;
    border-radius: 2px 4px 3px 2px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 2px 6px rgba(0, 0, 0, 0.35);
    border: 1px solid #dcd3be;
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    flex-direction: column;
    transform: rotate(-0.25deg) scale(1);
    transform-origin: center center;
    transition: transform 0.35s ease;
    will-change: transform;
    backface-visibility: hidden;
}

#crew-ledger-modal.hidden .ledger-paper-container {
    transform: rotate(-0.25deg) scale(0.96);
}

/* Brass push pin at top center */
.ledger-push-pin {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fef08a, #ca8a04 60%, #713f12 100%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.8);
    z-index: 10;
}
.ledger-push-pin::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #eab308;
}

/* Header */
.ledger-paper-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 10px;
}

.ledger-kicker {
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1.5px;
    color: #786d5e;
    text-transform: uppercase;
}

.ledger-headline {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #1a1614;
    margin: 4px 0 2px 0;
    text-transform: uppercase;
}

.ledger-subtext {
    font-size: 11.5px;
    letter-spacing: 1px;
    color: #574e43;
    font-weight: 600;
}

.ledger-stamp-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.ledger-ink-stamp {
    display: inline-block;
    border: 2px dashed #991b1b;
    color: #991b1b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    padding: 3px 8px;
    text-transform: uppercase;
    transform: rotate(2deg);
    opacity: 0.88;
    background: rgba(153, 27, 27, 0.04);
}

.ledger-close-btn {
    background: #292524;
    color: #f5f5f4;
    border: 1px solid #1c1917;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
    padding: 4px 10px;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.ledger-close-btn:hover {
    background: #44403c;
    color: #ffffff;
}

.ledger-divider {
    height: 2px;
    background: #1a1614;
    margin: 6px 0 14px 0;
    opacity: 0.85;
}

/* Horizontal Roster Rows */
.ledger-roster-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 14px;
}

.ledger-row {
    display: flex;
    align-items: center;
    background: rgba(240, 235, 222, 0.6);
    border: 1px solid rgba(160, 145, 120, 0.4);
    padding: 8px 16px;
    font-size: 13.5px;
    letter-spacing: 0.5px;
    border-radius: 2px;
}

.ledger-row.player-row {
    background: rgba(230, 225, 210, 0.85);
    border-left: 4px solid #1a1614;
}

.ledger-row.filled-row {
    border-left: 4px solid #15803d;
}

.ledger-row.vacant-row {
    border-left: 4px solid #a8a29e;
    background: rgba(245, 242, 235, 0.35);
    opacity: 0.65;
}

.ledger-col-seat {
    width: 90px;
    font-size: 13.5px;
    font-weight: 800;
    color: #292524;
    flex-shrink: 0;
}

.ledger-col-name {
    flex: 2;
    min-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ledger-col-role {
    flex: 2;
    min-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ledger-col-age {
    width: 80px;
    flex-shrink: 0;
}

.ledger-col-lbl {
    font-size: 10px;
    color: #78716c;
    font-weight: 700;
    margin-right: 4px;
    letter-spacing: 0.5px;
}

.ledger-col-status {
    width: 95px;
    text-align: right;
    flex-shrink: 0;
}

.ledger-stamp-mini {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    border-radius: 2px;
    text-transform: uppercase;
}

.stamp-stationed {
    border: 1px solid #1c1917;
    color: #1c1917;
    background: rgba(28, 25, 23, 0.08);
}

.stamp-accepted {
    border: 1px solid #15803d;
    color: #15803d;
    background: rgba(21, 128, 61, 0.08);
}

.stamp-vacant {
    border: 1px dashed #78716c;
    color: #78716c;
    background: transparent;
}

.unfilled-text {
    color: #a8a29e;
    font-style: italic;
}

/* Footer */
.ledger-paper-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed rgba(160, 145, 120, 0.5);
    padding-top: 10px;
    margin-top: auto;
}

.ledger-footer-note {
    font-size: 10px;
    color: #78716c;
    max-width: 70%;
    line-height: 1.4;
    letter-spacing: 0.5px;
}

.ledger-official-seal {
    font-size: 10px;
    font-weight: 800;
    color: #44403c;
    letter-spacing: 1px;
    text-align: right;
}

/* =============================================================
   PHASE II: STARSHIP FLIGHT OPERATIONS STYLES
   ============================================================= */

@keyframes launchRumble {
    0% { transform: translate(0, 0); }
    20% { transform: translate(-3px, 2px); }
    40% { transform: translate(3px, -2px); }
    60% { transform: translate(-2px, -3px); }
    80% { transform: translate(2px, 3px); }
    100% { transform: translate(0, 0); }
}

.launch-shake {
    animation: launchRumble 0.08s infinite !important;
}

.phase2-viewport {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 10;
    background: #020307;
    overflow: hidden;
    font-family: 'Consolas', 'Courier New', monospace;
    user-select: none;
}

.phase2-viewport.hidden {
    display: none !important;
}

#phase2-starfield-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.flight-deck-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.flight-top-header {
    height: 52px;
    background: #11151b;
    border-bottom: 1px solid #232c37;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    z-index: 20;
}

.header-title-box {
    display: flex;
    align-items: center;
    gap: 14px;
}

.vessel-badge {
    background: #182029;
    border: 1px solid #364656;
    color: #dce1e7;
    font-size: 12.5px;
    font-family: 'Share Tech Mono', monospace, sans-serif;
    font-weight: 700;
    padding: 4px 10px;
    letter-spacing: 1.5px;
    border-radius: 0px;
}

.destination-progress {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    font-family: 'Share Tech Mono', monospace, sans-serif;
    color: #8da1b4;
}

.progress-bar-bg {
    width: 240px;
    height: 10px;
    background: #090c10;
    border: 1px solid #202b37;
    border-radius: 0px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    width: 38%;
    height: 100%;
    background: #cf9f54;
    transition: width 0.3s;
}

.time-controls {
    display: flex;
    gap: 6px;
}

.time-btn {
    background: #141922;
    border: 1px solid #232d3a;
    color: #8ea1b4;
    padding: 5px 12px;
    font-size: 11.5px;
    cursor: pointer;
    font-family: 'Share Tech Mono', monospace, sans-serif;
    font-weight: 700;
    border-radius: 0px;
    transition: all 0.15s;
    letter-spacing: 0.5px;
}

.time-btn:hover {
    border-color: #485c72;
    color: #ffffff;
    background: #1b222d;
}

.time-btn.active {
    background: #1e2634;
    border-color: #cf9f54;
    color: #ffffff;
}

.flight-main-grid {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(410px, 29%) 1fr minmax(280px, 24%);
    height: calc(100vh - 52px);
    overflow: hidden;
}

.hud-side-panel {
    background: #11151a;
    border-right: 1px solid #232c37;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    z-index: 15;
}

.hud-side-panel.right-panel {
    border-right: none;
    border-left: 1px solid #232c37;
    background: #11151a;
    padding: 12px 14px;
    gap: 8px;
}

.hud-side-panel.left-panel {
    background: #11151a;
    border-right: 1px solid #232c37;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
    gap: 8px;
}

/* Panel Header Title */
.panel-header-title {
    font-size: 14.5px;
    font-weight: 700;
    color: #c5ced8;
    letter-spacing: 1.5px;
    border-bottom: 1px solid #232c37;
    padding-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Share Tech Mono', monospace, sans-serif;
    text-transform: uppercase;
}

.manifest-title-text {
    color: #c5ced8;
}

.manifest-counter-text {
    font-size: 11.5px;
    color: #6a7e92;
    letter-spacing: 1px;
}

/* Table Column Headers */
.manifest-table-header {
    display: flex;
    align-items: center;
    padding: 5px 6px;
    font-size: 10.5px;
    font-family: 'Share Tech Mono', monospace, sans-serif;
    color: #536679;
    letter-spacing: 0.8px;
    border-bottom: 1px solid #1c242f;
    text-transform: uppercase;
    user-select: none;
}

.manifest-table-header .th-col-num {
    width: 22px;
    flex-shrink: 0;
    text-align: center;
}

.manifest-table-header .th-col-name {
    flex: 1;
    padding-left: 48px; /* space for avatar */
}

.manifest-table-header .th-col-vitals {
    width: 100px;
    text-align: center;
    flex-shrink: 0;
}

.manifest-table-header .th-col-status {
    width: 105px;
    text-align: right;
    padding-right: 4px;
    flex-shrink: 0;
}

.hud-side-panel.left-panel #phase2-crew-roster {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-right: 2px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Flush Tabular Crew Card Row */
.crew-card {
    background: #13171f;
    border: 1px solid #1e2632;
    border-left: 2px solid transparent;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 0px;
    transition: all 0.15s ease;
    cursor: pointer;
    user-select: none;
}

.crew-card:hover {
    background: #19202a;
    border-color: #2e3a4b;
    border-left-color: #55677c;
}

.crew-card.card-selected {
    background: #1d2532 !important;
    border-color: #3b495c !important;
    border-left: 2px solid #cf9f54 !important;
    box-shadow: inset 0 0 10px rgba(207, 159, 84, 0.08);
}

.crew-row-num {
    font-family: 'Share Tech Mono', monospace, sans-serif;
    font-size: 11.5px;
    color: #536679;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    font-weight: 700;
}

.crew-card.card-selected .crew-row-num {
    color: #cf9f54;
}

.crew-row-avatar-box {
    width: 38px;
    height: 38px;
    background: #090c10;
    border: 1px solid #222c39;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.crew-avatar-mini {
    width: 38px;
    height: 38px;
    image-rendering: pixelated;
    display: block;
}

.crew-row-identity {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.crew-name {
    font-size: 12.5px;
    font-weight: 600;
    color: #dce1e7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.3px;
}

.crew-card.card-selected .crew-name {
    color: #fff;
}

.crew-role-badge {
    font-size: 10.5px;
    color: #788d9f;
    font-family: 'Share Tech Mono', monospace, sans-serif;
    letter-spacing: 0.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crew-row-vitals {
    width: 76px;
    flex-shrink: 0;
    display: flex;
    justify-content: space-around;
    gap: 8px;
    padding: 0 4px;
}

.vital-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Share Tech Mono', monospace, sans-serif;
    line-height: 1.1;
}

.vital-lbl {
    font-size: 9px;
    color: #536679;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.vital-num {
    font-size: 11px;
    font-weight: 700;
}

.vital-num.vital-hp { color: #5ea474; }
.vital-num.vital-san { color: #558db6; }
.vital-num.vital-eng { color: #cf9f54; }

@keyframes vitalBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.15; }
}

.vital-blinking {
    animation: vitalBlink 0.8s infinite !important;
}

.crew-row-status {
    width: 105px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}

.officer-status-badge {
    font-family: 'Share Tech Mono', monospace, sans-serif;
    font-size: 10px;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 105px;
}

.unassign-btn {
    background: #18202a;
    border: 1px solid #283749;
    color: #8da0b4;
    font-family: 'Share Tech Mono', monospace, sans-serif;
    font-size: 9px;
    padding: 1px 5px;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.5px;
}

.unassign-btn:hover {
    background: #222d3b;
    border-color: #cf9f54;
    color: #fff;
}

/* Deceased state */
.crew-card.crew-card-deceased {
    opacity: 0.45;
    background: #120c0d !important;
    border-color: #2b1719 !important;
    border-left-color: #632328 !important;
    cursor: not-allowed;
}

.crew-card.crew-card-deceased .crew-name {
    text-decoration: line-through;
    color: #7b6264;
}

.crew-card.crew-card-deceased .crew-avatar-mini {
    filter: grayscale(100%) brightness(45%);
}

.crew-card.crew-card-deceased .vital-num {
    color: #553e40;
}

/* Bottom Left: The Brig & Security Directives Console */
.security-console-panel {
    margin-top: auto;
    flex-shrink: 0;
    background: #0e1217;
    border: 1px solid #1e2633;
    border-top: 1px solid #293545;
    border-radius: 0px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.4);
}

.security-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #19222c;
    padding-bottom: 4px;
}

.security-title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.security-title {
    font-size: 12px;
    font-weight: 700;
    color: #8e9fae;
    letter-spacing: 1px;
    font-family: 'Share Tech Mono', monospace, sans-serif;
}

.sec-status-badge {
    font-family: 'Share Tech Mono', monospace, sans-serif;
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 6px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.sec-status-badge.active {
    background: rgba(94, 164, 116, 0.12);
    border: 1px solid #5ea474;
    color: #5ea474;
}

.sec-status-badge.standby {
    background: rgba(207, 159, 84, 0.12);
    border: 1px solid #cf9f54;
    color: #cf9f54;
}

.security-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-family: 'Share Tech Mono', monospace, sans-serif;
    font-size: 11px;
}

.security-guard-info, .security-target-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sec-label {
    color: #536679;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.6px;
}

.sec-val {
    font-weight: 600;
    color: #9cb1c4;
}

.sec-val-target {
    font-weight: 700;
    color: #cf9f54;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 2-Column Split: Buttons on Left, Viewfinder on Right */
.security-bottom-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 4px;
}

.sec-actions-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sec-action-btn {
    background: #131821;
    border: 1px solid #222c3a;
    color: #96a7b7;
    font-size: 10.5px;
    font-family: 'Share Tech Mono', monospace, sans-serif;
    font-weight: 700;
    padding: 5px 6px;
    cursor: pointer;
    border-radius: 0px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
    letter-spacing: 0.6px;
    user-select: none;
    text-align: left;
}

.sec-btn-num {
    color: #536679;
    font-size: 10px;
    font-weight: 700;
}

.sec-btn-txt {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sec-action-btn:hover:not(:disabled) {
    background: #1b232f;
    border-color: #3b4c60;
    color: #fff;
}

.sec-action-btn:hover:not(:disabled) .sec-btn-num {
    color: #cf9f54;
}

.sec-action-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: #161d26;
    color: #3e4c5b;
}

.sec-action-btn.rest-btn:hover:not(:disabled) {
    border-color: #558db6;
    color: #79a8cd;
}

.sec-action-btn.medbay-btn:hover:not(:disabled) {
    border-color: #5ea474;
    color: #7bc492;
}

.sec-action-btn.search-btn:hover:not(:disabled) {
    border-color: #cf9f54;
    color: #e5b974;
}

.sec-action-btn.eject-btn {
    border-color: rgba(200, 90, 83, 0.35);
    color: #d87670;
}

.sec-action-btn.eject-btn:hover:not(:disabled) {
    background: rgba(200, 90, 83, 0.15);
    border-color: #c85a53;
    color: #ff857d;
}

.sec-action-btn.eject-confirm {
    background: rgba(200, 90, 83, 0.3) !important;
    border-color: #c85a53 !important;
    color: #fff !important;
    box-shadow: 0 0 10px rgba(200, 90, 83, 0.5) !important;
}

/* Right Column Viewfinder Reticle */
.sec-viewfinder-col {
    display: flex;
}

.target-viewfinder {
    flex: 1;
    position: relative;
    background: #080b0f;
    border: 1px dashed #1a232f;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-family: 'Share Tech Mono', monospace, sans-serif;
}

/* Reticle corner brackets */
.vf-corner {
    position: absolute;
    width: 6px;
    height: 6px;
    border-color: #4e6277;
    pointer-events: none;
}
.vf-corner.tl { top: -1px; left: -1px; border-top: 2px solid #4e6277; border-left: 2px solid #4e6277; }
.vf-corner.tr { top: -1px; right: -1px; border-top: 2px solid #4e6277; border-right: 2px solid #4e6277; }
.vf-corner.bl { bottom: -1px; left: -1px; border-bottom: 2px solid #4e6277; border-left: 2px solid #4e6277; }
.vf-corner.br { bottom: -1px; right: -1px; border-bottom: 2px solid #4e6277; border-right: 2px solid #4e6277; }

.vf-empty-text {
    font-size: 10px;
    color: #4e6277;
    text-align: center;
    letter-spacing: 0.8px;
    line-height: 1.3;
}

.vf-target-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vf-target-name {
    font-size: 11.5px;
    font-weight: 700;
    color: #e6edf3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vf-target-role {
    font-size: 9.5px;
    color: #7997b0;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.vf-target-detail {
    font-size: 10px;
    color: #55728a;
    font-weight: 700;
}

.ship-viewport-center {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 10;
}

#phase2-ship-container {
    position: relative;
    height: 94%;
    max-width: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
}

.ship-cutaway-img {
    height: 100%;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 25px rgba(0, 200, 255, 0.15));
    pointer-events: none;
}

.room-interactive-overlay {
    position: absolute;
    border: 1px dashed rgba(0, 240, 255, 0.0);
    background: rgba(0, 240, 255, 0.0);
    transition: all 0.2s;
    cursor: pointer;
    z-index: 20;
}

.room-interactive-overlay:hover {
    border: 1px solid rgba(0, 240, 255, 0.7);
    background: rgba(0, 240, 255, 0.08);
}

.room-tooltip-tag {
    position: absolute;
    top: 4px;
    left: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #00f0ff;
    background: rgba(2, 8, 16, 0.9);
    padding: 3px 6px;
    border: 1px solid rgba(0, 240, 255, 0.4);
    border-radius: 2px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    letter-spacing: 0.5px;
    z-index: 28;
}

.room-interactive-overlay:hover .room-tooltip-tag {
    opacity: 1;
}

.room-capacity-badge {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 10px;
    font-weight: 600;
    color: #8b949e;
    background: rgba(4, 10, 18, 0.90);
    padding: 1px 6px;
    border: 1px solid #1c2d3d;
    border-radius: 2px;
    pointer-events: none;
    z-index: 26;
    white-space: nowrap;
    letter-spacing: 0.3px;
    backdrop-filter: blur(2px);
}

.room-occupants {
    position: absolute;
    bottom: 4px;
    left: 4px;
    right: 4px;
    height: 24px;
    pointer-events: none;
    z-index: 25;
}

/* Static Rooms: Sleep Pods & Cockpit/Helm — horizontal non-wrapping row */
.room-occupants.static-occupants {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    justify-content: flex-start;
}

.room-occupants.static-occupants .officer-token {
    position: relative;
    flex-shrink: 0;
}

/* Wandering Duty Rooms: Medbay, Hydroponics, O2 Bay, Brig, Workshop, Reactor */
.room-occupants.wandering-occupants {
    overflow: visible;
}

.room-occupants.wandering-occupants .officer-token {
    position: absolute;
    bottom: 0;
    left: 0;
    will-change: transform;
}

.officer-token {
    background: rgba(3, 8, 14, 0.94);
    border: 1px solid #00f0ff;
    border-radius: 3px;
    padding: 2px 6px 2px 3px;
    font-size: 10px;
    font-weight: 600;
    color: #e6edf3;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.35);
    pointer-events: auto;
    transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
    backdrop-filter: blur(2px);
    white-space: nowrap;
    user-select: none;
    cursor: pointer;
}

.officer-token:hover {
    border-color: #38bdf8;
    background: rgba(8, 20, 34, 0.98);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.7);
    filter: brightness(1.15);
}

.officer-token.token-paused {
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.55);
    border-color: #7dd3fc;
}

.token-avatar {
    width: 18px;
    height: 18px;
    border-radius: 2px;
    border: 1px solid rgba(0, 240, 255, 0.5);
    background: #060c14;
    display: block;
    flex-shrink: 0;
}

.token-name {
    font-size: 10px;
    font-weight: 600;
    color: #e6edf3;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.officer-token.in-transit {
    border-color: #f0883e;
    color: #f0883e;
    border-style: dashed;
    background: rgba(24, 12, 4, 0.92);
    animation: transitPulse 0.8s infinite alternate;
}

.officer-token.in-transit .token-avatar {
    border-color: rgba(240, 136, 62, 0.7);
}

.token-transit-badge {
    font-size: 9px;
    color: #f0883e;
    font-weight: 700;
    margin-left: 1px;
}

/* Track B: Personnel Condition Tokens */
.officer-token.token-panicked {
    border-color: #f85149 !important;
    color: #ff7b72 !important;
    background: rgba(36, 8, 10, 0.96) !important;
    box-shadow: 0 0 12px rgba(248, 81, 73, 0.85) !important;
    animation: panicTokenPulse 0.7s infinite alternate !important;
}

.officer-token.token-panicked .token-avatar {
    border-color: #f85149 !important;
}

@keyframes panicTokenPulse {
    0% {
        border-color: #f85149;
        box-shadow: 0 0 6px rgba(248, 81, 73, 0.5);
    }
    100% {
        border-color: #ff7b72;
        box-shadow: 0 0 16px rgba(248, 81, 73, 0.95);
    }
}

.officer-token.token-contagious {
    border-color: #e3b341 !important;
    color: #ffd369 !important;
    background: rgba(32, 24, 6, 0.96) !important;
    box-shadow: 0 0 12px rgba(227, 179, 65, 0.8) !important;
    animation: contagiousTokenPulse 1.1s infinite alternate !important;
}

.officer-token.token-contagious .token-avatar {
    border-color: #e3b341 !important;
}

@keyframes contagiousTokenPulse {
    0% {
        border-color: #d29922;
        box-shadow: 0 0 6px rgba(210, 153, 34, 0.45);
    }
    100% {
        border-color: #e3b341;
        box-shadow: 0 0 16px rgba(227, 179, 65, 0.9);
    }
}

/* Tactical Dispatch Mode */
.dispatch-mode-active .room-interactive-overlay {
    border: 1px dashed rgba(0, 240, 255, 0.5) !important;
    background: rgba(0, 240, 255, 0.05);
    animation: dispatchPulse 1.2s infinite alternate;
}

.dispatch-mode-active .room-interactive-overlay:hover {
    border: 1px solid #00f0ff !important;
    background: rgba(0, 240, 255, 0.22) !important;
    box-shadow: inset 0 0 18px rgba(0, 240, 255, 0.4);
}

@keyframes dispatchPulse {
    0% { border-color: rgba(0, 240, 255, 0.3); }
    100% { border-color: rgba(0, 240, 255, 0.85); }
}

.dispatch-banner {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(4, 12, 22, 0.96);
    border: 1px solid #00f0ff;
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.5);
    padding: 6px 16px;
    border-radius: 3px;
    font-size: 12px;
    color: #00f0ff;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 35;
    animation: fadeIn 0.2s ease;
}

.dispatch-banner.hidden {
    display: none !important;
}

.dispatch-cancel-btn {
    background: #101c28;
    border: 1px solid #388bfd;
    color: #79c0ff;
    font-size: 11px;
    font-family: inherit;
    font-weight: 600;
    padding: 3px 10px;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.15s;
}

.dispatch-cancel-btn:hover {
    color: #f85149;
    border-color: #f85149;
}

.dispatch-unassign-btn {
    background: rgba(248, 81, 73, 0.18);
    border: 1px solid #f85149;
    color: #ff7b72;
    font-size: 11px;
    font-family: inherit;
    font-weight: 700;
    padding: 3px 10px;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.15s;
    letter-spacing: 0.3px;
}

.dispatch-unassign-btn:hover {
    background: #da3633;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(248, 81, 73, 0.5);
}

.dispatch-unassign-btn.hidden {
    display: none !important;
}

.unassign-btn {
    background: rgba(248, 81, 73, 0.12);
    border: 1px solid rgba(248, 81, 73, 0.45);
    color: #ff7b72;
    font-size: 9.5px;
    font-family: inherit;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.4px;
}

.unassign-btn:hover {
    background: rgba(248, 81, 73, 0.32);
    border-color: #f85149;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(248, 81, 73, 0.4);
}

.telemetry-gauge {
    background: #0e1217;
    border: 1px solid #1e2633;
    padding: 7px 10px;
    border-radius: 0px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
}

.telemetry-status-badge {
    font-family: 'Share Tech Mono', monospace, sans-serif;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    letter-spacing: 0.8px;
    border-radius: 0px;
    text-transform: uppercase;
}

.telemetry-status-badge.nominal {
    background: rgba(94, 164, 116, 0.15);
    border: 1px solid #5ea474;
    color: #5ea474;
}

.telemetry-status-badge.warning {
    background: rgba(207, 159, 84, 0.15);
    border: 1px solid #cf9f54;
    color: #cf9f54;
}

.telemetry-status-badge.critical {
    background: rgba(200, 90, 83, 0.22);
    border: 1px solid #c85a53;
    color: #ff857d;
}

.gauge-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    margin-bottom: 5px;
    font-family: 'Share Tech Mono', monospace, sans-serif;
}

.gauge-name {
    color: #7c8e9f;
    font-weight: 600;
    letter-spacing: 0.6px;
}

.gauge-val {
    font-size: 11px;
    font-weight: 700;
    font-family: 'Share Tech Mono', monospace, sans-serif;
}

.gauge-val.val-power { color: #558db6; }
.gauge-val.val-o2 { color: #5ea474; }
.gauge-val.val-food { color: #cf9f54; }
.gauge-val.val-hull { color: #4e9a58; }
.gauge-val.val-discipline { color: #8e76b2; }

.gauge-track {
    height: 7px;
    background: #06090d;
    border: 1px solid #16202c;
    border-radius: 0px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.gauge-track.critical-pulse {
    border-color: #f85149 !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 8px rgba(248, 81, 73, 0.7) !important;
    animation: gaugeCriticalPulse 1.2s infinite ease-in-out;
}

@keyframes gaugeCriticalPulse {
    0%, 100% {
        border-color: #f85149;
        box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 4px rgba(248, 81, 73, 0.4);
    }
    50% {
        border-color: #ff7b72;
        box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 12px rgba(248, 81, 73, 0.95);
    }
}

.gauge-bar {
    height: 100%;
    transition: width 0.35s ease;
}

.bar-power { width: 100%; background: #4d88b0; }
.bar-o2 { width: 100%; background: #5ea474; }
.bar-food { width: 100%; background: #cf9f54; }
.bar-hull { width: 100%; background: #4e9a58; }
.bar-discipline, .bar-san { width: 100%; background: #8e76b2; }

/* Tactical Incident & Alert Dashboard */
.alert-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Share Tech Mono', monospace, sans-serif;
    font-size: 13.5px;
    color: #c5ced8;
    border-bottom: 1px solid #232c37;
    padding-bottom: 5px;
    margin-top: 6px;
}

.alert-counter-badge {
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 0px;
    font-family: 'Share Tech Mono', monospace, sans-serif;
}

.alert-counter-badge.zero {
    background: #141921;
    color: #6a7c8e;
    border: 1px solid #24303e;
}

.alert-counter-badge.warning {
    background: rgba(207, 159, 84, 0.18);
    color: #cf9f54;
    border: 1px solid #cf9f54;
}

.alert-counter-badge.critical {
    background: rgba(200, 90, 83, 0.25);
    color: #ff857d;
    border: 1px solid #c85a53;
    animation: alertPulse 1.2s infinite alternate;
}

.clear-alerts-btn {
    background: #131821;
    border: 1px solid #222c3a;
    color: #8da0b2;
    font-size: 9.5px;
    font-family: 'Share Tech Mono', monospace, sans-serif;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 0px;
    cursor: pointer;
    transition: all 0.15s;
}

.clear-alerts-btn:hover {
    background: #1b232f;
    border-color: #3b4c60;
    color: #fff;
}

.alerts-container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    padding: 2px 2px 4px 0;
}

.alerts-container::-webkit-scrollbar {
    width: 3px;
}

.alerts-container::-webkit-scrollbar-thumb {
    background: #222d3b;
    border-radius: 0px;
}

/* Empty Incidents State Card (Neutral Standby) */
.empty-incidents-card,
.all-systems-nominal-card {
    background: #0e1217;
    border: 1px solid #1e2633;
    border-left: 3px solid #4a5a6b;
    padding: 10px 12px;
    border-radius: 0px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
    animation: fadeIn 0.3s ease;
}

.empty-incidents-dot,
.nominal-pulse-dot {
    width: 7px;
    height: 7px;
    background: #5d7187;
    border-radius: 50%;
    flex-shrink: 0;
}

.empty-incidents-content,
.nominal-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.empty-incidents-title,
.nominal-title {
    font-size: 11px;
    font-weight: 700;
    color: #8a9cb0;
    letter-spacing: 0.6px;
    font-family: 'Share Tech Mono', monospace, sans-serif;
}

.empty-incidents-sub,
.nominal-sub {
    font-size: 10.5px;
    color: #5f7082;
    line-height: 1.35;
    font-family: 'Share Tech Mono', monospace, sans-serif;
}

/* Alert Cards Base (Teletype / Flight Data Recorders) */
.alert-card {
    position: relative;
    padding: 8px 10px;
    border-radius: 0px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: 'Share Tech Mono', monospace, sans-serif;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
    animation: alertSlideIn 0.22s ease-out;
    transition: all 0.2s ease;
}

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

.alert-card.dismissing {
    opacity: 0;
    transform: translateX(12px);
    transition: all 0.2s ease-out;
}

/* Card Urgency Tiers */
.alert-card.alert-critical {
    background: #170b0d;
    border: 1px solid #4a1d20;
    border-left: 3px solid #c85a53;
    animation: alertSlideIn 0.22s ease-out, criticalPulse 2s infinite alternate;
}

@keyframes criticalPulse {
    0% { border-color: #4a1d20; }
    100% { border-color: #c85a53; }
}

.alert-card.alert-warning {
    background: #17130b;
    border: 1px solid #453218;
    border-left: 3px solid #cf9f54;
}

.alert-card.alert-notice {
    background: #0c131a;
    border: 1px solid #1c2e3f;
    border-left: 3px solid #4d88b0;
}

.alert-card.alert-milestone {
    background: #0b1710;
    border: 1px solid #1c3b24;
    border-left: 3px solid #5ea474;
}

/* Alert Card Inner Layout */
.alert-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.alert-tag {
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 0px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    flex-shrink: 0;
    font-family: 'Share Tech Mono', monospace, sans-serif;
}

.tag-critical { background: #8c2e28; color: #ffffff; }
.tag-warning { background: #946726; color: #ffffff; }
.tag-notice { background: #295574; color: #ffffff; }
.tag-milestone { background: #2f6e42; color: #ffffff; }

.alert-title {
    font-size: 11.5px;
    font-weight: 700;
    color: #e2e7ec;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.3px;
}

.alert-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.alert-time {
    font-size: 10px;
    color: #6a7c8e;
}

.alert-timer {
    font-size: 10.5px;
    font-weight: 700;
    color: #ff857d;
    background: rgba(200, 90, 83, 0.25);
    border: 1px solid rgba(200, 90, 83, 0.4);
    padding: 1px 5px;
    border-radius: 0px;
    letter-spacing: 0.5px;
}

.alert-dismiss-btn {
    background: transparent;
    border: none;
    color: #6a7c8e;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.15s;
}

.alert-dismiss-btn:hover {
    color: #c85a53;
}

.alert-body {
    font-size: 11px;
    color: #b8c4d0;
    line-height: 1.35;
}

.alert-action-btn {
    align-self: flex-start;
    margin-top: 3px;
    background: #131821;
    border: 1px solid #283748;
    color: #c5ced8;
    font-size: 10px;
    font-family: 'Share Tech Mono', monospace, sans-serif;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 0px;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.6px;
}

.alert-action-btn:hover {
    background: #1b232f;
    border-color: #4d88b0;
    color: #ffffff;
}

/* Room target highlight ping on cutaway */
.room-target-highlight {
    border-color: #00f0ff !important;
    background: rgba(0, 240, 255, 0.35) !important;
    box-shadow: inset 0 0 24px rgba(0, 240, 255, 0.7), 0 0 16px rgba(0, 240, 255, 0.5) !important;
    animation: roomPing 0.6s ease 3 alternate !important;
}

@keyframes roomPing {
    0% { transform: scale(1); }
    100% { transform: scale(1.02); }
}

/* Cutaway Active Crisis Hazard State (Step 6) */
.room-interactive-overlay.room-crisis-active {
    border: 2px solid #f85149 !important;
    background: rgba(248, 81, 73, 0.16) !important;
    box-shadow: 0 0 16px rgba(248, 81, 73, 0.65), inset 0 0 12px rgba(248, 81, 73, 0.4) !important;
    animation: roomCrisisPulse 1.0s infinite alternate !important;
}

.room-interactive-overlay.room-crisis-active .room-tooltip-tag {
    opacity: 1 !important;
    color: #ff7b72 !important;
    border-color: #f85149 !important;
    background: rgba(32, 8, 10, 0.95) !important;
}

@keyframes roomCrisisPulse {
    0% {
        border-color: #f85149;
        box-shadow: 0 0 12px rgba(248, 81, 73, 0.5), inset 0 0 8px rgba(248, 81, 73, 0.3);
        background: rgba(248, 81, 73, 0.12);
    }
    100% {
        border-color: #ff7b72;
        box-shadow: 0 0 22px rgba(248, 81, 73, 0.85), inset 0 0 16px rgba(248, 81, 73, 0.55);
        background: rgba(248, 81, 73, 0.24);
    }
}

/* Crisis Resolution Progress Bar in Alert Cards */
.crisis-progress-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.crisis-progress-track {
    flex: 1;
    height: 6px;
    background: rgba(10, 20, 30, 0.95);
    border: 1px solid rgba(0, 240, 255, 0.35);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.crisis-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #388bfd, #00f0ff);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
    transition: width 0.2s ease-out;
}

.crisis-progress-fill.unmanned {
    background: rgba(248, 81, 73, 0.35);
    box-shadow: none;
}

.crisis-progress-percent {
    font-size: 10px;
    font-weight: 700;
    color: #00f0ff;
    font-family: inherit;
    min-width: 32px;
    text-align: right;
    letter-spacing: 0.3px;
}

.crisis-progress-percent.unmanned {
    color: #f85149;
}

/* =========================================================================
   STEP 8: MISSION DEBRIEFING & POST-FLIGHT SCORECARD MODAL
   ========================================================================= */
.debrief-modal {
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 12, 0.88);
    backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: 'Share Tech Mono', monospace, sans-serif;
}

.debrief-modal.hidden {
    display: none !important;
}

.debrief-card {
    width: min(880px, 94vw);
    max-height: 90vh;
    background: #0d1117;
    border: 2px solid #30363d;
    border-radius: 4px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 240, 255, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: debriefFadeIn 0.35s ease-out;
}

@keyframes debriefFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.debrief-header {
    padding: 16px 20px;
    border-bottom: 1px solid #30363d;
    background: #161b22;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.debrief-header.win {
    border-bottom: 2px solid #238636;
    background: linear-gradient(90deg, rgba(35, 134, 54, 0.25) 0%, rgba(22, 27, 34, 0.95) 100%);
}

.debrief-header.defeat {
    border-bottom: 2px solid #da3633;
    background: linear-gradient(90deg, rgba(218, 54, 51, 0.25) 0%, rgba(22, 27, 34, 0.95) 100%);
}

.debrief-title-block {
    flex: 1;
}

.debrief-badge {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 2px;
    display: inline-block;
    margin-bottom: 6px;
}

.debrief-badge.win {
    background: rgba(46, 160, 67, 0.2);
    color: #3fb950;
    border: 1px solid #2ea043;
}

.debrief-badge.defeat {
    background: rgba(248, 81, 73, 0.2);
    color: #ff7b72;
    border: 1px solid #da3633;
}

.debrief-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #f0f6fc;
    margin: 0 0 4px 0;
}

.debrief-desc {
    font-size: 12px;
    color: #8b949e;
    line-height: 1.4;
    margin: 0;
}

.rank-stamp-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: 2px solid #30363d;
    border-radius: 4px;
    background: #090d13;
    min-width: 110px;
    text-align: center;
}

.rank-stamp-letter {
    font-size: 38px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 1px;
}

.rank-stamp-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 4px;
}

.rank-stamp-score {
    font-size: 11px;
    font-weight: 700;
    color: #79c0ff;
    margin-top: 2px;
}

.rank-s { border-color: #58a6ff; color: #58a6ff; text-shadow: 0 0 10px rgba(88, 166, 255, 0.5); }
.rank-a { border-color: #3fb950; color: #3fb950; text-shadow: 0 0 10px rgba(63, 185, 80, 0.5); }
.rank-b { border-color: #d29922; color: #d29922; text-shadow: 0 0 10px rgba(210, 153, 34, 0.5); }
.rank-c { border-color: #db6d28; color: #db6d28; }
.rank-d { border-color: #f85149; color: #f85149; }
.rank-f { border-color: #da3633; color: #ff7b72; text-shadow: 0 0 10px rgba(218, 54, 51, 0.5); }

.debrief-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.debrief-section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #79c0ff;
    text-transform: uppercase;
    margin-bottom: 8px;
    border-bottom: 1px solid #21262d;
    padding-bottom: 4px;
}

.debrief-telemetry-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.debrief-stat-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 3px;
    padding: 8px;
    text-align: center;
}

.debrief-stat-label {
    font-size: 9.5px;
    color: #8b949e;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.debrief-stat-val {
    font-size: 14px;
    font-weight: 700;
    color: #f0f6fc;
    margin-top: 3px;
}

.debrief-crew-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
}

.debrief-crew-table th {
    text-align: left;
    font-size: 10px;
    color: #8b949e;
    letter-spacing: 0.8px;
    padding: 6px 8px;
    background: #161b22;
    border-bottom: 1px solid #30363d;
}

.debrief-crew-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #21262d;
    color: #c9d1d9;
}

.status-optimal { color: #3fb950; font-weight: 700; }
.status-survived { color: #7ee787; font-weight: 600; }
.status-injured { color: #d29922; font-weight: 600; }
.status-kia { color: #ff7b72; font-weight: 700; }

.debrief-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11.5px;
}

.debrief-breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 3px 6px;
    background: #161b22;
    border-radius: 2px;
}

.debrief-points-pos {
    color: #3fb950;
    font-weight: 700;
}

.debrief-points-neg {
    color: #ff7b72;
    font-weight: 700;
}

.debrief-actions {
    padding: 12px 20px;
    border-top: 1px solid #30363d;
    background: #161b22;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.debrief-btn-inspect {
    background: #21262d;
    border: 1px solid #30363d;
    color: #c9d1d9;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 8px 16px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.debrief-btn-inspect:hover {
    background: #30363d;
    color: #f0f6fc;
}

.debrief-btn-restart {
    background: #238636;
    border: 1px solid #2ea043;
    color: #ffffff;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 8px 20px;
    border-radius: 3px;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(46, 160, 67, 0.4);
    transition: all 0.15s ease;
}

.debrief-btn-restart:hover {
    background: #2ea043;
    box-shadow: 0 0 18px rgba(46, 160, 67, 0.7);
}

.time-btn.debrief-btn {
    border-color: #58a6ff;
    color: #58a6ff;
}

.time-btn.debrief-btn:hover {
    background: rgba(88, 166, 255, 0.2);
}

.hidden,
#phase2-btn-debrief.hidden {
    display: none !important;
}




