:root {
  color-scheme: dark;
  --bg: #152635;
  --surface: #263d4d;
  --ink: #f1f4f3;
  --muted: #a1b3bf;
  --accent: #e99542;
  --line: #3e5666;
  --steel: #b8c9d1;
  --topbar-h: 40px;
  --dock-h: 64px;
  --display: "Bahnschrift SemiCondensed", "Bahnschrift", "Arial Narrow", sans-serif;
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: var(--bg); color: var(--ink); }
button, a, select, canvas { -webkit-tap-highlight-color: transparent; }
button, select { font: inherit; }
button { cursor: pointer; transition: background .16s, border-color .16s, transform .16s; }
button:disabled { cursor: wait; opacity: .6; }
button:active { transform: translateY(1px); }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 2px solid #f7ba79; outline-offset: 3px; }
[hidden] { display: none !important; }
.app { height: 100vh; height: 100dvh; display: grid; grid-template-rows: var(--topbar-h) minmax(0, 1fr); }
.topbar { display: flex; align-items: center; gap: 24px; padding: 0 15px; background: #203546; border-bottom: 1px solid #466171; min-width: 0; }
.wordmark { color: var(--ink); text-decoration: none; font-family: var(--display); font-size: 25px; font-weight: 700; font-stretch: condensed; line-height: 1; letter-spacing: -1px; }
.wordmark:hover { color: #f4b473; }
.track-name { margin: 0; color: #b8c9d1; font-size: 11px; font-weight: 400; white-space: nowrap; }
.controls { display: flex; align-items: center; justify-content: center; gap: 17px; margin-left: auto; }
.controls > span { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
kbd { display: inline-grid; place-items: center; height: 19px; min-width: 20px; padding: 0 5px; color: #e1e8eb; font: 10px "Bahnschrift", "Segoe UI", sans-serif; border: 1px solid #647c89; border-bottom: 2px solid #78909d; border-radius: 3px; background: #304b5e; }
small { font-size: 10px; color: #b1c2cb; }
.toolbar { display: flex; gap: 6px; margin-left: auto; }
.icon-button { display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid #587180; background: transparent; color: #d2dde2; border-radius: 3px; }
.icon-button:hover { background: #39576b; border-color: #8ca4b0; }
.icon-button svg { width: 16px; height: 16px; }
main { display: grid; grid-template-rows: minmax(0, 1fr) var(--dock-h); min-height: 0; }
.race-stage { display: grid; place-items: center; min-height: 0; min-width: 0; padding: 4px 8px; overflow: hidden; }
.game-frame { position: relative; isolation: isolate; overflow: hidden; width: min(100%, calc((100dvh - var(--topbar-h) - var(--dock-h) - 8px) * 1.6)); aspect-ratio: 8 / 5; background: #11232a; outline: 1px solid #49616e; border-radius: 2px; }
canvas { display: block; width: 100%; height: 100%; outline: none; }
.race-footer { height: var(--dock-h); padding: 0 16px; background: #203546; border-top: 1px solid #486171; display: grid; grid-template-rows: 41px 22px; overflow: hidden; }
.hud-row { display: flex; align-items: center; min-width: 0; gap: 26px; }
.in-race-hud { display: flex; align-items: center; gap: 27px; min-width: 0; }
.hud-cell { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.hud-cell > span { font-size: 11px; color: #b5c5ce; }
.hud-cell strong { color: #fff; font-family: var(--display); font-size: 27px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.hud-cell strong span { color: #9aafbb; font-size: 13px; font-weight: 400; margin-left: 3px; }
.hud-time strong { font-size: 25px; }
.pause-button { width: 29px; height: 29px; flex-shrink: 0; background: #304b5e; color: #e9f0f2; border: 1px solid #67818f; border-radius: 3px; }
.pause-button:hover { background: #43667c; }
.speedometer { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.speedometer strong { color: #fff; font-family: var(--display); font-size: 27px; font-weight: 600; line-height: 1; min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.speedometer > span { color: #a8bdc9; font-size: 9px; }
.speed-track { align-self: center; height: 3px; width: 58px; background: #142736; margin-left: 6px; }
.speed-track i { display: block; height: 100%; width: 0; background: var(--accent); }
.best-time { display: flex; align-items: baseline; gap: 12px; margin-left: auto; color: #a9beca; font-size: 11px; white-space: nowrap; }
.best-time strong { color: #fff; font-family: var(--display); font-size: 19px; font-weight: 500; font-variant-numeric: tabular-nums; }
.dock-messages { display: flex; align-items: center; gap: 24px; min-width: 0; overflow: hidden; }
.surface-status, .lap-toast { color: #c7d9e3; font-size: 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.surface-status { flex-shrink: 0; max-width: 60%; }
.surface-status.offroad { color: #f4ba7f; }
.lap-toast { opacity: 0; transition: opacity .2s; }
.lap-toast.show { opacity: 1; }

/* The garage briefing is one designed composition, not a stack of cards. */
.overlay { position: absolute; z-index: 6; inset: 0; display: flex; align-items: safe center; justify-content: center; padding: 4%; background: rgba(13,31,44,.72); pointer-events: none; overflow-y: auto; scrollbar-width: thin; }
.menu-panel { pointer-events: auto; flex-shrink: 0; width: min(900px, 100%); max-height: 100%; overflow-y: auto; scrollbar-width: thin; background: #243e50; box-shadow: 0 20px 65px #06131f80; border: 1px solid #728b99; border-radius: 5px; animation: menu-arrive .35s ease-out both; }
.menu-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 520px; }
.garage-visual { position: relative; display: flex; flex-direction: column; align-items: center; padding: 19px 18px 17px; background: #b8c9d1; color: #233b4b; overflow: hidden; }
.garage-label { align-self: flex-start; font-size: 12px; font-weight: 500; }
.parking-bay { position: relative; width: 170px; height: 304px; margin: 10px auto 8px; display: grid; place-items: center; }
.parking-bay::before { content: ""; position: absolute; inset: 6px 5px; border: 3px solid #e9eff0; border-top: 0; }
.parking-bay::after { content: ""; position: absolute; bottom: -12px; height: 6px; width: 170px; background: repeating-linear-gradient(90deg, #758d9b 0 10px, transparent 10px 20px); }
.parking-bay img { position: relative; display: block; height: 285px; width: auto; max-width: 100%; object-fit: contain; filter: drop-shadow(5px 10px 5px #344c5b55); }
.car-caption { display: flex; align-items: center; gap: 8px; margin-top: 0; padding-top: 14px; font-size: 13px; }
.car-swatch { width: 13px; height: 13px; background: #d6772c; border: 1px solid #b95c1f; border-radius: 50%; }
.vehicle-choices { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; width: 100%; margin-top: auto; padding-top: 17px; }
.vehicle-choice { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-width: 0; min-height: 74px; padding: 6px 2px; border: 1px solid #8096a2; border-radius: 3px; color: #304c5b; background: #c3d1d8; }
.vehicle-choice img { display: block; height: 46px; max-width: 100%; width: auto; object-fit: contain; }
.vehicle-choice span { display: block; max-width: 100%; font-size: 9px; line-height: 1.1; text-align: center; }
.vehicle-choice:hover { border-color: #39596c; background: #d4dfe4; }
.vehicle-choice[aria-pressed="true"] { border-color: #253f51; background: #e6edf0; box-shadow: inset 0 -3px #d47d31; color: #172e3d; }
.vehicle-choice:focus-visible { outline-color: #253f51; outline-offset: 2px; }
.menu-content { padding: 21px 29px 22px; min-width: 0; }
.garage-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.menu-panel h2 { margin: 0 0 14px; font-family: var(--display); font-size: 43px; font-weight: 650; line-height: 1.08; letter-spacing: -1.3px; }
.menu-panel h2 > span { color: inherit; }
.menu-panel h2.game-title { margin: 0; font-size: 60px; font-weight: 700; font-stretch: condensed; letter-spacing: -3px; line-height: 1.05; }
.menu-panel p { color: #becdd5; font-size: 13px; line-height: 1.55; margin: 0; }
.menu-panel p.menu-subtitle { color: #b8cbd6; font-size: 12px; line-height: 1.25; font-weight: 400; white-space: nowrap; }
.vehicle-details h3 { margin: 0 0 5px; color: #f5f7f8; font-family: var(--display); font-size: 26px; font-weight: 600; line-height: 1.1; }
.menu-panel #vehicleDescription { min-height: 35px; font-size: 12px; line-height: 1.45; }
.vehicle-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; margin: 14px 0 0; }
.vehicle-stat { min-width: 0; }
.vehicle-stat dt { color: #bdced8; font-size: 11px; margin-bottom: 4px; }
.vehicle-stat dd { display: flex; align-items: center; gap: 8px; margin: 0; }
.vehicle-stat meter { appearance: none; display: block; width: 100%; min-width: 0; height: 6px; flex: 1; border: 0; background: #152c3c; border-radius: 0; }
.vehicle-stat meter::-webkit-meter-bar { height: 6px; border: 0; background: #152c3c; border-radius: 0; }
.vehicle-stat meter::-webkit-meter-optimum-value { background: #c5d8e2; border-radius: 0; }
.vehicle-stat meter::-moz-meter-bar { background: #c5d8e2; border-radius: 0; }
.vehicle-stat dd > span { min-width: 23px; text-align: right; color: #f1f4f3; font-size: 11px; font-variant-numeric: tabular-nums; }
.menu-panel p.vehicle-mass { margin: 10px 0 15px; color: #8faaba; font-size: 11px; }
.select-label { display: flex; align-items: center; justify-content: space-between; color: #d2dee5; font-size: 12px; gap: 14px; margin-bottom: 15px; }
.select-label select { width: 196px; color: #eef3f5; font-size: 12px; border: 1px solid #829ba9; border-radius: 3px; padding: 10px 30px 10px 11px; background: #355467; }
.primary-button { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 49px; background: #e99542; border: 1px solid #f2aa66; border-bottom: 3px solid #bd6827; border-radius: 3px; padding: 0 18px; color: #192d3c; font-size: 16px; font-weight: 600; gap: 12px; }
.primary-button:hover { background: #f5ae67; }
.primary-button:disabled { background: #b98a5c; }
.primary-button > span:last-child:not(:first-child) { display: none; }
.menu-controls { margin-top: 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; color: #c5d4dc; font-size: 10px; }
.menu-controls > span { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.menu-controls kbd { background: #345367; border-color: #718d9e; min-width: 20px; height: 21px; font-size: 10px; }
.menu-controls kbd:last-of-type { margin-right: 4px; }
.menu-panel p.menu-recovery { margin-top: 11px; color: #91adbd; font-size: 10px; }
.menu-recovery kbd { height: 17px; min-width: 17px; font-size: 9px; margin-right: 5px; }

/* Circuit choice has its own browsable view; the racing canvas stays large. */
.track-chooser { display:flex; align-items:center; justify-content:space-between; gap:14px; width:100%; min-height:53px; padding:9px 11px; margin:0 0 14px; color:#eef3f5; background:#304d61; border:1px solid #678391; border-radius:3px; text-align:left; }
.track-chooser:hover { background:#3b5e75; border-color:#a5bbc8; }
.track-chooser > span:first-child { display:grid; grid-template-columns:auto 1fr; align-items:baseline; gap:3px 11px; min-width:0; }
.track-chooser small { color:#a8bfcd; font-size:10px; }
.track-chooser strong { font-size:14px; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.track-chooser #selectedTrackEnvironment { grid-column:2; color:#a7bdca; font-size:10px; }
.track-chooser #selectedTrackDescription { grid-column:1/-1; color:#bfd0da; font-size:10px; line-height:1.35; margin-top:2px; }
.track-change { color:#d9e6ec; font-size:11px; white-space:nowrap; }
.menu-panel p.selection-notice { margin:0 0 10px; font-size:11px; color:#f4bd86; }
.menu-panel.track-picker:not(:has(.menu-layout)) { width:min(1000px,100%); max-width:none; height:100%; max-height:100%; padding:0; display:flex; flex-direction:column; overflow:hidden; }
.track-picker-head { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:20px 23px 14px; flex-shrink:0; }
.track-picker-head h2 { font-size:32px; margin:0 0 3px; }
.track-picker-head p { font-size:12px; color:#adbfca; }
.picker-back,.track-picker-status button { flex-shrink:0; min-height:36px; padding:0 13px; color:#dce7ec; background:#345369; border:1px solid #718c9c; border-radius:3px; font-size:12px; }
.picker-back:hover,.track-picker-status button:hover { background:#456b82; }
.track-picker-status { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-shrink:0; margin:0 23px; color:#d4e1e8; font-size:12px; }
.track-picker-status:not(:empty) { padding:0 0 12px; }
.track-picker-status.error { color:#ffc28c; }
.track-gallery { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); grid-auto-rows:max-content; align-content:start; gap:14px; padding:2px 23px 22px; min-height:0; overflow-y:auto; scrollbar-width:thin; flex:1; }
.track-card { display:block; min-width:0; padding:0 0 10px; text-align:left; color:#d6e4ec; background:#1c3446; border:1px solid #516d7e; border-radius:3px; overflow:hidden; }
.track-card:hover { border-color:#bed0db; background:#2e4c61; }
.track-card[aria-pressed="true"] { border-color:#f0a65e; box-shadow:inset 0 -3px #e99542; }
.track-card.loading { border-color:#f0a65e; opacity:.6; }
.track-card-image { position:relative; display:block; width:100%; aspect-ratio:8/5; background:#102735; }
.track-card-image img { display:block; width:100%; height:100%; object-fit:cover; }
.track-card-selected { display:none; position:absolute; bottom:7px; right:7px; padding:4px 7px; color:#20323f; background:#f0b274; font-size:10px; }
.track-card-kind { position:absolute; top:7px; left:7px; padding:4px 7px; background:#132a3ae8; color:#f0f5f7; font-size:10px; border:1px solid #adc0cb66; }
.track-card[aria-pressed="true"] .track-card-selected { display:block; }
.track-card-image.preview-unavailable::after { content:"Náhľad nie je dostupný"; position:absolute; inset:0; display:grid; place-items:center; font-size:11px; color:#9bb2c1; }
.preview-unavailable img { visibility:hidden; }
.track-card strong { display:block; padding:10px 10px 3px; color:#f0f5f7; font-size:15px; font-weight:500; }
.track-card-environment { display:block; padding:0 10px; color:#9fb7c6; font-size:11px; }
.menu-panel p.track-no-results { padding:28px 23px; font-size:13px; color:#bacbd5; }

/* Shared dialogue treatment for the JS-generated pause and finish screens. */
.menu-panel:not(:has(.menu-layout)) { max-width: 445px; padding: 30px 34px; }
.menu-panel:not(:has(.menu-layout)) .eyebrow { display: block; margin-bottom: 17px; color: #afc4d0; font-size: 12px; letter-spacing: 0; text-transform: none; }
.menu-panel:not(:has(.menu-layout)) .primary-button { margin-top: 22px; }
.secondary-button { background: #2e4b5f; border: 1px solid #6d8a9c; color: #dce7ed; min-height: 42px; width: 100%; font-size: 13px; margin-top: 10px; border-radius: 3px; }
.secondary-button:hover { background: #3c5f76; border-color: #abc0cc; }
.pause-copy { margin: 0 0 20px !important; }
.result-list { list-style: none; padding: 0; margin: 22px 0 0; }
.result-list li { display: flex; align-items: center; gap: 16px; font-size: 14px; padding: 12px 0; border-bottom: 1px solid #506c7d; font-variant-numeric: tabular-nums; }
.result-list li > span:first-child { color: #95b1c1; min-width: 18px; }
.result-list li > span:last-child { margin-left: auto; color: #a4bdcb; font-family: var(--display); font-size: 18px; }
.result-list li.you { color: #ffbd7d; }
.result-list li.you > span:last-child { color: #ffbd7d; }
.result-list .result-model { display: block; margin-top: 3px; color: #a4bdcb; font-size: 10px; font-weight: 400; }

.countdown { position: absolute; z-index: 3; inset: 0; display: grid; place-items: center; pointer-events: none; font-family: var(--display); font-size: 130px; font-weight: 700; color: #f6f8f9; text-shadow: 0 3px 25px #092231d9; }
.loading-error { position: absolute; z-index: 8; bottom: 20px; left: 5%; right: 5%; color: #fff0e0; background: #874522; padding: 15px; font-size: 13px; }
.restart-prompt { position: absolute; z-index: 5; inset: 0; display: grid; place-items: center; pointer-events: none; padding: 20px; }
.restart-banner { display: flex; align-items: center; gap: 21px; width: min(620px, 95%); padding: 23px 27px; background: #1d3549f5; border: 2px solid #efa65f; border-radius: 4px; box-shadow: 0 7px 35px #041521aa; animation: recovery-pulse 1.4s ease-in-out infinite; }
.recovery-symbol { display: grid; place-items: center; flex-shrink: 0; width: 46px; height: 46px; color: #243e50; background: #efa65f; border-radius: 50%; font-family: var(--display); font-size: 36px; font-weight: 700; }
.restart-banner strong { display: block; color: #fff; font-family: var(--display); font-size: 34px; font-weight: 650; line-height: 1.1; }
.restart-banner p { margin: 7px 0 0; color: #c3d2dc; font-size: 13px; line-height: 1.35; }
.restart-key { display: flex; flex-direction: column; align-items: center; gap: 7px; margin-left: auto; text-align: center; flex-shrink: 0; }
.restart-key kbd { width: max-content; min-width: 46px; white-space: nowrap; padding-inline: 10px; height: 46px; color: #fff; font-size: 29px; background: #36556e; border: 1px solid #9bb6c7; border-bottom: 4px solid #9bb6c7; border-radius: 5px; }
.restart-key span { color: #c9d9e3; font-size: 10px; }
@keyframes recovery-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .48; } }
@keyframes menu-arrive { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1100px) {
  .controls { display: none; }
  .hud-row { gap: 20px; }
  .in-race-hud { gap: 21px; }
}
@media (max-height: 750px) {
  .menu-layout { min-height: 500px; grid-template-columns: 246px minmax(0, 1fr); }
  .garage-visual { padding-top: 17px; padding-bottom: 17px; }
  .parking-bay { height: 276px; width: 166px; margin-top: 8px; }
  .parking-bay img { height: 258px; }
  .parking-bay::after { width: 166px; bottom: -10px; }
  .menu-content { padding: 18px 26px; }
  .menu-panel h2.game-title { font-size: 56px; }
  .menu-panel p.menu-subtitle { font-size: 12px; }
  .garage-heading { margin-bottom: 8px; }
  .track-chooser { min-height:46px; padding:7px 10px; margin-bottom:10px; }
  .track-chooser strong { font-size:13px; }
  .menu-panel #vehicleDescription { min-height:30px; font-size:11px; }
  .vehicle-details h3 { font-size:24px; }
  .menu-panel p.vehicle-mass { margin:8px 0 10px; }
  .menu-content { padding-top:14px; padding-bottom:14px; }
  .select-label { margin-bottom:10px; }
  .track-picker-head { padding-top:15px; padding-bottom:10px; }
  .vehicle-choices { gap: 4px; padding-top: 14px; }
  .vehicle-choice { padding-left: 1px; padding-right: 1px; }
  .vehicle-stats { gap: 8px 22px; margin-top: 12px; }
  .menu-controls { margin-top: 13px; gap: 7px 14px; }
  .menu-panel:not(:has(.menu-layout)) { padding: 23px 29px; }
}
@media (max-height: 750px) and (min-width: 1101px) {
  /* The same controls are already visible in the compact header at this width. */
  .menu-controls { display: none; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 9px; gap: 16px; }
  .track-name { font-size: 10px; }
  .race-stage { padding: 4px; }
  .race-footer { padding: 0 10px; }
  .in-race-hud, .hud-row { gap: 14px; }
  .hud-cell { flex-direction: column; align-items: start; gap: 0; }
  .hud-cell > span { font-size: 9px; }
  .hud-cell strong { font-size: 21px; }
  .hud-time strong { font-size: 20px; }
  .speed-track { display: none; }
  .speedometer strong { font-size: 24px; min-width: 34px; }
  .best-time { flex-direction: column; align-items: end; gap: 2px; font-size: 9px; }
  .best-time strong { font-size: 15px; }
  .overlay { padding: 16px; }
  .menu-panel { max-width: 440px; }
  .menu-layout { display: block; min-height: 0; }
  .garage-visual { display: block; padding: 10px 16px; }
  .garage-label, .parking-bay, .car-caption { display: none; }
  .vehicle-choices { padding-top: 0; margin-top: 0; gap: 7px; }
  .vehicle-choice { min-height: 70px; }
  .vehicle-choice img { height: 42px; }
  .vehicle-choice span { font-size: 10px; }
  .menu-content { padding: 18px 25px; }
  .menu-panel h2.game-title { font-size: 52px; }
  .countdown { font-size: 80px; }
  .dock-messages { gap: 12px; }
  .surface-status, .lap-toast { font-size: 9px; }
  .restart-banner { gap: 12px; padding: 17px; }
  .restart-banner strong { font-size: 28px; }
  .restart-banner p { font-size: 11px; }
  .recovery-symbol { width: 35px; height: 35px; font-size: 28px; }
  .menu-panel.track-picker { max-width:none; }
  .track-picker-head { padding:15px 15px 12px; gap:12px; }
  .track-picker-head h2 { font-size:27px; }
  .track-picker-head p { font-size:10px; }
  .picker-back { padding:0 9px; font-size:10px; }
  .track-picker-status { margin:0 15px; font-size:10px; }
  .track-gallery { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding:2px 15px 15px; }
  .track-card strong { font-size:12px; }
  .track-card-environment { font-size:10px; }
}
@media (max-width: 480px) {
  .best-time { display: none; }
  .speedometer { margin-left: auto; }
  .in-race-hud { gap: 12px; }
  .surface-status { max-width: 58%; }
  .menu-content { padding: 17px 20px; }
  .menu-panel h2.game-title { font-size: 48px; }
  .select-label select { width: 180px; }
  .menu-controls { gap: 9px; }
  .recovery-symbol { display: none; }
  .restart-banner { width: 100%; gap: 10px; padding: 14px; }
  .restart-banner strong { font-size: 24px; }
  .restart-key kbd { min-width: 36px; height: 36px; font-size: 20px; }
  .restart-key span { max-width: 60px; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.mode-switch { display:grid; grid-template-columns:repeat(3,1fr); margin:0 0 12px; border-bottom:1px solid #688392; }
.mode-switch button { background:transparent; padding:8px 3px; border:0; border-bottom:3px solid transparent; color:#c0d1dc; font-size:14px; }
.mode-switch button:hover,.mode-switch button[aria-pressed="true"] { color:white; background:#304d60; }
.mode-switch button[aria-pressed="true"] { border-bottom-color:var(--accent); }
.model-line,.wallet-line,.sheet-head { display:flex; justify-content:space-between; align-items:baseline; gap:12px; }
.workshop-link { color:#e8f1f5; background:transparent; border:0; border-bottom:1px solid #7f9ba9; padding:4px 0; font-size:13px; }
.workshop-link span { margin-left:8px; color:#ecc196; font-variant-numeric:tabular-nums; }
.ghost-option input { width:20px; height:20px; accent-color:var(--accent); margin:3px 0; }
.menu-panel p.garage-note,.menu-panel p.sheet-note { font-size:12px; line-height:1.45; color:#dfc3a4; margin:7px 0 10px; }
.menu-panel.service-sheet:not(:has(.menu-layout)),.menu-panel.season-results:not(:has(.menu-layout)) { width:min(710px,100%); max-width:none; }
.sheet-head { align-items:center; margin-bottom:13px; }
.sheet-head h2 { margin:0; }
.workshop-layout,.calendar-layout,.result-columns { display:grid; gap:24px; align-items:start; }
.workshop-layout { grid-template-columns:minmax(110px,.65fr) minmax(0,1.4fr); }
.workshop-car { display:grid; justify-items:center; align-content:center; align-self:stretch; padding:16px; color:#203545; background:#b8c9d1; }
.workshop-car img { width:auto; height:170px; max-width:100%; object-fit:contain; margin:0 0 12px; }
.workshop-car span,.part-level { font-size:12px; }
.wallet-line { padding:0 0 8px; border-bottom:1px solid var(--line); font-size:13px; }
.wallet-line strong { color:#f6bc80; font-family:var(--display); font-size:23px; font-variant-numeric:tabular-nums; }
.parts,.schedule { margin:0; padding:0; list-style:none; }
.parts li,.schedule li { display:flex; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid var(--line); }
.parts li>div { flex:1; }
.parts strong,.schedule strong { font-size:15px; font-weight:550; }
.parts small,.schedule small { display:block; font-size:11px; margin:3px 0; }
.part-level { color:#ccdae2; font-variant-numeric:tabular-nums; }
.fit-select { color:#e8eff3; background:#2e4b5f; font:inherit; padding:3px 4px; border:1px solid #698492; border-radius:3px; }
.part-buy { min-width:70px; padding:9px; border:1px solid #869eac; border-radius:3px; background:#345468; color:#f2f6f8; }
.part-buy:hover:enabled { background:#456b82; }
.part-buy:disabled,.vehicle-choice:disabled { cursor:default; opacity:.62; }
.calendar-layout,.result-columns { grid-template-columns:1.1fr 1fr; margin-top:12px; }
.schedule li>span { font-variant-numeric:tabular-nums; color:var(--muted); }
.schedule .next-round strong,.schedule .next-round>span,.player-row,.menu-panel p.payout { color:#ffbd7d; }
.cup-table { width:100%; border-collapse:collapse; font-size:13px; font-variant-numeric:tabular-nums; }
.cup-table th,.cup-table td { padding:9px 3px; text-align:left; border-bottom:1px solid var(--line); }
.cup-table thead th { font-weight:400; color:#b3c7d4; font-size:11px; }
.cup-table :is(th,td):last-child { text-align:right; }
.result-columns h3 { margin:0 0 4px; font-size:16px; }
.result-columns .result-list { margin:0; }
.menu-panel p.payout { margin:16px 0 0; font-size:12px; }
@media(max-height:800px) and (min-width:761px){
  .menu-content { padding:14px 23px; }
  .menu-layout { min-height:0; }
  .menu-panel h2.game-title { font-size:43px; }
  .garage-heading,.track-chooser,.select-label { margin-bottom:8px; }
  .menu-panel #vehicleDescription { min-height:0; }
  .menu-controls { margin-top:8px; }
  .menu-panel p.menu-recovery { margin-top:7px; }
}
@media(max-width:620px){
  .workshop-layout { grid-template-columns:1fr; gap:12px; }
  .workshop-car { display:flex; gap:12px; align-items:center; padding:8px 12px; }
  .workshop-car img { height:45px; margin:0; }
  .calendar-layout,.result-columns { grid-template-columns:1fr; gap:14px; }
  .sheet-head h2 { font-size:30px; }
}


/* Title screen and its two short submenus share the same painted dock backdrop. */
.app:has(.overlay:not([hidden]) .arcade-screen) {display:block;}
.app:has(.overlay:not([hidden]) .arcade-screen) :is(.topbar,.race-footer) {display:none;}
.app:has(.overlay:not([hidden]) .arcade-screen) :is(main,.race-stage,.game-frame) {display:block;width:100%;height:100%;padding:0;border:0;outline:0;border-radius:0;}
.overlay:has(.arcade-screen) {padding:0;background:#101513;}
.menu-panel.arcade-screen:not(:has(.menu-layout)) {position:relative;isolation:isolate;display:flex;align-items:safe center;width:100%;max-width:none;height:100%;max-height:none;padding:clamp(26px,7vw,130px);border:0;border-radius:0;box-shadow:none;background:linear-gradient(90deg,#101410 3%,#101410f5 28%,#12171596 65%,#16181447),url('assets/harbor.png') center / cover;animation:none;}
.arcade-art {position:absolute;inset:0;overflow:hidden;z-index:-1;pointer-events:none;}
.arcade-art::before {content:"";position:absolute;z-index:-1;inset:0 0 0 40%;background:url('assets/cars/muscle.png') center / auto 77% no-repeat;transform:rotate(31deg);filter:drop-shadow(9px 16px 9px #000b);pointer-events:none;}
.arcade-screen {overflow-x:clip;}
.arcade-content {width:min(430px,100%);margin-block:auto;padding-block:18px;}
.menu-panel h2.arcade-logo,.menu-panel h2.arcade-title {font:italic 900 clamp(64px,9vw,150px)/.92 Impact,"Arial Black",sans-serif;text-transform:uppercase;letter-spacing:-.045em;color:#fff1d2;text-shadow:3px 4px #151810,5px 6px #b64f20;margin:0 0 clamp(25px,5vh,60px);}
.menu-panel h2.arcade-title {font-size:clamp(38px,5.2vw,80px);}
.arcade-list {display:grid;gap:3px;}
.arcade-list button,.arcade-back {position:relative;background:#121610dc;color:#f4eedf;border:0;border-left:4px solid transparent;text-align:left;padding:9px 16px 10px;font:700 clamp(21px,2.6vw,39px)/1.2 var(--display);border-radius:0;}
.arcade-list button:is(:hover,:focus),.arcade-back:is(:hover,:focus) {outline:0;border-left-color:#ffb43d;background:#ffb43d;color:#19190f;}
.menu-panel .arcade-hint {margin-top:30px;display:flex;align-items:center;gap:5px;color:#dedbcf;}
.arcade-hint kbd,.arcade-bindings kbd {background:#252920;border-color:#888b77;color:#f4eedf;}
.arcade-hint kbd:last-child {margin-left:12px;}
.option-list button {display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:clamp(18px,2vw,28px);}
.option-list strong {font:500 15px var(--display);}
.arcade-back {margin-top:24px;font-size:17px;}
.arcade-bindings {margin:0;background:#101510de;padding:0 16px;}
.arcade-bindings div {display:flex;align-items:center;justify-content:space-between;min-height:36px;border-bottom:1px solid #ffffff25;}
.arcade-bindings dd {margin:0;}
.setup-back {margin-top:12px;}
@media(max-width:640px){.arcade-art::before{inset:0 -15% 20% 30%;opacity:.48;}.arcade-content{max-width:370px;}.arcade-list button{padding-block:13px;}}

/* The same ink, parchment and amber carry from the title screen onto the grid. */
:root {--bg:#101410;--line:#515347;--ink:#fff1d2;--accent:#ffb43d;--muted:#c4c1ad;}
.arcade-subpage .arcade-content {width:min(510px,100%);}
.arcade-subpage .arcade-title {margin-bottom:clamp(16px,3vh,32px);}
.arcade-subpage .option-list button {min-height:40px;gap:20px;}
.arcade-subpage .option-list strong {text-align:right;color:inherit;}
.arcade-list button[aria-pressed=true]::after {content:'✓';float:right;}
.arcade-list button:disabled {cursor:default;}
.arcade-subpage p.race-summary {margin-top:12px;color:#ded8bf;}
.arcade-subpage #start {color:#ffcc70;}
.arcade-subpage #start:is(:hover,:focus){color:#19190f;}
.arcade-subpage :is(.sheet-head,.track-picker-head,.dialog-content) h2 {font:900 clamp(36px,5.2vw,78px)/1 Impact,"Arial Black",sans-serif;letter-spacing:-.035em;text-transform:uppercase;color:#fff1d2;text-shadow:3px 3px #884315;}
.arcade-subpage:is(.service-sheet,.car-selection,.season-results,.track-picker) .arcade-content {width:min(840px,100%);}
.arcade-subpage:is(.service-sheet,.car-selection,.season-results,.track-picker) .arcade-art {display:none;}
.arcade-subpage :is(.dialog-content,.workshop-layout,.calendar-layout,.car-detail) {background:#101410e8;padding:clamp(12px,2vw,25px);}
.arcade-subpage :is(.dialog-content,.dialog-content button) {text-align:left;}
.arcade-subpage :is(.picker-back,.secondary-button,.primary-button,.part-buy,.fit-select) {border-radius:0;border:0;border-left:3px solid #877e64;background:#26291f;color:#fff1d2;}
.arcade-subpage :is(.primary-button,.secondary-button) {font:700 21px var(--display);padding:10px 15px;}
.arcade-subpage :is(.picker-back,.primary-button,.secondary-button,.part-buy):is(:focus,:hover):enabled {background:var(--accent);color:#161910;}
.arcade-subpage :is(p,small,.part-level,.result-list li>span,.cup-table thead th) {color:#d1cdbb;}
.arcade-subpage .workshop-car {color:#fff1d2;background:#282b22;}
.arcade-subpage .sheet-head {align-items:center;}
.arcade-subpage .car-picker {display:grid;grid-template-columns:minmax(175px,.85fr) minmax(225px,1.3fr);gap:15px;align-items:start;}
.car-detail {display:flex;align-items:center;gap:16px;}
.car-detail img {width:28%;height:185px;object-fit:contain;}
.car-detail h3 {color:#ffcc70;margin:0 0 5px;}
.car-detail dl {margin:8px 0;}
.car-detail dl div {display:flex;justify-content:space-between;border-bottom:1px solid var(--line);font-size:13px;padding:3px 0;}
.car-detail dd {margin:0;color:#ffcc70;}
.menu-panel.arcade-screen.track-picker {flex-direction:row;overflow-y:auto;align-items:safe center;}
.arcade-subpage .track-picker-head {padding:0 0 14px;}
.arcade-subpage .track-gallery {display:flex;flex-direction:column;gap:3px;padding:2px 3px;max-height:55dvh;}
.arcade-subpage .track-card {flex:none;display:grid;grid-template-columns:76px 1fr;grid-template-rows:auto auto;column-gap:14px;align-items:end;padding:4px;background:#171b14ee;border:0;border-left:4px solid transparent;border-radius:0;}
.arcade-subpage .track-card-image {grid-row:span 2;}
.arcade-subpage .track-card strong,.arcade-subpage .track-card-environment {padding:0;color:inherit;}
.arcade-subpage .track-card-environment {align-self:start;}
.arcade-subpage .track-card-kind,.arcade-subpage .track-card-selected {display:none;}
.arcade-subpage .track-card[aria-pressed=true] {box-shadow:none;border-color:var(--accent);}
.arcade-subpage .track-card:is(:hover,:focus) {background:var(--accent);color:#171b14;}
.topbar,.race-footer {background:#171b15;border-color:#554f3c;}
.wordmark {font-family:Impact,var(--display);color:#fff1d2;text-transform:uppercase;}
.game-frame {outline-color:#524e40;}
:is(.controls,.restart-key) kbd,.pause-button,.icon-button {background:#292d23;color:#fff1d2;border-color:#6d6d59;border-radius:0;}
:is(.pause-button,.icon-button):hover {background:#474839;}
.hud-cell>span,.track-name,.best-time,.speedometer>span,.surface-status,.lap-toast,.controls small {color:#c7c4b2;}
.hud-cell strong,.best-time strong,.speedometer strong {color:#fff1d2;}
.speed-track {background:#373a2c;}
.countdown {font-family:Impact,var(--display);color:#ffbf55;text-shadow:3px 4px #161810;}
.restart-banner {background:#191b14f5;border-color:var(--accent);border-radius:0;}
@media(max-width:670px){.arcade-subpage .car-picker {grid-template-columns:1fr;}.car-detail img {height:105px;}.arcade-subpage .track-card {grid-template-columns:60px 1fr;}.arcade-subpage .option-list button {font-size:20px;}}
@media(max-height:630px){.menu-panel.arcade-subpage:not(:has(.menu-layout)){padding-block:14px;}.arcade-subpage .arcade-content {padding-block:4px;}.arcade-subpage .option-list button {padding-block:5px;min-height:32px;}}
.race-setup .arcade-art::before {background-image:var(--race-car);}
.arcade-list:has(button:hover) button:focus:not(:hover) {background:#171b14;color:#fff1d2;border-left-color:#ac9163;}

.lobby-screen .lobby-fields {display:grid;gap:3px;}
.lobby-fields label,.binding-list button {display:flex;align-items:center;justify-content:space-between;gap:12px;background:#171b14ee;color:#fff1d2;padding:7px 12px;}
.lobby-fields select {min-width:48%;max-width:65%;background:#26291f;color:#fff1d2;border:1px solid #756f59;padding:5px;}
.binding-list {display:grid;grid-template-columns:1fr 1fr;gap:3px;margin:10px 0;}
.binding-list button {border:0;font:inherit;}
.binding-list button:focus-visible,.binding-list button:hover {background:#ffb43d;color:#171b14;}
#bindStatus {color:#ffcb75;}
#localHud {display:none;}
.local-race #localHud {display:flex;flex-wrap:wrap;column-gap:15px;row-gap:2px;font-size:13px;}
.local-race :is(#positionCell,#hud>.hud-cell:not(.hud-time),#speedometer,.best-time,.topbar .controls) {display:none;}
@media(max-width:700px){.local-race #localHud{font-size:10px;column-gap:7px;}.local-race .hud-time{display:none;}}
.choice-group {border:0;padding:0;margin:8px 0 14px;display:flex;flex-wrap:wrap;gap:4px;}
.choice-group legend {font-size:13px;color:#dfd8c1;margin-bottom:4px;}
.choice-group button,.fit-options button {padding:7px 12px;background:#252a21;color:#f4eedf;border:1px solid #67664f;font:inherit;}
.choice-group button[aria-pressed=true],.fit-options button[aria-pressed=true] {background:var(--accent);color:#161910;}
.fit-options {display:inline-flex;flex-wrap:wrap;gap:3px;}
.fit-options button {padding:4px 7px;}



.menu-panel.arcade-screen.track-picker:not(:has(.menu-layout)) {padding:clamp(8px,2vh,24px) clamp(10px,3vw,48px);overflow:hidden;}
.track-picker.arcade-subpage .arcade-content {display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:6px;width:min(100%,1500px);height:100%;padding:0;margin:auto;}
.track-picker.arcade-subpage .track-picker-head {padding:0;}
.track-picker.arcade-subpage .track-picker-head h2 {font-size:clamp(28px,5vh,56px);}
.track-picker.arcade-subpage .track-gallery {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));grid-auto-rows:minmax(0,1fr);align-content:stretch;gap:clamp(3px,.8vh,9px);max-height:none;overflow:hidden;padding:3px;}
.track-picker.arcade-subpage .track-card {display:grid;grid-template: minmax(0,1fr) auto / minmax(0,1fr);align-items:stretch;min-height:0;padding:0;border:1px solid #706e5c;}
.track-picker.arcade-subpage .track-card-image {grid-area:1/1;width:100%;height:100%;aspect-ratio:auto;background:#121810;}
.track-picker.arcade-subpage .track-card-image img {object-fit:contain;}
.track-picker.arcade-subpage .track-card strong {padding:2px 6px;font-size:clamp(11px,1.2vw,18px);line-height:1.15;}
.track-picker.arcade-subpage .track-card[aria-pressed=true] {border:2px solid var(--accent);}
.track-picker-status:empty {display:none;}
@media(max-width:600px) and (orientation:portrait){.track-picker.arcade-subpage .track-gallery {grid-template-columns:repeat(3,minmax(0,1fr));}}

.choice-group button[data-group="seat"] {border-bottom:3px solid var(--player-color);}
.choice-group button[data-group="seat"][aria-pressed="true"] {background:var(--player-color);color:#121510;}

@media (max-width: 540px) {
  .restart-banner {display:grid;grid-template-columns:auto minmax(0,1fr);}
  .restart-banner strong {overflow-wrap:anywhere;}
  .restart-key {grid-column:1/-1;flex-direction:row;justify-content:center;margin:0;}
  .restart-key span {max-width:none;}
}
