:root {
  color-scheme: dark;
  --ink: #090b09;
  --panel: #111510;
  --line: #2b3329;
  --bone: #f2eddf;
  --dim: #8e9587;
  --gold: #e3aa35;
  --green: #69d46d;
  --red: #ef5b55;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0; background: var(--ink); color: var(--bone);
  font-family: "Courier New", ui-monospace, monospace;
  background-image:
    radial-gradient(circle at 50% 10%, rgba(105,212,109,.07), transparent 36%),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.012) 3px 4px);
}
button, a { font: inherit; }
button { cursor: pointer; }

.cabinet { width: min(1180px, 100%); min-height: 100vh; margin: auto; padding: clamp(12px, 2vw, 24px); display: grid; align-content: center; gap: 12px; }
.cabinet__head, .cabinet__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.back { color: var(--dim); text-decoration: none; text-transform: uppercase; font-size: 12px; letter-spacing: .12em; }
.back:hover { color: var(--gold); }
.brand { display: grid; justify-items: center; line-height: 1; }
.brand span { color: var(--gold); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }
.brand strong { margin-top: 5px; font-size: clamp(19px, 3vw, 28px); text-transform: uppercase; letter-spacing: -.04em; }
.head-actions { display: flex; gap: 7px; }
.head-actions button {
  border: 1px solid var(--line); border-radius: 3px; padding: 7px 9px;
  background: var(--panel); color: var(--dim); font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
}
.head-actions button:hover, .head-actions button:focus-visible { color: var(--bone); border-color: var(--gold); }

.screen {
  position: relative; overflow: hidden; isolation: isolate;
  border: 2px solid #3b4638; border-radius: 8px; background: #071008;
  box-shadow: 0 0 0 6px #161c15, 0 20px 70px rgba(0,0,0,.55), inset 0 0 70px rgba(0,0,0,.55);
  aspect-ratio: 16 / 9;
}
.screen::after {
  content: ""; position: absolute; inset: 0; z-index: 5; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.025) 3px 4px);
  mix-blend-mode: screen;
}
canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; touch-action: none; }

.hud { position: absolute; inset: 12px 14px auto; z-index: 3; display: flex; justify-content: space-between; pointer-events: none; text-shadow: 2px 2px #000; }
.hud div { display: grid; gap: 2px; min-width: 90px; }
.hud div:nth-child(2) { justify-items: center; }
.hud div:last-child { justify-items: end; }
.hud span { color: var(--dim); font-size: clamp(8px, 1.2vw, 11px); text-transform: uppercase; letter-spacing: .14em; }
.hud strong { color: var(--bone); font-size: clamp(13px, 2.2vw, 21px); letter-spacing: .08em; }

.overlay {
  position: absolute; inset: 0; z-index: 4; display: grid; place-content: center; justify-items: center; gap: 12px;
  padding: 24px; text-align: center; background: rgba(4,8,4,.74); backdrop-filter: blur(2px);
}
.overlay[hidden] { display: none; }
.eyebrow { margin: 0; color: var(--green); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; }
.overlay h1 { margin: 0; font-size: clamp(42px, 10vw, 94px); line-height: .86; text-transform: uppercase; letter-spacing: -.08em; text-shadow: 5px 5px #1d3a1f; }
.overlay > p:not(.eyebrow):not(.keys) { max-width: 54ch; margin: 0; color: #bbc1b5; font-size: clamp(11px, 1.7vw, 15px); line-height: 1.55; }
.start {
  min-width: 170px; border: 2px solid #f1cb6d; border-radius: 3px; padding: 12px 18px;
  background: var(--gold); color: #171006; font-weight: 900; text-transform: uppercase; letter-spacing: .12em;
  box-shadow: 4px 4px 0 #6f4a0b;
}
.start:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #6f4a0b; }
.keys { margin: 0; color: var(--dim); font-size: 10px; text-transform: uppercase; }
kbd { border: 1px solid #4b5548; border-bottom-width: 2px; border-radius: 2px; padding: 2px 5px; background: #151a14; color: var(--bone); }
.jump {
  display: none; position: absolute; right: 16px; bottom: 16px; z-index: 4;
  width: 74px; height: 74px; border: 2px solid rgba(242,237,223,.7); border-radius: 50%;
  background: rgba(227,170,53,.84); color: #171006; font-weight: 900; text-transform: uppercase;
  touch-action: manipulation;
}
.jump:active { transform: scale(.94); }

.cabinet__foot { color: var(--dim); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.cabinet__foot p { margin: 0; }
.status { white-space: nowrap; }
.status i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (pointer: coarse), (max-width: 760px) {
  .cabinet { align-content: start; padding: 10px; }
  .screen { aspect-ratio: 27 / 43; }
  .jump { display: block; }
  .keys { display: none; }
  .cabinet__head { flex-wrap: wrap; }
  .brand { order: -1; width: 100%; }
  .cabinet__foot { display: block; line-height: 1.5; }
  .status { margin-top: 4px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .screen::after { display: none; }
}
