* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #3d3c4a; font-family: system-ui, "Segoe UI", Tahoma, sans-serif; color: #fff; user-select: none; -webkit-user-select: none; touch-action: none; }
#game { position: fixed; inset: 0; }
.hidden { display: none !important; }

#hud { position: fixed; inset: 0; pointer-events: none; text-shadow: 0 2px 4px rgba(0,0,0,.5); }
#hud-left { position: absolute; top: 16px; left: 16px; font-weight: 700; font-size: 18px; line-height: 1.3; }
#hud-left .big { font-size: 56px; line-height: 1; }
#hud-left .big small { font-size: 22px; opacity: .8; }
#time { font-variant-numeric: tabular-nums; opacity: .9; }

#board { position: absolute; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
#board .row { display: flex; align-items: center; gap: 8px; background: rgba(20,18,35,.55); padding: 4px 10px 4px 6px; border-radius: 6px; min-width: 150px; }
#board .row.me { background: rgba(255,170,40,.85); color: #222; text-shadow: none; }
#board img { width: 24px; height: 16px; object-fit: cover; border-radius: 2px; }

#minimap { position: absolute; left: 16px; bottom: 16px; width: 150px; height: 150px; background: rgba(20,18,35,.45); border-radius: 10px; }

#speedo { position: absolute; right: 20px; bottom: 16px; font-weight: 800; font-size: 54px; text-align: right; font-variant-numeric: tabular-nums; }
#speedo small { font-size: 16px; margin-left: 4px; opacity: .8; }
#boostbar { width: 160px; height: 8px; background: rgba(0,0,0,.4); border-radius: 4px; margin-left: auto; overflow: hidden; }
#boostfill { height: 100%; width: 0; background: linear-gradient(90deg, #4fd1ff, #ff5ad9); }

#center-msg { position: absolute; top: 34%; left: 0; right: 0; text-align: center; font-size: 96px; font-weight: 900; letter-spacing: 2px; }
#center-msg.small { font-size: 40px; color: #ff6a5a; }
#net-info { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); font-size: 13px; font-weight: 700; opacity: .75; font-variant-numeric: tabular-nums; }
#net-info.warn { color: #ff6a5a; opacity: 1; }

#touch { position: absolute; left: 0; right: 0; bottom: 180px; display: none; justify-content: space-between; padding: 0 16px; pointer-events: none; }
#touch .tgroup { display: flex; gap: 10px; pointer-events: auto; }
#touch button { width: 72px; height: 72px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); background: rgba(20,18,35,.45); color: #fff; font-size: 22px; font-weight: 800; touch-action: none; }
#touch button[data-k="drift"] { font-size: 12px; }
#touch button.on { background: rgba(255,170,40,.7); }
body.touch #touch { display: flex; }
#touch button[data-k="item"] { display: none; font-size: 12px; background: rgba(160,80,255,.45); }
body.party #touch button[data-k="item"] { display: block; }
/* party mode item slot (above the speedometer) */
#item-slot { position: absolute; right: 20px; bottom: 112px; width: 76px; height: 76px; border-radius: 16px; border: 2px solid rgba(255,255,255,.35);
  background: rgba(20,18,35,.55); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 38px; line-height: 1; }
#item-slot small { font-size: 11px; font-weight: 800; opacity: .8; margin-top: 4px; }
#item-slot.full { border-color: #ffb02e; box-shadow: 0 0 14px rgba(255,176,46,.6); }

/* centred when it fits; when taller than the screen it scrolls from the top (auto margins collapse) */
.overlay::before, .overlay::after { content: ''; margin: auto; }
.overlay { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 14px; background: rgba(30,28,48,.72); backdrop-filter: blur(3px); padding: 16px; text-align: center; overflow-y: auto; }
.overlay h1 { margin: 0; font-size: clamp(40px, 9vw, 84px); font-weight: 900; letter-spacing: 4px; color: #ffb02e; text-shadow: 0 4px 0 #8a4b00; }
.sub { margin: 0; opacity: .85; }
.help { max-width: 560px; font-size: 13px; opacity: .75; line-height: 1.6; margin: 0; }
.cars { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.car { width: 130px; padding: 8px; border-radius: 10px; background: rgba(255,255,255,.08); border: 2px solid transparent; cursor: pointer; font-weight: 700; font-size: 13px; }
.car img { width: 100%; display: block; }
.car.sel { border-color: #ffb02e; background: rgba(255,176,46,.18); }
.car .stats { font-weight: 400; font-size: 11px; opacity: .8; }
.skins { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 600px; margin-top: 8px; }
.skin { width: 64px; padding: 4px; border-radius: 8px; background: rgba(255,255,255,.06); border: 2px solid transparent; cursor: pointer; font-size: 10px; line-height: 1.2; position: relative; }
.skin img { width: 100%; display: block; }
.skin.sel { border-color: #ffb02e; background: rgba(255,176,46,.18); }
.skin.locked { cursor: default; opacity: .45; }
.skin.locked img { filter: grayscale(1) brightness(.6); }
.skin .lock { position: absolute; top: 4px; right: 4px; font-weight: 800; background: rgba(0,0,0,.6); border-radius: 4px; padding: 0 3px; }
.level-row { display: flex; align-items: center; gap: 8px; justify-content: center; }
.xpbar { width: 160px; height: 8px; border-radius: 4px; background: rgba(255,255,255,.15); overflow: hidden; }
.xpbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #4fd1ff, #ff4de6); transition: width .4s; }
.xp-gain { color: #7cff6b; font-weight: 800; }
.badge { font-weight: 900; margin-left: 4px; }
.tier { font-weight: 800; }
#lb-season { margin: 0; font-size: 13px; }
#mode-info { font-weight: 800; font-size: 18px; color: #ffb02e; text-shadow: 0 2px 0 rgba(0,0,0,.4); }
#mode-info.warn { color: #ff5a7a; }
.btn { font: inherit; font-weight: 800; font-size: 20px; padding: 12px 36px; border: none; border-radius: 10px; background: #ffb02e; color: #2a1a00; cursor: pointer; box-shadow: 0 4px 0 #8a4b00; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.ghost { background: transparent; color: #fff; box-shadow: none; border: 2px solid rgba(255,255,255,.4); font-size: 16px; padding: 8px 24px; }
#res-table { border-collapse: collapse; font-size: 18px; }
#res-table td { padding: 6px 14px; text-align: left; }
#res-table tr.me { color: #ffb02e; font-weight: 800; }
#res-table img { width: 28px; vertical-align: middle; border-radius: 2px; }
#loading { opacity: .7; margin: 0; }

.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
#name, #code { font: inherit; font-size: 16px; padding: 8px 12px; border-radius: 8px; border: 2px solid rgba(255,255,255,.3); background: rgba(0,0,0,.3); color: #fff; width: 200px; text-align: center; }
#code { width: 130px !important; text-transform: uppercase; letter-spacing: 3px; }
#net-msg { margin: 0; min-height: 1.2em; font-size: 14px; color: #ff8a7a; }
.room-list { display: flex; flex-direction: column; gap: 6px; width: min(420px, 100%); margin: 0 auto; max-height: 30vh; overflow-y: auto; }
.room-list .sub { margin: 4px 0 0; }
.room { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,.3); border-radius: 8px; padding: 6px 10px; font-size: 14px; text-align: left; }
.room img { width: 22px; height: auto; }
.room-host { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-meta { font-size: 12px; opacity: .8; white-space: nowrap; }
.btn.small { font-size: 13px; padding: 4px 12px; }
#lobby-code { font-size: 28px; letter-spacing: 4px; color: #ffb02e; margin: 0 6px; user-select: text; -webkit-user-select: text; }
#lobby-players { display: flex; flex-direction: column; gap: 6px; min-width: min(360px, 100%); }
#lobby-players .lp { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.08); padding: 6px 12px; border-radius: 8px; font-weight: 600; }
#lobby-players .lp.me { outline: 2px solid #ffb02e; }
#lobby-players .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
#lobby-players .lp .car-name { opacity: .7; font-weight: 400; font-size: 13px; margin-left: auto; }
#lobby-players .lp .st { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 6px; background: rgba(255,255,255,.12); }
#lobby-players .lp .st.ok { background: #7cff6b; color: #123; }
#lobby-cars .car { width: 104px; font-size: 12px; }

/* phase 6: ranked */
#lb-tab-lap.on, #lb-tab-ranked.on, #lb-tab-drift.on, #lb-tab-daily.on, #tracks .on, #lobby-track .on, #modes .on, #lobby-mode .on { border-color: #ffb02e; color: #ffb02e; }
#lobby-track { align-items: center; }
.track-random { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.track-random .track-code { color: #ffb02e; cursor: pointer; letter-spacing: 1px; }
.track-random .track-code-in { width: 128px; text-transform: uppercase; }
#mute { position: absolute; top: 160px; left: 16px; pointer-events: auto; font-size: 18px; padding: 4px 10px; }
#volume { width: 140px; accent-color: #ffb02e; vertical-align: middle; }
label.row { align-items: center; cursor: pointer; gap: 6px; }
#public { width: 18px; height: 18px; padding: 0; accent-color: #ffb02e; }
#queue-status { font-size: 18px; }

/* phase 6: accounts */
#account-row { align-items: center; gap: 8px; }
#account-row .btn.small { padding: 4px 10px; }

/* phase 6: time trial ghost */
#ghost-pick { font: inherit; padding: 6px 10px; border-radius: 8px; background: rgba(0,0,0,.35); color: #fff; border: 2px solid rgba(255,255,255,.3); }
#ghost-row { align-items: center; font-weight: 700; }
#ghost-info { position: absolute; top: 34px; left: 50%; transform: translateX(-50%); font-size: 13px; font-weight: 700; color: #bfe9ff; }

/* phase 5: profile, leaderboard, chat, emotes, spectator */
.small-text { font-size: 13px; }
#lap-time { font-size: 13px; opacity: .85; font-variant-numeric: tabular-nums; }
#flag-btn { display: inline-flex; align-items: center; gap: 6px; }
#flag-btn img, #flag-grid img, #lb-table img { width: 28px; height: 19px; object-fit: cover; border-radius: 2px; }
.swatches { display: flex; gap: 6px; align-items: center; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); cursor: pointer; padding: 0; }
.swatch.sel { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
#flag-picker h2 { margin: 0; }
#ach-panel h2 { margin: 0; }
#ach-btn { padding: 2px 10px; font-size: 13px; }
#ach-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; width: min(720px, 100%); max-height: 60vh; overflow-y: auto; }
.ach { padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,.06); font-size: 13px; text-align: left; }
.ach b { display: block; }
.ach.got { background: rgba(255,176,46,.18); border: 1px solid #ffb02e; }
.ach:not(.got) { opacity: .55; }
.missions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.mission { padding: 4px 10px; border-radius: 8px; background: rgba(255,255,255,.08); }
.mission.done { background: rgba(124,255,107,.2); }
.mission i { font-style: normal; opacity: .75; margin-left: 6px; }
#flag-search { font: inherit; padding: 8px 12px; border-radius: 8px; border: 2px solid rgba(255,255,255,.3); background: rgba(0,0,0,.3); color: #fff; width: 220px; text-align: center; text-transform: uppercase; }
#flag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; width: min(720px, 100%); max-height: 60vh; overflow-y: auto; padding: 4px; }
#flag-grid button { font: inherit; font-size: 11px; color: #fff; background: rgba(255,255,255,.08); border: 2px solid transparent; border-radius: 8px; padding: 6px 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; }
#flag-grid button.sel { border-color: #ffb02e; }
#lb-table { border-collapse: collapse; font-size: 16px; max-width: 100%; }
#lb-table td, #lb-table th { padding: 5px 12px; text-align: left; }
#lb-table th { font-size: 12px; opacity: .7; }
#lb-table tr.me { color: #ffb02e; font-weight: 800; }
#lb-table .dot, #chat-log .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
#bots-row { align-items: center; font-weight: 700; }
#bots-row b { min-width: 24px; font-size: 20px; }
#res-stats { color: #ffe14d; font-weight: 700; }
body.chat-on .overlay { padding-bottom: 240px; }
@media (min-width: 1100px) { body.chat-on .overlay { padding-bottom: 16px; } }
#chat { position: fixed; left: 16px; bottom: 16px; width: min(320px, calc(100vw - 32px)); z-index: 5; display: flex; flex-direction: column; gap: 6px; }
#chat-log { max-height: 160px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; font-size: 13px; background: rgba(20,18,35,.6); border-radius: 8px; padding: 6px 8px; text-align: left; user-select: text; -webkit-user-select: text; }
#chat-log:empty { display: none; }
#chat-log .sys { opacity: .6; font-style: italic; }
#chat-input { font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 8px; border: 2px solid rgba(255,255,255,.3); background: rgba(0,0,0,.45); color: #fff; }
#spec-info { position: absolute; bottom: 70px; left: 50%; transform: translateX(-50%); background: rgba(20,18,35,.6); padding: 6px 14px; border-radius: 8px; font-weight: 700; font-size: 15px; white-space: nowrap; }
#emotes { position: absolute; inset: 0; overflow: hidden; }
.emote { position: absolute; font-size: 34px; transform: translate(-50%, -100%); animation: emote-pop 2s ease-out forwards; }
.emote small { display: block; font-size: 11px; text-align: center; font-weight: 700; }
@keyframes emote-pop { 0% { opacity: 0; margin-top: 10px; } 10% { opacity: 1; margin-top: 0; } 80% { opacity: 1; } 100% { opacity: 0; margin-top: -20px; } }

@media (max-width: 600px) {
  #hud-left .big { font-size: 40px; }
  #speedo { font-size: 36px; }
  #boostbar { width: 110px; }
  #board { font-size: 12px; }
  #board .row { min-width: 120px; }
  #minimap { width: 110px; height: 110px; }
  #center-msg { font-size: 64px; }
}

/* ---------- replay ---------- */
#replay-hud { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(640px, calc(100% - 32px)); padding: 10px 14px;
  background: rgba(14, 12, 30, .82); border: 1px solid rgba(255, 140, 40, .55); clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px)); }
#replay-hud .rp-top { display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
#replay-hud .rp-top b { color: #ff3d3d; font-style: italic; font-weight: 900; letter-spacing: 1px; }
#rp-time { margin-left: auto; font-variant-numeric: tabular-nums; opacity: .8; }
.rp-bar { height: 6px; background: rgba(255, 255, 255, .15); margin: 8px 0; cursor: pointer; }
.rp-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ff5a0f, #ffb02e); }
.rp-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
#rp-clip.rec { border-color: #ff3d3d; color: #ff3d3d; }

/* ---------- menu dashboard (2026-11-10 redesign) ---------- */
:root {
  --dash-bg: rgba(14, 12, 30, .78);
  --dash-edge: rgba(255, 140, 40, .55);
  --hot: #ff8a1f;
  --hot2: #ffb02e;
  --ink-dim: rgba(255, 255, 255, .62);
  --cut: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}
.overlay.dash { display: grid; grid-template-columns: 290px minmax(0, 1fr) 310px; grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "top top top" "left center right" "bottom bottom bottom"; gap: 14px; padding: 12px 16px; text-align: left;
  align-items: stretch; justify-content: stretch; backdrop-filter: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 0 32%, rgba(10, 8, 26, .55) 70%), linear-gradient(180deg, rgba(10, 8, 26, .55), transparent 18%, transparent 75%, rgba(10, 8, 26, .7)); }
.overlay.dash::before, .overlay.dash::after { display: none; }
.dash h3 { margin: 0 0 8px; font-size: 14px; font-weight: 900; font-style: italic; letter-spacing: 1px; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.dash small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-dim); }

.dash-top { grid-area: top; display: flex; align-items: center; gap: 20px; padding: 4px 6px; border-bottom: 2px solid rgba(255, 140, 40, .35); }
.logo { font-size: 38px; font-weight: 900; font-style: italic; line-height: 1; letter-spacing: 1px; transform: skewX(-8deg); white-space: nowrap; }
.logo span { color: #fff; text-shadow: 3px 3px 0 #b3260e; margin-right: 6px; }
.logo b { color: var(--hot2); text-shadow: 3px 3px 0 #8a2b00, 0 0 18px rgba(255, 140, 30, .55); }
.dash .level-row { margin-left: auto; gap: 10px; font-weight: 800; }
.dash .xpbar { width: 170px; height: 10px; }
.top-actions { display: flex; gap: 8px; }
.icon-btn { font: inherit; font-weight: 800; color: #fff; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .2); border-radius: 10px; padding: 7px 12px; cursor: pointer; }
.icon-btn:hover { border-color: var(--hot2); color: var(--hot2); }

.panel { background: var(--dash-bg); border: 1px solid var(--dash-edge); clip-path: var(--cut); padding: 12px 14px; box-shadow: inset 0 0 24px rgba(255, 120, 20, .08); }

.dash-left, .dash-right { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; padding-right: 2px; }
.dash-left { grid-area: left; }
.dash-right { grid-area: right; }
.cta { font: inherit; display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px; border: none; cursor: pointer; text-align: left; color: #fff;
  background: linear-gradient(100deg, #ff5a0f, #ffb02e); clip-path: polygon(0 0, 100% 0, 100% 70%, 92% 100%, 0 100%);
  box-shadow: 0 0 22px rgba(255, 110, 20, .6); }
.cta b { font-size: 22px; font-style: italic; font-weight: 900; text-shadow: 0 2px 0 rgba(120, 30, 0, .6); }
.cta small { color: rgba(255, 255, 255, .9); }
.cta-icon { font-size: 30px; }
.cta:hover, .race-now:hover { filter: brightness(1.12); }
.chev { margin-left: auto; font-size: 26px; font-weight: 900; opacity: .85; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item { font: inherit; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; cursor: pointer; text-align: left; color: #fff;
  background: var(--dash-bg); border: 1px solid rgba(255, 255, 255, .14); clip-path: var(--cut); }
.nav-item:hover { border-color: var(--hot2); background: rgba(255, 140, 30, .14); }
.nav-item b { font-size: 16px; }
.ni { font-size: 22px; width: 30px; text-align: center; }
.nav-sub { display: flex; align-items: center; gap: 6px; padding: 0 12px; cursor: pointer; color: var(--ink-dim); }
.nav-join { display: flex; gap: 6px; padding: 2px 0; }
.nav-join #code { flex: 1; width: auto !important; min-width: 0; }
.event { padding: 12px 14px; clip-path: var(--cut); background: linear-gradient(135deg, rgba(120, 40, 200, .55), rgba(255, 90, 40, .35)); border: 1px solid rgba(255, 120, 255, .45); }
.event-title { font-weight: 900; font-style: italic; color: #ffe14d; letter-spacing: 1px; margin-bottom: 4px; }
.event p { margin: 0 0 8px; }
.dash #net-msg { text-align: center; }
.dash .room-list { width: 100%; max-height: none; }

.dash-center { grid-area: center; display: flex; flex-direction: column; justify-content: space-between; min-height: 0; gap: 10px; overflow-y: auto; overflow-x: hidden; }
.hero { display: flex; flex-direction: column; line-height: .95; transform: skewX(-8deg); pointer-events: none; padding: 6px 4px; }
.hero b { font-size: clamp(34px, 4.6vw, 64px); font-weight: 900; font-style: italic; letter-spacing: 1px; text-shadow: 0 4px 0 rgba(0, 0, 0, .45); }
.hero .hot { color: #ff3d3d; text-shadow: 0 4px 0 #6b0b0b, 0 0 24px rgba(255, 50, 50, .45); }
.hero small { margin-top: 6px; font-size: 14px; font-weight: 800; letter-spacing: 2px; color: var(--hot2); }
.center-bottom { display: flex; flex-direction: column; gap: 10px; }
.pick-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 10px; }
.dash #cars .cars { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding-bottom: 4px; }
.dash .car img { height: 64px; object-fit: contain; }
.dash .car { flex: 1 1 0; min-width: 96px; max-width: 160px; clip-path: var(--cut); border-radius: 0; text-align: center; background: rgba(255, 255, 255, .06); border: 2px solid rgba(255, 255, 255, .1); }
.dash .car.sel { border-color: var(--hot); background: linear-gradient(180deg, rgba(255, 120, 20, .25), rgba(255, 120, 20, .06)); box-shadow: inset 0 0 18px rgba(255, 120, 20, .35); }
.dash .skins { justify-content: flex-start; max-width: none; }
.tiles { display: flex; flex-wrap: wrap; gap: 6px; }
.tiles .btn.ghost { clip-path: var(--cut); border-radius: 0; border-width: 1px; font-size: 14px; padding: 8px 14px; }
/* 8 tracks: an even grid instead of ragged wrapping */
#tracks.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
#tracks.tiles .btn.ghost { font-size: 13px; padding: 7px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
/* short windows: smaller title so the start button stays on screen */
@media (max-height: 840px) and (min-width: 761px) {
  .hero b { font-size: clamp(28px, 3vw, 42px); }
  .hero small { display: none; }
  .dash .car img { height: 46px; }
  .dash .skin { width: 54px; }
  .dash .panel { padding: 9px 12px; }
  .tiles .btn.ghost, #tracks.tiles .btn.ghost { padding: 5px 8px; }
  .race-now { padding: 6px 20px; } .race-now b { font-size: 26px; }
}
.tiles .btn.ghost.on { background: linear-gradient(180deg, rgba(255, 120, 20, .4), rgba(255, 120, 20, .12)); border-color: var(--hot); color: #fff !important; }
.dash #track-record { margin: 8px 0 0; color: var(--ink-dim); }
.race-now { font: inherit; align-self: center; width: min(520px, 100%); padding: 12px 20px; border: none; cursor: pointer; color: #2a1000; text-align: center;
  background: linear-gradient(180deg, #ffd34d, #ff9a1f); clip-path: polygon(6% 0, 94% 0, 100% 50%, 94% 100%, 6% 100%, 0 50%);
  box-shadow: 0 0 30px rgba(255, 160, 30, .6); }
.race-now b { display: block; font-size: 34px; font-weight: 900; font-style: italic; }
.race-now small { color: #7a2b00; font-weight: 900; letter-spacing: 2px; }

.board-panel h3 .link-btn { margin-left: auto; }
.link-btn { font: inherit; font-size: 12px; font-style: normal; color: #fff; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .25); border-radius: 8px; padding: 3px 8px; cursor: pointer; }
#mini-sub { margin: -4px 0 6px; color: var(--ink-dim); }
.mini-row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 6px; padding: 5px 4px; border-bottom: 1px solid rgba(255, 255, 255, .06); font-size: 14px; }
.mini-row .rk { font-weight: 900; text-align: center; }
.mini-row:nth-child(1) .rk { color: #ffd34d; }
.mini-row:nth-child(2) .rk { color: #d6dde8; }
.mini-row:nth-child(3) .rk { color: #e09a5a; }
.mini-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-row .nm img { width: 20px; height: 13px; object-fit: cover; border-radius: 2px; vertical-align: -1px; margin-right: 4px; }
.mini-row .tm { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--hot2); }
.mini-row.me { background: rgba(255, 140, 30, .15); }
.profile-panel #name { width: 100%; text-align: left; }
.profile-panel #profile-row { justify-content: flex-start; margin: 8px 0; }
.profile-panel #my-stats { margin: 0; color: var(--ink-dim); }
.dash .missions { flex-direction: column; }
.dash .mission { display: flex; justify-content: space-between; border-radius: 0; clip-path: var(--cut); }

.dash-bottom { grid-area: bottom; display: flex; align-items: center; gap: 18px; font-size: 13px; color: var(--ink-dim); padding: 6px 6px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.dash-bottom .help { max-width: none; flex: 1; text-align: center; opacity: 1; }
.dash-bottom .vol { display: flex; align-items: center; gap: 6px; }
#status { white-space: nowrap; font-weight: 700; }
#status i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; }
.dot-on { background: #3dff7a; box-shadow: 0 0 8px #3dff7a; }
.dot-off { background: #888; }

@media (max-width: 1100px) {
  .overlay.dash { grid-template-columns: minmax(0, 1fr) 290px; grid-template-areas: "top top" "center right" "left right" "bottom bottom"; grid-template-rows: auto auto auto auto; overflow-y: auto; }
  .dash-center { min-height: auto; }
  .hero { min-height: 230px; }  /* room for the showroom car above the car picker */
  /* stacked rows must keep their content height (min-height 0 would let them shrink into each other) */
  .dash-left, .dash-right { min-height: auto; overflow: visible; }
  .overlay.dash { align-content: start; }
}
@media (max-width: 760px) {
  .overlay.dash { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-rows: auto; grid-template-areas: "top" "center" "left" "right" "bottom"; padding: 10px 12px; }
  .dash .car { flex-basis: 112px; }
  .dash-top { flex-wrap: wrap; gap: 10px; }
  .logo { font-size: 30px; }
  .dash .level-row { margin-left: 0; }
  .dash-center { min-height: auto; }
  .hero { display: none; }
  .pick-row { grid-template-columns: 1fr; }
  .dash-left, .dash-right { overflow: visible; }
  .dash-bottom { flex-wrap: wrap; justify-content: center; }
}

/* Desktop UI at 80%: the menu and HUD were designed for wider screens, and 80% browser zoom looked right.
   Only the UI is zoomed; the 3D canvas (#game) keeps full resolution (its ortho camera ignores pixel size). */
:root { --ui-zoom: 1; }
@media (min-width: 1100px) { :root { --ui-zoom: .8; } }
body > :not(#game) { zoom: var(--ui-zoom); }
.dash-bottom select { background: rgba(20,18,35,.6); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 6px; padding: 2px 4px; font: inherit; }
