/* Roadster Jump UI: minimal Tesla/Apple style. Glass surfaces over the WebGL canvas, critically damped motion by default and a little bounce only for celebrations, size-specific tracking, one accent colour for "on", red only for crashes and errors. */
:root {
  --fg: #f4f6fa; --fg2: #c9ced8; --mute: #8a93a4; --dim: #4b5262; --line: rgba(255, 255, 255, 0.09); --line2: rgba(255, 255, 255, 0.16);
  --glass: rgba(18, 20, 26, 0.66); --glass-solid: rgba(14, 16, 21, 0.92); --accent: #3d82f0; --accent2: #7fb0ff; --bad: #ff453a;
  --ease: cubic-bezier(0.2, 0.9, 0.25, 1); --ease-in: cubic-bezier(0.5, 0, 0.75, 0); --pop: cubic-bezier(0.34, 1.45, 0.5, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Inter, Arial, sans-serif;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; color: var(--fg); font-family: var(--font); overflow: hidden; -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
canvas#view { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
body.showroom canvas#view { cursor: grab; }
body.showroom.hovering canvas#view { cursor: pointer; }
body.showroom.dragging canvas#view { cursor: grabbing; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
.vignette { position: fixed; inset: 0; pointer-events: none; background: #000; opacity: 0; transition: opacity 0.6s var(--ease); z-index: 4; }
.vignette.on { opacity: 1; transition-duration: 0.25s; }

/* buttons */
.btn { position: relative; overflow: hidden; border: 0; border-radius: 14px; padding: 13px 22px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; cursor: pointer; transition: transform 0.16s var(--ease), background 0.2s, box-shadow 0.25s var(--ease), opacity 0.2s, color 0.2s; }
.btn:active { transform: scale(0.965); transition-duration: 0.08s; }
.btn:focus-visible { outline: 2px solid var(--accent2); outline-offset: 3px; }
.btn.primary { background: var(--fg); color: #05070a; box-shadow: 0 8px 28px rgba(255, 255, 255, 0.12); }
.btn.primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 36px rgba(255, 255, 255, 0.22); }
.btn.primary:disabled { background: rgba(255, 255, 255, 0.1); color: var(--fg2); cursor: default; box-shadow: inset 0 0 0 1px var(--line2); }
.btn.primary.ready { animation: readypop 0.6s var(--pop); }
@keyframes readypop { 40% { transform: scale(1.06); } }
.pl-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255, 255, 255, 0.14); transition: width 0.3s var(--ease); }
.btn.primary:not(:disabled) .pl-fill { display: none; }
.pl-label { position: relative; font-variant-numeric: tabular-nums; }
.btn.ghost { background: rgba(255, 255, 255, 0.07); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line2); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.12); }

/* loader */
.loader { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 60%, #0b0d12 0%, #000 70%); transition: opacity 0.8s var(--ease), filter 0.8s var(--ease), transform 1s var(--ease); }
.loader.out { opacity: 0; filter: blur(8px); transform: scale(1.04); pointer-events: none; }
.ld-wrap { width: min(760px, 88vw); text-align: center; }
.ld-ramp { width: 100%; height: auto; overflow: visible; }
.ld-ground { stroke: rgba(255, 255, 255, 0.1); stroke-width: 0.22; }
.ld-x { stroke: rgba(255, 255, 255, 0.3); stroke-width: 0.35; stroke-linecap: round; fill: none; opacity: 0; transition: opacity 0.5s; }
.loader.landed .ld-x { opacity: 1; }
.ld-track { fill: none; stroke: rgba(255, 255, 255, 0.12); stroke-width: 0.7; stroke-linecap: round; stroke-linejoin: round; }
.ld-fill { fill: none; stroke: var(--fg); stroke-width: 0.7; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 1.2px rgba(255, 255, 255, 0.9)); }
.ld-arc { fill: none; stroke: rgba(255, 255, 255, 0.55); stroke-width: 0.35; stroke-dasharray: 0.8 1.2; opacity: 0; transition: opacity 0.2s; }
.loader.jump .ld-arc { opacity: 1; }
.ld-dot { fill: #fff; filter: drop-shadow(0 0 1.6px #fff); }
.ld-title { margin-top: 26px; font-size: clamp(28px, 4.2vw, 46px); font-weight: 700; letter-spacing: -0.035em; animation: rise 1.1s var(--ease) both 0.15s; }
.ld-status { margin-top: 10px; display: flex; justify-content: center; gap: 12px; font-size: 13px; color: var(--mute); font-variant-numeric: tabular-nums; animation: rise 1.1s var(--ease) both 0.3s; }
.ld-pct { color: var(--fg2); min-width: 3.2em; text-align: left; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* title screen + showroom */
.title-screen { position: fixed; inset: 0; z-index: 5; pointer-events: none; transition: opacity 0.6s var(--ease); background: linear-gradient(90deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.3) 34%, rgba(0, 0, 0, 0) 55%), linear-gradient(0deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 35%); }
.title-screen.out { opacity: 0; }
.title-screen.out .ts-left > * { transform: translateY(16px); opacity: 0; transition: transform 0.45s var(--ease-in), opacity 0.35s; }
.ts-left { position: absolute; left: calc(56px + var(--sal)); bottom: calc(52px + var(--sab)); max-width: 520px; pointer-events: auto; }
.ts-left > * { animation: rise 0.9s var(--ease) both; }
.ts-kicker { font-size: 13px; color: var(--mute); letter-spacing: 0.02em; animation-delay: 0.05s !important; }
.ts-kicker i { color: var(--fg2); font-style: normal; }
.ts-title { margin: 10px 0 0; font-size: clamp(58px, 8.5vw, 116px); font-weight: 800; line-height: 0.88; letter-spacing: -0.055em; display: flex; flex-direction: column; animation-delay: 0.12s !important; }
.ts-title span { background: linear-gradient(180deg, #fff 30%, #b9c0cc 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ts-title span:last-child { padding-left: 0.04em; }
.ts-sub { margin: 18px 0 0; font-size: 17px; line-height: 1.45; color: var(--fg2); max-width: 420px; animation-delay: 0.22s !important; }
.ts-name { display: flex; align-items: center; gap: 12px; margin-top: 24px; width: fit-content; padding: 6px 6px 6px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px var(--line); animation-delay: 0.3s !important; transition: box-shadow 0.2s; }
.ts-name:focus-within { box-shadow: inset 0 0 0 1px rgba(61, 130, 240, 0.7), 0 0 0 4px rgba(61, 130, 240, 0.15); }
.ts-name span { font-size: 12px; color: var(--mute); letter-spacing: 0.06em; text-transform: uppercase; }
.ts-name input { width: 200px; background: transparent; border: 0; padding: 7px 4px; box-shadow: none; }
.ts-actions { display: flex; gap: 10px; margin-top: 14px; animation-delay: 0.38s !important; }
.ts-actions .btn.primary { min-width: 168px; font-size: 17px; }
.ts-hint { margin-top: 14px; font-size: 12px; color: var(--mute); animation-delay: 0.46s !important; }
.ts-hint b { font-weight: 600; color: var(--fg2); padding: 1px 6px; border-radius: 5px; box-shadow: 0 0 0 1px var(--line2); margin-right: 4px; animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4), 0 0 14px rgba(255, 255, 255, 0.12); } }
.ts-top { position: absolute; right: calc(40px + var(--sar)); top: calc(36px + var(--sat)); pointer-events: auto; animation: rise 1s var(--ease) both 0.5s; }
.tsb { width: 280px; padding: 14px 16px 8px; border-radius: 20px; background: var(--glass); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); box-shadow: inset 0 0 0 1px var(--line), 0 20px 50px rgba(0, 0, 0, 0.35); cursor: pointer; transition: transform 0.25s var(--ease), box-shadow 0.25s; }
.tsb:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--line2), 0 24px 60px rgba(0, 0, 0, 0.45); }
.tsb-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.tsb-live { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); display: inline-flex; align-items: center; gap: 6px; }
.tsb-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent2); box-shadow: 0 0 8px var(--accent2); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.tsb-list { min-height: 120px; }
.tsb-row { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; font-variant-numeric: tabular-nums; animation: slidein 0.5s var(--ease) both; }
.tsb-row span:first-child { color: var(--mute); font-size: 12px; }
.tsb-row span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tsb-row.top span:nth-child(2) { font-weight: 600; }
.tsb-row.me { color: var(--accent2); }
.tsb-empty { color: var(--mute); font-size: 13px; padding: 12px 0; }
@keyframes slidein { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.ts-show { position: absolute; right: calc(40px + var(--sar)); bottom: calc(52px + var(--sab)); display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: auto; animation: rise 1s var(--ease) both 0.6s; }
.show-seg { min-width: 220px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px var(--line); }
.show-hint { font-size: 12px; color: var(--mute); transition: opacity 0.4s; }
.tip { position: fixed; left: 0; top: 0; z-index: 7; pointer-events: none; padding: 9px 12px; border-radius: 12px; background: var(--glass); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%); box-shadow: inset 0 0 0 1px var(--line2), 0 12px 30px rgba(0, 0, 0, 0.35); opacity: 0; transform: translate3d(0, 0, 0) scale(0.92); transform-origin: 0 0; transition: opacity 0.18s var(--ease), transform 0.3s var(--pop); white-space: nowrap; }
.tip.on { opacity: 1; }
.tip-t { font-size: 13px; font-weight: 650; letter-spacing: -0.01em; }
.tip-d { font-size: 12px; color: var(--fg2); margin-top: 2px; }

input { font: inherit; font-size: 15px; color: var(--fg); background: rgba(255, 255, 255, 0.06); border: 0; border-radius: 10px; padding: 8px 11px; box-shadow: inset 0 0 0 1px var(--line); width: 190px; outline: none; user-select: text; -webkit-user-select: text; transition: box-shadow 0.2s; }
input:focus { box-shadow: inset 0 0 0 1px rgba(61, 130, 240, 0.7); }
input::placeholder { color: var(--dim); }

/* menu */
.menu { position: fixed; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, 0.42); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: fadein 0.3s var(--ease) both; }
.menu.closing { animation: fadeout 0.22s var(--ease-in) both; }
.menu.closing .menu-card { animation: cardout 0.22s var(--ease-in) both; }
@keyframes fadein { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }
.menu-card { width: min(620px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--glass); backdrop-filter: blur(24px) saturate(170%); -webkit-backdrop-filter: blur(24px) saturate(170%); border-radius: 26px; box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 30px 80px rgba(0, 0, 0, 0.5); padding: 22px 22px 18px; animation: cardin 0.45s var(--ease) both; }
@keyframes cardin { from { opacity: 0; transform: scale(0.95) translateY(10px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes cardout { to { opacity: 0; transform: scale(0.97) translateY(6px); filter: blur(4px); } }
.mc-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.mc-title { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
.mc-sub { font-size: 13px; color: var(--mute); margin-top: 2px; font-variant-numeric: tabular-nums; }
.mc-close { border: 0; background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 1px var(--line2); border-radius: 10px; padding: 6px 10px; font-size: 12px; font-weight: 600; color: var(--fg2); cursor: pointer; transition: transform 0.15s var(--ease), background 0.2s; }
.mc-close:hover { background: rgba(255, 255, 255, 0.12); }
.mc-close:active { transform: scale(0.94); }
.tabs { position: relative; display: flex; background: rgba(255, 255, 255, 0.05); padding: 3px; border-radius: 12px; margin-bottom: 6px; flex: none; }
.tabs button, .seg button { position: relative; z-index: 1; flex: 1; font-size: 13px; font-weight: 500; color: var(--mute); background: transparent; border: 0; border-radius: 9px; padding: 8px 8px; cursor: pointer; transition: color 0.25s; }
.tabs button.on, .seg button.on { color: var(--fg); }
.tabs button:active, .seg button:active { transform: scale(0.97); }
.tab-ink, .seg-ink { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 9px; background: rgba(255, 255, 255, 0.14); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); transition: transform 0.38s var(--ease), width 0.38s var(--ease); }
.tab-body { overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; margin: 0 -6px; padding: 0 6px; flex: 1; min-height: 0; }
.tab { animation: tabin 0.35s var(--ease) both; }
@keyframes tabin { from { opacity: 0; transform: translateY(6px); } }
.sec { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); margin: 18px 0 2px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.row-l { font-size: 15px; }
.row-d { font-size: 12px; color: var(--mute); margin-top: 3px; max-width: 330px; line-height: 1.4; }
.seg { position: relative; display: flex; background: rgba(255, 255, 255, 0.05); padding: 3px; border-radius: 11px; min-width: 250px; flex: none; }
.seg.wide { width: 100%; margin: 12px 0 8px; }
.rng { display: flex; align-items: center; gap: 12px; }
.rng-v { min-width: 3.2em; text-align: right; font-size: 13px; color: var(--fg2); font-variant-numeric: tabular-nums; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 200px; height: 28px; background: transparent; padding: 0; box-shadow: none; --p: 50%; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--fg) var(--p), rgba(255, 255, 255, 0.14) var(--p)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); transition: transform 0.15s var(--ease); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.18); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.14); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--fg); }
input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: #fff; }
.tog { width: 50px; height: 30px; flex: none; border-radius: 15px; border: 0; background: rgba(255, 255, 255, 0.16); position: relative; cursor: pointer; transition: background 0.25s var(--ease); }
.tog::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 12px; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); transition: transform 0.32s var(--pop), width 0.15s var(--ease); }
.tog:active::after { width: 29px; }
.tog.on { background: var(--accent); }
.tog.on::after { transform: translateX(20px); }
.tog.on:active::after { transform: translateX(15px); }
.board { min-height: 290px; }
.board .r { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: baseline; padding: 9px 6px; border-bottom: 1px solid var(--line); font-size: 15px; font-variant-numeric: tabular-nums; animation: slidein 0.45s var(--ease) both; border-radius: 8px; }
.board .r span:first-child { color: var(--mute); font-size: 13px; }
.board .r span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .r:nth-child(-n+3) span:nth-child(2) { font-weight: 650; }
.board .r:nth-child(1) { font-size: 17px; }
.board .r.me { color: var(--accent2); background: rgba(61, 130, 240, 0.09); }
.board .msg { color: var(--mute); font-size: 13px; padding: 24px 6px; }
.board .skel { height: 38px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0) 100%) 0 0 / 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.board-mine { font-size: 12px; color: var(--mute); margin-top: 12px; }
.mc-foot { display: flex; gap: 10px; margin-top: 16px; flex: none; }
.mc-foot .btn.primary { flex: 1; }
.keys-tip { font-size: 13px; color: var(--mute); margin: 14px 0 10px; }
.kb { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 16px; background: rgba(0, 0, 0, 0.25); box-shadow: inset 0 0 0 1px var(--line); }
.kb-row { display: flex; gap: 6px; }
.k { min-width: 40px; height: 38px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--fg2); border-radius: 8px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05)); box-shadow: inset 0 0 0 1px var(--line2), 0 2px 0 rgba(0, 0, 0, 0.4); transition: transform 0.08s var(--ease), background 0.12s, color 0.12s, box-shadow 0.12s; cursor: pointer; }
.k.wide { min-width: 52px; } .k.xwide { min-width: 96px; } .k.space { flex: 1; max-width: 300px; }
.k.down { transform: translateY(2px); background: var(--accent); color: #fff; box-shadow: 0 0 0 1px var(--accent), 0 0 18px rgba(61, 130, 240, 0.55); }
.gap { width: 18px; }
.kb-info { display: flex; gap: 12px; align-items: baseline; min-height: 42px; padding: 12px 4px 4px; font-size: 14px; color: var(--fg2); }
.kb-info b { font-weight: 650; color: var(--fg); min-width: 64px; }
.kb-info.flash { animation: flash 0.35s var(--ease); }
@keyframes flash { from { opacity: 0.2; transform: translateY(3px); } }
.keys2 { margin-top: 10px; }
.keys2 div { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--mute); }
.keys2 b { color: var(--fg); font-weight: 600; }
.keys-mob { font-size: 14px; line-height: 1.5; color: var(--fg2); padding: 14px 0; }
.mob { display: none; }
body.touchdev .desk { display: none !important; }
body.touchdev .mob { display: block; }
body.touchdev .keys2 { display: none; }

/* hud */
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 2; animation: fadein 0.6s var(--ease) both; }
.hud-left { position: absolute; left: calc(28px + var(--sal)); bottom: calc(24px + var(--sab)); }
.speed { display: flex; align-items: flex-end; gap: 10px; text-shadow: 0 1px 14px rgba(0, 0, 0, 0.6); }
.mph { font-size: 60px; font-weight: 650; letter-spacing: -0.04em; line-height: 0.9; min-width: 1.55em; font-variant-numeric: tabular-nums; }
.speed-side { display: flex; flex-direction: column; gap: 4px; padding-bottom: 3px; }
.gear { font-size: 12px; font-weight: 700; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--fg2); box-shadow: inset 0 0 0 1px var(--line2); transition: background 0.2s, color 0.2s, box-shadow 0.2s; }
.gear.rev { background: var(--fg); color: #000; box-shadow: none; }
.unit { font-size: 13px; color: var(--mute); font-weight: 500; letter-spacing: 0.02em; }
.dots { display: flex; gap: 5px; margin: 12px 0 10px 2px; height: 6px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); transition: background 0.06s, box-shadow 0.06s, transform 0.15s var(--ease); }
.dots i.g { margin-left: 6px; }
.dots i.on { background: #d8e8ff; box-shadow: 0 0 9px rgba(160, 205, 255, 0.95); transform: scale(1.25); }
.chips { display: flex; gap: 6px; }
.chip { position: relative; overflow: hidden; font-size: 12px; color: var(--mute); padding: 5px 9px 5px 7px; border-radius: 9px; background: rgba(13, 15, 19, 0.55); box-shadow: inset 0 0 0 1px var(--line); display: inline-flex; gap: 6px; align-items: center; transition: color 0.25s, box-shadow 0.25s; }
.chip b { font-size: 10px; font-weight: 600; color: var(--dim); box-shadow: inset 0 0 0 1px var(--dim); border-radius: 4px; padding: 0 4px; line-height: 14px; transition: color 0.25s, box-shadow 0.25s; }
.chip i { font-style: normal; }
.chip.on { color: var(--fg); box-shadow: inset 0 0 0 1px rgba(61, 130, 240, 0.6); }
.chip.on b { color: var(--accent2); box-shadow: inset 0 0 0 1px var(--accent2); }
.chip.ping { animation: ping 0.45s var(--pop); }
@keyframes ping { 40% { transform: scale(1.08); } }
.spool { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; }
.spool i { display: block; height: 100%; width: 0%; background: var(--accent2); box-shadow: 0 0 6px var(--accent2); }

.goals { position: absolute; left: calc(24px + var(--sal)); top: calc(22px + var(--sat)); width: 270px; padding: 12px 14px 10px; border-radius: 18px; background: var(--glass); backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%); box-shadow: inset 0 0 0 1px var(--line); transition: opacity 0.4s var(--ease), transform 0.5s var(--ease); }
.goals.off { opacity: 0; transform: translateX(-14px); }
.goals-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); margin-bottom: 6px; }
.goals-count { font-variant-numeric: tabular-nums; color: var(--fg2); }
.goal { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 13px; color: var(--mute); transition: color 0.3s; }
.goal .ck { flex: none; width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--dim); position: relative; transition: background 0.3s var(--ease), box-shadow 0.3s; }
.goal .ck::after { content: ""; position: absolute; left: 5px; top: 2.5px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform 0.35s var(--pop); }
.goal.now { color: var(--fg); }
.goal.now .ck { box-shadow: inset 0 0 0 1.5px var(--fg); animation: nowpulse 1.6s ease-in-out infinite; }
@keyframes nowpulse { 50% { box-shadow: inset 0 0 0 1.5px var(--fg), 0 0 0 4px rgba(255, 255, 255, 0.1); } }
.goal .gk { margin-left: auto; font-size: 10px; font-weight: 600; color: var(--fg2); box-shadow: inset 0 0 0 1px var(--line2); border-radius: 4px; padding: 0 5px; line-height: 15px; opacity: 0; transition: opacity 0.3s; }
.goal.now .gk { opacity: 1; }
.goal.done { color: var(--dim); }
.goal.done .ck { background: var(--accent); box-shadow: none; }
.goal.done .ck::after { transform: rotate(45deg) scale(1); }
.goal.just { animation: justdone 0.7s var(--pop); }
@keyframes justdone { 30% { transform: scale(1.06); color: var(--fg); } }
.goals-foot { font-size: 11px; color: var(--dim); margin-top: 6px; }
.goals-foot b { font-weight: 600; color: var(--mute); box-shadow: inset 0 0 0 1px var(--line2); border-radius: 4px; padding: 0 4px; margin-right: 4px; }
.goal-pill { display: none; }

.hud-right { position: absolute; right: calc(28px + var(--sar)); top: calc(22px + var(--sat)); text-align: right; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6); }
.best-l { font-size: 11px; color: var(--mute); letter-spacing: 0.08em; text-transform: uppercase; }
.best { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.best.bump { animation: ping 0.6s var(--pop); }
.session { font-size: 12px; color: var(--mute); margin-top: 2px; font-variant-numeric: tabular-nums; }

.trick { position: absolute; left: 50%; top: calc(15% + var(--sat)); transform: translate(-50%, -6px); text-align: center; opacity: 0; transition: opacity 0.2s, transform 0.35s var(--ease); text-shadow: 0 2px 20px rgba(0, 0, 0, 0.7); }
.trick.on { opacity: 1; transform: translate(-50%, 0); }
.trick-big { font-size: 72px; font-weight: 750; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; line-height: 1; }
.trick-big.pop { animation: trickpop 0.4s var(--pop); }
@keyframes trickpop { 35% { transform: scale(1.14); } }
.trick-sub { font-size: 15px; font-weight: 600; color: var(--fg2); margin-top: 4px; letter-spacing: 0.01em; }
.trick-meta { font-size: 12px; color: var(--mute); margin-top: 3px; font-variant-numeric: tabular-nums; }

.result { position: absolute; left: 50%; top: calc(12% + var(--sat)); width: 360px; transform: translate(-50%, -24px) scale(0.96); text-align: center; opacity: 0; pointer-events: none; background: var(--glass); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); box-shadow: inset 0 0 0 1px var(--line), 0 24px 60px rgba(0, 0, 0, 0.45); border-radius: 24px; padding: 18px 22px 16px; transition: opacity 0.35s var(--ease), transform 0.55s var(--pop); }
.result.on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.result.leave { opacity: 0; transform: translate(-50%, -12px) scale(0.98); transition: opacity 0.4s var(--ease-in), transform 0.45s var(--ease-in); }
.res-names { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.res-q { font-size: 13px; color: var(--mute); margin-top: 4px; }
.res-q .nb { color: var(--accent2); font-weight: 600; }
.res-q.bad { color: var(--bad); }
.res-pts { font-size: 52px; font-weight: 750; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; margin-top: 6px; line-height: 1.05; }
.res-parts { margin-top: 8px; text-align: left; }
.res-parts .p { display: flex; justify-content: space-between; padding: 4px 2px; font-size: 13px; color: var(--mute); border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; opacity: 0; transform: translateY(4px); animation: partin 0.35s var(--ease) forwards; }
.res-parts .p b { color: var(--fg); font-weight: 600; }
.res-parts .p.mul b { color: var(--accent2); }
@keyframes partin { to { opacity: 1; transform: none; } }
.res-rank { font-size: 13px; font-weight: 600; color: var(--accent2); margin-top: 8px; opacity: 0; transition: opacity 0.4s; }
.res-rank.on { opacity: 1; }

.prompt { position: absolute; left: 50%; bottom: calc(34px + var(--sab)); transform: translate(-50%, 8px); font-size: 14px; padding: 9px 15px 9px 11px; border-radius: 14px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px var(--line); opacity: 0; transition: opacity 0.25s var(--ease), transform 0.4s var(--pop); }
.prompt.on { opacity: 1; transform: translate(-50%, 0); }
.prompt b { font-size: 11px; font-weight: 600; line-height: 16px; padding: 0 6px; margin-right: 8px; border-radius: 5px; background: rgba(255, 255, 255, 0.12); box-shadow: 0 0 0 1px var(--line2); }
.toast { position: absolute; left: 50%; top: calc(6% + var(--sat)); transform: translate(-50%, -10px); font-size: 14px; color: var(--fg); padding: 8px 15px; border-radius: 13px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px var(--line); opacity: 0; transition: opacity 0.25s var(--ease), transform 0.45s var(--pop); white-space: nowrap; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.replay { position: absolute; left: 50%; bottom: calc(26px + var(--sab)); transform: translate(-50%, 12px); display: flex; align-items: center; gap: 12px; padding: 10px 15px; border-radius: 15px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; opacity: 0; pointer-events: none; transition: opacity 0.3s var(--ease), transform 0.45s var(--ease); }
.replay.on { opacity: 1; transform: translate(-50%, 0); }
.rp-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.2s ease-in-out infinite; }
.rp-tag { font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; font-size: 11px; }
.rp-bar { width: 220px; height: 3px; border-radius: 2px; background: var(--dim); overflow: hidden; }
.rp-bar i { display: block; height: 100%; width: 0; background: var(--fg); }
.rp-mode { font-weight: 600; }
.rp-help { color: var(--mute); }
.fps { position: absolute; right: 10px; bottom: 8px; font-size: 11px; color: var(--mute); font-variant-numeric: tabular-nums; }

/* touch */
.touch { position: fixed; inset: 0; pointer-events: none; z-index: 3; animation: fadein 0.5s var(--ease) both; }
.stick { position: absolute; left: calc(26px + var(--sal)); bottom: calc(26px + var(--sab)); width: 150px; height: 150px; border-radius: 50%; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); pointer-events: auto; }
.knob { position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px; border-radius: 50%; background: rgba(255, 255, 255, 0.24); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3), 0 4px 14px rgba(0, 0, 0, 0.3); transition: transform 0.3s var(--pop); }
.stick.active .knob { transition: none; background: rgba(255, 255, 255, 0.34); }
.tbtns { position: absolute; right: calc(20px + var(--sar)); bottom: calc(20px + var(--sab)); width: 230px; height: 190px; }
.tb { position: absolute; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.85); background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16); border-radius: 22px; pointer-events: auto; transition: transform 0.12s var(--ease), background 0.12s; }
.tb.down { background: rgba(255, 255, 255, 0.3); transform: scale(0.94); }
.tb-gas { right: 0; bottom: 0; width: 104px; height: 104px; border-radius: 52px; }
.tb-brake { right: 116px; bottom: 0; width: 86px; height: 70px; }
.tb-boost { right: 0; bottom: 116px; width: 104px; height: 64px; }
.tb-jet { right: 116px; bottom: 82px; width: 86px; height: 98px; }
.tsmall { position: absolute; right: calc(14px + var(--sar)); top: calc(10px + var(--sat)); display: flex; gap: 8px; }
.ts { min-width: 48px; height: 36px; padding: 0 10px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, 0.8); background: rgba(13, 15, 19, 0.62); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); border-radius: 12px; pointer-events: auto; transition: transform 0.12s var(--ease), box-shadow 0.2s; }
.ts.down { transform: scale(0.92); }
.ts.on { color: var(--fg); box-shadow: inset 0 0 0 1px var(--accent2); }
.tenter { position: absolute; left: 50%; bottom: calc(26px + var(--sab)); transform: translate(-50%, 10px) scale(0.95); padding: 12px 22px; border-radius: 16px; font-size: 15px; font-weight: 600; background: var(--glass-solid); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22); pointer-events: none; opacity: 0; transition: opacity 0.2s, transform 0.35s var(--pop); }
.tenter.on { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }
.tenter.down { transform: translate(-50%, 0) scale(0.95); }

body.touchdev .menu, body.touchdev .menu-card, body.touchdev .tsb, body.touchdev .result, body.touchdev .goals, body.touchdev .tip, body.touchdev .show-seg { backdrop-filter: none; -webkit-backdrop-filter: none; }
body.touchdev .menu { background: rgba(0, 0, 0, 0.6); }
body.touchdev .menu-card, body.touchdev .tsb, body.touchdev .result, body.touchdev .tip, body.touchdev .show-seg { background: var(--glass-solid); }
body.touchdev .hud-right { top: calc(56px + var(--sat)); }
body.touchdev .hud-left { left: calc(18px + var(--sal)); top: calc(10px + var(--sat)); bottom: auto; }
body.touchdev .mph { font-size: 36px; }
body.touchdev .dots, body.touchdev .chips, body.touchdev .goals { display: none; }
body.touchdev .goal-pill { display: block; position: absolute; left: calc(18px + var(--sal)); top: calc(58px + var(--sat)); max-width: 46vw; font-size: 12px; color: var(--fg2); padding: 6px 10px; border-radius: 10px; background: var(--glass-solid); box-shadow: inset 0 0 0 1px var(--line); transition: opacity 0.3s; }
body.touchdev .goal-pill:empty { opacity: 0; }
body.touchdev .toast { top: calc(20% + var(--sat)); }
body.touchdev .prompt { bottom: auto; top: calc(32% + var(--sat)); }
body.touchdev .trick-big { font-size: 48px; }
body.touchdev .result { top: calc(8% + var(--sat)); width: 300px; padding: 12px 16px; }
body.touchdev .res-pts { font-size: 34px; }
body.touchdev .res-parts .p { padding: 2px; font-size: 12px; }
body.touchdev .replay { bottom: auto; top: calc(56px + var(--sat)); }
body.touchdev .row-mouse { display: none; }
body.touchdev .ts-left { left: calc(28px + var(--sal)); bottom: calc(18px + var(--sab)); }
body.touchdev .ts-title { font-size: 50px; }
body.touchdev .ts-sub { font-size: 14px; margin-top: 8px; max-width: 320px; }
body.touchdev .ts-name { margin-top: 12px; }
body.touchdev .ts-top { right: calc(20px + var(--sar)); top: calc(14px + var(--sat)); }
body.touchdev .tsb { width: 230px; padding: 10px 12px 4px; }
body.touchdev .tsb-list { min-height: 0; }
body.touchdev .ts-show { right: calc(20px + var(--sar)); bottom: calc(18px + var(--sab)); }
@media (max-height: 520px) {
  .ts-left { bottom: calc(18px + var(--sab)); } .ts-title { font-size: 52px; } .ts-sub { font-size: 14px; margin-top: 8px; } .ts-name { margin-top: 12px; } .ts-actions { margin-top: 10px; } .ts-kicker, .ts-hint { display: none; }
  .tsb-list { min-height: 0; } .menu-card { padding: 14px 16px 12px; border-radius: 20px; } .mc-title { font-size: 22px; } .mc-head { margin-bottom: 10px; } .board { min-height: 160px; }
}
.rotate { position: fixed; inset: 0; display: none; flex-direction: column; gap: 18px; align-items: center; justify-content: center; background: #000; color: var(--fg); font-size: 17px; z-index: 20; }
.rot-icon { width: 34px; height: 58px; border-radius: 8px; box-shadow: inset 0 0 0 2px var(--fg); animation: rot 2.2s var(--ease) infinite; }
@keyframes rot { 0%, 20% { transform: rotate(0); } 55%, 100% { transform: rotate(-90deg); } }
@media (orientation: portrait) and (pointer: coarse) { .rotate { display: flex; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.12s !important; }
}
@media (prefers-reduced-transparency: reduce) { .menu-card, .tsb, .result, .goals, .prompt, .toast, .replay, .tip, .show-seg { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--glass-solid); } }
