body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==========================================================================
   SUPERSPIONEN: DEN KALDE KRIGEN - SPIONENS MEMOARER
   Grafisk roman & Workstation Cockpit System
   ========================================================================== */

/* Subtilt filmisk teksturoverlay */
body::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.75" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100" height="100" filter="url(%23noise)" opacity="0.04"/></svg>');
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: overlay;
}

/* --------------------------------------------------------------------------
   Skjermeffekter (Risting, Blits/Alarm)
   -------------------------------------------------------------------------- */
@keyframes screenShake {
    0%, 100% { transform: translate(0, 0); }
    15% { transform: translate(-8px, -6px) rotate(-0.4deg); }
    30% { transform: translate(7px, 5px) rotate(0.4deg); }
    45% { transform: translate(-6px, 4px); }
    60% { transform: translate(5px, -4px); }
    75% { transform: translate(-3px, 2px); }
    90% { transform: translate(2px, -1px); }
}
body.effect-shake #parallax-container,
body.effect-shake {
    animation: screenShake 0.65s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes screenFlash {
    0% { filter: brightness(2.8) contrast(1.4); }
    25% { filter: brightness(1.9) hue-rotate(50deg); }
    100% { filter: none; }
}
body.effect-flash {
    animation: screenFlash 0.85s ease-out both;
}

/* --------------------------------------------------------------------------
   Parallax Bakgrunn & Hotspots (Point & Click soner)
   -------------------------------------------------------------------------- */
#parallax-container {
    perspective: 1000px;
    background-color: #080808;
}

.parallax-layer {
    transition: transform 0.12s ease-out;
    width: 110%;
    height: 110%;
    left: -5%;
    top: -5%;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

.bg-hotspot {
    position: absolute;
    cursor: pointer;
    border: none;
    background: transparent;
    border-radius: 16px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-hotspot:hover {
    background: radial-gradient(ellipse at center, rgba(52, 211, 153, 0.2) 0%, rgba(52, 211, 153, 0.04) 55%, transparent 80%);
}

.hotspot-beacon {
    position: relative;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bg-hotspot:hover .hotspot-beacon {
    transform: scale(1.18);
}

.beacon-pulse-ring {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 2px solid rgba(52, 211, 153, 0.75);
    animation: beaconPulse 2.2s cubic-bezier(0.15, 0.85, 0.35, 1) infinite;
    pointer-events: none;
}

.beacon-core {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #065f46 0%, #047857 45%, #022c22 100%);
    border: 2px solid #34d399;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.85), 0 0 16px rgba(52, 211, 153, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a7f3d0;
    font-size: 16px;
}

@keyframes beaconPulse {
    0% { transform: scale(0.7); opacity: 0.95; }
    100% { transform: scale(1.65); opacity: 0; }
}

.bg-hotspot-label {
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(6, 24, 18, 0.96), rgba(2, 10, 8, 0.98));
    border: 1.5px solid #34d399;
    color: #a7f3d0;
    font-size: 12px;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 9999px;
    white-space: nowrap;
    pointer-events: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.85), 0 0 15px rgba(52, 211, 153, 0.5);
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.02em;
}

.bg-hotspot:hover .bg-hotspot-label {
    transform: translateX(-50%) translateY(2px) scale(1.06);
    border-color: #ffffff;
    color: #ffffff;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.95), 0 0 25px rgba(52, 211, 153, 0.85);
}

/* --------------------------------------------------------------------------
   Karakter-sprites & Animasjoner
   -------------------------------------------------------------------------- */
.char-enter-left { transform: translateX(-140%); opacity: 0; }
.char-enter-right { transform: translateX(140%); opacity: 0; }
.char-active { transform: translateX(0); opacity: 1; }
.char-exit-left { transform: translateX(-140%) !important; opacity: 0 !important; }
.char-exit-right { transform: translateX(140%) !important; opacity: 0 !important; }

@keyframes charFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-7px) rotate(0.4deg); }
    66% { transform: translateY(-3px) rotate(-0.4deg); }
}
.char-float {
    animation: charFloat 4.2s ease-in-out infinite;
    transform-origin: bottom center;
}

/* --------------------------------------------------------------------------
   Dialogboks og Valgknapper
   -------------------------------------------------------------------------- */
#dialog-box {
    border-top: 3px solid rgba(16, 185, 129, 0.8);
    transition: all 0.3s ease;
}

.choice-btn {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(8, 12, 24, 0.98));
    border: 1.5px solid rgba(52, 211, 153, 0.45);
    border-left: 6px solid #10b981;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(16, 185, 129, 0.2);
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.choice-btn:hover:not(.locked) {
    background: linear-gradient(135deg, rgba(20, 35, 55, 0.98), rgba(12, 20, 36, 1));
    border-left: 6px solid #34d399;
    border-color: rgba(52, 211, 153, 0.9);
    transform: translateX(-8px) scale(1.01);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.45);
}

.choice-btn:active:not(.locked) {
    transform: translateX(-4px) scale(0.99);
}

.continue-btn {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.95), rgba(4, 120, 87, 0.98));
    border: 1px solid rgba(52, 211, 153, 0.6);
    border-left: 6px solid #34d399;
    box-shadow: 0 10px 25px rgba(5, 150, 105, 0.45), 0 0 15px rgba(52, 211, 153, 0.2);
    transition: all 0.2s ease;
    cursor: pointer;
}

.continue-btn:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 1), rgba(5, 150, 105, 1));
    border-color: #34d399;
    border-left: 6px solid #fff;
    transform: translateX(-6px) scale(1.02);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.6), 0 0 20px rgba(52, 211, 153, 0.4);
}

/* ==========================================================================
   WORKSTATION COCKPIT UI (5/12 + 7/12 LAYOUT & ERGONOMI)
   ========================================================================== */
.workstation-chassis {
    width: 100%;
    max-width: 1100px;
    max-height: 92vh;
    height: 680px;
    background: rgba(10, 15, 26, 0.96);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.95), 0 0 30px rgba(16, 185, 129, 0.15);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.workstation-header {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.98), rgba(2, 44, 34, 0.95));
    border-bottom: 1.5px solid rgba(52, 211, 153, 0.3);
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.workstation-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

@media (max-width: 900px) {
    .workstation-chassis {
        height: auto;
        max-height: 95vh;
        overflow-y: auto;
    }
    .workstation-body {
        flex-direction: column;
        overflow-y: auto;
    }
}

/* Venstre kolonne (5/12) - Fysiske kilder og instrumenter */
.workstation-source-panel {
    flex: 5;
    background: rgba(15, 23, 42, 0.85);
    border-right: 1.5px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Høyre kolonne (7/12) - Interaksjon, kalkyle, numpad og løsning */
.workstation-action-panel {
    flex: 7;
    background: rgba(8, 12, 20, 0.95);
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Retro CRT-skjermeffekt */
.crt-monitor {
    background: #021a12;
    border: 2px solid #065f46;
    border-radius: 12px;
    padding: 1rem;
    position: relative;
    overflow: hidden;
    color: #34d399;
    font-family: 'Roboto Mono', monospace;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8), 0 0 15px rgba(16, 185, 129, 0.2);
}

.crt-monitor::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 2;
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
}

/* Autentisk historisk dokument */
.classified-document {
    background: #fdf6e2;
    color: #1e293b;
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    border: 1px solid #d4c5a9;
    position: relative;
    font-family: 'Courier New', Courier, monospace;
}

.stamp-top-secret {
    position: absolute;
    top: 15px;
    right: 20px;
    border: 3px solid #dc2626;
    color: #dc2626;
    font-weight: 900;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 6px;
    transform: rotate(6deg);
    font-family: 'Arial Black', sans-serif;
    letter-spacing: 2px;
    font-size: 0.8rem;
    opacity: 0.85;
}

/* Numpad og inntastingsfelt */
.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 220px;
    margin: 0 auto;
}

.keypad-btn {
    background: rgba(30, 41, 59, 0.9);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    font-size: 1.2rem;
    padding: 12px 0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.keypad-btn:hover {
    background: #10b981;
    border-color: #34d399;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.4);
}

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

/* ==========================================================================
   TAKTILE WORKSTATION-INSTRUMENTER (EUROTRIP SPESIALKLASSER)
   ========================================================================== */

/* 1. Cuba Rom 2A: U-2 Fotoanalyse Lysbord & Forstørrelseslupe */
.lightbox-frame {
    position: relative;
    background: #050b14;
    border: 2px solid #0e7490;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 0 25px rgba(6, 182, 212, 0.25), 0 8px 20px rgba(0, 0, 0, 0.7);
}

.lightbox-img-wrap {
    position: relative;
    width: 100%;
    height: 140px;
    background-size: cover;
    background-position: center;
    cursor: crosshair;
}

.lightbox-grid-overlay {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(6, 182, 212, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6, 182, 212, 0.15) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

.lightbox-reticle {
    position: absolute;
    width: 54px;
    height: 54px;
    border: 1.5px dashed #22d3ee;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.5);
    animation: reticlePulse 2s ease-in-out infinite;
}

.lightbox-reticle::before,
.lightbox-reticle::after {
    content: "";
    position: absolute;
    background: #22d3ee;
}
.lightbox-reticle::before { top: 50%; left: 0; right: 0; height: 1px; transform: translateY(-50%); }
.lightbox-reticle::after { left: 50%; top: 0; bottom: 0; width: 1px; transform: translateX(-50%); }

@keyframes reticlePulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

/* 2. Vietnam Rom 3B: Nagra Spolebåndopptaker */
.tape-deck-chassis {
    background: linear-gradient(180deg, #18181b 0%, #09090b 100%);
    border: 1.5px solid #27272a;
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.05), 0 8px 18px rgba(0, 0, 0, 0.6);
}

.tape-reels-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 6px 0;
}

.tape-spool {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: radial-gradient(circle, #71717a 15%, #27272a 18%, #18181b 50%, #3f3f46 65%, #09090b 100%);
    border: 2px solid #52525b;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    transition: transform 0.2s;
}

.tape-spool::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #a1a1aa;
    transform: translate(-50%, -50%);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.8);
}

.tape-spool-active {
    animation: spinReel 1.8s linear infinite;
}

@keyframes spinReel {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.vu-meter-bar {
    height: 6px;
    background: #18181b;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid #3f3f46;
}

.vu-meter-fill {
    height: 100%;
    width: 15%;
    background: linear-gradient(90deg, #10b981 60%, #eab308 85%, #ef4444 100%);
    transition: width 0.15s ease-out;
}

.vu-meter-fill.active {
    animation: vuPulse 0.4s ease-in-out infinite alternate;
}

@keyframes vuPulse {
    0% { width: 35%; }
    50% { width: 88%; }
    100% { width: 62%; }
}

/* 3. Afghanistan Rom 4B: Infrarød Stinger HUD */
.stinger-hud-scope {
    position: relative;
    width: 100%;
    height: 120px;
    background: #021a0f;
    border: 1.5px solid #059669;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(16, 185, 129, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hud-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(16, 185, 129, 0.25) 1px, transparent 1px);
    background-size: 16px 16px;
}

.hud-arc-ring {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 1.5px solid rgba(52, 211, 153, 0.4);
    border-radius: 50%;
    border-top-color: #10b981;
    border-bottom-color: #10b981;
    animation: spinReel 6s linear infinite;
}

.hud-lock-box {
    position: relative;
    z-index: 10;
    padding: 2px 8px;
    background: rgba(6, 78, 59, 0.8);
    border: 1.5px solid #34d399;
    border-radius: 4px;
    color: #6ee7b7;
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
}

.hud-lock-box.locked {
    background: rgba(185, 28, 28, 0.85);
    border-color: #f87171;
    color: #fee2e2;
    animation: lockFlash 0.3s ease-in-out infinite alternate;
}

@keyframes lockFlash {
    from { transform: scale(1); }
    to { transform: scale(1.08); }
}

/* 4. Moskva Rom 5A: Teleprinter Telex Ribbon */
.telex-output-feed {
    background: #fbf7ea;
    border-left: 3px dashed #d97706;
    border-right: 3px dashed #d97706;
    color: #1c1917;
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    padding: 6px 12px;
    font-size: 11px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    max-height: 80px;
    overflow: hidden;
    animation: telexSlide 0.5s ease-out;
}

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