:root {
  --bg: #15171e;
  --panel: #20232d;
  --line: #373c48;
  --ice: #afdcec;
  --salmon: #ffb190;
  --muted: #b1b7c4;
}
body::before { background-image: radial-gradient(#b2c5d50f 0.8px, transparent 1px); background-size: 6px 6px; }
.topbar { background: #191b23; }
.brand, .nav-item { text-decoration: none; color: inherit; }
.game-intro { padding-block: clamp(22px, 3vw, 40px) 24px; }
.game-intro h1 { color: #f4f2e9; text-shadow: 0 3px #747d93; letter-spacing: .012em; }
.game-intro p { color: #b9c0cb; }
.platform { background: #29323e; color: #c5e4f2; border-color: #465b6c; }
.location { display: flex; gap: 14px; align-items: center; padding-right: 2px; }
.location svg { width: 49px; height: 38px; }
.location b, .location small { display: block; }
.location b { font: normal 1.25rem var(--pixel); letter-spacing: .04em; color: #dce8f1; }
.location small { font: .73rem var(--mono); letter-spacing: .13em; color: #a9b2c2; margin-top: 4px; }
.venue-layout { display: grid; grid-template-columns: minmax(0, 1fr) clamp(250px, 25vw, 323px); gap: 20px; align-items: start; padding-bottom: 32px; }
.cabinet, .program, .bindings-panel, .options { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.feed-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: #252933; border-bottom: 1px solid #404550; }
.feed-bar span { color: #bdc6d4; display: inline-flex; align-items: center; gap: 9px; font: .72rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .075em; }
.feed-bar i { width: 7px; height: 7px; background: var(--ice); display: block; }
.feed-bar b { font-weight: 600; color: #eef2f7; }
.feed-bar span:first-child { min-width: 0; margin-right: 9px; }
.feed-bar i, #top-score { flex-shrink: 0; }
#mode-label { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.commentary strong, .score-table td { overflow-wrap: anywhere; }
.screen { aspect-ratio: 2; background: #151c2b; }
.preview { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(0deg,#0b122bc9 0%,transparent 46%); }
.preview.poster { background: linear-gradient(0deg,#0b122b70,transparent 37%), url("./alpine.webp") center / cover no-repeat; }
.event-caption { position: absolute; left: clamp(16px,3.1vw,48px); bottom: clamp(14px,2.6vw,38px); }
.event-caption span { display: inline-block; padding: 4px 7px; background: #162139; color: #d0edfa; font: 650 .70rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; border-left: 3px solid var(--salmon); }
.event-caption h2 { color: #fff2d9; font: normal clamp(1.65rem,3.5vw,3.55rem)/1.15 var(--pixel); text-shadow: 0 3px #5c5365, 2px 4px #16192c; margin: 6px 0 0; text-transform: uppercase; }
.screen-message { background: #10172bbf; }
.screen-message .eyelabel { color: var(--salmon); }
.commentary { min-height: 64px; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 13px; border-top: 1px solid #424653; }
.commentary .eyelabel { color: var(--ice); font-size: .68rem; text-transform: uppercase; margin-bottom: 5px; }
.commentary strong { display: block; font-size: .93rem; line-height: 1.35; font-weight: 510; }
#gauge-box { width: clamp(82px,24%,190px); flex: none; text-align: right; }
#clock { display: block; font: .77rem var(--mono); font-variant-numeric: tabular-nums; color: #ced7e6; margin-bottom: 4px; }
.gauge { position: relative; height: 9px; background: #414a5d; border-radius: 2px; }
.gauge i, .gauge b { position: absolute; height: 100%; left: 0; }
.gauge i { background: #579bad; }
.gauge b { background: #fff2d9; width: 3px; top: -2px; height: 13px; transform: translateX(-50%); }
.transport { min-height: 61px; background: #242731; border-color: var(--line); }
.primary { background: var(--salmon); border-color: #ffc5a9; color: #30201e; }
.primary:hover { background: #ffc5ae; }
.utility { color: #e3e7ef; border-color: #4d5362; background: #2b2f3b; }
.end-tools { margin-left: auto; display: flex; }
.end-tools button { border: 1px solid #454b59; margin-left: 5px; }
.panel-title { padding: 15px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.panel-title h2, .records-link { display: flex; gap: 10px; align-items: center; }
.panel-title h2 { font-size: 1.02rem; }
.panel-title h2 .icon, .records-link .icon { color: var(--ice); }
.event-count { font: .72rem var(--mono); color: #afb9ca; }
#event-list { padding: 6px 7px; }
.event-row { position: relative; width: 100%; text-align: left; border: 1px solid transparent; border-radius: 4px; background: transparent; padding: 7px 9px; display: flex; align-items: center; gap: 12px; color: #d5dae3; font: 560 .92rem var(--sans); }
.event-row:hover { background: #2b303c; }
.event-row[aria-pressed=true] { background: #2d3b48; border-color: #506b80; color: #eff8ff; }
.event-row[aria-pressed=true]::after { content: ""; margin-left: auto; width: 6px; height: 6px; background: var(--ice); }
.event-row:disabled { opacity: .82; }
.event-row canvas { width: 38px; height: 32px; flex: none; image-rendering: pixelated; border-radius: 2px; }
.records-link, .text-button { font: 600 .83rem var(--sans); background: transparent; color: #c4dfec; border: 0; }
.records-link { border-top: 1px solid var(--line); width: 100%; padding: 13px 17px; }
.records-link:hover, .text-button:hover { background: #29323d; color: white; }
.options { padding: 11px 15px; color: #c7ceda; font-size: .86rem; }
.options label { display: flex; align-items: center; gap: 9px; cursor: pointer; }
input { accent-color: var(--ice); }
.bindings-panel { margin-top: 15px; }
.bindings-panel .panel-title { padding: 11px 16px; border-bottom: 0; }
.text-button { padding: 4px 0 4px 6px; }
#bindings { display: flex; align-items: center; gap: 9px 20px; flex-wrap: wrap; padding: 0 16px 15px; }
.binding { display: flex; align-items: center; gap: 7px; font-size: .82rem; color: #c5cbd7; }
kbd { background: #303542; border-color: #51596b; color: #e6eaf1; }
.touch-controls { align-items: center; padding: 7px 12px; border-color: var(--line); background: #1e222c; }
.touch-controls .fire small { display:block; font: .68rem/1.25 var(--mono); }
.touch-controls .fire { background: #6b493e; color: #ffe2c8; min-width: 64px; }
.dpad:not(.eight) .diagonal { display: none; }
.dpad.eight { display: grid; grid-template-columns: repeat(3, 43px); grid-template-rows: repeat(3, 36px); }
.dpad.eight button { min-height: 0; }
.dpad.eight [data-action=right] { grid-column: 3; }
.dpad:not(.eight) [data-action=left] { order: -1; }
.dpad:not(.eight) [data-action=right] { order: 1; }
#race-pad>div { display: flex; align-items: center; gap: 4px; }
#race-pad span { font: .7rem var(--mono); margin-right: 4px; }
@media (max-width: 400px) { #race-pad span { max-width: 4ch; } }
.touch-controls button[aria-pressed=true] { background: #51657c; }
dialog { width: min(550px,calc(100% - 24px)); background: #20242f; }
dialog :is(select,input[type=text]) { color: var(--text); background: #171c26; border: 1px solid #50586b; border-radius: 4px; min-height: 36px; font: inherit; padding: 5px 8px; }
dialog fieldset { border: 1px solid #434a59; border-radius: 4px; margin: 15px 0 0; }
dialog legend { color: var(--ice); padding: 0 4px; font-weight: 600; }
dialog fieldset label { display: inline-flex; align-items: center; gap: 5px; margin: 4px 9px 4px 0; font-size: .88rem; }
.athlete-row { display: grid; grid-template-columns: minmax(90px,1fr) minmax(110px,1fr) auto; gap: 6px; margin: 8px 0; }
.athlete-row input,.athlete-row select { min-width: 0; width: 100%; }
.ceremony-option { display: flex; align-items: center; gap: 7px; margin: 15px 0 0; font-size: .9rem; }
.ceremony-scene { display: block; width: 100%; height: auto; image-rendering: pixelated; margin: 14px 0; }
.dialog-actions { gap: 8px; flex-wrap: wrap; }
.score-table { width: 100%; border-collapse: collapse; margin: 14px 0; text-align: left; font-size: .87rem; }
.score-table th,.score-table td { padding: 7px 4px; border-bottom: 1px solid var(--line); }
.score-table td:last-child { text-align: right; color: #e7cdac; }
.cabinet:is(:fullscreen,.expanded) .screen { width: min(100%,calc((100dvh - 190px)*2)); }
@media (max-width: 890px) { .venue-layout { grid-template-columns: minmax(0,1fr) 225px; gap: 13px; } .event-row { gap: 8px; } }
@media (max-width: 730px) {
  .venue-layout { grid-template-columns: minmax(0,1fr); }
  .transport { flex-wrap:wrap; }
  .rail { display: block; } .options { margin-top: 12px; }
  #event-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 2px; }
  .location { display: none; }
  .touch-controls:not([hidden]) { display: flex; }
  .cabinet:is(:fullscreen,.expanded) .screen { width: min(100%,calc((100dvh - 226px)*2)); }
}
@media (pointer: coarse) { .cabinet:is(:fullscreen,.expanded) .screen { width: min(100%,calc((100dvh - 226px)*2)); } }
@media (max-width: 480px) {
  .game-intro { padding: 18px 0 16px; } .game-intro h1 { margin-block: 10px 5px; }
  .feed-bar { padding: 7px 10px; } .feed-bar span { font-size: .63rem; }
  .commentary { min-height: 56px; padding: 9px 11px; }
  .commentary strong { font-size: .84rem; } .transport { min-height: 49px; }
  .event-row { font-size: .81rem; padding: 5px; }
  .event-row canvas { width: 30px; height: 26px; }
  .event-caption { left: 14px; bottom: 12px; }
  .event-caption span { font-size: .58rem; }
  .sound { min-width: 32px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .cabinet:not(:fullscreen):not(.expanded) .screen { width: min(100%,calc((100svh - 205px)*2)); margin: auto; }
  .cabinet .transport { min-height: 40px; padding-block: 4px; }
  .cabinet .commentary { min-height: 38px; padding-block: 4px; }
  .dpad.eight { display: flex; }
  .dpad.eight button { min-width: 35px; min-height: 40px; }
}
