/* Rainline: black and white, bold slanted type and one acid lime (after the street-racing menus the user picked).
   Every shape leans 12 degrees. */
:root {
  --ink: #0a0a0a; --panel: #0c0c0c; --text: #f5f5f5; --dim: #a3a3a3; --line: rgba(245, 245, 245, 0.16);
  --accent: #e3fc02; --red: #ff2a3d;   /* red only for the start lights and the race rules (penalties) */
  --orange: #ff8a1f;                   /* the rules' warnings */
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --lean: -12deg;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; color: var(--text); font-family: var(--font); }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
body.playing, body.playing * { cursor: none !important; }   /* driving: no mouse pointer (main.js sets the class) */
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui .interactive, #ui button, #ui input { pointer-events: auto; }

/* boot screen */
#boot { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: var(--ink); z-index: 10; font-family: var(--font); }
/* it comes and goes on the slant: an edge leaning 12 degrees (21.26vh across the height) sweeps left to right, a
   lime blade riding it (#blade). In: the screen fills behind the edge, the wordmark is drawn, the keys rise. Out:
   the scene shows behind the edge. */
/* the picture behind it: a wet night at the track (16:9, or the wide one on an ultrawide monitor: index.html picks by the screen, not the window), drifting slowly
   closer; shaded darker in the middle for the logo and at the bottom for the keys */
#boot .boot-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
#boot .boot-bg::before { content: ""; position: absolute; inset: 0; background: url(assets/ui/boot.jpg) center / cover no-repeat; transform-origin: 40% 60%; }
#boot .boot-bg.go::before { animation: boot-drift 24s cubic-bezier(.2,.6,.3,1) both; }
#boot.wide .boot-bg::before { background-image: url(assets/ui/boot-wide.jpg); }
#boot .boot-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 38% 30% at 50% 50%, rgba(10,10,10,0.6), rgba(10,10,10,0) 100%), linear-gradient(180deg, rgba(10,10,10,0.25), rgba(10,10,10,0) 25%, rgba(10,10,10,0) 62%, rgba(10,10,10,0.88)); }
@keyframes boot-drift { from { transform: scale(1); } to { transform: scale(1.09); } }
#boot.in { animation: boot-in 0.48s cubic-bezier(.76,0,.24,1) both; }
#boot.in .brand .plate { animation: boot-draw 0.7s 0.3s cubic-bezier(.2,.8,.2,1) both; }
#boot.in .boot-keys { animation: boot-rise 0.5s 0.45s cubic-bezier(.2,.8,.2,1) both; }
#boot.done { animation: boot-out 0.55s cubic-bezier(.76,0,.24,1) forwards; pointer-events: none; }
#blade { position: fixed; top: 0; bottom: 0; left: -5px; width: 10px; background: var(--accent); box-shadow: 0 0 26px rgba(227,252,2,0.55); transform: translateX(-40vh) skewX(var(--lean)); z-index: 11; pointer-events: none; }
#blade.go { animation: blade-sweep 0.5s cubic-bezier(.76,0,.24,1) both; }
@keyframes boot-in { from { clip-path: polygon(0 0, 0 0, -21.26vh 100%, -21.26vh 100%); } to { clip-path: polygon(0 0, calc(100% + 21.26vh) 0, 100% 100%, -21.26vh 100%); } }
@keyframes boot-out { from { clip-path: polygon(-21.26vh 0, calc(100% + 21.26vh) 0, 100% 100%, -21.26vh 100%); } to { clip-path: polygon(calc(100% + 21.26vh) 0, calc(100% + 21.26vh) 0, 100% 100%, 100% 100%); } }
@keyframes blade-sweep { from { transform: translateX(-10.63vh) skewX(var(--lean)); } to { transform: translateX(calc(100vw + 10.63vh)) skewX(var(--lean)); } }
@keyframes boot-draw { from { clip-path: polygon(0 0, 0 0, -10% 100%, 0 100%); } to { clip-path: polygon(0 0, 110% 0, 100% 100%, 0 100%); } }
@keyframes boot-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.boot-bar { position: relative; width: 260px; height: 3px; background: rgba(245,245,245,0.12); transform: skewX(var(--lean)); }
/* the percentage, small over the bar's right end: it keeps counting through the long steps (main.js progressBar) */
.boot-pct { position: absolute; right: 0; bottom: 7px; font-size: 11px; font-weight: 900; letter-spacing: 0.06em; color: var(--text); font-variant-numeric: tabular-nums; }
.boot-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.3s; }
.boot-msg { font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
/* how to drive, under the loading bar: the keys, or the controller's once one has said hello */
.boot-keys { position: absolute; left: 0; right: 0; bottom: 9vh; display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text); }
.boot-keys .how { display: flex; gap: 16px; color: var(--dim); }
.boot-keys .how b { color: var(--text); font-weight: 900; }
.boot-keys .keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; max-width: 92vw; }
.boot-keys .keys span { display: inline-flex; align-items: center; gap: 4px; }
.boot-keys .keys span kbd:last-of-type { margin-right: 4px; }
.boot-keys kbd { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; font: inherit; font-size: 9px; letter-spacing: 0.04em; color: var(--text); background: var(--panel); border: 1px solid rgba(245,245,245,0.35); transform: skewX(var(--lean)); }
#boot .pad, #boot.pad .kb { display: none; }
#boot.pad .pad { display: flex; }
#boot.pad .hint.pad { display: inline; color: var(--accent); }
.boot-error { color: var(--text); max-width: 480px; text-align: center; font-size: 13px; line-height: 1.5; }

/* the wordmark: a small outlined tag over a white slanted plate, black italic type, a lime slash through it */
.brand { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; font-family: var(--font); }
.brand .tag { border: 2px solid var(--text); padding: 3px 10px 2px; font-weight: 900; font-size: 13px; letter-spacing: 0.16em; color: var(--text); text-transform: uppercase; }
.brand .plate { position: relative; background: var(--text); color: var(--ink); transform: skewX(var(--lean)); padding: 2px 22px 0; }
.brand .plate b { display: block; transform: skewX(12deg); font-weight: 900; font-style: italic; font-stretch: 75%; font-size: 64px; line-height: 0.95; letter-spacing: -0.03em; text-transform: uppercase; }
.brand .plate i { position: absolute; left: -8%; right: -8%; top: 54%; height: 5px; background: var(--accent); transform: rotate(-4deg); box-shadow: 0 0 0 2px var(--ink); }
.brand.small { gap: 3px; }
.brand.small .tag { font-size: 8px; padding: 1px 6px; border-width: 1px; }
.brand.small .plate { padding: 1px 10px 0; }
.brand.small .plate b { font-size: 26px; }
.brand.small .plate i { height: 2px; box-shadow: 0 0 0 1px var(--ink); }

/* HUD: dark slanted plates over the picture, heavy italic numbers, lime for you and for bests */
.hud { position: absolute; inset: 0; font-family: var(--font); color: var(--text); }
.hud-plate { position: absolute; background: rgba(12,12,12,0.82); clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%); }
.hud-pos { left: 0; top: 0; display: grid; grid-template-columns: auto auto; column-gap: 22px; padding: 10px 34px 8px 24px; }
.hud-pos .big { display: flex; align-items: baseline; }
.hud-pos .big b { font-size: 56px; font-weight: 900; font-style: italic; line-height: 0.95; font-variant-numeric: tabular-nums; }
.hud-pos .big small { font-size: 20px; font-weight: 700; font-style: italic; color: var(--dim); margin-left: 2px; text-transform: uppercase; }
.hud-pos .side { text-align: right; align-self: center; }
.hud-pos small { display: block; font-size: 10px; font-weight: 800; letter-spacing: 0.16em; color: var(--dim); text-transform: uppercase; }
.hud-pos .side b { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.hud-pos .rows { grid-column: 1 / 3; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 5px; display: flex; flex-direction: column; gap: 2px; }
.hud-pos .rows span { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; }
.hud-pos .rows b { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hud-pos .rows b.best { color: var(--accent); }
.hud-rel { right: 0; top: 0; min-width: 300px; padding: 8px 18px 8px 30px; clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%); font-size: 13px; font-weight: 800; }
.hud-rel > div { display: flex; align-items: center; gap: 8px; height: 26px; }
.hud-rel > div + div { border-top: 1px solid var(--line); }
.hud-rel i, .hud-tags i, .hud-board i { font-style: normal; display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; background: var(--text); color: var(--ink); font-weight: 900; font-size: 11px; }
.hud-rel span { flex: 1; }
.hud-rel em { font-style: normal; font-variant-numeric: tabular-nums; }
.hud-rel .clear { color: var(--text); }
.flag { display: inline-block; flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,0.35); }
.hud-tags { position: absolute; inset: 0; overflow: hidden; }
.hud-tags .tag { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 3px; background: rgba(12,12,12,0.78); font-size: 12px; font-weight: 800; white-space: nowrap; will-change: transform; }
.hud-tags .tag::after { content: ""; position: absolute; left: 6px; top: 24px; width: 1px; height: calc(var(--lead, 30px) - 2px); background: rgba(245,245,245,0.75); }
.hud-tags .tag em { font-style: normal; font-weight: 600; color: var(--dim); font-variant-numeric: tabular-nums; }
/* the standings: a dark tower down the left under the place plate (after the reference the user picked), the
   player's row white, a penalty in orange at the end of its row */
.hud-board { position: absolute; left: 0; top: 168px; display: flex; flex-direction: column; gap: 3px; padding: 10px 14px 12px 14px; background: rgba(12,12,12,0.78); clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%); font-size: 13px; font-weight: 900; }
.hud-board:empty { display: none; }
.hud-board small { margin: 0 0 4px 2px; font-size: 10px; font-weight: 900; letter-spacing: 0.16em; color: var(--dim); text-transform: uppercase; }
.hud-board div { display: flex; align-items: center; gap: 8px; height: 24px; padding: 0 10px 0 3px; min-width: 210px; }
.hud-board i { box-sizing: border-box; width: 24px; min-width: 24px; height: 20px; padding: 0; flex: none; font-size: 12px; font-variant-numeric: tabular-nums; }   /* one size for 1 and 12 */
.hud-board div.me { background: var(--text); color: var(--ink); clip-path: polygon(0 0, 100% 0, calc(100% - 7px) 100%, 0 100%); }
.hud-board div.me i { background: var(--ink); color: var(--text); }
.hud-board span { flex: 1; white-space: nowrap; }
.hud-board b { min-width: 46px; text-align: right; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; color: rgba(245,245,245,0.75); }
.hud-board em { font-style: normal; font-size: 10px; font-weight: 900; letter-spacing: 0.06em; padding: 2px 5px; background: var(--orange); color: var(--ink); font-variant-numeric: tabular-nums; }
.hud-map { left: 0; bottom: 0; width: 200px; height: 150px; padding: 14px 30px 14px 18px; }
.hud-map svg { width: 100%; height: 100%; overflow: visible; }
.hud-speedo { right: 0; bottom: 0; width: 300px; padding: 12px 22px 10px 40px; clip-path: polygon(26px 0, 100% 0, 100% 100%, 0 100%); }
.hud-speedo .revs { display: flex; gap: 3px; height: 14px; transform: skewX(var(--lean)); }
.hud-speedo .revs i { flex: 1; background: rgba(245,245,245,0.16); }
.hud-speedo .revs i.on { background: var(--text); }
.hud-speedo .revs i.red.on, .hud-speedo .revs.limit i.on { background: var(--red); }
.hud-speedo .revnums { position: relative; height: 13px; margin-top: 3px; transform: skewX(var(--lean)); }
.hud-speedo .revnums i { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; font-weight: 800; font-style: italic; color: var(--dim); line-height: 1; }
.hud-speedo .revnums i::before { content: ''; position: absolute; left: 50%; top: -4px; width: 1px; height: 3px; background: currentColor; }
.hud-speedo .revnums i.red { color: var(--red); }
.hud-speedo .revnums small { position: absolute; left: 0; top: 0; font-size: 9px; font-weight: 800; letter-spacing: 0.1em; color: var(--dim); opacity: 0.7; }
.hud-speedo .read { display: flex; align-items: flex-end; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.hud-speedo .spd { font-size: 64px; font-weight: 900; font-style: italic; line-height: 0.9; font-variant-numeric: tabular-nums; }
.hud-speedo .unit { font-size: 11px; font-weight: 800; letter-spacing: 0.14em; color: var(--dim); margin-bottom: 4px; }
.hud-speedo .gear { display: grid; place-items: center; width: 38px; height: 44px; background: var(--text); color: var(--ink); font-size: 34px; font-weight: 900; font-style: italic; transform: skewX(var(--lean)); }
.hud-speedo .tyres { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.hud-speedo .tyres small { font-size: 10px; font-weight: 800; letter-spacing: 0.14em; color: var(--dim); text-transform: uppercase; }
.hud-speedo .tyres i { flex: 1; height: 3px; background: rgba(245,245,245,0.16); }
.hud-speedo .tyres u { display: block; height: 100%; background: #fff; }
.hud-msg { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); font-size: clamp(20px, 2.8vw, 38px); font-weight: 900; font-style: italic; text-transform: uppercase; opacity: 0; transition: opacity 0.3s; white-space: nowrap; text-shadow: 0 2px 14px rgba(0,0,0,0.6); }
.hud-msg.on { opacity: 1; }
.hud-msg[data-kind="best"], .hud-msg[data-kind="go"] { color: var(--accent); }
/* the lap just done: top centre, drops in, stays five seconds */
.hud-lap { left: 50%; top: 0; padding: 7px 30px 9px; clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 14px 100%); opacity: 0; transform: translate(-50%, -100%); transition: opacity 0.35s, transform 0.35s cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.hud-lap.on { opacity: 1; transform: translate(-50%, 0); }
.hud-lap small { display: block; font-size: 9px; font-weight: 800; letter-spacing: 0.16em; color: var(--dim); text-transform: uppercase; }
.hud-lap .head { display: flex; justify-content: center; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.hud-lap .head small { color: var(--text); }
.hud-lap .head em { font-style: normal; font-size: 9px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; color: var(--red); }
.hud-lap .secs, .hud-lap .laps { display: flex; gap: 18px; justify-content: center; align-items: flex-end; }
.hud-lap .laps { border-top: 1px solid var(--line); margin-top: 5px; padding-top: 5px; }
.hud-lap b { font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; }
.hud-lap .secs .pb b { color: var(--accent); }
.hud-lap .laps .void b { color: var(--dim); text-decoration: line-through; }
.hud-lap b.best { color: var(--accent); }
.hud-lap i { font-style: italic; font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; padding: 1px 7px; }
.hud-lap i.up { background: var(--accent); color: var(--ink); }
.hud-lap i.down { color: var(--red); }
.hud-help { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); font-size: 10px; font-weight: 800; letter-spacing: 0.12em; color: var(--dim); text-transform: uppercase; text-shadow: 0 1px 6px rgba(0,0,0,0.6); }
.hud-lights { position: absolute; left: 50%; top: 14%; transform: translateX(-50%); display: flex; gap: 16px; }
.hud-lights i { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.5); }
.hud-lights i.on { background: var(--red); border-color: var(--red); box-shadow: 0 0 24px var(--red); }
.hud-backend { position: absolute; right: 12px; bottom: 6px; font-size: 9px; letter-spacing: 0.2em; color: rgba(255,255,255,0.35); }

/* menus */
.menu { position: absolute; inset: 0; font-family: var(--font); color: var(--text);
  background: linear-gradient(90deg, rgba(10,10,10,0.9) 0, rgba(10,10,10,0.75) 24%, rgba(10,10,10,0.3) 38%, rgba(10,10,10,0) 50%),
    linear-gradient(0deg, rgba(10,10,10,0.7) 0, rgba(10,10,10,0.35) 22%, rgba(10,10,10,0) 42%), linear-gradient(rgba(10,10,10,0.6) 0, rgba(10,10,10,0) 20%); }
.menu button { font: inherit; color: var(--text); background: transparent; border: 0; padding: 0; cursor: pointer; outline: none; text-align: left; }
.menu button[disabled] { opacity: 0.3; cursor: default; }
.menu > .brand { position: absolute; left: 40px; top: 30px; }

/* main list: big black type, each item a step further right going up, the chosen one on a lime band */
/* (in a short window the items get shorter so the list stays between the brand at the top and the description) */
.menu .mainnav { position: absolute; left: 0; bottom: 150px; display: flex; flex-direction: column; width: 500px; isolation: isolate;
  --mh: clamp(28px, calc((100vh - 290px) / var(--n, 9)), 52px); }
.menu .mi { position: relative; height: var(--mh, 52px); display: flex; align-items: center; gap: 12px; padding-left: calc(40px + var(--i) * 11px); font-weight: 900; font-size: calc(var(--mh, 52px) * 0.67); letter-spacing: -0.02em; text-transform: uppercase; line-height: 1; }
.menu .mi::before { content: ""; position: absolute; inset: 0 0 0 -60px; background: var(--accent); transform: skewX(var(--lean)) scaleX(0); transform-origin: left; transition: transform 0.18s cubic-bezier(.2,.8,.2,1); z-index: -1; }
.menu .mi:is(:focus, .is-cursor), .menu .mi:hover:not([disabled]) { color: var(--ink); }
.menu .mi:is(:focus, .is-cursor)::before, .menu .mi:hover:not([disabled])::before { transform: skewX(var(--lean)) scaleX(1); }
.menu .mi em { font-style: normal; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; border: 1px solid currentColor; padding: 3px 7px; transform: skewX(var(--lean)); }
.menu .desc { position: absolute; left: 40px; bottom: 100px; margin: 0; font-size: 15px; font-weight: 500; color: var(--text); max-width: 440px; line-height: 1.35; }
.menu .prompts { position: absolute; left: 40px; bottom: 30px; display: flex; gap: 22px; z-index: 2; }
.menu .prompt { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; }
.menu kbd { display: inline-flex; align-items: center; height: 22px; padding: 0 6px; border: 1px solid var(--text); transform: skewX(var(--lean)); font-family: var(--font); font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; box-shadow: 0 1px 6px rgba(10,10,10,0.55), 0 0 15px rgba(10,10,10,0.35); }
.menu kbd[data-pad] .pk { display: none; }
.menu.pad kbd[data-pad] .kk { display: none; }
.menu.pad kbd[data-pad] .pk { display: inline; }
.menu .foot { position: absolute; right: 40px; bottom: 34px; max-width: calc(100% - 360px); text-align: right; line-height: 1.6; font-size: 10px; font-weight: 800; letter-spacing: 0.12em; color: var(--dim); text-transform: uppercase; }

/* panels: a black blade down the left, its right edge cut on the slant */
.menu .panel { position: absolute; left: 0; top: 0; bottom: 0; width: 600px; max-width: 100vw; background: var(--panel); clip-path: polygon(0 0, 100% 0, calc(100% - 170px) 100%, 0 100%);
  padding: 30px 200px 90px 40px; overflow-y: auto; scrollbar-width: none; animation: blade-in 0.28s cubic-bezier(.2,.8,.2,1); }
.menu .panel.wide { width: 780px; }
.menu .panel.small { width: 520px; }
.menu .panel.side { width: 580px; }
.menu .panel::-webkit-scrollbar { display: none; }
@keyframes blade-in { from { transform: translateX(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
.menu:has(.panel) { background: linear-gradient(90deg, rgba(10,10,10,0.5), rgba(10,10,10,0) 70%); }
.menu header small { display: inline-block; background: rgba(14,14,14,0.96); border: 1px solid var(--line); padding: 5px 12px; transform: skewX(var(--lean)); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text); }
.menu h2 { margin: 16px 0 10px; font-weight: 900; font-size: 47px; letter-spacing: -0.02em; line-height: 0.95; text-transform: uppercase; transform: skewX(var(--lean)); transform-origin: left bottom; }
.menu h2.big { font-size: 80px; }
.menu h3 { font-weight: 800; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); margin: 22px 0 10px; }
.menu header p, .menu p { color: var(--dim); font-size: 13px; font-weight: 500; line-height: 1.45; margin: 4px 0; }
.menu .cars, .menu .chal, .menu .list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0; }
.menu .chal, .menu .list { grid-template-columns: 1fr; }
.menu .card { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 10px 14px 10px 16px; background: #161616; transition: background .12s, color .12s; }
.menu .card::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; }
.menu .card.on::after { background: var(--accent); }
.menu .card:is(:focus, .is-cursor), .menu .card:hover:not([disabled]) { background: var(--accent); color: var(--ink); }
.menu .card:is(:focus, .is-cursor) small, .menu .card:hover:not([disabled]) small, .menu .card:is(:focus, .is-cursor) em, .menu .card:hover:not([disabled]) em { color: rgba(10,10,10,0.7); }
.menu .card:is(:focus, .is-cursor).on::after, .menu .card:hover.on::after { background: var(--ink); }
.menu .card b { font-weight: 900; font-size: 15px; text-transform: uppercase; letter-spacing: -0.01em; }
.menu .card small { color: var(--dim); font-size: 11px; font-weight: 500; line-height: 1.4; }
.menu .card em { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
/* the garage while a picked car loads: a tag on its card, and a plate over the scene (the old car is still on show) */
/* (::before, since ::after is the card's chosen-car bar on the left) */
.menu .card.car.loading::before { content: "Loading"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); padding: 3px 8px; background: var(--ink); color: var(--accent); border: 1px solid var(--accent); font-size: 9px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; animation: lb-pulse 0.5s ease-in-out infinite alternate; }
.menu .garage-loading { position: absolute; left: calc(50% + 160px); bottom: 70px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 10px 22px 10px 16px; background: rgba(10,10,10,0.88); border-left: 4px solid var(--accent); animation: gl-in 0.25s cubic-bezier(.2,.8,.2,1) both; }
.menu .garage-loading small { display: block; font-size: 9px; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.menu .garage-loading b { font-size: 18px; font-weight: 900; font-style: italic; text-transform: uppercase; }
.menu .garage-loading i { width: 22px; height: 22px; border: 3px solid rgba(245,245,245,0.2); border-top-color: var(--accent); border-radius: 50%; animation: gl-spin 0.7s linear infinite; }
@keyframes gl-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes gl-spin { to { transform: rotate(360deg); } }
.menu .card .tick { font-style: normal; color: var(--accent); margin-right: 6px; }
.menu .card:is(:focus, .is-cursor) .tick, .menu .card:hover .tick { color: var(--ink); }
.menu .swatch { height: 4px; width: 100%; margin-bottom: 6px; transform: skewX(var(--lean)); }
.menu .opts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 26px; margin: 10px 0 20px; }
.menu label span { display: flex; justify-content: space-between; font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); margin-bottom: 8px; }
.menu label b { color: var(--text); font-weight: 900; letter-spacing: 0.02em; }
.menu input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; outline: none; }
.menu input[type=range]::-webkit-slider-runnable-track { height: 3px; background: rgba(245,245,245,0.2); }
.menu input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 16px; margin-top: -6.5px; background: var(--text); transform: skewX(var(--lean)); }
.menu input[type=range]:is(:focus, .is-cursor)::-webkit-slider-thumb { background: var(--accent); }
.menu input[type=range]::-moz-range-track { height: 3px; background: rgba(245,245,245,0.2); }
.menu input[type=range]::-moz-range-thumb { width: 12px; height: 16px; border: 0; border-radius: 0; background: var(--text); }
.menu footer { display: flex; gap: 8px; margin-top: 22px; }
.menu footer button { height: 40px; padding: 0 18px; font-weight: 900; font-size: 14px; letter-spacing: 0.02em; text-transform: uppercase; border: 1px solid var(--text); transform: skewX(var(--lean)); transition: background .12s, color .12s, border-color .12s; }
.menu footer button:is(:focus, .is-cursor), .menu footer button:hover:not([disabled]) { background: var(--text); color: var(--ink); }
.menu footer button.go { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.menu footer button.go:is(:focus, .is-cursor), .menu footer button.go:hover { background: var(--text); border-color: var(--text); }
.menu .panel .mainnav { position: static; width: auto; margin: 20px 0 0 -40px; }
.menu .panel .mainnav .mi { font-size: 26px; height: 44px; }
.menu .pill { border: 1px solid var(--line); padding: 2px 8px; font-size: 11px; margin-left: 8px; }
.menu .pills { display: flex; gap: 6px; flex-wrap: wrap; }
.menu .pills .pill { margin: 0; height: 30px; padding: 0 14px; font-size: 11px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid var(--line); transform: skewX(var(--lean)); }
.menu .pills .pill.on { border-color: var(--accent); color: var(--accent); }
.menu .pills .pill:is(:focus, .is-cursor), .menu .pills .pill:hover:not([disabled]) { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.menu .note { font-size: 11px; }
.menu table { width: 100%; border-collapse: collapse; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 14px 0; }
.menu td { padding: 7px 8px; border-bottom: 1px solid rgba(245,245,245,0.08); }
.menu td:first-child { font-weight: 900; width: 28px; }
.menu tr.me td { background: var(--accent); color: var(--ink); }
.menu .chalres { color: var(--text); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; font-size: 12px; }
.menu .chalres.won { color: var(--accent); }
.menu .photoframe { position: absolute; inset: 0; background: none; }
.menu .photoframe .corners { position: absolute; inset: 6vh 6vw; border: 1px solid rgba(245,245,245,0.4); }
.menu .photoframe .caption { position: absolute; left: 8vw; bottom: 12vh; display: flex; flex-direction: column; gap: 6px; text-shadow: 0 1px 8px rgba(0,0,0,0.7); }
.menu .photoframe .caption b { font-size: 34px; font-weight: 900; text-transform: uppercase; transform: skewX(var(--lean)); transform-origin: left bottom; }
.menu .photoframe .caption span { font-weight: 700; }
.menu .photoframe .caption small { color: var(--dim); font-weight: 800; letter-spacing: 0.12em; }
.menu .photoframe footer { position: absolute; right: 8vw; bottom: 11vh; }
.menu:has(.photoframe), .menu:has(.replaybar) { background: none; }
.menu .replaybar { position: absolute; left: 0; right: 0; bottom: 26px; display: flex; justify-content: center; align-items: center; gap: 26px; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.menu .replaybar .rec { background: var(--accent); color: var(--ink); padding: 4px 12px; transform: skewX(var(--lean)); font-weight: 900; }

/* the sheet: the whole screen dimmed, a header with tabs (Q / E), rows on the left, what the row does on the right,
   prompts on a bar along the bottom. Settings, the starting grid, the records. */
.menu:has(.sheet) { background: rgba(10,10,10,0.72); }
.menu .sheet { position: absolute; inset: 0; padding: 28px 40px 90px; overflow: hidden; }
.menu .sheet header h2 { margin: 12px 0 8px; }
.menu .sheet .sub { color: var(--dim); font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; margin: 2px 0 0; }
.menu .tabs { display: flex; align-items: center; gap: 4px; margin: 14px 0 16px; }
.menu .tabs kbd { margin: 0 6px; }
.menu .tabs button { height: 34px; padding: 0 18px; font-size: 15px; font-weight: 900; text-transform: uppercase; color: var(--dim); transform: skewX(var(--lean)); }
.menu .tabs button.on { background: var(--text); color: var(--ink); }
.menu .tabs button:hover:not(.on) { color: var(--text); }
.menu .tabs.right { position: absolute; right: 40px; top: 28px; margin: 0; background: rgba(14,14,14,0.96); border: 1px solid var(--line); padding: 4px 6px; }
.menu .srows { display: flex; flex-direction: column; width: min(520px, 46vw); margin-left: -40px; max-height: calc(100vh - 260px); overflow-y: auto; scrollbar-width: none; }
.menu .srow { position: relative; display: flex; align-items: center; gap: 14px; min-height: 44px; padding: 0 10px 0 40px; flex: none; }
.menu .srow::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: transparent; }
.menu .srow:is(:focus, .is-cursor), .menu .srow:hover { background: rgba(245,245,245,0.2); }
.menu .srow:is(:focus, .is-cursor)::before { background: var(--accent); }
.menu .srow .l { flex: 1; font-size: 14px; font-weight: 700; }
.menu .srow .l i { font-style: normal; margin-left: 8px; font-size: 9px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); border: 1px solid var(--line); padding: 1px 5px; vertical-align: 2px; }
.menu .srow .seg { display: flex; gap: 3px; }
.menu .srow .seg b { display: grid; place-items: center; height: 32px; min-width: 62px; padding: 0 12px; font-size: 12px; font-weight: 900; color: var(--dim); border: 1px solid var(--line); background: rgba(10,10,10,0.5); transform: skewX(var(--lean)); }
.menu .srow .seg b.on { background: var(--text); border-color: var(--text); color: var(--ink); }
.menu .srow .bar { width: 170px; height: 6px; background: rgba(245,245,245,0.18); transform: skewX(var(--lean)); }
.menu .srow .bar u { display: block; height: 100%; background: var(--text); }
.menu .srow:is(:focus, .is-cursor) .bar u { background: var(--accent); }
.menu .srow .val { min-width: 46px; text-align: right; font-size: 13px; font-weight: 900; }
.menu .srow.go .l { color: var(--accent); font-weight: 900; text-transform: uppercase; }
.menu .sdesc { position: absolute; left: calc(min(520px, 46vw) + 30px); top: 172px; right: 40px; max-width: 480px; }
.menu .sdesc h3 { margin: 6px 0 10px; font-size: 30px; font-weight: 900; font-style: italic; letter-spacing: -0.01em; text-transform: uppercase; color: var(--text); }
.menu .sheet .desc, .menu .panel .desc:not(:empty) { position: static; font-size: 14px; font-weight: 500; max-width: none; color: var(--text); }
.menu .sdesc small { display: block; margin-top: 14px; color: var(--dim); font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.menu .bar-bottom { position: absolute; left: 0; right: 0; bottom: 0; height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 30px 0 40px; background: rgba(22,22,22,0.96); border-top: 1px solid var(--line); }
.menu .bar-bottom .prompts { position: static; }
.menu .go.big { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 26px; background: var(--accent); color: var(--ink); font-weight: 900; font-size: 17px; letter-spacing: 0.04em; text-transform: uppercase; clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%); }
.menu .go.big kbd { border-color: var(--ink); box-shadow: none; }
.menu .go.big:is(:focus, .is-cursor), .menu .go.big:hover { background: var(--text); }

/* the starting grid: two columns of slots, stepped like a grid */
/* the race lobby (after the street-racing lobby the user picked): the event top left, the hour and the weather as
   chips top right, the grid in two columns of slanted slots, Start at the bottom right. Start fills the open slots
   one by one, then the whole lobby wipes off and the loading screen slants in over it. */
.menu:has(.lobby) { background: linear-gradient(rgba(10,10,10,0.84), rgba(10,10,10,0.62) 45%, rgba(10,10,10,0.88)); }
.menu .lobby { position: absolute; inset: 0; }
.menu .lb-top { position: absolute; left: 40px; right: 40px; top: 26px; display: flex; align-items: stretch; animation: lb-wipe 0.45s cubic-bezier(.2,.8,.2,1) both; }
.menu .lb-esc { display: flex; align-items: center; gap: 8px; padding: 0 20px 0 2px; font-size: 12px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.menu .lb-esc:hover { color: var(--accent); }
.menu .lb-title { position: relative; padding: 4px 26px 6px 22px; background: rgba(10,10,10,0.6); border: 1px solid var(--line); clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
.menu .lb-title small { display: block; color: var(--accent); font-size: 10px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; }
.menu .lb-title h2 { margin: 2px 0 1px; font-size: 24px; font-weight: 900; font-style: italic; letter-spacing: -0.01em; text-transform: uppercase; line-height: 1; }
.menu .lb-title p { margin: 0; color: var(--dim); font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.menu .lb-chips { margin-left: auto; display: flex; align-items: flex-start; gap: 10px; }
.menu .lb-chip { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px 0 10px; background: rgba(10,10,10,0.6); border: 1px solid var(--line); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%); }
.menu .lb-chip kbd { height: 18px; padding: 0 5px; font-size: 9px; box-shadow: none; }
.menu .lb-chip span { color: var(--dim); }
.menu .lb-chip b { font-weight: 900; min-width: 64px; }
.menu .lb-chip i { font-style: normal; color: var(--dim); font-size: 10px; }
.menu .lb-chip:is(:focus, .is-cursor), .menu .lb-chip:hover { border-color: var(--accent); }
.menu .lb-chip:is(:focus, .is-cursor) b, .menu .lb-chip:hover b, .menu .lb-chip:is(:focus, .is-cursor) i { color: var(--accent); }

.menu .lb-grid { position: absolute; left: max(40px, calc(50% - 620px)); right: max(40px, calc(50% - 620px)); top: 50%; transform: translateY(-46%); }
.menu .lb-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); animation: lb-wipe 0.45s 0.08s cubic-bezier(.2,.8,.2,1) both; }
.menu .lb-count { display: flex; align-items: center; gap: 7px; }
.menu .lb-count b { color: var(--text); font-weight: 900; }
.menu .lb-count i { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); }
.menu .lobby.starting .lb-count i { background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: lb-blink 0.5s steps(2) infinite; }
.menu .lobby.starting .lb-count { color: var(--text); }
.menu .lb-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.menu .lslot { position: relative; display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 22px 0 0; background: rgba(22,22,22,0.92); border: 1px solid var(--line); clip-path: polygon(13px 0, 100% 0, calc(100% - 13px) 100%, 0 100%); animation: lb-slot-in 0.42s calc(0.12s + var(--i) * 0.035s) cubic-bezier(.2,.8,.2,1) both; }
.menu .lslot .n { width: 50px; padding-left: 8px; text-align: center; font-size: 26px; font-weight: 900; font-style: italic; color: var(--dim); }
.menu .lslot .stripe { align-self: stretch; width: 16px; margin-left: -8px; background: var(--c); transform: skewX(var(--lean)); }
.menu .lslot .who { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.menu .lslot strong { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 900; white-space: nowrap; }
.menu .lslot small { color: var(--dim); font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.menu .lslot .dot { display: inline-block; width: 5px; height: 5px; margin-right: 7px; border-radius: 50%; background: var(--dim); vertical-align: 1px; }
.menu .lslot .tags { display: flex; gap: 5px; }
.menu .lslot .tags i { font-style: normal; font-size: 9px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 7px; border: 1px solid currentColor; color: var(--dim); }
.menu .lslot em { font-style: normal; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; color: var(--dim); font-variant-numeric: tabular-nums; }
.menu .lslot.open { background: rgba(22,22,22,0.4); border-style: dashed; }
.menu .lslot.open .stripe { background: rgba(245,245,245,0.1); }
.menu .lslot.open strong { color: rgba(245,245,245,0.5); }
.menu .lslot.me { background: var(--text); border-color: var(--text); color: var(--ink); }
.menu .lslot.me .n, .menu .lslot.me small, .menu .lslot.me em { color: rgba(10,10,10,0.6); }
.menu .lslot.me .tags i { background: var(--ink); border-color: var(--ink); color: var(--text); }
.menu .lb-go { position: absolute; right: 40px; bottom: 26px; display: flex; align-items: center; gap: 12px; height: 50px; padding: 0 30px; background: var(--accent); color: var(--ink); font-weight: 900; font-size: 17px; letter-spacing: 0.04em; text-transform: uppercase; clip-path: polygon(13px 0, 100% 0, calc(100% - 13px) 100%, 0 100%); animation: lb-wipe 0.45s 0.2s cubic-bezier(.2,.8,.2,1) both; }
.menu .lb-go kbd { border-color: var(--ink); box-shadow: none; }
.menu .lb-go i { font-style: normal; font-size: 14px; }
.menu .lb-go:hover { background: #eeff52; }
.menu .lobby.starting .lb-go { background: var(--text); }
.menu .lobby.starting .lb-go .t { animation: lb-pulse 0.5s ease-in-out infinite alternate; }
.menu .lobby .prompts { animation: lb-wipe 0.45s 0.2s cubic-bezier(.2,.8,.2,1) both; }
/* a redraw (a chip changed) does not play the entrance again */
.menu .lobby.still :is(.lb-top, .lb-head, .lslot, .lb-go, .prompts) { animation: none; }
/* the start: each AI driver slides into an open slot, its colour dropping in */
.menu .lobby .lslot.join { animation: lb-join 0.34s cubic-bezier(.2,.8,.2,1) both; }
.menu .lobby .lslot.join .stripe { animation: lb-stripe 0.34s cubic-bezier(.2,.8,.2,1) both; }
/* then the lobby wipes off to the left, the top first */
.menu .lobby.out :is(.lb-top, .lb-head, .lslot, .lb-go, .prompts) { animation: lb-out 0.3s cubic-bezier(.76,0,.24,1) both; }
.menu .lobby.out .lslot { animation-delay: calc(var(--i) * 0.02s); }
@keyframes lb-wipe { from { clip-path: inset(-30px calc(100% + 30px) -30px -30px); transform: translateY(8px); } to { clip-path: inset(-30px -30px -30px -30px); transform: none; } }
@keyframes lb-slot-in { from { opacity: 0; transform: translate(-10px, 16px); } to { opacity: 1; transform: none; } }
@keyframes lb-join { 0% { opacity: 0; transform: translateX(22px); background: var(--accent); } 45% { opacity: 1; background: rgba(227,252,2,0.35); } 100% { opacity: 1; transform: none; background: rgba(22,22,22,0.92); } }
@keyframes lb-stripe { from { transform: skewX(var(--lean)) scaleY(0); } to { transform: skewX(var(--lean)) scaleY(1); } }
@keyframes lb-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(-60px); } }
@keyframes lb-blink { 50% { opacity: 0.2; } }
@keyframes lb-pulse { from { opacity: 1; } to { opacity: 0.45; } }

/* records: the tracks stepped down the left, the board on the right, your line under it */
.menu .tracklist { position: absolute; left: 0; top: 200px; display: flex; flex-direction: column; gap: 4px; width: 400px; }
.menu .tracklist button { position: relative; display: flex; align-items: center; gap: 14px; height: 40px; padding-left: calc(30px + var(--i) * 8px); font-size: 14px; font-weight: 900; text-transform: uppercase; color: var(--dim); background: rgba(22,22,22,0.9); clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%); }
.menu .tracklist button i { font-style: normal; color: inherit; }
.menu .tracklist button.on { background: var(--accent); color: var(--ink); }
.menu .tracklist button:is(:focus, .is-cursor):not(.on) { background: rgba(245,245,245,0.25); color: var(--text); }
.menu .records .board { position: absolute; left: 430px; right: 40px; top: 120px; bottom: 90px; padding: 10px 20px; background: rgba(22,22,22,0.9); border: 1px solid var(--line); overflow: hidden; }
.menu .records table { margin: 0; }
.menu .records th { text-align: left; padding: 6px 8px; font-size: 10px; font-weight: 800; letter-spacing: 0.12em; color: var(--dim); text-transform: uppercase; border-bottom: 1px solid var(--line); }
.menu .records td .flag { vertical-align: -1px; margin-right: 6px; }
.menu .records .count, .menu .records .empty { margin: 8px 0; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.menu .records .mine { position: absolute; left: 20px; right: 20px; bottom: 14px; display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 14px; background: var(--text); color: var(--ink); font-size: 13px; font-weight: 800; }
.menu .records .mine b { background: var(--ink); color: var(--text); padding: 2px 8px; }
.menu .records .mine span { min-width: 140px; }
.menu .records .mine em { flex: 1; font-style: normal; font-weight: 600; }

/* profile */
.menu .profile .who { display: flex; align-items: center; gap: 16px; margin: 18px 0 10px; }
.menu .profile .who input { font: inherit; font-size: 26px; font-weight: 900; color: var(--text); background: transparent; border: 0; border-bottom: 1px solid var(--line); width: 300px; outline: none; padding: 2px 0; }
.menu .profile .who input:is(:focus, .is-cursor) { border-color: var(--accent); }
.menu .profile .who small { display: block; color: var(--dim); font-size: 12px; font-weight: 700; margin-top: 4px; }
.menu .profile .srow { margin-left: -40px; }
.menu .profile .stats { display: grid; grid-template-columns: repeat(5, auto); gap: 8px 18px; margin: 16px 0 4px; padding: 10px 14px; border: 1px solid var(--line); }
.menu .profile .stats small { display: block; font-size: 9px; font-weight: 800; letter-spacing: 0.12em; color: var(--dim); text-transform: uppercase; }
.menu .profile .stats b { font-size: 20px; font-weight: 900; }
.menu .profile .stats b i { font-style: normal; font-size: 11px; color: var(--dim); }
.menu .profile .ach > div { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(245,245,245,0.08); opacity: 0.55; }
.menu .profile .ach > div.got { opacity: 1; box-shadow: inset 4px 0 0 var(--accent); padding-left: 10px; }
.menu .profile .ach i { font-style: normal; display: grid; place-items: center; width: 42px; height: 26px; border: 1px solid var(--line); font-size: 10px; font-weight: 900; transform: skewX(var(--lean)); }
.menu .profile .ach span { flex: 1; display: flex; flex-direction: column; }
.menu .profile .ach b { font-size: 14px; font-weight: 800; }
.menu .profile .ach small { color: var(--dim); font-size: 11px; }
.menu .profile .ach em { position: relative; font-style: normal; font-size: 10px; font-weight: 800; color: var(--dim); text-align: right; min-width: 70px; padding-top: 7px; }
.menu .profile .ach em u { position: absolute; right: 0; top: 0; height: 3px; background: var(--accent); max-width: 70px; }
.menu .profile .ach em::before { content: ""; position: absolute; right: 0; top: 0; width: 70px; height: 3px; background: rgba(245,245,245,0.15); }

/* the main menu's profile card, top right */
/* the main menu's top right: who is playing (opens My Player), then My Player and Settings as icons */
.menu .corner { position: absolute; right: 40px; top: 30px; display: flex; align-items: center; gap: 8px; }
.menu .carline { text-align: right; padding: 8px 14px; border: 1px solid transparent; }
.menu .iconbtn { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid rgba(245,245,245,0.22); background: rgba(10,10,10,0.35); color: var(--text); transition: border-color 0.15s, color 0.15s, background 0.15s; }
.menu .iconbtn svg { width: 24px; height: 24px; }
.menu .iconbtn:is(:focus, .is-cursor), .menu .iconbtn:hover { border-color: var(--accent); color: var(--accent); background: rgba(10,10,10,0.6); }
.menu .carline .who { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.menu .carline b { font-size: 20px; font-weight: 900; }
.menu .carline small { display: block; margin-top: 5px; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.menu .carline:is(:focus, .is-cursor), .menu .carline:hover { border-color: var(--accent); background: rgba(10,10,10,0.6); }

.fps { position: absolute; left: 50%; top: 8px; font-family: var(--font); font-size: 11px; font-weight: 900; letter-spacing: 0.06em; color: var(--ink); background: var(--accent); padding: 2px 8px; transform: skewX(var(--lean)); }
.menu .panel.still { animation: none; }
/* a redraw (a car picked) makes the cards anew: no fade into the cursor colours, which would wait out the car's load
   with white letters on lime */
.menu .panel.still .card { transition: none; }

/* HUD moments: overtakes, places lost, speed */
.hud-speedlines { position: absolute; inset: -15%; pointer-events: none; opacity: 0;
  background: repeating-conic-gradient(from 0deg at 50% 46%, rgba(255,255,255,0) 0deg 2.1deg, rgba(255,255,255,0.28) 2.3deg 2.45deg, rgba(255,255,255,0) 2.6deg 5.3deg, rgba(227,252,2,0.16) 5.45deg 5.55deg, rgba(255,255,255,0) 5.7deg 7.9deg);
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 46%, transparent 45%, #000 100%); mask-image: radial-gradient(ellipse 60% 55% at 50% 46%, transparent 45%, #000 100%);
  animation: speedlines 0.18s steps(4) infinite; }
@keyframes speedlines { 0% { transform: rotate(0deg) scale(1); } 50% { transform: rotate(1.7deg) scale(1.03); } 100% { transform: rotate(3.1deg) scale(1); } }
.hud-fx { position: absolute; inset: 0; pointer-events: none; }
.fx-banner { position: absolute; left: 50%; top: 27%; display: flex; flex-direction: column; align-items: center; gap: 4px; animation: fx-banner 2s cubic-bezier(.2,.8,.2,1) forwards; }
.fx-banner::before { content: ""; position: absolute; left: -60vw; right: -60vw; top: 50%; height: 2px; background: linear-gradient(90deg, transparent, var(--accent) 45%, var(--accent) 55%, transparent); animation: fx-streak 0.7s ease-out forwards; }
.fx-banner .t { position: relative; padding: 4px 30px 2px; background: var(--accent); color: var(--ink); font-size: clamp(26px, 3.6vw, 48px); font-weight: 900; font-style: italic; text-transform: uppercase; letter-spacing: -0.01em; clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%); }
.fx-banner .t i { font-style: normal; margin-left: 12px; padding: 0 8px; background: var(--ink); color: var(--accent); font-size: 0.6em; vertical-align: 0.25em; }
.fx-banner .s { position: relative; display: flex; align-items: center; gap: 10px; padding: 4px 16px; background: rgba(12,12,12,0.88); font-size: 13px; font-weight: 800; }
.fx-banner .s b { background: var(--text); color: var(--ink); padding: 1px 7px; font-weight: 900; }
.fx-banner .s span { display: flex; align-items: center; gap: 6px; color: var(--dim); text-decoration: line-through; text-decoration-color: rgba(245,245,245,0.5); }
.fx-banner .s em { font-style: normal; color: var(--accent); text-transform: uppercase; letter-spacing: 0.1em; font-size: 11px; }
.fx-banner.lead .t { background: var(--text); }
@keyframes fx-banner {
  0% { transform: translate(-130%, 0) skewX(-30deg); opacity: 0; }
  12% { transform: translate(-48%, 0) skewX(8deg); opacity: 1; }
  18%, 78% { transform: translate(-50%, 0) skewX(0); opacity: 1; }
  100% { transform: translate(40%, 0) skewX(-20deg); opacity: 0; } }
@keyframes fx-streak { from { transform: scaleX(0); opacity: 1; } to { transform: scaleX(1); opacity: 0; } }
.hud-pos .big.gain b { animation: pos-gain 0.7s cubic-bezier(.2,.8,.2,1); }
@keyframes pos-gain { 0% { color: var(--accent); transform: scale(1.7) skewX(-12deg); text-shadow: 0 0 24px var(--accent); } 60% { color: var(--accent); } 100% { transform: none; } }
.hud-pos .big.lost b { animation: pos-lost 0.5s; }
@keyframes pos-lost { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); color: var(--red); } 40% { transform: translateX(5px); color: var(--red); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.hud-speedo { transition: box-shadow 0.3s; }
.hud-speedo.hot .spd { color: var(--accent); text-shadow: 0 0 18px rgba(227,252,2,0.55); }
.hud-speedo.hot .revs i.on:not(.red) { background: var(--accent); box-shadow: 0 0 8px rgba(227,252,2,0.7); }
.hud-speedo.pop .spd { animation: spd-pop 0.5s cubic-bezier(.2,.8,.2,1); }
@keyframes spd-pop { 0% { transform: scale(1.35); } 100% { transform: none; } }
.hud-speedo .spd { display: inline-block; transform-origin: right bottom; }
.fx-speed { position: absolute; right: 40px; bottom: 150px; display: flex; align-items: baseline; gap: 6px; color: var(--accent); font-style: italic; text-shadow: 0 0 20px rgba(227,252,2,0.6), 0 2px 10px rgba(0,0,0,0.6); animation: fx-speed 1.3s cubic-bezier(.2,.8,.2,1) forwards; }
.fx-speed b { font-size: 64px; font-weight: 900; line-height: 1; }
.fx-speed small { font-size: 14px; font-weight: 900; letter-spacing: 0.1em; }
@keyframes fx-speed { 0% { transform: translateY(30px) scale(0.6); opacity: 0; } 15% { transform: translateY(0) scale(1.15); opacity: 1; } 30%, 70% { transform: none; opacity: 1; } 100% { transform: translate(-40px, -70px) skewX(-15deg); opacity: 0; } }

/* the career: a map of each circuit with its stages pinned on it, the stage under the cursor on the right */
.menu .career .chapters { position: absolute; left: 40px; top: 150px; bottom: 90px; width: min(56vw, 760px); display: flex; flex-direction: column; gap: 14px; }
.menu .career .chapter { flex: 1; min-height: 0; display: flex; flex-direction: column; background: rgba(22,22,22,0.82); border: 1px solid var(--line); background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 36px 36px; background-position: -1px -1px; }
.menu .career .chapter header { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: rgba(10,10,10,0.9); border-bottom: 1px solid var(--line); }
.menu .career .chapter header i { font-style: normal; font-size: 11px; font-weight: 900; color: var(--ink); background: var(--text); padding: 1px 6px; transform: skewX(var(--lean)); }
.menu .career .chapter header b { flex: 1; font-size: 15px; font-weight: 900; font-style: italic; text-transform: uppercase; letter-spacing: 0.02em; }
.menu .career .chapter header em { font-style: normal; font-size: 12px; font-weight: 800; color: var(--dim); }
.menu .career .cmap { position: relative; flex: 1; min-height: 0; margin: 6px auto; aspect-ratio: 400 / 260; max-width: 100%; }
.menu .career .cmap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.menu .career .cmap .road { fill: none; stroke: rgba(10,10,10,0.9); stroke-width: 9; stroke-linejoin: round; }
.menu .career .cmap .line { fill: none; stroke: rgba(245,245,245,0.75); stroke-width: 2.2; stroke-linejoin: round; }
.menu .career .pin { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; display: grid; place-items: center; background: var(--panel); border: 2px solid var(--text); transform: rotate(45deg); transition: transform 0.15s; }
.menu .career .pin b { transform: rotate(-45deg); font-size: 13px; font-weight: 900; font-style: italic; }
.menu .career .pin.won { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.menu .career .pin.locked { border-color: rgba(245,245,245,0.3); background: rgba(10,10,10,0.85); }
.menu .career .pin.locked b::before { content: ""; display: block; width: 8px; height: 8px; border: 2px solid rgba(245,245,245,0.4); }
.menu .career .pin.next { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(227,252,2,0.25); animation: pin-pulse 1.4s ease-in-out infinite; }
.menu .career .pin:is(:focus, .is-cursor), .menu .career .pin:hover { transform: rotate(45deg) scale(1.3); outline: none; box-shadow: 0 0 0 3px var(--ink), 0 0 0 5px var(--accent); z-index: 2; }
@keyframes pin-pulse { 50% { box-shadow: 0 0 0 9px rgba(227,252,2,0); } }
.menu .career .stagecard { position: absolute; left: calc(min(56vw, 760px) + 70px); right: 40px; top: 150px; padding: 18px 22px; background: rgba(22,22,22,0.92); border: 1px solid var(--line); border-left: 6px solid var(--accent); }
.menu .career .stagecard small { font-size: 10px; font-weight: 800; letter-spacing: 0.14em; color: var(--dim); text-transform: uppercase; }
.menu .career .stagecard h3 { margin: 6px 0 8px; font-size: 30px; font-weight: 900; font-style: italic; text-transform: uppercase; line-height: 1; }
.menu .career .stagecard p { margin: 0 0 14px; font-size: 13px; line-height: 1.45; color: var(--dim); }
.menu .career .stagecard dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.menu .career .stagecard dt { font-size: 10px; font-weight: 800; letter-spacing: 0.12em; color: var(--dim); text-transform: uppercase; align-self: center; }
.menu .career .stagecard dd { margin: 0; font-weight: 800; }
.menu .career .stagecard dd.goal { color: var(--accent); }
.menu .career .stagecard .state { margin: 14px 0 0; font-size: 12px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text); }
.menu .career .stagecard .state.won { color: var(--accent); }
.menu .career .stagecard .state.locked { color: var(--dim); }
.menu .go.big.ghost { pointer-events: none; }

/* My Player: a tall panel down the left, the car in its garage beside it */
.menu .panel.player { width: 600px; display: flex; flex-direction: column; padding: 24px 190px 0 40px; overflow: hidden; background: linear-gradient(180deg, rgba(14,14,14,0.97), rgba(10,10,10,0.94)); }
.menu .player .esc .prompts { position: static; }
.menu .player .esc .prompt { font-size: 13px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; }
.menu .player h2 { margin: 10px 0 16px; font-size: 44px; font-weight: 900; font-style: italic; text-transform: uppercase; letter-spacing: -0.01em; }
.menu .player .nameplate { display: flex; align-items: center; gap: 12px; }
.menu .player .nameplate .flag { flex: none; }
.menu .player .nameplate label { flex: 1; display: flex; align-items: center; background: rgba(245,245,245,0.1); border-left: 4px solid var(--accent); padding: 0 10px; }
.menu .player .nameplate input { flex: 1; min-width: 0; font: inherit; font-size: 26px; font-weight: 900; color: var(--text); background: transparent; border: 0; outline: none; padding: 6px 0; }
.menu .player .nameplate i { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: 0.12em; color: var(--dim); }
.menu .player .nameplate label:has(input:is(:focus, .is-cursor)) { background: rgba(245,245,245,0.18); box-shadow: inset 0 0 0 1px var(--accent); }
.menu .player .country { display: flex; align-items: center; justify-content: space-between; width: 100%; margin: 4px 0 0 46px; width: calc(100% - 46px); padding: 4px 10px; font-size: 13px; font-weight: 700; color: var(--dim); border: 1px solid transparent; }
.menu .player .country i { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0; }
.menu .player .country:is(:focus, .is-cursor), .menu .player .country:hover { border-color: var(--accent); color: var(--text); }
.menu .player .country:is(:focus, .is-cursor) i, .menu .player .country:hover i { opacity: 1; color: var(--accent); }
.menu .player .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 12px; margin: 16px 0 10px; padding: 10px 14px; border: 1px solid var(--line); background: rgba(22,22,22,0.7); }
.menu .player .stats small { display: block; font-size: 9px; font-weight: 800; letter-spacing: 0.12em; color: var(--dim); text-transform: uppercase; }
.menu .player .stats b { font-size: 22px; font-weight: 900; font-style: italic; }
.menu .player .stats b i { font-style: normal; font-size: 11px; color: var(--dim); }
.menu .player .unlock { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border: 1px solid var(--line); background: rgba(22,22,22,0.7); }
.menu .player .unlock .ico { font-style: normal; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); color: var(--accent); font-size: 14px; }
.menu .player .unlock span { flex: 1; display: flex; flex-direction: column; }
.menu .player .unlock small { font-size: 9px; font-weight: 800; letter-spacing: 0.12em; color: var(--dim); text-transform: uppercase; }
.menu .player .unlock b { font-size: 15px; font-weight: 900; }
.menu .player .unlock em { font-style: normal; font-size: 11px; color: var(--dim); }
.menu .player .unlock kbd { font: inherit; font-size: 9px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); border: 1px solid var(--line); padding: 3px 8px; }
.menu .player h3 { margin: 18px 0 6px; font-size: 11px; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.menu .player .ach { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; margin: 0 -10px; padding: 0 10px 10px; }
.menu .player .ach > button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 6px; text-align: left; border-bottom: 1px solid rgba(245,245,245,0.08); opacity: 0.6; }
.menu .player .ach > button.got { opacity: 1; box-shadow: inset 4px 0 0 var(--accent); padding-left: 12px; }
.menu .player .ach > button:is(:focus, .is-cursor), .menu .player .ach > button:hover { opacity: 1; background: rgba(245,245,245,0.08); outline: none; }
.menu .player .ach i { font-style: normal; display: grid; place-items: center; width: 44px; height: 26px; flex: none; border: 1px solid var(--line); font-size: 10px; font-weight: 900; transform: skewX(var(--lean)); }
.menu .player .ach .got i { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.menu .player .ach span { flex: 1; display: flex; flex-direction: column; }
.menu .player .ach b { font-size: 14px; font-weight: 800; }
.menu .player .ach small { color: var(--dim); font-size: 11px; }
.menu .player .ach em { position: relative; font-style: normal; font-size: 10px; font-weight: 800; color: var(--dim); text-align: right; min-width: 70px; padding-top: 7px; }
.menu .player .ach em u { position: absolute; right: 0; top: 0; height: 3px; background: var(--accent); max-width: 70px; z-index: 1; }
.menu .player .ach em:not(.tick)::before { content: ""; position: absolute; right: 0; top: 0; width: 70px; height: 3px; background: rgba(245,245,245,0.15); }
.menu .player .ach em.tick { color: var(--accent); padding-top: 0; }
.menu .player .pfoot { flex: none; padding: 12px 0 18px; border-top: 1px solid var(--line); }
.menu .player .pfoot .prompts { position: static; }

/* the rules: a place taken by contact. The overtake banner in red, then a red box counting down to give it back */
.fx-banner.foul::before { background: linear-gradient(90deg, transparent, var(--red) 45%, var(--red) 55%, transparent); }
.fx-banner.foul .t { background: var(--red); color: #fff; }
.fx-banner.foul .s span.who { color: var(--text); text-decoration: none; }
.fx-banner.foul .s em { color: var(--red); }
/* a warning (a hard hit that took no place): orange, its seconds added at the end */
.fx-banner.foul.warn::before { background: linear-gradient(90deg, transparent, var(--orange) 45%, var(--orange) 55%, transparent); }
.fx-banner.foul.warn .t { background: var(--orange); color: var(--ink); }
.fx-banner.foul.warn .s em { color: var(--orange); }
/* fastest sector, fastest lap: the warning's banner in timing purple, the time and what it took off the best */
.fx-banner.foul.fast::before { background: linear-gradient(90deg, transparent, #a64dff 45%, #a64dff 55%, transparent); }
.fx-banner.foul.fast .t { background: #a64dff; color: #fff; }
.fx-banner.foul.fast .s em { color: #c58cff; }
.hud-giveback { position: absolute; left: 50%; top: 118px; display: flex; align-items: center; gap: 16px; padding: 8px 18px 10px 22px; background: rgba(12,12,12,0.9); border-left: 5px solid var(--red); transform: translate(-50%, -12px); opacity: 0; transition: opacity 0.25s, transform 0.25s; pointer-events: none; }
.hud-giveback.on { opacity: 1; transform: translate(-50%, 0); animation: gb-pulse 1s ease-in-out infinite; }
.hud-giveback small { display: block; font-size: 9px; font-weight: 800; letter-spacing: 0.16em; color: var(--red); text-transform: uppercase; }
.hud-giveback b { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 900; }
.hud-giveback em { font-style: italic; font-size: 34px; font-weight: 900; color: var(--red); line-height: 1; min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.hud-giveback i { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,42,61,0.2); }
.hud-giveback i u { display: block; height: 100%; background: var(--red); transition: width 0.2s linear; }
@keyframes gb-pulse { 50% { box-shadow: 0 0 0 1px rgba(255,42,61,0.5), 0 0 24px rgba(255,42,61,0.25); } }
.hud-pos .rows b.pen { color: var(--red); }
.menu .panel p.pen { color: var(--red); font-weight: 800; }
.menu td.pen { color: var(--orange); font-weight: 900; text-align: right; }

/* ---- race results (after Aura's): the place or DNF big on the left with the track and the player's numbers, the
   classification on a slanted plate on the right, the choices in big type bottom left; the scene blurred behind */
.menu .results { position: absolute; inset: 0; backdrop-filter: blur(7px); background: rgba(10,10,10,0.3); }
.menu .rs-head { position: absolute; left: 40px; top: 30px; width: 400px; animation: rs-in 0.4s cubic-bezier(.2,.8,.2,1) both; }
.menu .rs-tag { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; }
.menu .rs-tag::before { content: ""; width: 5px; height: 13px; background: var(--accent); transform: skewX(var(--lean)); }
.menu .rs-big { margin: 4px 0 0 -4px; font-size: 128px; font-weight: 900; font-style: italic; letter-spacing: -0.05em; line-height: 0.95; text-transform: uppercase; }
.menu .rs-track { margin: 14px 0 2px; font-size: 26px; font-weight: 900; text-transform: uppercase; letter-spacing: -0.01em; }
.menu .rs-sub { margin: 0; font-size: 12px; font-weight: 600; color: var(--dim); }
.menu .rs-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 26px; }
.menu .rs-stats div { border-top: 1px solid rgba(245,245,245,0.25); padding-top: 9px; }
.menu .rs-stats small { display: block; margin-bottom: 4px; font-size: 10px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.menu .rs-stats b { font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; }
.menu .rs-stats b.pen { color: var(--orange); }
.menu .rs-note { margin: 18px 0 0 -40px; padding: 9px 30px 9px 40px; width: fit-content; background: rgba(18,18,18,0.92); clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%); font-size: 19px; font-weight: 900; text-transform: uppercase; }
.menu .rs-why { margin: 8px 0 0; font-size: 12px; font-weight: 600; color: var(--dim); }
.menu .rs-chal { margin: 16px 0 0; font-size: 13px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--dim); }
.menu .rs-chal.won { color: var(--accent); }
/* the board in the middle of the screen (clear of the head on the left in a narrow window) */
/* (it grows with the screen: wider, larger type and taller rows on a big display) */
.menu .rs-board { --w: min(1160px, calc(100vw - 540px)); position: absolute; left: max(480px, calc(50vw - var(--w) / 2)); top: 50%; translate: 0 -50%;
  width: var(--w); max-height: calc(100% - 60px); overflow-y: auto; scrollbar-width: none; padding: 22px 30px 20px 50px; background: rgba(16,16,16,0.93);
  clip-path: polygon(36px 0, 100% 0, 100% 100%, 0 100%); animation: rs-board-in 0.45s 0.1s cubic-bezier(.2,.8,.2,1) both; }
.menu .rs-board table { margin: 0; width: 100%; font-size: clamp(13px, 0.86vw, 18px); }
.menu .rs-board th { padding: 0 clamp(8px, 0.6vw, 14px) clamp(10px, 0.7vw, 14px); font-size: clamp(10px, 0.62vw, 13px); font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); text-align: left; }
.menu .rs-board td { padding: clamp(6px, 0.45vw, 10px) clamp(8px, 0.6vw, 14px); height: clamp(22px, 1.5vw, 30px); font-weight: 700; white-space: nowrap; }
.menu .rs-board :is(td, th).r { text-align: right; }
.menu .rs-board td.car { color: var(--dim); font-weight: 600; }
.menu .rs-board td.dnf { color: var(--dim); font-weight: 900; }
.menu .rs-board td i { display: inline-grid; place-items: center; min-width: clamp(22px, 1.5vw, 30px); height: clamp(22px, 1.5vw, 30px); font-style: normal; font-weight: 900; }
.menu .rs-board tr.me td { background: var(--text); color: var(--ink); }
.menu .rs-board tr.me td.car, .menu .rs-board tr.me td.dnf { color: rgba(10,10,10,0.6); }
.menu .rs-board tr.me td i { background: var(--accent); color: var(--ink); }
.menu .rs-foot { margin: 14px 0 0; font-size: clamp(11px, 0.7vw, 14px); font-weight: 600; color: var(--orange); }
.menu .results .mainnav { bottom: 84px; }
@keyframes rs-in { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }
@keyframes rs-board-in { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }
