/* ============================================================
   style.css — HUD and menus.
   Layout: full-bleed 3D canvas; HUD pinned to the four corners
   like a racing dash; menus are centred glass panels.
   One deliberate night look (single theme).
   ============================================================ */
:root {
  --night: #070a16;          /* sky / page */
  --glass: rgba(10, 14, 30, .78);
  --line: rgba(160, 175, 230, .18);
  --ink: #eef1ff;
  --dim: #8e97bd;
  --sodium: #ffb347;         /* streetlight orange: the accent */
  --smash: #3dff8f;
  --bounce: #ffae2b;
  --wreck: #ff2e4d;
  --gold: #ffd23a;
  --display: 'Teko', 'Arial Narrow', Impact, sans-serif;
  --body: 'Saira Semi Condensed', 'Arial Narrow', system-ui, sans-serif;
  color-scheme: dark;
}
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--night); color: var(--ink); font-family: var(--body);
  overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.speedlines { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .15s;
  background: repeating-conic-gradient(from 0deg at 50% 46%, rgba(255,255,255,.22) 0deg .35deg, transparent .35deg 4deg);
  -webkit-mask: radial-gradient(ellipse at 50% 46%, transparent 32%, #000 78%); mask: radial-gradient(ellipse at 50% 46%, transparent 32%, #000 78%); }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--sodium); outline-offset: 3px; }
.lbl { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.num { font-family: var(--display); font-variant-numeric: tabular-nums; line-height: .8; }

/* ---------------- HUD ---------------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
.hud-score, .hud-up, .hud-map, .hud-vitals, .hud-speed { position: absolute; }
.hud-score { top: calc(14px + env(safe-area-inset-top, 0px)); left: max(16px, env(safe-area-inset-left, 0px)); }
.hud-score .num { display: block; font-size: 58px; font-weight: 600; font-style: italic; text-shadow: 0 2px 0 rgba(0,0,0,.5); margin-top: 6px; }
.combo { display: flex; align-items: center; gap: 8px; margin-top: 4px; opacity: 0; transform: translateY(-4px); transition: .15s; }
.combo.on { opacity: 1; transform: none; }
#comboX { font-family: var(--display); font-size: 34px; font-weight: 700; color: var(--sodium); line-height: .8; font-style: italic; }
.combo-track { width: 70px; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
#comboBar { display: block; height: 100%; background: var(--sodium); transform-origin: left; }

.hud-up { top: calc(14px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); width: min(380px, 44vw); }
.tier-track { display: flex; justify-content: space-between; margin-bottom: 7px; }
.pip { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.pip-dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--dim); }
.pip.done { color: var(--ink); } .pip.done .pip-dot { background: var(--ink); border-color: var(--ink); }
.pip.cur { color: var(--sodium); } .pip.cur .pip-dot { background: var(--sodium); border-color: var(--sodium); box-shadow: 0 0 10px var(--sodium); }
.up-bar { height: 8px; background: rgba(255,255,255,.1); border-radius: 4px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
#upFill { display: block; height: 100%; background: linear-gradient(90deg, #ff8a2b, var(--sodium) 70%, #ffe3a8); transform-origin: left; transition: transform .25s; }
.up-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 5px; min-height: 26px; }
.up-label { font-size: 12px; color: var(--dim); font-weight: 600; letter-spacing: .06em; }
.pending { font-family: var(--display); font-size: 30px; font-weight: 700; color: var(--gold); line-height: .8; opacity: 0; transform: scale(.8); transition: opacity .2s, transform .12s; font-style: italic; text-shadow: 0 0 14px rgba(255,210,58,.45); }
.pending.on { opacity: 1; transform: scale(1); }

.hud-map { top: calc(14px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; align-items: center; gap: 8px; }
#minimap { width: 150px; height: 150px; border-radius: 50%; box-shadow: 0 0 0 2px var(--line), 0 6px 24px rgba(0,0,0,.5); }
.stars { display: flex; gap: 6px; }
.stars i { width: 16px; height: 16px; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); background: rgba(255,255,255,.15); }
.stars i.on { background: var(--ink); animation: blink .5s steps(2) infinite; }
@keyframes blink { 50% { background: #ff3b5c; } }
.icon-btn { pointer-events: auto; width: 40px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--glass); font-weight: 700; letter-spacing: -.05em; }

.hud-vitals { bottom: calc(22px + env(safe-area-inset-bottom, 0px)); left: max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 10px; width: min(240px, 40vw); }
.vital { display: grid; gap: 4px; }
.bar { height: 10px; border-radius: 5px; background: rgba(255,255,255,.1); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.bar span { display: block; height: 100%; transform-origin: left; transition: transform .2s; }
.bar.hp span { background: var(--smash); }
.bar.hp.low span { background: var(--wreck); animation: pulse .6s infinite alternate; }
.bar.fuel span { background: var(--smash); }
.bar.fuel.mid span { background: var(--bounce); }
.bar.fuel.low span { background: var(--wreck); animation: pulse .5s infinite alternate; }
@keyframes pulse { to { opacity: .45; } }

.hud-speed { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); text-align: right; }
.hud-speed .num { font-size: 72px; font-weight: 600; font-style: italic; }
.unit { font-size: 13px; color: var(--dim); font-weight: 600; margin-left: 4px; letter-spacing: .08em; }
.tags { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 4px; }
.tag { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--line); color: var(--dim); }
.tag.on { color: var(--night); background: var(--ink); border-color: var(--ink); }
.tag.boost.on { background: #6ad5ff; border-color: #6ad5ff; }
.tag.ram { display: none; }
.tag.ram.on { display: inline-block; background: var(--gold); border-color: var(--gold); color: var(--night); animation: pulse .25s infinite alternate; }
body.ramming .speedlines { filter: sepia(1) saturate(4) hue-rotate(-10deg); }
body.ramming .ring.bounce { animation: pulse .2s infinite alternate; }

.steer-hint, .gestures { display: none; }
@media (pointer: coarse) {
  .steer-hint { display: block; position: fixed; width: 110px; height: 44px; margin: -22px 0 0 -55px; border-radius: 22px; border: 1.5px solid var(--line); background: rgba(10,14,30,.35); opacity: 0; transition: opacity .15s, border-color .15s; }
  .steer-hint.on { opacity: 1; }
  .steer-hint.boost { border-color: #6ad5ff; box-shadow: 0 0 18px rgba(106,213,255,.5); }
  .steer-hint.brake { border-color: var(--wreck); box-shadow: 0 0 18px rgba(255,46,77,.45); }
  .steer-hint.boost #steerKnob { background: #6ad5ff; }
  .steer-hint.brake #steerKnob { background: var(--wreck); }
  #steerKnob { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px; border-radius: 50%; background: var(--ink); }
  .gestures { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; position: absolute; left: 50%; bottom: calc(212px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: min(340px, 86vw);
    background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 13px; color: var(--dim); opacity: 0; transition: opacity .4s; }
  .gestures.on { opacity: 1; }
  .gestures b { color: var(--ink); display: block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
  .hud-speed .num { font-size: 52px; }
}

.banner { position: absolute; top: 24%; left: 50%; transform: translate(-50%, -10px); text-align: center; opacity: 0; transition: opacity .3s, transform .3s; width: min(560px, 90vw); }
.banner.on { opacity: 1; transform: translate(-50%, 0); }
#bannerBig { font-family: var(--display); font-size: clamp(64px, 12vw, 120px); font-weight: 700; font-style: italic; line-height: .8; color: var(--sodium); text-shadow: 0 0 30px rgba(255,179,71,.5), 0 4px 0 rgba(0,0,0,.5); text-transform: uppercase; }
#bannerSmall { margin-top: 10px; font-size: 16px; font-weight: 600; text-wrap: balance; text-shadow: 0 2px 6px rgba(0,0,0,.8); }
.toast { position: absolute; bottom: calc(110px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%) translateY(10px); background: var(--glass); border: 1px solid var(--line); padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: 14px; opacity: 0; transition: .2s; white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis; }
.toast.on { opacity: 1; transform: translateX(-50%); }

#floats { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.float { position: absolute; left: 0; top: 0; font-family: var(--display); font-weight: 700; font-style: italic; font-size: 30px; white-space: nowrap; color: var(--ink); text-shadow: 0 2px 0 rgba(0,0,0,.6), 0 0 12px rgba(0,0,0,.6); will-change: transform; }
.float.big { color: var(--sodium); font-size: 38px; }
.float.gold { color: var(--gold); font-size: 42px; }
.float.miss { color: #6ad5ff; font-size: 26px; }
.float.dash { color: #fff; font-size: 44px; text-shadow: 0 0 18px rgba(106,213,255,.9), 0 3px 0 rgba(0,0,0,.6); }
.float.drift { color: #6ad5ff; font-size: 32px; }
.float.air { color: #ff7ab8; font-size: 34px; }
.float.tiny { color: var(--dim); font-size: 20px; }
.float.boosted { color: #6ad5ff; font-size: 36px; }
.float.ram { color: var(--gold); font-size: 40px; text-shadow: 0 0 16px rgba(255,210,58,.7), 0 3px 0 rgba(0,0,0,.6); }

.flash { position: fixed; inset: 0; pointer-events: none; opacity: 0; }
.flash.on { animation: flash .45s ease-out; }
.flash.red { background: radial-gradient(transparent 40%, rgba(255,46,77,.55)); }
.flash.gold { background: radial-gradient(rgba(255,210,58,.35), rgba(255,179,71,.2)); }
.flash.green { background: radial-gradient(transparent 40%, rgba(61,255,143,.4)); }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }

/* ---------------- Screens ---------------- */
.screen {
  position: fixed; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; overflow-y: auto;
  padding-block: calc(20px + env(safe-area-inset-top, 0px)) calc(20px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: linear-gradient(180deg, rgba(7,10,22,.15), rgba(7,10,22,.7)); touch-action: pan-y;
}
.panel { width: min(520px, 100%); background: var(--glass); border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: grid; gap: 16px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.panel.small { width: min(320px, 100%); text-align: center; }
.logo { margin: 0; font-family: var(--display); font-weight: 700; font-style: italic; font-size: clamp(60px, 19vw, 118px); line-height: .72; letter-spacing: -.01em; text-transform: uppercase; display: flex; gap: .18em; }
.logo .up { color: var(--sodium); text-shadow: 0 0 28px rgba(255,179,71,.55); }
.tagline { margin: 0; font-size: 17px; color: var(--dim); font-weight: 600; }
.btn { white-space: nowrap; height: 54px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.06); font-weight: 700; font-size: 16px; letter-spacing: .12em; text-transform: uppercase; padding-inline: 20px; }
.btn:hover { background: rgba(255,255,255,.12); }
.btn.primary { background: var(--sodium); color: #1a0f00; border-color: var(--sodium); font-family: var(--display); font-size: 32px; letter-spacing: .06em; font-style: italic; padding-top: 4px; }
.btn.primary:hover { background: #ffc46b; }
.meta { display: flex; gap: 18px; align-items: center; font-size: 14px; color: var(--dim); flex-wrap: wrap; }
.meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.link-btn { margin-left: auto; background: none; border: 0; color: var(--dim); text-decoration: underline; text-underline-offset: 3px; padding: 4px; }
.sub { margin: 4px 0 0; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); font-weight: 700; }
.big { margin: 0; font-family: var(--display); font-size: 64px; font-style: italic; line-height: .8; }
.paints { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.paint { display: grid; gap: 4px; justify-items: center; padding: 10px 4px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.04); min-width: 0; }
.paint .swatch { width: 46px; height: 26px; border-radius: 7px; box-shadow: 0 0 14px var(--paint); border: 1px solid rgba(255,255,255,.12); }
.paint .ptag { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.paint .pname { font-size: 12px; font-weight: 700; }
.paint .pcost { font-size: 11px; color: var(--dim); }
.paint.sel { border-color: var(--sodium); box-shadow: inset 0 0 0 1px var(--sodium); }
.paint.locked .swatch { opacity: .55; box-shadow: none; }
.howto { display: grid; gap: 10px; font-size: 13px; color: var(--dim); border-top: 1px solid var(--line); padding-top: 14px; }
.rings, .keys { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.rings span { display: flex; align-items: center; gap: 6px; }
.ring { width: 14px; height: 14px; border-radius: 50%; border: 3px solid; display: inline-block; }
.ring.smash { border-color: var(--smash); } .ring.bounce { border-color: var(--bounce); } .ring.wreck { border-color: var(--wreck); }
kbd { font-family: var(--body); font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); background: rgba(255,255,255,.08); color: var(--ink); margin-right: 2px; }
.touch-note, .ladder, .tricks, .credits { margin: 0; }
.credits { font-size: 12px; }
.touch-note { display: grid; gap: 4px; }
.touch-note b, .tricks b { color: var(--ink); }
.ladder { color: var(--ink); font-weight: 600; }
@media (pointer: coarse) { .keys { display: none; } }
@media (pointer: fine) { .touch-note { display: none; } }

.over-panel { text-align: left; }
.reason { margin: 0; color: var(--wreck); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 13px; }
.over-score { font-family: var(--display); font-size: 96px; font-weight: 700; font-style: italic; line-height: .75; font-variant-numeric: tabular-nums; }
.over-best { margin: 0; color: var(--dim); font-weight: 600; }
.over-best.new { color: var(--gold); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stats div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.04); }
.stats b { font-size: 18px; font-variant-numeric: tabular-nums; }
.growth { display: grid; gap: 7px; }
.g-row { display: grid; grid-template-columns: 52px 1fr 44px; gap: 10px; align-items: center; font-size: 13px; font-weight: 600; }
.g-row.miss { color: var(--dim); }
.g-track { position: relative; height: 8px; border-radius: 4px; background: rgba(255,255,255,.07); }
.g-fill { position: absolute; top: 0; bottom: 0; background: var(--sodium); border-radius: 4px; opacity: .55; }
.g-mark { position: absolute; top: -3px; width: 4px; height: 14px; margin-left: -2px; border-radius: 2px; background: var(--sodium); }
.g-row.miss .g-mark { display: none; }
.g-time { text-align: right; font-variant-numeric: tabular-nums; }
.breakdown { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--line); }
.chip b { color: var(--sodium); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

@media (max-width: 640px) {
  .hud-score .num { font-size: 42px; }
  #comboX { font-size: 26px; }
  .hud-up { top: calc(104px + env(safe-area-inset-top, 0px)); left: max(16px, env(safe-area-inset-left, 0px)); transform: none; width: calc(100% - 172px); }
  #minimap { width: 104px; height: 104px; }
  .pip-name { display: none; }
  .panel { padding: 20px; }
  .row { grid-template-columns: 1fr; }
  .paints { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .speedlines { display: none; }
  .stars i.on, .bar.low span { animation: none; }
  .flash.on { animation-duration: .01s; }
}

/* ---------------- Tabs, missions, garage ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab { flex: 1 0 auto; background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 8px; font-weight: 700; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-bottom: -1px; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--sodium); }
.tabpane { display: grid; gap: 10px; }
.missions { display: grid; gap: 8px; }
.mission { display: grid; gap: 6px; padding: 12px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.mission.done { border-color: rgba(61,255,143,.45); }
.m-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.m-text { font-weight: 600; font-size: 14px; min-width: 0; }
.m-tag { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
.mission.done .m-tag { color: var(--smash); }
.m-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.m-bar span { display: block; height: 100%; background: var(--sodium); border-radius: 3px; }
.mission.done .m-bar span { background: var(--smash); }
.m-prog { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.missions.compact .mission { padding: 10px 12px; }
.set-note { margin: 0; font-size: 13px; color: var(--dim); }
.garage { display: grid; gap: 8px; }
.up-row-g { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.up-info { display: grid; gap: 4px; flex: 1; min-width: 0; font-size: 13px; color: var(--dim); }
.up-info b { color: var(--ink); font-size: 15px; }
.up-info em { font-style: normal; color: var(--sodium); }
.pips { display: flex; gap: 4px; }
.pips i { width: 18px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.12); }
.pips i.on { background: var(--sodium); }
.buy { flex: none; min-width: 84px; height: 40px; border-radius: 8px; border: 1px solid var(--sodium); background: rgba(255,179,71,.12); color: var(--sodium); font-weight: 700; font-variant-numeric: tabular-nums; }
.buy:hover:not(:disabled) { background: var(--sodium); color: #1a0f00; }
.buy:disabled { border-color: var(--line); background: none; color: var(--dim); cursor: default; }
.over-set { display: grid; gap: 6px; padding: 12px; border-radius: 10px; background: rgba(61,255,143,.08); border: 1px solid rgba(61,255,143,.35); font-size: 14px; }
.over-set b { color: var(--gold); }
.over-set .lvl { font-weight: 700; color: var(--ink); }
.mission-pop { position: absolute; left: 50%; top: calc(110px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -12px); display: grid; gap: 2px; justify-items: center; text-align: center;
  background: var(--glass); border: 1px solid rgba(61,255,143,.5); border-radius: 12px; padding: 10px 18px; opacity: 0; transition: opacity .25s, transform .25s; width: max-content; max-width: 86vw; }
.mission-pop.on { opacity: 1; transform: translate(-50%, 0); }
.mp-head { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--smash); }
#mpText { font-weight: 600; font-size: 14px; }
#mpReward { color: var(--gold); font-size: 13px; }
@media (max-width: 640px) { .mission-pop { top: calc(200px + env(safe-area-inset-top, 0px)); } }

/* ---------------- Live landing screen ----------------
   The city keeps running behind; the UI hugs the top and bottom edges. */
.landing { position: fixed; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none;
  padding-block: calc(16px + env(safe-area-inset-top, 0px)) calc(18px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: linear-gradient(180deg, rgba(7,10,22,.65) 0%, transparent 22%, transparent 55%, rgba(7,10,22,.85) 100%); }
.landing button { pointer-events: auto; }
.land-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.landing .logo { font-size: clamp(56px, 13vw, 96px); text-shadow: 0 4px 24px rgba(0,0,0,.6); }
.land-stats { display: flex; gap: 8px; }
.land-stats span { display: grid; justify-items: end; padding: 6px 12px; border-radius: 10px; background: var(--glass); border: 1px solid var(--line); min-width: 64px; }
.land-stats small { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); font-weight: 700; }
.land-stats b { font-family: var(--display); font-size: 26px; line-height: .9; font-variant-numeric: tabular-nums; }
.land-bottom { display: grid; gap: 12px; justify-items: center; width: min(680px, 100%); margin-inline: auto; }
.landing .tagline { text-align: center; color: var(--ink); text-shadow: 0 2px 8px rgba(0,0,0,.8); }
.land-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; }
.nav-btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding-inline: 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.nav-btn:hover { border-color: var(--sodium); }
.nav-btn.quiet { color: var(--dim); font-weight: 600; letter-spacing: .04em; text-transform: none; }
.nb-badge { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: rgba(255,179,71,.18); color: var(--sodium); letter-spacing: .04em; }
.nb-badge.all { background: var(--smash); color: var(--night); }
.btn.drive { width: 100%; height: 64px; font-size: 40px; box-shadow: 0 10px 30px rgba(255,179,71,.35); }

/* ---------------- Menu sheets ---------------- */
.sheet-wrap { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(4,6,14,.55); z-index: 5;
  padding-block: calc(16px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.sheet { width: min(520px, 100%); max-height: min(86vh, 760px); display: flex; flex-direction: column; background: var(--glass); border: 1px solid var(--line); border-radius: 16px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); overflow: hidden; animation: sheetIn .22s ease-out; }
@keyframes sheetIn { from { transform: translateY(16px); opacity: 0; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-family: var(--display); font-size: 38px; font-style: italic; line-height: .8; padding-top: 6px; }
.icon-btn.close { width: 38px; height: 38px; font-size: 16px; letter-spacing: 0; }
.sheet-body { overflow-y: auto; padding: 16px 20px 20px; display: grid; gap: 12px; touch-action: pan-y; }
@media (max-width: 640px) {
  .sheet-wrap { place-items: end stretch; padding-left: 0; padding-right: 0; padding-bottom: 0; }
  .sheet { width: 100%; max-height: 82vh; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .land-stats span { min-width: 52px; padding: 5px 9px; }
  .land-stats b { font-size: 22px; }
  .btn.drive { height: 58px; font-size: 34px; }
  .nav-btn { height: 38px; padding-inline: 12px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }

/* arrow toward the nearest food truck (low fuel or health) */
.food-arrow { position: fixed; left: 0; top: 0; display: grid; justify-items: center; gap: 2px; pointer-events: none; opacity: 0; transition: opacity .25s; }
.food-arrow.on { opacity: 1; }
.fa-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(61,255,143,.16); border: 2px solid var(--smash); box-shadow: 0 0 14px rgba(61,255,143,.5); }
.fa-icon::before { content: ""; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 12px solid var(--smash); transform: translateY(-1px); }
.fa-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--smash); text-shadow: 0 1px 4px rgba(0,0,0,.9); white-space: nowrap; }
.food-arrow.on .fa-icon { animation: pulse .5s infinite alternate; }

/* ---------------- Map button + swipe picker ---------------- */
.map-btn { display: inline-flex; align-items: baseline; gap: 10px; padding: 8px 16px; border-radius: 12px; border: 1px solid rgba(255,179,71,.5); background: var(--glass);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.map-btn small { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); font-weight: 700; }
.map-btn b { font-family: var(--display); font-size: 26px; font-style: italic; line-height: .9; }
.mb-change { font-size: 12px; font-weight: 700; color: var(--sodium); }
.map-picker { position: fixed; inset: 0; z-index: 6; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); background: rgba(4,6,14,.82);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding-block: calc(14px + env(safe-area-inset-top, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)); }
.mp-headbar { display: flex; justify-content: space-between; align-items: center; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.mp-headbar h2 { margin: 0; font-family: var(--display); font-size: 40px; font-style: italic; line-height: .8; padding-top: 6px; }
.mp-stage { position: relative; display: flex; align-items: center; min-height: 0; min-width: 0; }
.map-track { position: relative; min-width: 0; display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; width: 100%; height: 100%; align-items: center;
  touch-action: pan-x; overscroll-behavior-x: contain; }
/* spacers so the first and last cards can sit in the middle */
.map-track::before, .map-track::after { content: ""; flex: 0 0 calc(50% - min(170px, 41vw) - 18px); }
.map-track::-webkit-scrollbar { display: none; }
.map-card { flex: 0 0 min(340px, 82vw); scroll-snap-align: center; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; min-width: 0; border-radius: 18px; overflow: hidden; background: var(--glass);
  border: 1px solid var(--line); transform: scale(.9); opacity: .55; transition: transform .25s, opacity .25s, border-color .25s; max-height: 100%; }
.map-card.focus { transform: none; opacity: 1; border-color: rgba(255,179,71,.6); }
.mc-preview { width: 100%; height: auto; aspect-ratio: 1; max-width: 100%; display: block; background: #000; max-height: 42vh; object-fit: cover; }
.mc-info { display: grid; gap: 10px; padding: 14px 16px 16px; }
.mc-info h3 { margin: 0; font-family: var(--display); font-size: 36px; font-style: italic; line-height: .85; }
.mc-info p { margin: 0; font-size: 14px; color: var(--dim); min-height: 2.6em; }
.mc-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim); }
.pill.d-easy, .pill.d-easiest { color: var(--smash); border-color: rgba(61,255,143,.45); }
.pill.d-medium { color: var(--bounce); border-color: rgba(255,174,43,.45); }
.pill.d-hard { color: #ff6f86; border-color: rgba(255,46,77,.45); }
.pill.coin { color: #ffd23a; border-color: rgba(255,210,58,.45); }
.mc-go { height: 50px; font-size: 26px; }
.mp-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--glass); font-size: 26px; line-height: 1; }
.mp-arrow:disabled { opacity: .25; cursor: default; }
#mapPrev { left: max(12px, env(safe-area-inset-left, 0px)); } #mapNext { right: max(12px, env(safe-area-inset-right, 0px)); }
.mp-dots { display: flex; justify-content: center; gap: 8px; padding-top: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.25); }
.dot.on { background: var(--sodium); width: 22px; border-radius: 5px; }
@media (pointer: coarse) { .mp-arrow { display: none; } }
@media (prefers-reduced-motion: reduce) { .map-card { transition: none; } }

.pill.current { color: var(--sodium); border-color: rgba(255,179,71,.5); }

.map-row { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; justify-content: center; }
.time-btn { padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-weight: 700; font-size: 14px; letter-spacing: .04em; white-space: nowrap; }
.time-btn:hover { border-color: var(--sodium); }
/* keep HUD text readable against a bright daytime sky */
#hud .lbl, #hud .pip, #hud .up-label, #hud .unit, #hud .tag { text-shadow: 0 1px 3px rgba(0,0,0,.75); }
body.day #hud .pip, body.day #hud .up-label, body.day #hud .lbl { color: #e6eaf8; }
body.day #minimap { box-shadow: 0 0 0 2px rgba(255,255,255,.35), 0 6px 24px rgba(0,0,0,.35); }

/* coaching tips: amber = boost through it, red = steer clear */
.coach { position: absolute; left: 50%; top: calc(200px + env(safe-area-inset-top, 0px)); width: max-content; box-sizing: border-box; transform: translate(-50%, 8px) scale(.96); display: flex; align-items: center; gap: 10px; max-width: min(90vw, 440px); padding: 10px 16px; border-radius: 12px; background: rgba(8,11,22,.82); border: 2px solid var(--line); font-size: 15px; line-height: 1.3; font-weight: 600; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.coach.on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.coach b { font-weight: 800; }
.coach.amber { border-color: var(--bounce); } .coach.amber b { color: var(--bounce); }
.coach.red { border-color: #ff2e4d; } .coach.red b { color: #ff6f86; }
.coach.ram { border-color: var(--gold); font-family: var(--display); font-size: 22px; font-style: italic; letter-spacing: .02em; } .coach.ram b { color: var(--gold); }
.coach .cr { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 4px solid; box-shadow: 0 0 10px currentColor; }
.coach .cr.amber { color: var(--bounce); border-color: var(--bounce); animation: crPulse .8s ease-in-out infinite alternate; }
.coach .cr.red { color: #ff2e4d; border-color: #ff2e4d; }
@keyframes crPulse { to { transform: scale(1.18); } }
@media (min-width: 641px) { .coach { top: 140px; } }

/* on-screen Boost button (touch only): hold with your other thumb */
.boost-btn { display: none; }
@media (pointer: coarse) {
  .boost-btn { display: grid; place-items: center; position: absolute; right: max(18px, env(safe-area-inset-right, 0px)); bottom: calc(112px + env(safe-area-inset-bottom, 0px));
    width: 84px; height: 84px; border-radius: 50%; pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
    background: radial-gradient(circle at 50% 40%, rgba(106,213,255,.35), rgba(10,14,30,.6)); border: 2px solid #6ad5ff; color: #e8f7ff;
    font-family: var(--display); font-size: 19px; font-weight: 700; font-style: italic; letter-spacing: .04em; text-transform: uppercase; box-shadow: 0 0 16px rgba(106,213,255,.35); }
  .boost-btn.held, .boost-btn.on { background: radial-gradient(circle, rgba(106,213,255,.85), rgba(40,120,200,.6)); color: #04121f; transform: scale(.94); box-shadow: 0 0 28px rgba(106,213,255,.8); }
  .boost-btn.ram { border-color: var(--gold); background: radial-gradient(circle, rgba(255,210,58,.9), rgba(200,120,20,.6)); box-shadow: 0 0 30px rgba(255,210,58,.8); }
}

/* round icon toggles, top right of the landing screen: sound, then day / night */
.land-top { padding-right: 58px; }
.land-icons { position: absolute; top: calc(16px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 10px; }
.round-btn { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: var(--glass); color: var(--ink);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 0; cursor: pointer; }
.round-btn svg { width: 22px; height: 22px; }
.round-btn:hover { border-color: var(--sodium); }
.round-btn.off { color: var(--dim); }
.round-btn.day { color: var(--gold); }
#timeBtn:not(.day) { color: #b9c6ff; }

/* Simple steering: a fixed wheel at the bottom, centre = straight */
@media (pointer: coarse) {
  .steer-hint.simple { width: 180px; margin-left: -90px; }
  .steer-hint.simple::before { content: ''; position: absolute; left: 50%; top: 8px; bottom: 8px; width: 2px; margin-left: -1px; background: var(--line); }
}

/* Boost button countdown ring: how much of a tapped burst is left */
@media (pointer: coarse) {
  .boost-btn::before { content: ''; position: absolute; inset: -7px; border-radius: 50%; pointer-events: none;
    background: conic-gradient(#6ad5ff calc(var(--left, 0) * 360deg), transparent 0);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); }
  .boost-btn.ram::before { background: conic-gradient(var(--gold) calc(var(--left, 0) * 360deg), transparent 0); }
}

/* first-run tutorial */
.tutor { position: absolute; inset: 0; pointer-events: none; }
.tutor .tz { display: none; position: absolute; top: 0; bottom: 0; width: 50%; align-items: center; justify-content: center; }
.tutor.zones .tz { display: flex; }
.tutor .tz-left { left: 0; } .tutor .tz-right { right: 0; }
.tutor .tz-arrow { font-family: var(--display); font-size: 120px; line-height: 1; color: rgba(255,255,255,.18); }
.tutor.left .tz-left, .tutor.right .tz-right { background: linear-gradient(90deg, rgba(61,255,143,.24), rgba(61,255,143,.05)); }
.tutor.right .tz-right { background: linear-gradient(270deg, rgba(61,255,143,.24), rgba(61,255,143,.05)); }
.tutor.left .tz-left .tz-arrow, .tutor.right .tz-right .tz-arrow { color: var(--smash); text-shadow: 0 0 24px rgba(61,255,143,.6); animation: tzNudge .9s ease-in-out infinite; }
.tutor.left .tz-left .tz-arrow { --dx: -12px; } .tutor.right .tz-right .tz-arrow { --dx: 12px; }
@keyframes tzNudge { 50% { transform: translateX(var(--dx)); } }
.tutor .tmsg { position: absolute; left: 50%; top: 24%; transform: translateX(-50%); display: grid; justify-items: center; gap: 8px; text-align: center; width: min(420px, 88vw); box-sizing: border-box;
  padding: 16px 20px; border-radius: 14px; background: rgba(8,11,22,.82); border: 2px solid var(--smash); }
.tutor .tmsg b#tutorBig { font-family: var(--display); font-size: 44px; font-style: italic; line-height: .9; color: var(--smash); }
.tutor .tmsg #tutorSmall { font-size: 16px; font-weight: 600; } .tutor .tmsg #tutorSmall b { color: var(--smash); }
.tutor .tbar { width: 70%; height: 6px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.tutor .tbar span { display: block; height: 100%; background: var(--smash); transform-origin: left; transform: scaleX(0); }
.small-btn { justify-self: start; height: 38px; padding-inline: 14px; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .tutor .tz-arrow { animation: none !important; } }

/* tutorial v2: the screen dims and the world crawls until you press; the side to press glows */
.tutor .tdim { position: absolute; inset: 0; background: rgba(4,6,14,.6); opacity: 0; transition: opacity .25s; }
.tutor.waiting .tdim { opacity: 1; }
.tutor.zones .tdim { display: none; }
.tutor.zones.waiting.left .tz-right, .tutor.zones.waiting.right .tz-left { background: rgba(4,6,14,.72); }
.tutor.zones.waiting.left .tz-left { background: linear-gradient(90deg, rgba(61,255,143,.38), rgba(61,255,143,.08)); }
.tutor.zones.waiting.right .tz-right { background: linear-gradient(270deg, rgba(61,255,143,.38), rgba(61,255,143,.08)); }
.tutor .tz { flex-direction: column; gap: 10px; transition: background .25s; }
.tutor .tz-hand { display: none; position: relative; width: 96px; height: 96px; border-radius: 50%; border: 3px solid var(--smash); place-items: center; padding-top: 58px; box-sizing: border-box;
  font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: .08em; color: var(--smash); }
.tutor .tz-hand i { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -22px 0 0 -15px; border-radius: 50%; background: var(--smash); box-shadow: 0 0 20px rgba(61,255,143,.8); }
.tutor .tz-hand::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 3px solid var(--smash); animation: handPulse 1.1s ease-out infinite; }
@keyframes handPulse { from { transform: scale(1); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
.tutor.waiting.left .tz-left .tz-hand, .tutor.waiting.right .tz-right .tz-hand { display: grid; }
.tutor:not(.waiting) .tz-arrow { opacity: .35; }
.tutor .tmsg { top: 18%; }
.tutor .tmsg small { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.tutor .tmsg b#tutorBig { font-size: 56px; }
.tutor.waiting .tmsg { animation: tmsgPulse 1.2s ease-in-out infinite; }
@keyframes tmsgPulse { 50% { box-shadow: 0 0 0 6px rgba(61,255,143,.18), 0 0 30px rgba(61,255,143,.35); } }
.tutor.nice .tmsg { border-color: var(--gold); animation: none; } .tutor.nice .tmsg b#tutorBig { color: var(--gold); }
.tutor.nice .tz, .tutor.nice .tdim { background: none !important; opacity: 0; }
.banner.go #bannerBig { font-size: clamp(90px, 26vw, 160px); color: var(--smash); }
@media (prefers-reduced-motion: reduce) { .tutor .tz-hand::after, .tutor.waiting .tmsg { animation: none; } }

/* feedback link on the game-over screen */
.feedback-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: 12px;
  border: 1px solid rgba(61,255,143,.5); background: rgba(61,255,143,.08); color: var(--ink); text-decoration: none; font-size: 14px; }
.feedback-cta b { color: var(--smash); font-size: 15px; letter-spacing: .04em; white-space: nowrap; }
.feedback-cta:hover { background: rgba(61,255,143,.16); }
a.nav-btn { text-decoration: none; color: inherit; pointer-events: auto; }

/* game-over stats: an odd last box spans the full width */
.stats > div:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* game-over: missions open from a round icon at the top right of the panel */
.over-panel { position: relative; }
.over-mbtn { position: absolute; top: 16px; right: 16px; z-index: 3; }
.over-mbtn.open { border-color: var(--sodium); color: var(--sodium); }
.over-mbtn .om-badge { position: absolute; top: -6px; right: -8px; min-width: 30px; padding: 2px 6px; border-radius: 999px; background: #1b2033; border: 1px solid var(--line);
  font-size: 11px; font-weight: 700; line-height: 1.3; color: var(--ink); }
.over-mbtn.new .om-badge { background: var(--smash); border-color: var(--smash); color: #04140a; }
.over-mbtn.new { box-shadow: 0 0 0 3px rgba(61,255,143,.35); }
.over-mpop { position: absolute; top: 70px; right: 16px; left: 16px; z-index: 2; display: grid; gap: 10px; padding: 14px; border-radius: 14px;
  background: #0b0e1c; border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0,0,0,.5); isolation: isolate; }
.over-mpop[hidden] { display: none; }

/* Boost button v2: shown on every device; the ring is your boost charge */
.boost-btn { display: grid; place-items: center; position: absolute; right: max(18px, env(safe-area-inset-right, 0px)); bottom: calc(112px + env(safe-area-inset-bottom, 0px));
  width: 84px; height: 84px; border-radius: 50%; pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  background: radial-gradient(circle at 50% 40%, rgba(106,213,255,.35), rgba(10,14,30,.6)); border: 2px solid #6ad5ff; color: #e8f7ff;
  font-family: var(--display); font-size: 19px; font-weight: 700; font-style: italic; letter-spacing: .04em; text-transform: uppercase; box-shadow: 0 0 16px rgba(106,213,255,.35);
  transition: filter .2s, opacity .2s; }
@media (pointer: fine) { .boost-btn { width: 70px; height: 70px; font-size: 16px; cursor: pointer; } }
.boost-btn::before { content: ''; position: absolute; inset: -7px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(#6ad5ff calc(var(--left, 0) * 360deg), rgba(255,255,255,.1) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px)); }
.boost-btn.empty { filter: grayscale(1) brightness(.6); box-shadow: none; }
.boost-btn.full { animation: boostReady 1s ease-in-out infinite alternate; }
@keyframes boostReady { to { box-shadow: 0 0 30px rgba(106,213,255,.9); } }
.boost-btn.denied { animation: boostDenied .35s; }
@keyframes boostDenied { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.boost-btn.ram::before { background: conic-gradient(var(--gold) calc(var(--left, 0) * 360deg), rgba(255,255,255,.1) 0); }
@media (prefers-reduced-motion: reduce) { .boost-btn.full, .boost-btn.denied { animation: none; } }

/* game-over v3: everything (score, stats, missions, feedback, buttons) fits one phone screen */
.over-panel { gap: 12px; padding: 18px; }
.over-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.over-panel .over-score { font-size: 72px; }
.over-panel .over-best { padding-bottom: 4px; }
.over-panel .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.over-panel .stats > div { grid-column: auto !important; padding: 8px 10px; }
.over-panel .stats .lbl { font-size: 10px; }
.over-panel .stats b { font-size: 16px; }
.over-panel .sub { margin: 0; }
.over-panel .missions { gap: 6px; }
.over-panel .missions.compact .mission { padding: 8px 10px; gap: 4px; }
.over-panel .m-text { font-size: 13px; }
.over-panel .m-bar { height: 4px; }
.over-panel .m-prog { font-size: 11px; }
.over-panel .over-set { padding: 8px 10px; font-size: 13px; gap: 4px; }
.over-panel .feedback-cta { padding: 9px 12px; font-size: 13px; }
.over-panel .over-row { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 8px; }
.over-panel .over-row .btn { height: 52px; padding-inline: 12px; }
.over-panel .over-row .btn.primary { font-size: clamp(22px, 6.2vw, 28px); letter-spacing: .02em; }

/* Rampage: mode picker and the countdown */
.mode-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.mode-btn { display: grid; gap: 2px; justify-items: center; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); color: var(--dim); cursor: pointer;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.mode-btn b { font-family: var(--display); font-size: 24px; font-style: italic; letter-spacing: .04em; text-transform: uppercase; line-height: 1; }
.mode-btn small { font-size: 11px; }
.mode-btn.on { border-color: var(--sodium); color: var(--ink); background: rgba(255,179,71,.14); }
.mode-btn.on b { color: var(--sodium); }
.timer { display: block; margin-top: 2px; font-family: var(--display); font-size: 30px; font-weight: 600; font-style: italic; letter-spacing: .04em; color: var(--ink); text-shadow: 0 2px 0 rgba(0,0,0,.5); }
.timer.low { color: var(--wreck); animation: timerPulse .5s ease-in-out infinite alternate; }
@keyframes timerPulse { to { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .timer.low { animation: none; } }
.banner.grew #bannerBig { font-size: clamp(56px, 16vw, 110px); color: var(--gold); }

/* Rampage timer sits beside the "Score" label so it doesn't push the HUD down */
.timer { display: inline-block; margin: 0 0 0 10px; padding: 1px 8px; border-radius: 8px; background: rgba(8,11,22,.6); border: 1px solid var(--line);
  font-size: 22px; line-height: 1.1; vertical-align: middle; }
.timer[hidden] { display: none; }
.banner.grew #bannerBig { font-size: clamp(44px, 13vw, 96px); white-space: nowrap; }
@media (max-width: 640px) { .tagline { display: none; } }

.flash.white { background: radial-gradient(rgba(255,255,255,.85), rgba(255,255,255,.35)); }

/* ---------- HUD v2: the Tank sits up top where you look; the growth meter moves to the bottom-left ---------- */
.hud-vitals { top: calc(14px + env(safe-area-inset-top, 0px)); bottom: auto; left: 50%; transform: translateX(-50%); width: min(380px, 44vw); }
.hud-vitals .vital { gap: 5px; }
.hud-vitals .lbl { font-size: 12px; font-weight: 700; letter-spacing: .16em; }
.bar.fuel { height: 14px; border-radius: 7px; }
.hud-up { top: auto; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); left: max(16px, env(safe-area-inset-left, 0px)); transform: none; width: min(300px, 34vw); }
@media (max-width: 640px) {
  .hud-vitals { top: calc(104px + env(safe-area-inset-top, 0px)); left: max(16px, env(safe-area-inset-left, 0px)); transform: none; width: calc(100% - 172px); }
  .hud-up { bottom: calc(18px + env(safe-area-inset-bottom, 0px)); width: calc(50% - 64px); }
  .hud-up .tier-track { margin-bottom: 5px; }
  .hud-up .up-row { min-height: 0; }
}
/* phones and tablets: Boost sits bottom-centre, between your thumbs, clear of the steering halves' edges */
@media (pointer: coarse) {
  .boost-btn { right: auto; left: 50%; margin-left: -42px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .hud-speed .tags { display: none; }   /* the Boost button lights up (and turns gold for Power Ram) instead */
}

/* Shop: Upgrades and Paint behind game-style tabs */
.shop-tabs { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px 0; border-bottom: 1px solid var(--line); }
.shop-tabs[hidden] { display: none; }
.st-tabs { display: flex; gap: 4px; }
.st-tab { position: relative; padding: 10px 18px 12px; border: 1px solid transparent; border-bottom: none; border-radius: 10px 10px 0 0; background: none; color: var(--dim);
  font-family: var(--display); font-size: 24px; font-style: italic; letter-spacing: .04em; text-transform: uppercase; line-height: 1; cursor: pointer; }
.st-tab.on { color: var(--ink); background: rgba(255,255,255,.06); border-color: var(--line); }
.st-tab.on::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 2px; background: var(--sodium); }
.st-coins { padding: 6px 12px; border-radius: 999px; background: rgba(255,210,58,.12); border: 1px solid rgba(255,210,58,.4); color: var(--gold); font-weight: 700; font-size: 14px; margin-bottom: 8px; white-space: nowrap; }
.st-coins b { font-variant-numeric: tabular-nums; }

/* the Shop sheet keeps a fixed height, so switching tabs doesn't make it jump */
.sheet.is-shop { height: min(86vh, 600px); }   /* sized to the Upgrades tab; Paint scrolls inside it */
@media (max-width: 640px) { .sheet.is-shop { height: min(82vh, 560px); } }
.sheet.is-shop .sheet-body { flex: 1; min-height: 0; align-content: start; }

/* ---------- the boss: bar under the Tank, an arrow when it's off-screen, and a win style ---------- */
.boss-bar { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 10px; background: rgba(8,11,22,.66); border: 1px solid rgba(255,46,77,.55); font-size: 12px; font-weight: 700; }
.boss-bar[hidden] { display: none; }
.bb-name { color: #ff6f86; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.bb-pips { display: flex; gap: 4px; }
.bb-pips i { width: 16px; height: 8px; border-radius: 2px; background: var(--wreck); box-shadow: 0 0 6px rgba(255,46,77,.6); }
.bb-pips i.gone { background: rgba(255,255,255,.12); box-shadow: none; }
.bb-info { margin-left: auto; color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.boss-bar.amber { border-color: var(--bounce); } .boss-bar.amber .bb-info { color: var(--bounce); }
.boss-bar.green { border-color: var(--smash); } .boss-bar.green .bb-info { color: var(--smash); }
.boss-arrow .fa-icon { background: rgba(255,46,77,.18); border-color: var(--wreck); box-shadow: 0 0 14px rgba(255,46,77,.6); }
.boss-arrow .fa-icon::before { border-bottom-color: var(--wreck); }
.boss-arrow .fa-label { color: #ff6f86; }
.reason.win { color: var(--smash); }
@media (max-width: 640px) {
  .boss-bar { flex-wrap: wrap; row-gap: 3px; }
  .bb-info { margin-left: 0; width: 100%; }
}

/* ---------- the Tank as a health bar ---------- */
.hpbar { position: relative; height: 18px; border-radius: 6px; overflow: hidden; background: #0b0e1a;
  border: 2px solid rgba(255,255,255,.9); box-shadow: 0 0 0 2px rgba(0,0,0,.55), 0 4px 12px rgba(0,0,0,.45); }
.hpbar > span { position: absolute; inset: 0; transform-origin: left; transform: scaleX(1); }
.hp-trail { background: linear-gradient(180deg, #ff6b7f, #ff2e4d 55%, #c4122f); }
.hp-gain { background: linear-gradient(180deg, #ffffff, #c9ffe0); }
.hp-fill { background: linear-gradient(180deg, #8dffbf, #2fd877 55%, #18a456); box-shadow: inset 0 2px 0 rgba(255,255,255,.35); }
.hpbar.mid .hp-fill { background: linear-gradient(180deg, #ffe08a, #ffb347 55%, #d9861a); }
.hpbar.low .hp-fill { background: linear-gradient(180deg, #ff8a9a, #ff3b55 55%, #c4122f); }
.hpbar.low { border-color: #ff6f86; animation: hpWarn .55s ease-in-out infinite alternate; }
.hp-ticks { background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 2px), rgba(0,0,0,.5) calc(25% - 2px) 25%); }
.hpbar.hit { animation: hpShake .32s; }
.hpbar.low.hit { animation: hpShake .32s, hpWarn .55s ease-in-out .32s infinite alternate; }
@keyframes hpShake { 20% { transform: translateX(-5px); } 45% { transform: translateX(4px); } 70% { transform: translateX(-2px); } }
@keyframes hpWarn { to { box-shadow: 0 0 0 2px rgba(0,0,0,.55), 0 0 16px rgba(255,46,77,.85); } }
@media (max-width: 640px) { .hpbar { height: 16px; } }
@media (prefers-reduced-motion: reduce) { .hpbar.hit, .hpbar.low, .hpbar.low.hit { animation: none; } }
.hpbar.low .hp-trail { background: linear-gradient(180deg, #ffffff, #ffd0d7); }   /* stands out against the red fill */

/* boss health bar */
.boss-bar .boss-hp { flex: 1; min-width: 60px; height: 10px; border-width: 1.5px; border-radius: 4px; }
.boss-hp .hp-fill { background: linear-gradient(180deg, #ff8a9a, #ff2e4d 55%, #b0102a); box-shadow: none; }
.boss-hp .hp-trail { background: #ffffff; }
@media (max-width: 640px) { .boss-bar .boss-hp { min-width: 0; } }

/* Settings sheet */
.set-h { margin: 0; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.seg button { display: grid; gap: 3px; justify-items: center; padding: 10px 6px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--dim); cursor: pointer; text-align: center; }
.seg button b { font-family: var(--display); font-size: 22px; font-style: italic; letter-spacing: .04em; text-transform: uppercase; line-height: 1; }
.seg button small { font-size: 11px; line-height: 1.25; }
.seg button.on { border-color: var(--sodium); background: rgba(255,179,71,.14); color: var(--ink); }
.seg button.on b { color: var(--sodium); }
.set-row { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 14px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255,255,255,.04); color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; text-align: left; }
.set-row span { color: var(--dim); font-size: 20px; line-height: 1; }
.set-row:hover { background: rgba(255,255,255,.08); }
/* How to play: short list */
.howto-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.howto-list li { display: grid; grid-template-columns: 108px 1fr; gap: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.04); font-size: 14px; }
.howto-list b { color: var(--sodium); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.howto-list .kb { color: var(--dim); }
@media (pointer: coarse) { .howto-list .kb { display: none; } }
.set-row { box-sizing: border-box; }   /* the feedback link is an <a>, which would otherwise add its padding to 100% width */

/* =================== Phone held sideways (wide and short screens) =================== */
@media (orientation: landscape) and (max-height: 500px) {
  /* ---- landing: logo and stats on the left, menu down the right edge, the car in between ---- */
  .landing { flex-direction: row; align-items: stretch; gap: 16px;
    background: linear-gradient(90deg, rgba(7,10,22,.7) 0%, transparent 30%, transparent 58%, rgba(7,10,22,.85) 100%); }
  .land-top { flex-direction: column; align-items: flex-start; justify-content: flex-start; padding-right: 0; gap: 10px; flex-wrap: nowrap; }
  .landing .logo { font-size: 54px; }
  .land-stats span { min-width: 54px; padding: 4px 9px; }
  .land-stats b { font-size: 20px; }
  .land-icons { position: static; display: flex; gap: 8px; order: 3; }
  .land-icons .round-btn { width: 40px; height: 40px; }
  .land-bottom { width: min(340px, 44vw); margin: 0; align-content: end; justify-items: stretch; gap: 8px; }
  .landing .tagline { display: none; }
  .map-row { display: grid; } .map-btn { justify-content: center; }
  .land-nav { justify-content: stretch; } .land-nav .nav-btn { flex: 1; height: 36px; }
  .mode-btn { padding: 6px 8px; } .mode-btn b { font-size: 20px; } .mode-btn small { font-size: 10px; }
  .btn.drive { height: 52px; font-size: 30px; }

  /* ---- in-game HUD: smaller pieces so the road stays visible ---- */
  .hud-score .num { font-size: 40px; margin-top: 2px; }
  .timer { font-size: 18px; }
  .hud-map { flex-direction: row-reverse; align-items: flex-start; gap: 8px; }
  #minimap { width: 100px; height: 100px; }
  .hud-speed .num { font-size: 44px; }
  .hud-vitals { top: calc(10px + env(safe-area-inset-top, 0px)); width: min(360px, 40vw); gap: 6px; }
  .hud-vitals .lbl { display: none; }
  .hud-up { width: min(260px, 30vw); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .boost-btn { width: 74px; height: 74px; margin-left: -37px; font-size: 17px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .banner #bannerBig { font-size: clamp(40px, 9vh + 24px, 72px); }
  .coach { top: calc(96px + env(safe-area-inset-top, 0px)); }

  /* ---- game over: two columns in one card (result and buttons left, missions right) ---- */
  .over-panel { width: min(820px, 100%); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 18px; row-gap: 10px; padding: 16px; align-items: start; }
  .over-panel > * { grid-column: 1; }
  #overReason { grid-row: 1; } .over-top { grid-row: 2; } .over-panel .stats { grid-row: 3; } #overSet { grid-row: 4; } .over-panel .over-row { grid-row: 5; }
  .over-panel > .sub { grid-column: 2; grid-row: 1; }
  #overMissions { grid-column: 2; grid-row: 2 / span 3; }
  .over-panel .feedback-cta { grid-column: 2; grid-row: 5; align-self: stretch; }
  .over-panel .over-score { font-size: 56px; }
  .over-panel .over-row .btn { height: 48px; }

  /* ---- menus: centred panels that use most of the height ---- */
  .sheet { max-height: 92vh; }
  .sheet.is-shop { height: 92vh; }
  .sheet-head { padding: 10px 18px 8px; }
  .sheet-head h2 { font-size: 30px; }
  .shop-tabs { padding-top: 6px; } .st-tab { font-size: 20px; padding: 7px 14px 9px; }
  .sheet-body { padding: 12px 18px 16px; }
  .paints { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  /* ---- map picker: wide cards, preview on the left ---- */
  .mp-headbar h2 { font-size: 30px; }
  .map-card { flex-basis: min(560px, 74vw); grid-template-columns: minmax(0, 200px) minmax(0, 1fr); }
  .map-track::before, .map-track::after { flex-basis: calc(50% - min(280px, 37vw) - 18px); }
  .mc-preview { max-height: none; height: 100%; aspect-ratio: auto; }
  .mc-info { gap: 8px; padding: 12px 14px; }
  .mc-info h3 { font-size: 30px; }
  .mc-go { height: 44px; font-size: 22px; }
}

/* ---- sideways, round 2: smaller in-game text so it doesn't cover the road ---- */
@media (orientation: landscape) and (max-height: 500px) {
  .float { font-size: 20px; } .float.big { font-size: 24px; } .float.gold { font-size: 26px; } .float.miss { font-size: 17px; }
  .float.dash { font-size: 28px; } .float.drift { font-size: 21px; } .float.air { font-size: 22px; } .float.tiny { font-size: 14px; }
  .float.boosted { font-size: 23px; } .float.ram { font-size: 26px; }
  .banner { top: 17%; width: min(460px, 60vw); }
  .banner #bannerBig, .banner.go #bannerBig, .banner.grew #bannerBig { font-size: 46px; }
  #bannerSmall { font-size: 13px; margin-top: 6px; }
  .coach { font-size: 13px; padding: 7px 12px; } .coach.ram { font-size: 17px; } .coach .cr { width: 16px; height: 16px; border-width: 3px; }
  .mission-pop { top: calc(70px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -12px) scale(.82); }
  .mission-pop.on { transform: translate(-50%, 0) scale(.82); }
  .toast { font-size: 12px; padding: 6px 12px; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  #comboX { font-size: 22px; }
  .hud-score .lbl, .up-label, .pip-name, .hud-speed .unit, .tag { font-size: 10px; }
  .boss-bar { font-size: 11px; padding: 3px 8px; }
  .food-arrow .fa-icon { width: 26px; height: 26px; } .fa-label { font-size: 9px; }
  .tutor .tmsg { top: 12%; padding: 10px 14px; } .tutor .tmsg b#tutorBig { font-size: 36px; } .tutor .tmsg #tutorSmall { font-size: 13px; }

  /* ---- game over, round 2: fills the screen; missions on the left, everything else on the right, and
     Drive again bottom-right in the same spot (and size) as Drive on the landing screen ---- */
  #overScreen { padding: 0; place-items: stretch; }
  #overScreen .over-panel { width: auto; height: 100%; box-sizing: border-box; border-radius: 0; border: 0; max-width: none;
    padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    grid-template-columns: minmax(0, 1fr) min(340px, 44vw); grid-template-rows: auto auto auto auto 1fr auto; column-gap: 20px; row-gap: 8px;
    background: linear-gradient(90deg, rgba(7,10,22,.86), rgba(7,10,22,.72)); }
  #overScreen .over-panel > * { grid-column: 2; }
  #overScreen .over-panel > .sub { grid-column: 1; grid-row: 1; }
  #overScreen #overMissions { grid-column: 1; grid-row: 2 / -1; overflow-y: auto; align-self: stretch; }
  #overScreen #overReason { grid-row: 1; } #overScreen .over-top { grid-row: 2; } #overScreen .stats { grid-row: 3; } #overScreen #overSet { grid-row: 4; }
  #overScreen .feedback-cta { display: none; }
  #overScreen .over-row { grid-row: 6; grid-template-columns: minmax(0, 1fr); gap: 8px; align-self: end; }
  #overScreen #menuBtn { order: 1; height: 36px; font-size: 13px; }
  #overScreen #againBtn { order: 2; height: 52px; font-size: 30px; }
  #overScreen .over-score { font-size: 48px; }
  #overScreen .over-top { gap: 8px; }
  #overScreen .stats { gap: 6px; } #overScreen .stats > div { padding: 6px 8px; }
  #overScreen .over-set { font-size: 12px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  #overScreen #overMissions { align-content: start; }   /* cards keep their natural height */
  .hud-score .num { font-size: 32px; }
  .hud-speed .num { font-size: 34px; }
  .timer { font-size: 16px; }
}
@media (orientation: landscape) and (max-height: 500px) { .pending { font-size: 18px; } }

/* ---------- Boost back on the right; tips move to the left so the road ahead stays clear ---------- */
@media (pointer: coarse) {
  .boost-btn { left: auto; margin-left: 0; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
}
@media (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
  .boost-btn { margin-left: 0; bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
}
.coach, .coach.on { left: max(14px, env(safe-area-inset-left, 0px)); right: auto; top: 40%; transform: none; max-width: min(42vw, 300px); width: auto;
  font-size: 13px; padding: 8px 12px; border-radius: 10px; align-items: flex-start; text-align: left; }
.coach { transform: translateX(-12px); }
.coach.on { transform: none; }
.coach.ram { font-size: 17px; }
.coach .cr { width: 16px; height: 16px; border-width: 3px; margin-top: 1px; }
.toast, .toast.on { left: max(14px, env(safe-area-inset-left, 0px)); right: auto; bottom: auto; top: 30%; transform: none; max-width: min(42vw, 300px);
  white-space: normal; text-align: left; font-size: 12px; padding: 6px 11px; }
.toast { transform: translateX(-12px); }
.toast.on { transform: none; }
@media (orientation: landscape) and (max-height: 500px) {
  .coach, .coach.on { top: 34%; max-width: min(30vw, 260px); font-size: 12px; } .coach.ram { font-size: 15px; }
  .toast, .toast.on { top: 22%; bottom: auto; max-width: min(30vw, 260px); }
}

/* ---------- top-right: minimap with Pause in the corner beside it, police stars under the map ---------- */
.hud-map, .hud-map { display: grid; grid-template-columns: auto auto; grid-template-areas: "map pause" "stars ."; align-items: start; justify-items: center; gap: 6px 8px; flex-direction: initial; }
.hud-map #minimap { grid-area: map; }
.hud-map #pauseBtn { grid-area: pause; }
.hud-map .stars { grid-area: stars; }

/* sideways game over: a slim feedback link just above the buttons, for the playtest */
@media (orientation: landscape) and (max-height: 500px) {
  #overScreen .feedback-cta { display: flex; grid-column: 2; grid-row: 5; align-self: end; flex-wrap: nowrap; padding: 7px 12px; font-size: 12px; border-radius: 10px; }
  #overScreen .feedback-cta { justify-content: center; }
  #overScreen .feedback-cta span { display: none; }
  #overScreen .feedback-cta b { font-size: 13px; }
}

/* ---------- full screen: landing button, Settings row, iPhone home-screen hint ---------- */
.round-btn[hidden], .set-row[hidden], .btn[hidden], .ios-hint[hidden] { display: none; }
#fsRow span b { font-weight: 700; color: var(--dim); margin-right: 4px; }
.ios-hint { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px 9px 14px; border-radius: 12px;
  background: rgba(8,11,22,.82); border: 1px solid var(--line); font-size: 13px; line-height: 1.3; color: var(--ink); pointer-events: auto; }
.ios-hint b { color: var(--sodium); }
.ios-hint button { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); color: var(--ink); font-size: 13px; }

/* ---------- Wheel steering: a wheel under the left thumb, Boost under the right ---------- */
/* the growth meter moves up under the Tank, out of the left thumb's way */
.hud-vitals .hud-up { position: static; transform: none; width: auto; inset: auto; margin-top: 2px; }
.hud-vitals .hud-up .tier-track { margin-bottom: 4px; }
.hud-vitals .hud-up .up-row { min-height: 0; margin-top: 3px; }
.wheel { position: absolute; left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  width: 128px; height: 128px; border-radius: 50%; display: grid; place-items: center; touch-action: none; user-select: none; -webkit-user-select: none;
  background: radial-gradient(circle, rgba(8,11,22,.18) 0 55%, rgba(8,11,22,.42) 56%); border: 1px solid var(--line); color: rgba(235,240,255,.82); pointer-events: auto; }
.wheel[hidden] { display: none; }
.wheel-art { width: 86%; height: 86%; display: block; transition: transform .22s cubic-bezier(.3,1.4,.5,1); filter: drop-shadow(0 2px 4px rgba(0,0,0,.6)); }
.wheel-art svg { width: 100%; height: 100%; display: block; }
.wheel.held { border-color: var(--sodium); color: #fff; }
.wheel.held .wheel-art { transition: none; }
.wheel.teach { animation: wheelTeach 1.1s ease-in-out infinite; }
@keyframes wheelTeach { 0%, 100% { box-shadow: 0 0 0 0 rgba(61,255,143,.55); } 50% { box-shadow: 0 0 0 14px rgba(61,255,143,0); border-color: var(--smash); } }
@media (orientation: landscape) and (max-height: 500px) {
  .wheel { width: 112px; height: 112px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); left: max(20px, env(safe-area-inset-left, 0px)); }
  .hud-vitals .hud-up .tier-track { display: none; }   /* keep it to one slim bar sideways */
}
/* the "turn sideways" tip only makes sense while the phone is upright */
@media (orientation: landscape) { .rot-hint { display: none !important; } }
.land-bottom .ios-hint + .ios-hint { margin-top: -4px; }
.seg { display: grid; grid-template-columns: repeat(2, 1fr); }
@media (orientation: landscape) and (max-height: 500px) { .seg { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Buttons steering: hold ◀ or ▶ (bottom-left, where the wheel would be) ---------- */
.steer-btns { position: absolute; left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(22px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 12px; pointer-events: auto; }
.steer-btns[hidden] { display: none; }
.st-btn { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; touch-action: none; user-select: none; -webkit-user-select: none;
  background: rgba(8,11,22,.42); border: 1px solid var(--line); color: rgba(235,240,255,.85); padding: 0; }
.st-btn svg { width: 34px; height: 34px; }
.st-btn.right svg { transform: scaleX(-1); }
.st-btn.held { border-color: var(--sodium); color: #fff; background: rgba(255,179,71,.22); transform: scale(.95); }
.st-btn.teach { animation: wheelTeach 1.1s ease-in-out infinite; }
@media (orientation: landscape) and (max-height: 500px) {
  .steer-btns { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); left: max(20px, env(safe-area-inset-left, 0px)); }
  .st-btn { width: 68px; height: 68px; }
  .seg { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Joystick steering (default on touch): bigger than the wheel, bottom-left ---------- */
.stick { position: absolute; left: max(14px, env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: 156px; height: 156px; border-radius: 50%; display: grid; place-items: center; touch-action: none; user-select: none; -webkit-user-select: none; pointer-events: auto;
  background: radial-gradient(circle, rgba(8,11,22,.22), rgba(8,11,22,.48)); border: 2px solid var(--line); }
.stick[hidden] { display: none; }
.stick-guide { position: absolute; inset: 0; pointer-events: none; }
.stick-guide i { position: absolute; top: 50%; width: 0; height: 0; margin-top: -8px; border: 8px solid transparent; opacity: .55; }
.stick-guide i:first-child { left: 10px; border-right: 11px solid rgba(235,240,255,.85); border-left: 0; }
.stick-guide i:last-child { right: 10px; border-left: 11px solid rgba(235,240,255,.85); border-right: 0; }
.stick-knob { width: 70px; height: 70px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 38% 32%, #f4f6ff, #aeb6d6 60%, #7b84a8); box-shadow: 0 4px 12px rgba(0,0,0,.55), inset 0 -3px 6px rgba(0,0,0,.25);
  transition: transform .18s cubic-bezier(.3,1.5,.5,1); }
.stick.held { border-color: var(--sodium); }
.stick.held .stick-knob { transition: none; background: radial-gradient(circle at 38% 32%, #fff4e0, #ffc877 60%, #e09a3c); }
.stick.teach { animation: wheelTeach 1.1s ease-in-out infinite; }
@media (orientation: landscape) and (max-height: 500px) {
  .stick { width: 140px; height: 140px; left: max(20px, env(safe-area-inset-left, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .stick-knob { width: 62px; height: 62px; }
  .seg { grid-template-columns: repeat(3, 1fr); }
}
.seg:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ◀ ▶ sit level with the Boost button (centres lined up) */
.steer-btns { bottom: calc(104px + env(safe-area-inset-bottom, 0px)); }
@media (orientation: landscape) and (max-height: 500px) { .steer-btns { bottom: calc(81px + env(safe-area-inset-bottom, 0px)); } }
