* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #1d1b19; /* warm charcoal, same family as Wimble */
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body {
  height: 100dvh;
  display: grid;
  place-items: center;
}

canvas#game {
  display: block;
  touch-action: none;
  background: #35503a;
}

#hud {
  position: fixed;
  top: 12px;
  left: 14px;
  font: 600 14px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
  color: #efe8d8;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  background: rgba(24, 22, 20, 0.5);   /* readable on snow too */
  padding: 6px 12px;
  border-radius: 10px;
}
#hud .k { display: inline-block; width: 3.8em; color: #bdb5a2; }

#tracks, #cars {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
#cars { top: 46px; }
#tracks button, #cars button {
  font: 600 12px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.03em;
  color: #efe8d8;
  background: rgba(29, 27, 25, 0.55);
  border: 1px solid rgba(239, 232, 216, 0.25);
  border-radius: 999px;
  padding: 7px 11px;
  white-space: nowrap;
  cursor: pointer;
}
#tracks button:hover, #cars button:hover { border-color: rgba(239, 232, 216, 0.6); }
#tracks button.on { background: #e8742a; border-color: #e8742a; color: #1d1b19; }
#cars button.on { background: rgba(239, 232, 216, 0.92); color: #1d1b19; }

#hint {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(94vw, 700px);
  bottom: 18px;
  text-align: center;
  background: rgba(24, 22, 20, 0.55);
  padding: 6px 16px;
  border-radius: 999px;
  white-space: normal;
  font: 500 14px/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: #efe8d8;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  transition: opacity 0.25s;
}
#hint.hidden { opacity: 0; }

/* Rewards stay at the edge of the view and never capture driving input. */
#lap-feedback {
  position: fixed;
  left: 50%;
  bottom: max(70px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: max-content;
  max-width: min(94vw, 700px);
  padding: 8px 14px;
  border: 1px solid #ffb347;
  border-radius: 12px;
  background: rgba(24, 22, 20, 0.85);
  color: #ffe2b2;
  text-align: center;
  font: 600 13px/1.4 ui-monospace, monospace;
  pointer-events: none;
  transition: opacity 0.2s;
}
#lap-feedback.hidden { opacity: 0; }

/* Retain the track buttons, with two compact record lines and horizontal scroll. */
#tracks {
  max-width: calc(100vw - 420px);
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: #bdb5a2 transparent;
}
#tracks button { flex: 0 0 auto; border-radius: 12px; line-height: 1.3; }
#tracks small { display: block; font-size: 10px; font-weight: 500; }
#cars { top: 86px; }

#credit {
  position: fixed;
  right: 12px;
  top: 10px;
  font: 500 12px ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: #bdb5a2;
  opacity: 0.7;
  text-decoration: none;
}
#credit:hover { opacity: 1; }

/* On-screen controls, touch devices only. */
#touch {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(14px, env(safe-area-inset-bottom));
  padding: 0 18px;
  justify-content: space-between;
  pointer-events: none;
}
#touch .pad { display: flex; gap: 14px; pointer-events: auto; }
#touch button {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  border: 2px solid rgba(239, 232, 216, 0.35);
  background: rgba(29, 27, 25, 0.45);
  color: #efe8d8;
  font-size: 26px;
  touch-action: none;
}
#touch button.on { background: rgba(232, 116, 42, 0.6); }
#touch #boost {
  align-self: flex-end;
  width: 58px;
  height: 48px;
  border-radius: 14px;
  font: 700 11px ui-monospace, monospace;
  pointer-events: auto;
  border-color: #ffb347;
}

@media (max-width: 760px) {
  #tracks, #cars { left: 14px; transform: none; max-width: calc(100vw - 28px); }
  #hud { font-size: 12px; line-height: 1.3; }
  #tracks { top: 112px; width: calc(100vw - 28px); }
  #cars { top: 190px; }
  #hint { white-space: normal; border-radius: 14px; }
  #touch { padding: 0 10px; }
  #touch .pad { gap: 8px; }
  #touch button { width: clamp(44px, 16vw, 64px); height: 64px; }
}

@media (any-pointer: coarse) {
  #touch { display: flex; }
  #hint { bottom: 110px; }
}

/* Boost meter in the HUD */
#hud .bar { display: inline-block; width: 70px; height: 8px; border-radius: 4px; background: rgba(255,255,255,0.14); vertical-align: middle; overflow: hidden; }
#hud .bar i { display: block; height: 100%; width: 0; background: #8d8a80; }
#hud .bar.ready i { background: #ffb347; }
#hud .bar.on i { background: #ff5a1f; }

/* Sound button, under the credit */
#mute {
  position: fixed;
  right: 12px;
  top: 34px;
  font: 600 12px ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: #efe8d8;
  background: rgba(29, 27, 25, 0.55);
  border: 1px solid rgba(239, 232, 216, 0.25);
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
}
#mute:hover { border-color: rgba(239, 232, 216, 0.6); }
#mute.off { opacity: 0.6; }

/* Compact race actions, clear of the driving pads and track pickers. */
#race-controls {
  position: fixed;
  top: max(70px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  display: flex;
  gap: 6px;
}
#race-controls button {
  min-width: 72px;
  min-height: 44px;
  padding: 8px;
  border: 1px solid rgba(239, 232, 216, 0.4);
  border-radius: 12px;
  background: rgba(29, 27, 25, 0.75);
  color: #efe8d8;
  font: 600 12px ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  touch-action: manipulation;
  cursor: pointer;
}
#race-controls button:focus-visible {
  outline: 2px solid #ffb347;
  outline-offset: 2px;
}
@media (max-width: 760px), (any-pointer: coarse) {
  #race-controls {
    top: auto;
    right: auto;
    left: 50%;
    bottom: max(104px, calc(env(safe-area-inset-bottom) + 90px));
    transform: translateX(-50%);
  }
  #hint { bottom: max(158px, calc(env(safe-area-inset-bottom) + 144px)); }
  #lap-feedback { bottom: max(158px, calc(env(safe-area-inset-bottom) + 144px)); }
}

@media (prefers-reduced-motion: reduce) {
  #lap-feedback, #hint { transition: none; }
}

/* Game coordinates are supplied by resize(); keep the invisible hit area 48px. */
#garage-bush {
  position: fixed;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  touch-action: manipulation;
}
#garage-bush svg { display: block; pointer-events: none; }
#garage-bush:focus-visible { outline: 2px solid #ffb347; outline-offset: 2px; }
#cars { max-width: calc(100vw - 28px); overflow-x: auto; scrollbar-width: thin; }
#cars button { flex: 0 0 auto; }

#secret-garage {
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 22px;
  border: 1px solid #6d6456;
  border-radius: 16px;
  background: #211f20;
  color: #efe8d8;
  font: 500 14px/1.5 ui-monospace, monospace;
}
#secret-garage::backdrop { background: rgba(10, 10, 12, 0.72); }
#secret-garage h2 { margin: 0 54px 8px 0; font-size: 18px; }
#secret-garage p { margin: 8px 0; }
#garage-note { color: #bdb5a2; }
#garage-form label { display: block; margin-top: 16px; }
#garage-code {
  width: 100%;
  margin: 6px 0 12px;
  padding: 10px;
  border: 1px solid #8b8174;
  border-radius: 8px;
  background: #141315;
  color: #efe8d8;
  font: inherit;
  font-size: 16px;
  user-select: text;
  -webkit-user-select: text;
}
#secret-garage button {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #8b8174;
  border-radius: 8px;
  background: #343032;
  color: #efe8d8;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
#garage-close { position: absolute; right: 10px; top: 10px; }
#garage-status { color: #ffca82; font-weight: 700; }
#secret-garage :focus-visible { outline: 2px solid #ffb347; outline-offset: 2px; }

/* Optional Rival controls share the compact picker column. */
#mode-controls {
  position: fixed;
  top: 124px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  color: #efe8d8;
  font: 600 12px ui-monospace, monospace;
}
#mode-controls button, #mode-controls select, #race-result button {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #8b8174;
  border-radius: 10px;
  background: #211f20;
  color: #efe8d8;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
#mode-controls button[aria-pressed="true"] { background: #efe8d8; color: #211f20; }
#mode-controls :focus-visible, #race-result button:focus-visible { outline: 2px solid #ffb347; outline-offset: 2px; }
#race-status, #race-result {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 14px;
  border-radius: 14px;
  background: rgba(24, 22, 20, 0.92);
  color: #efe8d8;
  text-align: center;
  font: 700 28px ui-monospace, monospace;
}
#race-status { pointer-events: none; font-size: 54px; }
#race-result { width: min(360px, 94vw); font-size: 18px; }
#race-result p { margin: 0 0 14px; }
#race-result button { min-height: 44px; font-size: 13px; }
@media (max-width: 760px) {
  #mode-controls { top: 228px; left: 14px; transform: none; }
}
@media (max-height: 500px) and (min-width: 761px) {
  #mode-controls { top: 122px; }
}
@media (max-width: 760px) and (max-height: 500px) {
  #tracks { top: 10px; left: 210px; width: calc(100vw - 350px); }
  #cars { top: 86px; left: 210px; max-width: calc(100vw - 224px); }
  #mode-controls { top: 124px; left: 210px; }
}

/* Race setup owns configuration; gameplay uses reserved screen bands. */
[hidden] { display: none !important; }
canvas#game { position: fixed; }
#race-setup {
  position: fixed; inset: 0; z-index: 10;
  overflow-y: auto; overscroll-behavior: contain;
  background: rgba(23, 21, 20, 0.97);
  color: #efe8d8; font: 600 14px/1.4 ui-monospace, monospace;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 72px;
}
.setup-panel { max-width: 900px; margin: auto; }
#race-setup header { display: flex; align-items: center; gap: 20px; }
#logo-reserved { width: clamp(100px, 22vw, 210px); height: 64px; flex-shrink: 0; }
#race-setup h1 { font-size: clamp(20px, 4vw, 30px); margin: 0; color: #ffb347; }
#race-setup h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.15em; color: #bdb5a2; margin: 18px 0 8px; }
#race-setup #tracks, #race-setup #cars, #race-setup #mode-controls {
  position: static; transform: none; width: auto; max-width: none;
  overflow: visible; flex-wrap: wrap; padding: 0;
}
#race-setup #tracks { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
#race-setup #tracks button { text-align: left; border-radius: 10px; padding: 12px; min-height: 72px; white-space: normal; }
#race-setup #cars button, #race-setup #mode-controls button, #race-setup select { min-height: 44px; }
#start-race {
  display: block; width: 100%; margin-top: 24px; min-height: 52px;
  border: 1px solid #ffb347; border-radius: 12px; background: #e8742a;
  color: #1d1b19; font: 800 18px ui-monospace, monospace; cursor: pointer;
}
#start-race:focus-visible { outline: 3px solid #efe8d8; outline-offset: 3px; }
#hud {
  top: 6px; left: max(8px, env(safe-area-inset-left));
  display: flex; flex-wrap: wrap; gap: 2px 14px;
  max-width: calc(100vw - 310px); padding: 0; background: transparent;
  font-size: 12px; line-height: 22px;
}
#hud .k { width: auto; }
#race-controls {
  top: 6px; right: max(8px, env(safe-area-inset-right)); left: auto; bottom: auto;
  transform: none; gap: 4px;
}
#race-controls button { min-width: 52px; padding: 6px; }
#mute { top: 6px; right: 238px; padding: 4px; min-height: 44px; }
#hint, #lap-feedback {
  bottom: 2px; padding: 2px 8px; font-size: 11px; max-width: 94vw;
  border-radius: 6px;
}
#credit { display: none; }
#garage-bush { z-index: 11; }
#abandon-race {
  max-width: min(380px, calc(100vw - 32px)); max-height: calc(100dvh - 24px); overflow: auto;
  border: 1px solid #8b8174; border-radius: 14px; background: #211f20;
  color: #efe8d8; padding: 20px; font: 14px/1.5 ui-monospace, monospace;
}
#abandon-race::backdrop { background: rgba(10, 10, 12, 0.75); }
#abandon-race button { min-height: 44px; margin: 4px; padding: 8px; background: #343032; color: #efe8d8; border: 1px solid #8b8174; border-radius: 8px; }
@media (max-width: 600px) and (min-height: 501px) {
  #hud { max-width: calc(100vw - 16px); gap: 0 12px; }
  #race-controls { top: 54px; right: 8px; }
  #mute { top: 54px; left: 8px; right: auto; }
  #race-setup #tracks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #race-setup #tracks button { padding: 8px; font-size: 11px; }
}
@media (any-pointer: coarse) {
  #hint, #lap-feedback { bottom: 80px; }
  #touch { bottom: max(4px, env(safe-area-inset-bottom)); }
}
@media (orientation: landscape) and (max-height: 500px) and (any-pointer: coarse) {
  #touch { top: 64px; bottom: 0; padding: 0 4px; align-items: center; }
  #touch .pad { flex-direction: column; gap: 8px; }
  #touch button { width: 68px; height: 54px; }
  #touch .pad:last-child { margin-bottom: 56px; }
  #touch #boost { position: absolute; right: 8px; bottom: 4px; }
  #hint, #lap-feedback { bottom: 2px; max-width: calc(100vw - 170px); }
}
/* Driving tips belong in setup; feedback stays in the reserved margins. */
#hint { display: none; }
#lap-feedback { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 94vw; }
@media (any-pointer: coarse) {
  #lap-feedback { bottom: 72px; }
}
@media (orientation: landscape) and (max-height: 500px) and (any-pointer: coarse) {
  #touch { top: 80px; }
  #lap-feedback { top: 56px; bottom: auto; font-size: 10px; }
}
/* Keep the garage landmark clear of scrollable setup choices. */
body:has(#race-setup:not([hidden])) #garage-bush {
  left: auto !important; top: 24px !important; right: 20px; transform: none;
}
#race-setup header { padding-right: 48px; }
#race-setup header #logo-reserved { min-width: 70px; width: clamp(70px, 18vw, 180px); }
.setup-panel #credit { display: inline-block; position: static; margin-top: 16px; }

/* Curvado's cream / flame orange / deep purple arcade menu. Gameplay bands stay unchanged. */
#race-setup {
  background: radial-gradient(ellipse at 50% 0, #392044 0, #221b27 46%, #171619 100%);
  color: #f6e6cc;
  padding-bottom: 48px;
}
.setup-panel { max-width: 1120px; }
#race-setup header.setup-brand { display: block; text-align: center; padding: 0 40px; }
#curvado-logo { display: block; width: min(100%, 690px); height: auto; margin: 0 auto 12px; }
#race-setup h1 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.24em; color: #f7e6c9; }
.setup-eyebrow { color: #bfaace; font-size: 10px; letter-spacing: 0.18em; margin: 8px 0 24px; }
#race-setup h2 { display: flex; align-items: center; gap: 10px; color: #f0ddc0; letter-spacing: 0.1em; margin-top: 24px; }
#race-setup h2 span { color: #f58a35; font-size: 11px; border: 1px solid #6d3e55; border-radius: 5px; padding: 3px 6px; }
#race-setup #tracks { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
#race-setup #tracks button {
  display: flex; flex-direction: column; align-items: stretch;
  padding: 12px; border: 1px solid #59415e; background: #211d27;
  color: #f3e4ca; box-shadow: 0 3px 0 #110e14;
}
#race-setup #tracks button span { font-size: 13px; letter-spacing: 0; }
#race-setup #tracks small { color: #c8b9cd; line-height: 1.5; font-size: 10px; }
#race-setup #tracks button.on { border-color: #ff9b43; background: #392536; box-shadow: inset 0 0 0 1px #ff9b43, 0 3px 0 #110e14; }
#race-setup #tracks button.on small { color: #ffe1b9; }
.track-preview { order: -1; display: block; width: 100%; height: auto; margin: 0 0 8px; border-radius: 5px; background: #16141b; }
#race-setup #cars { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
#race-setup #cars button { display: flex; flex-direction: column; align-items: center; color: #f3e4ca; background: #211d27; border-radius: 12px; padding: 10px; font-size: 14px; }
#race-setup #cars button.on { background: #392536; outline: 1px solid #ff9b43; }
.vehicle-preview { order: -1; display: block; width: 100%; max-width: 240px; height: auto; }
#race-setup #mode-controls { gap: 10px; }
#race-setup #mode-controls button { min-width: 108px; border-color: #705376; letter-spacing: 0.1em; }
#race-setup #mode-controls button[aria-pressed="true"] { color: #201523; background: #f5dfba; border-color: #f5dfba; }
#difficulty-label { display: flex; align-items: center; gap: 8px; color: #c8b9cd; }
#race-setup select { background: #322137; border-color: #705376; }
#race-setup button:focus-visible { outline: 3px solid #ffaf62; outline-offset: 3px; }
#start-race { max-width: 460px; margin: 22px auto 0; background: linear-gradient(#ffa24b, #eb6c1b); min-height: 58px; letter-spacing: 0.12em; box-shadow: 0 4px 0 #7c3425; }
.setup-help { color: #b7a9bd; font-size: 11px; line-height: 1.7; margin-bottom: 0; }
.setup-panel #credit { color: #d1b7d6; font-size: 11px; }
@media (hover: hover) {
  #race-setup #tracks button:hover, #race-setup #cars button:hover { border-color: #f9ad67; background: #352639; }
}
@media (max-width: 760px) {
  #race-setup #tracks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #race-setup #cars { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #race-setup #cars button { font-size: 12px; padding: 8px 3px; border-left-width: 5px !important; }
  #race-setup header.setup-brand { padding: 0; }
  #race-setup #tracks button { padding: 9px; }
  #race-setup #tracks button span { font-size: 11px; }
  #race-setup #tracks small { font-size: 9px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  #curvado-logo { width: min(48vw, 390px); }
  .setup-eyebrow { margin-bottom: 12px; }
  #race-setup #tracks { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #race-setup #tracks button { padding: 8px; }
}

/* A compact desktop pit board; small screens retain natural document scrolling. */
@media (min-width: 900px) and (min-height: 600px) {
  #race-setup { padding: 12px 24px 20px; }
  #race-setup .setup-panel { max-width: 1440px; }
  #race-setup header.setup-brand { position: relative; padding: 0 48px; }
  #curvado-logo { width: auto; max-width: 100%; height: clamp(76px, 14vh, 130px); margin-bottom: 4px; }
  #race-setup h1 { font-size: 12px; }
  .setup-eyebrow { margin: 4px 0 0; font-size: 9px; }
  #race-setup h2 { margin: 10px 0 6px; font-size: 11px; }
  #race-setup #tracks { gap: 8px; }
  #race-setup #tracks button { padding: 8px; min-height: 0; }
  #race-setup .track-preview { height: clamp(44px, 8vh, 76px); width: 100%; object-fit: contain; margin-bottom: 5px; }
  #race-setup #tracks small { font-size: 10px; line-height: 1.4; }
  .setup-options { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(290px, 1fr); gap: 24px; }
  #race-setup #cars { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
  #race-setup #cars button { padding: 6px; font-size: 12px; }
  #race-setup .vehicle-preview { height: clamp(48px, 8vh, 72px); width: 100%; object-fit: contain; }
  #race-setup #mode-controls { gap: 6px; }
  #race-setup #mode-controls button { min-width: 108px; }
  #race-setup #difficulty-label { flex-basis: 100%; }
  .setup-footer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 340px); column-gap: 24px; align-items: center; margin-top: 12px; }
  .setup-footer .setup-links { margin: 0; grid-column: 1; grid-row: 1; }
  .setup-footer .setup-help { margin: 3px 0 0; grid-column: 1; grid-row: 2; font-size: 10px; }
  .setup-footer #start-race { grid-column: 2; grid-row: 1 / 3; margin: 0; min-height: 48px; }
}
@media (min-width: 1100px) and (min-height: 600px) {
  #race-setup #tracks { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  #race-setup #tracks button span { font-size: 11px; }
  #race-setup #tracks small { font-size: 9px; }
  #race-setup .track-preview { height: clamp(62px, 12vh, 120px); }
}

/* Give the approved wordmark more presence while keeping short laptop menus compact. */
@media (min-width: 1100px) and (min-height: 600px) {
  #curvado-logo {
    width: min(100%, clamp(399px, 73.5vh, 682.5px));
    height: auto;
    margin-bottom: 8px;
  }
  #race-setup h2 { margin-top: clamp(12px, 2.5vh, 24px); }
  #race-setup .setup-options h2 { margin-top: clamp(16px, 3vh, 28px); }
}

/* One safe-area source for the mobile visual-viewport fitter. */
#safe-area-probe { position: fixed; visibility: hidden; pointer-events: none; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
#play-ui[data-mobile] #hud { max-width: none; font-size: 10px; line-height: 18px; gap: 0 8px; }
#play-ui[data-mobile] #hud .bar { width: 44px; }
#play-ui[data-mobile] #race-controls { gap: 4px; transform: none; }
#play-ui[data-mobile] #race-controls button { flex: 1; min-width: 0; min-height: 42px; font-size: 11px; }
#play-ui[data-mobile] #mute { min-height: 42px; font-size: 10px; }
#touch[data-layout] { position: static; padding: 0; }
#touch[data-layout] .pad { display: contents; }
#touch[data-layout] button, #touch[data-layout] #boost { position: fixed; margin: 0; transform: none; touch-action: none; border-radius: 14px; pointer-events: auto; }
#play-ui[data-mobile] button { touch-action: none; }
#race-setup, #secret-garage, #abandon-race { touch-action: auto; }
@media (any-pointer: coarse) {
  #race-setup { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); padding-bottom: max(48px, env(safe-area-inset-bottom)); }
}

/* Privacy preferences stay in Race Setup, outside the track and driving controls. */
.setup-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin-top: 16px; }
.setup-links a, .setup-panel .setup-links #credit { position: static; margin: 0; padding: 5px 0; color: #d1b7d6; font: 11px/1.5 system-ui, sans-serif; text-decoration: none; }
.setup-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.setup-links a:focus-visible { outline: 3px solid #ffaf62; outline-offset: 3px; border-radius: 2px; }
