:root {
  --bg: #07080a; --panel: #0f1115; --panel2: #151820; --line: #262a33; --text: #f3f4f6; --muted: #9ba1ad; --dim: #9ba1ad;
  --same: #2fd47f; --diff: #ff574d; --wait: #f0b54a; --own: #f0b54a; --same2: #147548;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
}
* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--sans); overflow-x: hidden; }
a { color: var(--text); text-underline-offset: 3px; }
code { font: 0.92em var(--mono); color: #cfd3da; overflow-wrap: anywhere; }
kbd { font: 600 0.85em var(--mono); background: var(--panel2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px; color: var(--text); }
[hidden] { display: none !important; }

.top, .stage, .band { max-width: 1840px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.top { padding-top: 26px; padding-bottom: 14px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); column-gap: 40px; align-items: end; }
.kicker { grid-column: 1 / -1; margin: 0 0 10px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; font-size: 13px; color: var(--same); }
.kicker span { color: var(--muted); font-weight: 600; letter-spacing: 0.04em; text-transform: none; margin-left: 10px; }
h1 { margin: 0; font-size: clamp(32px, 4vw, 64px); line-height: 1.02; font-weight: 900; letter-spacing: -0.035em; }
.idea { margin: 0 0 6px; font-size: clamp(16px, 1.45vw, 21px); line-height: 1.4; color: #d5d8de; max-width: 46ch; }

/* ---- consoles ---- */
.stage { padding-top: 8px; padding-bottom: 28px; }
.panes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.panes[data-count="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pane { min-width: 0; }
.pane > header { display: flex; align-items: baseline; gap: 12px; border-top: 3px solid var(--text); padding: 6px 0 8px; }
.year { font-size: 34px; line-height: 1; font-weight: 900; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.name { font-size: 15px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.name small { font-size: 11px; letter-spacing: 0.08em; color: var(--wait); border: 1px solid currentColor; border-radius: 3px; padding: 1px 5px; margin-left: 4px; white-space: nowrap; }
.screen { position: relative; display: grid; place-items: center; background: #000; border: 1px solid var(--line); aspect-ratio: 16 / 15; overflow: hidden; }
.target { display: block; background: #000; max-width: 100%; }
.target.pixel { image-rendering: pixelated; image-rendering: crisp-edges; image-rendering: pixelated; }
.target.frame { position: relative; }
.target.frame iframe { position: absolute; inset: 0; }
.pane-msg { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; text-align: center; padding: 18px; font-size: 14px; color: var(--muted); pointer-events: none; }
.pane-msg:empty { display: none; }
.pane[data-state="error"] .screen { border-color: var(--diff); }
.pane[data-state="error"] .target { visibility: hidden; }
.pane[data-state="error"] .pane-msg { color: #ffb1ac; background: #1a0c0b; }
.what { margin: 10px 0 0; font-size: 14.5px; line-height: 1.4; color: #dfe2e7; }
.exact { margin: 6px 0 0; font-size: 11.5px; line-height: 1.4; color: var(--dim); }

/* ---- counter and controller ---- */
.stage { display: flex; flex-direction: column; }
.deck { display: contents; }   /* wide screens: the counter sits above the consoles, the controller below them */
.verdict { order: -1; border-left: 8px solid var(--dim); padding: 10px 0 10px 16px; min-width: 0; margin: 0 0 16px; background: var(--panel); }
.pad { margin-top: 18px; padding: 14px 18px; background: var(--panel); border: 1px solid var(--line); justify-content: center; }
.verdict-text { margin: 0; font-size: clamp(20px, 2.5vw, 34px); line-height: 1.12; font-weight: 900; letter-spacing: -0.02em; }
.verdict-sub { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.verdict-sub:empty { display: none; }
.verdict[data-status="same"] { border-color: var(--same); } .verdict[data-status="same"] .verdict-text { color: var(--same); }
.verdict[data-status="differs"] { border-color: var(--diff); } .verdict[data-status="differs"] .verdict-text { color: var(--diff); font-size: clamp(17px, 1.9vw, 26px); }
.verdict[data-status="waiting"], .verdict[data-status="loading"] { border-color: var(--wait); } .verdict[data-status="waiting"] .verdict-text, .verdict[data-status="loading"] .verdict-text { color: var(--wait); }

.pad { display: flex; align-items: center; gap: 22px; user-select: none; -webkit-user-select: none; }
.pad button { font: 800 16px var(--sans); color: var(--text); background: var(--panel2); border: 1px solid #3a3f4b; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; padding: 0; }
.pad button:hover { border-color: #6a7080; }
.pad button:active, .pad button.lit { background: var(--text); color: #000; border-color: var(--text); }
.pad button:focus-visible, .act:focus-visible { outline: 2px solid var(--same); outline-offset: 2px; }
.dpad { display: grid; grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(3, 44px); }
.dpad button { font-size: 15px; }
.dpad [data-b="up"] { grid-area: 1 / 2; border-radius: 6px 6px 0 0; }
.dpad [data-b="left"] { grid-area: 2 / 1; border-radius: 6px 0 0 6px; }
.dpad [data-b="right"] { grid-area: 2 / 3; border-radius: 0 6px 6px 0; }
.dpad [data-b="down"] { grid-area: 3 / 2; border-radius: 0 0 6px 6px; }
.pad .start { height: 34px; padding: 0 16px; border-radius: 17px; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.ab { display: flex; gap: 12px; }
.ab button { width: 56px; height: 56px; border-radius: 50%; font-size: 19px; }
.ab [data-b="a"] { margin-top: -18px; } .ab [data-b="b"] { margin-top: 18px; }

.under { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 32px; }
.keys { margin: 0; font-size: 14.5px; color: #d5d8de; }
.keys b { color: var(--text); }
.bot { margin: 0; font-size: 14.5px; color: var(--muted); padding-left: 14px; border-left: 3px solid var(--line); align-self: start; }
.bot[data-on="1"] { color: var(--text); border-color: var(--same); }
.actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.act { font: inherit; color: var(--text); background: transparent; border: 1px solid #3a3f4b; padding: 9px 14px; cursor: pointer; text-align: left; display: flex; flex-direction: column; min-width: 0; touch-action: manipulation; }
.act b { font-size: 15px; font-weight: 800; letter-spacing: 0.02em; }
.act span { font-size: 12.5px; color: var(--muted); }
.act:hover { border-color: var(--text); }
.act.danger { border-color: var(--diff); } .act.danger b { color: var(--diff); }
.act[aria-pressed="true"] { border-color: var(--wait); }
.act:disabled { opacity: 0.4; cursor: default; }
.fine { grid-column: 1 / -1; margin: 6px 0 0; font-size: 12.5px; color: var(--dim); }

/* ---- lower sections ---- */
.band { padding-top: 44px; padding-bottom: 8px; border-top: 1px solid var(--line); }
.band > * { max-width: 1040px; }
h2 { margin: 0 0 12px; font-size: clamp(26px, 3.2vw, 42px); line-height: 1.02; font-weight: 900; letter-spacing: -0.035em; }
h3 { margin: 34px 0 10px; font-size: 13px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.lead { margin: 0 0 20px; font-size: clamp(16px, 1.35vw, 19px); color: #d5d8de; max-width: 68ch; }
.small { font-size: 13px; color: var(--muted); max-width: 86ch; }
.bars { display: grid; gap: 10px; margin: 6px 0 12px; }
.bar-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 10px; }
.bar-name { font-weight: 900; letter-spacing: 0.08em; font-size: 14px; }
.bar { display: flex; height: 38px; width: calc(var(--total) / 591 * 100%); gap: 2px; }
.bar i { flex: var(--n) 0 0; min-width: 0; font: 800 12.5px/38px var(--sans); color: #06120b; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.bar .same { background: var(--same); } .bar .same2 { background: var(--same2); color: #eafff3; padding: 0 2px; text-align: center; } .bar .own { background: var(--own); color: #1b1200; }
.legend { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.key { display: inline-block; width: 11px; height: 11px; margin: 0 6px 0 14px; vertical-align: -1px; }
.key:first-child { margin-left: 0; }
.key.same { background: var(--same); } .key.same2 { background: var(--same2); } .key.own { background: var(--own); }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: none; }
.timeline li { position: relative; padding: 9px 0 9px 26px; border-left: 2px solid var(--line); margin-left: 6px; font-size: 15px; color: #d5d8de; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 15px; width: 12px; height: 12px; border-radius: 50%; background: var(--dim); }
.timeline li.bad::before { background: var(--diff); } .timeline li.good::before { background: var(--same); } .timeline li.diag::before { background: var(--wait); }
.timeline b { color: var(--text); }

.facts { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.facts li { padding-left: 16px; border-left: 2px solid var(--line); font-size: 15px; color: #d5d8de; }
.facts b { color: var(--text); }
.limits li { border-color: var(--wait); }
.really { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; font-size: 14px; }
.really dt { font-weight: 900; letter-spacing: 0.06em; }
.really dd { margin: 0; color: #d5d8de; font-family: var(--mono); font-size: 13px; }
.eng { padding-bottom: 64px; }

/* ---- narrow screens: stack the consoles, keep the controller on screen ---- */
@media (max-width: 859px) {
  .top, .stage, .band { padding-left: 16px; padding-right: 16px; }
  .top { display: block; padding-top: 18px; }
  .kicker span { display: block; margin: 2px 0 0; }
  .idea { margin-top: 12px; }
  .panes, .panes[data-count="4"] { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .screen { aspect-ratio: auto; padding: 0; }
  .deck { display: grid; position: sticky; bottom: 0; z-index: 5; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 18px -16px 0; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); border-width: 1px 0 0; background: #0c0e12; }
  .verdict { order: 0; border-left-width: 6px; padding: 2px 0 2px 10px; margin: 0; background: none; }
  .pad { margin: 0; padding: 0; background: none; border: 0; }
  .verdict-text, .verdict[data-status="differs"] .verdict-text { font-size: 17px; line-height: 1.2; }
  .verdict-sub { display: none; }
  .pad { justify-content: space-between; gap: 8px; }
  .dpad { grid-template-columns: repeat(3, 40px); grid-template-rows: repeat(3, 40px); }
  .ab button { width: 54px; height: 54px; }
  .under { grid-template-columns: minmax(0, 1fr); }
  .actions { flex-direction: column; }
  .bar i { font-size: 11px; padding: 0 5px; }
  .bar-row { grid-template-columns: 44px minmax(0, 1fr); }
  .really { grid-template-columns: minmax(0, 1fr); gap: 2px; } .really dd { margin-bottom: 10px; }
}
@media (min-width: 860px) and (max-width: 1100px) {
  .panes[data-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.technical { margin-top: 8px; color: var(--muted); font-size: 12px; }
.technical summary { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.site-nav { display: flex; flex-wrap: wrap; gap: 12px 24px; padding: 10px 24px; border-bottom: 1px solid var(--line); font-size: 14px; }
.site-nav a { min-height: 44px; display: inline-flex; align-items: center; }
.skip { position: absolute; left: 16px; top: -100px; padding: 12px; background: var(--panel); z-index: 10; }
.skip:focus { top: 8px; }
.eng > p { max-width: 86ch; }

.system-buttons { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pad .pause { min-width: 86px; min-height: 34px; padding: 0 12px; border-radius: 6px; font-size: 12px; }
.pad .pause[aria-pressed="true"] { border-color: var(--wait); color: var(--wait); }

/* Intentional keyboard control and first-visit guidance. */
.first-steps { margin: 0 0 16px; color: #d5d8de; max-width: 100ch; }
.panes:focus-visible { outline: 3px solid var(--same); outline-offset: 5px; }
.take-control { min-height: 44px; margin: 0 4px; padding: 0 12px; border: 1px solid var(--same); border-radius: 6px; background: var(--panel); color: var(--text); font: 700 14px var(--sans); cursor: pointer; }
.take-control:focus-visible { outline: 2px solid var(--same); outline-offset: 3px; }
