:root {
  color-scheme: light;
  --ink: #1e2c32;
  --muted: #6b787d;
  --paper: #f5f6f2;
  --night: #19262c;
  --turbo: #ffd166;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.game-page { --page-edge: 20px; --page-top: max(var(--page-edge), env(safe-area-inset-top)); width: min(100%, 1240px); margin: 0 auto; padding: var(--page-top) max(var(--page-edge), env(safe-area-inset-right)) 20px max(var(--page-edge), env(safe-area-inset-left)); }

/* Give the shop's own mark a readable size, including horizontal wordmarks. */
.brand-mark { --mark-size: 60px; --mark-wide: 180px; display: grid; place-items: center; flex-shrink: 0; overflow: hidden; width: var(--mark-size); height: var(--mark-size); padding: 5px; background: #fff; border: 1px solid #ffffff24; border-radius: 12px; }
.brand-mark[data-logo-shape="wide"] { width: min(var(--mark-wide), calc(var(--mark-size) * var(--logo-aspect))); }
.brand-mark img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.eyebrow { display: block; color: var(--muted); font-size: 10px; line-height: 1.5; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; }

/* All moving scenery stays in the GPU canvas; the chrome is intentionally quiet. */
.arcade { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: min(820px, calc(100svh - var(--page-top) - var(--page-edge))); min-height: 520px; position: relative; overflow: hidden; isolation: isolate; border-radius: 22px; background: var(--night); box-shadow: 0 16px 45px #22342c18, 0 2px 4px #22342c10; }
.hud { position: relative; display: flex; align-items: center; gap: 18px; min-width: 0; min-height: 80px; padding: 10px 22px; color: #fff; background: var(--night); }
.position-stat, .lap-stat { flex-shrink: 0; white-space: nowrap; }
.hud .position-stat > span, .hud .lap-stat > span { display: block; margin-bottom: 2px; color: #a7b5b7; font-size: 8px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; }
.hud strong { font-size: 27px; line-height: 1; font-weight: 750; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.position-stat strong { color: #fff; }
.position-stat small, .lap-stat small { color: #96a7ad; font-size: 13px; font-weight: 500; margin-left: 2px; letter-spacing: 0; }
.lap-stat { text-align: right; }
.hud-center { display: flex; align-items: center; justify-content: center; gap: 13px; min-width: 0; flex: 1; }
.hud-identity { min-width: 0; text-align: left; }
.hud-identity:only-child, .hud-logo[hidden] + .hud-identity { text-align: center; }
#race-shop-name { display: block; color: #fff; font-size: 17px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.minimize-race { display: grid; place-items: center; flex-shrink: 0; width: 42px; height: 42px; padding: 0; background: #ffffff0d; border: 1px solid #ffffff24; color: #d4dfe0; border-radius: 12px; }
.minimize-race svg { width: 20px; height: 20px; }
.sound-toggle { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 7px; min-width: 44px; min-height: 44px; padding: 9px 11px; color: #e4efee; background: #ffffff0d; border: 1px solid #ffffff24; border-radius: 12px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.sound-toggle svg { width: 20px; height: 20px; flex-shrink: 0; }
.sound-toggle .sound-slash, .sound-toggle[aria-pressed="true"] .sound-waves { display: none; }
.sound-toggle[aria-pressed="true"] .sound-slash { display: block; }
.sound-toggle[aria-pressed="true"] { color: #b8c7c8; background: #ffffff05; }
.sound-toggle:hover { border-color: #adc8c9; }
.sound-toggle:focus-visible { outline: 3px solid var(--turbo); outline-offset: 3px; }
.hud-actions { position: relative; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.controls-help { min-height: 32px; padding: 6px 9px; color: #d4dfe0; border: 1px solid #ffffff26; border-radius: 7px; background: #ffffff08; font-size: 10px; }
.controls-guide { position: absolute; top: calc(100% + 12px); right: 0; z-index: 5; width: min(260px, calc(100vw - 40px)); padding: 16px; color: #eaf3f8; background: #23363d; border: 1px solid #92b5c461; border-radius: 12px; box-shadow: 0 8px 24px #0005; }
.controls-guide p { margin: 0 0 10px; font-size: 12px; line-height: 1.6; }
.controls-guide button { padding: 7px 15px; color: #1b303e; background: #a9d9ff; border: 0; border-radius: 6px; font-size: 12px; font-weight: 700; }
.road-wrap { position: relative; min-height: 0; height: auto; overflow: hidden; background: #afd6d9; }
#road { display: block; width: 100%; height: 100%; outline-offset: -4px; touch-action: none; }
.race-score { position: absolute; top: 16px; left: 18px; display: flex; align-items: center; gap: 14px; padding: 7px 11px; color: #fff; background: #19262ccd; border: 1px solid #ffffff1a; border-radius: 8px; pointer-events: none; }
.race-score > div { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.race-score .race-clock { padding-left: 14px; border-left: 1px solid #ffffff30; }
.qe-game-credit { display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; gap: 2px; margin-left: 2px; padding-left: 18px; border-left: 1px solid #ffffff26; text-decoration: none; }
.qe-credit-label { color: #b4c2c3; font-size: 8px; font-weight: 600; line-height: 1.2; letter-spacing: .5px; }
/* Render small lettering as text so it stays sharp at every screen density. */
.qe-game-logo { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.qe-game-icon { display: block; flex-shrink: 0; width: 25px; height: 25px; overflow: hidden; stroke: none; }
.qe-game-wordmark { color: #f4f8fa; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight: 700; line-height: 1; letter-spacing: -.35px; }
.qe-game-wordmark > span { color: #ff9145; }
.qe-game-credit:hover .qe-credit-label { color: #fff; }
.race-score span { color: #e1e8e8; font-size: 8px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.race-score strong { font-size: 17px; font-variant-numeric: tabular-nums; font-weight: 700; }
.steer-hint { position: absolute; bottom: 34px; left: 50%; z-index: 1; display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100% - 24px); padding: 10px 14px; border: 1px solid #9dcfff70; border-radius: 12px; background: #172c3aeb; color: #f2f8ff; transform: translateX(-50%); font-size: 12px; font-weight: 650; line-height: 1.35; pointer-events: none; }
.steer-hint * { pointer-events: none; }
.steer-hint small { display: block; margin-top: 2px; color: #bfd3df; font-size: 10px; font-weight: 450; }
.steer-gesture { display: flex; align-items: center; gap: 8px; color: #80c7ff; }
.steer-gesture .hint-arrow { width: 12px; height: 20px; }
.steer-gesture .hint-finger { width: 22px; height: 28px; animation: demonstrate-steering 1.8s ease-in-out infinite; }
@keyframes demonstrate-steering { 0%, 100% { transform: translateX(-7px); } 50% { transform: translateX(7px); } }
.race-message { position: absolute; top: 27%; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 18px; border-radius: 30px; color: var(--night); background: var(--turbo); box-shadow: 0 5px 14px #19262c20; font-size: 13px; font-weight: 850; letter-spacing: .8px; text-align: center; pointer-events: none; }
.race-message.race-impact { color: #fff; background: #a33425; box-shadow: 0 5px 18px #69211455; }
.service-stop-status { position: absolute; z-index: 3; top: 78px; right: 14px; width: 220px; max-width: 70%; padding: 12px 14px; border: 1px solid #8be0d2; border-radius: 13px; color: #f4fff9; background: #173e43ed; box-shadow: 0 5px 18px #14272d35; pointer-events: none; }
.service-stop-status strong, .service-stop-status > span { display: block; }
.service-stop-status strong { font-size: 15px; }
.service-stop-status > span { margin-top: 4px; font-size: 11px; line-height: 1.45; color: #d5f1e7; }
.service-stop-meter { height: 4px; overflow: hidden; border-radius: 4px; background: #ffffff25; display: none !important; }
.service-stop-active .service-stop-meter { display: block !important; margin-top: 9px; }
.service-stop-meter > span { display: block; height: 100%; background: #bdef62; }
.service-stop-ahead { width: 240px; max-width: calc(100% - 28px); color: #192e32; background: #ffe174; border: 2px solid #fff5c7; box-shadow: 0 4px 0 #ac7732, 0 8px 24px #14272d35; }
.service-stop-ahead strong { font-size: 16px; letter-spacing: .06em; }
.service-stop-ahead > span { color: #192e32; font-size: 13px; font-weight: 750; }
.service-stop-ahead .service-stop-reward { margin-top: 7px; padding-top: 7px; border-top: 1px solid #192e3230; font-size: 10px; font-weight: 600; }
.service-stop-status [hidden] { display: none !important; }
.service-stop-boosted { border-color: #bdef62; }
.graphics-error { position: absolute; inset: 15px 15px auto; z-index: 9; max-height: calc(100% - 30px); overflow-y: auto; padding: 14px; background: #fff3da; color: #493b25; border: 1px solid #e9c876; border-radius: 10px; font-size: 12px; line-height: 1.6; }
.graphics-error p { margin: 0; }
.graphics-error .button-row { margin-top: 14px; }
.graphics-error .button { min-width: 0; }

.overlay { position: absolute; inset: 0; z-index: 2; display: flex; color: white; padding: 34px; overflow-y: auto; }
.start-overlay { flex-direction: column; justify-content: flex-end; justify-content: safe flex-end; background: linear-gradient(180deg, #14272d00 12%, #14272d18 24%, #14272dce 69%, #14272df5 100%); }
.start-content { width: 100%; flex-shrink: 0; }
.start-kicker { display: inline-flex; align-items: center; gap: 8px; color: #edf1df; font-size: 9px; font-weight: 650; letter-spacing: 1.6px; text-transform: uppercase; }
.start-kicker svg { width: 20px; height: 20px; stroke-width: 1.4; }
.flag-checks { fill: currentColor; stroke: none; }
.overlay h2 { max-width: 100%; margin: 10px 0 10px; font-size: clamp(32px, 5.5vw, 48px); line-height: 1.05; font-weight: 800; letter-spacing: -1.9px; text-wrap: balance; }
.overlay p { margin: 0 0 20px; color: #d6e2e3; font-size: 13px; line-height: 1.7; }
.overlay .friend-challenge { width: fit-content; margin: 0 0 10px; padding: 5px 10px; border-radius: 7px; background: #ffffff17; color: #fff; font-size: 11px; }
.race-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 9px 12px; margin: 0 0 16px; max-width: 354px; }
.race-options .service-picker { grid-column: 1 / -1; }
.race-options label { flex: 1; min-width: 0; margin: 0; color: #c2d0d2; font-size: 9px; font-weight: 550; letter-spacing: .5px; }
.race-options select { margin-top: 5px; padding: 8px 26px 8px 11px; min-height: 38px; border: 1px solid #ffffff3b; background: #263b42; color: #fff; border-radius: 8px; font-size: 12px; cursor: pointer; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 15px; min-height: 48px; border: 0; border-radius: 10px; padding: 13px 20px; color: inherit; font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; }
.primary { background: var(--night); color: #fff; }
.secondary { border: 1px solid #dce3dc; background: #f7f8f4; color: #35464c; }
.overlay .primary { min-width: 210px; min-height: 52px; background: var(--turbo); color: #26322d; box-shadow: 0 3px 0 #00000015; }
.overlay .primary svg { width: 20px; height: 20px; margin-left: 18px; }
.start-help { display: inline-block; margin-left: 16px; color: #b8c7c9; font-size: 10px; line-height: 1.6; }
.button:disabled { opacity: .58; cursor: wait; }
.button[aria-busy="true"] { opacity: 1; }
.button[aria-busy="true"] svg { display: none; }
.button[aria-busy="true"]::after { content: ""; width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: race-loading-spin .85s linear infinite; }
@keyframes race-loading-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .button[aria-busy="true"]::after { animation: none; } }
.start-links button:disabled { opacity: .5; cursor: wait; }
.arcade .reload-game { min-width: 0; margin: 0 0 10px; font-size: 12px; }
.button:hover { filter: brightness(1.045); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #e8a733; outline-offset: 3px; }
.finish-overlay { flex-direction: column; align-items: center; justify-content: center; justify-content: safe center; text-align: center; background: linear-gradient(#14272d65, #14272deb); }
.finish-service-link { display: inline-block; padding: 7px 12px; border: 0; background: transparent; color: #ddf4aa; font: inherit; font-size: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.finish-overlay .eyebrow { color: #ccd9d9; }
.finish-brand { display: flex; align-items: center; gap: 9px; max-width: 100%; text-align: left; }
.finish-brand > div { min-width: 0; }
.finish-brand > div:only-child, .finish-logo[hidden] + div { text-align: center; }
.finish-brand .eyebrow { font-size: 8px; letter-spacing: 1.1px; }
.finish-shop-name { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #eef4f3; font-size: 12px; font-weight: 650; }
.finish-result { min-width: 0; max-width: 100%; }
.finish-actions { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 350px; }
.finish-place { margin: 10px 0 0; color: var(--turbo); font-size: 100px; font-weight: 900; line-height: 1; letter-spacing: -7px; }
.finish-overlay h2 { font-size: 32px; letter-spacing: -1px; margin-top: 10px; }
.finish-time { display: flex; justify-content: center; align-items: baseline; gap: 9px; margin: 0 0 12px; }
.finish-time span { color: #b9cccf; font-size: 9px; font-weight: 650; letter-spacing: .7px; text-transform: uppercase; }
.finish-time strong { color: #fff; font-size: 21px; line-height: 1.2; font-weight: 750; font-variant-numeric: tabular-nums; }
.finish-overlay p { max-width: 350px; margin-bottom: 20px; }
.race-replay { min-width: 210px; color: #eef4f3; border: 1px solid #aabfc43d; background: #ffffff08; margin-top: 10px; }

/* Fixed-size thumb targets never depend on the frame rate or canvas resolution. */
.controls { display: flex; align-items: center; gap: 20px; min-height: 94px; padding: 14px 20px max(14px, env(safe-area-inset-bottom)); background: var(--night); }
.steering { display: flex; gap: 10px; }
.controls button { touch-action: none; -webkit-user-select: none; user-select: none; }
.steering button { display: grid; place-items: center; width: 76px; min-height: 62px; border: 1px solid #526167; border-radius: 14px; background: #304148; color: #f5f8f6; box-shadow: 0 3px 0 #0c191f; }
.steering svg { width: 26px; height: 26px; stroke-width: 2.2; }
.steering button:active { background: #476069; transform: translateY(2px); box-shadow: 0 1px 0 #0c191f; }
.speed { margin-left: auto; text-align: center; }
.speed strong { display: block; color: #f5f8f6; font-size: 25px; font-weight: 650; line-height: 1.05; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.speed > span { display: block; color: #9cadaf; font-size: 8px; text-transform: uppercase; letter-spacing: 1.1px; margin-top: 4px; }
.boost-button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; width: 138px; min-width: 116px; min-height: 62px; color: #c1cecd; border: 1px solid #526167; border-radius: 14px; background: #304148; box-shadow: 0 3px 0 #0c191f; }
.boost-button.turbo-hint { outline: 3px solid #67baff; outline-offset: 3px; }
.boost-button.turbo-hint::after { content: ""; position: absolute; inset: -7px; border: 2px solid #67baff; border-radius: 20px; pointer-events: none; animation: introduce-turbo 1.4s ease-out infinite; }
.boost-button.turbo-hint::before { content: "Tap Turbo"; position: absolute; bottom: calc(100% + 13px); right: 0; padding: 5px 9px; border-radius: 7px; color: #fff; background: #176ab0; font-size: 10px; font-weight: 700; line-height: 1.2; white-space: nowrap; pointer-events: none; }
@keyframes introduce-turbo { from { opacity: .85; transform: scale(1); } to { opacity: 0; transform: scale(1.12, 1.18); } }
.boost-ready { border-color: #ffe09d; color: #26322d; background: var(--turbo); box-shadow: 0 3px 0 #b28b3b; }
.boost-button:active { transform: translateY(2px); box-shadow: none; }
#boost-label { font-size: 11px; font-weight: 800; letter-spacing: 1px; }
.boost-meter { display: block; width: 72%; height: 4px; overflow: hidden; border-radius: 4px; background: #16252c2b; }
#boost-fill { display: block; width: 100%; height: 100%; background: currentColor; }
.status { min-height: 17px; margin: 19px 0 6px; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.6; }
.desktop-help { display: flex; align-items: center; justify-content: center; gap: 5px; margin: 0 0 19px; font-size: 9px; color: #83908f; }
.desktop-help > span { margin: 0 5px; }
kbd { font-family: inherit; min-width: 16px; border: 1px solid #dfe4dd; border-radius: 3px; padding: 1px 4px; text-align: center; color: #64736f; }
.best { display: flex; justify-content: space-between; gap: 14px; border-top: 1px solid #dfe4de; padding: 16px 2px 26px; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.best strong { margin-left: 8px; color: var(--ink); font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.demo-banner { color: #7b827b; font-size: 10px; line-height: 1.5; margin: -6px 0 22px; text-align: center; }

.panel { margin: 0 0 18px; padding: 28px; border: 1px solid #dfe5dd; border-radius: 17px; background: #fff; }
.panel h2 { font-size: 25px; line-height: 1.2; font-weight: 750; letter-spacing: -.8px; margin: 7px 0 10px; }
.panel h3 { font-size: 19px; line-height: 1.3; letter-spacing: -.35px; margin: 8px 0; }
.panel p { font-size: 13px; color: var(--muted); line-height: 1.7; margin: 0 0 18px; }
.result-stats { display: flex; gap: 28px; margin: 21px 0 0; }
.result-stats > div { display: flex; flex-direction: column; gap: 5px; }
.result-stats span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.result-stats strong { color: var(--ink); font-size: 25px; font-weight: 750; line-height: 1.15; font-variant-numeric: tabular-nums; }
.score-details { margin-top: 20px; border-bottom: 1px solid #e2e8e1; padding-bottom: 14px; }
.score-details summary { cursor: pointer; min-height: 28px; font-size: 12px; font-weight: 650; }
.score-breakdown { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin: 14px 0; font-size: 12px; }
.score-breakdown > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; }
.score-breakdown dt { color: var(--muted); }
.score-breakdown dd { margin: 0; font-weight: 750; font-variant-numeric: tabular-nums; }
.score-details p { margin-bottom: 0; font-size: 11px; }
.panel .leaderboard-form { margin-top: 22px; padding-top: 16px; }
.leaderboard-form h3 { margin-top: 0; }
.leaderboard-form p { max-width: 590px; margin-bottom: 14px; font-size: 12px; }
.nickname-row { display: flex; align-items: flex-end; gap: 12px; max-width: 590px; }
.nickname-row label { flex: 1; min-width: 0; margin: 0; }
.nickname-row label > span { color: var(--muted); font-weight: 450; }
.nickname-row .button { flex-shrink: 0; min-height: 45px; margin-bottom: 1px; }
.panel #leaderboard-submit-status { margin: 10px 0 0; }
.panel #leaderboard-submit-status:empty { display: none; }
.challenge-intro { margin-top: 24px; padding-top: 16px; border-top: 1px solid #e2e8e1; }
.challenge-intro h3 { margin-top: 0; }
.challenge-intro p { margin-bottom: 14px; }
.leaderboard-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.leaderboard-heading > div { min-width: 0; }
.leaderboard h2 { overflow-wrap: anywhere; }
.leaderboard-tabs { display: inline-flex; gap: 4px; max-width: 100%; margin: 11px 0 18px; padding: 4px; background: #edf1ed; border-radius: 10px; }
.leaderboard-tabs button { min-height: 40px; padding: 10px 18px; border: 0; border-radius: 7px; color: #65736e; background: transparent; font-size: 12px; font-weight: 700; }
.leaderboard-tabs button[aria-selected="true"] { background: var(--night); color: #fff; box-shadow: 0 2px 4px #19262c12; }
.leaderboard-tabs button[aria-selected="false"]:hover { color: var(--ink); background: #e1e8e1; }
#leaderboard-panel { outline-offset: 5px; border-radius: 4px; }
#leaderboard-panel:focus-visible { outline: 3px solid #e8a733; }
.leaderboard-table { width: 100%; table-layout: fixed; border-collapse: collapse; color: var(--ink); font-size: 13px; }
.leaderboard-table thead th { padding: 0 10px 10px; color: var(--muted); font-size: 9px; font-weight: 650; letter-spacing: .7px; text-align: left; text-transform: uppercase; }
.leaderboard-table th:first-child, .leaderboard-table td:first-child { width: 56px; padding-left: 2px; }
.leaderboard-table th:nth-child(3), .leaderboard-table td:nth-child(3) { width: 88px; text-align: right; }
.leaderboard-table th:last-child, .leaderboard-table td:last-child { width: 98px; padding-right: 2px; text-align: right; }
.leaderboard-table td, .leaderboard-table tbody th { padding: 14px 10px; border-top: 1px solid #e7ece6; line-height: 1.4; font-variant-numeric: tabular-nums; }
.leaderboard-table tbody th { overflow-wrap: anywhere; font-weight: 650; text-align: left; }
.leaderboard-ranked-value { font-weight: 750; }
.leaderboard-table tbody tr.leaderboard-your-run { background: #eaf5fc; }
.leaderboard-table td:not(:nth-child(2)) { white-space: nowrap; }
.leaderboard-table tbody tr:first-child { color: #294936; background: #f4f8f0; }
.leaderboard-table tbody tr:first-child td:first-child { border-radius: 7px 0 0 7px; }
.leaderboard-table tbody tr:first-child td:last-child { border-radius: 0 7px 7px 0; }
.panel #leaderboard-status { margin: 0; padding: 20px 8px; border-top: 1px solid #e7ece6; text-align: center; font-size: 12px; }
.panel #leaderboard-status:empty { display: none; }
.leaderboard-retry { display: flex; min-height: 40px; margin: 0 auto 10px; padding: 9px 16px; font-size: 12px; }
.panel .leaderboard-note { margin: 18px 0 0; color: #839087; font-size: 10px; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.button-row > * { flex: 1; white-space: nowrap; }
.offer { margin-top: 23px; padding: 22px; background: #f2f5ed; border: 1px solid #e1e8d7; border-radius: 12px; }
.offer small, .fine-print { font-size: 11px; line-height: 1.6; color: #6a7765; }
.offer p { margin-bottom: 10px; }
label { display: block; margin: 13px 0; color: #43544f; font-size: 12px; font-weight: 650; }
input:not([type="checkbox"]), select { display: block; width: 100%; min-width: 0; margin-top: 6px; padding: 12px; color: var(--ink); background: #fff; border: 1px solid #d3ddd6; border-radius: 9px; font-size: 16px; }
input[type="checkbox"] { flex-shrink: 0; width: 20px; height: 20px; margin: 0; accent-color: var(--brand); }
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; min-width: 0; }
.consent { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.6; }
form { margin-top: 26px; padding-top: 14px; border-top: 1px solid #e2e8e1; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; }
.business-cta { background: transparent; }
.business-cta .button-row { max-width: 520px; }
footer { padding: 12px 0 8px; color: #87918b; text-align: center; font-size: 10px; }
footer a { color: inherit; text-decoration: none; }
footer p { margin: 0; font-size: 9px; line-height: 1.7; }
footer p a { text-decoration: underline; text-underline-offset: 2px; }

body.race-open { position: fixed; width: 100%; overflow: hidden; overscroll-behavior: none; }
.arcade.race-expanded { position: fixed; inset: 0; z-index: 1000; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: 100%; height: 100vh; height: 100dvh; min-height: 0; border: 0; border-radius: 0; padding-top: env(safe-area-inset-top); }
.race-expanded .road-wrap { height: auto; }
.race-expanded .hud { padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
.race-expanded .controls { padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); padding-bottom: max(14px, env(safe-area-inset-bottom)); }

@media (min-width: 1100px) {
  .race-expanded .steering button { width: 92px; }
  .race-expanded .controls { padding-left: 32px; padding-right: 32px; }
  .race-expanded .boost-button { width: 150px; }
}
@media (max-width: 900px) {
  .sound-toggle { width: 44px; padding: 0; }
  #sound-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (min-width: 601px) and (max-width: 900px) and (min-height: 521px) {
  .hud { display: grid; grid-template-columns: max-content max-content minmax(0, 1fr) auto; gap: 7px 12px; }
  .hud-center { grid-column: 1 / -1; grid-row: 1; padding-right: 52px; }
  .sound-toggle { position: absolute; top: 12px; right: 12px; }
  .position-stat { grid-column: 1; grid-row: 2; }
  .lap-stat { grid-column: 2; grid-row: 2; }
  .hud-actions { grid-column: 4; grid-row: 2; justify-self: end; }
  .qe-game-credit { grid-column: 3; grid-row: 2; justify-self: center; margin-left: 0; padding-left: 0; border-left: 0; }
}
@media (max-width: 600px) {
  .game-page { --page-edge: 8px; padding-bottom: 15px; }
  .arcade { height: calc(100svh - var(--page-top) - var(--page-edge)); min-height: 0; border-radius: 16px; }
  .hud { display: grid; grid-template-columns: max-content max-content minmax(0, 1fr) auto; gap: 7px 8px; padding: 10px 12px; min-height: 0; }
  .hud-center { grid-column: 1 / -1; grid-row: 1; justify-content: flex-start; gap: 9px; }
  .hud:has(.sound-toggle:not([hidden])) .hud-center { min-height: 48px; padding-right: 52px; }
  .sound-toggle { position: absolute; top: 12px; right: 12px; }
  .hud-identity:only-child, .hud-logo[hidden] + .hud-identity { text-align: left; }
  .position-stat, .lap-stat { display: flex; align-items: baseline; gap: 6px; }
  .position-stat { grid-column: 1; grid-row: 2; }
  .lap-stat { grid-column: 2; grid-row: 2; text-align: left; }
  .hud .position-stat > span, .hud .lap-stat > span { margin: 0; font-size: 7px; letter-spacing: .6px; }
  .hud strong { font-size: 18px; letter-spacing: -.5px; }
  .position-stat small, .lap-stat small { font-size: 10px; }
  .hud-actions { grid-column: 4; grid-row: 2; justify-self: end; }
  .controls-help { min-height: 28px; padding: 5px 8px; }
  .minimize-race { width: 32px; height: 28px; border-radius: 7px; }
  .minimize-race svg { width: 17px; height: 17px; }
  .hud-logo { --mark-size: 48px; --mark-wide: 126px; }
  #race-shop-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; overflow-wrap: anywhere; font-size: 13px; line-height: 1.3; }
  .race-score { top: 12px; left: 12px; gap: 10px; padding: 6px 9px; }
  .race-score > div { gap: 6px; }
  .race-score .race-clock { padding-left: 10px; }
  .qe-game-credit { grid-column: 3; grid-row: 2; justify-self: center; margin-left: 0; padding-left: 0; border-left: 0; }
  .qe-game-icon { width: 22px; height: 22px; }
  .qe-game-wordmark { font-size: 12px; }
  .qe-credit-label { font-size: 7.5px; }
  .race-score strong { font-size: 16px; }
  .overlay { padding: 23px; }
  .start-overlay { background: linear-gradient(180deg, #14272d00 15%, #14272d15 29%, #14272dce 65%, #14272df7); }
  .overlay h2 { font-size: 36px; letter-spacing: -1.5px; }
  .overlay p { font-size: 12px; margin-bottom: 17px; }
  .race-options { margin-bottom: 15px; }
  .race-options select { min-height: 41px; font-size: 16px; }
  .overlay .primary { width: 100%; }
  .start-help { display: block; margin: 11px 0 0; text-align: center; font-size: 9px; }
  .finish-place { font-size: 80px; margin-top: 8px; }
  .finish-overlay h2 { font-size: 29px; }
  .race-replay { width: 100%; }
  .controls { gap: 12px; min-height: 93px; padding: 14px 13px max(16px, env(safe-area-inset-bottom)); }
  .steering { gap: 8px; }
  .steering button { width: clamp(58px, 16vw, 76px); min-height: 62px; }
  .boost-button { width: 112px; min-width: 102px; }
  .speed strong { font-size: 22px; }
  .speed > span { font-size: 7px; }
  .status { margin-top: 17px; font-size: 10px; }
  .best { padding-top: 15px; padding-bottom: 23px; font-size: 8px; letter-spacing: .7px; }
  .best strong { font-size: 14px; margin-left: 5px; }
  .demo-banner { font-size: 9px; padding: 0 8px; }
  .panel { padding: 22px; }
  .panel h2 { font-size: 23px; }
  .leaderboard-heading { display: block; }
  .leaderboard-tabs { display: flex; margin-top: 17px; }
  .leaderboard-tabs button { flex: 1; padding: 10px 9px; font-size: 11px; }
  .leaderboard-table { font-size: 12px; }
  .leaderboard-table thead th { font-size: 8px; letter-spacing: .3px; padding-right: 6px; padding-left: 6px; }
  .leaderboard-table td, .leaderboard-table tbody th { padding: 13px 6px; }
  .leaderboard-table th:first-child, .leaderboard-table td:first-child { width: 34px; }
  .leaderboard-table th:nth-child(3), .leaderboard-table td:nth-child(3) { width: 60px; }
  .leaderboard-table th:last-child, .leaderboard-table td:last-child { width: 72px; }
  .nickname-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .nickname-row .button { min-height: 46px; margin: 0; }
  .button-row { gap: 8px; }
  .button-row > .button { font-size: 12px; padding-left: 13px; padding-right: 13px; }
  .race-expanded .controls { gap: 12px; }
  .race-expanded .road-wrap { height: auto; }
}
@media (max-width: 359px) {
  .game-page { --page-edge: 6px; }
  .overlay { padding: 19px; }
  .overlay h2 { font-size: 32px; }
  .controls { gap: 9px; padding-left: 10px; padding-right: 10px; }
  .steering button { width: 56px; }
  .boost-button { min-width: 96px; width: 96px; }
  .speed strong { font-size: 19px; }
  .form-row { display: block; }
  .race-expanded .controls { padding-left: 10px; padding-right: 10px; }
  .race-expanded .race-options { gap: 8px; }
  .race-expanded .hud { padding-left: 12px; padding-right: 12px; }
}
@media (pointer: coarse) {
  .desktop-help { display: none; }
  .status { margin-bottom: 18px; }
  .button:hover { filter: none; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .arcade { height: calc(100svh - var(--page-top) - var(--page-edge)); min-height: 0; grid-template-rows: auto minmax(0, 1fr); }
  .game-page { --page-edge: 8px; }
  .arcade.race-expanded { height: 100dvh; grid-template-rows: auto minmax(0, 1fr); }
  .arcade .hud { display: flex; gap: 12px; min-height: 48px; padding-top: 6px; padding-bottom: 6px; }
  .arcade .hud-center { justify-content: center; }
  .arcade .hud:has(.sound-toggle:not([hidden])) .hud-center { min-height: 0; padding-right: 0; }
  .arcade .sound-toggle { position: static; }
  .arcade .hud-identity:only-child, .arcade .hud-logo[hidden] + .hud-identity { text-align: center; }
  .qe-game-credit { gap: 1px; padding-left: 12px; }
  .qe-game-icon { width: 22px; height: 22px; }
  .qe-game-wordmark { font-size: 12px; }
  .hud-logo { --mark-size: 42px; --mark-wide: 140px; }
  .arcade .hud strong { font-size: 21px; }
  .race-expanded .minimize-race { height: 34px; width: 38px; }
  .steer-hint { bottom: 88px; padding: 7px 12px; font-size: 11px; }
  .steer-hint small { font-size: 9px; }
  .steer-gesture .hint-finger { height: 24px; }
  .arcade .controls { position: absolute; bottom: 0; left: 0; right: 0; min-height: 84px; background: linear-gradient(transparent, #19262c30); pointer-events: none; }
  .arcade .controls button { pointer-events: auto; }
  .arcade .steering button { width: 66px; min-height: 58px; background: #24383ee8; border-color: #ced9db75; }
  .arcade .boost-button { min-height: 58px; margin-left: auto; }
  .arcade .speed { display: none; }
  .start-overlay { padding: 22px max(28px, env(safe-area-inset-right)) 88px max(28px, env(safe-area-inset-left)); }
  .start-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, .85fr); align-items: center; gap: 6px 24px; }
  .start-kicker { grid-column: 1; grid-row: 1; font-size: 8px; }
  .start-kicker svg { width: 16px; height: 16px; }
  .start-overlay h2 { grid-column: 1; grid-row: 2; font-size: 28px; margin: 0; letter-spacing: -1px; }
  .start-overlay p { grid-column: 1; grid-row: 3; margin: 0; font-size: 11px; line-height: 1.5; }
  .start-overlay .friend-challenge { grid-row: 4; margin: 0; font-size: 10px; padding: 3px 7px; }
  .race-options { grid-column: 2; grid-row: 1 / 3; width: 100%; margin: 0; gap: 8px; }
  .race-options select { min-height: 36px; padding: 6px 20px 6px 8px; }
  #play { grid-column: 2; grid-row: 3 / 5; width: 100%; min-width: 0; }
  #start-status { grid-column: 1 / -1; grid-row: 5; }
  #reload-game { grid-column: 2; grid-row: 6; }
  .start-help { display: none; }
  .arcade .finish-overlay { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 260px); grid-template-rows: auto auto; align-content: center; align-content: safe center; justify-items: center; gap: 7px 24px; padding: 16px max(85px, env(safe-area-inset-right)) 80px max(85px, env(safe-area-inset-left)); }
  .arcade .finish-brand { grid-column: 1; grid-row: 1; }
  .arcade .finish-result { grid-column: 1; grid-row: 2; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 3px 12px; }
  .arcade .finish-actions { grid-column: 2; grid-row: 1 / 3; }
  .arcade .finish-place { grid-column: 1; grid-row: 1 / 4; font-size: 55px; letter-spacing: -3px; margin-top: 0; }
  .arcade .finish-overlay h2 { grid-column: 2; font-size: 21px; margin: 0; }
  .arcade .finish-time { grid-column: 2; flex-wrap: wrap; gap: 3px 7px; margin: 3px 0; }
  .arcade .finish-time span { font-size: 8px; }
  .arcade .finish-time strong { font-size: 17px; }
  .arcade .finish-overlay p { grid-column: 2; margin-bottom: 0; font-size: 10px; line-height: 1.45; }
  .arcade .overlay .button { width: auto; min-height: 40px; padding: 9px 15px; font-size: 11px; }
  .arcade .finish-actions .button { width: 100%; min-width: 0; }
  .arcade .race-replay { margin-top: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .steer-gesture .hint-finger, .boost-button.turbo-hint::after { animation: none; }
}
/* Results, offers and secondary views stay inside the game. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.start-best, .start-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 14px; color: #becfce; font-size: 10px; }
.start-best strong { color: #fff; margin-left: 4px; }
.start-links { margin-top: 6px; }
.start-links button, .finish-links button { min-height: 36px; padding: 4px 0; border: 0; background: none; color: #deebea; font-size: 11px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.start-links span { font-size: 9px; }
.start-links #remembered-racer { flex-basis: 100%; font-size: 11px; overflow-wrap: anywhere; }
#remembered-name { color: #fff; }
#change-nickname { margin-left: 8px; }
.arcade.race-ready, .arcade.race-complete, .arcade.panel-open { grid-template-rows: auto minmax(0, 1fr); }
.race-ready > .controls, .race-ready .race-score, .race-complete > .controls, .panel-open > .controls, .race-complete .race-score { display: none; }
.arcade .finish-overlay { display: flex; flex-direction: column; align-items: center; justify-content: safe center; padding: 22px; background: linear-gradient(#14272dc9, #14272df2); }
.finish-main { display: grid; gap: 18px; width: min(100%, 760px); flex-shrink: 0; }
.finish-summary { min-width: 0; }
.finish-brand { display: flex; align-items: center; justify-content: center; gap: 9px; text-align: left; }
.finish-brand > div { min-width: 0; }
.finish-brand .eyebrow { color: #bfd1d0; font-size: 8px; }
.finish-logo { --mark-size: 72px; --mark-wide: 180px; }
.finish-brand:has([data-logo-shape="wide"]) { flex-direction: column; gap: 8px; text-align: center; }
.finish-brand:has([data-logo-shape="wide"]) > div { width: 100%; text-align: center; }
.finish-logo[data-logo-shape="wide"] { --mark-wide: 240px; max-width: 100%; }
.finish-shop-name { display: block; color: #fff; font-size: 18px; font-weight: 750; line-height: 1.25; white-space: normal; overflow-wrap: anywhere; }
body[data-frame-branding="name"] #race-shop-name { font-size: 21px; }
body[data-frame-branding="name"] .finish-shop-name { font-size: 24px; }
.hud-center.is-logo-only { justify-content: center; }
.hud-center.is-logo-only .hud-identity { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hud-center.is-logo-only .hud-logo { --mark-wide: 280px; max-width: calc(100% - 80px); flex-shrink: 1; }
.finish-brand.is-logo-only .finish-logo { --mark-wide: 280px; max-width: 100%; }
.arcade .finish-result { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 14px; text-align: left; }
.arcade .finish-place { margin: 0; color: var(--turbo); font-size: 62px; font-weight: 900; line-height: 1; letter-spacing: -3px; }
.arcade .finish-overlay h2 { margin: 0 0 8px; font-size: 25px; line-height: 1.1; letter-spacing: -.7px; }
.arcade .finish-time { display: flex; align-items: baseline; gap: 8px; margin: 0; }
.finish-time span { color: #b9cccf; font-size: 9px; text-transform: uppercase; }
.finish-time strong { color: #fff; font-size: 19px; font-variant-numeric: tabular-nums; }
.arcade .finish-result p { margin: 5px 0 0; max-width: 290px; color: #d6e2e3; font-size: 12px; line-height: 1.45; }
.finish-offer { min-width: 0; width: 100%; color: #203638; text-align: left; }
.offer-fallback { position: relative; padding: 24px; border: 1px solid #f0e5b9; border-radius: 8px; background: #fff8df; box-shadow: 0 8px 25px #0002; clip-path: polygon(0 0, 100% 0, 100% calc(62% - 9px), calc(100% - 9px) 62%, 100% calc(62% + 9px), 100% 100%, 0 100%, 0 calc(62% + 9px), 9px 62%, 0 calc(62% - 9px)); }
.offer-fallback::before { content: ""; position: absolute; inset: 7px; border: 1px dashed #b4a676; border-radius: 3px; pointer-events: none; }
.coupon-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.coupon-badge { display: inline-block; padding: 6px 9px; border: 1px solid #213d3d; color: #213d3d; font-size: 11px; font-weight: 850; line-height: 1; letter-spacing: 1.5px; text-transform: uppercase; }
.coupon-tearoff { margin: 18px -12px 0; padding: 17px 12px 0; border-top: 2px dashed #b4a676; }
.finish-offer .eyebrow { color: #6b613a; font-size: 9px; }
.finish-offer h3 { margin: 10px 0 12px; font-size: clamp(21px, 3.5vw, 30px); line-height: 1.2; letter-spacing: -.6px; overflow-wrap: anywhere; white-space: pre-wrap; }
.arcade .offer-fallback p { max-width: none; margin: 0 0 14px; color: #53654f; font-size: 12px; line-height: 1.5; }
.finish-offer small { display: block; margin-top: 12px; color: #757055; font-size: 9px; line-height: 1.5; }
.offer-save-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.arcade .offer-save-actions .button { min-width: 0; min-height: 44px; margin: 0; padding: 10px 16px; border: 1px solid #aabfc466; background: #ffffff12; color: #fff; box-shadow: none; font-size: 12px; }
.offer-save-actions .button:focus-visible { outline: 3px solid var(--turbo); outline-offset: 3px; }
.arcade .finish-offer .offer-save-status { max-width: none; margin: 8px 0 0; color: #d6e2e3; font-size: 11px; line-height: 1.5; text-align: center; }
.offer-save-status:empty { display: none; }
.finish-offer.offer-locked .offer-fallback { background: #eef1e9; border-color: #d7dfd2; }
.arcade .finish-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; max-width: none; }
.arcade .finish-actions .button { width: 100%; max-width: 350px; min-width: 0; }
.arcade .race-replay { margin: 0; min-height: 46px; padding: 12px 20px; border: 1px solid #aabfc466; background: #ffffff12; color: #fff; }
.finish-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 18px; }
#offer-image { display: block; width: 100%; max-width: 100%; height: auto; border-radius: 8px; box-shadow: 0 8px 25px #0002; -webkit-touch-callout: default; -webkit-user-select: auto; user-select: auto; touch-action: pan-y pinch-zoom; }
.arcade .game-panel { display: block; padding: 0; z-index: 8; background: #f6f8f3; color: var(--ink); }
.game-panel-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 18px; padding: 12px 20px; background: #f6f8f3f5; border-bottom: 1px solid #dce5da; }
.game-panel-header button { min-height: 42px; border: 0; background: transparent; color: #315650; font: inherit; font-size: 13px; font-weight: 700; }
.arcade .game-panel-header h2 { margin: 0; color: #233a38; font-size: 21px; letter-spacing: -.5px; }
.game-panel-view { max-width: 800px; margin: auto; padding: 22px; }
.game-panel .panel { padding: 0; margin: 20px 0; border: 0; background: transparent; }
.arcade .game-panel p { max-width: none; margin: 8px 0 16px; color: #67776e; font-size: 13px; line-height: 1.6; }
.arcade .game-panel h2 { color: #203b35; font-size: 23px; }
.arcade .game-panel h3 { color: #203b35; font-size: 19px; }
.arcade .game-panel .primary { min-width: 0; background: #203b35; color: #fff; }
.game-best { display: flex; flex-wrap: wrap; gap: 10px 24px; font-size: 12px; color: #5f7569; }
.game-panel .result-stats { margin-top: 20px; }
.game-panel .leaderboard-form { padding: 18px 0; }
.game-panel .challenge-intro { margin-top: 0; padding-top: 0; border: 0; }
.game-panel .business-cta { margin-top: 0; }
.game-panel .business-cta .button-row, .graphics-error .button-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.game-panel .business-cta .button-row > .button, .graphics-error .button-row > .button { width: auto; min-width: 0; white-space: normal; text-align: center; }
.arcade .in-game-privacy { padding-top: 18px; font-size: 10px; }
.in-game-privacy a { color: inherit; }
@media (min-width: 760px) {
  .finish-main.has-offer { grid-template-columns: .9fr 1.1fr; gap: 22px 30px; align-items: center; }
  .has-offer .finish-summary { grid-column: 1; grid-row: 1; align-self: end; }
  .has-offer .finish-actions { grid-column: 1; grid-row: 2; align-self: start; }
  .has-offer .finish-offer { grid-column: 2; grid-row: 1 / 3; }
}
@media (max-width: 600px) {
  .arcade .finish-overlay { padding: 18px; }
  .finish-main { gap: 16px; }
  .finish-logo { --mark-size: 56px; --mark-wide: 154px; }
  .finish-shop-name { font-size: 16px; }
  body[data-frame-branding="name"] #race-shop-name { font-size: 17px; }
  body[data-frame-branding="name"] .finish-shop-name { font-size: 21px; }
  .offer-fallback { padding: 18px; }
  .arcade .finish-place { font-size: 52px; }
  .arcade .finish-overlay h2 { font-size: 23px; }
  .game-panel-view { padding: 18px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .start-best { grid-column: 1; grid-row: 5; margin-top: 2px; }
  .start-links { grid-column: 2; grid-row: 5; margin-top: 0; }
  .arcade .finish-overlay { padding: 14px 24px; }
  .finish-logo { --mark-size: 48px; --mark-wide: 144px; }
  .finish-shop-name { font-size: 15px; }
  .finish-main.has-offer { grid-template-columns: .9fr 1.1fr; gap: 12px 24px; align-items: center; }
  .has-offer .finish-summary { grid-column: 1; grid-row: 1; align-self: end; }
  .has-offer .finish-actions { grid-column: 1; grid-row: 2; align-self: start; }
  .has-offer .finish-offer { grid-column: 2; grid-row: 1 / 3; }
  .arcade .finish-place { font-size: 48px; }
  .finish-offer h3 { font-size: 22px; }
}
/* Keep the document itself to one game viewport, including before play. */
.game-page { padding-bottom: var(--page-edge); }
#start-status { margin: 10px 0; padding: 8px 10px; border-radius: 8px; background: #493722; color: #ffe4a3; font-size: 12px; }
#share-status:empty { display: none; }
.arcade { height: calc(100svh - var(--page-top) - var(--page-edge)); }
@media (max-width: 680px) {
  .race-ready .start-overlay { background: linear-gradient(180deg, #14272d80, #14272d70 35%, #14272dce 65%, #14272df7); }
}
@media (max-height: 540px) and (min-width: 600px) {
  .race-ready .start-overlay { padding-bottom: 22px; }
}

/* Challenge sharing is available directly beside the completed race. */
.finish-share { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; justify-self: center; gap: 7px 12px; width: 100%; max-width: 350px; }
.arcade .finish-share .finish-challenge { width: 100%; min-width: 0; min-height: 50px; padding: 13px 15px; font-size: 14px; font-weight: 800; white-space: normal; }
.finish-challenge span { margin-left: 5px; }
.finish-copy-link { min-height: 44px; padding: 7px 0; border: 0; background: none; color: #ecf4f3; font-size: 11px; font-weight: 650; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
.finish-copy-link:disabled { opacity: .58; cursor: wait; }
.finish-share-link, .finish-share-status { grid-column: 1 / -1; }
.arcade .finish-share-status { margin: 0; max-width: none; color: #e1edea; font-size: 11px; line-height: 1.4; text-align: center; }
.finish-share input.finish-share-link { margin: 0; padding: 9px 10px; font-size: 14px; }
@media (max-width: 360px) {
  .qe-game-icon { width: 20px; height: 20px; }
  .qe-game-wordmark { font-size: 11px; }
  .controls-help { width: 32px; padding: 5px; }
  .controls-help > span { display: none; }
  .controls-help::after { content: "?"; font-size: 14px; font-weight: 750; }
  .finish-share { gap: 6px 9px; }
  .arcade .finish-share .finish-challenge { padding: 12px 10px; font-size: 13px; }
}
@media (min-width: 760px), (max-height: 520px) and (orientation: landscape) {
  .has-offer > .finish-leaderboard { grid-column: 1; grid-row: 2; }
  .has-offer > .finish-share { grid-column: 1; grid-row: 3; }
  .has-offer > .finish-actions { grid-column: 1; grid-row: 4; }
  .has-offer > .finish-offer { grid-row: 1 / 5; }
}

/* Enter a nickname where the player sees their result, without another panel. */
.finish-leaderboard { justify-self: center; width: 100%; max-width: 350px; min-width: 0; padding: 14px; border: 1px solid #b9d9cd; border-radius: 13px; background: #eaf4ee; color: #24443f; text-align: left; }
.finish-leaderboard .leaderboard-form { margin: 0; padding: 0; border: 0; }
.finish-leaderboard h3 { margin: 0 0 9px; font-size: 16px; font-weight: 750; line-height: 1.25; }
.finish-leaderboard label { display: block; margin: 0 0 5px; color: #355b51; font-size: 11px; font-weight: 650; }
.finish-leaderboard .nickname-row { display: grid; grid-template-columns: minmax(0, 1fr) 112px; align-items: stretch; gap: 8px; width: 100%; }
.finish-leaderboard input { margin: 0; padding: 10px; min-height: 44px; border-color: #b4cbbf; font-size: 16px; }
.arcade .finish-leaderboard .primary { width: 100%; min-width: 0; min-height: 44px; margin: 0; padding: 9px 10px; background: #24443f; color: #fff; box-shadow: none; font-size: 12px; line-height: 1.3; }
.arcade .finish-leaderboard p { max-width: none; margin: 8px 0 0; color: #526d62; font-size: 10px; line-height: 1.4; }
.arcade .finish-leaderboard #leaderboard-submit-status { color: #8a3425; font-size: 11px; }
#leaderboard-submit-status:empty { display: none; }
.leaderboard-saved-heading { display: flex; align-items: center; gap: 10px; }
.leaderboard-saved-heading > span { display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; color: #fff; background: #33745d; font-size: 20px; }
.leaderboard-saved-heading > div { min-width: 0; }
.leaderboard-saved-heading strong { font-size: 15px; }
.arcade .leaderboard-published #leaderboard-published-details { margin: 3px 0 0; color: #355b51; font-size: 12px; overflow-wrap: anywhere; }
.leaderboard-published button { min-height: 36px; margin-top: 5px; padding: 5px 0; border: 0; background: none; color: #24443f; font: inherit; font-size: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.leaderboard-published #forget-nickname { display: block; margin: 0; font-size: 11px; font-weight: 500; }
.leaderboard-published small { display: block; color: #526d62; font-size: 10px; line-height: 1.4; }
/* The server supplies the business-local expiration date on earned coupons. */
.finish-offer .coupon-expiry { font-weight: 800; color: #243c36; margin: .6rem 0; }

/* The host supplies the frame size; panels scroll inside one fitted game view. */
body.embedded { overflow: hidden; }
.embedded .game-page { --page-edge: 0px; --page-top: 0px; width: 100%; padding: 0; }
.embedded .arcade, .embedded .arcade.race-expanded { width: 100%; height: 100vh; height: 100svh; min-height: 0; border-radius: 0; box-shadow: none; }
