:root {
  color-scheme: dark;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  background: #0c1116;
  color: #d9e5e8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --muted: #75888d;
  --line: #26343a;
  --mint: #8df0c5;
  --orange: #ffad66;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: radial-gradient(ellipse at 53% 40%, #152126 0, #0c1116 68%); }
button, a { font: inherit; }
button { color: inherit; }
.topbar { height: 58px; padding-inline: clamp(18px, 4vw, 54px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); color: #91a2a5; font-size: 10px; letter-spacing: .1em; }
.wordmark { color: var(--mint); font-size: 13px; font-weight: 800; letter-spacing: .05em; text-decoration: none; }
.wordmark span { color: var(--muted); font-size: 10px; font-weight: 400; }
.topbar-right { display: flex; align-items: center; gap: 9px; }
.demo-link { margin-right: 14px; color: var(--mint); font-size: 8px; letter-spacing: .09em; text-decoration: none; }
.demo-link:hover { color: #d1ffe8; }
.live-dot, .record-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px #8df0c577; }

.layout { width: min(1260px, calc(100% - 48px)); margin: 44px auto 38px; display: grid; grid-template-columns: minmax(0, 1fr) 255px; gap: 30px; }
.stage-column { min-width: 0; }
.stage-heading { min-height: 71px; margin-bottom: 17px; display: flex; align-items: center; justify-content: space-between; }
.eyebrow { margin: 0 0 10px; color: var(--mint); font-size: 9px; letter-spacing: .13em; }
h1 { margin: 0; color: #edf5f4; font-family: ui-sans-serif, system-ui, sans-serif; font-size: clamp(25px, 4vw, 34px); font-weight: 550; letter-spacing: -.045em; }
.reset-button { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); background: #121b20; color: #a6b6b8; font-size: 9px; letter-spacing: .09em; cursor: pointer; }
.reset-button:hover { border-color: #506367; color: var(--mint); }
kbd { min-width: 21px; height: 21px; padding: 3px 5px; display: inline-grid; place-items: center; border: 1px solid #43545a; border-bottom-width: 2px; border-radius: 3px; color: #c9d6d6; font: inherit; font-size: 9px; line-height: 1; }

.viewport-frame { position: relative; overflow: hidden; border: 1px solid #324349; background: #17232a; box-shadow: 0 20px 80px #0005; aspect-ratio: 16 / 9; }
#game { width: 100%; height: 100%; display: block; outline: none; cursor: crosshair; }
.viewport-frame:fullscreen { width: 100vw; height: 100vh; aspect-ratio: auto; }
.viewport-frame:fullscreen #game { width: 100%; height: 100%; }
.viewport-top { position: absolute; inset: 12px 14px auto; display: flex; justify-content: space-between; color: #d5e2df; font-size: 8px; letter-spacing: .11em; pointer-events: none; text-shadow: 0 1px 4px #000; }
.viewport-top > span:first-child { display: flex; align-items: center; gap: 7px; }
.record-dot { width: 6px; height: 6px; background: #ff776a; box-shadow: 0 0 9px #ff776a88; }
.crosshair { position: absolute; top: 50%; left: 50%; width: 13px; height: 13px; transform: translate(-50%, -50%); opacity: .8; pointer-events: none; }
.crosshair i, .crosshair b { position: absolute; display: block; background: #e9f7e8; box-shadow: 0 0 3px #182020; }
.crosshair i { top: 6px; left: 1px; width: 11px; height: 1px; }
.crosshair b { top: 1px; left: 6px; width: 1px; height: 11px; }
.start-overlay { position: absolute; inset: 0; width: 100%; display: grid; align-content: center; justify-items: center; gap: 10px; border: 0; background: #07101475; cursor: pointer; transition: background .15s; }
.start-overlay:hover { background: #07101458; }
.start-icon { width: 39px; height: 39px; display: grid; place-items: center; padding-left: 3px; border: 1px solid #8df0c599; border-radius: 50%; color: var(--mint); font-size: 13px; }
.start-title { color: #f1f7f3; font-size: 10px; letter-spacing: .16em; }
.start-hint { color: #b5c2bd; font-size: 9px; }
.start-overlay[hidden] { display: none; }
.toast { position: absolute; bottom: 13px; left: 50%; padding: 7px 10px; transform: translate(-50%, 8px); opacity: 0; background: #0c1419e8; color: var(--orange); font-size: 9px; pointer-events: none; transition: .18s; }
.toast.visible { transform: translate(-50%, 0); opacity: 1; }

.controls-strip { min-height: 74px; display: flex; align-items: center; gap: clamp(18px, 4vw, 43px); border-bottom: 1px solid var(--line); }
.control-group { display: flex; align-items: center; gap: 9px; }
.control-label { color: var(--muted); font-size: 8px; letter-spacing: .1em; }
.key-cluster { width: 60px; display: grid; justify-items: center; gap: 3px; }
.key-cluster > span { display: flex; gap: 3px; }
.key-cluster kbd { min-width: 18px; height: 17px; padding: 1px 3px; font-size: 8px; }
.mouse-glyph { color: var(--mint); font-size: 20px; }
.control-copy { color: #c9d6d6; font-size: 8px; }
.wide-key { min-width: 54px; height: 19px; font-size: 7px; }
.release-hint { margin-left: auto; color: var(--muted); font-size: 8px; }
.release-hint kbd { min-width: auto; height: 18px; margin-right: 4px; font-size: 7px; }

.instrument-panel { min-width: 0; border-left: 1px solid var(--line); }
.panel-block { padding: 5px 0 21px 20px; border-bottom: 1px solid var(--line); }
.panel-block + .panel-block { padding-top: 20px; }
.metric { min-height: 39px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #202c31; color: #8b9b9f; font-size: 8px; letter-spacing: .06em; }
.metric:last-child { border-bottom: 0; }
.metric strong { color: #e2ece9; font-size: 13px; font-weight: 450; letter-spacing: .01em; }
.metric small { color: var(--muted); font-size: 8px; }
.map-heading { display: flex; align-items: start; justify-content: space-between; }
.map-heading > span { color: var(--muted); font-size: 7px; letter-spacing: .08em; }
#map { width: 100%; display: block; border: 1px solid #27373c; background: #111b20; image-rendering: pixelated; }
.map-caption { margin: 9px 0 0; color: var(--muted); font-size: 7px; letter-spacing: .07em; }
.map-caption i { width: 6px; height: 6px; margin-right: 4px; display: inline-block; border-radius: 50%; background: var(--orange); }
.map-caption span { padding-inline: 5px; color: #435459; }
.about-block > p:not(.eyebrow) { margin: 0 0 15px; color: #9babad; font-family: ui-sans-serif, system-ui, sans-serif; font-size: 11px; line-height: 1.65; }
.spec-row { min-height: 25px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 7px; letter-spacing: .06em; }
.spec-row strong { color: #c4d2cf; font-size: 8px; font-weight: 450; }
.panel-footer { padding: 13px 0 0 20px; color: #506166; font-size: 7px; letter-spacing: .08em; }

@media (max-width: 800px) {
  .layout { width: min(100% - 32px, 680px); margin-top: 27px; grid-template-columns: 1fr; gap: 22px; }
  .instrument-panel { display: grid; grid-template-columns: 1fr 1fr; border-left: 0; border-top: 1px solid var(--line); }
  .panel-block { padding-left: 0; }
  .panel-block + .panel-block { padding-top: 5px; }
  .panel-block:nth-child(2) { padding-left: 18px; border-left: 1px solid var(--line); }
  .about-block { grid-column: 1 / -1; padding-top: 18px !important; }
  .panel-footer { grid-column: 1 / -1; padding: 12px 0; }
}
@media (max-width: 520px) {
  .topbar { height: 50px; padding-inline: 15px; }
  .layout { width: calc(100% - 24px); margin-top: 18px; }
  .viewport-frame { aspect-ratio: 4 / 3; }
  .controls-strip { justify-content: space-between; gap: 6px; }
  .control-group { gap: 5px; }
  .control-label { font-size: 7px; }
  .release-hint { font-size: 0; }
  .release-hint kbd { font-size: 7px; }
  .instrument-panel { grid-template-columns: 1fr; }
  .panel-block:nth-child(2) { padding: 18px 0 21px; border-left: 0; }
  .about-block { grid-column: auto; padding-top: 18px !important; }
}
