@charset "UTF-8";

:root {
  color-scheme: dark;
  --ink: #0c1823;
  --ink-deep: #081019;
  --ivory: #fff5df;
  --muted: #a4afb3;
  --orange: #ff692f;
  --orange-bright: #ff8445;
  --cyan: #70e5dc;
  --line: rgba(233, 241, 232, .19);
  --display: Impact, "Arial Narrow", "Helvetica Neue", sans-serif;
  --body: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; }
body { background: var(--ink); color: var(--ivory); font-family: var(--body); -webkit-font-smoothing: antialiased; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; font: inherit; cursor: pointer; }
button, a { touch-action: manipulation; }
button { border: 0; border-radius: 0; }
button:disabled { cursor: wait; opacity: .55; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--cyan); outline-offset: 5px; }
button:active:not(:disabled) { transform: translateY(2px); }
a { color: inherit; }
p, h1, h2 { margin: 0; }
[hidden] { display: none !important; }
#game { display: block; position: fixed; inset: 0; width: 100%; height: 100%; outline: none; touch-action: none; }

.menu-sheet { position: fixed; inset: 0; z-index: 5; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; background: linear-gradient(90deg, rgba(8,16,25,.92) 0%, rgba(8,16,25,.62) 35%, rgba(8,16,25,0) 66%); }
.menu-shell { width: min(100%, 1680px); min-height: 100%; margin: 0 auto; padding: max(29px, env(safe-area-inset-top)) max(42px, env(safe-area-inset-right)) max(19px, env(safe-area-inset-bottom)) max(42px, env(safe-area-inset-left)); display: flex; flex-direction: column; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; }
.studio-mark { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-size: 12px; font-weight: 900; letter-spacing: .04em; line-height: 1.32; }
.studio-mark > span:last-child > span { display: block; color: var(--muted); font-weight: 500; font-size: 12px; letter-spacing: .04em; margin-top: 2px; }
.omega-symbol { width: 42px; height: 42px; display: grid; place-items: center; border: 2px solid var(--ivory); color: var(--ivory); font-family: Georgia, serif; font-size: 33px; font-weight: 700; line-height: 1; padding: 0 0 4px; }
.edition-mark { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; line-height: 1.8; text-align: right; }
.edition-mark > span:last-child { display: block; color: var(--muted); font-size: 12px; }
.status-dot { display: inline-block; width: 6px; height: 6px; background: var(--cyan); vertical-align: 1px; margin-right: 6px; border-radius: 50%;  }
.menu-hero { position: relative; display: flex; align-items: center; flex: 1 0 auto; min-height: clamp(350px, 55vh, 590px); padding: 30px 0 56px; }
.hero-copy { position: relative; z-index: 1; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--muted); font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.tiny-rule { width: 23px; height: 3px; background: var(--orange); display: inline-block; }
.game-title { margin: 0 0 18px -4px; font-family: var(--display); font-size: clamp(94px, 9.8vw, 164px); font-weight: 900; line-height: .84; letter-spacing: -.025em; font-style: italic; transform: skew(-4deg); transform-origin: left bottom; text-shadow: 0 4px 0 rgba(3,12,18,.12); }
.game-title > span { display: block; }
.game-title > .mega-title { font-size: .64em; line-height: 1.05; letter-spacing: -.035em; }
.game-title > span:last-child { color: var(--orange); }
.title-period { color: var(--ivory); }
.tagline { margin-top: 23px; font-size: clamp(13px, 1.1vw, 17px); font-weight: 900; letter-spacing: .04em; }
.hero-description { margin-top: 14px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.hero-coordinate { position: absolute; right: 0; top: 32%; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: rgba(255,245,223,.5); }
.hero-coordinate > span:first-child { color: var(--ivory); font-size: 14px; font-weight: 700; }
.hero-coordinate i { width: 26px; height: 1px; background: var(--orange); margin-top: 4px; }
.turn-ride-button { position: absolute; right: 0; bottom: 55px; z-index: 2; display: inline-flex; align-items: center; justify-content: center; gap: 11px; min-height: 44px; padding: 10px 13px; border: 1px solid var(--orange); background: rgba(8,16,25,.88); color: var(--ivory); font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.turn-ride-button > span { color: var(--orange); font-size: 22px; line-height: 1; }
.turn-ride-button:hover:not(:disabled) { background: var(--ink); border-color: var(--ivory); }
.hero-bottomline { position: absolute; bottom: 21px; left: 0; right: 0; display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: rgba(255,245,223,.48); }
.hero-bottomline > span:last-child { color: var(--ivory); }

.mode-selection { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 18px; padding: 12px 0; }
.mode-options { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); }
.mode-options > button { min-height: 44px; padding: 10px 17px; background: var(--ink-deep); color: var(--muted); font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .025em; }
.mode-options > button[aria-pressed="true"] { background: var(--ivory); color: var(--ink-deep); box-shadow: inset 0 -3px 0 var(--orange); }
.mode-options > button:hover:not([aria-pressed="true"]) { color: var(--ivory); background: #19313c; }
.garage-progress { color: var(--muted); font-family: var(--mono); font-size: 12px; line-height: 1.5; }
.cup-route { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; list-style: none; margin: 0; padding: 0; }
.cup-route > li { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px; border: 1px solid var(--line); font-size: 12px; line-height: 1.35; }
.cup-route > li > span { color: var(--orange); font-family: var(--mono); font-size: 12px; }
.garage { display: grid; grid-template-columns: 1.2fr 1fr .85fr; gap: 0; background: rgba(10,22,32,.95); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); position: relative; }
.garage::before { content: ""; position: absolute; top: -1px; left: 0; width: 36px; height: 3px; background: var(--orange); }
.selection-panel { padding: 22px 24px 20px 0; min-width: 0; }
.wheel-selection { padding-left: 24px; border-left: 1px solid var(--line); }
.selection-heading { display: flex; align-items: center; gap: 9px; min-height: 17px; margin-bottom: 16px; }
.selection-heading h2 { font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.section-number { color: var(--orange); font-family: var(--mono); font-size: 12px; }
.selection-arrow { margin-left: auto; color: var(--muted); font-size: 15px; }
.option-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 6px; min-height: 45px; }
.option-list > button { min-width: 0; flex: 1; min-height: 45px; padding: 10px 7px; border: 1px solid rgba(255,245,223,.22); background: transparent; color: #b8c2c5; text-transform: uppercase; font-size: 12px; font-weight: 800; line-height: 1.3; letter-spacing: .025em; transition: border-color .15s ease, color .15s ease, background .15s ease; position: relative; }
.option-list > button:hover { border-color: var(--ivory); color: var(--ivory); background: rgba(255,245,223,.035); }
.option-list > button:is([aria-pressed="true"], [aria-selected="true"], .selected, .active) { color: var(--ink-deep); background: var(--ivory); border-color: var(--ivory); box-shadow: inset 0 -3px 0 var(--orange); }
.option-list .option-number { display: block; font-family: var(--mono); font-size: 12px; opacity: .5; margin-bottom: 5px; }
.option-list .option-name { display: block; }
.option-list .option-meta { display: block; font-family: var(--mono); font-size: 12px; font-weight: 400; opacity: .65; margin-top: 5px; letter-spacing: 0; }
.track-selector { max-height: 250px; overflow-y: auto; overscroll-behavior: contain; padding: 2px 6px 3px 1px; scrollbar-width: thin; scrollbar-color: #617176 var(--ink); }
.course-group-label { margin: 0 0 7px; color: var(--muted); font: 500 12px var(--mono); line-height: 1.4; }
.course-group-label:not(:first-child) { margin-top: 14px; }
.track-selector button:focus-visible { outline-offset: -3px; }
.option-list > .course-locked { border-style: dashed; }
.unlock-condition { display: block; margin-top: 5px; font-size: 12px; font-weight: 500; line-height: 1.35; letter-spacing: 0; text-transform: none; }
.race-button[data-locked="true"] { cursor: not-allowed; background: #53616a; color: var(--ivory); opacity: 1; }
.race-button[data-locked="true"]::after { background: #53616a; }
.selection-description { margin-top: 11px; color: var(--muted); font-size: 12px; line-height: 1.5; min-height: 15px; }
.track-preview { display: block; width: 100%; height: 74px; margin-top: 9px; background: rgba(5,17,26,.55); border-left: 2px solid var(--orange); }
.race-map { position: absolute; right: max(26px, env(safe-area-inset-right)); top: 84px; width: 110px; height: 80px; background: rgba(8,24,35,.75); }
.track-section { position: absolute; left: max(26px, env(safe-area-inset-left)); top: 126px; color: var(--ivory); background: rgba(8,24,35,.8); padding: 7px 10px; font: 12px var(--mono); max-width: 200px; }
.track-section.feature-ahead { color: var(--cyan); border-left: 2px solid var(--cyan); }
@media (max-width:700px) {.race-map {right:15px;top:68px;width:82px;height:60px;} .track-section {left:15px;top:105px;max-width:190px;padding:5px 7px;} .track-preview {height:65px;} }
.launch-panel { padding: 22px 0 15px 24px; border-left: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.race-format { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; margin-bottom: 12px; white-space: nowrap; color: var(--muted); }
.button { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 54px; padding: 14px 19px; text-align: left; font-family: var(--display); font-size: 24px; letter-spacing: .02em; font-style: italic; line-height: 1.1; transition: background .15s ease, color .15s ease, transform .15s ease; }
.button > span { font-family: var(--body); font-weight: 500; font-style: normal; font-size: 28px; }
.button-primary { background: var(--orange); color: var(--ink-deep); }
.button-primary:hover { background: var(--orange-bright); }
.race-button { min-height: 62px; font-size: clamp(22px, 2.05vw, 32px); position: relative; }
.race-button::after { content: ""; position: absolute; bottom: -5px; left: 0; width: 100%; height: 2px; background: var(--orange); }
.loading-status { min-height: 13px; text-align: center; color: var(--muted); font-family: var(--mono); font-size: 12px; margin-top: 14px; letter-spacing: .025em; }
.menu-footer { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding-top: 17px; font-family: var(--mono); font-size: 12px; line-height: 1.6; color: var(--muted); }
.desktop-controls { display: flex; align-items: center; gap: 5px; }
.desktop-controls > span, .mobile-controls > span { margin: 0 6px; color: var(--orange); }
kbd { display: inline-block; font-family: var(--mono); font-size: 12px; line-height: 1.5; padding: 1px 4px; min-width: 16px; text-align: center; border: 1px solid rgba(255,245,223,.24); color: var(--ivory); }
.mobile-controls { display: none; }
.legal { display: flex; align-items: center; gap: 14px; font-size: 12px; }
.legal a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; text-transform: uppercase; }
.legal a:hover { color: var(--ivory); }

.race-hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; padding: 24px; }
.race-stats { display: flex; gap: 22px; position: absolute; top: max(22px, env(safe-area-inset-top)); left: max(26px, env(safe-area-inset-left)); padding: 10px 12px 9px 8px; background: rgba(8,24,35,.82); text-shadow: none; }
.position-stat { border-left: 1px solid var(--orange); padding-left: 12px; }
.stat-label { display: block; font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--ivory); line-height: 1.4; }
.position-stat > strong { display: block; font-family: var(--display); font-size: 63px; line-height: 1; font-style: italic; font-weight: 400; white-space: nowrap; }
.position-stat > strong > span { color: #c2cece; font-family: var(--mono); font-size: 14px; font-style: normal; letter-spacing: -.1em; }
.timing-stats { display: flex; gap: 22px; padding-top: 2px; }
.timing-stats strong { display: block; margin-top: 5px; font-family: var(--mono); font-size: 19px; font-weight: 700; white-space: nowrap; }
.hud-actions { position: absolute; top: max(20px, env(safe-area-inset-top)); right: max(24px, env(safe-area-inset-right)); display: flex; gap: 8px; pointer-events: auto; }
.icon-button { width: 44px; height: 44px; background: rgba(8,16,25,.7); border: 1px solid rgba(255,245,223,.25); font-size: 22px; color: var(--ivory); }
.icon-button:hover { background: var(--ivory); color: var(--ink); }
.icon-button[aria-pressed="true"] { color: var(--muted); }
.drive-stats { position: absolute; right: max(28px, env(safe-area-inset-right)); bottom: max(29px, env(safe-area-inset-bottom)); width: 177px; padding: 8px 10px; border: 1px solid var(--line); background: rgba(8,24,35,.88); text-shadow: none; }
.speed-stat { display: flex; align-items: baseline; justify-content: flex-end; gap: 7px; }
.speed-stat > strong { font-family: var(--display); font-size: 65px; font-style: italic; font-weight: 400; line-height: 1; }
.speed-stat > span { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; }
.drift-status { margin-top: 10px; }
.drift-label { display: flex; justify-content: space-between; min-height: 28px; align-items: flex-end; font-family: var(--mono); font-size: 12px; line-height: 1.15; letter-spacing: .025em; margin-bottom: 5px; }
.drift-track { position: relative; height: 5px; background: rgba(255,245,223,.22); transform: skew(-15deg); overflow: hidden; }
.drift-track::after { content: ""; position: absolute; top: 0; bottom: 0; left: 37.5%; width: 2px; background: var(--ivory); }
.drift-fill { width: 0%; height: 100%; background: var(--cyan);  }
.drift-status[data-level="ready"] .drift-label { color: var(--cyan); }
.drift-status[data-level="big"] .drift-label { color: var(--orange-bright); }
.drift-status[data-level="big"] .drift-fill { background: var(--orange-bright); }
.gadget-status { margin-top: 12px; display: flex; align-items: center; gap: 7px; justify-content: flex-end; font-family: var(--mono); font-size: 12px; letter-spacing: .035em; }
.gadget-key { display: grid; place-items: center; border: 1px solid var(--orange); width: 19px; height: 19px; color: var(--orange); }
.race-control-hint { position: absolute; left: max(26px, env(safe-area-inset-left)); bottom: max(28px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 12px; text-shadow: 0 2px 10px #081019; }
.race-control-hint > span { margin: 0 5px; color: var(--orange); }
.race-control-hint .brake-hint { display: none; align-items: center; gap: 5px; margin: 0; color: var(--ivory); }
@media (min-width: 1100px) { .race-control-hint .brake-hint { display: inline-flex; } }
.countdown { position: fixed; z-index: 15; top: 43%; left: 50%; transform: translate(-50%,-50%) skew(-7deg); font-family: var(--display); font-size: clamp(110px,20vw,220px); font-style: italic; line-height: 1; color: var(--ivory); text-shadow: 6px 6px 0 var(--orange), 0 10px 40px rgba(8,16,25,.6); pointer-events: none; }
.toast { position: fixed; z-index: 18; top: 24%; left: 50%; transform: translateX(-50%) rotate(-2deg); background: var(--ivory); color: var(--ink-deep); box-shadow: 4px 4px 0 var(--orange); padding: 10px 21px; max-width: calc(100% - 40px); font-family: var(--display); font-size: 26px; font-style: italic; text-align: center; pointer-events: none; }

.touch-controls { position: fixed; z-index: 12; bottom: max(18px, env(safe-area-inset-bottom)); left: max(16px, env(safe-area-inset-left)); right: max(16px, env(safe-area-inset-right)); display: flex; justify-content: space-between; align-items: flex-end; pointer-events: none; user-select: none; -webkit-user-select: none; }
.steering-controls, .action-controls { display: flex; align-items: flex-end; gap: 9px; }
.touch-button { pointer-events: auto; min-width: 62px; min-height: 62px; border: 1px solid rgba(255,245,223,.44); background: rgba(8,16,25,.68); color: var(--ivory); touch-action: none; font-family: var(--display); font-style: italic; font-size: 16px; box-shadow: 0 2px 10px rgba(0,0,0,.13); }
.touch-button:active, .touch-button.active, .touch-button.held { transform: none; background: var(--ivory); color: var(--ink-deep); border-color: var(--ivory); }
.steering-button { font-family: var(--body); font-style: normal; font-size: 30px; }
.drift-button { min-width: 70px; min-height: 70px; background: var(--orange); border-color: var(--orange); color: var(--ink-deep); font-size: 20px; }
.drift-button.ready { background: var(--cyan); border-color: var(--cyan); color: var(--ink-deep); font-size: 16px; }
.touch-button.brake-button { width: 44px; min-width: 44px; min-height: 48px; padding: 3px 1px; font-family: var(--mono); font-size: 12px; font-style: normal; align-self: flex-end; }
.gadget-button { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 3px; font-family: var(--mono); font-size: 12px; font-style: normal; letter-spacing: .04em; }
.gadget-button > span:first-child { color: var(--cyan); font-size: 24px; line-height: 1; }
.auto-accelerate { position: absolute; bottom: -12px; left: 0; font-family: var(--mono); font-size: 12px; letter-spacing: .04em; opacity: .7; }

.modal-layer { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 28px; background: rgba(5,12,19,.78); backdrop-filter: blur(7px); overflow-y: auto; overscroll-behavior: contain; }
.overlay-panel { position: relative; width: min(100%, 465px); padding: 38px; background: var(--ink); border: 1px solid var(--line); border-top: 1px solid var(--orange); box-shadow: 15px 15px 0 rgba(0,0,0,.13); }
.overlay-title { font-family: var(--display); font-size: clamp(49px, 7vw, 70px); line-height: .94; letter-spacing: -.015em; font-style: italic; font-weight: 400; margin: 24px 0 16px; }
.overlay-title > span { color: var(--orange); }
.overlay-description { font-size: 12px; line-height: 1.6; color: var(--muted); }
.overlay-buttons { display: grid; gap: 12px; margin-top: 27px; }
.button-secondary { border: 1px solid rgba(255,245,223,.35); color: var(--ivory); background: transparent; font-size: 21px; }
.button-secondary:hover { color: var(--ink); background: var(--ivory); }
.text-button { min-height: 44px; padding: 10px 0; background: transparent; color: var(--muted); font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-align: left; }
.text-button:hover { color: var(--ivory); }
.panel-registration { display: block; margin-top: 15px; font-family: var(--mono); color: var(--muted); font-size: 12px; letter-spacing: .04em; opacity: .5; }
.results-content { width: min(100%, 525px); padding: 24px 28px; }
.result-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 9px; }
.results-content .overlay-title { font-size: 38px; margin: 0; }
.cup-medal { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border: 3px double currentColor; border-radius: 50%; color: #ffe29a; background: #4b3b19; font: 700 24px var(--mono); }
.cup-medal.silver { color: #e4edf1; background: #3c4e58; }
.cup-medal.bronze { color: #ffc194; background: #533520; }
.result-highlights { display: flex; flex-wrap: wrap; gap: 3px 14px; margin-top: 10px; color: var(--cyan); font-family: var(--mono); font-size: 12px; line-height: 1.5; }
.result-highlights > span { white-space: nowrap; }
.unlock-notice { margin-top: 11px; padding: 9px 11px; background: #17353b; }
.unlock-notice > strong { display: block; color: var(--cyan); font-family: var(--mono); font-size: 12px; line-height: 1.4; }
.unlock-notice > p { margin-top: 3px; color: var(--ivory); font-size: 12px; line-height: 1.4; }
.standings-heading { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-bottom: 7px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--muted); }
.standings-heading > span:last-child { color: var(--orange); }
.standings { list-style: none; counter-reset: position; margin: 0 0 14px; padding: 0; }
.standings > li { counter-increment: position; position: relative; display: flex; align-items: center; gap: 10px; min-height: 34px; border-bottom: 1px solid var(--line); font-size: 12px; padding: 6px 0; }
.standings > li::before { content: counter(position, decimal-leading-zero); color: var(--muted); font-family: var(--mono); font-size: 12px; min-width: 22px; }
.standings > li:is(.player, .player-result, .you, [data-player="true"]) { color: var(--cyan); }
.standings > li:is(.player, .player-result, .you, [data-player="true"])::before { color: var(--cyan); }
.standings > li > :last-child:not(:first-child) { margin-left: auto; font-family: var(--mono); font-size: 12px; }
.results-buttons { display: grid; grid-template-columns: 1.1fr 1fr; gap: 10px; }
.results-buttons.single-action { grid-template-columns: 1fr; }
.results-buttons .button { font-size: 20px; gap: 8px; padding: 13px; }
.results-buttons .button > span { font-size: 23px; }
.results-links { display: flex; justify-content: space-between; gap: 20px; margin-top: 6px; }
.share-status { font-size: 12px; color: var(--cyan); line-height: 1.5; }

@media (min-width: 1600px) { .menu-hero { min-height: 590px; } }

@media (max-width: 1100px) and (min-width: 701px) {
  .menu-shell { padding-left: 30px; padding-right: 30px; }
  .menu-hero { min-height: 390px; }
  .game-title { font-size: 112px; }
  .garage { grid-template-columns: 1fr 1fr; }
  .launch-panel { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); padding: 16px 0; display: grid; grid-template-columns: 1fr 1.1fr; column-gap: 25px; align-items: center; }
  .race-format { grid-row: 1; margin: 0; font-size: 12px; }
  .race-button { grid-column: 2; grid-row: 1 / 3; min-height: 55px; font-size: 27px; }
  .loading-status { grid-column: 1; grid-row: 2; text-align: left; margin-top: 7px; }
  .menu-footer { flex-wrap: wrap; gap: 3px; }
}

@media (max-width: 700px) {
  .menu-sheet { background: linear-gradient(90deg, rgba(8,16,25,.6), rgba(8,16,25,.12) 54%, transparent), linear-gradient(0deg, var(--ink) 0%, rgba(8,16,25,.75) 12%, transparent 42%); }
  .menu-shell { padding: max(19px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(11px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
  .masthead { min-height: 35px; }
  .mode-selection { gap: 8px; padding: 10px 0; }
  .mode-options { width: 100%; }
  .track-selector { max-height: 238px; }
  .studio-mark { gap: 9px; font-size: 12px; letter-spacing: .04em; }
  .studio-mark > span:last-child > span { font-size: 12px; }
  .omega-symbol { height: 33px; width: 33px; font-size: 27px; border-width: 1px; }
  .edition-mark { font-size: 12px; }
  .edition-mark > span:last-child { font-size: 12px; }
  .edition-mark .status-dot { width: 4px; height: 4px; margin-right: 3px; }
  .menu-hero { min-height: 264px; flex: 1 0 264px; padding: 25px 0 33px; align-items: flex-start; }
  .eyebrow { font-size: 12px; gap: 7px; letter-spacing: .04em; }
  .tiny-rule { width: 16px; height: 2px; }
  .game-title { margin: 0 0 16px -2px; font-size: clamp(67px, 19.5vw, 110px); line-height: .84; }
  .tagline { font-size: 12px; letter-spacing: .04em; margin-top: 17px; }
  .hero-description { font-size: 12px; line-height: 1.55; margin-top: 10px; }
  .hero-coordinate { right: 0; top: auto; bottom: 45px; font-size: 12px; gap: 4px; }
  .hero-coordinate > span:first-child { font-size: 12px; }
  .hero-coordinate i { width: 16px; margin-top: 1px; }
  .hero-bottomline { bottom: 13px; font-size: 12px; letter-spacing: .04em; }
  .hero-bottomline > span:last-child { display: none; }
  .garage { grid-template-columns: 1fr; background: rgba(10,22,32,.94); }
  .selection-panel { padding: 13px 0 12px; }
  .wheel-selection { padding: 12px 0; border-top: 1px solid var(--line); border-left: 0; }
  .selection-heading { gap: 7px; margin-bottom: 9px; min-height: 12px; }
  .selection-heading h2 { font-size: 12px; letter-spacing: .04em; }
  .section-number { font-size: 12px; }
  .selection-arrow { font-size: 12px; }
  .option-list { gap: 6px; min-height: 44px; }
  .option-list > button { min-height: 44px; padding: 9px 7px; font-size: 12px; }
  .option-list .option-number { display: none; }
  .option-list .option-meta { font-size: 12px; margin-top: 2px; }
  .selection-description { font-size: 12px; margin-top: 7px; min-height: 12px; }
  .launch-panel { border-left: 0; border-top: 1px solid var(--line); padding: 13px 0 9px; }
  .race-format { display: none; }
  .race-button { min-height: 53px; font-size: 28px; padding: 11px 17px; }
  .loading-status { font-size: 12px; margin-top: 12px; min-height: 10px; }
  .menu-footer { flex-direction: column; align-items: flex-start; gap: 4px; padding-top: 10px; font-size: 12px; }
  .desktop-controls { display: none; }
  .mobile-controls { display: block; font-size: 12px; letter-spacing: .03em; }
  .legal { width: 100%; gap: 13px; font-size: 12px; }
  .legal a { min-height: 44px; font-size: 12px; }
  .legal a:first-child { margin-left: auto; }
  .race-stats { top: max(15px, env(safe-area-inset-top)); left: max(15px, env(safe-area-inset-left)); gap: 14px; }
  .position-stat { border-left-width: 1px; padding-left: 8px; }
  .stat-label { font-size: 12px; letter-spacing: .04em; }
  .position-stat > strong { font-size: 48px; }
  .position-stat > strong > span { font-size: 12px; }
  .timing-stats { flex-direction: column; gap: 7px; padding-top: 0; }
  .timing-stats > div { display: flex; align-items: center; gap: 7px; }
  .timing-stats strong { margin-top: 0; font-size: 12px; }
  .hud-actions { top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); gap: 5px; }
  .icon-button { width: 44px; height: 44px; font-size: 21px; }
  .drive-stats { left: max(17px, env(safe-area-inset-left)); right: auto; bottom: max(112px, calc(env(safe-area-inset-bottom) + 96px)); width: 138px; }
  .speed-stat > strong { font-size: 44px; }
  .speed-stat > span { font-size: 12px; }
  .drift-status { margin-top: 5px; }
  .drift-label { font-size: 12px; }
  .drift-track { height: 4px; }
  .gadget-status { margin-top: 7px; font-size: 12px; }
  .gadget-key { display: none; }
  .race-control-hint { display: none; }
  .toast { top: 24%; font-size: 22px; padding: 8px 16px; }
  .modal-layer { padding: max(22px, env(safe-area-inset-top)) 20px max(22px, env(safe-area-inset-bottom)); }
  .overlay-panel { padding: 27px 23px 21px; }
  .overlay-title { margin-top: 22px; font-size: 58px; }
  .overlay-description { font-size: 12px; }
  .overlay-buttons { gap: 10px; margin-top: 22px; }
  .results-content { padding: 20px; }
  .results-content .overlay-title { font-size: 32px; }
  .results-buttons { gap: 7px; }
  .results-buttons .button { font-size: 18px; min-height: 51px; padding: 11px; }
  .results-buttons .button > span { font-size: 20px; }
  .results-links { gap: 10px; }
  .text-button { font-size: 12px; }
}

@media (pointer: coarse) {
  .desktop-controls { display: none; }
  .mobile-controls { display: block; }
  .race-control-hint { display: none; }
}

body[data-touch-controls="true"] .desktop-controls,
body[data-touch-controls="true"] .race-control-hint { display: none; }
body[data-touch-controls="true"] .mobile-controls { display: block; }
body[data-touch-controls="true"] .gadget-key { display: none; }
@media (min-width: 701px) {
  body[data-touch-controls="true"] .drive-stats { bottom: max(112px, calc(env(safe-area-inset-bottom) + 96px)); }
}

@media (max-height: 500px) and (min-width: 701px) {
  .menu-shell { padding-top: max(15px, env(safe-area-inset-top)); padding-bottom: 10px; }
  .masthead { min-height: 32px; }
  .omega-symbol { width: 32px; height: 32px; font-size: 26px; }
  .studio-mark { font-size: 12px; }
  .studio-mark > span:last-child > span { font-size: 12px; }
  .edition-mark { font-size: 12px; }
  .menu-hero { min-height: 220px; padding: 18px 0 29px; }
  .game-title { font-size: 85px; margin-top: 12px; margin-bottom: 10px; }
  .eyebrow { font-size: 12px; }
  .tagline { font-size: 12px; margin-top: 15px; }
  .hero-description { display: none; }
  .hero-bottomline { bottom: 9px; font-size: 12px; }
  .garage { grid-template-columns: 1fr 1fr .85fr; }
  .selection-panel { padding: 14px 16px 11px 0; }
  .wheel-selection { padding-left: 16px; }
  .selection-heading { margin-bottom: 8px; gap: 6px; }
  .selection-heading h2 { font-size: 12px; }
  .option-list { gap: 4px; }
  .option-list > button { font-size: 12px; padding: 8px 4px; }
  .selection-description { font-size: 12px; margin-top: 7px; }
  .launch-panel { display: flex; grid-column: auto; padding: 13px 0 11px 16px; border-top: 0; border-left: 1px solid var(--line); }
  .race-format { font-size: 12px; margin-bottom: 7px; }
  .race-button { font-size: 23px; min-height: 49px; padding: 10px 13px; }
  .loading-status { font-size: 12px; margin-top: 11px; }
  .menu-footer { padding-top: 9px; font-size: 12px; }
  .legal { font-size: 12px; }
  .race-stats { top: max(12px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); gap: 14px; }
  .position-stat > strong { font-size: 43px; }
  .stat-label { font-size: 12px; }
  .timing-stats { gap: 14px; }
  .timing-stats strong { font-size: 14px; }
  .hud-actions { top: max(10px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); }
  .race-map { top: 64px; width: 96px; height: 70px; }
  .drive-stats { right: max(18px, env(safe-area-inset-right)); bottom: max(98px, calc(env(safe-area-inset-bottom) + 82px)); width: 132px; }
  .speed-stat > strong { font-size: 37px; }
  .speed-stat > span, .drift-label, .gadget-status { font-size: 12px; }
  .drift-status { margin-top: 4px; }
  .gadget-status { margin-top: 6px; }
  .gadget-key { display: none; }
  .touch-controls { bottom: max(14px, env(safe-area-inset-bottom)); }
  .touch-button { min-width: 58px; min-height: 58px; }
  .drift-button { min-width: 65px; min-height: 65px; }
  .countdown { font-size: 115px; }
  .toast { top: 26%; font-size: 23px; }
  .modal-layer { display: flex; align-items: flex-start; justify-content: center; padding: 18px; }
  .overlay-panel { padding: 24px; }
  .overlay-title { font-size: 47px; margin-top: 15px; margin-bottom: 10px; }
  .overlay-buttons { margin-top: 18px; gap: 8px; }
  .overlay-buttons .button { min-height: 48px; }
  .panel-registration { margin-top: 7px; }
}

@media (max-width: 360px) {
  .menu-shell { padding-left: 15px; padding-right: 15px; }
  .game-title { font-size: 67px; }
  .menu-hero { min-height: 249px; flex-basis: 249px; }
  .touch-controls { left: 10px; right: 10px; }
  .steering-controls, .action-controls { gap: 6px; }
  .touch-button { min-width: 54px; min-height: 58px; }
  .drift-button { min-width: 62px; min-height: 66px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

::selection { background: var(--orange); color: var(--ink-deep); }
.menu-sheet, .modal-layer { scrollbar-color: #617176 var(--ink); scrollbar-width: thin; }
#race-time, #lap, #speed, #place, .standings { font-variant-numeric: tabular-nums; }

/* Keep the full four-track / five-wheel roster readable. */
#wheel-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.option-list .option-number { display: none; }
.option-list > button { min-height: 48px; overflow-wrap: break-word; }
#mute-button { width: 84px; padding: 0 7px; font-family: var(--mono); font-size: 12px; line-height: 1.2; }
.gadget-key { width: auto; min-width: 19px; padding: 0 4px; }
.gadget-button.ready { border-color: var(--cyan); background: #133c41; }

@media (max-width: 700px) {
  .menu-shell { padding-bottom: max(113px, calc(env(safe-area-inset-bottom) + 96px)); }
  .menu-hero { min-height: 440px; flex-basis: 440px; }
  .hero-bottomline { display: none; }
  .hero-description { display: none; }
  .hero-coordinate { bottom: 74px; }
  .turn-ride-button { bottom: 12px; }
  .launch-panel { position: fixed; left: max(20px, env(safe-area-inset-left)); right: max(20px, env(safe-area-inset-right)); bottom: 0; padding: 11px 0 max(10px, env(safe-area-inset-bottom)); background: var(--ink-deep); z-index: 7; border-top: 1px solid var(--line); box-shadow: 0 -12px 20px rgba(0,0,0,.18); }
  .launch-panel::before { content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: -20px; right: -20px; background: var(--ink-deep); }
  .loading-status { margin-top: 10px; }
  .legal { flex-wrap: wrap; gap: 0 13px; }
  .race-stats { gap: 9px; }
  .timing-stats > div { gap: 5px; }
  .hud-actions { gap: 4px; }
  #mute-button { width: 62px; font-size: 12px; }
}

@media (max-height: 500px) and (min-width: 701px) {
  .menu-shell { padding-bottom: 110px; }
  .garage { grid-template-columns: 1fr 1fr; }
  .launch-panel { position: fixed; left: max(30px, env(safe-area-inset-left)); right: max(30px, env(safe-area-inset-right)); bottom: 0; width: auto; padding: 12px 0; border: 0; border-top: 1px solid var(--line); background: var(--ink-deep); z-index: 7; display: grid; grid-template-columns: 1fr 260px; gap: 20px; align-items: center; }
  .launch-panel::before { content: ""; position: absolute; z-index: -1; inset: 0 -30px; background: var(--ink-deep); }
  .launch-panel .race-button { grid-column: 2; grid-row: 1; }
  .launch-panel .loading-status { grid-column: 1; grid-row: 1; text-align: left; margin: 0; }
  .race-format { display: none; }
  .loading-status { font-size: 12px; margin-top: 10px; }
  .race-button { min-height: 48px; }
}
