:root {
  color-scheme: dark;
  --bg: #0b0e0d;
  --panel: #141916;
  --cream: #e2dfcd;
  --muted: #b0b5a7;
  --gold: #dfa340;
  --line: #4f4a36;
  --red: #f08c72;
  --mono: 'Courier New', Courier, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 50% 0, #242d24 0, var(--bg) 66%);
  color: var(--cream);
  font: 17px/1.6 Georgia, 'Times New Roman', serif;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .2;
  background: repeating-linear-gradient(0deg, transparent 0 3px, #000 3px 4px);
  pointer-events: none;
}
.shell { max-width: 1120px; margin: 12px auto 0; padding: 0 28px; }
a { color: var(--gold); text-underline-offset: 4px; }
.masthead { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding: 0 5px 14px; }
.wordmark {
  color: #dadcd4;
  font: bold clamp(28px, 4.5vw, 40px)/1.05 var(--mono);
  letter-spacing: -.065em;
  text-decoration: none;
  text-shadow: 0 2px #000, 0 -1px #fff6;
}
.wordmark span { display: block; margin-top: 9px; color: var(--gold); font: bold 11px/1.4 var(--mono); letter-spacing: .24em; text-shadow: 0 1px #000; }
.wordmark i { padding: 0 7px; font-style: normal; color: #666e60; }
.edition { display: flex; align-items: center; gap: 10px; margin-bottom: 3px; color: #bec1b1; font: 11px/1.5 var(--mono); letter-spacing: .09em; }
.signal { width: 7px; height: 7px; background: var(--gold); box-shadow: 0 0 8px #dfa34066; }

/* Steel housing around two independent, inset displays. */
.console {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  column-gap: 20px;
  padding: 0 20px;
  border: 1px solid #77796a;
  border-bottom-color: #252b23;
  background: repeating-linear-gradient(0deg, #ffffff04 0 1px, transparent 1px 3px), linear-gradient(100deg, #3c4136, #232b23 18%, #30382b 75%, #4c4e3f);
  box-shadow: inset 0 0 0 3px #161b17, inset 0 0 0 4px #646555, 0 16px 60px #0008, 0 4px #050705;
}
.console::before, .console::after {
  content: '';
  position: absolute;
  top: 13px;
  width: 10px;
  height: 10px;
  border: 1px solid #8c8d7c;
  border-radius: 50%;
  background: linear-gradient(135deg, #23291e 42%, #727765 43% 55%, #171b15 56%);
  box-shadow: 1px 1px 2px #000;
}
.console::before { left: 11px; }
.console::after { right: 11px; }
.console-rail, .console-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 18px; color: #b9bb9f; font: bold 10px/1.4 var(--mono); letter-spacing: .1em; text-shadow: 0 1px #000; }
.console-rail { height: 32px; padding: 0 5px; }
.rail-stripes { flex: 1; max-width: 85px; height: 9px; opacity: .7; background: repeating-linear-gradient(120deg, #b3a56f 0 5px, #121710 5px 10px); }
.console-foot { padding: 10px 5px 12px; }
.launcher, .briefing { min-width: 0; border: 1px solid #060a06; box-shadow: 0 0 0 1px #737260, inset 0 0 22px #0006; }
.launcher { padding: 18px 23px; background: radial-gradient(ellipse at top left, #20251b, #101610 85%); }
.eyebrow { font: bold 11px/1.5 var(--mono); color: var(--gold); letter-spacing: .12em; margin: 0 0 10px; }
.eyebrow span { margin-right: 8px; color: #9b966f; }
h1 { margin: 0; color: #eeece0; font: bold clamp(25px, 3vw, 32px)/1.15 var(--mono); letter-spacing: -.05em; text-shadow: 0 2px #000; }
.hud-rule { height: 7px; margin: 15px 0; border: 1px solid #ad7b2f; background: linear-gradient(90deg, #b9822d 0 24%, transparent 24%); box-shadow: 0 1px #000; }
.lead { margin: 0 0 18px; color: #c4c7b7; font-size: 16px; }

button {
  cursor: pointer;
  border: 1px solid #818269;
  border-top-color: #a3a48e;
  border-left-color: #a3a48e;
  border-radius: 0;
  background: linear-gradient(#3e4535, #282f22);
  color: var(--cream);
  padding: 12px 17px;
  font: bold 15px/1.4 var(--mono);
  box-shadow: inset 1px 1px #c6c7a51a, inset -2px -2px #0d110b, 2px 2px #000;
  text-shadow: 0 1px #000;
}
button:hover { background: linear-gradient(#4f5840, #343d2a); color: #fff5ce; }
button:active { box-shadow: inset 2px 2px #111608; transform: translate(1px, 1px); }
button.primary {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  text-align: left;
  color: #ffe7b2;
  border-color: #a87727;
  border-top-color: #e5bd6b;
  border-left-color: #e5bd6b;
  background: repeating-linear-gradient(0deg, #ffffff04 0 1px, transparent 1px 3px), linear-gradient(#715321, #4f3819);
  box-shadow: inset 0 0 0 3px #16150f, inset 0 0 0 4px #aa7e3899, 2px 3px #000;
  font-size: 17px;
}
button.primary span { color: var(--gold); font-size: 14px; padding-left: 14px; border-left: 1px solid #bc904c66; }
button.primary:hover { background: linear-gradient(#926d2d, #674820); color: #fff7d9; }
button:disabled { opacity: .52; cursor: wait; }
button:disabled:active { transform: none; }
button.quiet { background: #111810; font: 12px/1.5 var(--mono); color: #c0c4b1; box-shadow: inset 1px 1px #000, 1px 1px #4b5441; border-color: #58614e; padding: 9px 12px; }
button.quiet:hover { color: #ffe7b2; border-color: #b58c43; }
button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid #f4ca73; outline-offset: 5px; }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0; font: 14px/1.5 var(--mono); color: #c6cbb8; cursor: pointer; }
.check input { margin: 3px 0; accent-color: var(--gold); width: 16px; height: 16px; flex-shrink: 0; }
.sound-switch { padding: 1px 0 4px; }
.manual-import { margin-top: 16px; }
.launcher:has(details[open]) .lead,
.launcher:has(details[open]) .hud-rule,
.launcher:has(details[open]) #prepare,
.launcher:has(details[open]) #cached { display: none; }
details { border-top: 1px solid #53583e; }
details:last-child { border-bottom: 1px solid #53583e; }
summary { cursor: pointer; padding: 11px 0; color: #d8c59a; font: bold 14px/1.5 var(--mono); }
summary::marker { color: #b38538; font-size: 11px; }
details[open] summary { color: #ffe1a0; }
details form { margin: 4px 0 18px; }
form label { display: block; margin-bottom: 9px; font: 14px/1.5 var(--mono); }
input[type=file], input[type=url] { display: block; width: 100%; padding: 10px; border: 1px solid #69704d; background: #080e08; color: var(--cream); font: 14px/1.5 var(--mono); margin-bottom: 14px; min-width: 0; }
input::file-selector-button { background: #36422a; color: var(--cream); border: 1px solid #78835f; padding: 6px 8px; margin-right: 9px; font: 12px var(--mono); cursor: pointer; }
details p, .small { font-size: 14px; color: var(--muted); }
.message { margin: 18px 0 0; padding: 17px; border: 1px solid #997033; background: #191c10; font-size: 14px; }
.message strong { display: block; font: bold 14px/1.5 var(--mono); color: #f0cb80; }
.message p { margin: 12px 0 0; color: #bec1a8; }
.error { border-color: #b36a50; color: #ffb499; background: #271a13; overflow-wrap: anywhere; }
progress { display: block; appearance: none; width: 100%; height: 12px; margin-top: 13px; border: 1px solid #c18a37; background: #0e130b; padding: 2px; }
progress::-webkit-progress-bar { background: #0e130b; }
progress::-webkit-progress-value { background: repeating-linear-gradient(90deg, #dfa340 0 7px, #845e26 7px 9px); }
progress::-moz-progress-bar { background: repeating-linear-gradient(90deg, #dfa340 0 7px, #845e26 7px 9px); }
.saved-game { margin: 0 0 20px; }
.saved-game p { margin: 0 0 12px; color: #d1d5bb; font: 14px/1.6 var(--mono); }

.briefing { align-self: start; background: #0c120e; }
.mission-screen { margin: 0; padding: 8px; border-bottom: 1px solid #626348; background: #070b08; }
.monitor-label { display: flex; justify-content: space-between; margin: 0; color: #ccab66; padding: 3px 5px 10px; font: 10px/1.4 var(--mono); letter-spacing: .15em; }
.mission-screen img { display: block; width: 100%; height: clamp(220px, 40vh, 306px); object-fit: contain; background: #000; border: 1px solid #4e5944; }
.mission-screen figcaption { color: #a2ac93; padding: 8px 5px 2px; font: 10px/1.5 var(--mono); }
.briefing-copy { padding: 14px 20px 18px; }

footer { margin-top: 16px; padding: 0 5px 18px; font: 12px/1.6 Georgia, 'Times New Roman', serif; color: #b0b4a6; }
footer p { margin: 0; }
.legal { max-width: 1060px; }
.project-credit { margin-top: 10px; padding-top: 10px; border-top: 1px solid #414636; font: 11px/1.6 var(--mono); color: #cacbb8; }
.project-credit span { display: inline; }

.game-toolbar { display: flex; align-items: center; gap: 12px; font: 15px/1.5 var(--mono); padding: 18px 0; }
.game-toolbar span { margin-right: auto; color: #dbbc7a; }
.game-toolbar button { font-size: 13px; padding: 8px 12px; }
#stage { position: relative; width: 100%; height: min(73vh, 800px); background: #000; min-height: 480px; }
#game { display: block; width: 100%; height: 100%; outline: 0; }
#stage:fullscreen { height: 100vh; }
#world-progress { position: absolute; inset: 0; background: #080d08ef; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px; z-index: 5; }
#world-progress strong { font: bold 20px/1.5 var(--mono); color: #ecd1a1; text-align: center; }
#world-progress progress { max-width: 480px; }
.game-help { font: 13px/1.5 var(--mono); color: var(--muted); }
body.playing .shell { max-width: 1600px; margin-top: 8px; }
body.playing header { display: none; }
body.playing footer { margin-top: 18px; }
[hidden] { display: none !important; }

@media (min-width: 1400px) and (min-height: 800px) {
  body:not(.playing) .shell { zoom: 1.25; }
}

@media (max-width: 900px) {
  .shell { margin-top: 16px; padding: 0 22px; }
  .console { gap: 18px; padding: 0 18px; }
  .launcher { padding: 20px; }
  .briefing-copy { padding: 16px; }
  .edition { max-width: 150px; font-size: 10px; }
  .wordmark span { font-size: 11px; }
}
@media (max-width: 700px) {
  .shell { padding: 0 12px; margin-top: 24px; }
  .masthead { flex-wrap: wrap; padding-bottom: 20px; gap: 16px; }
  .wordmark { font-size: clamp(25px, 7.5vw, 38px); }
  .edition { max-width: none; font-size: 10px; }
  .console { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 14px; }
  .console-rail { font-size: 8px; gap: 9px; }
  .rail-stripes { max-width: 40px; }
  .launcher { padding: 22px; }
  .briefing { margin-top: 20px; }
  .briefing-copy { padding: 22px; }
  .console-foot { font-size: 8px; align-items: flex-start; padding-top: 16px; }
  .console-foot span:last-child { text-align: right; }
  button.primary { font-size: 15px; padding: 15px; }
  .lead { font-size: 16px; }
  footer { margin-top: 22px; padding: 0 6px 26px; }
  .project-credit span { display: block; margin-top: 5px; }
  .game-toolbar { flex-wrap: wrap; gap: 9px; }
  .game-toolbar span { flex-basis: 100%; }
  #stage { min-height: 300px; }
}
@media (prefers-reduced-motion: reduce) {
  button:active { transform: none; }
}
