:root {
  color-scheme: dark;
  --base: #2c1b2b;
  --surface: #392432;
  --border: #67404b;
  --lime: #e1edaa;
  --coral: #ff805e;
  --muted: #d4bcb0;
  --sport: Impact, Haettenschweiler, 'Arial Narrow', 'Franklin Gothic Medium', sans-serif;
  font-family: system-ui, sans-serif;
  color: var(--lime);
  background: var(--base);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; display: grid; align-items: center; }
[hidden] { display: none !important; }
.cabinet {
  width: min(100%, 1160px, calc(max(460px, 100svh - 111px) * 1.54));
  margin-inline: auto; padding: 11px 14px 12px; container-type: inline-size;
}
.hud { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: clamp(8px, 2vw, 23px); margin-bottom: 10px; }
h1, h2 { font-family: var(--sport); font-style: italic; font-weight: 900; line-height: .98; text-transform: uppercase; }
h1 { margin: 0; display: flex; align-items: center; gap: 9px; font-size: clamp(20px, 4.2cqw, 47px); letter-spacing: .012em; }
h1 svg { flex: 0 0 auto; width: clamp(20px, 4cqw, 42px); height: auto; color: var(--coral); }
h1 em { color: var(--coral); }
.times { display: flex; gap: clamp(9px, 2cqw, 24px); margin: 0; }
.times div + div { border-left: 1px solid var(--border); padding-left: clamp(9px, 2cqw, 24px); }
dt, .track-label, .manual-title, button { font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
dt { color: var(--muted); font-size: 10px; margin-bottom: 1px; }
dd { margin: 0; font: 800 clamp(13px, 2.3cqw, 25px)/1 ui-monospace, monospace; letter-spacing: -.07em; white-space: nowrap; }
.times div:first-child dd, .times div:last-child dd { min-width: 8ch; }
button { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: inherit; cursor: pointer; font-family: inherit; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 2px solid white; outline-offset: 3px; }
.restart { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 10px; font-size: 10px; }
.restart svg, .pads svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.restart:hover, .pads button:hover { border-color: var(--lime); }
.stage { position: relative; isolation: isolate; overflow: hidden; border: 3px solid var(--lime); border-radius: clamp(10px, 2cqw, 23px); background: #e69854 url('terrain.jpg') center / cover; }
canvas { display: block; width: 100%; height: auto; }
.track-label { position: absolute; top: 12px; left: 12px; font-size: clamp(8px, 1.15cqw, 13px); line-height: 1.6; padding: 3px 8px; border-radius: 4px; color: #fff0ca; background: #402a33; }
.track-label span { margin-right: .35em; color: var(--coral); }
.panel { position: absolute; top: 57%; left: 50%; transform: translate(-50%, -50%); width: max-content; max-width: 86%; padding: clamp(10px, 2.7cqw, 25px) clamp(13px, 3.5cqw, 40px); text-align: center; background: #2c1b2b; border: 1px solid #925847; border-radius: clamp(8px, 1.3cqw, 15px); box-shadow: 0 7px 0 #2c1b2b55; }
.panel h2 { margin: 0; font-size: clamp(20px, 4.3cqw, 42px); }
.panel p { margin: 6px 0 11px; color: var(--muted); font-size: clamp(11px, 1.55cqw, 14px); }
.start { background: var(--coral); border-color: #ffab87; color: var(--base); min-height: 40px; padding: 0 15px; font-size: clamp(10px, 1.4cqw, 13px); }
.start:hover { background: #ffa585; }
.count, .hint { position: absolute; left: 50%; transform: translateX(-50%); background: var(--base); border: 1px solid #925847; border-radius: 7px; text-transform: uppercase; white-space: nowrap; }
.count { top: 48%; padding: 0 .28em .05em; font: italic 900 clamp(35px, 9cqw, 92px)/1.08 var(--sport); }
.hint { bottom: 4%; padding: 5px 10px; color: var(--coral); font-weight: 900; letter-spacing: .12em; font-size: clamp(8px, 1.4cqw, 13px); }
.manual { display: flex; gap: clamp(12px, 3cqw, 39px); justify-content: center; align-items: center; margin-top: 11px; color: var(--muted); font-size: clamp(11px, 1.5cqw, 14px); }
.manual-title { color: var(--coral); font-style: italic; }
.manual kbd { display: inline-grid; place-items: center; min-width: 24px; min-height: 22px; padding: 0 3px; border: 1px solid #7f765b; border-radius: 4px; color: var(--lime); font: inherit; font-weight: 850; }
.pads { display: none; justify-content: space-between; gap: 8px; margin-top: 9px; }
.pad-group { display: flex; gap: 6px; }
.pads button { display: grid; place-items: center; min-height: 48px; min-width: clamp(44px, 10cqw, 72px); padding: 0 8px; font-size: clamp(10px, 1.7cqw, 14px); touch-action: none; user-select: none; }
.pads .boost { color: var(--base); background: var(--coral); border-color: #ffab87; }
.pads button.is-held { color: var(--base); background: var(--lime); border-color: var(--lime); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@container (max-width: 625px) {
  .hud { grid-template-columns: 1fr auto; gap: 8px 6px; }
  .times { grid-column: 1 / 3; grid-row: 2; justify-content: space-between; }
  .times div { flex: 1; }
  .times div:last-child { text-align: right; }
  .restart { grid-column: 2; grid-row: 1; min-height: 34px; }
  .alternate { display: none; }
}
@media (pointer: coarse), (max-width: 700px) {
  .cabinet { padding: 9px 8px; }
  .manual { display: none; }
  .pads { display: flex; }
}
@media (pointer: coarse) and (orientation: landscape) {
  .cabinet { width: min(100%, max(330px, calc((100svh - 113px) * 1.54))); }
}
@media (max-width: 342px) {
  .restart span { display: none; }
}
