@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@500;700;800&family=Share+Tech+Mono&family=Black+Ops+One&family=VT323&display=swap');

:root {
    --duke-yellow: #facc15;
    --duke-gold: #eab308;
    --duke-red: #ef4444;
    --duke-dark-red: #991b1b;
    --duke-blood: #dc2626;
    --duke-cyan: #06b6d4;
    --duke-green: #22c55e;
    --duke-toxic: #39ff14;
    --duke-steel-dark: #12151c;
    --duke-steel: #1e2530;
    --duke-steel-light: #334155;
    --hud-border-outer: #475569;
    --hud-border-inner: #0f172a;
    --led-red: #ff2a2a;
    --led-amber: #ffaa00;
    --led-green: #00ff66;
    --led-blue: #00bfff;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #050608;
    font-family: 'Chakra Petch', sans-serif;
    color: #f1f5f9;
}

#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    cursor: crosshair;
}

/* Screen Damage & Pickup Flash Overlay */
#flash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
    opacity: 0;
    transition: opacity 0.08s ease-out;
}

#flash-overlay.damage {
    background: radial-gradient(circle, rgba(220, 38, 38, 0.3) 0%, rgba(185, 28, 28, 0.8) 100%);
    opacity: 1;
}

#flash-overlay.toxic {
    background: radial-gradient(circle, rgba(57, 255, 20, 0.25) 0%, rgba(34, 197, 94, 0.7) 100%);
    opacity: 1;
}

#flash-overlay.item {
    background: radial-gradient(circle, rgba(250, 204, 21, 0.2) 0%, rgba(234, 179, 8, 0.5) 100%);
    opacity: 1;
}

#flash-overlay.atomic {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, rgba(37, 99, 235, 0.6) 100%);
    opacity: 1;
}

#flash-overlay.denied {
    background: radial-gradient(circle, rgba(239, 68, 68, 0.45) 0%, rgba(185, 28, 28, 0.9) 100%);
    opacity: 1;
    animation: denied-strobe 0.5s cubic-bezier(0.1, 0.9, 0.2, 1);
}

@keyframes denied-strobe {
    0% { opacity: 0; }
    20% { opacity: 1; }
    40% { opacity: 0.25; }
    60% { opacity: 0.85; }
    80% { opacity: 0.2; }
    100% { opacity: 0; }
}

/* ========================================================
   KEYCARD HAND SWIPE & ACCESS SCANNER OVERLAY
   ======================================================== */
#keycard-hand {
    position: absolute;
    bottom: 0;
    right: 15%;
    width: 380px;
    height: 420px;
    pointer-events: none;
    z-index: 12;
    transform-origin: bottom right;
    transform: translateY(115%) translateX(15%) rotate(18deg);
    opacity: 0;
}

#keycard-hand.card-none,
#keycard-hand.card-standard {
    --card-fill: #0891b2;
    --card-glow: #22d3ee;
    --card-text-col: #cffafe;
}

#keycard-hand.card-blue {
    --card-fill: #0284c7;
    --card-glow: #38bdf8;
    --card-text-col: #bae6fd;
}

#keycard-hand.card-yellow {
    --card-fill: #eab308;
    --card-glow: #fef08a;
    --card-text-col: #fef9c3;
}

#keycard-hand.card-red {
    --card-fill: #dc2626;
    --card-glow: #f87171;
    --card-text-col: #fecaca;
}

#keycard-hand.swiping {
    opacity: 1;
    animation: swipe-card-action 0.85s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

@keyframes swipe-card-action {
    0% {
        transform: translateY(115%) translateX(15%) rotate(18deg);
        opacity: 0;
    }
    20% {
        transform: translateY(-2%) translateX(-5%) rotate(4deg);
        opacity: 1;
    }
    35% {
        transform: translateY(-6%) translateX(-8%) rotate(2deg);
        opacity: 1;
    }
    60% {
        transform: translateY(26%) translateX(-12%) rotate(-4deg);
        opacity: 1;
    }
    75% {
        transform: translateY(30%) translateX(-10%) rotate(-3deg);
        opacity: 1;
    }
    100% {
        transform: translateY(115%) translateX(15%) rotate(18deg);
        opacity: 0;
    }
}

.hand-card-graphic {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.9));
}

.hand-card-svg {
    width: 100%;
    height: 100%;
}

/* Flashing Security Warning Banner */
.access-warning-banner {
    position: absolute;
    top: 64px;
    left: 50%;
    transform: translateX(-50%);
    width: min(520px, 90vw);
    background: rgba(12, 10, 16, 0.96);
    border: 2px solid #ef4444;
    border-radius: 6px;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.8), inset 0 0 15px rgba(239, 68, 68, 0.35);
    z-index: 25;
    pointer-events: none;
    overflow: hidden;
    animation: banner-alarm-pulse 0.4s infinite alternate;
}

@keyframes banner-alarm-pulse {
    from {
        border-color: #ef4444;
        box-shadow: 0 0 25px rgba(239, 68, 68, 0.7), inset 0 0 12px rgba(239, 68, 68, 0.3);
    }
    to {
        border-color: #f87171;
        box-shadow: 0 0 40px rgba(239, 68, 68, 1), inset 0 0 22px rgba(239, 68, 68, 0.6);
    }
}

.warning-stripes {
    height: 8px;
    width: 100%;
    background: repeating-linear-gradient(
        -45deg,
        #ef4444,
        #ef4444 12px,
        #18181b 12px,
        #18181b 24px
    );
}

.warning-alert-body {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 20px;
}

.warning-alert-icon {
    font-size: 28px;
    color: #ef4444;
    text-shadow: 0 0 12px #ef4444;
    animation: icon-strobe 0.3s infinite alternate;
}

@keyframes icon-strobe {
    from { transform: scale(1); filter: brightness(1); }
    to { transform: scale(1.15); filter: brightness(1.4); }
}

.warning-alert-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.warning-alert-title {
    font-family: 'Orbitron', monospace, sans-serif;
    font-size: 14px;
    font-weight: 900;
    color: #ef4444;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
}

.warning-alert-desc {
    font-family: 'Orbitron', monospace, sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: #fca5a5;
    letter-spacing: 1.5px;
    margin-top: 2px;
}

/* ========================================================
   HUD OVERLAYS
   ======================================================== */
#hud-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Top Bar */
.hud-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(180deg, rgba(10, 14, 20, 0.85) 0%, rgba(10, 14, 20, 0) 100%);
}

.hud-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-title {
    font-family: 'Black Ops One', cursive;
    font-size: 26px;
    letter-spacing: 2px;
    color: var(--duke-yellow);
    text-shadow: 0 0 10px rgba(250, 204, 21, 0.6), 2px 2px 0px #000;
}

.brand-sub {
    font-size: 13px;
    font-weight: 800;
    background: var(--duke-red);
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 1px;
    text-shadow: 1px 1px 0 #000;
}

.brand-depth {
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #334155;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 1.5px;
}

.hud-top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
}

#tactical-readout {
    position: absolute;
    top: 58px;
    left: 20px;
    min-width: 250px;
    padding: 7px 10px;
    background: rgba(7, 19, 27, 0.9);
    border-left: 3px solid #67e8f9;
    border-top: 1px solid #334155;
    border-right: 1px solid #334155;
    border-bottom: 1px solid #334155;
    border-radius: 0 4px 4px 0;
    color: #a5f3fc;
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
    letter-spacing: 0.4px;
    text-shadow: 1px 1px 0 #000;
    pointer-events: none;
}

.tactical-row {
    display: flex;
    align-items: baseline;
    gap: 9px;
    white-space: nowrap;
}

.tactical-label {
    width: 64px;
    color: #94a3b8;
    font-size: 10px;
}

#hud-objective {
    color: #67e8f9;
}

#hud-hostiles {
    color: var(--duke-yellow);
}

#hud-hostiles.threat-near {
    color: #fb7185;
    text-shadow: 0 0 8px rgba(244, 63, 94, 0.8);
}

#hud-tracker {
    color: #38bdf8;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
}

#hud-tracker.tracker-direct {
    color: #f43f5e;
    text-shadow: 0 0 8px rgba(244, 63, 94, 0.85);
}

#hud-tracker.tracker-blocked {
    color: #fbbf24;
    text-shadow: 0 0 6px rgba(251, 191, 36, 0.5);
}

#hud-tracker.tracker-clear {
    color: #4ade80;
}

#elevator-waypoint {
    position: absolute;
    top: 118px;
    left: 20px;
    display: grid;
    grid-template-columns: 34px 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 10px;
    min-width: 250px;
    padding: 6px 12px;
    border: 1px solid #334155;
    border-left: 3px solid #67e8f9;
    border-radius: 0 4px 4px 0;
    background: rgba(7, 19, 27, 0.9);
    box-shadow: 0 0 16px rgba(34, 211, 238, 0.15);
    color: #a5f3fc;
    font-family: 'Share Tech Mono', monospace;
    text-align: left;
    pointer-events: none;
    animation: waypointPulse 1.5s ease-in-out infinite;
}

.waypoint-ring {
    grid-row: 1 / span 2;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 2px solid #67e8f9;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(103, 232, 249, 0.65);
}

#elevator-waypoint-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: #67e8f9;
    transform-origin: center;
    transition: transform 0.05s linear;
}

#elevator-waypoint-arrow svg {
    width: 100%;
    height: 100%;
    display: block;
    fill: currentColor;
    filter: drop-shadow(0 0 3px rgba(103, 232, 249, 0.8));
}

#elevator-waypoint.waypoint-close #elevator-waypoint-arrow svg {
    filter: drop-shadow(0 0 4px rgba(234, 179, 8, 0.85));
}

#elevator-waypoint-label {
    grid-column: 2;
    font-size: 11px;
    letter-spacing: 1px;
    white-space: nowrap;
}

#elevator-waypoint-distance {
    grid-column: 2;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

#elevator-waypoint.waypoint-close {
    border-color: var(--duke-yellow);
    border-left-color: var(--duke-yellow);
    color: var(--duke-yellow);
    animation-duration: 0.55s;
}

@keyframes waypointPulse {
    0%, 100% { opacity: 0.82; }
    50% { opacity: 1; }
}

.hud-stat-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(18, 24, 38, 0.85);
    border: 1px solid #334155;
    padding: 4px 10px;
    border-radius: 4px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
}

.pill-label {
    color: #94a3b8;
    font-weight: 700;
}

.pill-val {
    color: var(--duke-yellow);
    font-weight: 800;
}

.retro-btn {
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
    border: 1px solid #475569;
    border-top-color: #64748b;
    border-bottom-color: #0f172a;
    color: #f8fafc;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    transition: all 0.1s ease;
}

.retro-btn:hover {
    background: linear-gradient(180deg, #475569 0%, #334155 100%);
    color: var(--duke-yellow);
}

.retro-btn:active {
    transform: translateY(1px);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
}

/* Crosshair & Interaction */
#crosshair-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

#crosshair {
    width: 22px;
    height: 22px;
    position: relative;
}

#crosshair::before, #crosshair::after {
    content: '';
    position: absolute;
    background-color: rgba(250, 204, 21, 0.85);
    box-shadow: 0 0 4px rgba(0,0,0,0.8);
}

#crosshair::before {
    top: 10px;
    left: 0;
    width: 22px;
    height: 2px;
}

#crosshair::after {
    top: 0;
    left: 10px;
    width: 2px;
    height: 22px;
}

#crosshair.elevator-target::before,
#crosshair.elevator-target::after {
    background-color: #22d3ee;
    box-shadow: 0 0 8px rgba(34, 211, 238, 0.95);
}

#hit-marker {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 42px;
    height: 42px;
    border: 2px solid var(--duke-red);
    transform: rotate(45deg);
    opacity: 0.9;
    animation: hitPulse 0.15s ease-out forwards;
}

@keyframes hitPulse {
    0% { transform: scale(1.3) rotate(45deg); opacity: 1; }
    100% { transform: scale(1) rotate(45deg); opacity: 0; }
}

#interaction-prompt {
    position: absolute;
    top: 58%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--duke-yellow);
    padding: 6px 14px;
    border-radius: 4px;
    color: #f8fafc;
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.7), 0 0 10px rgba(250, 204, 21, 0.3);
    animation: promptPulse 1.2s infinite alternate;
}

.key-prompt {
    color: var(--duke-yellow);
    font-weight: 800;
}

@keyframes promptPulse {
    from { transform: translateX(-50%) scale(1); }
    to { transform: translateX(-50%) scale(1.05); }
}

/* Duke Quip Banner */
#duke-quip-banner {
    position: absolute;
    top: 75px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(10, 12, 16, 0.92);
    border: 2px solid var(--duke-yellow);
    padding: 8px 20px;
    border-radius: 6px;
    box-shadow: 0 0 25px rgba(250, 204, 21, 0.4), 0 10px 20px rgba(0,0,0,0.8);
    transition: opacity 0.3s ease;
}

.duke-avatar-mini {
    width: 32px;
    height: 32px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><rect width="32" height="32" fill="%23dc2626"/><rect x="6" y="4" width="20" height="7" fill="%23facc15"/><rect x="7" y="11" width="18" height="12" fill="%23fed7aa"/><rect x="8" y="13" width="16" height="4" fill="%230f172a"/><rect x="11" y="21" width="10" height="2" fill="%23991b1b"/></svg>') center/contain no-repeat;
    border: 1px solid #475569;
}

.duke-speech-text {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 800;
    font-size: 17px;
    color: var(--duke-yellow);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-shadow: 2px 2px 0 #000;
}

/* German Soldier Speech Banner */
#soldier-speech-banner {
    position: absolute;
    top: 125px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(24, 30, 27, 0.94);
    border: 2px solid #6b8272;
    padding: 8px 18px;
    border-radius: 6px;
    box-shadow: 0 0 25px rgba(107, 130, 114, 0.45), 0 10px 20px rgba(0,0,0,0.85);
    transition: opacity 0.3s ease;
    z-index: 50;
    pointer-events: none;
}

.soldier-avatar-mini {
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
}

.soldier-speech-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.soldier-speech-sender {
    font-family: 'Chakra Petch', monospace;
    font-size: 11px;
    font-weight: 700;
    color: #9cb0a0;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.soldier-speech-text {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 800;
    font-size: 16px;
    color: #f1f5f2;
    letter-spacing: 0.5px;
    text-shadow: 2px 2px 0 #000;
}

.soldier-speech-sub {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #a3b8aa;
    font-style: italic;
    letter-spacing: 0.3px;
}

/* Boss Health Bar */
#boss-bar-container {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    max-width: 640px;
    background: rgba(15, 23, 42, 0.92);
    border: 2px solid var(--duke-red);
    padding: 8px 12px;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
    border-radius: 3px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    z-index: 100;
}

.boss-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.boss-label {
    font-family: 'Black Ops One', cursive;
    font-size: 14px;
    color: var(--duke-red);
    letter-spacing: 1.5px;
    text-shadow: 1px 1px 0 #000;
}

.boss-power-badge {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 13px;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid #38bdf8;
    padding: 2px 8px;
    border-radius: 3px;
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
    transition: all 0.2s ease;
}

.boss-bar-frame {
    height: 16px;
    background: #1e1b2e;
    border: 1px solid #475569;
    position: relative;
    overflow: hidden;
    border-radius: 2px;
}

.boss-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #dc2626, #f97316);
    box-shadow: 0 0 10px #ef4444;
    transition: width 0.15s ease-out;
}

.boss-sub-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.boss-status-text {
    color: #38bdf8;
    font-weight: 600;
    text-shadow: 0 0 6px rgba(56, 189, 248, 0.6);
    transition: color 0.2s ease;
}

.boss-hp-text {
    color: #f1f5f9;
    font-weight: 700;
    text-shadow: 1px 1px 0 #000;
}

#boss-bar-container.boss-hit {
    animation: bossHitShake 0.18s ease-out;
}

@keyframes bossHitShake {
    0% {
        transform: translateX(-50%) scale(1);
        filter: brightness(2) contrast(1.2);
    }
    30% {
        transform: translateX(calc(-50% + 4px)) scale(1.02);
    }
    60% {
        transform: translateX(calc(-50% - 3px)) scale(1.01);
    }
    100% {
        transform: translateX(-50%) scale(1);
        filter: brightness(1);
    }
}

#boss-bar-container.boss-critical {
    border-color: #ef4444;
    box-shadow: 0 0 35px rgba(239, 68, 68, 0.95), inset 0 0 15px rgba(239, 68, 68, 0.4);
    animation: bossCriticalPulse 0.45s ease-in-out infinite alternate;
}

@keyframes bossCriticalPulse {
    from {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
        border-color: #f97316;
    }
    to {
        box-shadow: 0 0 45px rgba(239, 68, 68, 1), inset 0 0 25px rgba(239, 68, 68, 0.6);
        border-color: #ef4444;
    }
}

/* Item Toast */
#item-toast {
    position: absolute;
    bottom: 110px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(15, 23, 42, 0.95);
    border-left: 5px solid var(--duke-yellow);
    border-top: 1px solid #334155;
    border-right: 1px solid #334155;
    border-bottom: 1px solid #334155;
    padding: 10px 16px;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.8);
    transition: all 0.25s ease;
}

.toast-icon {
    font-size: 24px;
    color: var(--duke-yellow);
}

.toast-title {
    font-weight: 800;
    font-size: 14px;
    color: var(--duke-yellow);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.toast-desc {
    font-size: 12px;
    color: #cbd5e1;
    font-family: 'Share Tech Mono', monospace;
}

/* ========================================================
   AREA CLEAR POP-UP WINDOW
   ======================================================== */
#area-clear-modal {
    position: fixed;
    top: 24%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 85;
    pointer-events: none;
    width: min(440px, 92vw);
    box-sizing: border-box;
}

.area-clear-content {
    position: relative;
    padding: 22px 26px;
    background: radial-gradient(circle at center, rgba(15, 33, 48, 0.96) 0%, rgba(6, 17, 26, 0.98) 100%);
    border: 2px solid #facc15;
    border-radius: 6px;
    box-shadow: 0 0 40px rgba(250, 204, 21, 0.4), 0 10px 30px rgba(0, 0, 0, 0.9), inset 0 0 25px rgba(250, 204, 21, 0.12);
    text-align: center;
    font-family: 'Share Tech Mono', monospace;
    overflow: hidden;
}

.area-clear-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        rgba(0, 0, 0, 0.15) 2px,
        transparent 2px,
        transparent 4px
    );
    pointer-events: none;
}

.area-clear-corner {
    position: absolute;
    width: 14px;
    height: 14px;
    border-color: #facc15;
    border-style: solid;
}
.area-clear-corner.tl { top: 4px; left: 4px; border-width: 3px 0 0 3px; }
.area-clear-corner.tr { top: 4px; right: 4px; border-width: 3px 3px 0 0; }
.area-clear-corner.bl { bottom: 4px; left: 4px; border-width: 0 0 3px 3px; }
.area-clear-corner.br { bottom: 4px; right: 4px; border-width: 0 3px 3px 0; }

.area-clear-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 6px;
}

.area-clear-star {
    color: #facc15;
    font-size: 14px;
    text-shadow: 0 0 8px rgba(250, 204, 21, 0.8);
}

.area-clear-tag {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #67e8f9;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(103, 232, 249, 0.8);
}

.area-clear-headline {
    margin: 4px 0 8px;
    font-family: 'Black Ops One', 'Chakra Petch', cursive, sans-serif;
    font-size: 38px;
    line-height: 1;
    letter-spacing: 3px;
    color: #facc15;
    text-shadow: 0 0 20px rgba(250, 204, 21, 0.8), 3px 3px 0 #78350f, 0 0 35px rgba(234, 179, 8, 0.6);
}

.area-clear-line {
    height: 2px;
    margin: 10px auto 12px;
    width: 80%;
    background: linear-gradient(90deg, transparent, #facc15 30%, #67e8f9 50%, #facc15 70%, transparent);
    box-shadow: 0 0 8px rgba(250, 204, 21, 0.7);
}

.area-clear-detail {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #ecfeff;
    text-shadow: 0 0 8px rgba(165, 243, 252, 0.6);
    margin-bottom: 6px;
}

.area-clear-action {
    font-size: 11px;
    letter-spacing: 1px;
    color: #94a3b8;
    text-transform: uppercase;
}

#area-clear-modal.pop-in {
    animation: areaClearPopIn 0.38s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

#area-clear-modal.fade-out {
    animation: areaClearFadeOut 0.65s ease-out forwards;
}

@keyframes areaClearPopIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -60%) scale(0.75);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.0);
    }
}

@keyframes areaClearFadeOut {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.0);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -42%) scale(1.05);
    }
}

/* Small, non-modal notifications for world pickups. */
#pickup-feed {
    position: fixed;
    right: 18px;
    bottom: 108px;
    z-index: 72;
    width: min(270px, calc(100vw - 36px));
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    pointer-events: none;
}

.pickup-notice {
    display: grid;
    grid-template-columns: 28px 1fr;
    column-gap: 9px;
    width: fit-content;
    max-width: 100%;
    padding: 7px 10px;
    color: #ecfeff;
    background: rgba(5, 18, 25, 0.9);
    border: 1px solid rgba(34, 211, 238, 0.55);
    border-right: 4px solid #22d3ee;
    border-radius: 4px 0 0 4px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
    font-family: 'Share Tech Mono', monospace;
    animation: pickup-in 0.18s ease-out;
}

.pickup-notice.leaving { animation: pickup-out 0.2s ease-in forwards; }
.pickup-notice-icon { grid-row: 1 / 3; align-self: center; color: #facc15; font: 700 22px/1 monospace; text-align: center; }
.pickup-notice-title { color: #facc15; font-size: 13px; font-weight: 800; letter-spacing: 0.7px; text-transform: uppercase; }
.pickup-notice-detail { color: #bae6fd; font-size: 11px; white-space: normal; }

@keyframes pickup-in { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pickup-out { to { opacity: 0; transform: translateX(18px); } }

@media (max-width: 650px) {
    #pickup-feed {
        top: 230px;
        right: 8px;
        bottom: auto;
        width: min(210px, calc(100vw - 16px));
    }
    .pickup-notice { padding: 6px 8px; grid-template-columns: 22px 1fr; }
    .pickup-notice-icon { font-size: 18px; }
    .pickup-notice-title { font-size: 11px; }
    .pickup-notice-detail { font-size: 10px; }
}

/* ========================================================
   DUKE NUKEM 3D CLASSIC BOTTOM STATUS BAR
   ======================================================== */
.duke-status-bar {
    width: 100%;
    height: 84px;
    background: linear-gradient(180deg, #2b3544 0%, #151b24 18%, #0f131a 100%);
    border-top: 3px solid #64748b;
    border-bottom: 2px solid #000;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    padding: 6px 12px;
    pointer-events: auto;
    position: relative;
    z-index: 30;
}

.duke-status-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.25);
}

.status-panel {
    background: linear-gradient(180deg, #10141c 0%, #1b222d 100%);
    border: 2px solid #334155;
    border-top-color: #0f172a;
    border-left-color: #0f172a;
    border-right-color: #475569;
    border-bottom-color: #475569;
    border-radius: 4px;
    padding: 4px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    box-shadow: inset 1px 1px 5px rgba(0,0,0,0.8);
}

.panel-header {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.digital-display {
    font-family: 'VT323', monospace;
    font-size: 40px;
    line-height: 34px;
    color: var(--led-amber);
    text-shadow: 0 0 8px rgba(255, 170, 0, 0.7);
    letter-spacing: 2px;
}

.panel-ammo {
    min-width: 140px;
}

.weapon-name {
    font-size: 10px;
    font-weight: 800;
    color: #cbd5e1;
    letter-spacing: 1px;
    margin-top: 2px;
}

.panel-health {
    min-width: 150px;
}

.ego-display {
    color: var(--led-red);
    text-shadow: 0 0 8px rgba(255, 42, 42, 0.7);
}

.health-bar-track, .armor-bar-track {
    width: 100%;
    height: 6px;
    background: #090c10;
    border: 1px solid #334155;
    margin-top: 2px;
    position: relative;
}

.health-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #991b1b, #ef4444);
    box-shadow: 0 0 6px #ef4444;
}

.panel-portrait {
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2px;
}

.portrait-frame {
    width: 52px;
    height: 52px;
    background: #090d14;
    border: 2px solid #64748b;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 8px #000;
}

.duke-face {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.portrait-label {
    font-family: 'Black Ops One', cursive;
    font-size: 10px;
    color: var(--duke-yellow);
    letter-spacing: 1px;
    margin-top: 2px;
}

.panel-armor {
    min-width: 140px;
}

.armor-display {
    color: var(--led-blue);
    text-shadow: 0 0 8px rgba(0, 191, 255, 0.7);
}

.armor-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #0284c7, #38bdf8);
    box-shadow: 0 0 6px #38bdf8;
}

.panel-rack {
    flex: 1;
    max-width: 375px;
}

.weapons-grid {
    display: flex;
    gap: 4px;
    margin-top: 3px;
}

.weapon-slot {
    flex: 1;
    background: #0c1017;
    border: 1px solid #334155;
    padding: 3px 4px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    color: #64748b;
    text-align: center;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.1s ease;
}

.weapon-slot .w-key {
    color: #94a3b8;
    margin-right: 2px;
}

.weapon-slot.unlocked {
    color: #cbd5e1;
    border-color: #475569;
}

.weapon-slot.active {
    background: linear-gradient(180deg, #475569 0%, #1e293b 100%);
    border-color: var(--duke-yellow);
    color: var(--duke-yellow);
    box-shadow: 0 0 6px rgba(250, 204, 21, 0.4);
}

.keys-row {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.keycard-tag {
    flex: 1;
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    font-weight: 800;
    text-align: center;
    padding: 2px;
    border-radius: 2px;
    opacity: 0.25;
    border: 1px solid currentColor;
}

#key-blue {
    color: #38bdf8;
}

#key-yellow {
    color: #facc15;
}

#key-red {
    color: #ef4444;
}

.keycard-tag.has-key {
    opacity: 1;
    box-shadow: 0 0 8px currentColor;
    background: currentColor;
    color: #000 !important;
}

/* ========================================================
   MODALS: TITLE, PAUSE, DEATH, VICTORY
   ======================================================== */
#title-screen, #pause-screen, #death-screen, #victory-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(4, 6, 10, 0.85);
    backdrop-filter: blur(8px);
}

.title-modal, .pause-modal, .death-modal, .victory-modal {
    max-width: 650px;
    width: 90%;
    background: linear-gradient(180deg, #1a2230 0%, #0d121c 100%);
    border: 3px solid #475569;
    border-top: 3px solid #64748b;
    box-shadow: 0 20px 50px rgba(0,0,0,0.9), 0 0 30px rgba(250, 204, 21, 0.15);
    border-radius: 8px;
    padding: 28px;
    text-align: center;
    position: relative;
}

.title-logo {
    margin-bottom: 20px;
}

.title-top {
    font-family: 'Black Ops One', cursive;
    font-size: 58px;
    line-height: 52px;
    letter-spacing: 4px;
    color: var(--duke-yellow);
    text-shadow: 
        0 0 20px rgba(250, 204, 21, 0.7),
        3px 3px 0 #b45309,
        5px 5px 0 #78350f,
        7px 7px 0 #000;
}

.title-bottom {
    font-family: 'Black Ops One', cursive;
    font-size: 40px;
    line-height: 38px;
    letter-spacing: 3px;
    color: var(--duke-red);
    text-shadow: 
        0 0 20px rgba(239, 68, 68, 0.7),
        2px 2px 0 #991b1b,
        4px 4px 0 #450a0a,
        6px 6px 0 #000;
}

.title-tagline {
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    color: #94a3b8;
    margin-top: 8px;
    letter-spacing: 2px;
}

.briefing-box {
    background: rgba(10, 15, 22, 0.8);
    border: 1px solid #334155;
    padding: 14px 18px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: left;
}

.briefing-text {
    font-size: 14px;
    line-height: 1.5;
    color: #cbd5e1;
}

.briefing-text strong {
    color: var(--duke-yellow);
}

.difficulty-select {
    margin-bottom: 24px;
}

.diff-header {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: #94a3b8;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.diff-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.diff-btn {
    background: #111827;
    border: 1px solid #374151;
    color: #9ca3af;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 11px;
    padding: 8px 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.diff-btn:hover {
    border-color: #6b7280;
    color: #fff;
}

.diff-btn.selected {
    background: linear-gradient(180deg, #b45309 0%, #78350f 100%);
    border-color: var(--duke-yellow);
    color: #fff;
    box-shadow: 0 0 10px rgba(250, 204, 21, 0.5);
}

.start-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(180deg, #eab308 0%, #ca8a04 50%, #a16207 100%);
    border: 2px solid #fef08a;
    border-radius: 6px;
    color: #000;
    font-family: 'Black Ops One', cursive;
    font-size: 20px;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(234, 179, 8, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.6);
    position: relative;
    overflow: hidden;
    transition: all 0.15s ease;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(234, 179, 8, 0.7), inset 0 2px 6px rgba(255, 255, 255, 0.8);
}

.start-btn:active {
    transform: translateY(1px);
}

.controls-guide {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 18px;
    font-size: 12px;
    color: #94a3b8;
    text-align: left;
}

.controls-guide .key {
    display: inline-block;
    background: #1e293b;
    border: 1px solid #475569;
    padding: 1px 6px;
    border-radius: 3px;
    font-family: 'Share Tech Mono', monospace;
    font-weight: 700;
    color: var(--duke-yellow);
    margin-right: 4px;
}

/* Death Screen */
.death-title {
    font-family: 'Black Ops One', cursive;
    font-size: 46px;
    color: var(--duke-red);
    text-shadow: 0 0 25px rgba(220, 38, 38, 0.8), 3px 3px 0 #450a0a;
    margin-bottom: 12px;
}

.death-quote {
    font-size: 16px;
    font-style: italic;
    color: #e2e8f0;
    margin-bottom: 20px;
}

.death-stats {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 24px;
}

/* Victory Screen */
.victory-title {
    font-family: 'Black Ops One', cursive;
    font-size: 46px;
    color: var(--duke-yellow);
    text-shadow: 0 0 25px rgba(250, 204, 21, 0.8), 3px 3px 0 #78350f;
    margin-bottom: 8px;
}

.deck-subtitle {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: #38bdf8;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.victory-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #334155;
    padding: 10px 4px;
    border-radius: 4px;
}

.stat-num {
    display: block;
    font-family: 'VT323', monospace;
    font-size: 32px;
    color: var(--duke-yellow);
}

.stat-txt {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    color: #94a3b8;
    letter-spacing: 1px;
}

.victory-quote {
    font-size: 15px;
    font-style: italic;
    color: #cbd5e1;
    margin-bottom: 24px;
}

/* ========================================================
   MOBILE VIRTUAL CONTROLS
   ======================================================== */
#mobile-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 25;
    pointer-events: none;
}

.stick-zone {
    position: absolute;
    bottom: 96px;
    left: 20px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.45);
    border: 2px solid rgba(56, 189, 248, 0.4);
    pointer-events: auto;
    touch-action: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stick-knob {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle, #38bdf8 0%, #0284c7 100%);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.6);
    pointer-events: none;
    transform: translate(0px, 0px);
}

.mobile-action-buttons {
    position: absolute;
    bottom: 96px;
    right: 20px;
    display: grid;
    grid-template-columns: repeat(2, 64px);
    grid-template-rows: repeat(3, 56px);
    gap: 8px;
    pointer-events: auto;
}

.m-btn {
    border-radius: 8px;
    border: 2px solid #64748b;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 800;
    font-size: 12px;
    color: #fff;
    cursor: pointer;
    touch-action: manipulation;
    box-shadow: 0 4px 10px rgba(0,0,0,0.6);
}

.m-btn:active {
    transform: scale(0.95);
}

.btn-fire {
    grid-column: 2;
    grid-row: 2 / span 2;
    background: linear-gradient(180deg, #ef4444 0%, #991b1b 100%);
    border-color: #f87171;
    font-size: 16px;
}

.btn-use {
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
    border-color: #60a5fa;
}

.btn-jump {
    background: linear-gradient(180deg, #10b981 0%, #047857 100%);
    border-color: #34d399;
}

.btn-wep {
    background: linear-gradient(180deg, #6366f1 0%, #4338ca 100%);
    border-color: #818cf8;
}

.btn-scope {
    background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
    border-color: #38bdf8;
    color: #fff;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* ========================================================
   RESPONSIVE LAYOUT ADJUSTMENTS
   ======================================================== */
@media (max-width: 900px) {
    .duke-status-bar {
        height: 72px;
        padding: 4px 8px;
    }
    .digital-display {
        font-size: 30px;
        line-height: 26px;
    }
    .panel-ammo, .panel-health, .panel-armor {
        min-width: 95px;
    }
    .panel-portrait {
        width: 60px;
    }
    .portrait-frame {
        width: 42px;
        height: 42px;
    }
    .weapon-slot {
        font-size: 8px;
        padding: 2px;
    }
}

@media (max-width: 650px) {
    .brand-depth {
        display: none;
    }
    .hud-stat-pill {
        display: none;
    }
    .panel-armor {
        display: none;
    }
    .weapons-grid {
        display: none;
    }
    .diff-options {
        grid-template-columns: repeat(2, 1fr);
    }
    .controls-guide {
        grid-template-columns: 1fr;
    }
    #tactical-readout {
        top: 54px;
        left: 8px;
        min-width: 0;
        max-width: calc(100vw - 16px);
        padding: 5px 8px;
        font-size: 11px;
    }
    .tactical-label {
        width: 58px;
        font-size: 9px;
    }
    #elevator-waypoint {
        top: 112px;
        left: 8px;
        min-width: 0;
        max-width: calc(100vw - 16px);
        padding: 5px 8px;
        column-gap: 8px;
    }
    .waypoint-ring {
        width: 28px;
        height: 28px;
    }
    #elevator-waypoint-arrow {
        width: 18px;
        height: 18px;
    }
    #elevator-waypoint-label {
        font-size: 10px;
    }
    #elevator-waypoint-distance {
        font-size: 11px;
    }
    #area-clear-modal {
        width: min(340px, 94vw);
        top: 26%;
    }
    .area-clear-content {
        padding: 16px 18px;
    }
    .area-clear-headline {
        font-size: 28px;
    }
    .area-clear-detail {
        font-size: 12px;
    }
    .area-clear-action {
        font-size: 9px;
    }
}

/* ========================================================
   DUKE SPECIAL GEAR BAR & OVERLAYS
   ======================================================== */
.duke-gear-bar {
    position: absolute;
    bottom: 88px;
    left: 14px;
    display: flex;
    gap: 8px;
    pointer-events: auto;
    z-index: 25;
}

.gear-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid #475569;
    border-radius: 4px;
    padding: 3px 8px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: #94a3b8;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.6);
    transition: all 0.15s ease;
}

.gear-pill:hover {
    border-color: var(--duke-yellow);
    color: #fff;
}

.gear-pill.active {
    background: linear-gradient(180deg, #1e3a8a 0%, #0f172a 100%);
    border-color: #38bdf8;
    color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.gear-meter {
    font-weight: 800;
    color: var(--duke-yellow);
}

/* Night Vision Green Phosphor Screen Overlay */
#nightvision-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 18;
    background: radial-gradient(circle, rgba(34, 197, 94, 0.28) 0%, rgba(5, 46, 22, 0.75) 100%);
    box-shadow: inset 0 0 80px rgba(16, 185, 129, 0.6);
    mix-blend-mode: screen;
}

/* Steroids Adrenaline Pulse Overlay */
#steroids-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 17;
    border: 8px solid rgba(239, 68, 68, 0.8);
    box-shadow: inset 0 0 100px rgba(220, 38, 38, 0.5);
    animation: steroidPulse 0.4s infinite alternate;
}

@keyframes steroidPulse {
    from { opacity: 0.4; }
    to { opacity: 1.0; }
}


/* Diegetic descent readout; gameplay remains visible throughout the lift ride. */
#depth-readout { position:fixed; top:55px; right:20px; z-index:20; color:#67e8f9; font:14px monospace; pointer-events:none; }
#lift-prompt { position:fixed; bottom:180px; left:50%; transform:translateX(-50%); z-index:100; pointer-events:none; padding:10px 18px; background:#07131bf2; border:1px solid #67e8f9; box-shadow:0 0 16px rgba(103,232,249,0.3); color:#a5f3fc; font:14px monospace; text-align:center; border-radius:4px; user-select:none; }
#lift-status { position:fixed; left:50%; top:15%; transform:translateX(-50%); z-index:40; width:min(420px,85vw); padding:22px; border:1px solid #67e8f9; background:#07131be8; color:#a5f3fc; font:14px monospace; text-align:center; pointer-events:none; }
#lift-depth { display:block; font-size:42px; margin:16px 0; font-variant-numeric:tabular-nums; }
#lift-destination { line-height:1.5; }

@media (max-width: 650px) {
    #depth-readout {
        top: 104px;
        right: 8px;
        font-size: 12px;
    }
}

/* ========================================================
   TACTICAL SNIPER SCOPE OVERLAY
   ======================================================== */
#sniper-scope-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 28;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, transparent 38vmin, rgba(0, 0, 0, 0.95) 42vmin, #000 46vmin);
}

#sniper-scope-overlay.hidden {
    display: none !important;
}

.scope-housing {
    position: relative;
    width: 82vmin;
    height: 82vmin;
    border-radius: 50%;
    border: 3px solid rgba(56, 189, 248, 0.4);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.95), inset 0 0 60px rgba(8, 47, 73, 0.6);
    overflow: hidden;
}

.scope-lens {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.05) 0%, rgba(6, 78, 59, 0.08) 70%, rgba(0, 0, 0, 0.4) 100%);
}

.scope-circle.outer-ring {
    position: absolute;
    inset: 12%;
    border-radius: 50%;
    border: 1px dashed rgba(56, 189, 248, 0.35);
}

.scope-circle.inner-ring {
    position: absolute;
    inset: 32%;
    border-radius: 50%;
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.scope-crosshair {
    position: absolute;
    background: rgba(56, 189, 248, 0.85);
    box-shadow: 0 0 4px rgba(56, 189, 248, 0.6);
}

.scope-crosshair.ch-horizontal {
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    transform: translateY(-50%);
}

.scope-crosshair.ch-vertical {
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    transform: translateX(-50%);
}

.scope-center-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: #ef4444;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 6px #ef4444;
}

.scope-data {
    position: absolute;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 1px;
    color: #38bdf8;
    text-shadow: 0 0 5px rgba(56, 189, 248, 0.8);
    font-weight: 700;
}

.scope-data.top-left { top: 16%; left: 16%; }
.scope-data.top-right { top: 16%; right: 16%; text-align: right; }
.scope-data.bottom-left { bottom: 16%; left: 16%; }
.scope-data.bottom-right { bottom: 16%; right: 16%; text-align: right; }

.scope-data.locked {
    color: #ef4444 !important;
    text-shadow: 0 0 8px #ef4444 !important;
}

.scope-compass {
    position: absolute;
    bottom: 22%;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    color: #22c55e;
    letter-spacing: 2px;
}

/* ==========================================================================
   Tactical M1A2 Abrams Tank Driving HUD Overlay
   ========================================================================== */

#tank-hud-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 29;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

#tank-hud-overlay.hidden {
    display: none !important;
}

.tank-viewport-frame {
    position: absolute;
    inset: 24px;
    border: 1px solid rgba(74, 222, 128, 0.28);
    box-shadow: inset 0 0 45px rgba(20, 83, 45, 0.25), 0 0 15px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

.tank-corner {
    position: absolute;
    width: 32px;
    height: 32px;
    border-color: #4ade80;
    border-style: solid;
}
.tank-corner.tl { top: 0; left: 0; border-width: 3px 0 0 3px; }
.tank-corner.tr { top: 0; right: 0; border-width: 3px 3px 0 0; }
.tank-corner.bl { bottom: 0; left: 0; border-width: 0 0 3px 3px; }
.tank-corner.br { bottom: 0; right: 0; border-width: 0 3px 3px 0; }

.tank-reticle-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110px;
    height: 110px;
    border: 2px solid rgba(74, 222, 128, 0.45);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.35);
}

.tank-reticle-cross {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
}
.tank-reticle-cross::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, #4ade80, transparent 40%, transparent 60%, #4ade80);
}
.tank-reticle-cross::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, #4ade80, transparent 40%, transparent 60%, #4ade80);
}

.tank-header {
    position: absolute;
    top: 14px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Share Tech Mono', monospace;
}

.tank-title {
    font-size: 14px;
    font-weight: 800;
    color: #4ade80;
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(74, 222, 128, 0.7);
}

.tank-badge {
    font-size: 10px;
    padding: 2px 7px;
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid #22c55e;
    color: #86efac;
    letter-spacing: 1px;
    border-radius: 2px;
}

.tank-telemetry {
    position: absolute;
    top: 14px;
    right: 20px;
    display: flex;
    gap: 20px;
    font-family: 'Share Tech Mono', monospace;
}

.tank-telem-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.tank-telem-item .lbl {
    font-size: 9px;
    color: rgba(74, 222, 128, 0.65);
    letter-spacing: 1px;
}

.tank-telem-item .val {
    font-size: 14px;
    font-weight: 700;
    color: #4ade80;
    text-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
}

.tank-telem-item .val.ready {
    color: #4ade80;
}

.tank-telem-item .val.reloading {
    color: #fbbf24;
    text-shadow: 0 0 6px rgba(251, 191, 36, 0.6);
}

.tank-controls-bar {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 1px;
    color: rgba(229, 231, 235, 0.85);
    background: rgba(10, 20, 10, 0.75);
    border: 1px solid rgba(74, 222, 128, 0.35);
    padding: 6px 18px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.tank-controls-bar span.highlight {
    color: #facc15;
    font-weight: 700;
    text-shadow: 0 0 6px rgba(250, 204, 21, 0.6);
}

.tank-controls-bar span.exit-btn {
    color: #38bdf8;
    font-weight: 700;
}

/* ========================================================
   AH-64 APACHE HELICOPTER FLIGHT HUD OVERLAY
   ======================================================== */
#helicopter-hud-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 29;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

#helicopter-hud-overlay.hidden {
    display: none !important;
}

.heli-viewport-frame {
    position: absolute;
    inset: 24px;
    border: 1px solid rgba(245, 158, 11, 0.32);
    box-shadow: inset 0 0 50px rgba(180, 83, 9, 0.22), 0 0 18px rgba(0, 0, 0, 0.85);
    pointer-events: none;
}

.heli-corner {
    position: absolute;
    width: 34px;
    height: 34px;
    border-color: #f59e0b;
    border-style: solid;
}
.heli-corner.tl { top: 0; left: 0; border-width: 3px 0 0 3px; }
.heli-corner.tr { top: 0; right: 0; border-width: 3px 3px 0 0; }
.heli-corner.bl { bottom: 0; left: 0; border-width: 0 0 3px 3px; }
.heli-corner.br { bottom: 0; right: 0; border-width: 0 3px 3px 0; }

.heli-pitch-ladder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 180px;
    pointer-events: none;
}

.heli-horizon-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, #f59e0b 0%, #f59e0b 35%, transparent 35%, transparent 65%, #f59e0b 65%, #f59e0b 100%);
    opacity: 0.8;
}

.heli-pitch-bar {
    position: absolute;
    left: 25%;
    right: 25%;
    height: 1px;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.6) 0%, rgba(245, 158, 11, 0.6) 30%, transparent 30%, transparent 70%, rgba(245, 158, 11, 0.6) 70%, rgba(245, 158, 11, 0.6) 100%);
}
.heli-pitch-bar.up { top: 25%; }
.heli-pitch-bar.down { top: 75%; }

.heli-reticle-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border: 2px solid rgba(245, 158, 11, 0.5);
    border-radius: 50%;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.35);
}

.heli-reticle-cross {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 160px;
    height: 160px;
}
.heli-reticle-cross::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, #f59e0b, transparent 38%, transparent 62%, #f59e0b);
}
.heli-reticle-cross::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, #f59e0b, transparent 38%, transparent 62%, #f59e0b);
}

.heli-header {
    position: absolute;
    top: 14px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Share Tech Mono', monospace;
}

.heli-title {
    font-size: 14px;
    font-weight: 800;
    color: #f59e0b;
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
}

.heli-badge {
    font-size: 10px;
    padding: 2px 7px;
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid #f59e0b;
    color: #fde68a;
    letter-spacing: 1px;
    border-radius: 2px;
}

.heli-telemetry {
    position: absolute;
    top: 14px;
    right: 20px;
    display: flex;
    gap: 16px;
    font-family: 'Share Tech Mono', monospace;
}

.heli-telem-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.heli-telem-item .lbl {
    font-size: 9px;
    color: rgba(245, 158, 11, 0.7);
    letter-spacing: 1px;
}

.heli-telem-item .val {
    font-size: 13px;
    font-weight: 700;
    color: #fbbf24;
    text-shadow: 0 0 6px rgba(251, 191, 36, 0.6);
}

.heli-telem-item .val.ready {
    color: #38bdf8;
    text-shadow: 0 0 6px rgba(56, 189, 248, 0.6);
}

.heli-telem-item .val.reloading {
    color: #ef4444;
    text-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

.heli-controls-bar {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 14px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 1px;
    color: rgba(229, 231, 235, 0.85);
    background: rgba(20, 16, 10, 0.82);
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 6px 18px;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
    white-space: nowrap;
}

.heli-controls-bar span.highlight {
    color: #f59e0b;
    font-weight: 700;
    text-shadow: 0 0 6px rgba(245, 158, 11, 0.7);
}

.heli-controls-bar span.exit-btn {
    color: #38bdf8;
    font-weight: 700;
}

/* FLIR Thermal Night-Vision Viewport Mode */
#helicopter-hud-overlay.flir-mode .heli-viewport-frame {
    border-color: rgba(52, 211, 153, 0.55);
    box-shadow: inset 0 0 65px rgba(5, 150, 105, 0.35), 0 0 22px rgba(0, 0, 0, 0.9);
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.08) 0%, rgba(5, 46, 22, 0.45) 100%),
                repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.28) 0px, rgba(0, 0, 0, 0.28) 2px, transparent 2px, transparent 4px);
}
#helicopter-hud-overlay.flir-mode .heli-corner {
    border-color: #34d399;
}
#helicopter-hud-overlay.flir-mode .heli-reticle-circle {
    border-color: rgba(52, 211, 153, 0.7);
    box-shadow: 0 0 14px rgba(52, 211, 153, 0.5);
}
#helicopter-hud-overlay.flir-mode .heli-reticle-cross::before,
#helicopter-hud-overlay.flir-mode .heli-reticle-cross::after {
    background: linear-gradient(90deg, #34d399, transparent 38%, transparent 62%, #34d399);
}
#helicopter-hud-overlay.flir-mode .heli-title {
    color: #34d399;
    text-shadow: 0 0 8px rgba(52, 211, 153, 0.8);
}
#helicopter-hud-overlay.flir-mode .heli-badge.active {
    background: rgba(16, 185, 129, 0.3);
    border-color: #34d399;
    color: #a7f3d0;
    text-shadow: 0 0 8px #34d399;
}
#helicopter-hud-overlay.flir-mode .heli-telem-item .lbl {
    color: rgba(52, 211, 153, 0.7);
}
#helicopter-hud-overlay.flir-mode .heli-telem-item .val {
    color: #6ee7b7;
    text-shadow: 0 0 6px rgba(110, 231, 183, 0.7);
}
#helicopter-hud-overlay.flir-mode .heli-controls-bar {
    border-color: rgba(52, 211, 153, 0.5);
}

/* Tactical Aerial Lock-On Reticle */
.heli-lock-box {
    position: absolute;
    width: 48px;
    height: 48px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 31;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.heli-lock-box.hidden {
    display: none !important;
}
.heli-lock-bracket {
    position: absolute;
    inset: 0;
    border: 2px solid #ef4444;
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.75);
    animation: heliLockPulse 0.5s infinite alternate ease-in-out;
}
@keyframes heliLockPulse {
    from { transform: scale(1); opacity: 0.85; border-color: #ef4444; }
    to { transform: scale(1.15); opacity: 1; border-color: #f87171; box-shadow: 0 0 18px rgba(239, 68, 68, 0.95); }
}
.heli-lock-diamond {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #ef4444;
    transform: rotate(45deg);
    top: -12px;
}
.heli-lock-tag {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    font-weight: 800;
    color: #fee2e2;
    background: rgba(185, 28, 28, 0.88);
    padding: 1px 6px;
    border-radius: 2px;
    white-space: nowrap;
    letter-spacing: 1px;
    margin-top: 4px;
    box-shadow: 0 0 8px rgba(185, 28, 28, 0.6);
}
.heli-lock-dist {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    color: #fef08a;
    font-weight: 700;
    margin-bottom: 2px;
    white-space: nowrap;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

/* ========================================================
   PROCEDURAL BUILDING GENERATOR MODAL & ARCHITECTURAL MATRIX
   ======================================================== */
#procedural-building-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 14, 24, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#procedural-building-modal.hidden {
    display: none !important;
}

.proc-building-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.92) 100%);
    border: 1px solid rgba(56, 189, 248, 0.35);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.15);
    border-radius: 12px;
    width: 100%;
    max-width: 580px;
    padding: 28px 32px;
    color: #f8fafc;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    position: relative;
    overflow: hidden;
    animation: procPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes procPopIn {
    0% { transform: scale(0.92); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.proc-building-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #38bdf8, #00f3ff, #eab308, #38bdf8);
}

.proc-header {
    margin-bottom: 20px;
}

.proc-badge {
    display: inline-block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 3px 10px;
    border-radius: 4px;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.proc-title {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px 0;
    letter-spacing: -0.5px;
}

.proc-subtitle {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
    line-height: 1.4;
}

/* Telemetry stat cards matching prompt screenshot */
.proc-telemetry-row {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: rgba(10, 16, 28, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.proc-stat-card {
    text-align: center;
    flex: 1;
}

.proc-stat-divider {
    width: 1px;
    height: 48px;
    background: rgba(255, 255, 255, 0.12);
}

.proc-stat-label {
    display: block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 1.5px;
    color: #64748b;
    margin-bottom: 4px;
}

.proc-stat-value {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.proc-stat-sub {
    display: block;
    font-size: 12px;
    color: #38bdf8;
    margin-top: 2px;
}

/* Control sliders */
.proc-controls {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 22px;
}

.proc-control-group {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 12px 16px;
}

.proc-control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.proc-control-header label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    letter-spacing: 1px;
    color: #cbd5e1;
}

.proc-readout {
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    color: #38bdf8;
}

.proc-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #1e293b;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.proc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #38bdf8;
    border: 2px solid #ffffff;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
    cursor: pointer;
    transition: transform 0.1s, background-color 0.1s;
}

.proc-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    background: #00f3ff;
}

/* Preset buttons */
.proc-presets-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.proc-preset-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    color: #64748b;
    letter-spacing: 1px;
    width: 100%;
    margin-bottom: 2px;
}

.proc-preset-btn {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: #cbd5e1;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.proc-preset-btn:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #ffffff;
}

/* Bottom action buttons */
.proc-actions {
    display: flex;
    justify-content: flex-end;
}

.proc-apply-btn {
    width: 100% !important;
    padding: 12px 24px !important;
    font-size: 14px !important;
    background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%) !important;
    border: 1px solid #38bdf8 !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4) !important;
}

.proc-apply-btn:hover {
    background: linear-gradient(180deg, #0369a1 0%, #075985 100%) !important;
}

/* ========================================================
   TACTICAL FIELD MANUAL & INSTRUCTIONS MODAL
   ======================================================== */
.manual-launch-btn {
    margin-top: 10px !important;
    background: linear-gradient(180deg, rgba(30, 58, 138, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%) !important;
    border: 1px solid rgba(56, 189, 248, 0.5) !important;
    color: #e0f2fe !important;
    font-size: 13px !important;
    letter-spacing: 1.5px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(56, 189, 248, 0.2) !important;
}

.manual-launch-btn:hover {
    background: linear-gradient(180deg, rgba(2, 132, 199, 0.8) 0%, rgba(30, 58, 138, 0.9) 100%) !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4) !important;
}

#field-manual-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 8, 16, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 105;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#field-manual-modal.hidden {
    display: none !important;
}

.manual-modal-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(10, 15, 26, 0.98) 100%);
    border: 2px solid #334155;
    border-top: 2px solid #38bdf8;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(56, 189, 248, 0.15);
    border-radius: 10px;
    width: 100%;
    max-width: 860px;
    height: 86vh;
    max-height: 720px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    animation: manualPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes manualPopIn {
    0% { transform: scale(0.94); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.manual-corner {
    position: absolute;
    width: 10px;
    height: 10px;
    border-color: #38bdf8;
    pointer-events: none;
    z-index: 2;
}
.manual-corner.tl { top: 6px; left: 6px; border-top: 2px solid #38bdf8; border-left: 2px solid #38bdf8; }
.manual-corner.tr { top: 6px; right: 6px; border-top: 2px solid #38bdf8; border-right: 2px solid #38bdf8; }
.manual-corner.bl { bottom: 6px; left: 6px; border-bottom: 2px solid #38bdf8; border-left: 2px solid #38bdf8; }
.manual-corner.br { bottom: 6px; right: 6px; border-bottom: 2px solid #38bdf8; border-right: 2px solid #38bdf8; }

.manual-header {
    padding: 20px 24px 14px 24px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.7);
    position: relative;
    background: rgba(15, 23, 42, 0.6);
}

.manual-badge {
    display: inline-block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
}

.manual-title {
    font-family: 'Black Ops One', cursive;
    font-size: 26px;
    color: var(--duke-yellow);
    letter-spacing: 2px;
    margin: 0 0 4px 0;
    text-shadow: 0 0 14px rgba(250, 204, 21, 0.4);
}

.manual-subtitle {
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}

.manual-close-x {
    position: absolute;
    top: 16px;
    right: 18px;
    background: transparent;
    border: 1px solid #475569;
    color: #94a3b8;
    font-size: 22px;
    line-height: 22px;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.manual-close-x:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

.manual-tabs-nav {
    display: flex;
    overflow-x: auto;
    background: rgba(8, 14, 24, 0.95);
    border-bottom: 1px solid #334155;
    padding: 0 16px;
    gap: 6px;
}

.manual-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #94a3b8;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1px;
    padding: 12px 16px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.manual-tab-btn:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.03);
}

.manual-tab-btn.active {
    color: var(--duke-yellow);
    border-bottom-color: var(--duke-yellow);
    background: rgba(250, 204, 21, 0.06);
    text-shadow: 0 0 10px rgba(250, 204, 21, 0.3);
}

.manual-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    background: rgba(10, 15, 24, 0.5);
}

.manual-body::-webkit-scrollbar {
    width: 7px;
}
.manual-body::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.7);
}
.manual-body::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
.manual-body::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

.manual-tab-pane {
    display: none;
    animation: manualFadeIn 0.18s ease;
}

.manual-tab-pane.active {
    display: block;
}

@keyframes manualFadeIn {
    0% { opacity: 0; transform: translateY(4px); }
    100% { opacity: 1; transform: translateY(0); }
}

.manual-section {
    margin-bottom: 22px;
}

.manual-sec-title {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #38bdf8;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(56, 189, 248, 0.2);
    padding-bottom: 4px;
}

.manual-p {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 13.5px;
    line-height: 1.55;
    color: #cbd5e1;
    margin: 0 0 12px 0;
}

.manual-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.manual-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.manual-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 6px;
    padding: 14px 16px;
    position: relative;
}

.manual-card.full-width {
    grid-column: 1 / -1;
}

.manual-card h4 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #f8fafc;
    margin: 0 0 6px 0;
    letter-spacing: 0.5px;
}

.manual-card p {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 12.5px;
    line-height: 1.5;
    color: #94a3b8;
    margin: 0;
}

.manual-card-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--duke-yellow);
    color: #000;
    font-family: 'Black Ops One', cursive;
    font-size: 12px;
    border-radius: 4px;
    margin-bottom: 6px;
}

.manual-card-tag {
    display: inline-block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 1px;
    margin-bottom: 6px;
}
.tag-blue { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.tag-amber { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.tag-red { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }
.tag-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.tag-green { background: rgba(34, 197, 94, 0.15); color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.3); }
.tag-gold { background: rgba(250, 204, 21, 0.15); color: #facc15; border: 1px solid rgba(250, 204, 21, 0.3); }

.manual-list {
    margin: 0;
    padding-left: 18px;
    color: #cbd5e1;
    font-size: 13px;
    line-height: 1.6;
}

.manual-list.compact {
    padding-left: 14px;
    font-size: 12px;
    line-height: 1.5;
}

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

.manual-list kbd, .manual-table kbd, .manual-footer kbd {
    background: #0f172a;
    border: 1px solid #475569;
    border-bottom: 2px solid #64748b;
    border-radius: 3px;
    padding: 1px 5px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: var(--duke-yellow);
    box-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.manual-table-wrap {
    overflow-x: auto;
    border: 1px solid #334155;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.6);
}

.manual-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 12.5px;
    text-align: left;
}

.manual-table th {
    background: rgba(30, 41, 59, 0.8);
    color: #38bdf8;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 1px;
    padding: 10px 14px;
    border-bottom: 1px solid #334155;
}

.manual-table td {
    padding: 9px 14px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.4);
    color: #cbd5e1;
}

.manual-table tr:hover td {
    background: rgba(56, 189, 248, 0.04);
}

.cheat-card {
    text-align: center;
    border-color: rgba(250, 204, 21, 0.35);
    background: linear-gradient(180deg, rgba(30, 27, 75, 0.4) 0%, rgba(15, 23, 42, 0.8) 100%);
}

.cheat-code {
    display: inline-block;
    font-family: 'Black Ops One', cursive;
    font-size: 18px;
    color: var(--duke-yellow);
    letter-spacing: 3px;
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px dashed var(--duke-gold);
    margin-bottom: 8px;
    text-shadow: 0 0 10px rgba(250, 204, 21, 0.5);
}

.manual-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-top: 1px solid #334155;
    background: rgba(15, 23, 42, 0.8);
}

.manual-hint {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: #64748b;
    letter-spacing: 1px;
}

.manual-close-btn {
    padding: 8px 20px !important;
    font-size: 13px !important;
    height: auto !important;
}

/* Live long-range missile inset. The scene is rendered into the transparent view. */
#missile-camera { position: fixed; right: 18px; top: 30%; width: min(300px, 32vw);
    border: 2px solid #eab308; border-radius: 4px; z-index: 35; pointer-events: none;
    box-shadow: 0 0 14px #000a; overflow: hidden; }
#missile-camera.hidden { display: none; }
#missile-camera-status { padding: 5px 7px; background: #111d; color: #facc15;
    font: bold 11px monospace; letter-spacing: 1px; }
#missile-camera-view { width: 100%; aspect-ratio: 16 / 9; }
