:root {
  --fg: rgba(255, 255, 255, 0.95);
  --dim: rgba(235, 240, 255, 0.62);
  --faint: rgba(235, 240, 255, 0.36);
  --line: rgba(255, 255, 255, 0.11);
  --glass: rgba(14, 17, 26, 0.5);
  --glass2: rgba(14, 17, 26, 0.72);
  --accent: #7fb2ff;
  --hot: #ff5a3c;
  --ok: #3ce0a0;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --r: 16px;
  --ui: 'Manrope', system-ui, -apple-system, sans-serif;
  --num: 'Space Grotesk', 'Manrope', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #05060a; color: var(--fg);
  font-family: var(--ui); font-weight: 400; -webkit-font-smoothing: antialiased;
  user-select: none; -webkit-user-select: none;
}
canvas#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.4) 100%); }
#grain { display: none; }
button { font-family: inherit; }
kbd {
  font-family: var(--num); font-size: 10.5px; font-weight: 500; color: var(--dim); border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 6px; margin: 0 2px; background: rgba(255, 255, 255, 0.05); letter-spacing: 0.02em;
}
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, #7fb2ff, #ff5a3c); margin-right: 10px; box-shadow: 0 0 14px rgba(127, 178, 255, 0.7); }

/* ============================================================ title / garage */
#title { position: fixed; inset: 0; z-index: 30; transition: opacity 1.2s var(--ease); }
#title.gone { opacity: 0; pointer-events: none; visibility: hidden; transition: opacity 1.2s var(--ease), visibility 0s linear 1.3s; }
.tscrim { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(4, 6, 12, 0.78) 0%, rgba(4, 6, 12, 0.35) 34%, rgba(4, 6, 12, 0) 58%),
              linear-gradient(0deg, rgba(4, 6, 12, 0.7) 0%, rgba(4, 6, 12, 0) 32%); }
.tbar { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 26px clamp(22px, 4vw, 56px); }
.tmark { font-size: 12px; font-weight: 600; letter-spacing: 0.34em; text-transform: uppercase; display: flex; align-items: center; }
.tbar-r { display: flex; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05); color: var(--dim); font-size: 12.5px; font-weight: 500; cursor: pointer;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: color 0.25s, background 0.25s, border-color 0.25s;
}
.chip:hover { color: var(--fg); background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.22); }

.tcar { position: absolute; left: clamp(22px, 4vw, 56px); top: 50%; transform: translateY(-58%); width: min(440px, calc(100vw - 44px)); }
.tidx { display: flex; align-items: center; gap: 10px; font-family: var(--num); font-size: 12px; color: var(--faint); letter-spacing: 0.1em; }
.tidx i { width: 34px; height: 1px; background: var(--faint); }
#tIdx { color: var(--fg); }
#tCar { font-family: var(--num); font-size: clamp(48px, 7vw, 88px); font-weight: 500; letter-spacing: -0.035em; line-height: 0.95; margin: 14px 0 8px; text-shadow: 0 6px 40px rgba(0, 0, 0, 0.35); }
#tCar.swap { animation: carIn 0.7s var(--ease); }
@keyframes carIn { 0% { opacity: 0; transform: translateX(-18px); filter: blur(6px); } 100% { opacity: 1; transform: none; filter: none; } }
.tcls { font-size: 13px; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent); }
.tstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 28px 0 24px; }
.st b { display: block; font-family: var(--num); font-size: 26px; font-weight: 500; letter-spacing: -0.02em; }
.st b small { font-size: 12px; color: var(--dim); font-weight: 400; margin-left: 3px; letter-spacing: 0; }
.st span { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); margin: 2px 0 8px; }
.st .bar { height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.st .bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #7fb2ff, #fff); transition: width 0.7s var(--ease); }
.tsw { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 26px; }
.tsw .swatch { width: 24px; height: 24px; }
.tnav { display: flex; align-items: center; gap: 10px; }
.round {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); color: var(--fg);
  display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: background 0.25s, transform 0.2s, border-color 0.25s;
}
.round:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.25); }
.round:active { transform: scale(0.94); }
.thint { margin-left: 10px; font-size: 12px; color: var(--faint); }
.tcredit { margin-top: 18px; font-size: 10.5px; color: var(--faint); min-height: 14px; }

.tgo { position: absolute; left: clamp(22px, 4vw, 56px); bottom: clamp(26px, 6vh, 56px); display: flex; flex-direction: column; gap: 14px; width: min(560px, calc(100vw - 44px)); }
.tmode { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 18px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.tmode button { text-align: left; border: 0; border-radius: 13px; padding: 12px 16px; background: transparent; color: var(--dim); cursor: pointer; transition: background 0.3s, color 0.3s; }
.tmode button b { display: block; font-size: 15px; font-weight: 600; color: inherit; }
.tmode button span { display: block; font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.tmode button:hover { color: var(--fg); }
.tmode button.on { background: rgba(255, 255, 255, 0.95); color: #0b0d12; }
.tmode button.on span { color: rgba(11, 13, 18, 0.55); }
.topts { display: none; gap: 10px; flex-direction: column; padding: 4px 4px 0; }
#title.race .topts { display: flex; }
.oprow { display: flex; align-items: center; gap: 14px; }
.oprow label { width: 72px; font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); }
.pills { display: flex; gap: 6px; }
.pills button { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--dim); border-radius: 99px; padding: 7px 14px; font-size: 12.5px; font-weight: 500; cursor: pointer; transition: all 0.25s; }
.pills button:hover { color: var(--fg); border-color: rgba(255, 255, 255, 0.25); }
.pills button.on { background: rgba(127, 178, 255, 0.2); border-color: rgba(127, 178, 255, 0.6); color: #fff; }
.cta-btn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 18px; height: 60px; padding: 0 22px 0 26px; border: 0; border-radius: 18px;
  background: linear-gradient(135deg, #ffffff, #dfe8ff); color: #0b0d12; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; cursor: pointer;
  box-shadow: 0 18px 50px rgba(127, 178, 255, 0.25), inset 0 -2px 0 rgba(0, 0, 0, 0.06); transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.cta-btn:hover { transform: translateY(-2px); box-shadow: 0 24px 60px rgba(127, 178, 255, 0.35); }
.cta-btn:active { transform: translateY(0) scale(0.99); }
.cta-btn kbd { color: rgba(11, 13, 18, 0.55); border-color: rgba(11, 13, 18, 0.15); background: rgba(11, 13, 18, 0.05); }
#title:not(.ready) .cta-btn { opacity: 0.4; pointer-events: none; }
#title .cta { margin: 0; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--faint); }
#title.ready .cta { display: none; }
.tcar, .tgo, .tbar { opacity: 0; transform: translateY(10px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.tcar { transform: translateY(-56%); }
#title.loading .tbar, #title.ready .tbar, #title.ready .tgo { opacity: 1; transform: none; }
#title.ready .tcar { opacity: 1; transform: translateY(-58%); }
#title.loading .tgo { opacity: 1; transform: none; }
.tload { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255, 255, 255, 0.05); transition: opacity 1s; }
.tload i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7fb2ff, #ff5a3c); transition: width 0.4s var(--ease); }
#title.ready .tload { opacity: 0; }
@media (max-height: 720px) { .tstats { margin: 16px 0 14px; } .tsw { margin-bottom: 14px; } #tCar { font-size: 52px; } }
@media (max-width: 700px) { .tcar { top: 96px; transform: none !important; } .tbar-r .chip span { display: none; } .thint { display: none; } }

/* ======================================================================= hud */
#hud { transition: opacity 0.9s ease; }
body.idle #hud .fade, body.idle #hint, body.idle #buttons, body.idle #np:not(.flash) { opacity: 0; }
body.idle { cursor: none; }
body.zen #hud, body.zen #hint, body.zen #toast, body.zen #vignette { opacity: 0 !important; }
body.playing-title #hud, body.playing-title #ap { opacity: 0; pointer-events: none; }
.glass { background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); }

#topbar { position: fixed; top: 18px; right: 18px; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
#buttons { display: flex; gap: 6px; order: -1; transition: opacity 0.9s; }
button.icon {
  width: 42px; height: 42px; border-radius: 13px; border: 1px solid var(--line); background: rgba(14, 17, 26, 0.42); color: var(--dim); cursor: pointer;
  display: grid; place-items: center; transition: color 0.25s, background 0.25s, border-color 0.25s; font-size: 22px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
button.icon:hover { color: var(--fg); background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.22); }
button.icon.small { width: 32px; height: 32px; border-radius: 10px; font-size: 20px; }
#mini { width: 150px; height: 150px; border-radius: 22px; background: rgba(10, 13, 20, 0.42); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }

/* speed cluster */
#cluster { position: fixed; right: 26px; bottom: 18px; width: 210px; height: 210px; pointer-events: none; }
#gauge { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#gauge .gtrack { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 7; stroke-linecap: round; }
#gauge .gfill { fill: none; stroke: url(#gg); stroke-width: 7; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(127, 178, 255, 0.55)); transition: stroke-dashoffset 0.08s linear; }
#gauge line { stroke: rgba(255, 255, 255, 0.35); stroke-width: 1.5; }
#gauge line.red { stroke: rgba(255, 90, 60, 0.8); }
.cread { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-top: 8px; }
#spd { font-family: var(--num); font-size: 58px; font-weight: 500; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 2px 20px rgba(0, 0, 0, 0.4); }
.cunit { font-size: 10.5px; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase; color: var(--dim); margin-top: 4px; }
.cgear { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
#gear { font-family: var(--num); font-size: 15px; font-weight: 600; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line); }
#mode { font-size: 10px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); display: none; }
#mode.on { display: block; }
#cluster.redline #spd { color: #ffd2c8; }

/* autodrive badge */
#ap {
  position: fixed; right: 64px; bottom: 228px; display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 11px; border-radius: 99px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: #cfe0ff; background: rgba(60, 110, 220, 0.2); border: 1px solid rgba(127, 178, 255, 0.4);
  box-shadow: 0 0 30px rgba(80, 140, 255, 0.25); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  opacity: 0; transform: translateY(6px) scale(0.96); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); pointer-events: none;
}
#ap.on { opacity: 1; transform: none; animation: apIn 0.9s var(--ease); }
#ap.on svg { animation: apWheel 1s var(--ease); }
body.idle #ap.on { opacity: 0.6; }
body.zen #ap { opacity: 0 !important; }
@keyframes apIn { 0% { box-shadow: 0 0 0 0 rgba(127, 178, 255, 0.6); } 100% { box-shadow: 0 0 30px 16px rgba(80, 140, 255, 0); } }
@keyframes apWheel { 0% { transform: rotate(-80deg); } 100% { transform: rotate(0); } }
#edge { position: fixed; inset: 0; pointer-events: none; opacity: 0; }
#edge.on { box-shadow: inset 0 0 140px 10px rgba(70, 130, 255, 0.45); animation: edge 1.4s ease-out forwards; }
#edge.off { box-shadow: inset 0 0 140px 10px rgba(255, 170, 110, 0.35); animation: edge 1.1s ease-out forwards; }
#edge.go { box-shadow: inset 0 0 160px 14px rgba(60, 224, 160, 0.5); animation: edge 1.2s ease-out forwards; }
@keyframes edge { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }

#hint {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(8px); font-size: 12.5px; font-weight: 500; color: var(--fg);
  padding: 10px 18px; border-radius: 99px; background: rgba(12, 15, 22, 0.6); border: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  opacity: 0; transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); white-space: nowrap; pointer-events: none; max-width: calc(100vw - 40px); overflow: hidden; text-overflow: ellipsis;
}
#hint.show { opacity: 1; transform: translateX(-50%); }
#hint kbd { color: var(--fg); }

/* ===================================================================== race */
#race {
  position: fixed; top: 18px; left: 18px; width: 300px; padding: 16px 18px 16px; border-radius: 20px;
  background: rgba(12, 15, 22, 0.55); border: 1px solid var(--line); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; align-items: center;
}
#race[hidden] { display: none; }
.rpos { font-family: var(--num); line-height: 1; }
.rpos b { font-size: 54px; font-weight: 600; letter-spacing: -0.05em; }
.rpos b::before { content: 'P'; font-size: 26px; color: var(--dim); margin-right: 1px; }
.rpos span { font-size: 18px; color: var(--faint); }
.rtime { font-family: var(--num); font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
.rgap { font-family: var(--num); font-size: 12.5px; color: var(--dim); font-variant-numeric: tabular-nums; margin-top: 2px; min-height: 16px; }
.rgap .up { color: var(--ok); } .rgap .dn { color: #ff8a73; }
.rbar { grid-column: 1 / -1; position: relative; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.1); margin-top: 12px; }
.rbar #rFill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: linear-gradient(90deg, #7fb2ff, #fff); }
#rDots i { position: absolute; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(10, 12, 18, 0.7); }
#rDots i.you { width: 12px; height: 12px; margin: -6px 0 0 -6px; background: var(--accent); box-shadow: 0 0 0 2px #0b0d12, 0 0 12px rgba(127, 178, 255, 0.9); z-index: 2; }
.rleft { grid-column: 1 / -1; font-size: 10.5px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); margin-top: 8px; display: flex; justify-content: space-between; }
#count { position: fixed; left: 50%; top: 16vh; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 16px; pointer-events: none; }
#count[hidden] { display: none; }
.lamps { display: flex; gap: 12px; padding: 14px 18px; border-radius: 22px; background: rgba(8, 10, 14, 0.75); border: 1px solid var(--line); }
.lamps i { width: 34px; height: 34px; border-radius: 50%; background: #2a0b08; box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6); transition: background 0.08s, box-shadow 0.08s; }
.lamps i.on { background: radial-gradient(circle at 40% 35%, #ffb3a1, #ff2a12 55%, #b00d00); box-shadow: 0 0 26px rgba(255, 50, 20, 0.85); }
.lamps.go i { background: radial-gradient(circle at 40% 35%, #c8ffe9, #18d68e 55%, #058a55); box-shadow: 0 0 26px rgba(30, 230, 150, 0.85); }
.cmsg { font-family: var(--num); font-size: 22px; font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase; text-shadow: 0 4px 24px rgba(0, 0, 0, 0.5); }
#results { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(4, 6, 10, 0.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 40; transition: opacity 0.6s var(--ease); }
#results.hidden { opacity: 0; pointer-events: none; }
.rescard { width: min(520px, calc(100vw - 32px)); border-radius: 26px; padding: 30px; background: rgba(14, 17, 26, 0.82); border: 1px solid var(--line); box-shadow: 0 40px 120px rgba(0, 0, 0, 0.5); }
#results:not(.hidden) .rescard { animation: resIn 0.35s var(--ease); }
@keyframes resIn { 0% { transform: translateY(24px) scale(0.98); opacity: 0; } 100% { transform: none; opacity: 1; } }
.reskick { font-size: 11px; font-weight: 700; letter-spacing: 0.26em; text-transform: uppercase; color: var(--accent); }
.reshead h2 { font-family: var(--num); font-size: 64px; font-weight: 600; letter-spacing: -0.05em; margin: 6px 0 2px; line-height: 1; }
.ressub { color: var(--dim); font-size: 14px; }
.reslist { list-style: none; padding: 0; margin: 22px 0; display: flex; flex-direction: column; gap: 2px; max-height: 42vh; overflow: auto; }
.reslist li { display: grid; grid-template-columns: 30px 12px 1fr auto; gap: 12px; align-items: center; padding: 9px 12px; border-radius: 12px; font-size: 14px; }
.reslist li:nth-child(odd) { background: rgba(255, 255, 255, 0.03); }
.reslist li.you { background: rgba(127, 178, 255, 0.16); }
.reslist .p { font-family: var(--num); color: var(--dim); font-weight: 600; }
.reslist .c { width: 10px; height: 10px; border-radius: 3px; }
.reslist .n small { color: var(--faint); margin-left: 8px; font-size: 12px; }
.reslist .t { font-family: var(--num); font-variant-numeric: tabular-nums; color: var(--dim); }
.resbtns { display: flex; gap: 10px; }
.resbtns .cta-btn { flex: 1; height: 54px; font-size: 15px; }
.ghost { height: 54px; padding: 0 22px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); color: var(--fg); font-size: 15px; font-weight: 600; cursor: pointer; }
.ghost:hover { background: rgba(255, 255, 255, 0.12); }

/* ============================================================ now playing dock */
#np {
  --tint: 120, 130, 160;
  position: fixed; left: 18px; bottom: 18px; width: min(360px, calc(100vw - 260px)); padding: 10px 12px 12px 10px; border-radius: 20px;
  display: flex; align-items: center; gap: 10px; overflow: hidden;
  background: rgba(12, 15, 22, 0.5); border: 1px solid var(--line); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.3); opacity: 0; transform: translateY(8px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease), background 0.4s;
}
#np.show { opacity: 1; transform: none; }
#np::before { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 180% at 0% 50%, rgba(var(--tint), 0.42), rgba(var(--tint), 0) 70%); pointer-events: none; transition: background 1.2s; }
#np:hover { background: rgba(12, 15, 22, 0.72); }
#npInfo { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; cursor: pointer; }
#npArt { width: 48px; height: 48px; border-radius: 12px; flex: none; background: center / cover no-repeat, linear-gradient(135deg, #2a3045, #5b4a6e); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); transition: transform 0.4s var(--ease); }
#np:not(.paused) #npArt:not(.radio) { animation: artbreathe 5s ease-in-out infinite; }
@keyframes artbreathe { 50% { transform: scale(1.05); } }
#npArt.radio { border-radius: 50%; background: radial-gradient(circle at 50% 50%, #0d0f16 0 18%, #c9a37a 19% 26%, #1a1c24 27% 100%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
#npArt.radio.spin { animation: vinyl 3.2s linear infinite; }
@keyframes vinyl { to { transform: rotate(360deg); } }
.npt { min-width: 0; flex: 1; }
#npTitle { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; }
#npTitle span { display: inline-block; white-space: nowrap; }
#npTitle.long span { animation: marquee 14s linear infinite; padding-right: 40px; }
@keyframes marquee { 0%, 18% { transform: translateX(0); } 82%, 100% { transform: translateX(calc(-100% + var(--w, 200px))); } }
#npArtist { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
#np.paused #npTitle { color: var(--dim); }
.npc { position: relative; display: flex; align-items: center; gap: 2px; flex: none; }
.npb { width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--dim); display: grid; place-items: center; cursor: pointer; transition: color 0.2s, background 0.2s, transform 0.15s; }
.npb:hover { color: var(--fg); background: rgba(255, 255, 255, 0.1); }
.npb:active { transform: scale(0.9); }
.npb.main { width: 38px; height: 38px; color: #0b0d12; background: var(--fg); }
.npb.main:hover { background: #fff; color: #000; }
#npBar { position: absolute; left: 70px; right: 16px; bottom: 7px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; opacity: 0; transition: opacity 0.6s; }
#np.has-bar #npBar { opacity: 1; }
#npBar i { display: block; height: 100%; width: 0; border-radius: 3px; background: rgba(var(--tint), 1); filter: brightness(1.7) saturate(1.2); transition: width 0.3s linear; }
#npTime { position: absolute; right: 16px; top: 6px; font-family: var(--num); font-size: 10px; color: var(--faint); font-variant-numeric: tabular-nums; opacity: 0; transition: opacity 0.3s; }
#np:hover #npTime, #np.vol #npTime { opacity: 1; }
#npVol { position: absolute; left: 70px; right: 16px; bottom: 7px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); opacity: 0; transition: opacity 0.3s; }
#np.vol #npVol { opacity: 1; }
#np.vol #npBar { opacity: 0; }
#npVol i { display: block; height: 100%; width: 50%; background: var(--fg); border-radius: 3px; }
body.lib-open #np { opacity: 0; pointer-events: none; }

/* toast */
#toast {
  position: fixed; left: 50%; top: 18px; display: flex; gap: 12px; align-items: center; padding: 8px 18px 8px 8px; border-radius: 18px;
  background: rgba(12, 15, 22, 0.62); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--line);
  transform: translate(-50%, -14px); opacity: 0; transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  max-width: min(380px, calc(100vw - 44px)); pointer-events: none; box-shadow: 0 14px 44px rgba(0, 0, 0, 0.35); z-index: 25;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toastArt { width: 46px; height: 46px; border-radius: 11px; object-fit: cover; background: linear-gradient(135deg, #3a3150, #c57b5c); flex: none; }
.tmeta { min-width: 0; }
.np { font-size: 9.5px; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent); margin-bottom: 2px; }
#toastTitle { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#toastArtist { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* quick picks */
#quick {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); width: min(720px, calc(100vw - 32px)); padding: 18px; border-radius: 26px; z-index: 22;
  background: rgba(12, 15, 22, 0.78); border: 1px solid var(--line); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45); transition: opacity 0.16s var(--ease), transform 0.2s var(--ease);
}
#quick.hidden { opacity: 0; transform: translateX(-50%) translateY(14px); pointer-events: none; }
.qhead { display: flex; align-items: center; gap: 12px; margin: 0 4px 14px; }
.qhead b { font-size: 15px; font-weight: 700; }
.qhead span { font-size: 12px; color: var(--faint); flex: 1; }
.qgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.qt { position: relative; aspect-ratio: 1.25; border-radius: 16px; overflow: hidden; cursor: pointer; background: #1a1e29 center / cover no-repeat; border: 1px solid var(--line); transition: transform 0.25s var(--ease), border-color 0.25s; }
.qt:hover, .qt.sel { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.4); }
.qt::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.05) 70%); }
.qt .qn { position: absolute; top: 9px; left: 9px; z-index: 1; font-family: var(--num); font-size: 11px; font-weight: 600; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.2); }
.qt .ql { position: absolute; left: 11px; right: 11px; bottom: 10px; z-index: 1; }
.qt .ql b { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qt .ql span { display: block; font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qt.g1 { background-image: linear-gradient(135deg, #1d5b3a, #1db954); }
.qt.g2 { background-image: linear-gradient(135deg, #3b2f8f, #8e8ee0); }
.qt.g3 { background-image: radial-gradient(circle at 30% 30%, #c9a37a, #3a2a20 70%); }
.qt.g4 { background-image: linear-gradient(135deg, #22283a, #3a4566); }
@media (max-width: 640px) { .qgrid { grid-template-columns: repeat(2, 1fr); } }

/* ===================================================================== menu */
#menu {
  position: fixed; top: 14px; right: 14px; bottom: 14px; width: min(420px, calc(100vw - 28px)); border-radius: 24px;
  background: rgba(12, 15, 22, 0.78); backdrop-filter: blur(26px) saturate(1.3); -webkit-backdrop-filter: blur(26px) saturate(1.3);
  border: 1px solid var(--line); padding: 22px 22px 30px; overflow-y: auto; z-index: 35; box-shadow: 0 30px 100px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s var(--ease), opacity 0.16s var(--ease);
}
#menu.hidden { transform: translateX(30px); opacity: 0; pointer-events: none; }
#menu::-webkit-scrollbar { width: 6px; } #menu::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.mhead { display: flex; justify-content: space-between; align-items: center; }
.brand { font-size: 11px; font-weight: 700; letter-spacing: 0.3em; text-transform: uppercase; color: var(--dim); display: flex; align-items: center; }
.tabs { display: flex; gap: 4px; margin: 18px 0 14px; flex-wrap: wrap; padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); }
.tab { color: var(--dim); cursor: pointer; padding: 7px 11px; border-radius: 10px; font-size: 12.5px; font-weight: 600; transition: color 0.25s, background 0.25s; }
.tab:hover { color: var(--fg); }
.tab.on { color: #0b0d12; background: var(--fg); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-size: 14px; }
.row.col { flex-wrap: wrap; }
.row label { color: var(--dim); white-space: nowrap; font-weight: 500; }
.rv { display: flex; align-items: center; gap: 10px; }
.rv span { font-family: var(--num); font-size: 12px; color: var(--dim); min-width: 56px; text-align: right; font-variant-numeric: tabular-nums; }
.seg { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.seg button, .btn { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); color: var(--dim); border-radius: 99px; padding: 7px 13px; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all 0.25s; }
.seg button:hover, .btn:hover { color: var(--fg); border-color: rgba(255, 255, 255, 0.25); }
.seg button.on { color: #0b0d12; background: var(--fg); border-color: transparent; }
.btn.primary { background: #1db954; color: #08130b; border-color: transparent; }
.btn.primary:hover { background: #2ad466; color: #08130b; }
#btnRace.primary { background: linear-gradient(135deg, #ffffff, #dfe8ff); color: #0b0d12; }
.btn.wide { width: 100%; padding: 12px; font-size: 14px; border-radius: 14px; }
.toggle { width: 42px; height: 24px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); position: relative; cursor: pointer; transition: background 0.3s; flex: none; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--fg); transition: transform 0.35s var(--ease); }
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(18px); background: #0b0d12; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 150px; height: 4px; background: rgba(255, 255, 255, 0.16); border-radius: 4px; outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--fg); cursor: pointer; border: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--fg); cursor: pointer; border: 0; }
.swatches { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.swatch { width: 22px; height: 22px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 2px 8px rgba(0, 0, 0, 0.3); transition: transform 0.2s; }
.swatch:hover { transform: scale(1.12); }
.swatch.on { border-color: var(--fg); transform: scale(1.1); }
.stat { font-size: 12.5px; color: var(--faint); line-height: 1.6; margin: 18px 0 0; }
.stat.found { color: var(--accent); opacity: 0.8; }
.mono { font-family: var(--num); font-variant-numeric: tabular-nums; color: var(--dim); font-size: 13px; }
.keys > div { display: flex; gap: 14px; align-items: center; padding: 8px 0; font-size: 13px; color: var(--dim); border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.keys kbd { min-width: 70px; text-align: center; margin: 0; }
.ggrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.gc { padding: 12px 12px 11px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); cursor: pointer; transition: background 0.25s, border-color 0.25s; }
.gc:hover { background: rgba(255, 255, 255, 0.09); }
.gc.on { border-color: var(--accent); background: rgba(127, 178, 255, 0.14); }
.gc b { display: block; font-size: 14px; font-weight: 700; }
.gc span { display: block; font-size: 11px; color: var(--faint); margin-top: 2px; }
.gc .gm { display: flex; gap: 10px; margin-top: 8px; font-family: var(--num); font-size: 11.5px; color: var(--dim); }

/* music pane + library */
.mp p { font-size: 13px; color: var(--dim); line-height: 1.6; margin: 0 0 12px; }
.mp ol { padding-left: 18px; margin: 0 0 14px; font-size: 13px; color: var(--dim); line-height: 1.7; }
.mp a { color: var(--accent); }
.mp code { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; background: rgba(255, 255, 255, 0.06); padding: 2px 6px; border-radius: 4px; user-select: all; -webkit-user-select: all; word-break: break-all; color: var(--fg); }
.mp input[type=text] { width: 100%; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); color: var(--fg); border-radius: 12px; padding: 11px 13px; font: inherit; font-size: 13px; outline: none; user-select: text; -webkit-user-select: text; margin-bottom: 10px; }
.mp input[type=text]:focus { border-color: var(--faint); }
.mp .err { color: #ff9a8a; font-size: 12px; margin: 8px 0; }
.mp .status { font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); margin: 4px 0 14px; }
.npc2 { display: flex; gap: 14px; align-items: center; margin: 6px 0 12px; }
.npc2 img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: linear-gradient(135deg, #3a3150, #c57b5c); }
.npc2 .t { font-size: 15px; font-weight: 600; } .npc2 .a { font-size: 12px; color: var(--dim); }
.ctrls { display: flex; gap: 6px; align-items: center; margin: 6px 0 4px; }
.ctrls button.icon { font-size: 15px; color: var(--fg); }
.plist { margin-top: 10px; }
.plist .h { font-size: 10px; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; color: var(--faint); margin: 14px 0 6px; }
.pl { display: flex; gap: 12px; align-items: center; padding: 7px 6px; border-radius: 11px; cursor: pointer; transition: background 0.2s; }
.pl:hover { background: rgba(255, 255, 255, 0.07); }
.pl img, .pl .ph { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: linear-gradient(135deg, #4b3a6b, #9a6bd6); flex: none; }
.pl .nm { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl .sub2 { font-size: 11px; color: var(--faint); }
.linkish { background: none; border: 0; color: var(--faint); font: inherit; font-size: 12px; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.linkish:hover { color: var(--dim); }

#lib {
  position: fixed; top: 14px; left: 14px; bottom: 14px; width: min(400px, calc(100vw - 28px)); display: flex; flex-direction: column;
  border-radius: 24px; background: rgba(12, 15, 22, 0.74); backdrop-filter: blur(28px) saturate(1.3); -webkit-backdrop-filter: blur(28px) saturate(1.3);
  border: 1px solid var(--line); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.4);
  transition: transform 0.22s var(--ease), opacity 0.16s var(--ease); overflow: hidden; z-index: 20;
}
#lib.hidden { transform: translateX(-36px); opacity: 0; pointer-events: none; }
body.lib-open #race { opacity: 0; }
.lhead { display: flex; align-items: center; gap: 6px; padding: 14px 12px 8px 14px; }
.lsearch { flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 40px; border-radius: 13px; background: rgba(255, 255, 255, 0.07); border: 1px solid transparent; color: var(--dim); transition: border-color 0.3s; }
.lsearch:focus-within { border-color: rgba(127, 178, 255, 0.6); color: var(--fg); }
.lsearch input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--fg); font: inherit; font-size: 13.5px; user-select: text; -webkit-user-select: text; }
.lsearch input::placeholder { color: var(--faint); }
#libBack { font-size: 26px; }
#libBack[hidden] { display: none; }
.ltabs { display: flex; gap: 4px; padding: 4px 14px 10px; overflow-x: auto; scrollbar-width: none; }
.ltabs span { font-size: 12px; font-weight: 600; color: var(--dim); padding: 7px 12px; border-radius: 99px; cursor: pointer; white-space: nowrap; transition: background 0.3s, color 0.3s; }
.ltabs span:hover { color: var(--fg); }
.ltabs span.on { background: var(--fg); color: #0b0d12; }
#lib.signed-out .ltabs, #lib.signed-out .lsearch { opacity: 0.35; pointer-events: none; }
#libBody { flex: 1; overflow-y: auto; padding: 2px 8px 12px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
#libBody .mp { padding: 8px 8px; }
.lh { font-size: 10px; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; color: var(--faint); margin: 18px 8px 8px; }
.lload { color: var(--dim); font-size: 13px; padding: 26px 10px; text-align: center; line-height: 1.6; }
.lt, .lb { display: flex; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 12px; cursor: pointer; transition: background 0.25s; }
.lt:hover, .lb:hover { background: rgba(255, 255, 255, 0.08); }
.lt img, .lt .ph { width: 42px; height: 42px; border-radius: 8px; flex: none; object-fit: cover; }
.lb img, .lb .ph { width: 50px; height: 50px; border-radius: 10px; flex: none; object-fit: cover; }
.lb img.round, .lhero img.round { border-radius: 50%; }
.ph { background: linear-gradient(135deg, #2a3045, #47405e); }
.ph.g1 { background: linear-gradient(135deg, #1d5b3a, #1db954); }
.ph.g2 { background: linear-gradient(135deg, #3b2f8f, #8e8ee0); }
.lt .m, .lb .m { min-width: 0; flex: 1; }
.nm { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub2 { font-size: 11.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.lt .du { font-family: var(--num); font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.lt.now .nm { color: var(--ok); }
.lgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 4px 0 0; }
.lb.big { flex-direction: column; align-items: flex-start; gap: 10px; padding: 10px; background: rgba(255, 255, 255, 0.05); }
.lb.big .ph { width: 100%; height: 70px; border-radius: 10px; }
.lb.big .m { width: 100%; }
.lb.big .sub2 { white-space: normal; }
.lhero { display: flex; gap: 14px; align-items: flex-end; padding: 10px 8px 14px; }
.lhero img, .lhero .ph { width: 116px; height: 116px; border-radius: 14px; object-fit: cover; flex: none; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4); }
.lhero .ht { font-size: 20px; font-weight: 700; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lhero .hb { display: flex; gap: 6px; margin-top: 10px; }
.lmore { display: block; margin: 12px auto 4px; }
#libBody .err { color: #ff9a8a; font-size: 12.5px; margin: 16px 10px 4px; line-height: 1.5; }
#libNow { --tint: 120, 130, 160; border-top: 1px solid var(--line); background: linear-gradient(180deg, rgba(var(--tint), 0.22), rgba(var(--tint), 0.03)); transition: background 1.2s; }
#libNow:empty { display: none; }
.np2 { padding: 16px 18px; }
.np2 .top { display: flex; gap: 14px; align-items: center; }
.np2 .top img, .np2 .top .ph { width: 68px; height: 68px; border-radius: 12px; object-fit: cover; flex: none; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45); }
.np2 .seek { position: relative; height: 16px; margin: 12px 0 2px; cursor: pointer; }
.np2 .seek::before { content: ''; position: absolute; left: 0; right: 0; top: 6px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.14); }
.np2 .seek i { position: absolute; left: 0; top: 6px; height: 4px; border-radius: 4px; background: var(--fg); }
.np2 .seek i::after { content: ''; position: absolute; right: -6px; top: -4px; width: 12px; height: 12px; border-radius: 50%; background: var(--fg); opacity: 0; transition: opacity 0.2s; }
.np2 .seek:hover i::after { opacity: 1; }
.np2 .times { display: flex; justify-content: space-between; font-family: var(--num); font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.np2 .ctl { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 6px; }
.np2 .ctl button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--dim); display: grid; place-items: center; cursor: pointer; transition: color 0.2s, background 0.2s, transform 0.15s; }
.np2 .ctl button:hover { color: var(--fg); background: rgba(255, 255, 255, 0.08); }
.np2 .ctl button:active { transform: scale(0.9); }
.np2 .ctl button.on { color: #1ed760; }
.np2 .ctl button.big { width: 48px; height: 48px; background: var(--fg); color: #0c0e14; }
.np2 .ctl button.big:hover { background: #fff; color: #000; transform: scale(1.04); }
.np2 .volrow { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--faint); }
.np2 .volrow input { flex: 1; }

@media (max-width: 760px) {
  #cluster { width: 160px; height: 160px; right: 10px; bottom: 8px; }
  #spd { font-size: 44px; }
  #np { width: calc(100vw - 196px); left: 10px; bottom: 10px; }
  .npc #npPrev, .npc #npQuick { display: none; }
  #mini { width: 110px; height: 110px; }
  #race { width: 240px; padding: 12px 14px; }
  .rpos b { font-size: 40px; }
  #ap { right: 30px; bottom: 176px; }
  #hint { display: none; }
}

/* time of day picker */
#todBar {
  position: fixed; left: 50%; top: 18px; transform: translate(-50%, -12px); z-index: 33; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 12px 14px 12px; border-radius: 22px; background: rgba(12, 15, 22, 0.72); border: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
  opacity: 0; pointer-events: none; transition: opacity 0.35s var(--ease), transform 0.35s var(--ease); max-width: calc(100vw - 24px);
}
#todBar.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#todBar .tdl { font-size: 10.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }
#todBar .tdl span { font-weight: 500; letter-spacing: 0.04em; text-transform: none; color: var(--faint); }
#todBar .tdc { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
#todBar .tdc button {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 74px; padding: 10px 8px 8px; border: 1px solid transparent;
  border-radius: 14px; background: transparent; color: var(--dim); cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s;
}
#todBar .tdc button:hover { background: rgba(255, 255, 255, 0.07); color: var(--fg); }
#todBar .tdc button.on { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.28); color: #fff; }
#todBar .tdc i { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 50% 70%, #fff8 0 18%, var(--c) 19%); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), 0 4px 14px rgba(0, 0, 0, 0.35); }
#todBar .tdc button.on i { box-shadow: 0 0 0 2px #fff, 0 0 18px var(--c); }
#todBar .tdc b { font-size: 12px; font-weight: 600; white-space: nowrap; }
#todBar .tdc small { position: absolute; top: 5px; right: 7px; font-family: var(--num); font-size: 9.5px; color: var(--faint); }
#todBar .tdflow { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); color: var(--dim); border-radius: 99px; padding: 6px 14px; font-size: 12px; font-weight: 600; cursor: pointer; }
#todBar .tdflow:hover { color: var(--fg); background: rgba(255, 255, 255, 0.1); }
#todBar .tdflow b { font-size: 9px; margin-right: 6px; }
body.zen #todBar { opacity: 0; }

/* race controls + mode switch */
.rbtns { grid-column: 1 / -1; display: flex; gap: 6px; margin-top: 12px; }
.rbtns button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); color: var(--dim); font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.rbtns button:hover { color: var(--fg); background: rgba(255, 255, 255, 0.12); }
#rLeave:hover { color: #ffb4a5; border-color: rgba(255, 120, 100, 0.4); }
.modebar { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 16px; }
.modebar button { text-align: left; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--dim); cursor: pointer; transition: all 0.25s; }
.modebar button b { display: block; font-size: 14px; font-weight: 700; }
.modebar button span { display: block; font-size: 11px; color: var(--faint); margin-top: 2px; }
.modebar button:hover { color: var(--fg); border-color: rgba(255, 255, 255, 0.25); }
.modebar button.on { background: var(--fg); color: #0b0d12; border-color: transparent; }
.modebar button.on span { color: rgba(11, 13, 18, 0.55); }
#raceCallout { position: fixed; left: 50%; top: 26vh; transform: translate(-50%, 10px); font-family: var(--num); font-size: 34px; font-weight: 600; letter-spacing: -0.02em; text-shadow: 0 6px 30px rgba(0, 0, 0, 0.55); opacity: 0; pointer-events: none; transition: opacity 0.35s var(--ease), transform 0.35s var(--ease); white-space: nowrap; }
#raceCallout.show { opacity: 1; transform: translate(-50%, 0); }
#raceCallout.up { color: #8af0c4; } #raceCallout.dn { color: #ffab98; }
#raceCallout small { display: block; text-align: center; font-family: var(--ui); font-size: 12px; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; color: var(--dim); margin-top: 4px; }

/* boost + drift */
#cluster.boost #gauge .gfill { stroke: #9cc4ff; filter: drop-shadow(0 0 10px rgba(110, 170, 255, 0.95)) drop-shadow(0 0 22px rgba(110, 170, 255, 0.6)); }
#cluster.boost #spd { color: #e6f0ff; text-shadow: 0 0 18px rgba(120, 175, 255, 0.9), 0 0 40px rgba(120, 175, 255, 0.5); transform: scale(1.06); }
#spd { transition: transform 0.25s var(--ease), color 0.25s, text-shadow 0.25s; }
#cluster.boost::after { content: 'BOOST'; position: absolute; left: 50%; top: -14px; transform: translateX(-50%); font-size: 10.5px; font-weight: 800; letter-spacing: 0.32em; color: #cfe1ff; padding: 5px 12px; border-radius: 99px; background: rgba(70, 120, 255, 0.28); border: 1px solid rgba(140, 180, 255, 0.55); box-shadow: 0 0 22px rgba(90, 150, 255, 0.55); animation: boostPulse 0.5s ease-in-out infinite alternate; }
@keyframes boostPulse { to { box-shadow: 0 0 34px rgba(90, 150, 255, 0.85); } }
#drift {
  position: fixed; left: 50%; bottom: 120px; transform: translate(-50%, 14px) scale(0.92); display: flex; align-items: baseline; gap: 12px;
  padding: 10px 22px; border-radius: 18px; background: rgba(12, 15, 22, 0.55); border: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  opacity: 0; pointer-events: none; transition: opacity 0.25s var(--ease), transform 0.25s var(--ease); --ang: 0;
}
#drift.show { opacity: 1; transform: translate(-50%, 0) scale(calc(1 + var(--ang) * 0.08)); }
#drift .dl { font-size: 11px; font-weight: 800; letter-spacing: 0.3em; text-transform: uppercase; color: #ffb877; }
#drift b { font-family: var(--num); font-size: 34px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; min-width: 2ch; }
#drift .dm { font-family: var(--num); font-size: 18px; font-weight: 700; color: #ffd27a; }
#drift.bank b { color: #8af0c4; animation: bank 0.6s var(--ease); }
#drift.fail b { color: #ff8a73; }
@keyframes bank { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* ------------------------------------------------------------------ biomes */
.tmode { grid-template-columns: 1fr 1fr 1fr; }
.modebar { grid-template-columns: 1fr 1fr 1fr; }
#biomes { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 28px; background: rgba(4, 6, 12, 0.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: opacity 0.35s var(--ease); }
#biomes.hidden { opacity: 0; pointer-events: none; }
#biomes .bwrap { width: min(1180px, 100%); max-height: 100%; display: flex; flex-direction: column; border-radius: 24px; background: var(--glass2); border: 1px solid var(--line); box-shadow: 0 40px 120px rgba(0, 0, 0, 0.5); overflow: hidden; transform: translateY(0) scale(1); transition: transform 0.45s var(--ease); }
#biomes.hidden .bwrap { transform: translateY(18px) scale(0.98); }
.bhead { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px 14px; }
.bhead b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.bhead span { display: block; font-size: 12.5px; color: var(--dim); margin-top: 4px; }
.bbody { overflow-y: auto; padding: 0 26px 26px; }
.bbody h4 { margin: 16px 0 10px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; color: var(--faint); }
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.bcard { position: relative; text-align: left; padding: 0 0 12px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--fg); cursor: pointer; overflow: hidden; transition: transform 0.25s var(--ease), border-color 0.25s, background 0.25s; }
.bcard:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.08); }
.bcard i { display: block; height: 64px; margin-bottom: 10px; position: relative; }
.bcard i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.25)); }
.bcard b { display: block; padding: 0 14px; font-size: 14.5px; font-weight: 700; }
.bcard span { display: block; padding: 3px 14px 0; font-size: 11.5px; line-height: 1.35; color: var(--dim); }
.bcard em { position: absolute; top: 10px; right: 10px; font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; padding: 4px 8px; border-radius: 99px; background: rgba(0, 0, 0, 0.55); color: #fff; }
.bcard.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
#travel { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: #05060a; opacity: 0; transition: opacity 0.25s ease-out; pointer-events: none; }
#travel.on { opacity: 1; }
#travel i { width: 64px; height: 64px; border-radius: 50%; box-shadow: 0 0 60px rgba(255, 255, 255, 0.25); margin-bottom: 10px; }
#travel span { font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--faint); }
#travel b { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }

/* ------------------------------------------------------------- stunt pops */
#stunts { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); z-index: 20; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.stp { display: flex; align-items: baseline; gap: 10px; padding: 8px 18px; border-radius: 99px; background: rgba(10, 12, 18, 0.55); border: 1px solid rgba(255, 255, 255, 0.14); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: stpIn 0.45s var(--ease) both; transition: opacity 0.5s, transform 0.5s var(--ease); }
.stp b { font-family: var(--num); font-size: 22px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.stp span { font-family: var(--num); font-size: 13px; color: var(--dim); }
.stp.out { opacity: 0; transform: translateY(-14px); }
.stp.hot b { color: #ffb347; text-shadow: 0 0 18px rgba(255, 140, 40, 0.7); }
.stp.orb b { color: #ffd76a; }
.stp.ring b { color: #ffe28a; text-shadow: 0 0 18px rgba(255, 210, 90, 0.7); }
.stp.strike b { color: #7dffb0; text-shadow: 0 0 22px rgba(80, 255, 160, 0.7); font-size: 28px; }
.stp.bounce b { color: #7fd0ff; }
.stp.bump b { color: #ff9a3c; }
.stp.world b { font-size: 26px; text-transform: none; }
@keyframes stpIn { from { opacity: 0; transform: translateY(10px) scale(0.9); } to { opacity: 1; transform: none; } }
body.slowmo #vignette { background: radial-gradient(ellipse at 50% 45%, transparent 40%, rgba(0, 0, 0, 0.6) 100%); transition: background 0.4s; }

/* ---------------------------------------------------------------- pursuit */
#chase { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); width: 300px; padding: 14px 18px 12px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); text-align: center; transition: border-color 0.3s, box-shadow 0.3s; }
#chase[hidden] { display: none; }
#chase.danger { border-color: rgba(255, 70, 80, 0.7); box-shadow: 0 0 40px rgba(255, 40, 60, 0.25); }
#chase.evade { border-color: rgba(60, 224, 160, 0.6); }
.cstars { display: flex; justify-content: center; gap: 6px; margin-bottom: 6px; }
.cstars i { width: 14px; height: 14px; background: rgba(255, 255, 255, 0.16); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.cstars i.on { background: #ffcf4a; filter: drop-shadow(0 0 6px rgba(255, 200, 60, 0.8)); }
.cscore b { display: block; font-family: var(--num); font-size: 30px; font-weight: 600; letter-spacing: 0.02em; }
.cscore span { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--faint); }
.cstate { font-size: 12px; color: var(--dim); margin: 8px 0 7px; }
.cbar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.cbar i { display: block; height: 100%; width: 0; background: #ff4a5a; transition: width 0.15s linear; }
#chase.evade .cbar i { background: var(--ok); }
#chase .rbtns { margin-top: 10px; display: flex; gap: 6px; justify-content: center; }
#chase .rbtns button { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--dim); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 99px; padding: 5px 11px; cursor: pointer; }
#chase .rbtns button:hover { color: var(--fg); background: rgba(255, 255, 255, 0.12); }
.reslist li.kv { grid-template-columns: 1fr auto; }
@media (max-width: 700px) { #chase { width: calc(100% - 32px); top: 70px; } .bgrid { grid-template-columns: 1fr 1fr; } #biomes { padding: 10px; } }

/* ===================================================================== pause */
#c { transition: filter 0.18s ease-out, transform 0.3s var(--ease); transform-origin: 50% 50%; }
body.paused #c { filter: blur(9px) saturate(0.55) brightness(0.48); transform: scale(1.045); }
body.paused #hud, body.paused #ap, body.paused #hint, body.paused #toast, body.paused #stunts, body.paused #chase, body.paused #np { opacity: 0 !important; pointer-events: none; transition: opacity 0.25s; }
#pause { position: fixed; inset: 0; z-index: 34; overflow: hidden; transition: opacity 0.12s ease-out, visibility 0s; }
#pause.hidden { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.12s ease-out, visibility 0s 0.12s; }
.pz-scrim { position: absolute; inset: 0; background:
  radial-gradient(120% 90% at 18% 50%, rgba(10, 14, 26, 0.25), rgba(3, 4, 8, 0.82) 70%),
  repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px); }
.pz-sweep { position: absolute; inset: -20%; background: linear-gradient(105deg, transparent 42%, rgba(127, 178, 255, 0.07) 50%, transparent 58%); animation: pzSweep 5.5s linear infinite; }
@keyframes pzSweep { from { transform: translateX(-60%); } to { transform: translateX(60%); } }
.pz-ghost { position: absolute; left: 0; bottom: -4vw; white-space: nowrap; display: flex; font-family: var(--num); font-weight: 600; font-size: 15vw; line-height: 1; letter-spacing: -0.02em;
  color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, 0.06); animation: pzGhost 60s linear infinite; pointer-events: none; }
@keyframes pzGhost { to { transform: translateX(-50%); } }
.pz-wrap { position: relative; height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 6vw; align-items: center; padding: 0 7vw; }
.pz-kick { display: flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); }
.pz-pip { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(127, 178, 255, 0.7); animation: pzPip 1.6s ease-out infinite; }
@keyframes pzPip { 0% { box-shadow: 0 0 0 0 rgba(127, 178, 255, 0.6); } 100% { box-shadow: 0 0 0 14px rgba(127, 178, 255, 0); } }
.pz-title { margin: 10px 0 6px; font-family: var(--num); font-weight: 600; font-size: clamp(64px, 10vw, 150px); line-height: 0.9; letter-spacing: -0.045em; display: flex; }
.pz-title span { display: inline-block; background: linear-gradient(180deg, #fff 30%, #9fc3ff 120%); -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0; transform: translateY(0.25em) rotate(3deg); }
#pause:not(.hidden) .pz-title span { animation: pzIn 0.3s var(--ease) forwards; }
@keyframes pzIn { to { opacity: 1; transform: none; } }
.pz-where { font-size: 15px; color: var(--dim); margin-bottom: 34px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pz-where .chip2 { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); color: var(--fg); font-size: 13px; }
.pz-where .chip2 i { width: 10px; height: 10px; border-radius: 50%; }
.pz-menu { display: flex; flex-direction: column; gap: 2px; max-width: 460px; }
.pz-menu button { all: unset; cursor: pointer; position: relative; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; padding: 11px 16px; border-radius: 14px;
  color: var(--dim); opacity: 0; transform: translateX(-14px); transition: color 0.2s, background 0.25s var(--ease), padding 0.25s var(--ease); }
#pause:not(.hidden) .pz-menu button { animation: pzRow 0.24s var(--ease) forwards; }
@keyframes pzRow { to { opacity: 1; transform: none; } }
.pz-menu button[hidden] { display: none; }
.pz-menu i { font-style: normal; font-family: var(--num); font-size: 12px; color: var(--faint); transition: color 0.2s; }
.pz-menu b { font-weight: 500; font-size: 22px; letter-spacing: -0.01em; }
.pz-menu kbd { opacity: 0; transition: opacity 0.2s; }
.pz-menu button.on { color: #fff; background: linear-gradient(90deg, rgba(127, 178, 255, 0.18), rgba(127, 178, 255, 0.02)); padding-left: 24px; }
.pz-menu button.on::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.pz-menu button.on i { color: var(--accent); }
.pz-menu button.on kbd { opacity: 1; }
.pz-right { opacity: 0; transform: translateY(14px); }
#pause:not(.hidden) .pz-right { animation: pzIn 0.28s 0.04s var(--ease) forwards; }
.pz-sub { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px; }
.pz-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pz-stat { padding: 16px 16px 14px; border-radius: 18px; background: rgba(255, 255, 255, 0.045); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.pz-stat b { display: block; font-family: var(--num); font-weight: 500; font-size: 30px; letter-spacing: -0.02em; }
.pz-stat b small { font-size: 13px; color: var(--dim); margin-left: 4px; font-weight: 400; }
.pz-stat span { font-size: 12px; color: var(--dim); }
.pz-card { margin-top: 10px; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: rgba(255, 255, 255, 0.045); border: 1px solid var(--line); }
.pz-card .sw { width: 38px; height: 38px; border-radius: 12px; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 6px 18px rgba(0, 0, 0, 0.4); }
.pz-card b { display: block; font-size: 16px; font-weight: 600; }
.pz-card span { font-size: 12px; color: var(--dim); }
.pz-foot { position: absolute; left: 7vw; right: 7vw; bottom: 26px; display: flex; gap: 22px; font-size: 12px; color: var(--faint); }
.pz-foot kbd { margin-right: 4px; }
@media (max-width: 860px) { .pz-wrap { grid-template-columns: 1fr; align-content: center; gap: 24px; padding: 0 22px; } .pz-right { display: none; } .pz-foot { left: 22px; } }

/* ======================================================= deck (m): never pauses */
#deck { position: fixed; top: 16px; right: 16px; bottom: 16px; width: min(400px, calc(100vw - 32px)); z-index: 36; display: flex; flex-direction: column;
  border-radius: 28px; background: linear-gradient(180deg, rgba(20, 24, 36, 0.72), rgba(10, 12, 20, 0.78)); border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.2s var(--ease), opacity 0.14s var(--ease); overflow: hidden; }
#deck.hidden { transform: translateX(calc(100% + 30px)); opacity: 0; pointer-events: none; }
.dk-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 8px; }
.dk-tabs { position: relative; flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); padding: 4px; border-radius: 16px; background: rgba(255, 255, 255, 0.06); }
.dk-tabs button { all: unset; cursor: pointer; position: relative; z-index: 1; text-align: center; padding: 8px 0; font-size: 13px; font-weight: 600; color: var(--dim); transition: color 0.2s; }
.dk-tabs button.on { color: #0b0d12; }
.dk-ink { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 4); border-radius: 12px; background: #fff; transition: transform 0.4s var(--ease); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3); }
.dk-x { all: unset; cursor: pointer; width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; color: var(--dim); background: rgba(255, 255, 255, 0.06); }
.dk-x:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }
.dk-body { flex: 1; overflow-y: auto; padding: 8px 18px 18px; scrollbar-width: none; }
.dk-body::-webkit-scrollbar { display: none; }
.dk-foot { padding: 10px 18px 14px; font-size: 11px; color: var(--faint); text-align: center; border-top: 1px solid var(--line); }
.dk-pane { animation: dkIn 0.16s var(--ease); }
@keyframes dkIn { from { opacity: 0; transform: translateY(4px); } }
.dk-h { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); margin: 18px 0 10px; }
.dk-art { position: relative; aspect-ratio: 1; border-radius: 22px; overflow: hidden; margin-top: 6px; background: #111 center/cover no-repeat; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45); }
.dk-art.gen { background: radial-gradient(circle at 30% 30%, var(--a1, #7fb2ff), transparent 55%), radial-gradient(circle at 75% 70%, var(--a2, #ff7ad9), transparent 55%), #0d1020; }
.dk-art.gen::after { content: ''; position: absolute; inset: 0; background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.12), transparent 40%); animation: dkSpin 9s linear infinite; }
.dk-art.gen.off::after { animation-play-state: paused; }
@keyframes dkSpin { to { transform: rotate(1turn); } }
.dk-bars { position: absolute; left: 18px; bottom: 16px; display: flex; gap: 4px; align-items: flex-end; height: 26px; z-index: 1; }
.dk-bars i { width: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.85); animation: dkBar 1s ease-in-out infinite; }
.dk-bars i:nth-child(2) { animation-delay: -0.3s; } .dk-bars i:nth-child(3) { animation-delay: -0.6s; } .dk-bars i:nth-child(4) { animation-delay: -0.15s; }
.off .dk-bars i, .dk-bars.off i { animation-play-state: paused; }
@keyframes dkBar { 0%, 100% { height: 5px; } 50% { height: 24px; } }
.dk-t { margin-top: 16px; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-a { font-size: 13px; color: var(--dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-prog { margin-top: 14px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.dk-prog i { display: block; height: 100%; width: 0; background: #fff; border-radius: 2px; }
.dk-ctl { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 14px 0 6px; }
.dk-ctl button { all: unset; cursor: pointer; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #fff; transition: background 0.2s, transform 0.15s; }
.dk-ctl button:hover { background: rgba(255, 255, 255, 0.1); }
.dk-ctl button:active { transform: scale(0.92); }
.dk-ctl button.big { width: 62px; height: 62px; background: #fff; color: #0b0d12; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }
.dk-ctl button.big:hover { background: #fff; transform: scale(1.05); }
.dk-row { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.dk-row label { font-size: 13px; color: var(--dim); min-width: 74px; }
.dk-row input[type=range] { flex: 1; }
#deck input[type=range] { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 2px; background: linear-gradient(90deg, #fff var(--p, 50%), rgba(255, 255, 255, 0.15) var(--p, 50%)); outline: none; }
#deck input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); cursor: pointer; }
.dk-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dk-chip { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 99px; font-size: 13px; font-weight: 500; color: var(--dim);
  background: rgba(255, 255, 255, 0.06); border: 1px solid transparent; transition: all 0.2s; }
.dk-chip:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.dk-chip.on { color: #0b0d12; background: #fff; }
.dk-chip i { width: 9px; height: 9px; border-radius: 50%; }
.dk-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.dk-btn { all: unset; cursor: pointer; text-align: center; padding: 12px; border-radius: 14px; font-size: 13px; font-weight: 600; background: rgba(255, 255, 255, 0.07); transition: background 0.2s; }
.dk-btn:hover { background: rgba(255, 255, 255, 0.13); }
.dk-btn.green { background: #1db954; color: #04130a; }
.dk-cars { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dk-car { all: unset; cursor: pointer; position: relative; padding: 14px; border-radius: 18px; background: rgba(255, 255, 255, 0.05); border: 1px solid transparent; transition: all 0.25s var(--ease); overflow: hidden; }
.dk-car:hover { background: rgba(255, 255, 255, 0.09); transform: translateY(-2px); }
.dk-car.on { border-color: rgba(255, 255, 255, 0.7); background: rgba(255, 255, 255, 0.1); }
.dk-car .sw { width: 26px; height: 26px; border-radius: 9px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); margin-bottom: 12px; }
.dk-car b { display: block; font-size: 14px; }
.dk-car span { font-size: 11px; color: var(--dim); }
.dk-car .bar { margin-top: 10px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); }
.dk-car .bar i { display: block; height: 100%; border-radius: 2px; background: var(--accent); }
.dk-paints { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.dk-paint { all: unset; cursor: pointer; aspect-ratio: 1; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); transition: transform 0.2s; }
.dk-paint:hover { transform: scale(1.08); }
.dk-paint.on { box-shadow: 0 0 0 2px #0b0d12, 0 0 0 4px #fff; }
.dk-worlds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dk-world { all: unset; cursor: pointer; position: relative; aspect-ratio: 1.25; border-radius: 14px; overflow: hidden; display: flex; align-items: flex-end; padding: 8px; font-size: 11px; font-weight: 600;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7); transition: transform 0.2s var(--ease); }
.dk-world:hover { transform: scale(1.04); }
.dk-world.on { box-shadow: 0 0 0 2px #fff; }
.dk-world.on::after { content: 'here'; position: absolute; top: 6px; right: 6px; font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; background: #fff; color: #0b0d12; text-shadow: none; }
.dk-note { font-size: 12px; color: var(--faint); margin-top: 12px; line-height: 1.5; }
.dk-toggle { margin-left: auto; width: 40px; height: 24px; border-radius: 12px; background: rgba(255, 255, 255, 0.15); position: relative; cursor: pointer; transition: background 0.2s; }
.dk-toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.25s var(--ease); }
.dk-toggle.on { background: var(--ok); }
.dk-toggle.on::after { transform: translateX(16px); }
/* the deck slides in on the right: the speedo and minimap step aside for it */
#cluster, #topbar { transition: transform 0.22s var(--ease), opacity 0.16s; }
body.deck #cluster, body.deck #topbar { transform: translateX(calc(-1 * min(416px, 100vw - 16px))); }
@media (max-width: 700px) { body.deck #cluster, body.deck #topbar { opacity: 0; transform: none; } }
.bcard.wide { grid-column: 1 / -1; }
.bcard.wide i { height: 80px; }
.dk-world.wide { grid-column: 1 / -1; aspect-ratio: auto; height: 54px; font-size: 13px; }
#travel small { font-size: 12px; color: var(--dim); letter-spacing: 0.04em; }

/* controller focus: a soft glowing ring on whatever the d-pad is on */
.padfocus { outline: 2px solid #fff !important; outline-offset: 3px; box-shadow: 0 0 0 6px rgba(127, 178, 255, 0.35), 0 0 24px rgba(127, 178, 255, 0.45) !important; border-radius: 12px; transition: outline-offset 0.15s; z-index: 2; position: relative; }
input[type=range].padfocus { outline-offset: 6px; }

/* ---- the picker opens fast too */
#biomes { transition: opacity 0.14s ease-out !important; }
#biomes .bwrap { transition: transform 0.18s var(--ease) !important; }

/* ---- lite mode (older / weaker machines): no live background blur anywhere. Blurring the
   moving 3D view behind a panel costs the graphics chip a full extra pass every frame. */
body.lite *, body.lite *::before, body.lite *::after { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
body.lite #deck, body.lite #menu, body.lite #lib, body.lite #quick, body.lite #biomes .bwrap, body.lite .rescard { background: rgba(14, 17, 26, 0.96) !important; }
body.lite #np, body.lite #chase, body.lite .stp, body.lite #toast, body.lite #ap, body.lite .chip, body.lite .pz-stat, body.lite .pz-card { background: rgba(12, 15, 22, 0.86) !important; }
body.lite #biomes, body.lite #results { background: rgba(4, 6, 12, 0.88) !important; }
body.lite.paused #c { filter: brightness(0.35) saturate(0.6); transform: none; }
body.lite #grain, body.lite .pz-sweep, body.lite .pz-ghost { display: none; }
/* while a panel covers the screen, don't animate what's under it */
body.paused #hud * { animation-play-state: paused !important; }

/* arriving from a world switch: the live world shows straight away, with a small label */
#title.skip { display: none; }
#arrive { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 45; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none;
  padding: 18px 28px; border-radius: 22px; background: rgba(8, 10, 16, 0.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: arrIn 0.3s var(--ease); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
#arrive i { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 40px rgba(255, 255, 255, 0.25); margin-bottom: 4px; }
#arrive span { font-size: 10.5px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--faint); }
#arrive b { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
#arrive.out { opacity: 0; transform: translate(-50%, -60%); }
@keyframes arrIn { from { opacity: 0; } }
