/* CSS Variables for theming */
:root {
    --bg-color: #1a1a1a; 
    --text-color: #e0dcd3;
    --accent-color: #d4af37; /* Brass/Gold */
    --border-color: #4a3c31;
    --hud-bg: rgba(20, 15, 10, 0.9);
    
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Source Sans 3', sans-serif;
    --font-code: 'Courier New', Courier, monospace;
}

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

body {
    background-color: #000;
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background image handling */
#game-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.25; /* dim background to keep text readable */
    filter: sepia(0.6) grayscale(0.4) contrast(1.2); /* WW1 Gritty Look */
    z-index: -1;
    transition: background-image 1s ease-in-out, opacity 1s;
}

/* Blood overlay for low troops */
#blood-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(circle, transparent 40%, rgba(139, 0, 0, 0.5) 100%);
    pointer-events: none;
    z-index: 50;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}
#blood-overlay.active { opacity: 1; }

/* Shake animation for artillery/chaos */
@keyframes shakeAnimation {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-2px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}
.shake {
    animation: shakeAnimation 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

/* Background classes toggled via JS */
.bg-room1 { background-image: url('assets/room1.png'); }
.bg-room2 { background-image: url('assets/room2.png'); }
.bg-room3 { background-image: url('assets/room3.png'); }
.bg-room4 { background-image: url('assets/room5.png'); }
.bg-room5 { background-image: url('assets/room6.png'); }
.bg-room6 { background-image: url('assets/room7.png'); }
.bg-room7 { background-image: url('assets/room8.png'); }
.bg-room8 { background-image: url('assets/room9.png'); }
.bg-room9 { background-image: url('assets/room10.png'); }
.bg-room10 { background-image: url('assets/room11.png'); }
.bg-room11 { background-image: url('assets/room12.png'); }
.bg-room12 { background-image: url('assets/room13.png'); }
.bg-room13 { background-image: url('assets/room14.png'); }
.bg-room14 { background-image: url('assets/room15.png'); }

#game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

#content-area {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    order: 1;
}

.sidebar-panel {
    grid-column: 2;
    grid-row: 2;
    position: sticky;
    top: 20px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sidebar-panel #hud,
.sidebar-panel #hint-container {
    grid-column: auto;
    position: static;
    order: initial;
}

.sidebar-panel #hint-container {
    margin-bottom: 0;
}

/* Consequence Stamp Overlay */
#consequence-stamp {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.85);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}
#consequence-stamp.hidden { display: none; }
#stamp-title {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    color: #a83232;
    text-transform: uppercase;
    border: 5px solid #a83232;
    padding: 20px;
    transform: rotate(-10deg) scale(2);
    opacity: 0;
    animation: stampIn 0.5s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#stamp-desc {
    margin-top: 30px;
    font-size: 1.5rem;
    max-width: 600px;
}

#gas-leak-splash .gas-leak-panel {
    width: min(680px, 100%);
    background:
        linear-gradient(180deg, rgba(246, 248, 252, 0.98), rgba(214, 223, 233, 0.98)),
        #e9eef3;
    color: #10202c;
    border: 3px solid #bfd0df;
    border-radius: 18px;
    padding: 28px 24px 26px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        0 24px 48px rgba(0, 0, 0, 0.45);
    text-align: center;
}

#gas-leak-splash .gas-leak-label {
    display: inline-block;
    margin-bottom: 14px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #d74d4d;
    color: #fff;
    font-family: var(--font-code);
    font-weight: bold;
    letter-spacing: 0.14em;
}

#gas-leak-splash .gas-leak-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(2rem, 3vw, 3rem);
    color: #1d2b35;
    margin-bottom: 16px;
}

#gas-leak-splash .gas-leak-text {
    font-size: 1.35rem;
    line-height: 1.6;
    margin: 0 auto 10px;
    max-width: 560px;
}

#gas-leak-splash .gas-leak-subtext {
    font-size: 1rem;
    color: #425463;
    margin-bottom: 24px;
}

@keyframes stampIn {
    to { transform: rotate(-10deg) scale(1); opacity: 1; }
}

body.artillery-modal-open {
    overflow: hidden;
}

#artillery-overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(4, 5, 4, 0.94);
    backdrop-filter: blur(4px);
}

#artillery-overlay.hidden {
    display: none;
}

.artillery-overlay-shell {
    width: min(96vw, 1500px);
    height: min(94vh, 980px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid #4a3c31;
    background: linear-gradient(180deg, rgba(19, 22, 17, 0.98), rgba(8, 10, 8, 0.99));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6);
}

.artillery-overlay-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.22);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent);
}

.artillery-overlay-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.artillery-overlay-subtitle {
    font-size: 0.85rem;
    color: #b7ab95;
}

.artillery-overlay-status {
    flex: 1;
    text-align: center;
    font-family: var(--font-code);
    font-size: 0.95rem;
    color: #d8cfba;
}

.artillery-close-btn {
    white-space: nowrap;
}

.artillery-overlay-body {
    position: relative;
    flex: 1;
    min-height: 0;
    background: #050605;
}

#artillery-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #050605;
}

.artillery-result-panel {
    position: absolute;
    right: 20px;
    bottom: 20px;
    left: 20px;
    margin: 0 auto;
    max-width: 680px;
    padding: 22px 24px;
    border-radius: 16px;
    border: 1px solid rgba(212, 175, 55, 0.25);
    background: rgba(8, 10, 8, 0.92);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.artillery-result-panel.hidden {
    display: none;
}

.artillery-result-panel h3 {
    font-family: var(--font-heading);
    color: var(--accent-color);
    font-size: 1.6rem;
    margin-bottom: 10px;
}

.artillery-result-panel p {
    margin-bottom: 18px;
    color: #efeadc;
    font-size: 1.05rem;
    white-space: pre-line;
}

/* Analog Gauges for HUD */
#hud {
    background-color: var(--hud-bg);
    border: 3px solid #5c4e40;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.8), inset 0 0 15px rgba(0,0,0,0.5);
    transition: opacity 0.5s ease;
}
#hud.hidden { display: none; opacity: 0; }

.gauge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 10px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(212, 175, 55, 0.12);
}
.gauge-label {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 5px;
}
.gauge {
    position: relative;
    width: 80px;
    height: 40px;
    background: linear-gradient(180deg, #111, #333);
    border-top-left-radius: 40px;
    border-top-right-radius: 40px;
    border: 2px solid #a68b5b;
    border-bottom: none;
    overflow: hidden;
}
.gauge::before {
    content: ''; position: absolute; bottom: 0; left: 10px; width: 60px; height: 30px;
    background: #000; border-top-left-radius: 30px; border-top-right-radius: 30px;
}
.gauge-needle {
    position: absolute;
    bottom: -5px; left: 38px;
    width: 4px; height: 35px;
    background: #e2584a;
    transform-origin: bottom center;
    transform: rotate(-90deg); /* 0 is -90deg, 100 is 90deg */
    transition: transform 1s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-radius: 2px;
}
.gauge-val {
    margin-top: 5px;
    font-weight: bold;
    font-family: var(--font-code);
}

/* Hint System */
#hint-container {
    background: rgba(0,0,0,0.6);
    border: 1px solid var(--accent-color);
    padding: 10px;
    margin-bottom: 0;
    border-radius: 5px;
    text-align: center;
}

@media (max-width: 960px) {
    #game-container {
        grid-template-columns: minmax(0, 1fr);
    }

    #content-area,
    .sidebar-panel {
        grid-column: 1;
    }

    .sidebar-panel {
        position: static;
    }

    .sidebar-panel #hud,
    .sidebar-panel #hint-container {
        position: static;
    }

    .schlieffen-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .trench-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .schlieffen-map-subtitle {
        text-align: left;
        max-width: none;
    }

    .trench-board-header,
    .trench-stats-panel {
        flex-direction: column;
        align-items: flex-start;
    }

    .trench-stat-note {
        text-align: left;
    }
}
.btn-hint {
    background: #5c4e40;
    color: #fff;
    border: 1px solid #d4af37;
    font-size: 0.9rem;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-family: var(--font-heading);
    text-transform: uppercase;
}
.btn-hint:hover { background: #d4af37; color: #000; }
#hint-text {
    margin-top: 10px;
    font-style: italic;
    color: #4ae28a; /* Soft green */
}

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

.room {
    background-color: rgba(20, 15, 12, 0.9);
    border: 1px solid var(--border-color);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 1s ease-in-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.title-main { font-family: 'Cinzel', serif; font-size: 2.5rem; text-align: center; color: var(--accent-color); margin-bottom: 20px; }
.room-title { font-family: var(--font-heading); font-size: 2rem; margin-bottom: 15px; border-bottom: 1px solid var(--border-color); color: var(--accent-color); }
.room-desc, .intro-text { font-size: 1.1rem; margin-bottom: 20px; }

/* Typewriter text */
.typewriter-text {
    font-size: 1.2rem;
    margin-bottom: 20px;
    min-height: 80px; /* prevent layout shifts */
    border-left: 3px solid var(--accent-color);
    padding-left: 15px;
}

/* Puzzles */
.puzzle-container { background: rgba(0,0,0,0.4); border: 1px dashed var(--accent-color); padding: 20px; margin-bottom: 20px; border-radius: 5px; text-align: center;}
input[type="number"], input[type="text"], input[type="time"] { background: #111; color: #fff; border: 1px solid var(--accent-color); padding: 10px; font-family: var(--font-code); font-size: 1.2rem; width: 200px; border-radius: 3px; text-align:center; margin-bottom: 10px; }
.feedback { font-weight: bold; margin-top: 10px; min-height: 24px; }
.feedback.error { color: #e2584a; }
.feedback.success { color: #4ae28a; }


#room-5 .mini-game-shell {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(19, 18, 15, 0.72), rgba(8, 7, 6, 0.82));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#room-5 .mini-game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

#room-5 .mini-game-header h3 {
    margin: 0 0 6px;
    font-family: var(--font-heading);
    color: var(--accent-color);
    font-size: 1.4rem;
}

#room-5 .mini-game-header p {
    margin: 0;
    color: #ddd3c3;
    max-width: 56rem;
}

#room-5 .mini-game-link {
    color: #f2e0ae;
    text-decoration: none;
    border: 1px solid rgba(212, 175, 55, 0.4);
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.25);
    white-space: nowrap;
}

#room-5 .mini-game-link:hover {
    background: rgba(212, 175, 55, 0.12);
}

#room-5 .mini-game-frame {
    width: 100%;
    height: 620px;
    border: 1px solid rgba(212, 175, 55, 0.24);
    border-radius: 12px;
    background: #1b1b1b;
    display: block;
}

/* Room 1: Dial Lock */
.dial-lock { display: flex; justify-content: center; gap: 15px; margin-bottom: 15px; }
.dial { display: flex; flex-direction: column; align-items: center; background: #222; border: 2px solid #555; padding: 5px; border-radius: 5px; }
.dial button { background: none; border: none; color: var(--accent-color); font-size: 1.5rem; cursor: pointer; }
.dial button:hover { color: #fff; }
.dial span { font-family: var(--font-code); font-size: 2rem; font-weight: bold; background: #000; padding: 5px 15px; border: 1px inset #333; margin: 5px 0; }

/* Room 4: Valves */
.valve-container { display: flex; justify-content: space-around; margin: 20px 0; }
.valve-station { display: flex; flex-direction: column; align-items: center; background: #111; padding: 15px; border: 2px solid var(--accent-color); border-radius: 50%; width: 100px; height: 100px; justify-content: center; box-shadow: inset 0 0 10px rgba(0,0,0,0.8); }
.valve-label { font-size: 0.7rem; text-transform: uppercase; margin-bottom: 5px; color: #ccc; }
.valve-btn { width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle, #4a4a4a, #222); border: 2px solid #777; color: white; font-size: 1.2rem; cursor: pointer; }
.valve-btn:hover { background: radial-gradient(circle, #5a5a5a, #333); }

/* Room 7: Magic Lens */
.letter-interactive { position: relative; background: #d1c7b1; color: #2b2723; padding: 30px; font-family: 'Playfair Display', serif; font-style: italic; border: 1px solid #a69c86; cursor: crosshair; user-select: none; }
.hidden-word { color: transparent; /* hidden until hovered */ transition: color 0.3s; }
.letter-interactive:hover .hidden-word { color: #2b2723; text-shadow: 0 0 2px red; }
.lens { position: absolute; width: 60px; height: 60px; border: 2px solid #8b0000; border-radius: 50%; pointer-events: none; opacity: 0; box-shadow: 0 0 0 9999px rgba(0,0,0,0.5); /* darkens rest of letter */ transition: opacity 0.2s; }
.letter-interactive:hover .lens { opacity: 1; }

/* Room 10: Threads and Flashlight */
.room-ten-brief {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 4px 0 8px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.38);
    border: 1px solid rgba(212, 175, 55, 0.22);
    color: #eee5d0;
    font-size: 0.95rem;
}
.room-ten-brief span {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent-color);
    font-family: var(--font-heading);
    font-size: 0.75rem;
}
.room-ten-brief strong {
    font-weight: 600;
}
.thread-status {
    margin-bottom: 10px;
    color: #cfc6ae;
    font-style: italic;
    min-height: 1.4em;
}
.thread-container { display: flex; justify-content: center; gap: 14px; align-items: flex-end; height: 192px; padding: 18px 18px 20px; position: relative; overflow: hidden; background: linear-gradient(180deg, rgba(4, 7, 6, 0.9), rgba(16, 19, 14, 0.96)); border-radius: 8px; border: 1px solid rgba(212, 175, 55, 0.18); }
.thread-container::before {
    content: "";
    position: absolute;
    inset: 18px 16px 50px;
    border-radius: 8px;
    background:
        radial-gradient(circle at 50% 30%, rgba(100, 123, 96, 0.22), transparent 36%),
        linear-gradient(180deg, transparent 68%, rgba(53, 43, 29, 0.95) 69%, rgba(34, 27, 18, 0.98) 100%);
    opacity: 0.9;
    pointer-events: none;
}
.thread-container::after {
    content: "";
    position: absolute;
    inset: auto 14px 20px;
    height: 34px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255,255,255,0.1), transparent 70%);
    opacity: 0.35;
    pointer-events: none;
}
.flashlight-mask {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(ellipse 140px 96px at 50% 50%, rgba(255, 243, 194, 0.18) 0%, rgba(255, 243, 194, 0.08) 18%, transparent 34%, rgba(0,0,0,0.98) 68%);
    pointer-events: none;
    z-index: 10;
}
.thomas-shadow {
    position: absolute;
    right: 10px;
    bottom: 18px;
    width: 140px;
    height: 86px;
    background: radial-gradient(circle at 50% 26%, rgba(0,0,0,0.8) 0 24%, transparent 25%),
        radial-gradient(ellipse at 50% 70%, rgba(0,0,0,0.9) 0 42%, transparent 43%);
    opacity: 0.55;
    filter: blur(1px);
    z-index: 2;
    pointer-events: none;
}
.thread { width: 10px; background: #6b6e70; border-left: 2px dashed #4a4d4f; border-right: 2px dashed #4a4d4f; cursor: pointer; transition: background 0.3s, box-shadow 0.3s, transform 0.3s; border-radius: 2px; position: relative; z-index: 5; transform-origin: bottom center; --thread-tilt: 0deg; transform: rotate(var(--thread-tilt)); }
.thread:hover, .thread.lit { background: #d7c06b; border-color: #f0d98b; box-shadow: 0 0 14px rgba(255, 231, 153, 0.45); transform: translateY(-2px) rotate(var(--thread-tilt)); }
.t-thick { height: 100px; width: 15px; }
.t-angled { height: 112px; width: 9px; --thread-tilt: -5deg; }
.t-short { height: 78px; width: 6px; }
.t-medium { height: 120px; width: 10px; }
.t-slack { height: 88px; width: 5px; --thread-tilt: 3deg; }
.t-rusted { height: 108px; width: 8px; background: #7b6a55; border-left-color: #5f5142; border-right-color: #5f5142; }
.t-thin { height: 90px; width: 4px; }

/* Buttons */
.btn { font-family: var(--font-heading); cursor: pointer; padding: 10px 20px; border: none; border-radius: 3px; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; transition: all 0.2s; }
.btn-primary { background-color: var(--accent-color); color: #000; display: inline-block; font-weight: bold; }
.btn-primary:hover { background-color: #fff; }
.btn-secondary { background: transparent; border: 1px solid var(--accent-color); color: var(--accent-color); }
.btn-secondary:hover { background: rgba(212, 175, 55, 0.1); }
.btn-action { background: #333; color: white; border: 1px solid #777; margin-top: 10px; }
.btn-action:hover { background: #555; }

/* Choices Splash Screen Overlay */
.choices-container { 
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.92);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    margin: 0;
    border: none;
}
.choices-container.hidden { display: none !important; }
.choices-container h3 { color: #fff; font-family: 'Cinzel', serif; font-size: 2rem; margin-bottom: 30px; text-align: center; }
.choice-buttons { display: flex; gap: 20px; flex-direction: column; width: 100%; max-width: 500px; }
.btn-choice { background-color: #1a1a1a; border: 2px solid var(--accent-color); color: var(--text-color); text-align: center; padding: 20px; font-size: 1rem; border-radius: 8px;}
.btn-choice strong { color: var(--accent-color); font-size: 1.5rem; display: block; margin-bottom: 10px; }
.btn-choice:hover { background-color: #222; box-shadow: 0 0 15px rgba(212, 175, 55, 0.5); transform: scale(1.02); }

/* Newspaper Epilogue */
#newspaper-container {
    background: #eadecd;
    color: #2b2b2b;
    padding: 20px;
    font-family: 'Playfair Display', serif;
    border: 1px solid #111;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.1), 0 0 20px rgba(0,0,0,0.8);
    margin-bottom: 20px;
}
.newspaper-header {
    text-align: center;
    border-bottom: 3px double #2b2b2b;
    margin-bottom: 15px;
    padding-bottom: 10px;
}
.newspaper-header h1 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    margin-bottom: 5px;
}
.newspaper-date {
    font-style: italic;
    font-size: 0.9rem;
    border-top: 1px solid #2b2b2b;
    border-bottom: 1px solid #2b2b2b;
    display: inline-block;
    padding: 2px 20px;
}
.newspaper-main {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #2b2b2b;
    padding-bottom: 15px;
}
.news-headline {
    font-size: 2.2rem;
    line-height: 1.1;
    margin-bottom: 10px;
    text-transform: uppercase;
}
.news-text {
    font-size: 1.1rem;
    column-count: 2;
    column-gap: 20px;
    text-align: justify;
}
.newspaper-columns {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}
.news-col {
    flex: 1;
    min-width: 150px;
    border-right: 1px solid #999;
    padding-right: 15px;
}
.news-col:last-child {
    border-right: none;
    padding-right: 0;
}
.news-col h3 {
    font-size: 1rem;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 5px;
    border-bottom: 1px solid #999;
    padding-bottom: 3px;
}
.news-col p {
    font-size: 0.85rem;
    text-align: justify;
}

/* End Screen */
.final-stats { background: rgba(0,0,0,0.5); padding: 20px; border: 1px solid var(--border-color); margin-top: 20px; }
#end-stats-list { list-style: none; font-family: var(--font-code); font-size: 1.2rem; }
#end-stats-list li { display: flex; justify-content: space-between; border-bottom: 1px dashed #444; margin-bottom: 5px; padding-bottom: 5px;}

/* --- NYE MINISPILL CSS --- */

/* Rom 8: Klokke */
.interactive-clock { display: flex; flex-direction: column; align-items: center; margin: 20px 0; }
.clock-face { position: relative; width: 150px; height: 150px; background: radial-gradient(circle, #eadecd, #c2b29c); border: 8px solid #a68b5b; border-radius: 50%; box-shadow: inset 0 0 10px rgba(0,0,0,0.5), 0 5px 15px rgba(0,0,0,0.8); }
.clock-face::after { content: ''; position: absolute; width: 100%; height: 100%; background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="50" cy="50" r="48" fill="none" stroke="%23333" stroke-width="1" stroke-dasharray="2, 4"/></svg>') center/cover; opacity: 0.5; pointer-events: none;}
.clock-center { position: absolute; top: 50%; left: 50%; width: 12px; height: 12px; background: #333; border-radius: 50%; transform: translate(-50%, -50%); z-index: 10; box-shadow: 0 0 2px rgba(0,0,0,0.5); }
.clock-hand { position: absolute; bottom: 50%; left: 50%; transform-origin: bottom center; background: #222; border-radius: 2px; box-shadow: 0 0 3px rgba(0,0,0,0.3); transition: transform 0.2s cubic-bezier(0.4, 2.08, 0.55, 0.44); }
.clock-hour { width: 6px; height: 40px; margin-left: -3px; }
.clock-minute { width: 4px; height: 60px; margin-left: -2px; }
.clock-controls { margin-top: 20px; display: flex; align-items: center; gap: 15px; }
#clock-digital-display { font-family: var(--font-code); font-size: 1.5rem; background: #111; padding: 5px 15px; border: 1px inset #555; color: var(--accent-color); }

/* Rom 12: Somme Grid Map */
.somme-map-container { display: flex; flex-direction: column; align-items: center; margin: 20px 0; }
.somme-grid { display: grid; grid-template-columns: repeat(5, 50px); grid-template-rows: repeat(5, 50px); gap: 2px; background: #4a3c31; border: 4px solid #2b2b2b; padding: 2px; box-shadow: 0 5px 15px rgba(0,0,0,0.8); position: relative; }
.somme-cell { background: #6b5c4b; cursor: crosshair; transition: background 0.2s; position: relative; display: flex; justify-content: center; align-items: center; color: rgba(255,255,255,0.2); font-size: 0.7rem; }
.somme-cell:hover { background: #8b7762; }
.somme-cell.selected { background: #a83232; box-shadow: inset 0 0 10px rgba(0,0,0,0.8); color: white; font-weight: bold; }
.somme-coords { margin-top: 15px; font-family: var(--font-code); font-size: 1.2rem; }
#somme-selected-coord { color: var(--accent-color); font-weight: bold; }

/* Rom 13: Gas Stamp */
.puzzle-container { position: relative; overflow: hidden; }
#room-13 .puzzle-container {
    background:
        linear-gradient(180deg, rgba(8, 16, 8, 0.24), rgba(0, 0, 0, 0.42)),
        rgba(0, 0, 0, 0.4);
    border-color: rgba(116, 167, 98, 0.32);
}
#room-13 .windsock-container,
#room-13 .document-container {
    display: none;
}
.gas-atmosphere { position: absolute; inset: 14px; border-radius: 10px; overflow: hidden; pointer-events: none; z-index: 0; }
.gas-atmosphere::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 20%, rgba(177, 255, 139, 0.16), transparent 42%),
        linear-gradient(180deg, rgba(25, 44, 19, 0.08), rgba(8, 12, 8, 0.12) 55%, rgba(0, 0, 0, 0.18));
}
.gas-cloud, .gas-haze { position: absolute; left: -30%; pointer-events: none; }
.gas-cloud {
    border-radius: 999px;
    filter: blur(12px) saturate(1.8);
    mix-blend-mode: screen;
    background:
        radial-gradient(circle at 18% 55%, rgba(236, 255, 196, 0.9) 0 11%, rgba(186, 255, 132, 0.72) 12% 27%, rgba(103, 186, 67, 0.42) 28% 49%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(156, 233, 94, 0.55) 0 18%, rgba(72, 126, 43, 0.32) 19% 41%, transparent 42%);
    opacity: 0.84;
    animation: gasCloudDriftEast 28s linear infinite;
}
.gas-cloud::before,
.gas-cloud::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(185, 255, 128, 0.5);
    filter: blur(8px);
}
.gas-cloud::before { inset: 10% 14% 18% 24%; opacity: 0.8; }
.gas-cloud::after { inset: 22% 6% 12% 40%; opacity: 0.55; }
.gas-cloud-1 { top: 16%; width: 42%; height: 16%; animation-duration: 34s; animation-delay: -4s; }
.gas-cloud-2 { top: 28%; width: 30%; height: 13%; opacity: 0.68; animation-duration: 24s; animation-delay: -12s; }
.gas-cloud-3 { top: 42%; width: 38%; height: 15%; opacity: 0.58; animation-duration: 40s; animation-delay: -18s; }
.gas-haze {
    bottom: -2%;
    width: 120%;
    height: 34%;
    left: -10%;
    background:
        radial-gradient(circle at 20% 45%, rgba(193, 255, 133, 0.17), transparent 38%),
        radial-gradient(circle at 50% 56%, rgba(145, 227, 85, 0.15), transparent 42%),
        linear-gradient(180deg, transparent, rgba(125, 209, 74, 0.14) 36%, rgba(15, 24, 12, 0.3) 100%);
    filter: blur(18px);
    opacity: 0.95;
    animation: gasHazeSweepEast 32s linear infinite;
}
.gas-atmosphere.wind-west .gas-cloud,
.gas-atmosphere.wind-west .gas-haze { animation-direction: reverse; }
.gas-atmosphere.wind-north .gas-cloud { animation-name: gasCloudDriftNorth; }
.gas-atmosphere.wind-north .gas-haze { animation-name: gasHazeSweepNorth; }
.gas-atmosphere.wind-south .gas-cloud { animation-name: gasCloudDriftSouth; }
.gas-atmosphere.wind-south .gas-haze { animation-name: gasHazeSweepSouth; }
.gas-container { position: relative; z-index: 1; display: flex; gap: 30px; align-items: stretch; justify-content: center; margin: 20px 0; flex-wrap: wrap; }
.gas-lab-card {
    width: min(960px, 100%);
    background:
        linear-gradient(180deg, rgba(228, 232, 240, 0.95), rgba(188, 196, 209, 0.94)),
        rgba(0, 0, 0, 0.38);
    border: 2px solid #e7eef6;
    border-radius: 18px;
    padding: 18px;
    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, 0.65),
        inset -1px -1px 0 rgba(0, 0, 0, 0.35),
        0 20px 42px rgba(0, 0, 0, 0.4);
    color: #142017;
}
.gas-lab-header,
.gas-console-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.gas-lab-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(18, 24, 18, 0.18);
}
.gas-lab-title {
    font-family: var(--font-code);
    font-size: 1.1rem;
    letter-spacing: 0.12em;
    font-weight: bold;
    color: #0f1d12;
}
.gas-lab-tag {
    padding: 5px 10px;
    border-radius: 999px;
    background: linear-gradient(180deg, #a8ff75, #74d152);
    color: #0f1c10;
    font-family: var(--font-code);
    font-weight: bold;
    letter-spacing: 0.08em;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35), 0 0 16px rgba(120, 255, 110, 0.18);
}
.gas-lab-note {
    margin-bottom: 14px;
    color: #203122;
    font-size: 0.95rem;
}
.gas-shell-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.gas-shell-card {
    background:
        linear-gradient(180deg, rgba(76, 88, 104, 0.18), rgba(29, 37, 46, 0.1)),
        rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(20, 30, 37, 0.2);
    border-radius: 14px;
    padding: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.gas-shell-card.in-range {
    border-color: rgba(80, 160, 80, 0.6);
    box-shadow: 0 0 0 1px rgba(80, 160, 80, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.gas-shell-card.over-safe {
    border-color: rgba(168, 50, 50, 0.7);
    box-shadow: 0 0 0 1px rgba(168, 50, 50, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.gas-shell-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: baseline;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.gas-shell-name {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: #132112;
}
.gas-shell-class {
    font-family: var(--font-code);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: #506055;
    text-transform: uppercase;
}
.gas-gauge {
    position: relative;
    height: 220px;
    border-radius: 12px;
    background:
        linear-gradient(180deg, #141a16, #0a100c),
        linear-gradient(180deg, rgba(255,255,255,0.04), transparent);
    border: 2px inset #54665a;
    overflow: hidden;
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.5);
}
.gas-gauge::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, transparent 0 19%, rgba(255,255,255,0.08) 20% 21%, transparent 22% 39%, rgba(255,255,255,0.08) 40% 41%, transparent 42% 59%, rgba(255,255,255,0.08) 60% 61%, transparent 62% 79%, rgba(255,255,255,0.08) 80% 81%, transparent 82% 100%);
    opacity: 0.45;
    pointer-events: none;
}
.gas-target-band {
    position: absolute;
    left: 10px;
    right: 10px;
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(81, 255, 118, 0.28), rgba(81, 255, 118, 0.12));
    border: 1px solid rgba(81, 255, 118, 0.5);
    box-shadow: 0 0 0 1px rgba(81, 255, 118, 0.1), 0 0 16px rgba(81, 255, 118, 0.15);
}
.gas-shell-fill {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(180deg, rgba(140, 255, 90, 0.95), rgba(68, 168, 61, 0.88));
    box-shadow: 0 0 18px rgba(92, 255, 92, 0.2);
    transition: height 0.2s ease;
}
.gas-shell-mark {
    position: absolute;
    left: 8px;
    right: 8px;
    height: 2px;
    background: rgba(255, 66, 66, 0.9);
    box-shadow: 0 0 12px rgba(255, 66, 66, 0.35);
}
.gas-shell-readout,
.gas-console-readout {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    font-family: var(--font-code);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
}
.gas-shell-readout {
    margin: 10px 0 8px;
    color: #132112;
}
.gas-shell-controls {
    display: flex;
    gap: 8px;
}
.gas-shell-slider-wrap {
    margin-top: 10px;
}
.gas-shell-slider {
    width: 100%;
    appearance: none;
    height: 14px;
    border-radius: 999px;
    background: linear-gradient(90deg, #152116 0%, #3d6b3d 48%, #a5e86f 58%, #c94444 80%, #7d1414 100%);
    border: 1px solid rgba(19, 33, 18, 0.35);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.55);
    cursor: pointer;
}
.gas-shell-slider::-webkit-slider-thumb {
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #f2f7ef;
    background: radial-gradient(circle at 35% 35%, #fbfffa 0 20%, #c7d2c6 21% 45%, #7f8f82 46% 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.gas-shell-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #f2f7ef;
    background: radial-gradient(circle at 35% 35%, #fbfffa 0 20%, #c7d2c6 21% 45%, #7f8f82 46% 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.gas-shell-card.warning {
    border-color: rgba(244, 175, 82, 0.85);
    box-shadow: 0 0 0 1px rgba(244, 175, 82, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.gas-mini-btn {
    flex: 1;
    padding: 8px 10px;
    font-size: 0.85rem;
}
.gas-console-footer {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(18, 24, 18, 0.18);
    margin-bottom: 12px;
}
.gas-console-readout {
    background: rgba(12, 18, 12, 0.92);
    color: #d7f8d8;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px inset #4f654f;
    min-width: 190px;
}
.gas-console-readout strong {
    color: #8cff9d;
}
.gas-lab-card .feedback {
    margin-top: 12px;
    min-height: 1.4em;
}
.gas-shell-card.leaking {
    animation: gasLeakPulse 0.7s ease;
}
.gas-shell-card.over-safe {
    border-color: rgba(168, 50, 50, 0.7);
    box-shadow: 0 0 0 1px rgba(168, 50, 50, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.gas-shell-card.in-range {
    border-color: rgba(80, 160, 80, 0.6);
    box-shadow: 0 0 0 1px rgba(80, 160, 80, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.windsock-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 220px;
    padding: 14px 14px 12px;
    border-radius: 12px;
    border: 2px solid #d8deea;
    background:
        linear-gradient(180deg, #7f8895 0%, #505965 16%, #2b313c 56%, #1a1d25 100%);
    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, 0.45),
        inset -1px -1px 0 rgba(0, 0, 0, 0.5),
        inset 0 0 24px rgba(255, 255, 255, 0.08),
        0 14px 28px rgba(0, 0, 0, 0.38);
}
.windsock-container::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 14px;
    right: 14px;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.18));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 1px 0 rgba(0, 0, 0, 0.4);
}
.windsock-container::after {
    content: '';
    position: absolute;
    top: 32px;
    left: 14px;
    right: 14px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
    opacity: 0.7;
}
.wind-meter-header,
.wind-meter-footer {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-code);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.68rem;
    color: #dbe6f2;
}
.wind-meter-header { margin-top: 12px; margin-bottom: 12px; }
.wind-meter-title { font-weight: bold; color: #f3f7ff; }
.wind-meter-tag {
    padding: 3px 8px;
    border-radius: 999px;
    color: #09110b;
    background: linear-gradient(180deg, #a8ff75, #74d152);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28), 0 0 18px rgba(120, 255, 110, 0.22);
}
.wind-meter-footer {
    margin-top: 10px;
    padding: 5px 8px;
    border-radius: 8px;
    background: rgba(5, 8, 12, 0.36);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #b8c7d8;
}
.windsock {
    width: 72px;
    height: 22px;
    background: linear-gradient(to right, #efefef 0%, #d3d7dd 42%, #f8f8f8 56%, #c7ccd4 100%);
    border-radius: 10px 50% 50% 10px;
    position: relative;
    transition: transform 0.45s ease-in-out, filter 0.2s ease;
    transform-origin: left center;
    border-left: 5px solid #27303b;
    margin: 10px 0 18px;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22), 0 4px 10px rgba(0, 0, 0, 0.28);
}
.windsock::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 10px;
    width: 8px;
    height: 8px;
    transform: translateY(-50%);
    border-radius: 50%;
    background: rgba(33, 42, 53, 0.34);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12), 0 0 14px rgba(109, 233, 107, 0.12);
}
.windsock:hover { filter: brightness(1.06); }
.windsock:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 6px; }
.wind-west { transform: rotate(180deg); } /* Mot egne */
.wind-north { transform: rotate(90deg); }
.wind-east { transform: rotate(0deg); }   /* Mot fienden */
.wind-south { transform: rotate(270deg); }
.wind-prompt {
    font-size: 0.72rem;
    color: #e8eef8;
    text-align: center;
    margin-bottom: 8px;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.13);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
#wind-status {
    width: 100%;
    font-family: var(--font-code);
    font-size: 0.82rem;
    text-align: center;
    color: #8cff9d;
    background: linear-gradient(180deg, rgba(4, 13, 7, 0.98), rgba(10, 23, 11, 0.98));
    border: 2px inset #557d5d;
    border-radius: 5px;
    padding: 9px 10px 8px;
    min-height: 46px;
    box-shadow: inset 0 0 12px rgba(84, 255, 100, 0.12);
}
.document-container { background: #eadecd; color: #2b2b2b; padding: 20px; width: 300px; border: 1px solid #111; position: relative; min-height: 250px; display: flex; flex-direction: column; font-family: 'Playfair Display', serif; }
.doc-title { font-weight: bold; font-size: 1.2rem; border-bottom: 2px solid #2b2b2b; margin-bottom: 10px; padding-bottom: 5px; }
.stamp-target { margin-top: auto; height: 80px; border: 2px dashed #999; display: flex; justify-content: center; align-items: center; color: #999; font-style: italic; transition: background 0.3s; }
.stamp-target.drag-over { background: rgba(168, 50, 50, 0.2); border-color: #a83232; }
.draggable-stamp { background: rgba(255,255,255,0.8); border: 4px solid #a83232; color: #a83232; font-family: 'Cinzel', serif; font-size: 1.5rem; font-weight: bold; padding: 10px 20px; border-radius: 5px; transform: rotate(-10deg); cursor: grab; display: inline-block; user-select: none; margin-top: 20px; align-self: center; }
.draggable-stamp:active { cursor: grabbing; }
.stamp-stamped { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%) rotate(-15deg); border: 4px solid #a83232; color: #a83232; font-family: 'Cinzel', serif; font-size: 2rem; font-weight: bold; padding: 10px 20px; opacity: 0.8; pointer-events: none; z-index: 10; }

@keyframes gasCloudDriftEast {
    0% { transform: translate3d(-10%, 0, 0) scale(0.96); }
    100% { transform: translate3d(160%, -1.5%, 0) scale(1.08); }
}
@keyframes gasCloudDriftWest {
    0% { transform: translate3d(160%, -1.5%, 0) scale(1.08); }
    100% { transform: translate3d(-10%, 0, 0) scale(0.96); }
}
@keyframes gasCloudDriftNorth {
    0% { transform: translate3d(-8%, 14%, 0) scale(0.98); }
    100% { transform: translate3d(162%, -10%, 0) scale(1.1); }
}
@keyframes gasCloudDriftSouth {
    0% { transform: translate3d(162%, -10%, 0) scale(1.1); }
    100% { transform: translate3d(-8%, 14%, 0) scale(0.98); }
}
@keyframes gasHazeSweepEast {
    0% { transform: translate3d(-4%, 0, 0); }
    100% { transform: translate3d(12%, 0, 0); }
}
@keyframes gasHazeSweepNorth {
    0% { transform: translate3d(-4%, 6%, 0); }
    100% { transform: translate3d(8%, -8%, 0); }
}
@keyframes gasHazeSweepSouth {
    0% { transform: translate3d(8%, -8%, 0); }
    100% { transform: translate3d(-4%, 6%, 0); }
}
@keyframes gasLeakPulse {
    0% { transform: translateX(0) scale(1); filter: saturate(1); }
    20% { transform: translateX(-2px) scale(1.01); }
    40% { transform: translateX(3px) scale(1.01); filter: saturate(1.35); }
    60% { transform: translateX(-3px) scale(0.99); }
    80% { transform: translateX(2px) scale(1.01); }
    100% { transform: translateX(0) scale(1); filter: saturate(1); }
}

/* Rom 9: Feltsykehuset */
.medicine-cabinet { display: flex; justify-content: center; gap: 15px; margin: 20px 0; flex-wrap: wrap; background: rgba(0,0,0,0.5); padding: 20px; border: 2px solid #5c4e40; border-radius: 5px; box-shadow: inset 0 0 20px rgba(0,0,0,0.8); }
.med-bottle { width: 80px; height: 120px; background: rgba(139, 69, 19, 0.4); border: 2px solid #4a3c31; border-radius: 10px 10px 5px 5px; display: flex; flex-direction: column; justify-content: center; align-items: center; cursor: pointer; transition: all 0.2s; position: relative; padding: 5px; text-align: center; font-size: 0.8rem; font-family: 'Playfair Display', serif; background-image: linear-gradient(rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 20%); }
.med-bottle::before { content: ''; position: absolute; top: -15px; width: 30px; height: 15px; background: inherit; border: inherit; border-bottom: none; border-radius: 5px 5px 0 0; }
.med-bottle:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,0,0,0.5); background-color: rgba(139, 69, 19, 0.6); }
.med-bottle.selected { border-color: var(--accent-color); background-color: rgba(212, 175, 55, 0.3); box-shadow: 0 0 15px rgba(212, 175, 55, 0.5); color: #fff; }

/* Rom 11: Tysk Kodebok */
.codebook-container { background: #d1c7b1; color: #2b2723; padding: 20px; font-family: 'Playfair Display', serif; border: 2px solid #a69c86; box-shadow: 0 5px 15px rgba(0,0,0,0.8); max-width: 400px; margin: 0 auto 20px auto; }
.codebook-title { text-align: center; border-bottom: 2px solid #2b2723; padding-bottom: 10px; margin-bottom: 15px; text-transform: uppercase; }
.codebook-help { display: none; }
#room-10 .puzzle-container::before { content: "Løs tre oversettelser i samme rom for å få ham til å snakke videre."; display: block; max-width: 520px; margin: 0 auto 14px auto; text-align: center; font-style: italic; color: #ddd1b4; }
.codebook-progress, .codebook-target { text-align: center; margin: 0 0 10px 0; font-weight: bold; }
.codebook-target { font-style: italic; }
.codebook-progress span, .codebook-target span { color: #a83232; }
.codebook-list { list-style: none; padding: 0; margin: 0 0 15px 0; border: 1px solid rgba(0,0,0,0.1); }
.codebook-list li { padding: 10px; border-bottom: 1px solid rgba(0,0,0,0.1); cursor: pointer; transition: background 0.2s; }
.codebook-list li:last-child { border-bottom: none; }
.codebook-list li:hover { background: rgba(0,0,0,0.05); }
.codebook-list li.selected { background: rgba(168, 50, 50, 0.2); font-weight: bold; }
.codebook-selected { text-align: center; font-weight: bold; border-top: 1px dashed #2b2723; padding-top: 10px; }
#selected-translation { color: #a83232; }

/* Rom 13: Radio */
.radio-container { background: #333; border: 4px solid #1a1a1a; padding: 20px; border-radius: 5px; box-shadow: inset 0 0 10px rgba(0,0,0,0.8), 0 5px 15px rgba(0,0,0,0.5); max-width: 400px; margin: 0 auto 20px auto; }
.radio-slider { width: 100%; margin-bottom: 15px; accent-color: var(--accent-color); }
.radio-display { font-family: var(--font-code); color: #4ae28a; font-size: 1.5rem; text-align: center; background: #000; padding: 10px; border-radius: 3px; border: 1px inset #555; margin-bottom: 15px; }
.radio-signal-bar { width: 100%; height: 20px; background: #111; border: 1px solid #444; border-radius: 2px; position: relative; overflow: hidden; }
#radio-signal-strength { height: 100%; background: linear-gradient(90deg, #a83232, #d4af37, #4ae28a); transition: width 0.1s ease; }

/* Rom 2: Schlieffen Map */
.schlieffen-container { margin: 20px 0; }
.schlieffen-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.75fr); gap: 18px; align-items: stretch; }
.schlieffen-map-board { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.schlieffen-map-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 0 4px; }
.schlieffen-map-title { font-family: var(--font-heading); font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-color); }
.schlieffen-map-subtitle { max-width: 320px; text-align: right; color: #d8cfba; font-size: 0.9rem; }
.schlieffen-map-frame { position: relative; aspect-ratio: 1 / 1; border-radius: 18px; overflow: hidden; border: 1px solid rgba(212, 175, 55, 0.35); background: linear-gradient(180deg, #2a2018, #120f0c); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55); }
.schlieffen-map-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: sepia(0.22) saturate(0.92) contrast(1.08); transform: scale(1.01); }
.schlieffen-map-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at center, transparent 38%, rgba(0, 0, 0, 0.08) 65%, rgba(0, 0, 0, 0.58) 100%); }
.schlieffen-map-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0.95; }
.map-target { position: absolute; display: flex; flex-direction: column; justify-content: space-between; padding: 14px; color: #f7efdf; border: 1px solid rgba(242, 219, 170, 0.42); border-radius: 16px; background: linear-gradient(180deg, rgba(18, 14, 10, 0.32), rgba(74, 40, 28, 0.5)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 20px rgba(0, 0, 0, 0.18); backdrop-filter: blur(2px) saturate(120%); transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; overflow: hidden; }
.map-target::before { content: ''; position: absolute; left: 12px; bottom: 12px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent-color); box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.14); }
.map-target::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 42%); pointer-events: none; }
.map-target.drag-over { transform: scale(1.015); border-color: rgba(212, 175, 55, 0.8); background: linear-gradient(180deg, rgba(34, 24, 12, 0.48), rgba(122, 72, 35, 0.58)); box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.16), 0 14px 28px rgba(0, 0, 0, 0.28); }
.map-target.occupied { border-color: rgba(212, 175, 55, 0.58); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 24px rgba(0, 0, 0, 0.24); }
.map-target-north { top: 9%; left: 6%; width: 46%; height: 21%; }
.map-target-center { top: 35%; left: 27%; width: 35%; height: 20%; }
.map-target-south { top: 59%; left: 45%; width: 47%; height: 21%; }
.sector-tag { font-family: var(--font-heading); font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.06em; }
.sector-note { font-size: 0.8rem; line-height: 1.35; color: #efe2c2; max-width: 220px; }
.zone-count { position: absolute; top: 12px; right: 12px; min-width: 2rem; height: 2rem; padding: 0 0.45rem; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(212, 175, 55, 0.45); color: var(--accent-color); font-family: var(--font-code); font-weight: bold; }
.zone-armies { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.army-chip { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 999px; border: 1px solid rgba(212, 175, 55, 0.35); background: rgba(13, 11, 8, 0.72); color: #fff6e0; font-size: 0.72rem; letter-spacing: 0.03em; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); }
.schlieffen-sidebar { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.schlieffen-info-card, .troop-dock-card { background: rgba(0, 0, 0, 0.38); border: 1px solid rgba(212, 175, 55, 0.18); border-radius: 14px; padding: 16px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03); }
.schlieffen-info-card h3, .troop-dock-card h3 { font-family: var(--font-heading); font-size: 1.2rem; color: var(--accent-color); margin-bottom: 10px; }
.schlieffen-info-card p { margin-bottom: 12px; color: #e8ddc7; }
.schlieffen-info-card ul { padding-left: 18px; color: #d5cab4; display: grid; gap: 8px; }
.troop-dock-card { display: flex; flex-direction: column; gap: 12px; }
.troop-dock { display: flex; flex-direction: column; gap: 10px; max-width: none; }
.draggable-troop { background: linear-gradient(180deg, #51483f, #2e271f); border: 1px solid rgba(212, 175, 55, 0.22); padding: 12px 14px; color: #fff; cursor: grab; font-weight: bold; border-radius: 10px; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18); }
.draggable-troop:active { cursor: grabbing; transform: translateY(1px); }

/* Rom 3: Trench Builder */
.trench-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.75fr); gap: 18px; align-items: stretch; }
.trench-board, .trench-sidecard, .trench-materials-card, .trench-notes-card {
    background: rgba(0, 0, 0, 0.38);
    border: 1px solid rgba(212, 175, 55, 0.18);
    border-radius: 14px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}
.trench-board { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.trench-sidecard { padding: 16px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.trench-board-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.trench-board-title { font-family: var(--font-heading); font-size: 1.25rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-color); }
.trench-board-subtitle { margin-top: 4px; color: #d8cfba; font-size: 0.92rem; max-width: 44ch; }
.trench-board-badge {
    flex: 0 0 auto;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.28);
    color: var(--accent-color);
    font-family: var(--font-code);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.trench-cross-section {
    position: relative;
    min-height: 330px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.3);
    background: linear-gradient(180deg, #291f19, #120f0c);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 18px 14px 16px;
    gap: 8px;
    flex-wrap: wrap;
}
.trench-scene-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: sepia(0.28) saturate(0.9) contrast(1.08); opacity: 0.62; }
.trench-scene-overlay { position: absolute; inset: 0; background: radial-gradient(circle at center, transparent 34%, rgba(0, 0, 0, 0.14) 58%, rgba(0, 0, 0, 0.62) 100%); }
.trench-ridge {
    position: absolute;
    bottom: 22px;
    width: 34%;
    height: 18px;
    border-radius: 999px;
    background: rgba(75, 53, 31, 0.72);
    filter: blur(1px);
    opacity: 0.85;
}
.trench-ridge-left { left: -2%; transform: rotate(-4deg); }
.trench-ridge-right { right: -2%; transform: rotate(4deg); }
.trench-earth-layer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 44%;
    background: linear-gradient(180deg, transparent 0%, rgba(53, 38, 24, 0.18) 25%, rgba(53, 38, 24, 0.72) 78%, rgba(31, 24, 18, 0.95) 100%);
    pointer-events: none;
}
.trench-section-label {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: #fff6e0;
    font-family: var(--font-code);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
}
.trench-cross-section.drag-over { transform: translateY(-1px); border-color: rgba(212, 175, 55, 0.75); box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.12), 0 22px 56px rgba(0, 0, 0, 0.62); }
.trench-hint {
    position: relative;
    z-index: 2;
    padding: 11px 16px;
    border-radius: 999px;
    background: rgba(9, 10, 8, 0.7);
    border: 1px dashed rgba(212, 175, 55, 0.35);
    color: #eee4cf;
    font-style: italic;
    font-size: 0.92rem;
}
.dropped-material {
    position: relative;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.5);
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 0.03em;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.22);
}
.dropped-material.material-wood { background: linear-gradient(180deg, #7a5631, #4c3520); color: #fff3e0; }
.dropped-material.material-sandbag { background: linear-gradient(180deg, #b7a175, #8b7857); color: #201a13; }
.trench-stats-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(212, 175, 55, 0.16);
}
.trench-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.trench-stat-label { text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-color); font-family: var(--font-heading); font-size: 0.72rem; }
.trench-stat-value { font-family: var(--font-code); color: #f5e9ca; font-size: 1.05rem; }
.trench-stat-note { color: #d7cab0; font-size: 0.92rem; text-align: right; }
.trench-materials-card, .trench-notes-card { padding: 14px; }
.trench-materials-card h3, .trench-notes-card h3 { font-family: var(--font-heading); font-size: 1.1rem; color: var(--accent-color); margin-bottom: 10px; }
.trench-materials { display: grid; gap: 12px; }
.trench-material-item {
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    cursor: grab;
    text-align: left;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.trench-material-item strong { display: block; font-size: 1.02rem; }
.trench-material-item small { display: block; margin-top: 4px; color: rgba(255, 255, 255, 0.82); }
.trench-material-item:active { cursor: grabbing; transform: translateY(1px); }
.trench-material-item:hover { transform: translateY(-2px); box-shadow: 0 12px 18px rgba(0, 0, 0, 0.24); }
.material-sandbag { background: linear-gradient(180deg, #c1ad7f, #907c58); color: #1f1812; }
.material-wood { background: linear-gradient(180deg, #7b5632, #4c3520); color: #fff3e0; }
.trench-notes-list { margin: 0; padding-left: 18px; color: #d5cab4; display: grid; gap: 8px; }
.trench-notes-list li { line-height: 1.45; }

/* Rom 5: Train Logistics (2D Tetris Knapsack) */
.train-logistics-container { display: flex; flex-direction: column; gap: 20px; align-items: center; margin: 20px 0; }
.wagons-wrapper { display: flex; gap: 40px; justify-content: center; width: 100%; flex-wrap: wrap; }
.wagon-wrapper { display: flex; flex-direction: column; align-items: center; }
.wagon-title { font-family: var(--font-code); color: #d4af37; text-align: center; margin-bottom: 5px; font-weight: bold;}
.wagon-box { 
    width: 150px; height: 150px; 
    background-color: #1a1a1a;
    background-image: 
        linear-gradient(rgba(212, 175, 55, 0.2) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212, 175, 55, 0.2) 1px, transparent 1px);
    background-size: 50px 50px;
    border: 3px solid #5c4e40;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}
.wagon-box.drag-over { background-color: rgba(92, 78, 64, 0.3); }

.cargo-docks-2d { 
    width: 100%; max-width: 600px; min-height: 160px;
    background: rgba(0,0,0,0.4); border: 2px dashed #777; padding: 10px;
    position: relative;
    display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; justify-content: center;
}

.crate-2d {
    position: relative; /* absolute when dropped in wagon */
    cursor: grab;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center; font-family: var(--font-code); font-size: 0.75rem;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5), 2px 2px 5px rgba(0,0,0,0.5);
    border: 2px solid #111;
    user-select: none;
    z-index: 10;
    box-sizing: border-box;
}
.crate-2d:active { cursor: grabbing; z-index: 20; opacity: 0.8; }
.crate-2x2 { width: 100px; height: 100px; }
.crate-3x1 { width: 150px; height: 50px; }
.crate-1x3 { width: 50px; height: 150px; }
.crate-2x1 { width: 100px; height: 50px; }
.crate-1x2 { width: 50px; height: 100px; }
.crate-1x1 { width: 50px; height: 50px; }

/* Rom 6: Gun Assembly */
.gun-assembly-container { display: flex; flex-direction: column; gap: 20px; margin: 20px 0; align-items: center; }
.gun-blueprint { width: 300px; height: 200px; background: rgba(0,0,0,0.5); border: 2px dashed #777; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.blueprint-slot { width: 150px; height: 40px; border: 2px dashed #a83232; color: #a83232; display: flex; justify-content: center; align-items: center; font-style: italic; transition: background 0.2s; }
.blueprint-slot.drag-over { background: rgba(168, 50, 50, 0.2); }
.blueprint-slot.filled { border: 2px solid #4ae28a; background: #222; color: #4ae28a; font-style: normal; font-weight: bold; }
.gun-parts-dock { display: flex; gap: 10px; }
.gun-part { background: #4a4a4a; border: 2px solid #222; padding: 10px; color: #fff; cursor: grab; font-weight: bold; }

/* Rom 7: Sensur */
.censor-letter {
    background: #eadecd;
    color: #2b2b2b;
    padding: 20px 30px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 600px;
    margin: 20px auto;
    text-align: left;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.2), 2px 2px 10px rgba(0,0,0,0.5);
}
.censor-letter p { margin-bottom: 15px; }
.censor-word {
    cursor: pointer;
    padding: 0 2px;
    border-radius: 2px;
    transition: all 0.1s;
}
.censor-word:hover { background-color: rgba(0,0,0,0.1); }
.censor-word.censored {
    background-color: #111 !important;
    color: #111 !important;
}
