/* Apex Rush - mobile landscape UI.
   Visual language: kerb stripes (red / white) as the one recurring motif, italic display numerals,
   graphite panels with clipped corners, the live 3D scene always visible behind the menus. */

@font-face { font-family: 'Inter'; font-weight: 500; font-style: normal; font-display: swap; src: url('/fonts/text-medium.woff') format('woff'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fonts/text-semibold.woff') format('woff'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/text-bold.woff') format('woff'); }
@font-face { font-family: 'Inter Display'; font-weight: 800; font-style: italic; font-display: swap; src: url('/fonts/display-extrabold-italic.woff') format('woff'); }
@font-face { font-family: 'Inter Display'; font-weight: 900; font-style: italic; font-display: swap; src: url('/fonts/display-black-italic.woff') format('woff'); }

:root {
  --asphalt: #101218;
  --graphite: #1a1e29;
  --graphite-2: #252b3a;
  --graphite-3: #323a4f;
  --kerb-red: #e4262b;
  --kerb-white: #f3f1ea;
  --signal: #ffc400;
  --blue: #3c8dff;
  --good: #37d67a;
  --muted: #9aa3b5;
  --panel: rgba(16, 18, 24, 0.8);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --kerb: repeating-linear-gradient(-55deg, var(--kerb-red) 0 0.7rem, var(--kerb-white) 0.7rem 1.4rem);
  --display: 'Inter Display', 'Inter', system-ui, sans-serif;
  --text: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: clamp(11px, 3.4vh, 19px); background: var(--asphalt); overscroll-behavior: none; }
body {
  margin: 0; height: 100vh; height: 100dvh; overflow: hidden; background: var(--asphalt); color: var(--kerb-white);
  font: 500 1rem/1.35 var(--text); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  touch-action: none; overscroll-behavior: none; position: fixed; inset: 0; width: 100%;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
input { font: inherit; color: inherit; user-select: text; -webkit-user-select: text; touch-action: manipulation; }
h1, h2, h3, p { margin: 0; }
svg { display: block; }
:focus-visible { outline: 0.18rem solid var(--signal); outline-offset: 0.15rem; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; background: var(--asphalt); outline: none; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
#ui > .hud, #ui > .hud * { pointer-events: none; }
#ui > .hud .ctl, #ui > .hud .hud-btn, #ui > .hud .slide-zone { pointer-events: auto; }

/* ---------- full-screen overlays: boot, rotate, desktop gate ---------- */
.overlay-full { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: var(--asphalt); text-align: center; padding: 1rem; }
.overlay-full[hidden] { display: none; }
#boot { z-index: 60; transition: opacity 0.35s ease; }
#boot.done { opacity: 0; pointer-events: none; }
.boot-card { width: min(24rem, 80vw); }
.boot-title, .gate-card h1 { font: 900 italic 3.4rem/1 var(--display); letter-spacing: -0.02em; }
.boot-card .kerb-bar { margin-top: 1rem; }
.kerb-bar { height: 0.55rem; background: var(--kerb); transform: skewX(-24deg); }
.kerb-anim { background-size: 2.5rem 100%; animation: kerb-run 0.7s linear infinite; }
@keyframes kerb-run { to { background-position: 2.5rem 0; } }
.rotate-card { display: grid; gap: 0.6rem; justify-items: center; }
.rotate-card h2 { font: 900 italic 1.8rem/1.1 var(--display); }
.rotate-card p, .gate-card p { color: var(--muted); max-width: 26rem; }
.rotate-card svg { animation: tilt 1.8s ease-in-out infinite; }
@keyframes tilt { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-90deg); } }
.gate-card { display: grid; gap: 0.9rem; justify-items: center; max-width: 30rem; }
.gate-card .kerb-bar { width: 12rem; }
.gate-lead { color: var(--kerb-white) !important; font-weight: 700; font-size: 1.2rem; }
.gate-card code { font: 600 0.95rem var(--text); background: var(--graphite); padding: 0.6rem 0.9rem; border-radius: 0.3rem; word-break: break-all; user-select: all; }

/* ---------- buttons ---------- */
.btn {
  --bg: var(--graphite-2); --fg: var(--kerb-white);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3.4rem; padding: 0 1.7rem; background: var(--bg); color: var(--fg);
  transform: skewX(-10deg); font: 800 italic 1.1rem/1 var(--display); letter-spacing: 0.01em;
  transition: filter 0.12s, transform 0.08s;
}
.btn > span, .btn > svg { transform: skewX(10deg); }
.btn > span { display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.btn:active { transform: skewX(-10deg) scale(0.97); filter: brightness(1.18); }
.btn-primary { --bg: var(--kerb-red); --fg: #fff; }
.btn-signal { --bg: var(--signal); --fg: #17130a; }
.btn-ghost { --bg: rgba(16, 18, 24, 0.6); box-shadow: inset 0 0 0 0.12rem var(--graphite-3); }
.btn-small { min-height: 2.8rem; padding: 0 1.2rem; font-size: 1rem; }
.btn[disabled], .btn.disabled { filter: grayscale(1) brightness(0.6); pointer-events: none; }
.btn-icon { min-width: 3.4rem; padding: 0 0.9rem; }
.btn-icon svg { width: 1.5rem; height: 1.5rem; }
.btn-wide { width: 100%; }

.icon-btn { width: 3.2rem; height: 3.2rem; display: grid; place-items: center; background: var(--panel); border-radius: 50%; box-shadow: inset 0 0 0 0.12rem rgba(255, 255, 255, 0.12); }
.icon-btn svg { width: 1.4rem; height: 1.4rem; }
.icon-btn:active { background: var(--graphite-3); }

/* ---------- panels, chips, layout ---------- */
.screen { position: absolute; inset: 0; padding: calc(var(--safe-t) + 0.9rem) calc(var(--safe-r) + 1.1rem) calc(var(--safe-b) + 0.9rem) calc(var(--safe-l) + 1.1rem); display: flex; flex-direction: column; animation: screen-in 0.22s ease-out; }
@keyframes screen-in { from { opacity: 0; } to { opacity: 1; } }
.panel {
  background: var(--panel); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  clip-path: polygon(0 0, calc(100% - 1.1rem) 0, 100% 1.1rem, 100% 100%, 1.1rem 100%, 0 calc(100% - 1.1rem));
  padding: 1rem 1.2rem;
}
.row { display: flex; align-items: center; gap: 0.7rem; }
.grow { flex: 1 1 auto; min-width: 0; }
.spread { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 0.7rem; }
.muted { color: var(--muted); }
.h-title { font: 900 italic 2rem/1 var(--display); letter-spacing: -0.01em; }
.h-sub { font: 800 italic 1.25rem/1.1 var(--display); }
.num { font-family: var(--display); font-style: italic; font-weight: 900; font-variant-numeric: tabular-nums; }
.small { font-size: 0.85rem; }

.chip { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 2.5rem; padding: 0 0.95rem; background: var(--panel); border-radius: 1.4rem; font-weight: 700; box-shadow: inset 0 0 0 0.1rem rgba(255, 255, 255, 0.1); }
.chip svg { width: 1.2rem; height: 1.2rem; }
.chip.tap:active { background: var(--graphite-3); }
.coin { color: var(--signal); }
.topbar { display: flex; align-items: center; gap: 0.6rem; }
.topbar .spacer { flex: 1; }

/* ---------- home ---------- */
.home-main { display: flex; flex-direction: column; gap: 0.95rem; width: min(23rem, 46vw); margin-top: auto; margin-bottom: auto; }
.brand { font: 900 italic 4.1rem/0.9 var(--display); letter-spacing: -0.03em; text-shadow: 0 0.2rem 1.2rem rgba(0, 0, 0, 0.55); }
.brand-sub { margin-top: 0.55rem; width: 11.5rem; }
.home-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; margin-top: 0.6rem; }
.home-actions .btn { justify-content: flex-start; padding: 0 1rem 0 1.3rem; white-space: nowrap; }
.home-actions .btn:last-child:nth-child(odd) { grid-column: span 2; }
.car-tag { position: absolute; right: calc(var(--safe-r) + 1.1rem); bottom: calc(var(--safe-b) + 0.9rem); text-align: right; }
.car-tag .h-sub { text-shadow: 0 0.1rem 0.8rem rgba(0, 0, 0, 0.6); }
.offline-pill { color: var(--signal); font-weight: 700; }

/* ---------- track select ---------- */
.tracks { display: flex; gap: 0.9rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0.3rem 0.1rem 0.6rem; margin: 0.6rem 0; touch-action: pan-x; scrollbar-width: none; flex: 1 1 auto; min-height: 0; }
.tracks::-webkit-scrollbar { display: none; }
.track-card { flex: 0 0 15.5rem; scroll-snap-align: center; display: flex; flex-direction: column; gap: 0.5rem; padding: 0.9rem 1rem; background: var(--panel); text-align: left; transition: transform 0.15s; clip-path: polygon(0 0, calc(100% - 1.1rem) 0, 100% 1.1rem, 100% 100%, 1.1rem 100%, 0 calc(100% - 1.1rem)); position: relative; }
.track-card.sel { background: var(--graphite-2); }
.track-card.sel::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 0.4rem; background: var(--kerb); }
.track-card canvas { width: 100%; height: 6.6rem; display: block; }
.track-card .h-sub { font-size: 1.15rem; }
.stars { display: flex; gap: 0.15rem; color: var(--signal); }
.stars svg { width: 0.95rem; height: 0.95rem; }
.stars .off { color: var(--graphite-3); }
.roam-note { max-width: 15rem; line-height: 1.3; }
.options { display: flex; gap: 1rem; align-items: center; flex-wrap: nowrap; }
.opt { display: flex; flex-direction: column; gap: 0.3rem; }
.opt > label { color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.seg { display: inline-flex; background: var(--graphite); padding: 0.2rem; gap: 0.2rem; border-radius: 0.3rem; }
.seg button { min-height: 2.6rem; padding: 0 0.9rem; font-weight: 700; border-radius: 0.2rem; color: var(--muted); }
.seg button.on { background: var(--kerb-white); color: #14161c; }
.stepper { display: inline-flex; align-items: center; background: var(--graphite); border-radius: 0.3rem; }
.stepper button { width: 2.8rem; height: 2.8rem; font: 800 1.4rem var(--display); }
.stepper output { min-width: 2rem; text-align: center; font: 900 italic 1.3rem var(--display); }

/* ---------- garage ---------- */
.garage { flex-direction: row; gap: 1rem; }
.garage-left { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.garage-right { flex: 0 0 18rem; align-self: stretch; display: flex; flex-direction: column; gap: 0.7rem; }
.stat { display: grid; grid-template-columns: 6.3rem 1fr; align-items: center; gap: 0.6rem; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.bar { height: 0.55rem; background: var(--graphite-3); transform: skewX(-24deg); position: relative; overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: var(--kerb); background-size: 1.4rem 100%; }
.garage-arrows { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.owned-tag { color: var(--good); font-weight: 700; }
.garage-right.wide { flex-basis: 21.5rem; }
.gtabs { display: flex; gap: 0.2rem; background: var(--graphite); padding: 0.2rem; border-radius: 0.3rem; }
.gtabs button { flex: 1; min-height: 2.4rem; font-weight: 700; font-size: 0.85rem; border-radius: 0.2rem; color: var(--muted); }
.gtabs button.on { background: var(--kerb-white); color: #14161c; }
.gbody { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 0.55rem; padding: 0.1rem 0.25rem 0.2rem 0.1rem; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; -webkit-mask-image: linear-gradient(#000 calc(100% - 1.3rem), transparent); mask-image: linear-gradient(#000 calc(100% - 1.3rem), transparent); padding-bottom: 1.3rem; }
.glabel { color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 0.15rem; }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.5rem; padding: 0.3rem 0.3rem; }
.sw { aspect-ratio: 1; min-width: 0; border-radius: 50%; background: var(--c, #444); box-shadow: inset 0 0 0 0.12rem rgba(255, 255, 255, 0.22); position: relative; }
.sw.on { box-shadow: 0 0 0 0.16rem var(--asphalt), 0 0 0 0.34rem var(--kerb-white); }
.sw.stock::after { content: ''; position: absolute; inset: 27%; border: 0.14rem dashed rgba(255, 255, 255, 0.9); border-radius: 50%; mix-blend-mode: difference; }
.sw.off { background: var(--graphite-2); }
.sw.off::after { content: ''; position: absolute; left: 18%; right: 18%; top: calc(50% - 0.09rem); height: 0.18rem; background: var(--kerb-red); transform: rotate(-45deg); }
.sw.custom { background: conic-gradient(#ff3b3b, #ffd400, #35ff8a, #33a8ff, #9a5bff, #ff3fa4, #ff3b3b); overflow: hidden; }
.sw.custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; }

/* ---------- friends / lobby ---------- */
.hub { display: grid; grid-template-columns: 1fr 1.25fr; gap: 1rem; flex: 1 1 auto; min-height: 0; margin: 0.7rem 0; }
.hub .panel { display: flex; flex-direction: column; gap: 0.8rem; justify-content: center; }
.code-tiles { display: flex; gap: 0.5rem; justify-content: center; }
.code-tiles div { width: 3.3rem; height: 4rem; display: grid; place-items: center; background: var(--graphite-2); font: 900 italic 2.3rem var(--display); border-bottom: 0.3rem solid var(--graphite-3); }
.code-tiles div.cur { border-bottom-color: var(--signal); }
.keypad { display: grid; grid-template-columns: repeat(8, 1fr); gap: 0.3rem; }
.keypad button { min-height: 2.65rem; background: var(--graphite-2); font: 800 italic 1.05rem var(--display); }
.keypad button:active { background: var(--graphite-3); }
.keypad button.wide { grid-column: span 2; color: var(--muted); font-size: 0.85rem; }
.lobby { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1rem; flex: 1 1 auto; min-height: 0; margin: 0.7rem 0 0; }
.lobby .panel { display: flex; flex-direction: column; gap: 0.7rem; min-height: 0; }
.room-code { font: 900 italic 3.4rem/0.95 var(--display); letter-spacing: 0.08em; }
.players { display: flex; flex-direction: column; gap: 0.35rem; overflow-y: auto; min-height: 0; touch-action: pan-y; scrollbar-width: none; }
.player { display: grid; grid-template-columns: 1.8rem 1fr auto; align-items: center; gap: 0.6rem; padding: 0.4rem 0.6rem; background: var(--graphite); font-weight: 700; }
.player .dot { width: 0.8rem; height: 0.8rem; border-radius: 50%; background: var(--graphite-3); }
.player.ready .dot { background: var(--good); }
.player.away { opacity: 0.5; }
.player .tag { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.player .host { color: var(--signal); }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chips button { min-height: 2.5rem; padding: 0 0.9rem; background: var(--graphite); font-weight: 700; color: var(--muted); }
.chips button.on { background: var(--kerb-white); color: #14161c; }
.chips button[disabled] { opacity: 0.55; }

/* ---------- modal (settings, leaderboard, name, info) ---------- */
.scrim { position: absolute; inset: 0; background: rgba(8, 9, 13, 0.62); display: flex; align-items: center; justify-content: center; padding: calc(var(--safe-t) + 0.8rem) calc(var(--safe-r) + 1rem) calc(var(--safe-b) + 0.8rem) calc(var(--safe-l) + 1rem); animation: screen-in 0.18s ease-out; z-index: 5; }
.modal { width: min(46rem, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 0.8rem; background: var(--graphite); clip-path: polygon(0 0, calc(100% - 1.3rem) 0, 100% 1.3rem, 100% 100%, 1.3rem 100%, 0 calc(100% - 1.3rem)); padding: 1.1rem 1.3rem; }
.modal.narrow { width: min(26rem, 100%); }
.modal-body { overflow-y: auto; touch-action: pan-y; min-height: 0; scrollbar-width: none; display: grid; gap: 0.2rem; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 0.08rem solid rgba(255, 255, 255, 0.07); }
.setting > div:first-child { min-width: 0; }
.setting .name { font-weight: 700; }
.setting .hint { color: var(--muted); font-size: 0.8rem; }
.switch { width: 3.4rem; height: 1.9rem; background: var(--graphite-3); border-radius: 1rem; position: relative; flex: none; transition: background 0.15s; }
.switch::after { content: ''; position: absolute; top: 0.2rem; left: 0.2rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--kerb-white); transition: transform 0.15s; }
.switch.on { background: var(--kerb-red); }
.switch.on::after { transform: translateX(1.5rem); }
input[type='range'] { width: 11rem; accent-color: var(--kerb-red); height: 2rem; }
.text-input { width: 100%; background: var(--graphite-2); border: 0; border-bottom: 0.25rem solid var(--graphite-3); padding: 0.7rem 0.9rem; font-weight: 700; font-size: 1.2rem; border-radius: 0; }
.text-input:focus { outline: none; border-bottom-color: var(--signal); }
.board { display: grid; gap: 0.25rem; }
.board-row { display: grid; grid-template-columns: 2.4rem 1fr auto; gap: 0.6rem; padding: 0.45rem 0.7rem; background: var(--graphite-2); font-weight: 700; align-items: center; }
.board-row.me { background: #3b2326; box-shadow: inset 0.25rem 0 0 var(--kerb-red); }
.board-row .rk { font: 900 italic 1.1rem var(--display); color: var(--muted); }

/* ---------- loading ---------- */
.loading { align-items: center; justify-content: center; text-align: center; gap: 0.9rem; background: radial-gradient(circle at 50% 45%, rgba(16, 18, 24, 0.55), rgba(16, 18, 24, 0.96)); }
.loading .bar-wrap { width: min(22rem, 70vw); height: 0.7rem; background: var(--graphite-2); transform: skewX(-24deg); overflow: hidden; }
.loading .bar-fill { height: 100%; width: 0; background: var(--kerb); background-size: 1.4rem 100%; transition: width 0.2s ease; }
.tip { color: var(--muted); max-width: 26rem; }

/* ---------- HUD ---------- */
.hud { position: absolute; inset: 0; padding: calc(var(--safe-t) + 0.7rem) calc(var(--safe-r) + 1rem) calc(var(--safe-b) + 0.8rem) calc(var(--safe-l) + 1rem); text-shadow: 0 0.1rem 0.6rem rgba(0, 0, 0, 0.7); }
.hud-pos { position: absolute; top: calc(var(--safe-t) + 0.6rem); left: calc(var(--safe-l) + 1rem); }
.hud-pos .num { font-size: 3.6rem; line-height: 0.85; }
.hud-pos .of { font: 800 italic 1.5rem var(--display); color: var(--muted); }
.hud-lap { font: 800 italic 1.1rem var(--display); margin-top: 0.3rem; }
.hud-time { position: absolute; top: calc(var(--safe-t) + 0.6rem); left: 50%; transform: translateX(-50%); text-align: center; }
.hud-time .num { font-size: 1.8rem; }
.hud-time .best { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.hud-top-right { position: absolute; top: calc(var(--safe-t) + 0.6rem); right: calc(var(--safe-r) + 1rem); display: flex; gap: 0.5rem; }
.hud-btn { width: 2.9rem; height: 2.9rem; display: grid; place-items: center; background: rgba(16, 18, 24, 0.6); border-radius: 50%; box-shadow: inset 0 0 0 0.1rem rgba(255, 255, 255, 0.18); }
.hud-btn svg { width: 1.3rem; height: 1.3rem; }
/* Free roam: coin + gem counters replace the race readouts and the map shows the whole drivable world */
.hud-roam { position: absolute; top: calc(var(--safe-t) + 0.6rem); left: calc(var(--safe-l) + 1rem); display: grid; gap: 0.3rem; }
.hud.roam .hud-pos, .hud.roam .hud-time { display: none; }
.roam-coins, .roam-gems { display: flex; align-items: center; gap: 0.5rem; }
.roam-coins .num { font-size: 2.1rem; line-height: 1; }
.roam-gems .num { font-size: 1.35rem; line-height: 1; color: #e2c2ff; }
.roam-ico { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; color: #ffc400; filter: drop-shadow(0 0.1rem 0.35rem rgba(0, 0, 0, 0.6)); }
.roam-gems .roam-ico { width: 1.5rem; height: 1.5rem; color: #c06bff; }
.roam-ico svg { width: 100%; height: 100%; }
/* Free roam map: a round map that follows the car; tap it to zoom */
.hud.roam .hud-map { width: 10.6rem; height: 10.6rem; border-radius: 50%; opacity: 1; box-shadow: 0 0 0 0.16rem rgba(243, 241, 234, 0.55), 0 0.3rem 1.2rem rgba(0, 0, 0, 0.55); background: #0a0c11; }
#ui > .hud.roam canvas.hud-map { pointer-events: auto; cursor: pointer; touch-action: manipulation; }
/* portal travel */
.portal-hint { position: absolute; left: 50%; top: calc(var(--safe-t) + 0.7rem); transform: translateX(-50%); padding: 0.28rem 0.95rem 0.28rem 0.7rem; display: flex; align-items: center; gap: 0.5rem; background: rgba(8, 9, 13, 0.62); border-radius: 2rem; font: 800 0.9rem var(--text); white-space: nowrap; box-shadow: inset 0 0 0 0.1rem var(--c, #fff); }
.portal-hint::before { content: ''; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--c, #fff); box-shadow: 0 0 0.7rem var(--c, #fff); }
.portal-flash { position: absolute; inset: 0; z-index: 8; pointer-events: none; background: radial-gradient(circle at 50% 55%, #fff 0%, var(--c, #fff) 38%, rgba(8, 9, 13, 0.92) 100%); }
.portal-flash.out { animation: pflash-out 0.55s ease-in forwards; }
.portal-flash.in { animation: pflash-in 1.1s ease-out forwards; }
@keyframes pflash-out { from { opacity: 0; } to { opacity: 1; } }
@keyframes pflash-in { from { opacity: 1; } to { opacity: 0; } }
.hud-map { position: absolute; top: calc(var(--safe-t) + 4rem); right: calc(var(--safe-r) + 1rem); width: 8.2rem; height: 8.2rem; opacity: 0.92; }
.hud-speed { position: absolute; left: 50%; bottom: calc(var(--safe-b) + 0.8rem); transform: translateX(-50%); text-align: center; min-width: 9rem; }
.hud-speed .num { font-size: 3.4rem; line-height: 0.9; }
.hud-speed .unit { font: 700 0.85rem var(--text); color: var(--muted); margin-top: 0.1rem; }
.nitro-bar { width: 9rem; height: 0.6rem; margin: 0.45rem auto 0; background: rgba(16, 18, 24, 0.7); transform: skewX(-24deg); overflow: hidden; box-shadow: inset 0 0 0 0.08rem rgba(255, 255, 255, 0.2); }
.nitro-bar > i { display: block; height: 100%; width: 100%; transform-origin: left; background: linear-gradient(90deg, #2d7cff, #7de3ff); }
.nitro-bar.boost > i { background: linear-gradient(90deg, #ffd45a, #fff6c9); }
.lights { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); display: flex; gap: 1rem; padding: 0.8rem 1.2rem; background: rgba(8, 9, 13, 0.75); border-radius: 1.2rem; transition: opacity 0.3s; }
.lights i { width: 2.6rem; height: 2.6rem; border-radius: 50%; background: #2a1517; box-shadow: inset 0 0 0 0.15rem #000; }
.lights i.red { background: #ff2a2f; box-shadow: 0 0 1.6rem #ff2a2f, inset 0 0 0 0.15rem #000; }
.lights.go i { background: #2dff7a; box-shadow: 0 0 1.8rem #2dff7a, inset 0 0 0 0.15rem #000; }
.banner { position: absolute; left: 50%; top: 24%; transform: translate(-50%, 0); font: 900 italic 3rem/1 var(--display); text-align: center; white-space: nowrap; animation: banner 1.8s ease-out forwards; }
.banner small { display: block; font: 700 1rem var(--text); color: var(--muted); margin-top: 0.4rem; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, 1rem) scale(0.9); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
.wrongway { position: absolute; left: 50%; top: 34%; transform: translateX(-50%); background: var(--kerb-red); padding: 0.5rem 1.4rem; font: 900 italic 1.6rem var(--display); animation: blink 0.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.35; } }
.hud [hidden] { display: none !important; }

.net-note { position: absolute; left: 50%; top: calc(var(--safe-t) + 3.6rem); transform: translateX(-50%); background: rgba(228, 38, 43, 0.85); padding: 0.25rem 0.9rem; font-weight: 700; font-size: 0.85rem; }

.tag3d { position: absolute; left: 0; top: 0; font: 700 0.8rem/1 var(--text); background: rgba(16, 18, 24, 0.72); padding: 0.28rem 0.6rem; border-radius: 1rem; white-space: nowrap; pointer-events: none; will-change: transform; }

/* touch controls */
.ctl { position: absolute; display: grid; place-items: center; touch-action: none; color: #fff; -webkit-user-select: none; }
.ctl .face { width: 100%; height: 100%; display: grid; place-items: center; background: rgba(16, 18, 24, 0.5); box-shadow: inset 0 0 0 0.14rem rgba(255, 255, 255, 0.32); transform: skewX(-10deg); transition: background 0.06s, transform 0.06s; }
.ctl .face svg { width: 42%; height: 42%; transform: skewX(10deg); }
.ctl.down .face { background: rgba(228, 38, 43, 0.75); transform: skewX(-10deg) scale(0.94); box-shadow: inset 0 0 0 0.14rem #fff; }
.ctl-left { left: calc(var(--safe-l) + 1rem); bottom: calc(var(--safe-b) + 0.9rem); width: 6.4rem; height: 6.4rem; }
.ctl-right { left: calc(var(--safe-l) + 8.3rem); bottom: calc(var(--safe-b) + 0.9rem); width: 6.4rem; height: 6.4rem; }
.ctl-gas { right: calc(var(--safe-r) + 1rem); bottom: calc(var(--safe-b) + 0.9rem); width: 6.9rem; height: 8.4rem; }
.ctl-gas .face { background: rgba(55, 214, 122, 0.28); }
.ctl-gas.down .face { background: rgba(55, 214, 122, 0.8); }
.ctl-brake { right: calc(var(--safe-r) + 8.4rem); bottom: calc(var(--safe-b) + 0.9rem); width: 5.6rem; height: 5.6rem; }
.ctl-nitro { right: calc(var(--safe-r) + 8.6rem); bottom: calc(var(--safe-b) + 7rem); width: 4.6rem; height: 4.6rem; }
.ctl-nitro .face { background: rgba(60, 141, 255, 0.34); border-radius: 50%; transform: none; }
.ctl-nitro .face svg { transform: none; }
.ctl-nitro.down .face { background: rgba(255, 196, 0, 0.85); transform: scale(0.94); }
.ctl-nitro.empty { opacity: 0.5; }
.ctl-hand { right: calc(var(--safe-r) + 14.7rem); bottom: calc(var(--safe-b) + 0.9rem); width: 5rem; height: 5rem; }
.ctl-hand .face { background: rgba(255, 196, 0, 0.2); box-shadow: inset 0 0 0 0.14rem rgba(255, 196, 0, 0.65); }
.ctl-hand .face svg { width: 52%; height: 52%; }
.ctl-hand.down .face { background: rgba(255, 196, 0, 0.9); color: #17130a; box-shadow: inset 0 0 0 0.14rem #fff; }
.ctl-wheel { left: calc(var(--safe-l) + 1.2rem); bottom: calc(var(--safe-b) + 0.6rem); width: 9.4rem; height: 9.4rem; border-radius: 50%; background: radial-gradient(circle, rgba(16, 18, 24, 0.5) 0 62%, rgba(16, 18, 24, 0.24) 63% 100%); box-shadow: inset 0 0 0 0.14rem rgba(255, 255, 255, 0.28); }
.ctl-wheel .wheel-disc { width: 100%; height: 100%; display: grid; place-items: center; color: rgba(243, 241, 234, 0.92); pointer-events: none; will-change: transform; }
.ctl-wheel .wheel-disc svg { width: 94%; height: 94%; filter: drop-shadow(0 0.15rem 0.3rem rgba(0, 0, 0, 0.5)); }
.ctl-wheel.down { box-shadow: inset 0 0 0 0.16rem rgba(255, 255, 255, 0.7); }
.ctl-label { position: absolute; bottom: 0.35rem; font: 800 italic 0.7rem var(--display); opacity: 0.8; letter-spacing: 0.02em; }
.slide-zone { position: absolute; left: 0; bottom: 0; width: 50%; height: 62%; touch-action: none; }
.slide-hint { position: absolute; left: calc(var(--safe-l) + 1.2rem); bottom: calc(var(--safe-b) + 1.1rem); width: 12rem; height: 3.2rem; display: grid; align-items: center; }
.slide-hint::before { content: ''; height: 0.45rem; background: rgba(255, 255, 255, 0.22); transform: skewX(-24deg); }
.slide-hint i { position: absolute; left: 50%; top: 50%; width: 2.8rem; height: 2.8rem; margin: -1.4rem 0 0 -1.4rem; border-radius: 50%; background: rgba(243, 241, 234, 0.85); }
.tilt-hint { position: absolute; left: calc(var(--safe-l) + 1.4rem); bottom: calc(var(--safe-b) + 1.2rem); width: 5rem; height: 5rem; border-radius: 50%; box-shadow: inset 0 0 0 0.14rem rgba(255, 255, 255, 0.32); background: rgba(16, 18, 24, 0.4); display: grid; place-items: center; }
.tilt-hint i { width: 3.4rem; height: 0.35rem; background: var(--kerb-white); border-radius: 0.2rem; }

/* pause + results */
.pause { align-items: center; justify-content: center; background: rgba(8, 9, 13, 0.6); }
.pause .panel { width: 22rem; display: grid; gap: 0.7rem; padding: 1.3rem; }
.results { background: radial-gradient(circle at 30% 40%, rgba(16, 18, 24, 0.55), rgba(16, 18, 24, 0.94)); }
.res-wrap { display: grid; grid-template-columns: 1fr 1.5fr; gap: 1.2rem; align-items: center; flex: 1 1 auto; min-height: 0; }
.res-hero .pos { font: 900 italic 7.5rem/0.85 var(--display); letter-spacing: -0.04em; }
.res-hero .pos sup { font-size: 2.6rem; vertical-align: top; position: relative; top: 0.4rem; }
.res-hero .win { color: var(--signal); }
.res-rows { display: grid; gap: 0.25rem; max-height: 100%; overflow-y: auto; touch-action: pan-y; scrollbar-width: none; }
.res-row { display: grid; grid-template-columns: 2.2rem 1fr auto auto; gap: 0.7rem; align-items: center; padding: 0.42rem 0.8rem; background: var(--panel); font-weight: 700; }
.res-row.me { background: #3b2326; box-shadow: inset 0.25rem 0 0 var(--kerb-red); }
.res-row .t { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.res-row .rk { font: 900 italic 1.2rem var(--display); }
.coin-line { display: flex; align-items: center; gap: 0.5rem; font: 900 italic 1.8rem var(--display); color: var(--signal); }
.coin-line svg { width: 1.9rem; height: 1.9rem; }

/* toast */
.toast { position: absolute; left: 50%; bottom: calc(var(--safe-b) + 1.2rem); transform: translateX(-50%); background: var(--kerb-white); color: #14161c; padding: 0.7rem 1.2rem; font-weight: 700; z-index: 20; animation: toast 3s ease-out forwards; max-width: 80vw; text-align: center; clip-path: polygon(0 0, calc(100% - 0.7rem) 0, 100% 0.7rem, 100% 100%, 0.7rem 100%, 0 calc(100% - 0.7rem)); pointer-events: none; }
.toast.bad { background: var(--kerb-red); color: #fff; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 1rem); } 8% { opacity: 1; transform: translate(-50%, 0); } 85% { opacity: 1; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .kerb-anim, .rotate-card svg, .wrongway { animation: none; }
  .portal-flash.in, .portal-flash.out { animation-duration: 0.01s; }
  .screen, .scrim { animation: none; }
}

/* Quick match: the waiting screen */
.mm-main { align-items: center; text-align: center; justify-content: center; }
.mm-timer { font-size: 4.2rem; font-weight: 800; line-height: 1; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; font-style: italic; }
.mm-bar { width: min(20rem, 100%); height: 0.7rem; background: var(--graphite-2); transform: skewX(-24deg); overflow: hidden; margin: 0.5rem 0; }
.mm-bar .bar-fill { height: 100%; width: 0; background: var(--kerb); background-size: 1.4rem 100%; transition: width 0.3s linear; }

/* Garage: parts shop */
.gtabs button { font-size: 0.78rem; padding: 0 0.1rem; }
.bar > b { position: absolute; inset: 0 auto 0 0; background: var(--signal); }
.part-row, .buy-bar { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; align-items: center; padding: 0.45rem 0.6rem; background: var(--graphite); }
.pname { font-weight: 700; font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem; }
.pnote { color: var(--muted); font-size: 0.72rem; font-weight: 600; line-height: 1.3; }
.pips { display: inline-flex; gap: 0.2rem; }
.pips i { display: block; width: 0.5rem; height: 0.5rem; background: var(--graphite-3); transform: skewX(-24deg); }
.pips i.on { background: var(--signal); }
.buy-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem; min-height: 2.4rem; min-width: 4.6rem; padding: 0 0.7rem; background: var(--signal); color: #17130a; font-weight: 800; font-size: 0.82rem; clip-path: polygon(0.45rem 0, 100% 0, calc(100% - 0.45rem) 100%, 0 100%); }
.buy-btn svg { width: 1rem; height: 1rem; }
.buy-btn[disabled] { background: var(--graphite-3); color: var(--muted); }
.maxed { color: var(--good); font-weight: 800; font-size: 0.8rem; padding: 0 0.6rem; }
.slot { display: flex; flex-direction: column; gap: 0.35rem; }
.slot-title { font-weight: 700; font-size: 0.85rem; }
.chips button.locked { color: var(--muted); }
.chips .tagp { margin-left: 0.4rem; color: var(--signal); font-size: 0.72rem; font-weight: 800; }
.chips button.on .tagp { color: #8a6a00; }

/* ---- daily challenge ---- */
.daily-chip .dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 0.12rem rgba(255, 212, 0, 0.25); }
.daily-modal { width: min(46rem, 94vw); }
.daily-body { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1rem; align-items: start; }
.daily-info { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.daily-map { width: auto; max-width: 100%; height: 6.5rem; aspect-ratio: 340 / 150; background: var(--graphite-2); align-self: flex-start; }
.daily-facts { flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.daily-side { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.daily-board { display: flex; flex-direction: column; gap: 0.25rem; max-height: 15rem; overflow-y: auto; }
.res-hero .pos.time { font-size: 4.6rem; line-height: 1; }
.daily-rank { min-height: 1.1em; }
@media (max-width: 640px) { .daily-body { grid-template-columns: 1fr; } }

/* ---- performance report ---- */
.perf-hud { position: absolute; left: calc(var(--safe-l, 0px) + 0.5rem); bottom: calc(var(--safe-b, 0px) + 0.4rem); z-index: 60; pointer-events: none; font: 700 0.72rem/1.2 ui-monospace, Menlo, Consolas, monospace; color: #d7ffd7; background: rgba(0, 0, 0, 0.55); padding: 0.15rem 0.4rem; }
.perf-text { width: 100%; font: 600 0.72rem/1.35 ui-monospace, Menlo, Consolas, monospace; resize: none; min-height: 9rem; }

/* use the same player on another phone */
.transfer-modal { display: flex; flex-direction: column; gap: 0.6rem; }
.code-big { font: 900 italic 2.6rem/1.1 var(--display); letter-spacing: 0.22rem; text-align: center; padding: 0.7rem 0.4rem; background: var(--graphite-2); border-bottom: 0.25rem solid var(--signal); font-variant-numeric: tabular-nums; user-select: all; -webkit-user-select: all; }
.code-big.bad { color: var(--muted); border-bottom-color: var(--graphite-3); }
.code-input { text-align: center; text-transform: uppercase; letter-spacing: 0.2rem; font-family: var(--display); }
.warn { color: var(--signal); }
.link-btn { background: none; border: 0; padding: 0.5rem 0 0; margin: 0; color: var(--blue); font: 700 0.85rem var(--text); text-decoration: underline; text-underline-offset: 0.2rem; cursor: pointer; text-align: left; }

/* Quick match rating */
.rating-line { min-height: 1.1em; }
.rating-line b { font-family: var(--display); font-style: italic; font-weight: 900; font-size: 1.15em; }
.rating-line .delta { font-weight: 800; }
.rating-line .delta.up { color: var(--good); }
.rating-line .delta.down { color: var(--kerb-red); }

/* ghost lap */
.hud-time .ghost-gap { margin-top: 0.15rem; font: 800 0.95rem var(--text); color: var(--good); text-shadow: 0 0.1rem 0.4rem rgba(0, 0, 0, 0.6); }
.hud-time .ghost-gap.behind { color: #ff8a8d; }
.chip.ghost-chip { color: #8fb6ff; }

/* ---- career ---- */
.home-actions .career-btn { grid-column: span 2; }
.career { gap: 0.55rem; }
.cup-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.55rem; }
.cup-tab { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; padding: 0.55rem 0.8rem; background: var(--panel); text-align: left; min-width: 0; box-shadow: inset 0 0 0 0.1rem rgba(255, 255, 255, 0.08); }
.cup-tab .ct-name { font: 800 italic 1rem/1.1 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding-right: 1.4rem; }
.cup-tab .ct-sub { color: var(--muted); font-weight: 600; }
.cup-tab.sel { background: var(--graphite-2); box-shadow: inset 0 -0.3rem 0 var(--kerb-red); }
.cup-tab.locked { opacity: 0.75; }
.cup-tab .ct-badge { position: absolute; right: 0.6rem; top: 0.5rem; width: 1.1rem; height: 1.1rem; color: var(--muted); }
.cup-tab .ct-badge svg { width: 100%; height: 100%; }
.cup-tab .ct-badge.gold { color: var(--signal); }
.stars-chip { color: var(--signal); }
.event-row { display: flex; gap: 0.8rem; flex: 1 1 auto; min-height: 0; overflow-x: auto; touch-action: pan-x; scrollbar-width: none; padding: 0.1rem 0.1rem 0.3rem; }
.event-row::-webkit-scrollbar { display: none; }
.event-card { flex: 1 1 0; min-width: 13rem; display: flex; flex-direction: column; gap: 0.25rem; padding: 0.6rem 0.9rem; background: rgba(16, 18, 24, 0.88); overflow-x: hidden; overflow-y: auto; scrollbar-width: none; clip-path: polygon(0 0, calc(100% - 1.1rem) 0, 100% 1.1rem, 100% 100%, 1.1rem 100%, 0 calc(100% - 1.1rem)); }
.event-card canvas { width: 100%; height: 3.5rem; object-fit: contain; display: block; flex: 0 0 auto; }
.event-card .h-sub { font-size: 1.05rem; min-width: 0; }
.event-card.locked canvas, .event-card.locked .goals { opacity: 0.4; }
.event-card .btn { margin-top: auto; align-self: flex-start; flex: 0 0 auto; min-height: 2.5rem; }
.event-facts, .event-car { color: var(--muted); }
.event-car { color: var(--kerb-white); opacity: 0.85; }
.goals { display: grid; gap: 0.15rem; }
.goal-row { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.goal-row .gi { width: 0.95rem; height: 0.95rem; flex: 0 0 auto; color: var(--graphite-3); }
.goal-row .gi svg { width: 100%; height: 100%; }
.goal-row .gt { flex: 1 1 auto; min-width: 0; }
.goal-row .gc { color: var(--signal); font-variant-numeric: tabular-nums; }
.goal-row.got { color: var(--kerb-white); }
.goal-row.got .gi { color: var(--good); }
.goal-row.got .gc { color: var(--muted); text-decoration: line-through; }
.lock-note { display: flex; align-items: center; gap: 0.4rem; margin-top: auto; color: var(--muted); font-weight: 600; }
.lock-note svg { width: 1rem; height: 1rem; flex: 0 0 auto; }
.cup-note { line-height: 1.3; }

.career-res { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.5rem; }
.career-stars { display: flex; gap: 0.3rem; }
.career-stars .cs { width: 2.3rem; height: 2.3rem; color: var(--graphite-3); }
.career-stars .cs svg { width: 100%; height: 100%; }
.career-stars .cs.on { color: var(--signal); }
.career-stars .cs.new { animation: star-pop 0.5s calc(var(--i) * 0.28s + 0.2s) both cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes star-pop { from { transform: scale(0.2) rotate(-40deg); opacity: 0; } to { transform: none; opacity: 1; } }
.career-res .prize { color: var(--signal); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .career-stars .cs.new { animation: none; } }

/* ---- car damage + pit box ---- */
.hud-dmg { position: absolute; top: calc(var(--safe-t) + 5.6rem); left: calc(var(--safe-l) + 1rem); display: flex; align-items: center; gap: 0.4rem; font: 800 0.85rem var(--text); }
.hud-dmg .dmg-ico { width: 1.1rem; height: 1.1rem; color: var(--muted); }
.hud-dmg .dmg-ico svg { width: 100%; height: 100%; }
.dmg-bar { width: 5.4rem; height: 0.5rem; background: rgba(16, 18, 24, 0.7); transform: skewX(-24deg); overflow: hidden; box-shadow: inset 0 0 0 0.08rem rgba(255, 255, 255, 0.2); }
.dmg-bar > i { display: block; height: 100%; width: 100%; transform-origin: left; background: var(--good); transition: transform 0.2s; }
.hud-dmg[data-level=warn] .dmg-bar > i { background: var(--signal); }
.hud-dmg[data-level=bad] .dmg-bar > i { background: var(--kerb-red); }
.hud-dmg[data-level=bad] .dmg-txt { color: #ff8a8d; }
.repair { position: absolute; left: 50%; top: 38%; transform: translateX(-50%); display: grid; gap: 0.4rem; justify-items: center; font: 900 italic 1.4rem var(--display); }
.repair-bar { width: 11rem; height: 0.7rem; background: rgba(16, 18, 24, 0.75); transform: skewX(-24deg); overflow: hidden; box-shadow: inset 0 0 0 0.1rem rgba(255, 255, 255, 0.3); }
.repair-bar > i { display: block; height: 100%; width: 100%; transform-origin: left; background: #3c8dff; }
.res-hero .damage-line { min-height: 1.1em; }

/* ---- achievements ---- */
.badge-chip { color: var(--signal); }
.ach-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.55rem; }
.ach-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: min-content; gap: 0.5rem; overflow-y: auto; touch-action: pan-y; scrollbar-width: none; align-content: start; padding: 0.1rem; }
.ach-grid::-webkit-scrollbar { display: none; }
.ach-card { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.7rem; min-height: 3.7rem; background: rgba(16, 18, 24, 0.88); box-shadow: inset 0 0 0 0.1rem rgba(255, 255, 255, 0.06); min-width: 0; clip-path: polygon(0 0, calc(100% - 0.8rem) 0, 100% 0.8rem, 100% 100%, 0.8rem 100%, 0 calc(100% - 0.8rem)); }
.ach-ico { width: 1.9rem; height: 1.9rem; flex: 0 0 auto; color: var(--graphite-3); }
.ach-ico svg { width: 100%; height: 100%; }
.ach-txt { flex: 1 1 auto; min-width: 0; }
.ach-name { font: 800 italic 0.95rem/1.15 var(--display); }
.ach-desc { color: var(--muted); font-weight: 600; line-height: 1.2; }
.ach-coins { flex: 0 0 auto; color: var(--signal); font-weight: 800; font-variant-numeric: tabular-nums; }
.ach-coins.done { color: var(--good); }
.ach-card.got { background: rgba(38, 33, 12, 0.88); box-shadow: inset 0 0 0 0.1rem rgba(255, 196, 0, 0.35); }
.ach-card.got .ach-ico { color: var(--signal); }
.ach-card:not(.got) .ach-name { color: var(--kerb-white); opacity: 0.85; }
@media (max-width: 760px) { .ach-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.badge-res { display: grid; gap: 0.2rem; margin-top: 0.5rem; }
.badge-line { display: flex; align-items: baseline; gap: 0.45rem; font-weight: 700; animation: badge-in 0.4s calc(var(--i) * 0.25s + 0.5s) both ease-out; }
.badge-line .bi { width: 1.1rem; height: 1.1rem; flex: 0 0 auto; color: var(--signal); align-self: center; }
.badge-line .bi svg { width: 100%; height: 100%; }
.badge-line .bn { font: 800 italic 1rem var(--display); white-space: nowrap; }
.badge-line .bt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; }
.badge-line .bc { color: var(--signal); font-variant-numeric: tabular-nums; margin-left: auto; }
.badge-more { color: var(--muted); font-weight: 600; }
@keyframes badge-in { from { transform: translateX(-0.8rem); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .badge-line { animation: none; } }
