
html { scroll-behavior: smooth; }
body > main { width: 100%; margin: 0; }
body > main > footer { padding: 1rem clamp(1rem, 5vw, 5rem); }

body > main > .door, body > main > section {
    min-height: 100vh;
    min-height: 100svh;
    padding: clamp(1.25rem, 6vw, 6rem);
    border: 0;
    border-radius: 0;
    margin: 0;
    background-position: right center;
    background-size: cover;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
body > main > .door {
    background-image: linear-gradient(90deg, #10130ff2, #10130f77 56%, #10130f12),
        url('./vector-bunker-steel-door.png');
    background-position: center;
    box-shadow: none;
}
.door form { max-width: 23rem; }
body > main > #fridge {
    display: flex;
    flex-direction: column-reverse;
    justify-content: center;
    padding: clamp(1rem, 4vw, 4rem);
    background: radial-gradient(ellipse at top, #494537, #1e1c18 70%);
    font-family: "Courier New", monospace;
}
.fridge-compose, .fridge-board {
    background: #08140f;
    color: #c9ead5;
    border-inline: clamp(.5rem, 2vw, 1.4rem) solid #444034;
    padding: clamp(.85rem, 2vw, 1.65rem);
}
.fridge-compose {
    border-bottom: clamp(.5rem, 2vw, 1.4rem) solid #444034;
    border-radius: 0 0 1.2rem 1.2rem;
    box-shadow: 0 1rem 2rem #0008, inset 0 1px #386149;
}
.fridge-compose h2 { margin: 0 0 .55rem; color: #a5fac4; }
.fridge-compose > p:not(.error) { display: none; }
.fridge-compose form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: .4rem .8rem;
}
.terminal-field { min-width: 0; }
.terminal-field label { display: block; margin: 0 0 .22rem; }
.terminal-field input, .terminal-field textarea { display: block; }
.terminal-field textarea { min-height: 2.75rem; }
.fridge-compose input, .fridge-compose textarea {
    max-width: none;
    background: #0d1f15;
    color: #e0ffeb;
    border-color: #60856e;
}
.fridge-compose button { margin: 0; background: #a5fac4; }
body > main > #arcade {
    background-image: linear-gradient(90deg, #10130ff2, #10130f36),
        url('./vector-bunker-arcade.png');
}
body > main > #retro {
    background-image: linear-gradient(90deg, #10130ff2, #10130f36),
        url('./vector-bunker-retro.png');
}
.arcade { max-width: 42rem; }
.room-art { display: none; }

.fridge-board {
    height: clamp(17rem, 55svh, 42rem);
    overflow-y: auto;
    scrollbar-color: #609879 #0a1a12;
    border-top: clamp(.5rem, 2vw, 1.4rem) solid #444034;
    border-radius: 1.2rem 1.2rem 0 0;
    background-image: repeating-linear-gradient(0deg, #8cffad08 0 1px, transparent 1px 4px);
    box-shadow: inset 0 0 3rem #000a;
}
.fridge-board:focus-visible { outline: 2px solid #9bf4b7; outline-offset: -5px; }
.fridge-board .note {
    color: var(--author-colour, #a5fac4);
    margin: 0;
    border: 0;
    padding: .4rem 0 .55rem;
    overflow-wrap: anywhere;
}
.fridge-board .note + .note { border-top: 1px solid #325040; }
.fridge-board time { color: #a0b5a7; font-size: .8rem; margin-left: .45rem; }
.fridge-board .note p { margin: .25rem 0 0; }

.bunker-transition { display: none; }
.play-bunker-door .bunker-transition {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: block;
    overflow: hidden;
    pointer-events: none;
    background: #10130f url('./vector-bunker-arcade.png') right center / cover no-repeat;
    animation: reveal-bunker 1.35s both;
}
.bunker-transition::before, .bunker-transition::after {
    content: "";
    position: absolute;
    inset: 0;
    background: #232720 url('./vector-bunker-steel-door.png') center / cover no-repeat;
}
.bunker-transition::before {
    clip-path: inset(0 50% 0 0);
    animation: open-left 1s .05s cubic-bezier(.45, 0, .35, 1) both;
}
.bunker-transition::after {
    clip-path: inset(0 0 0 50%);
    animation: open-right 1s .05s cubic-bezier(.45, 0, .35, 1) both;
}
@keyframes open-left { to { transform: translateX(-50%); } }
@keyframes open-right { to { transform: translateX(50%); } }
@keyframes reveal-bunker {
    0%, 72% { opacity: 1; visibility: visible; }
    100% { opacity: 0; visibility: hidden; }
}


/* Moulded case and recessed CRT glass. */
.crt-monitor {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column-reverse;
    width: min(100%, 64rem);
    margin-inline: auto;
    padding: clamp(.65rem, 2.8vw, 2.2rem);
    padding-bottom: clamp(2.4rem, 4vw, 3.6rem);
    border: 1px solid #a69c82;
    border-radius: 1.5rem;
    background:
        repeating-linear-gradient(91deg, #ffffff03 0 1px, transparent 1px 3px),
        linear-gradient(155deg, #b2a68e, #766d58 45%, #494337);
    box-shadow: inset 2px 3px 3px #f4e9c57a,
        inset -3px -5px 8px #251e16ad, 0 1.2rem 2.5rem #000b;
}

.crt-monitor::before {
    content: "";
    position: absolute;
    bottom: 1rem;
    right: 1.5rem;
    width: .52rem;
    height: .52rem;
    border-radius: 50%;
    background: #a7ff9a;
    box-shadow: 0 0 .45rem #77ff61, 0 0 0 .2rem #2b2921;
}

.crt-monitor::after {
    content: "";
    position: absolute;
    bottom: .86rem;
    left: 1.55rem;
    width: clamp(3rem, 16%, 10rem);
    height: .85rem;
    border-radius: .18rem;
    background: repeating-linear-gradient(90deg, #2b261e 0 2px, #9b8e72 2px 5px);
    box-shadow: inset 0 2px 3px #1411099e;
}

.crt-monitor .fridge-board,
.crt-monitor .fridge-compose {
    border-inline: clamp(.28rem, .7vw, .6rem) solid #272720;
    background-color: #0a170e;
    color: #c8edcf;
}

.crt-monitor .fridge-board {
    border-top: .5rem solid #22241c;
    border-radius: 1.2rem 1.2rem 0 0;
    background-image:
        repeating-linear-gradient(0deg, #0004 0 1px, transparent 1px 4px),
        radial-gradient(ellipse at 28% 6%, #7ab78324, transparent 54%),
        radial-gradient(ellipse at center, #1b3820, #09160e 80%);
    box-shadow: inset 0 0 2.25rem #000e, inset 0 2px 0 #71945b75;
    font-variant-numeric: tabular-nums;
}

.crt-monitor .fridge-board .note {
    text-shadow: 0 0 .35em color-mix(in srgb, currentColor 30%, transparent);
}

.crt-monitor .fridge-compose {
    border-bottom: .5rem solid #22241c;
    border-radius: 0 0 1.2rem 1.2rem;
    background-image: repeating-linear-gradient(0deg, #0004 0 1px, transparent 1px 4px);
    box-shadow: inset 0 -1rem 1.4rem #0008, inset 0 1px #386149;
}

.crt-monitor .fridge-compose input,
.crt-monitor .fridge-compose textarea {
    border-radius: .15rem;
    caret-color: #b5ffac;
}


.terminal-signal {
    display: flex;
    align-items: center;
    gap: .2rem;
    width: fit-content;
    height: 1.6rem;
    padding: .2rem .65rem;
    margin: 0 0 .65rem auto;
    border: 1px solid #447751;
    border-radius: .2rem;
    background: #0b1d12;
}
.terminal-signal i {
    display: block;
    width: .2rem;
    height: .9rem;
    background: #87fba5;
    box-shadow: 0 0 .4rem #6dd98280;
    transform: scaleY(.35);
}
.terminal-signal i:nth-child(2n) { transform: scaleY(.7); }
.terminal-signal i:nth-child(3n) { transform: scaleY(.5); }
.crt-started .terminal-signal i { animation: signal-pulse 1.2s ease-in-out 4 alternate; }
.crt-started .terminal-signal i:nth-child(2n) { animation-delay: .18s; }
.crt-started .terminal-signal i:nth-child(3n) { animation-delay: .36s; }
.crt-started .fridge-board { animation: glass-warmup .65s ease-out both; }
.crt-started::before { animation: glass-warmup .8s ease-out both; }
@keyframes signal-pulse {
    45% { transform: scaleY(1); }
    80% { transform: scaleY(.25); }
}
@keyframes glass-warmup {
    from { filter: brightness(.55); }
    60% { filter: brightness(1.14); }
    to { filter: brightness(1); }
}
@media (prefers-reduced-motion: reduce) {
    .crt-started .fridge-board, .crt-started::before,
    .crt-started .terminal-signal i { animation: none; }
}



.control-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
    gap: .55rem;
    width: min(100%, 46rem);
    padding: clamp(.75rem, 2vw, 1.25rem);
    border: 1px solid #77786a;
    border-radius: .55rem;
    background:
        radial-gradient(circle, #8c8c7d 0 1px, #272921 1px 3px, transparent 3.5px) left .2rem top .2rem / .6rem .6rem no-repeat,
        radial-gradient(circle, #8c8c7d 0 1px, #272921 1px 3px, transparent 3.5px) right .2rem bottom .2rem / .6rem .6rem no-repeat,
        linear-gradient(145deg, #42463a, #242720);
    box-shadow: inset 0 1px 2px #ffffff50, 0 .45rem .8rem #0009;
}
.control-panel > a {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: .55rem;
    min-height: 3rem;
    padding: .55rem .65rem;
    border: 1px solid #7c8373;
    border-radius: .3rem;
    background: linear-gradient(#414e40, #202a23);
    color: #f2f3e7;
    box-shadow: inset 0 1px 2px #ffffff45, 0 .2rem 0 #141a16;
    text-decoration: none;
    font: 700 .82rem/1.2 system-ui, sans-serif;
    transition: transform .15s, box-shadow .15s;
}
.control-panel > a::before {
    content: "";
    flex: 0 0 .4rem;
    width: .4rem;
    height: .4rem;
    border-radius: 50%;
    background: #a3ff98;
    box-shadow: 0 0 .45rem #6beb7a;
}
.control-panel > a:hover { border-color: #c3d0ab; }
.control-panel > a:focus-visible { outline: 2px solid #ffd798; outline-offset: 2px; }
.control-panel > a:active { transform: translateY(.15rem); }
.control-panel > .emergency-button {
    width: auto;
    margin: 0;
    background: linear-gradient(#a92d2a, #6e0e13);
    box-shadow: inset 0 1px 2px #ffffff45, 0 .2rem 0 #350d0d;
    border-color: #fc9b82;
}

.emergency-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 1.15rem;
    border: 2px solid #ffad80;
    border-radius: .5rem;
    padding: .75rem 1.1rem;
    background: linear-gradient(#a92d2a, #6e0e13);
    color: #fff3dd;
    box-shadow: inset 0 2px 2px #fff5, 0 .28rem 0 #350d0d;
    text-decoration: none;
    font: 800 .86rem/1.2 system-ui, sans-serif;
    letter-spacing: .12em;
    transition: transform .15s ease, box-shadow .15s ease;
}
.emergency-button::before {
    content: "";
    width: .48rem;
    height: .48rem;
    margin-right: .55rem;
    border-radius: 50%;
    background: #ffba87;
    box-shadow: 0 0 .75rem #ff6757;
    animation: warning-light 1.1s ease-in-out 3 alternate;
}
.emergency-button:hover { box-shadow: inset 0 2px 2px #fff5, 0 .28rem 0 #350d0d, 0 0 1rem #e53636a0; }
.emergency-button:active { transform: translateY(.22rem); }
@keyframes warning-light { to { opacity: .4; } }

.arcade article { transition: border-color .2s ease, box-shadow .2s ease; }
.arcade article:focus-within, .arcade article:hover {
    border-color: #d6a460;
    box-shadow: inset 0 0 1.1rem #ad7c3330;
}
#fridge :target, #arcade :target, #retro :target {
    animation: console-highlight .8s ease-out both;
}
@keyframes console-highlight {
    from { box-shadow: inset 0 0 0 2px #ffc36aaa; }
}
@media (prefers-reduced-motion: reduce) {
    .bunker-menu details[open] > a, .emergency-button::before,
    #fridge :target, #arcade :target, #retro :target { animation: none; }
    .arcade article, .emergency-button { transition: none; }
}


.terminal-admin {
    margin-top: .75rem;
    border-top: 1px solid #4b6c56;
    padding-top: .7rem;
}
.terminal-admin summary { cursor: pointer; color: #ffb9a0; }
.fridge-board .message-delete, .fridge-compose .terminal-admin form { display: block; }
.fridge-board .message-delete button, .fridge-compose .terminal-admin button {
    background: #522720;
    color: #ffe3d6;
    border: 1px solid #bf7866;
    font-size: .78rem;
    margin-top: .35rem;
}
.fridge-compose .terminal-admin input { width: auto; display: inline; }


.room-toolbar {
    align-items: center;
    justify-content: space-between;
    padding: .75rem clamp(1rem, 4vw, 4rem);
    border-bottom: 1px solid #606a56;
    background: #22271e;
    color: #ebe7d7;
}
.room-toolbar a { font-weight: 700; }
.room-toolbar + section { min-height: calc(100svh - 3.5rem); }

@media (max-width: 680px) {
    body > main > .door {
        padding-top: 38svh;
        background-image: linear-gradient(180deg, #10130f10, #10130ff5 57%),
            url('./vector-bunker-steel-door.png');
    }
    .fridge-compose form { display: grid; grid-template-columns: 1fr; gap: .65rem; }
    .fridge-compose button { margin-top: .65rem; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .play-bunker-door .bunker-transition { display: none; }
}

/* Keep the control panel and each room within the visible viewport. */
body { overflow: hidden; }
body > main {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
}
body > main > .door,
body > main > section {
    flex: 1 1 0;
    min-height: 0;
    padding: clamp(.85rem, 3vmin, 3rem);
    overflow: auto;
    justify-content: safe center;
}
body > main > footer {
    flex: none;
    padding-block: .3rem;
    font-size: .75rem;
}
.room-toolbar {
    flex: none;
    flex-wrap: nowrap;
    gap: .6rem;
    padding-block: .4rem;
    font-size: .86rem;
}
.room-toolbar span { text-align: right; }
body > main > #fridge {
    padding: clamp(.35rem, 2vmin, 1.5rem);
    overflow: hidden;
}
.crt-monitor {
    min-height: 0;
    max-height: 100%;
    padding: clamp(.3rem, 2vmin, 1.25rem);
    padding-bottom: clamp(1.7rem, 4vmin, 2.65rem);
}
.crt-monitor::before { bottom: .6rem; }
.crt-monitor::after { bottom: .48rem; }
.crt-monitor .fridge-board {
    flex: 1 1 auto;
    min-height: 2.8rem;
    height: min(55dvh, 34rem);
    padding-block: .5rem;
}
.crt-monitor .fridge-compose { flex: 0 0 auto; padding-block: .5rem; }
.fridge-compose h2 { font-size: 1.1rem; margin-bottom: .35rem; }
.fridge-compose #message { min-height: 2.25rem; resize: none; }
.terminal-field label { font-size: .85rem; }
.terminal-field input, .terminal-field textarea { padding: .3rem .5rem; }
.terminal-signal { margin-bottom: .35rem; }

@media (max-width: 680px) {
    body > main > .door { background-position: center; }
    .control-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fridge-compose form {
        grid-template-columns: minmax(0, 1fr);
        gap: .4rem;
    }
    .fridge-compose form > div:last-child:not(.terminal-field) { grid-column: 1 / -1; }
    .fridge-compose button { margin-top: 0; }
    .arcade { display: grid; grid-template-columns: 1fr; gap: .45rem; }
    .arcade article { padding: .4rem .65rem; }
    .arcade article h3, .arcade article p { margin: .3rem 0; }
}
@media (max-height: 520px) {
    body > main > .door, body > main > section { padding-block: .4rem; }
    .door h1 { font-size: clamp(1.55rem, 8vmin, 2.7rem); }
    .door p { margin-block: .35rem; }
    .door form label { margin-top: .3rem; }
    .control-panel > a { min-height: 2rem; }
}


body > main > .command-console {
    align-items: center;
    text-align: center;
    background:
        repeating-linear-gradient(0deg, #ffffff06 0 1px, transparent 1px 3px),
        repeating-linear-gradient(90deg, transparent 0 23%, #0b0e0c70 23% 23.3%, transparent 23.3% 25%),
        radial-gradient(ellipse at 50% 0, #75745b, #232a24 58%, #0c100e);
    box-shadow: inset 0 0 4rem #060906;
}
.command-console h1 { font-size: clamp(1.7rem, 7vmin, 4.8rem); }
.command-console .control-panel {
    flex: none;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
    width: min(100%, 57rem);
    padding: clamp(.65rem, 3vmin, 2rem);
    gap: clamp(.35rem, 2vmin, 1.15rem);
    border: 3px solid #847d66;
    border-radius: 1rem;
    background:
        radial-gradient(circle, #c2bd9b 0 2px, #151b16 3px 5px, transparent 6px) .3rem .3rem / 1rem 1rem no-repeat,
        radial-gradient(circle, #c2bd9b 0 2px, #151b16 3px 5px, transparent 6px) right .3rem bottom .3rem / 1rem 1rem no-repeat,
        linear-gradient(155deg, #545c4c, #20271f 65%);
}
.command-console .control-panel > a {
    position: relative;
    justify-content: center;
    flex-direction: column;
    min-height: clamp(3.05rem, 11vmin, 6.4rem);
    padding: .5rem .35rem;
    text-align: center;
}
.command-console .control-panel > a:not(.emergency-button) {
    border: 2px solid #111613;
    border-radius: .3rem;
    background: linear-gradient(175deg, #373e36, #1b211d 45%, #121914);
    color: #d8e8cc;
    box-shadow: inset 0 1px 1px #abb9a275, inset 0 -3px #080d0a,
        0 0 0 2px #667061, 0 .32rem .45rem #000b;
    text-shadow: 0 0 .65em #b7ff9670;
    font: 700 clamp(.66rem, 1.8vmin, .88rem)/1.25 "Courier New", monospace;
    letter-spacing: .055em;
    text-transform: uppercase;
}
.command-console .control-panel > a:not(.emergency-button)::before {
    flex: 0 0 .24rem;
    width: 1.45rem;
    height: .24rem;
    border-radius: .08rem;
    background: #91e984;
    box-shadow: 0 0 .5rem #75ff6380;
}
.command-console .control-panel > a:not(.emergency-button):nth-child(2)::before {
    background: #edbb66;
    box-shadow: 0 0 .5rem #edbb6680;
}
.command-console .control-panel > a:not(.emergency-button):nth-child(3)::before {
    background: #81d8d4;
    box-shadow: 0 0 .5rem #81d8d480;
}
.command-console .control-panel > a:not(.emergency-button):hover {
    background: linear-gradient(175deg, #475345, #202c23 55%, #142017);
}
.command-console .launch-station {
    flex: none;
    display: grid;
    place-items: center;
    width: min(100%, 23rem);
    box-sizing: border-box;
    margin-block: clamp(.75rem, 3vmin, 1.8rem);
    padding: clamp(.55rem, 2.6vmin, 1.25rem);
    border: 2px solid #181711;
    border-radius: .55rem;
    background: repeating-linear-gradient(-45deg, #edbf3f 0 14px, #1a1915 14px 28px);
}
.command-console .launch-plate {
    display: grid;
    place-items: center;
    width: min(100%, 14rem);
    aspect-ratio: 1;
    box-sizing: border-box;
    border: 3px solid #211f19;
    border-radius: .35rem;
    background: linear-gradient(145deg, #787368, #332f28);
    box-shadow: inset 0 0 0 2px #a09a87, 0 4px 9px #000a;
}
.command-console .launch-plate > .emergency-button {
    display: grid;
    place-items: center;
    width: 82%;
    aspect-ratio: 1;
    box-sizing: border-box;
    margin: 0;
    padding: .55rem;
    border-radius: 50%;
    border: .32rem solid #37191a;
    background: radial-gradient(circle at 35% 24%, #f65a4c, #a4141a 55%, #560b11);
    box-shadow: 0 0 0 .15rem #bfb298, 0 .38rem 0 #2b0b0d, inset 0 .25rem .6rem #ffd1c088;
    color: #fff6dd;
    font: 950 clamp(1rem, 5vw, 2rem)/.98 system-ui, sans-serif;
    letter-spacing: .035em;
    text-align: center;
    text-shadow: 0 2px 4px #360005;
}
.command-console .launch-plate > .emergency-button::before { content: none; }
.command-console .launch-plate > .emergency-button:hover { filter: brightness(1.12); }
.command-console .launch-plate > .emergency-button:focus-visible { outline: 3px solid #fff0af; outline-offset: 5px; }
.command-console .launch-plate > .emergency-button span { overflow-wrap: anywhere; }
body > main > .launch-confirmation {
    align-items: center;
    text-align: center;
    background: radial-gradient(ellipse, #53251e, #181b17 65%);
}
.launch-confirmation h2 { margin: 0; font-size: clamp(1.45rem, 5vmin, 3rem); }
.launch-actions { margin-top: 1.2rem; display: flex; justify-content: center; flex-wrap: wrap; gap: .85rem; }
.launch-actions a {
    padding: .62rem .9rem;
    border: 1px solid #a09b7a;
    border-radius: .35rem;
    color: #fff3df;
    background: #303b2b;
    font-weight: 700;
}
.launch-actions .launch-confirm { background: #8b211e; border-color: #f09276; }
@media (max-width: 580px) {
    .command-console .control-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


body > main:has(> .entrance) > footer { display: none; }
