/* Game page skin. Tokens match the un:tricky club site (site/style.css, brand/README.md round 2).
   Self-contained so the page also renders on the game dev server (fonts fall back to system faces there). */

@font-face { font-family: "Exo 2"; font-style: normal; font-weight: 400 900; font-display: swap; src: url("/fonts/exo2.woff2") format("woff2"); }
@font-face { font-family: "Exo 2"; font-style: italic; font-weight: 400 900; font-display: swap; src: url("/fonts/exo2-italic.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --night: #120d2e;
  --night-deep: #08061a;
  --panel: #1c1447;
  --panel-2: #271c5e;
  --orange: #ff6a13;
  --cyan: #22d3ff;
  --lime: #c6ff1a;
  --snow: #f4f8ff;
  --muted: #c4bde8;
  --skew: -12deg;
  --margin: clamp(16px, 3vw, 40px);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  font-family: "Exo 2", system-ui, sans-serif;
  font-size: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  line-height: 1.5;
  background: var(--night-deep);
  color: var(--snow);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; background: radial-gradient(120% 90% at 20% 0%, #2b1a78 0%, #120d2e 55%, #08061a 100%) fixed; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
.skip { position: absolute; left: var(--margin); top: -100px; z-index: 20; background: var(--lime); color: var(--night); padding: 10px 18px; font-weight: 700; }
.skip:focus { top: 12px; }

h1, h2 { font-style: italic; font-weight: 900; text-transform: uppercase; letter-spacing: -0.01em; line-height: 0.95; }
h1 {
  font-size: clamp(2.25rem, 1.4rem + 3vw, 3.75rem);
  background: linear-gradient(180deg, #fff 0%, #d3e3f7 40%, #55688f 49%, #a3b8da 57%, #f2f7ff 85%, #fff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(2px 2px 0 var(--night)) drop-shadow(-1px -1px 0 var(--night)) drop-shadow(0.05em 0.05em 0 var(--orange));
  padding-right: 0.12em;
}
h2 { font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem); }

/* Shared header styles come from the site's /nav.css. */

main { width: min(100% - 2 * var(--margin), 1040px); margin: 8px auto 64px; display: grid; gap: 18px; }
.status-line { color: var(--muted); }
.error { color: var(--snow); background: #6b1030; padding: 12px 16px; border-radius: 12px; overflow-wrap: anywhere; }
.help { color: var(--muted); max-width: 75ch; }

.panel { background: var(--panel); border-radius: 16px; padding: clamp(20px, 3vw, 32px); display: grid; gap: 12px; justify-items: start; }
.panel p { max-width: 70ch; }
.file-label, #install-progress label { font-weight: 700; }
#xiso-file { width: 100%; font: inherit; color: var(--muted); }
#xiso-file::file-selector-button {
  font: italic 900 1rem/1 "Exo 2", sans-serif; text-transform: uppercase; cursor: pointer;
  min-height: 48px; padding: 0 22px; margin-right: 14px; border: 0; border-radius: 10px;
  background: var(--orange); color: var(--night); box-shadow: 4px 4px 0 var(--cyan);
}
/* Internal test install (tailnet dev only): secondary look with a lime "test" shadow. */
#install-internal { --fill: var(--panel-2); --ink: var(--snow); --shadow: var(--lime); min-height: 46px; font-size: 0.9375rem; }
.option .check { font-weight: 500; color: var(--muted); align-items: flex-start; min-height: 0; padding: 6px 0; }
#hosted-note { display: block; margin-top: 12px; max-width: 48ch; color: var(--muted); }
.option input[type=checkbox] { flex: none; margin-top: 2px; }
#install-progress { width: 100%; display: grid; gap: 8px; }
progress { width: 100%; height: 18px; accent-color: var(--orange); }
#progress-text { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; color: var(--muted); }

/* Buttons: skewed shape drawn behind the text, so scripts can set textContent freely. */
button, a.button-link {
  --fill: var(--panel-2); --ink: var(--snow); --shadow: var(--night-deep);
  position: relative; isolation: isolate; border: 0; background: none; cursor: pointer;
  min-height: 46px; padding: 0 20px; color: var(--ink);
  font: italic 900 0.9375rem/1 "Exo 2", sans-serif; text-transform: uppercase;
  transition: transform 140ms var(--ease-out);
}
button::before, a.button-link::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 10px;
  background: var(--fill); transform: skewX(var(--skew)); box-shadow: 4px 4px 0 var(--shadow);
  transition: box-shadow 140ms var(--ease-out), background-color 140ms;
}
button:hover, a.button-link:hover { transform: translate(-1px, -1px); }
button:hover::before, a.button-link:hover::before { box-shadow: 6px 6px 0 var(--shadow); }
button:active, a.button-link:active { transform: translate(2px, 2px); }
button:active::before, a.button-link:active::before { box-shadow: 1px 1px 0 var(--shadow); }
button.go { --fill: var(--orange); --ink: var(--night); --shadow: var(--cyan); min-height: 52px; padding: 0 28px; font-size: 1.0625rem; }
button[aria-pressed="true"] { --fill: var(--cyan); --ink: var(--night); }
button:disabled { cursor: wait; --fill: var(--panel-2); --ink: var(--muted); --shadow: var(--night-deep); transform: none; }

/* The stage: the game sits in a dark frame with the orange offset, like the season pass. */
#player, #guest { display: grid; gap: 18px; }
#player { container: player-stage / inline-size; }
/* margin-bottom plus the grid gap clears the 16px offset shadow, so the next line is not covered. */
#stage, #guest-stage, #stopped-panel { position: relative; width: 100%; aspect-ratio: 4 / 3; margin-bottom: 10px; background: #000; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 6px var(--night), 10px 10px 0 6px var(--orange); }
#stopped-panel { display: grid; place-items: center; padding: clamp(20px, 4vw, 48px); background: var(--panel); }
.stopped-content { display: grid; gap: clamp(12px, 2vw, 24px); max-width: 36rem; text-align: center; }
#stopped-title { font-size: clamp(1.375rem, 4vw, 3rem); text-wrap: balance; }
#stopped-note { color: var(--muted); font-size: clamp(0.875rem, 2vw, 1.0625rem); }
.stopped-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 20px; }
@media (max-width: 480px) {
  .stopped-actions { gap: 12px; }
  .stopped-actions button, .stopped-actions button.go { padding-inline: 12px; font-size: 0.8125rem; }
}
#game { display: block; width: 100%; height: 100%; outline-offset: -3px; }
#remote-video { width: 100%; height: 100%; object-fit: contain; display: block; }
#remote-video:focus-visible { outline: 3px solid var(--lime); outline-offset: -3px; }
#fps, #guest-fps { position: absolute; left: 10px; top: 10px; color: var(--night); background: var(--lime); padding: 4px 10px; border-radius: 6px; pointer-events: none; font: italic 800 13px/1.2 "Exo 2", sans-serif; font-variant-numeric: tabular-nums; }
#start-overlay, #guest-overlay, #guest-notice { position: absolute; inset: 0; display: grid; place-items: center; background: #08061acc; }
/* The native start prompt stays above the event launcher (.lx, z-index 2) and its loading cover. */
#start-overlay, #guest-overlay, #guest-notice { z-index: 3; }
/* Shown over the guest's video when the stream stops, so a dead stream is never a silent black box. */
#guest-notice p { max-width: 34ch; margin: 16px; padding: 18px 22px; border-radius: 16px; background: var(--panel); color: var(--snow); font-weight: 700; text-align: center; text-wrap: balance; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#remote-video.crisp { image-rendering: pixelated; }
/* Player pills sit at the bottom left outside the game's two-player split layout. */
.pills { position: absolute; left: 8px; bottom: 8px; display: grid; gap: 4px; justify-items: start; pointer-events: none; z-index: 1; opacity: 0.85; }
/* In the split layout, the outer corners hold the game's mph and score.
   Keep the two pills beside the divider and the FPS badge above its HUD row. */
#stage .pills:not(.pills-top):has(.pill[data-slot="2"] .pill-place) { left: 50%; display: flex; gap: clamp(12px, 2vw, 24px); transform: translateX(-50%); }
#stage:has(.pills:not(.pills-top) .pill[data-slot="2"] .pill-place) #fps { left: 50%; top: 4px; transform: translateX(-50%); padding: 2px 7px; font-size: 11px; white-space: nowrap; }
@container player-stage (max-width: 900px) {
  #stage:has(.pills:not(.pills-top) .pill[data-slot="2"] .pill-place):not(:fullscreen) { overflow: visible; margin-bottom: 130px; }
  #stage:not(:fullscreen) .pills:not(.pills-top):has(.pill[data-slot="2"] .pill-place) { left: 8px; bottom: -118px; display: grid; transform: none; }
}
/* Every pill has the same columns: face, a fixed text column (long names end
   with an ellipsis), then in a race a fixed place box and a fixed score column. */
.pill { position: relative; isolation: isolate; display: grid; grid-auto-flow: column; grid-template-columns: 2em var(--pill-text, 11.5em); align-items: center; gap: 6px; padding: 4px; border-radius: 12px; --pill-panel-radius: 8px; background: #120d2ec7; box-shadow: 2px 2px 0 var(--orange); color: var(--snow); font: 700 clamp(9px, 0.9vw, 13px)/1.15 "Exo 2", sans-serif; }
.pill::before, .pill::after { z-index: 0; pointer-events: none; }
.pill > * { position: relative; z-index: 1; }
.pill[data-slot="2"] { box-shadow: 2px 2px 0 var(--cyan); }
.pill-face { display: grid; place-items: center; width: 2em; height: 2.4em; border-radius: 5px; overflow: hidden; outline: 0; background: var(--lime); color: var(--night); font-weight: 800; }
.pill-face img { width: 100%; height: 100%; object-fit: cover; }
/* Split screen: a larger face with more room from the left edge. */
.pills:not(.pills-top) .pill { grid-template-columns: 2.6em var(--pill-text, 11.5em); }
.pills:not(.pills-top) .pill-face { width: 2.6em; height: 3em; }
/* Transparent content preserves the frame art and the existing inset. */
.pill-text { display: grid; min-width: 0; align-self: stretch; align-content: center;
  padding: 3px 5px; border-radius: var(--pill-panel-radius);
  background: none; box-shadow: none; }
.pill-line { min-width: 0; }
.pill-name, .pill-meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill-name { font-style: italic; }
.pill-meta { color: var(--muted); font-weight: 600; font-size: 0.85em; font-variant-numeric: tabular-nums; }
/* The XP badge floats over the pill's top edge, so it never resizes the pill. */
.pill-badge { position: absolute; right: 6px; top: -0.8em; padding: 1px 6px; white-space: nowrap; border-radius: 5px; background: var(--cyan); color: var(--night); font-weight: 800; font-variant-numeric: tabular-nums; animation: pill-pop 240ms var(--ease-out); }
.pill-level-up { background: var(--orange); }
@keyframes pill-pop { from { transform: scale(0.7); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pill-badge { animation: none; } }
/* Top centre; two pills wrap to two rows when the stage is too narrow for one. */
.pills.pills-top { top: 8px; bottom: auto; left: 8px; right: 8px; display: flex; flex-wrap: wrap; justify-content: center; align-items: start; gap: 8px; }
/* 8.5ch of tabular digits fits 9,999,999. */
.pill-score { width: 8.5ch; margin-left: 2px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; color: var(--snow); }
.pill-metrics { display: grid; font-weight: 800; gap: 0.35em; width: 8.5ch; margin-left: 2px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.pill-metrics .pill-score { margin-left: 0; }
.pill-speed { justify-self: end; width: 7ch; font-size: 0.9em; color: var(--snow); }
.pill-place { font-style: italic; font-weight: 800; font-variant-numeric: tabular-nums; }
#stage:fullscreen, #guest-stage:fullscreen { width: 100vw; height: 100dvh; aspect-ratio: auto; margin: 0; border-radius: 0; box-shadow: none; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.check, .volume { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--orange); }
/* Dropdowns in the toolbar (e.g. #aspect, #render-scale from the port thread). */
.toolbar label:has(+ select), .toolbar label:has(select) { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; }
select {
  font: italic 800 0.9375rem/1 "Exo 2", sans-serif; text-transform: uppercase; color: var(--snow);
  min-height: 44px; padding: 0 36px 0 14px; border: 2px solid var(--panel-2); border-radius: 10px; cursor: pointer;
  background: var(--night-deep) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2322d3ff' stroke-width='2.5'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none;
}
select:hover { border-color: var(--cyan); }
select option { text-transform: none; font-style: normal; }
input[type=range] { width: 130px; min-height: 44px; accent-color: var(--orange); }
#mock-debug { display: block; font-size: 0.875rem; overflow-wrap: anywhere; color: var(--muted); }

.link-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; width: 100%; }
:is(#online-link, #watch-link) { flex: 1 1 260px; width: 0; min-width: 0; min-height: 44px; padding: 0 12px; font: inherit; color: var(--snow); background: var(--night-deep); border: 2px solid var(--panel-2); border-radius: 10px; }
#online-status { margin: 0; color: var(--muted); }
#online-status:empty { display: none; }

/* Game-page leaderboard (client: web/leaderboard/client/leaderboard.js renders inside :is(#leaderboard, #guest-leaderboard)). */
:is(#leaderboard, #guest-leaderboard):empty { display: none; }
:is(#leaderboard, #guest-leaderboard) > div { width: 100%; }
:is(#leaderboard, #guest-leaderboard) > p:empty { display: none; }
:is(#leaderboard, #guest-leaderboard) > p:first-of-type { font-style: italic; font-weight: 800; color: var(--cyan); }
:is(#leaderboard, #guest-leaderboard) a[href] {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 24px; border-radius: 10px;
  background: var(--orange); color: var(--night); text-decoration: none;
  font: italic 900 1rem/1 "Exo 2", sans-serif; text-transform: uppercase; box-shadow: 4px 4px 0 var(--cyan);
}
:is(#leaderboard, #guest-leaderboard) button { --fill: var(--orange); --ink: var(--night); --shadow: var(--cyan); }
:is(#leaderboard, #guest-leaderboard) table { margin-top: 6px; }
:is(#leaderboard, #guest-leaderboard) caption { text-align: left; color: var(--muted); font-weight: 700; padding: 0 8px 6px; text-transform: capitalize; }
:is(#leaderboard, #guest-leaderboard) th { font-style: italic; font-weight: 800; text-transform: uppercase; font-size: 0.8125rem; color: var(--muted); }
:is(#leaderboard, #guest-leaderboard) tbody tr:nth-child(odd) { background: var(--panel-2); }
:is(#leaderboard, #guest-leaderboard) tbody tr:nth-child(1) td:first-child { color: var(--lime); font-weight: 900; }

#reinstall { justify-self: start; }
#logs summary { min-height: 44px; padding: 12px 0; cursor: pointer; font-weight: 700; color: var(--muted); }
#log { white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; max-height: 260px; margin: 0; padding: 12px; background: var(--night-deep); border-radius: 10px; font: 12px/1.5 ui-monospace, monospace; color: var(--muted); }

@media (max-width: 560px) {
  main { width: calc(100% - 24px); }
  .toolbar { gap: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  button, button::before { transition: none; }
  button:hover, button:active { transform: none; }
}

/* Short controls card. Data and markup come from the site's /controls-card.js. */
#controls-card { justify-items: stretch; gap: 16px; min-width: 0; }
.controls-card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.controls-card-head a { font-weight: 700; color: var(--cyan); }
.controls-card-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 8px 24px; margin: 0; }
.controls-card-list > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 8px 0; }
.controls-card-list dt { font-weight: 700; }
/* Group swatch before the action, the same shape as the site's drawing key (no edge stripe). */
.controls-card-list dt::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 10px; border-radius: 3px; background: var(--c, var(--snow)); vertical-align: -1px; }
.controls-card-list dd { margin: 0; display: grid; justify-items: end; gap: 2px; }
.controls-card-list .keys { display: flex; flex-wrap: wrap; justify-content: end; gap: 4px; }
.controls-card-list .pad { color: var(--muted); font-size: 0.875rem; }
.controls-card-list .g-move { --c: var(--cyan); }
.controls-card-list .g-air { --c: var(--orange); }
.controls-card-list .g-grab { --c: var(--lime); }
.controls-card-list .g-boost { --c: var(--snow); }
.controls-card-list .g-system { --c: var(--muted); }
kbd {
  display: inline-block; min-width: 2em; padding: 1px 7px; text-align: center;
  font: 700 0.8125rem/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--snow);
  background: var(--panel-2); border-radius: 6px; box-shadow: inset 0 -3px 0 #08061a99, 0 0 0 1px #f4f8ff26;
}

/* Session panel ("Ride with a friend"), the same on the host and guest pages (session-panel mockup). */
.session { justify-items: stretch; }
.session-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.session-room { font: 700 13px/1 ui-monospace, Menlo, monospace; letter-spacing: 0.08em; padding: 7px 10px; border-radius: 8px; background: var(--night-deep); color: var(--muted); }
.session-room b { color: var(--snow); }
.session-players { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.session-card { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; padding: 14px; border-radius: 12px; background: var(--panel-2); box-shadow: 4px 4px 0 var(--orange); }
.session-card.p2 { box-shadow: 4px 4px 0 var(--cyan); }
.session-card.empty { background: transparent; box-shadow: none; outline: 2px dashed #c4bde866; outline-offset: -2px; }
.session-face { position: relative; display: grid; place-items: center; grid-row: span 3; width: 44px; height: 53px; border-radius: 8px; background: var(--lime); color: var(--night); font-size: 18px; font-weight: 800; }
.session-card.p2 .session-face { background: var(--cyan); }
.session-face img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.session-face.empty-face { background: transparent; outline: 2px dashed #c4bde866; color: var(--muted); }
.session-who { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.session-who b { font: italic 900 18px/1 "Exo 2", sans-serif; }
.session-card.empty .session-who b { color: var(--muted); }
.tag { font: 800 11px/1 "Exo 2", sans-serif; text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 6px; border-radius: 5px; background: var(--night-deep); color: var(--muted); }
.tag-you { background: var(--snow); color: var(--night); }
.session-state { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px #c6ff1a33; }
.dot.warn { background: var(--orange); box-shadow: 0 0 0 3px #ff6a1333; }
.dot.off { background: transparent; box-shadow: inset 0 0 0 2px var(--muted); }
.session-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.session-stats b { color: var(--snow); font-weight: 700; }
@media (max-width: 560px) { .session-players { grid-template-columns: 1fr; } }
/* Input device icon after the player's name (pills and session cards). */
.pill-line { display: flex; align-items: center; }
.pill-dev { display: inline-grid; place-items: center; width: 1em; height: 1em; margin-left: 0.3em; color: var(--muted); flex: none; }
.pill-dev svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.session-who .pill-dev { width: 16px; height: 16px; margin-left: 0; align-self: center; }

/* Event results pop-up over the stage (also in fullscreen). */
.results { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; background: #08061a99; }
.results-card { width: min(420px, calc(100% - 32px)); display: grid; gap: 14px; padding: 18px 20px; border-radius: 14px; background: var(--panel); box-shadow: 6px 6px 0 var(--orange); color: var(--snow); }
.results-head { display: flex; align-items: center; gap: 14px; }
.results-place { font: italic 900 40px/1 "Exo 2", sans-serif; color: var(--lime); }
.results-what { display: grid; gap: 2px; }
.results-what b { font: italic 800 18px/1.15 "Exo 2", sans-serif; }
.results-what span { color: var(--muted); font-size: 14px; }
.results-what .results-credit { color: var(--cyan); font-size: 13px; font-weight: 600; }
.results-body { display: grid; gap: 8px; }
.results-xp { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.results-xp b { font: italic 900 24px/1 "Exo 2", sans-serif; color: var(--cyan); }
.results-xp span, .results-note { color: var(--muted); font-size: 14px; margin: 0; }
.results-note a { color: var(--cyan); }
.results-levelup { justify-self: start; padding: 3px 8px; border-radius: 6px; background: var(--orange); color: var(--night); font: italic 900 15px/1.2 "Exo 2", sans-serif; }
.results-bar { height: 12px; border-radius: 6px; background: var(--night-deep); overflow: hidden; }
.results-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--lime)); transition: width 900ms var(--ease-out); }
.results-labels { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.results-foot { display: flex; align-items: center; gap: 12px; }
.results-hint { color: var(--muted); font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .results-fill { transition: none; } }

/* Save tools share the toolbar and panel tokens. Status wraps on small screens. */
.save-controls { align-items: center; }
#unlock-status { color: var(--muted); max-width: 48ch; }
#save-panel .toolbar { margin: 0; }

#save-conflict { width: min(620px, calc(100% - 32px)); max-height: calc(100svh - 32px); overflow: auto; padding: 28px; border: 2px solid var(--cyan); border-radius: 16px; background: var(--panel); color: var(--snow); }
#save-conflict::backdrop { background: #08061acc; }
#save-conflict h2, #save-conflict p, #save-conflict dl { margin-bottom: 18px; }
#save-conflict dt { font-weight: 800; }
#save-conflict dd { margin: 0 0 12px; color: var(--muted); overflow-wrap: anywhere; }

.lobby-choice .check { min-height: 44px; cursor: pointer; }
.lobby-choice .check:has(:disabled) { cursor: default; }
#list-lobby-note { margin: 0 0 12px 30px; color: var(--muted); font-size: .875rem; }

/* Online menu ownership stays inside the fullscreen stage. */
.menu-notice { position: absolute; top: 42px; left: 50%; transform: translateX(-50%); z-index: 2; max-width: calc(100% - 24px); padding: 7px 12px; border-radius: 8px; background: var(--night); box-shadow: 2px 2px 0 var(--cyan); color: var(--snow); font-size: clamp(12px, 1.2vw, 16px); font-weight: 700; text-align: center; pointer-events: none; }
.text-notice { top: 82px; box-shadow: 2px 2px 0 var(--orange); }
/* Place: a full-height rounded block. Lime for 1st; dark with the player's colour otherwise. */
.pill-place { display: grid; place-items: center; width: 5.4em; height: 3.5em; margin-left: 0.8em; padding: 0; border: 2px solid var(--orange); border-radius: 6px; background: var(--panel-2); color: var(--snow); white-space: nowrap; }
.pill[data-slot="2"] .pill-place { border-color: var(--cyan); }
.pill-place strong { font-size: 1.7em; font-weight: 900; line-height: 1; }
.pill-place sup { font-size: 0.75em; margin-left: 1px; }
.pill-place small { margin-left: 3px; font-size: 0.8em; font-style: italic; color: var(--muted); }
.pill .pill-place.pill-place-first { border-color: var(--lime); background: var(--lime); color: var(--night); }
.pill-place-first small { color: #2b3a00; }
/* Boost gauge, after the in-game meter: a skewed bar and six TRICKY letters,
   one lit per Uber trick. Lime glow = the game's TRICKY state (Uber window
   open); the white line under the bar is the time left. After six Ubers the
   meter stays full and the letters burn orange for the rest of the event. */
.pill-gauge { display: flex; align-items: center; gap: 0.45em; height: 1.15em; margin-top: 0.25em; }
.pill-gauge-bar { position: relative; flex: 1; height: 0.85em; overflow: hidden; border-radius: 2px; background: var(--night-deep); box-shadow: inset 0 0 0 1px #ffffff2e; transform: skewX(var(--skew)); }
.pill-gauge-fill { position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--boost, 0)); background: linear-gradient(90deg, #1677ff, var(--cyan)); }
/* Chunky segments, like the game's meter. */
.pill-gauge-bar::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(20% - 1.5px), #08061acc calc(20% - 1.5px) 20%); }
.pill-boost-full .pill-gauge-fill { background: linear-gradient(90deg, var(--cyan), #b8f3ff); }
.pill-gauge-window { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; height: 2px; transform-origin: left; transform: scaleX(var(--window, 0)); background: var(--snow); }
.pill-letters { display: flex; gap: 1px; flex: none; }
.pill-letter { display: grid; place-items: center; width: 1.12em; height: 1.4em; border-radius: 2px; background: var(--panel-2); color: #c4bde873; font-size: 0.8em; font-style: italic; font-weight: 900; line-height: 1; transform: skewX(var(--skew)); }
.pill-letter-lit { background: var(--orange); color: var(--snow); }
.pill-tricky-active .pill-gauge-bar { box-shadow: inset 0 0 0 1px var(--lime), 0 0 6px 1px #c6ff1a8c; }
.pill-tricky-active .pill-gauge-fill { background: linear-gradient(90deg, #8fe000, var(--lime) 60%, #f3ffc4); }
.pill-tricky-active .pill-letter:not(.pill-letter-lit) { box-shadow: inset 0 0 0 1px #c6ff1a80; color: #c6ff1ab3; }
.pill-tricky-full .pill-gauge-bar { box-shadow: inset 0 0 0 1px #ffd166, 0 0 7px 1px #ff6a13a6; }
.pill-tricky-full .pill-gauge-fill { background: linear-gradient(90deg, var(--orange), #ffd166 55%, var(--lime)); }
.pill-tricky-full .pill-letter-lit { background: linear-gradient(180deg, #ffd166, var(--orange)); color: var(--night); box-shadow: 0 0 5px #ff6a1399; }
/* A light sweep while TRICKY is on; static glow only when motion is reduced. */
.pill-tricky-active .pill-gauge-bar::before, .pill-tricky-full .pill-gauge-bar::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, transparent, #ffffffa6, transparent); transform: translateX(-100%); animation: pill-shimmer 1400ms linear infinite; animation-delay: calc(var(--phase, 0ms) * -1); }
@keyframes pill-shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .pill-tricky-active .pill-gauge-bar::before, .pill-tricky-full .pill-gauge-bar::before { animation: none; opacity: 0; } }
@media (max-width: 480px) { .pills.pills-top { gap: 5px; } .pill { gap: 4px; --pill-text: 10em; } .pill-meta { max-width: 95px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }

/* B2: live quick controls, a wide party card, then the settings console. */
main { max-width: 1340px; width: calc(100% - 2 * var(--margin)); }
.quick-menu { border: 1px solid var(--panel-2); border-radius: 15px; background: var(--night-deep); box-shadow: 5px 5px 0 var(--panel-2); }
.quick-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 18px 20px; background: #141039; border-radius: 15px 15px 0 0; }
.quick-head h2 { font-size: 1.25rem; }
.live { color: var(--lime); font-size: .78rem; font-weight: 800; }
.quick-groups { display: grid; grid-template-columns: 1fr 1.25fr 1fr .8fr; }
.quick-group { min-width: 0; padding: 20px; background: #0f0b2a; border-right: 1px solid #ffffff28; }
.quick-group:nth-child(even) { background: #171039; }
.quick-group:first-child { border-radius: 0 0 0 15px; }
.quick-group:last-child { border-right: 0; border-radius: 0 0 15px 0; }
.quick-groups.host-quick-groups { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.quick-stack { min-width: 0; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-content: start; background: #0f0b2a; border-right: 1px solid #ffffff28; border-radius: 0 0 0 15px; }
.quick-stack .quick-group { background: transparent; border-radius: 0; border-bottom: 0; }
.quick-stack .quick-group:first-child { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid #ffffff28; }
.quick-stack .quick-group:last-child { border-radius: 0; }
.group-title { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.group-title h3 { margin: 0; font-size: .95rem; font-style: italic; text-transform: uppercase; color: var(--lime); }
.group-title > span { color: var(--muted); font-size: .72rem; }
.group-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.quick-group button, .page-tools button { font-size: .73rem; padding: 8px 12px; min-height: 42px; }
.quick-group button::before { border-radius: 4px; }
.quick-group button[aria-pressed=true] { --fill: var(--orange); }
.quick-group .check { display: flex; justify-content: space-between; flex-direction: row-reverse; padding: 10px; margin-top: 12px; border-radius: 8px; background: var(--panel-2); font-size: .8rem; }
.quick-group .check input { flex: none; }
.group-note, #unlock-status, #max-stats-status { display: block; color: var(--muted); font-size: .75rem; margin: 10px 0; }
.save-chip { padding: 4px 8px; background: var(--panel-2); border-radius: 5px; font-weight: 800; }
.save-chip[data-state=synced] { color: var(--lime); }
.save-chip[data-state=syncing] { color: var(--cyan); }
.save-chip[data-state=blocked], .save-chip[data-state=offline] { color: var(--orange); }
.setting-field { display: grid; min-width: 0; gap: 8px; }
.quick-group .setting-field { margin-top: 14px; }
.setting-field label { font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.setting-field label output { float: right; color: var(--muted); }
.setting-field select { width: 100%; min-width: 0; font-size: .85rem; text-transform: none; font-style: normal; }
.setting-field input[type=range] { width: 100%; }
.setting-field .help { font-size: .8rem; }
a.button-link { --fill: var(--lime); --ink: var(--night); display: inline-flex; align-items: center; text-decoration: none; }
a.button-link:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.switch-head { display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.tip { position: relative; display: inline-flex; }
button.tip-button { min-height: 0; width: 22px; height: 22px; padding: 0; font: 900 .75rem/1 "Exo 2", sans-serif; --fill: var(--panel-2); --ink: var(--cyan); --shadow: transparent; }
button.tip-button::before { border-radius: 50%; transform: none; }
[role=tooltip] { position: absolute; z-index: 5; left: 50%; bottom: calc(100% + 8px); width: max-content; max-width: min(260px, 70vw); padding: 8px 10px; border-radius: 8px; background: var(--night-deep); color: var(--snow); box-shadow: 0 0 0 2px var(--cyan); font-size: .78rem; font-weight: 600; text-transform: none; line-height: 1.35; transform: translateX(-50%); opacity: 0; visibility: hidden; transition: opacity 140ms var(--ease-out), visibility 140ms; }
.tip:hover [role=tooltip], .tip:focus-within [role=tooltip] { opacity: 1; visibility: visible; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 6px 10px 6px 14px; border-radius: 10px; background: var(--night-deep); cursor: pointer; font-size: .85rem; font-weight: 800; }
.switch-row .switch-on { display: none; }
.switch-row:has(input:checked) .switch-on { display: inline; }
.switch-row:has(input:checked) .switch-off { display: none; }
input[type=checkbox][role=switch] { appearance: none; position: relative; flex: none; width: 52px; height: 30px; margin: 0; border-radius: 999px; background: var(--panel-2); box-shadow: inset 0 0 0 2px #63588d; cursor: pointer; transition: background-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out); }
input[type=checkbox][role=switch]::before { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--snow); box-shadow: 0 2px 4px rgb(0 0 0 / .4); transition: transform 160ms var(--ease-out); }
input[type=checkbox][role=switch]:checked { background: var(--orange); box-shadow: inset 0 0 0 2px var(--orange); }
input[type=checkbox][role=switch]:checked::before { transform: translateX(22px); }
input[type=checkbox][role=switch]:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { input[type=checkbox][role=switch], input[type=checkbox][role=switch]::before, [role=tooltip] { transition: none; } }
.quick-group #dual-view-limit { color: var(--muted); font-size: .75rem; }
.eyebrow { color: var(--cyan); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.ride-card { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: center; background: linear-gradient(110deg, #3a1f8f, var(--panel) 64%); }
.ride-intro { display: grid; gap: 20px; min-width: 0; }
.ride-intro h2 { font-size: clamp(2rem, 3.4vw, 3.3rem); }
.ride-card .party-side { padding-left: 24px; border-left: 1px solid #ffffff40; display: grid; gap: 12px; justify-items: start; min-width: 0; }
.ride-card .link-row { grid-column: 1 / -1; }
.ride-card .link-row label { width: 100%; font-size: .8rem; text-transform: uppercase; font-weight: 800; }
.ride-card .session-players { margin-top: 4px; }
.ride-card .session-card { font-size: .85rem; }
.console-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; align-items: start; }
.console-grid > * { min-width: 0; }
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 0; padding: 0; min-height: 340px; justify-items: stretch; }
.settings-head { padding: 24px; border-radius: 16px 0 0 16px; display: grid; align-content: start; gap: 14px; background: var(--panel-2); }
.settings h2 { line-height: 1.05; }
.setting-nav { display: grid; gap: 8px; margin-top: 6px; }
.setting-nav button { text-align: left; padding: 10px 16px; min-height: 44px; font-size: .8rem; }
.setting-nav button::before { transform: none; box-shadow: none; border-radius: 0; }
.setting-nav button[aria-selected=true] { --fill: var(--orange); --ink: var(--night); }
.setting-body { min-width: 0; padding: 28px; }
.setting-body [role=tabpanel] { display: grid; gap: 18px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.settings-grid .check { background: var(--panel-2); border-radius: 8px; padding: 10px; }
.settings .help { font-size: .85rem; }
.settings #save-panel, .settings #controls-card { padding: 0; border-radius: 0; background: none; min-width: 0; justify-items: stretch; }
.settings #save-title, .settings #controls-card-title { font-size: 1.2rem; }
.settings #save-panel button { font-size: .78rem; padding: 10px 14px; }
.settings .toolbar { gap: 12px; }
.now { padding: 26px; gap: 14px; justify-items: stretch; }
.now h2 { line-height: 1.05; }
.now [data-now-players] { display: grid; gap: 14px; }
.now-player { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px; background: var(--panel-2); border-radius: 8px; font-size: .85rem; }
.now-face { position: relative; display: grid; place-items: center; width: 40px; height: 50px; border-radius: 5px; background: var(--orange); color: var(--night); font-weight: 800; }
.now-player + .now-player .now-face { background: var(--cyan); }
.now-face img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.now-number { position: absolute; right: -5px; bottom: -5px; display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 3px; border: 1px solid var(--muted); border-radius: 4px; background: var(--night-deep); color: var(--snow); font-size: .65rem; }
.now-player strong { display: block; overflow-wrap: anywhere; font-style: italic; }
.now-player small { display: block; color: var(--muted); }
.now-place { color: var(--lime); font-size: .75rem; font-weight: 800; white-space: nowrap; }
.now .help { font-size: .8rem; }
.page-tools { display: flex; flex-wrap: wrap; gap: 12px; }
.install-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px; width: 100%; margin-top: 14px; }
.install-choice, .install-note { display: grid; align-content: start; gap: 16px; min-width: 0; }
.install-note { background: var(--panel-2); border-radius: 12px; padding: 24px; }
.install-note h3 { margin: 0; }
button:disabled { cursor: default; opacity: .65; }
.quick-menu, .settings, .now, .ride-card { overflow-wrap: anywhere; }
@media (max-width: 1150px) {
  .quick-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-groups:not(.host-quick-groups) > .quick-group:nth-child(2) { border-right: 0; }
  .quick-groups:not(.host-quick-groups) > .quick-group:nth-child(-n+2) { border-bottom: 1px solid #ffffff28; }
  .settings { grid-template-columns: 170px minmax(0, 1fr); }
  .settings-head { padding: 20px; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .quick-groups.host-quick-groups { grid-template-columns: 1fr; }
  .quick-stack { border-right: 0; border-bottom: 1px solid #ffffff28; border-radius: 0; }
  .host-quick-groups > .quick-group { border-bottom: 0; border-radius: 0 0 15px 15px; }
  .ride-card, .console-grid, .install-grid { grid-template-columns: 1fr; }
  .ride-card .party-side { padding: 20px 0 0; border-left: 0; border-top: 1px solid #ffffff40; }
  .ride-card .link-row { grid-column: auto; }
  .now { width: 100%; }
  .now [data-now-players] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .quick-stack { grid-template-columns: 1fr; }
  .quick-stack .quick-group { border-right: 0; border-bottom: 1px solid #ffffff28; }
  .quick-groups { grid-template-columns: 1fr; }
  .quick-groups > .quick-group { border-right: 0; border-bottom: 1px solid #ffffff28; border-radius: 0; }
  .quick-groups > .quick-group:last-child { border-bottom: 0; border-radius: 0 0 15px 15px; }
  .quick-stack .quick-group:last-child { border-bottom: 0; }
  .settings { grid-template-columns: 1fr; }
  .settings-head { border-radius: 16px 16px 0 0; }
  .setting-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .setting-nav button { text-align: center; padding: 10px 4px; }
  .setting-body { padding: 20px; }
  .now [data-now-players] { grid-template-columns: 1fr; }
  #online-link { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .quick-menu button, .quick-menu button::before, .settings button, .settings button::before { transition: none; }
}
.board-shell { justify-items: stretch; }
.board-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.board-head a { color: var(--cyan); font-size: .85rem; }
.board-shell :is(#leaderboard, #guest-leaderboard) { padding: 0; border-radius: 0; background: none; }
.board-shell:has(:is(#leaderboard, #guest-leaderboard) > h2) .board-placeholder, .board-shell :is(#leaderboard, #guest-leaderboard) > h2 { display: none; }

/* The engine pause layer belongs to each stage, including browser fullscreen. */
.engine-pause {
  position: absolute; inset: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(12px, 3vh, 24px); padding: 20px; overflow: auto;
  text-align: center; background: rgb(8 6 26 / 94%); color: var(--snow);
}
.engine-pause h2 {
  font-size: clamp(2.75rem, 10vw, 7rem); line-height: 1;
  transform: skewX(-6deg); color: var(--orange); text-shadow: 3px 3px 0 var(--panel-2);
}
.engine-pause p { max-width: 100%; overflow-wrap: anywhere; }
.engine-pause-hint { color: var(--muted); }
.engine-pause button:active { transform: scale(0.96); }
@media (prefers-reduced-motion: reduce) {
  .engine-pause button, .engine-pause button::before { transition: none; }
}
@media (max-height: 450px) {
  .engine-pause { gap: 10px; padding: 12px; }
  .engine-pause h2 { font-size: 2.75rem; }
}

/* The join route works before game storage or installation is available. */
#join-form { display: grid; gap: 12px; width: min(100%, 760px); }
#join-form label { font-weight: 800; }
.join-fields { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
#join-code { flex: 1 1 240px; width: 100%; min-width: 0; min-height: 52px; padding: 12px 14px; border: 2px solid var(--muted); border-radius: 10px; font: inherit; color: var(--snow); background: var(--night-deep); }
#join-code::placeholder { color: var(--muted); opacity: 1; }
#join-error { color: var(--snow); background: #6b1030; padding: 10px 14px; border-radius: 8px; }

/* Server-confirmed trophy feedback waits for a finish or pause screen. */
.award-toast { position:absolute; inset:16px 16px auto auto; z-index:6; width:min(340px,calc(100% - 32px)); display:grid; gap:6px; padding:18px 20px; border:2px solid #d8e5ff; border-radius:12px; background:var(--night-deep); color:var(--snow); box-shadow:4px 4px 0 var(--cyan); }
.award-toast[data-tier="gold"] { border-color:#f3cd78; }
.award-toast[data-tier="bronze"] { border-color:#e2ac87; }
.award-toast[data-tier="platinum"] { border-color:var(--cyan); }
.award-label { font-size:.75rem; font-weight:800; text-transform:uppercase; color:var(--muted); }
.award-name { font-size:1.25rem; line-height:1.15; overflow-wrap:anywhere; }
.award-saved,.award-toast a { font-size:.8125rem; }
.award-toast a { display:inline-flex; align-items:center; color:var(--cyan); padding:6px 0; min-height:44px; }
@media (prefers-reduced-motion:no-preference) { .award-toast { transition:opacity 200ms ease-out; } }
@media (max-width:480px) { .award-toast { inset:12px 12px auto; width:auto; padding:12px 16px; gap:4px; } .award-name { font-size:1.0625rem; } }
/* Achievement materials compose with every rank base and remain static in play. */
.pill[data-pill-frame="ion-trail"] { outline:2px solid var(--cyan); outline-offset:1px; box-shadow:3px 3px 0 #885cff; }
.pill[data-pill-frame="1000-club"] { outline:2px solid #ffad70; outline-offset:1px; box-shadow:3px 3px 0 #873900; }
:is(.pill, .pill-profile)[data-name-effect="afterburn"] .pill-name { color:#fff; text-shadow:1px 1px 0 #833600; text-decoration:underline; text-decoration-color:#ff9b52; text-underline-offset:3px; }
:is(.pill, .pill-profile)[data-avatar-ring="night-circuit"] .pill-face::after { border:2px dashed #22d3ff; inset:1px; box-shadow:inset 0 0 0 2px #d76727, inset 0 0 0 4px #08061a; }
.pill-title { display:block; width:fit-content; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; border-radius:3px; padding:1px 4px; color:#08061a; background:#8fe6ff; font-size:10px; font-weight:800; line-height:1.3; }
:is(.pill, .pill-profile)[data-title-badge="speed-demon"] .pill-title { background:#ffb478; }

/* More achievement materials. Every frame paints its art on the absolute
   .pill-holo rim, so frames add no rows, columns, borders or padding to a pill.
   The paints are static gradients: no animation, filter or layout work. */
.pill[data-pill-frame="fresh-line"] {
  outline:2px solid #eaf2ff; outline-offset:1px;
  box-shadow:3px 3px 0 #2b1a78, -2px -2px 0 #22d3ff;
}
.pill[data-pill-frame="fresh-line"] .pill-holo {
  background:
    linear-gradient(90deg, #f4f8ff 0 62%, #22d3ff 62%) top left / 100% 3px no-repeat,
    linear-gradient(90deg, #22d3ff 0 38%, #f4f8ff 38%) bottom left / 100% 3px no-repeat,
    linear-gradient(180deg, #f4f8ff 0 100%) left / 3px 100% no-repeat,
    linear-gradient(180deg, #22d3ff 0 100%) right / 3px 100% no-repeat,
    linear-gradient(90deg, #c6ff1a 0 9px, transparent 9px calc(100% - 9px), #c6ff1a calc(100% - 9px)) top left / 100% 2px no-repeat;
}
.pill[data-pill-frame="link-rail"] {
  outline:2px solid #22d3ff; outline-offset:1px;
  box-shadow:3px 3px 0 #0c4257, -2px -2px 0 #c6ff1a;
}
.pill[data-pill-frame="link-rail"] .pill-holo {
  background:
    linear-gradient(90deg, #c6ff1a 0 10px, transparent 10px) top left / 100% 4px no-repeat,
    linear-gradient(270deg, #c6ff1a 0 10px, transparent 10px) bottom right / 100% 4px no-repeat,
    linear-gradient(90deg, #f4f8ff, #22d3ff 45%, #f4f8ff) center / 100% 1px no-repeat,
    linear-gradient(180deg, #22d3ff, #8ff5ff 50%, #22d3ff) left / 2px 100% no-repeat,
    linear-gradient(180deg, #22d3ff, #8ff5ff 50%, #22d3ff) right / 2px 100% no-repeat;
}
.pill[data-pill-frame="ten-track"] {
  outline:2px solid #c6ff1a; outline-offset:2px;
  box-shadow:0 0 0 1px #08061a, 0 0 0 3px #5d7a0c, 3px 3px 0 #2b3a00;
}
.pill[data-pill-frame="ten-track"] .pill-holo {
  background:
    repeating-linear-gradient(90deg, #c6ff1a 0 5px, #08061a 5px 8px) top left / 100% 3px no-repeat,
    repeating-linear-gradient(90deg, #c6ff1a 0 5px, #08061a 5px 8px) bottom left / 100% 3px no-repeat,
    linear-gradient(180deg, #c6ff1a, #4e6b00) left / 2px 100% no-repeat,
    linear-gradient(180deg, #4e6b00, #c6ff1a) right / 2px 100% no-repeat,
    linear-gradient(180deg, transparent 42%, #ff6a13 42% 58%, transparent 58%) center / 16px 100% no-repeat;
}
.pill[data-pill-frame="four-corners"] {
  outline:1px solid #6b58c9; outline-offset:1px;
  box-shadow:3px 3px 0 #2b1a78, 0 0 0 1px #22d3ff38;
}
.pill[data-pill-frame="four-corners"] .pill-holo {
  background:
    linear-gradient(90deg, #22d3ff 0 14px, transparent 14px) top left / 50% 3px no-repeat,
    linear-gradient(270deg, #22d3ff 0 14px, transparent 14px) top right / 50% 3px no-repeat,
    linear-gradient(90deg, #22d3ff 0 14px, transparent 14px) bottom left / 50% 3px no-repeat,
    linear-gradient(270deg, #22d3ff 0 14px, transparent 14px) bottom right / 50% 3px no-repeat,
    linear-gradient(180deg, #22d3ff 0 12px, transparent 12px) top left / 3px 50% no-repeat,
    linear-gradient(180deg, #22d3ff 0 12px, transparent 12px) bottom left / 3px 50% no-repeat,
    linear-gradient(0deg, #22d3ff 0 12px, transparent 12px) top right / 3px 50% no-repeat,
    linear-gradient(0deg, #22d3ff 0 12px, transparent 12px) bottom right / 3px 50% no-repeat,
    linear-gradient(135deg, #6b58c9, #3a2a86 45%, #6b58c9) center / 100% 1px no-repeat;
}
.pill[data-pill-frame="endurance"] {
  outline:2px solid #eaf2ff; outline-offset:2px;
  box-shadow:0 0 0 1px #08061a, 0 0 0 4px #1c1447, 3px 3px 0 #4a2600, -3px -3px 0 #ff6a1355;
}
.pill[data-pill-frame="endurance"] .pill-holo {
  background:
    linear-gradient(180deg, transparent 0 82%, #ff6a13 82% 94%, #ffb784 94%) bottom left / 100% 30% no-repeat,
    repeating-linear-gradient(90deg, #ff6a13 0 2px, transparent 2px 22px) bottom left / 100% 2px no-repeat,
    linear-gradient(90deg, #f4f8ff 0 10%, #8fd8ff 10% 50%, #f4f8ff 50% 90%, #8fd8ff 90%) top left / 100% 2px no-repeat,
    linear-gradient(180deg, #f4f8ff, #b9d6ff 55%, #f4f8ff) left / 2px 100% no-repeat,
    linear-gradient(180deg, #f4f8ff, #b9d6ff 55%, #f4f8ff) right / 2px 100% no-repeat,
    radial-gradient(circle, #f4f8ff 0 1px, transparent 1.4px) left top / 18px 12px;
}
/* Course pack trophies (P01-P05) use the site palettes (cosmetics.css) with
   the same engine geometry rules as the other rewards. Pa'hee Tide is a pass
   foil, so the game pill draws nothing for it. */
.pill[data-pill-frame="belline-frost"] {
  outline:2px solid #b7eaff; outline-offset:1px;
  box-shadow:0 0 0 5px #b7eaff33, 3px 3px 0 #2b1a78;
}
.pill[data-pill-frame="belline-frost"] .pill-holo {
  background:
    linear-gradient(115deg, #9675e6 0 24%, #b7eaff 24% 70%, #9675e6 70% 84%, #b7eaff 84%) top left / 100% 3px no-repeat,
    linear-gradient(115deg, #9675e6 0 24%, #b7eaff 24% 70%, #9675e6 70% 84%, #b7eaff 84%) bottom left / 100% 3px no-repeat,
    linear-gradient(180deg, #b7eaff, #9675e6 50%, #b7eaff) left / 2px 100% no-repeat,
    linear-gradient(180deg, #b7eaff, #9675e6 50%, #b7eaff) right / 2px 100% no-repeat;
}

/* Names keep solid fill so they stay legible over every course. The extra
   colour lives in the shadow and the rule under the name. */
:is(.pill, .pill-profile)[data-name-effect="snow-ink"] .pill-name {
  color:#dcf8ff; text-shadow:1px 1px 0 #13455e, 0 0 7px #22d3ff66;
  text-decoration:underline double #8fe9ff; text-decoration-thickness:1px; text-underline-offset:3px;
}
:is(.pill, .pill-profile)[data-name-effect="uber-mark"] .pill-name {
  color:#ffd2a6; text-shadow:1px 1px 0 #833600, 0 0 7px #ff6a1355;
  text-decoration:underline double #ff6a13; text-decoration-thickness:2px; text-underline-offset:3px;
}
:is(.pill, .pill-profile)[data-name-effect="medal-line"] .pill-name {
  color:#ffd7b8; text-shadow:1px 1px 0 #5a2f12, 0 0 6px #ffb78440;
  text-decoration:underline double #ffb784; text-decoration-thickness:1px; text-underline-offset:3px;
}
:is(.pill, .pill-profile)[data-name-effect="spark-type"] .pill-name {
  color:#8fe9ff; text-shadow:0 1px 0 #0b3c4d, 0 0 7px #22d3ff55;
  text-decoration:underline double; text-decoration-color:#22d3ff; text-underline-offset:3px;
}
:is(.pill, .pill-profile)[data-name-effect="engine-type"] .pill-name {
  color:#fff; text-shadow:1px 1px 0 #833600, 2px 2px 0 #ff6a13, 3px 3px 0 #3a1800;
  text-decoration:underline; text-decoration-color:#ff6a13; text-decoration-thickness:3px; text-underline-offset:3px;
}
:is(.pill, .pill-profile)[data-name-effect="kahuna-glow"] .pill-name {
  color:#f4f8ff; background:linear-gradient(115deg, #13455e, #3a1f3d 65%); text-shadow:0 0 6px #ff6a13aa, 1px 1px 0 #08061a;
  text-decoration:underline; text-decoration-color:#ff944d; text-decoration-thickness:2px; text-underline-offset:3px;
}

/* Rings paint inside the avatar box. Nothing extends past the face, so an
   adjacent name or metric keeps its exact box. The deployed site stylesheet
   also styles previews; these scoped resets keep the game pill's rings inside
   the face and stop any site frame animation on a non-staff gameplay frame. */
.pills .pill[data-avatar-ring] .pill-face { outline:0; border:0; box-shadow:none; }
.pills .pill:not([data-pill-frame^="staff-"]) .pill-holo::before { content:none; animation:none; }
:is(.pill, .pill-profile)[data-avatar-ring] .pill-face { position:relative; }
:is(.pill, .pill-profile)[data-avatar-ring] .pill-face::after {
  content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
}
:is(.pill, .pill-profile)[data-avatar-ring="chalk-ring"] .pill-face::after {
  background:linear-gradient(135deg, #22d3ff3d, transparent 46%);
  box-shadow:inset 0 0 0 1px #f4f8ff, inset 0 0 0 2px #22d3ff, inset 0 0 0 4px #08061a, inset 0 0 0 5px #f4f8ff;
}
:is(.pill, .pill-profile)[data-avatar-ring="twin-loop"] .pill-face::after {
  background:linear-gradient(315deg, #c6ff1a1f, transparent 45%);
  box-shadow:inset 0 0 0 1px #f4f8ff, inset 0 0 0 2px #22d3ff, inset 0 0 0 4px #08061a, inset 0 0 0 5px #c6ff1a;
}
:is(.pill, .pill-profile)[data-avatar-ring="copper-edge"] .pill-face::after {
  background:
    linear-gradient(90deg, #f4f8ff 0 5px, transparent 5px) top left / 42% 2px no-repeat,
    linear-gradient(270deg, #f4f8ff 0 5px, transparent 5px) bottom right / 42% 2px no-repeat;
  box-shadow:inset 0 0 0 2px #ffb784, inset 0 0 0 3px #08061a, inset 0 0 0 4px #ffb784;
}
:is(.pill, .pill-profile)[data-avatar-ring="spark-ring"] .pill-face::after {
  background:
    linear-gradient(#c6ff1a, #c6ff1a) top center / 8px 2px no-repeat,
    linear-gradient(#c6ff1a, #c6ff1a) bottom center / 8px 2px no-repeat,
    linear-gradient(#c6ff1a, #c6ff1a) left center / 2px 8px no-repeat,
    linear-gradient(#c6ff1a, #c6ff1a) right center / 2px 8px no-repeat;
  box-shadow:inset 0 0 0 2px #22d3ff, inset 0 0 0 4px #08061a, inset 0 0 0 5px #22d3ff;
}
:is(.pill, .pill-profile)[data-avatar-ring="club-orbit"] .pill-face::after {
  background:radial-gradient(circle at 50% 1px, #c6ff1a 0 2px, transparent 2.4px);
  border:1px dashed #22d3ff;
  inset:1px;
  box-shadow:inset 0 0 0 2px #6b58c9, inset 0 0 0 4px #08061a;
}
:is(.pill, .pill-profile)[data-avatar-ring="belline-crown"] .pill-face::after {
  background:linear-gradient(#ffe09a, #ffe09a) top center / 10px 3px no-repeat;
  box-shadow:inset 0 0 0 1px #f4f8ff, inset 0 0 0 2px #b7eaff, inset 0 0 0 4px #08061a, inset 0 0 0 5px #b7eaff;
}

/* Title badges stay solid, opaque labels. Their paints use only shadow and
   background, so every title keeps the base label's box and line height. The
   site stylesheet also draws reward previews; this scoped reset keeps the game
   label on the base box model when both stylesheets are loaded. */
.pills .pill[data-title-badge]:not([data-title-badge^="staff-"]) .pill-title {
  border:0; margin:0; padding:1px 4px; font-size:10px; font-weight:800; line-height:1.3;
  letter-spacing:normal; text-transform:none;
}
.pills .pill[data-title-badge]:not([data-title-badge^="staff-"]) .pill-title::after { content:none; }
:is(.pill, .pill-profile)[data-title-badge="finisher"] .pill-title {
  color:#f4f8ff; background:#1c1447;
  box-shadow:inset 0 0 0 1px #f4f8ff, inset 0 0 4px #22d3ff40, 2px 2px 0 #22d3ff;
}
:is(.pill, .pill-profile)[data-title-badge="first-uber"] .pill-title {
  color:#2a0f00; background:#ffd2a6;
  box-shadow:inset 0 0 0 1px #ff6a13, 2px 2px 0 #6b2a00;
}
:is(.pill, .pill-profile)[data-title-badge="connected"] .pill-title {
  color:#062a33; background:#22d3ff;
  background-image:
    radial-gradient(circle at 2.5px 35%, #c6ff1a 0 1.1px, transparent 1.5px),
    radial-gradient(circle at 2.5px 65%, #c6ff1a 0 1.1px, transparent 1.5px);
  box-shadow:inset 0 0 0 1px #c6ff1a, 2px 2px 0 #0b4d63;
}
:is(.pill, .pill-profile)[data-title-badge="ten-down"] .pill-title {
  color:#1c2b00; background:#c6ff1a;
  box-shadow:inset 0 0 0 1px #2b3a00, inset 0 0 0 2px #7ea300, 2px 2px 0 #41560a;
}
:is(.pill, .pill-profile)[data-title-badge="hundred-rider"] .pill-title {
  color:#120d2e; background:#f4f8ff;
  box-shadow:0 0 0 2px #ff6a13, 2px 2px 0 #20516e;
}
:is(.pill, .pill-profile)[data-title-badge="off-the-map"] .pill-title {
  color:#c6ff1a; background:#142d43;
  background-image:repeating-linear-gradient(115deg, #142d43 0 7px, #18384d 7px 8px);
  box-shadow:inset 0 0 0 1px #22d3ff, 2px 2px 0 #0b4d63;
}

/* Text-only titles preserve the badge box and all reward geometry. */
.pill[data-title-badge]:not([data-title-badge^="staff-"]) .pill-text > .pill-title {
  color: #ffe0b5; background: none; border-radius: 999px; box-shadow: none;
}

/* Shared confirmations use the club button shape, including JS-set labels. */
.club-confirm {
  width: min(560px, calc(100% - 32px)); max-height: calc(100svh - 32px); overflow: auto;
  padding: clamp(24px, 4vw, 36px); border: 2px solid var(--cyan); border-radius: 16px;
  background: var(--panel); color: var(--snow); font: inherit;
}
.club-confirm::backdrop { background: #08061ae6; }
.club-confirm h2 { margin-bottom: 20px; line-height: 1.1; }
.club-confirm p { color: var(--muted); margin-bottom: 28px; }
.club-confirm .toolbar { gap: 16px; padding: 0 5px 6px; }
.club-confirm button { padding: 14px 20px; line-height: 1.2; }
.club-confirm button.go { font-size: .9375rem; }
.play-onboarding { border: 2px solid var(--cyan); scroll-margin-top: 20px; }
.play-onboarding h2 { line-height: 1.1; }
.play-step { color: var(--lime); font-weight: 700; }
#play-mode-form { display: grid; gap: 20px; width: 100%; }
#play-mode-form fieldset { display: grid; gap: 14px; padding: 0; border: 0; margin: 0; min-width: 0; }
.play-choice { display: flex; align-items: flex-start; gap: 14px; padding: 20px; border: 2px solid var(--panel-2); border-radius: 10px; background: var(--night); cursor: pointer; }
.play-choice:has(:checked) { border-color: var(--lime); }
.play-choice input { margin: 5px 0 0; accent-color: var(--lime); flex: none; width: 18px; height: 18px; }
.play-choice strong { display: block; font-size: 1.125rem; margin-bottom: 4px; }
.play-choice span span { color: var(--muted); }
.play-mode-control { display: grid; gap: 10px; margin: 4px 0 14px; }
.play-mode-control strong { color: var(--lime); }
.play-mode-control button { justify-self: start; }
@media (max-width: 480px) {
  .club-confirm .toolbar { display: grid; }
  .club-confirm button { width: 100%; }
  .play-choice { padding: 16px; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .club-confirm button, .club-confirm button::before { transition: none; }
  .club-confirm button:hover, .club-confirm button:active { transform: none; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Staff role palettes and base patterns. Holographic layers follow below. */
[data-pill-frame="staff-owner-pill-frame"], [data-pass-foil="staff-owner-pass-foil"],
[data-name-effect="staff-owner-name-effect"], [data-avatar-ring="staff-owner-avatar-ring"],
[data-title-badge="staff-owner-title-badge"] { --staff-metal: #ffe0b5; --staff-accent: #ff944d; --staff-dark: #59311d; }
[data-pill-frame="staff-dev-pill-frame"], [data-pass-foil="staff-dev-pass-foil"],
[data-name-effect="staff-dev-name-effect"], [data-avatar-ring="staff-dev-avatar-ring"],
[data-title-badge="staff-dev-title-badge"] { --staff-metal: #c7faff; --staff-accent: #22d3ff; --staff-dark: #164650; }
.pill[data-pill-style="pill-staff-owner"], .pass[data-pass-background="pass-staff-owner"] {
  --cosmetic-accent: #ff944d;
  --cosmetic-base: #110d20;
  --cosmetic-art: linear-gradient(145deg, transparent 35%, #ffe0b5 35% 35.5%, #ff6a13 35.5% 38%, transparent 38% 65%, #ffe0b5 65% 65.5%, transparent 65.5%), repeating-linear-gradient(135deg, #ffffff05 0 1px, transparent 1px 8px), radial-gradient(ellipse at 100% 0, #75462f, transparent 65%);
}
.pill[data-pill-style="pill-staff-dev"], .pass[data-pass-background="pass-staff-dev"] {
  --cosmetic-accent: #22d3ff;
  --cosmetic-base: #0a1427;
  --cosmetic-art: linear-gradient(145deg, transparent 35%, #c7faff 35% 35.5%, #22d3ff 35.5% 38%, transparent 38% 65%, #c6ff1a 65% 65.5%, transparent 65.5%), repeating-linear-gradient(0deg, #22d3ff0a 0 1px, transparent 1px 7px), radial-gradient(ellipse at 100% 0, #184c60, transparent 65%);
}
.pill[data-pill-frame^="staff-"] {
  outline: 1px solid var(--staff-metal); outline-offset: 2px;
  box-shadow: 4px 4px 0 var(--staff-dark), 0 0 0 1px #08061a;
}
.pill[data-pill-frame^="staff-"]::before {
  content: ""; position: absolute; inset: 3px; border-radius: inherit;
  border-top: 2px solid var(--staff-metal); clip-path: polygon(0 0, 26% 0, 20% 20%, 0 20%);
  pointer-events: none;
}
[data-name-effect^="staff-"] :is(.pill-name, [data-handle], [data-username], [data-rider-title]) {
  color: var(--staff-metal); text-shadow: 1px 1px 0 #08061a;
  text-decoration: underline double var(--staff-accent); text-underline-offset: 4px;
}
[data-avatar-ring^="staff-"] > img,
[data-avatar-ring^="staff-"] :is(.pill-face, .pass-photo, [data-rider-subtitle] img) {
  outline: 2px solid var(--staff-metal); outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--staff-dark), 3px 3px 0 5px var(--staff-accent);
}
[data-title-badge^="staff-"] :is(.reward-title, .pill-title) {
  color: #100d20; background: linear-gradient(115deg, var(--staff-metal), #f4f8ff 45%, var(--staff-accent));
  border: 1px solid var(--staff-metal); border-radius: 3px;
  box-shadow: 2px 2px 0 var(--staff-dark); letter-spacing: .12em; text-transform: uppercase;
  font-weight: 900;
}

/* Lewis requested full holographic materials, including gradient signatures. */
@property --staff-holo-angle { syntax: '<angle>'; inherits: true; initial-value: 125deg; }
[data-pill-frame^="staff-"], [data-pass-foil^="staff-"], [data-name-effect^="staff-"],
[data-avatar-ring^="staff-"], [data-title-badge^="staff-"] {
  --holo-colors: #ffb3ed, #bcb5ff, #8ff5ff, #ceff9a, #fff3aa, #ffc08f, #ffb3ed;
  --holo-glow: #ff9bd66b;
}
[data-pill-frame="staff-dev-pill-frame"], [data-pass-foil="staff-dev-pass-foil"],
[data-name-effect="staff-dev-name-effect"], [data-avatar-ring="staff-dev-avatar-ring"],
[data-title-badge="staff-dev-title-badge"] {
  --holo-colors: #93faff, #b3c8ff, #d7b8ff, #a4ffdf, #dcff92, #93faff;
  --holo-glow: #43e8ff70;
}
.pass[data-pass-foil^="staff-"] {
  --staff-holo-angle: 125deg;
  background: #16122e;
  box-shadow: 0 0 22px var(--holo-glow);
  animation: staff-holo-angle 9s linear infinite;
  transform: perspective(1000px) rotateX(var(--holo-tilt-x, 0deg)) rotateY(var(--holo-tilt-y, 0deg));
  transition: transform 160ms ease-out;
}
.pass[data-pass-foil^="staff-"]::after {
  inset: 0; width: auto; opacity: 1; z-index: -2;
  background:
    repeating-linear-gradient(118deg, #ffffff00 0 3px, #ffffff40 3px 4px, #08061a18 4px 5px),
    radial-gradient(circle, #fff 0 .65px, #fff0 1.3px) 3px 7px / 23px 29px,
    radial-gradient(circle, #fff9 0 .6px, #fff0 1.4px) 13px 19px / 41px 37px,
    conic-gradient(from calc(var(--staff-holo-angle) + var(--holo-pointer-angle, 0deg)) at 48% 42%, var(--holo-colors));
  animation: none; transform: none;
}
.staff-holo-sweep { display: none; }
.pass[data-pass-foil^="staff-"] > .staff-holo-sweep {
  display: block; position: absolute; inset: -30% -100%; z-index: -1; pointer-events: none;
  background: linear-gradient(112deg, transparent 35%, #ffffff20 43%, #ffffffe6 48%, #ffffff20 53%, transparent 61%);
  animation: staff-holo-sweep 3.2s ease-in-out infinite;
}
.pass[data-pass-foil^="staff-"] :is(.pass-id, .pass-stats, .pass-band) { background: #100c29; }
.pass[data-pass-foil^="staff-"] .pass-band { border-bottom-color: #e5dfff; }
.pass[data-pass-foil^="staff-"] .pass-id { border-color: #c8bfff7a; }
.pass[data-pass-foil^="staff-"] .pass-stats { border-color: #c8bfff7a; }
.pass[data-pass-foil^="staff-"] .pass-foot { border-top-color: #e5dfff; }
[data-name-effect^="staff-"] :is(.pill-name, [data-handle], [data-username], [data-rider-title]) {
  color: #d9faff; background: linear-gradient(110deg, var(--holo-colors)); background-size: 240% 100%;
  background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 0; text-shadow: none; text-decoration: none;
  animation: staff-holo-signature 4s ease-in-out infinite alternate;
}
[data-avatar-ring^="staff-"] :is(.pass-photo, .pill-face),
[data-avatar-ring^="staff-"] > img, [data-avatar-ring^="staff-"] [data-rider-subtitle] img {
  --staff-holo-angle: 125deg;
  border: 3px solid transparent; outline: 1px solid #f4f8ff9e; outline-offset: 1px;
  background: conic-gradient(from var(--staff-holo-angle), var(--holo-colors)) border-box;
  box-shadow: 0 0 13px var(--holo-glow), 0 0 0 1px #120d2e;
  animation: staff-holo-angle 4s linear infinite;
}
[data-title-badge^="staff-"] :is(.reward-title, .pill-title) {
  color: #100c29; border-color: #f4f8ff; text-shadow: none;
  padding: 0 3px; font-size: 8px; line-height: 1.2; letter-spacing: .06em;
  background: linear-gradient(115deg, var(--holo-colors)); background-size: 250% 100%;
  box-shadow: 0 0 10px var(--holo-glow), 2px 2px 0 #100c29;
  animation: staff-holo-signature 4s ease-in-out infinite alternate;
}
.pill[data-pill-frame^="staff-"] {
  isolation: isolate; outline: 1px solid #f4f8ff99; outline-offset: 2px;
  box-shadow: 0 0 13px var(--holo-glow), 3px 3px 0 #08061a;
}
.pill[data-pill-frame^="staff-"]::before { content: none; }
.pill-holo {
  position: absolute; inset: -2px; z-index: -1; border-radius: inherit; overflow: hidden; pointer-events: none;
  /* Paint only the rim. Never add another art panel behind the pill content. */
  padding: 3px;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.pill[data-pill-frame^="staff-"] .pill-holo::before {
  content: ''; position: absolute; width: 125%; aspect-ratio: 1; left: 50%; top: 50%;
  background: conic-gradient(var(--holo-colors));
  animation: staff-holo-border 4s linear infinite;
}
.pill-holo::after {
  content: none;
}
/* Staff materials preserve all normal pill boxes, including avatar image bounds. */
.pill[data-pill-style="pill-staff-owner"], .pill[data-pill-style="pill-staff-dev"] {
  --cosmetic-art: none; --cosmetic-base: #120d2e;
}
.pill[data-avatar-ring^="staff-"] .pill-face { position: relative; border: 0; outline: 0; box-shadow: none; }
.pill[data-avatar-ring^="staff-"] .pill-face::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  padding: 2px; background: conic-gradient(var(--holo-colors));
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude; pointer-events: none;
}
/* A gameplay pill has one animated gradient. Its text, ring and badge stay still. */
.pills .pill[data-name-effect^="staff-"] .pill-name,
.pills .pill[data-avatar-ring^="staff-"] .pill-face,
.pills .pill[data-title-badge^="staff-"] .pill-title {
  animation: none; background-position: 50% 50%;
}
@keyframes staff-holo-angle { to { --staff-holo-angle: 485deg; } }
@keyframes staff-holo-signature { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@keyframes staff-holo-sweep {
  0%, 12% { transform: translateX(-30%); opacity: 0; }
  20% { opacity: .85; }
  65% { opacity: .85; }
  85%, 100% { transform: translateX(30%); opacity: 0; }
}
@keyframes staff-holo-border { from { transform: translate(-50%, -50%) rotate(0turn); } to { transform: translate(-50%, -50%) rotate(1turn); } }
@media (prefers-reduced-motion: reduce) {
  .pass[data-pass-foil^="staff-"],
  [data-name-effect^="staff-"] :is(.pill-name, [data-handle], [data-username], [data-rider-title]),
  [data-avatar-ring^="staff-"] :is(.pass-photo, .pill-face), [data-avatar-ring^="staff-"] > img,
  [data-avatar-ring^="staff-"] [data-rider-subtitle] img,
  [data-title-badge^="staff-"] :is(.reward-title, .pill-title),
  .pass[data-pass-foil^="staff-"] > .staff-holo-sweep, .pill-holo::before {
    animation: none; transition: none; --staff-holo-angle: 125deg; background-position: 50% 50%;
  }
  .pass[data-pass-foil^="staff-"] { transform: none; }
  .pass[data-pass-foil^="staff-"] > .staff-holo-sweep { transform: none; opacity: .25; }
  .pill-holo::before { transform: translate(-50%, -50%) rotate(.15turn); }
}

/* Keep glyph edges consistent with the site cosmetics.css. A static dark glyph edge works over both snow and vivid rank art. Paint
   stroke before fill to preserve small glyphs; no layout or motion changes. */
.pill .pill-text :is(.pill-meta, .pill-dev, .pill-title, .reward-title, .pill-letter) {
  -webkit-text-stroke: 2px #08061a; paint-order: stroke fill;
  text-shadow: 0 1px 0 #08061a;
}
.pill .pill-text .pill-name {
  -webkit-text-stroke: 2px #08061a; paint-order: stroke fill; background: none;
}
/* Chromium paints a clipped gradient below its text stroke. Keep the staff
   gradient as a fine signature underline, with readable solid glyphs. */
.pill[data-name-effect^="staff-"] .pill-text .pill-name {
  color: #d9faff; -webkit-text-fill-color: currentColor;
  background: linear-gradient(110deg, var(--holo-colors)) left bottom / 100% 1px no-repeat;
  background-clip: border-box; -webkit-background-clip: border-box;
  text-shadow: 0 1px 0 #08061a; animation: none;
}
.pill .pill-text :is(.pill-meta, .pill-dev) { color: #f4f8ff; }
.pill[data-title-badge] .pill-text > :is(.pill-title, .reward-title) {
  color: #ffe0b5; background: none; border-color: transparent; box-shadow: none;
  animation: none;
}
.pill .pill-text .pill-letter { color: #c4bde8; background: none; box-shadow: none; }
.pill .pill-text .pill-letter-lit { color: #ffd166; box-shadow: inset 0 -2px 0 #ffd166, inset 0 -3px 0 #08061a; }
.pill.pill-tricky-active .pill-text .pill-letter:not(.pill-letter-lit) { color: #c6ff1a; }
.pill.pill-tricky-full .pill-text .pill-letter-lit { box-shadow: inset 0 -2px 0 #ffd166, inset 0 -3px 0 #08061a, inset 0 -5px 0 #ffd166; }

#guest-leaderboard tr[aria-current="true"] { outline: 2px solid var(--cyan); outline-offset: -2px; }
/* End-event choices remain inside the fullscreen game stage. */
.end-event { position:absolute; inset:0; z-index:12; display:flex; align-items:center; justify-content:center; background:var(--night-deep); padding:clamp(8px,2vw,24px); overflow:auto; }
.end-event:focus { outline:none; }
.end-event-card { width:min(960px,100%); max-height:100%; overflow:auto; padding:clamp(16px,3vw,32px); background:var(--night); border:2px solid var(--cyan); border-radius:12px; }
.end-event-head { margin-bottom:16px; }
.end-event-head h2 { color:var(--snow); font-style:italic; font-size:clamp(24px,3vw,38px); line-height:1.15; }
.end-event-head p,.end-event-hint { color:var(--muted); }
.end-event-columns { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1fr); gap:24px; margin:16px 0; }
.end-event h3 { margin:0 0 8px; font-size:20px; }

/* Result receipts lead with the club identity, then the event numbers. */
.end-event-players { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; padding:12px 0; border-block:1px solid var(--panel-2); }
.end-event-player { display:grid; gap:10px; min-width:0; padding:12px; border:1px solid var(--panel-2); border-radius:8px; background:var(--panel); }
.end-event-profile { position:relative; display:grid; grid-auto-flow:column; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:10px; min-width:0; }
.end-event-profile .pill-face { width:48px; height:56px; border-radius:6px; font-size:17px; flex:none; }
.end-event-profile .pill-text { display:grid; gap:2px; min-width:0; }
.end-event-profile .pill-name { white-space:normal; overflow-wrap:anywhere; font-size:16px; line-height:1.2; }
.end-event-profile .pill-meta { white-space:normal; overflow-wrap:anywhere; font-size:13px; }
.end-event-profile .pill-title { max-width:100%; font-size:11px; }
.end-event-profile, .end-event-profile * { animation:none !important; transition:none !important; filter:none; }
.end-event-stats { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 12px; font-variant-numeric:tabular-nums; }
.end-event-result { color:var(--snow); font-weight:700; }
.end-event-xp { color:var(--lime); font-size:13px; }

.end-event-board { overflow:auto; margin:8px 0; }
.end-event table { width:100%; border-collapse:collapse; text-align:left; font-variant-numeric:tabular-nums; font-size:14px; }
.end-event caption { text-align:left; color:var(--muted); padding:4px 0; }
.end-event th,.end-event td { padding:8px 6px; border-bottom:1px solid var(--panel-2); overflow-wrap:anywhere; }
.end-event td:last-child { white-space:nowrap; }
/* Rank column: as narrow as its number, inset from the row edge, close to the rider name (Lewis, 2026-10-21). */
.end-event-board :is(th, td):first-child, .lx-board-box :is(th, td):first-child { width:1%; white-space:nowrap; padding-left:15px; padding-right:12px; }
.end-event-own { background:var(--panel-2); color:var(--lime); }
/* Podium rows: ranks 1–3 on club boards. A slow sheen crosses a metal tint. */
tr[data-podium] { --podium:#ffb81c; --podium-sheen:#fff3c4;
  background:
    linear-gradient(105deg, transparent 38%, color-mix(in oklab, var(--podium-sheen) 40%, transparent) 50%, transparent 62%) 100% 0 / 250% 100% no-repeat,
    linear-gradient(90deg, color-mix(in srgb, var(--podium) 50%, var(--panel)), color-mix(in srgb, var(--podium) 16%, var(--panel)));
  animation:podium-sheen 4.5s ease-in-out var(--podium-delay, 0s) infinite; }
tr[data-podium="silver"] { --podium:#c9d3e3; --podium-sheen:#ffffff; --podium-delay:0.35s; }
tr[data-podium="bronze"] { --podium:#e07a33; --podium-sheen:#ffd6b8; --podium-delay:0.7s; }
tr[data-podium] > td:first-child { color:var(--podium-sheen); text-shadow:0 1px 0 #08061a, 0 0 6px #08061a; font-weight:900; }
@keyframes podium-sheen { to { background-position:0% 0, 0 0; } }
@media (prefers-reduced-motion: reduce) { tr[data-podium] { animation:none; } }
.end-event button { min-height:44px; max-width:100%; font:inherit; }
.end-event-choices { display:flex; flex-direction:column; gap:10px; }
.end-event-status { color:var(--lime); min-height:24px; margin-bottom:8px; }
.end-event-share { display:grid; grid-template-columns:minmax(0,260px) minmax(0,1fr); grid-template-areas:"title title" "preview body"; gap:8px 20px; margin:0 0 16px; padding-top:16px; border-top:1px solid var(--panel-2); }
.end-event-share h3 { grid-area:title; }
.end-event-share-preview { grid-area:preview; display:block; width:100%; max-height:200px; background:var(--night-deep); border-radius:8px; outline:1px solid oklch(1 0 0 / 0.1); outline-offset:-1px; }
.end-event-share-body { grid-area:body; display:grid; align-content:start; gap:10px; min-width:0; }
.end-event-share-info { color:var(--snow); font-weight:700; font-variant-numeric:tabular-nums; min-height:24px; }
.end-event-share-actions { display:flex; flex-wrap:wrap; gap:10px; }
.end-event .end-event-share-download { --fill:var(--lime); --ink:var(--night); }
.end-event-share .end-event-hint { margin-top:0; }
@media(max-width:640px) { .end-event-share { grid-template-columns:1fr; grid-template-areas:"title" "preview" "body"; } }
.end-event-hint { font-size:13px; margin-top:8px; }

/* Course picker: the game's confirmed list, as artwork cards. */
.end-event-picker { display:grid; gap:14px; margin:16px 0; }
.end-event-picker h3 { margin:0; }
.end-event-courses { display:grid; grid-template-columns:repeat(auto-fit,minmax(145px,1fr)); gap:12px; }
.end-event-course { position:relative; display:grid; grid-template-rows:auto auto auto; align-content:start; gap:6px; min-width:0; padding:0 0 10px; overflow:hidden; background:var(--panel); color:var(--snow); border:2px solid var(--panel-2); border-radius:10px; text-align:left; text-transform:none; font:600 14px/1.25 "Exo 2", system-ui, sans-serif; font-style:normal; transition:transform 140ms var(--ease-out), border-color 140ms ease, background-color 140ms ease; }
.end-event .end-event-course::before { display:none; }
.end-event-course.is-current { border-color:var(--lime); }
.end-event-course.is-readonly { cursor:default; }
.end-event-course:disabled { cursor:not-allowed; opacity:1; color:var(--muted); border-color:#3a2f6e; background:#171033; }
.end-event-course-shot { position:relative; display:block; aspect-ratio:16/9; overflow:hidden; background:var(--night-deep); }
.end-event-course-shot img { display:block; width:100%; height:100%; object-fit:cover; outline:1px solid oklch(1 0 0 / 0.1); outline-offset:-1px; }
.end-event-course.is-unavailable .end-event-course-shot img { filter:grayscale(1) brightness(0.55); }
.end-event-course-lock { position:absolute; inset:0; display:grid; place-items:center; font-size:22px; line-height:1; background:rgb(8 6 26 / 62%); }
.end-event-course-name { padding:0 10px; font-weight:700; font-size:14px; overflow-wrap:anywhere; }
.end-event-course-state { padding:0 10px; color:var(--muted); font-size:11px; font-weight:700; letter-spacing:0.04em; text-transform:uppercase; }
.end-event-course.is-current .end-event-course-state { color:var(--lime); }
@media (hover:hover) and (pointer:fine) {
  .end-event-course:not(:disabled):hover { border-color:var(--cyan); background:var(--panel-2); }
}
.end-event-course:not(:disabled):active { transform:scale(0.96); }
.end-event-picker-actions { display:flex; justify-content:flex-start; }

/* Programmatic gamepad focus must fill the control, not just outline it. */
.end-event button:focus { outline:3px solid var(--lime); outline-offset:3px; --fill:var(--lime); --ink:var(--night); }
.end-event button.go:focus { --fill:var(--cyan); --ink:var(--night); }
.end-event-course:focus { background:var(--panel-2); border-color:var(--lime); }
.end-event-course:focus .end-event-course-state { color:var(--lime); }

.engine-is-paused .end-event { visibility:hidden; }
@media(max-width:640px) { .end-event { align-items:flex-start; } .end-event-columns { grid-template-columns:1fr; gap:20px; } .end-event-card { border-radius:8px; } }
@media(max-width:480px) {
  .end-event { padding:6px; }
  .end-event-card { padding:14px; }
  .end-event-players { grid-template-columns:1fr; }
  .end-event-courses { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .end-event-course-name { font-size:13px; }
}
@media(max-width:340px) { .end-event-courses { grid-template-columns:1fr; } }
@media(prefers-reduced-motion:reduce) { .end-event *, .end-event *::before { animation:none; transition:none; } }
.end-event-fallback { position:absolute; inset:8px 8px auto; z-index:13; padding:8px 12px; background:var(--night-deep); color:var(--lime); border:1px solid var(--cyan); border-radius:6px; pointer-events:none; font-size:14px; }

/* End-event course loading and safe artwork fallback. */
.end-event-course-placeholder { position:absolute; inset:0; display:grid; place-items:center; padding:12px; color:#fff; text-align:center; font-weight:700; }
.end-event-course-shot img { position:relative; }
.end-event-course-shot img[hidden] { display:none; }
.end-event-course.is-selected:disabled { border-color:var(--cyan); background:var(--panel-2); color:var(--snow); box-shadow:0 0 0 2px var(--cyan); }
.end-event-course.is-selected .end-event-course-state { color:var(--cyan); }
.end-event-progress { display:block; width:100%; height:6px; margin:8px 0 16px; accent-color:var(--lime); }
.end-event-progress[hidden] { display:none; }
/* Indeterminate: a lime segment sweeps across while the overlay waits for the game. */
.end-event-progress:indeterminate { appearance:none; border:0; border-radius:3px;
  background:linear-gradient(90deg, transparent 30%, var(--lime) 30% 55%, transparent 55%) 100% 0 / 250% 100% no-repeat, var(--panel-2);
  animation:end-event-indeterminate 1.1s linear infinite; }
.end-event-progress:indeterminate::-webkit-progress-bar { background:transparent; }
@keyframes end-event-indeterminate { to { background-position:0% 0, 0 0; } }
@media (prefers-reduced-motion: reduce) { .end-event-progress:indeterminate { animation:none; background-position:50% 0, 0 0; } }

/* Ready controls use the existing club profile, focus ring, and reduced-motion rules. */
.end-event-player > button { margin-top: 12px; width: 100%; min-height: 44px; }
/* Ready state reads at a glance: orange = not ready yet, green = ready. Focus keeps the state colour. */
.end-event-player > button, .end-event-player > button:focus { --fill: var(--orange); --ink: var(--night); }
.end-event-player > button.is-ready, .end-event-player > button.is-ready:focus { --fill: #35d07f; --ink: var(--night); }
.end-event-ready-recovery { display: flex; flex-wrap: wrap; gap: 10px; margin-block: 12px; }
.end-event-ready-recovery button { min-height: 44px; }
.end-event-ready-recovery[hidden], .end-event-ready[hidden] { display: none; }



/* Transparent race layout. Keep this block identical in both renderers.
   The three rows share fixed columns across every rank and reward material. */
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] {
  grid-template-columns: 2.5em 8.8em 11.8em 4.4em;
  grid-template-rows: 1.3em 1.2em 1.5em;
  grid-auto-flow: row; gap: 0 0.4em; padding: 4px 4px 4px 0.6em;
}
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] .pill-text { display: contents; }
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] .pill-face { grid-column: 1; grid-row: 1 / 4; justify-self: start; width: 2em; height: 2.8em; }
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] .pill-line { grid-column: 2; grid-row: 1; min-width: 0; }
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] .pill-meta { grid-column: 2; grid-row: 2; max-width: none; }
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] :is(.pill-title, .reward-title) {
  grid-column: 2; grid-row: 3; align-self: center; width: 100%; min-width: 0;
  margin: 0; padding: 0; border: 0; border-radius: 0; font-size: 10px; line-height: 1.3;
  font-weight: 800; letter-spacing: normal; text-transform: none;
  color: #ffe0b5; background: none; box-shadow: none; animation: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] :is(.pill-title, .reward-title)::after { content: none; }
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] .pill-gauge {
  grid-column: 3; grid-row: 1 / 3; display: flex; flex-direction: column-reverse;
  justify-content: center; align-items: stretch; gap: 0.1em; height: auto; margin: 0;
}
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] .pill-letters { display: flex; justify-content: space-between; gap: 2px; }
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] .pill-letter {
  display: grid; place-items: center; box-sizing: border-box; flex: 1; width: auto;
  height: 1.25em; padding: 0; border: 1px solid #c4bde8; border-radius: 2px;
  font-size: 1.15em; font-style: italic; font-weight: 900; line-height: 1;
  color: #c4bde8; background: none; box-shadow: none; transform: skewX(-12deg);
}
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] .pill-letter-lit {
  color: #ffd166; border-color: #ffd166; box-shadow: inset 0 -2px 0 #ffd166;
}
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style].pill-tricky-active .pill-letter:not(.pill-letter-lit) { color: #c6ff1a; border-color: #c6ff1a; }
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style].pill-tricky-full .pill-letter-lit { box-shadow: inset 0 -3px 0 #ffd166; }
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] .pill-gauge-bar {
  flex: none; height: 0.85em; border-radius: 2px; background: none;
  box-shadow: inset 0 0 0 1px #f4f8ff, 0 0 0 1px #08061a;
}
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] .pill-gauge-bar::after { content: none; }
/* Confine the existing sweep to the fill. The empty track stays transparent. */
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] .pill-gauge-bar::before {
  right: calc((1 - var(--boost, 0)) * 100%);
}
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] .pill-metrics {
  grid-column: 3; grid-row: 3; display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.4em; width: auto; margin: 0; padding: 0; border: 0;
  background: none; box-shadow: none; font-size: 1.25em; line-height: 1.15;
}
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] :is(.pill-score, .pill-speed) { width: auto; margin: 0; font-size: 1em; font-weight: 800; }
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] .pill-place {
  grid-column: 4; grid-row: 1 / 4; width: auto; height: auto; margin: 0; padding: 0;
  border: 0; background: none; box-shadow: none; color: #f4f8ff;
}
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] .pill-place strong { font-size: 2em; font-weight: 900; line-height: 1; }
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] .pill-place sup { margin-left: 0; font-size: 0.8em; }
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] .pill-place small { margin-left: 1px; font-size: 0.95em; color: #f4f8ff; }
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] .pill-place-first { color: #c6ff1a; }
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] :is(.pill-place, .pill-score, .pill-speed, .pill-badge) {
  -webkit-text-stroke: 2px #08061a; paint-order: stroke fill; text-shadow: 0 1px 0 #08061a;
}
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] .pill-badge { background: none; box-shadow: none; color: #b5f6ff; }
/* Without race telemetry, keep the compact identity layout. */
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style]:not(:has(.pill-place)) { grid-template-columns: 2em var(--pill-text, 11.5em); grid-template-rows: auto; }
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style]:not(:has(.pill-place)) .pill-text { display: grid; grid-template-columns: minmax(0, 1fr); padding: 3px 5px; }
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style]:not(:has(.pill-place)) :is(.pill-line, .pill-meta, .pill-title, .reward-title) { grid-column: 1; grid-row: auto; }
/* Small site samples fit their own containers, independent of viewport size. */
.style-preview { container-type: inline-size; }
.style-preview .pill[data-pill-style][data-pill-style] { grid-template-columns: 2.5em minmax(0, 1fr) 11.8em 4.4em; }
@container (max-width: 350px) {
  .style-preview .pill[data-pill-style][data-pill-style] { font-size: 10px; }
}
@container (max-width: 290px) {
  .style-preview .pill[data-pill-style][data-pill-style] { font-size: 9px; }
}

/* Lewis 2026-10-20: TRICKY letters glow purple; the race place glows orange. Same geometry. */
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] .pill-letter { position: relative; color: #a8a6b6; border-color: #7f63c4; }
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] .pill-letter-lit {
  color: #c46bff; border: 2px solid #c77dff;
  text-shadow: 0 0 4px #b04dff, 0 0 9px #8a2be2;
  box-shadow: 0 0 6px #b04dffa6, inset 0 0 4px #b04dff73, inset 0 -2px 0 #c77dff;
}
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style].pill-tricky-full .pill-letter-lit {
  box-shadow: 0 0 9px #c77dffcc, inset 0 0 6px #b04dff99, inset 0 -3px 0 #e2b8ff;
}
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] :is(.pill-place, .pill-place-first) { color: #ffa24d; }
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] :is(.pill-place, .pill-place-first) :is(small) { color: #ffc28a; }
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] .pill-place {
  text-shadow: 0 1px 0 #08061a, 0 0 6px #ff6a13, 0 0 14px #ff6a13b3;
}
:is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] .pill-letter-lit::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 10px #c77dff, 0 0 4px #b04dff; opacity: 0.35;
  animation: pill-letter-glow 1.8s ease-in-out infinite alternate;
}
@keyframes pill-letter-glow { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { :is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] .pill-letter-lit { transition: none; } :is(.pills, .style-preview) .pill[data-pill-style][data-pill-style] .pill-letter-lit::after { animation: none; opacity: 0.7; } }

/* Spectators use the game page controls, with no player actions. */
#spectator { display: grid; gap: 18px; }
#watch-stage { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #000; border-radius: 14px; overflow: hidden; }
#watch-video { width: 100%; height: 100%; object-fit: contain; }
#watch-ended { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; background: var(--night-deep); text-align: center; }
#watch-start { position: absolute; bottom: 20px; left: 20px; }
.watch-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.watch-controls select { min-height: 46px; max-width: 100%; }
.watch-controls input[type=range] { width: 140px; }
#spectator .panel { width: 100%; }
/* View-only layer: input stays on the original game canvas and player slot. */
.watching-view { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; background:#000; pointer-events:none; }
.watching-notice { top:auto; bottom:12px; width:max-content; font-size:12px; }

/* Course pack: Game settings > Courses and the end-event credit line. */
.coursepack { display: grid; gap: 10px; justify-items: start; }
.settings .coursepack button { font-size: .78rem; padding: 10px 14px; }
#coursepack-progress { max-width: 420px; }
.coursepack-credit, .end-event-head .end-event-credit { color: var(--cyan); font-size: .875rem; font-weight: 600; }

/* Event launcher (launcher-ui.js, slice L3). Approved design: design/launcher-l3/index.html, revision 2.
   It fills the stage over the idle native front end. No edge accent bars (Untricky rule). */
.lx { position: absolute; inset: 0; z-index: 2; container: lx / inline-size; overflow: hidden;
  background: radial-gradient(120% 90% at 20% 0%, #2b1a78 0%, #120d2e 55%, #08061a 100%); font-size: clamp(12px, 1.55cqi, 16px); line-height: 1.5; }
.lx-main { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.lx button { font-size: clamp(12px, 1.5cqi, 15.5px); }
.lx h2 { font: italic 900 clamp(20px, 3.6cqi, 38px)/0.95 "Exo 2", sans-serif; text-transform: uppercase; letter-spacing: -0.01em; }
.lx h2[tabindex]:focus { outline: none; }
.lx h3 { margin: 0; font: italic 900 1.0625em/1.1 "Exo 2", sans-serif; text-transform: uppercase; }
.lx-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 1.6cqi 2.4cqi 0.8cqi; }
.lx-trail { display: flex; gap: 0.4em; list-style: none; margin: 0; padding: 0; font: italic 800 0.8125em/1 "Exo 2", sans-serif; text-transform: uppercase; letter-spacing: 0.02em; }
.lx-trail li { padding: 0.5em 0.9em; border-radius: 6px; color: var(--muted); background: rgb(255 255 255 / 0.04); transform: skewX(var(--skew)); }
.lx-trail li > span { display: inline-block; transform: skewX(calc(-1 * var(--skew))); }
.lx-trail li[aria-current="step"] { background: var(--lime); color: var(--night); }
.lx-trail li.done { color: var(--snow); }
.lx-summary { color: var(--muted); font-size: 0.875em; text-align: right; font-variant-numeric: tabular-nums; }
.lx-summary b { color: var(--snow); font-weight: 700; }
.lx-body { min-height: 0; overflow: auto; padding: 1.2cqi 2.4cqi; display: grid; align-content: start; gap: 1.6cqi; }
.lx-body.enter > * { animation: lx-enter 220ms var(--ease-out) both; }
.lx-body.enter > :nth-child(2) { animation-delay: 40ms; }
.lx-body.enter > :nth-child(3) { animation-delay: 80ms; }
@keyframes lx-enter { from { opacity: 0; transform: translateY(6px); } }
.lx-note, .lx-sub { color: var(--muted); font-size: 0.875em; }
.lx-label { font-weight: 700; margin-right: 0.4em; }
.lx-credit { color: var(--muted); font-size: 0.8125em; }
.lx-bar { display: flex; align-items: center; gap: 1.6cqi; padding: 1.4cqi 2.4cqi 2cqi; border-top: 1px solid rgb(255 255 255 / 0.06); background: rgb(8 6 26 / 0.55); }
.lx-grow { flex: 1; min-width: 0; color: var(--muted); font-size: 0.875em; }
/* The online guest's copy of the launcher (slice L5): the host picks on these steps. */
.lx-host-note { color: var(--snow); font-weight: 700; }
.lx-zone-own { display: grid; justify-items: center; gap: 8px; }
.lx-hints { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3em 1.1em; color: var(--muted); font-size: 0.875em; }
.lx-hint { display: inline-flex; align-items: center; gap: 0.45em; white-space: nowrap; }
.lx-key { display: inline-grid; place-items: center; min-width: 1.7em; height: 1.7em; padding: 0 0.35em; border-radius: 0.45em; background: var(--panel-2); color: var(--snow);
  font: 800 0.8em/1 "Exo 2", sans-serif; font-style: normal; text-transform: none; box-shadow: inset 0 -2px 0 rgb(0 0 0 / 0.35); }
.lx-alert { color: var(--snow); background: #6b1030; padding: 0.4em 0.8em; border-radius: 8px; font-weight: 700; font-size: 0.875em; text-align: center; }

/* Forward slab: an arrow-shaped plate; the wrapper draws the brand offset shadow and the focus ring. */
.lx-slab-wrap { flex: none; filter: drop-shadow(6px 6px 0 var(--cyan)); border-radius: 4px; }
.lx-slab-wrap.alt { filter: drop-shadow(5px 5px 0 var(--night-deep)); }
.lx-slab-ring { flex: none; border-radius: 6px; }
.lx-slab-ring:has(.lx-slab.lx-focus) { outline: 3px solid var(--snow); outline-offset: 8px; }
.lx-slab-wrap:has(.lx-slab:disabled) { filter: none; }
.lx .lx-slab { --fill: var(--orange); --ink: var(--night);
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 0.7em; align-content: center; text-align: left;
  min-height: clamp(64px, 9.4cqi, 100px); min-width: clamp(250px, 38cqi, 400px); padding: 0 clamp(44px, 6.4cqi, 70px) 0 clamp(22px, 3cqi, 34px);
  background: var(--fill); color: var(--ink); clip-path: polygon(3.5% 0, 88% 0, 100% 50%, 88% 100%, 0 100%);
  transition: scale 140ms var(--ease-out), background-color 140ms ease; }
.lx .lx-slab::before { display: none; }
.lx .lx-slab:focus-visible { outline: none; }
.lx .lx-slab:not(:disabled):active { scale: 0.96; transform: none; }
@media (hover: hover) and (pointer: fine) { .lx .lx-slab:not(:disabled):hover { transform: none; background: #ff7d33; } .lx .lx-slab-wrap.alt .lx-slab:not(:disabled):hover { background: #33287a; } }
.lx-slab .lx-key { grid-row: 1 / 3; align-self: center; width: 2.1em; height: 2.1em; font-size: 1.05em; border-radius: 50%; background: var(--night); color: var(--snow); box-shadow: none; }
.lx-slab-kicker { font: italic 800 clamp(11px, 1.35cqi, 14px)/1 "Exo 2", sans-serif; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.8; }
.lx-slab-label { font: italic 900 clamp(20px, 3.3cqi, 36px)/1 "Exo 2", sans-serif; text-transform: uppercase; white-space: nowrap; }
.lx .lx-slab-wrap.alt .lx-slab { --fill: var(--panel-2); --ink: var(--snow); min-width: clamp(200px, 28cqi, 300px); }
.lx-slab-wrap.alt .lx-slab .lx-key { background: var(--snow); color: var(--night); }
.lx-slab-wrap.alt .lx-slab-label { font-size: clamp(16px, 2.3cqi, 25px); }
.lx .lx-slab:disabled { --fill: var(--panel-2); --ink: var(--muted); cursor: not-allowed; }

/* Pressable cards: mode, course, rider. Scale on press 0.96. */
.lx .lx-card { position: relative; display: grid; text-align: left; color: var(--snow); background: var(--panel); border: 0; border-radius: 12px; padding: 0; overflow: hidden; cursor: pointer;
  box-shadow: inset 0 0 0 2px var(--panel-2); font: inherit; text-transform: none; min-height: 0;
  transition: scale 140ms var(--ease-out), box-shadow 140ms ease, background-color 140ms ease; }
.lx .lx-card::before { display: none; }
.lx .lx-card:not(:disabled):active { scale: 0.96; transform: none; }
@media (hover: hover) and (pointer: fine) { .lx .lx-card:hover { box-shadow: inset 0 0 0 2px var(--cyan); transform: none; } }
/* Selected (quiet): a thin lime edge and a check. Focus (loud): the white ring below. */
.lx .lx-card[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--lime); }
.lx .lx-mode[aria-checked="true"]::after, .lx .lx-course[aria-checked="true"]::after { content: "✓"; position: absolute; top: 0.5em; right: 0.6em; display: grid; place-items: center;
  width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--lime); color: var(--night); font: 900 0.85em/1 "Exo 2", sans-serif; }
.lx .lx-course[aria-checked="true"] { background: var(--panel-2); }
/* One focus mark for every launcher control (launcher-ui.js mark()). The shell's lime
   :focus-visible ring is off here: lime means "selected" in the launcher. */
.lx :focus-visible { outline: none; }
.lx .lx-focus { outline: 3px solid var(--snow); outline-offset: 3px; }
.lx .lx-card.lx-focus { outline-offset: 3px; box-shadow: inset 0 0 0 2px var(--snow); }
.lx .lx-card.lx-focus[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--lime); }
.lx .lx-pick.lx-focus { outline-offset: 2px; background: rgb(255 255 255 / 0.08); }
.lx-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.6cqi; }
.lx .lx-mode { padding: 2.6cqi; gap: 0.6em; min-height: 30cqi; align-content: end; background: linear-gradient(160deg, rgb(255 106 19 / 0.20), transparent 55%), var(--panel); }
.lx .lx-mode.showoff { background: linear-gradient(160deg, rgb(34 211 255 / 0.20), transparent 55%), var(--panel); }
.lx .lx-mode.freeride { background: linear-gradient(160deg, rgb(244 248 255 / 0.16), transparent 55%), var(--panel); }
.lx-big { font: italic 900 clamp(22px, 4.4cqi, 46px)/0.9 "Exo 2", sans-serif; text-transform: uppercase; }
.lx-mode.race .lx-big { color: var(--orange); }
.lx-mode.showoff .lx-big { color: var(--cyan); }
.lx-mode.freeride .lx-big { color: var(--snow); }
.lx-seg { display: flex; flex-wrap: wrap; gap: 1.2cqi; align-items: center; }
.lx-seg button[aria-checked="true"] { --fill: var(--cyan); --ink: var(--night); }
.lx-courses { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.2cqi; }
.lx-courses.ten { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.lx .lx-course { gap: 0.3em; padding-bottom: 0.8em; }
.lx-shot { display: block; aspect-ratio: 16 / 9; background: var(--night-deep); overflow: hidden; }
.lx-shot img { display: block; width: 100%; height: 100%; object-fit: cover; outline: 1px solid oklch(1 0 0 / 0.1); outline-offset: -1px; }
.lx-name { padding: 0 0.7em; font-weight: 700; line-height: 1.2; }
.lx-tag { margin: 0 0.7em; justify-self: start; padding: 0.15em 0.5em; border-radius: 4px; font: 800 0.7em/1.3 "Exo 2", sans-serif; text-transform: uppercase; letter-spacing: 0.04em; }
.lx-tag.pack { background: var(--lime); color: var(--night); }
.lx-tag.showoff { background: var(--cyan); color: var(--night); }
.lx-tag.freeride { background: var(--snow); color: var(--night); }
.lx-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2cqi 2.4cqi; }
.lx-stepper { display: inline-flex; align-items: center; gap: 0.6em; }
.lx-stepper button { min-height: 44px; min-width: 48px; padding: 0 12px; }
.lx-stepper output { min-width: 2.2ch; text-align: center; font: italic 900 1.4em/1 "Exo 2", sans-serif; font-variant-numeric: tabular-nums; }

/* Riders: portrait tiles at the headshot aspect (208 x 264 px), at most 104 CSS px wide, so the
   source is never drawn above 1:1 at 2x DPR. Names sit on a plate under the face. */
.lx-riders-wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 2cqi; align-items: start; }
.lx-riders-wrap.two { grid-template-columns: 1fr; gap: 1.4cqi; }
.lx-riders { display: grid; grid-template-columns: repeat(6, minmax(0, 104px)); gap: max(10px, 1.1cqi); justify-content: start; padding: 4px; }
.lx-riders-wrap.two .lx-riders { grid-template-columns: repeat(12, minmax(0, 104px)); gap: max(8px, 0.8cqi); }
.lx .lx-rider { grid-template-rows: auto auto; align-content: start; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); }
.lx-face { display: block; aspect-ratio: 208 / 264; overflow: hidden; background: var(--night-deep); }
.lx-face img, .lx-kit-face img, .lx-res-face img { display: block; width: 100%; height: 100%; object-fit: cover; outline: 1px solid oklch(1 0 0 / 0.1); outline-offset: -1px; }
.lx-plate { display: flex; align-items: center; justify-content: center; gap: 0.3em; min-height: 2.1em; padding: 0.3em 0.35em; }
.lx-rname { font: italic 900 clamp(10px, 1.15cqi, 13px)/1 "Exo 2", sans-serif; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lx-mark { padding: 0.15em 0.35em; border-radius: 4px; font: 900 clamp(9px, 1cqi, 11px)/1.2 "Exo 2", sans-serif; color: var(--night); }
.lx-mark.p1 { background: var(--orange); }
.lx-mark.p2 { background: var(--cyan); }
/* Selection rings sit outside the tile, clear of the face. */
.lx .lx-rider[aria-checked="true"], .lx .lx-rider[aria-checked="false"] { box-shadow: inset 0 0 0 1px var(--line); }
.lx .lx-rider.sel-p1 { box-shadow: 0 0 0 3px var(--orange); }
.lx .lx-rider.sel-p2 { box-shadow: 0 0 0 3px var(--cyan); }
.lx .lx-rider.sel-p1.sel-p2 { box-shadow: 0 0 0 3px var(--orange), 0 0 0 6px var(--cyan); }
.lx .lx-rider.sel-p1 .lx-plate, .lx .lx-rider.sel-p2 .lx-plate { background: var(--panel-2); }
.lx .lx-rider.lx-focus { outline-offset: 7px; }
/* P2's cursor on the Riders step (P2 has no page focus): a dashed ring in the P2 colour. */
.lx .lx-cur2:not(.lx-focus) { outline: 3px dashed var(--cyan); outline-offset: 3px; }
.lx .lx-rider.lx-cur2 { outline-offset: 7px; }
/* P1's focus ring takes the outline when both cursors are on one control: P2's ring moves inside. */
.lx .lx-cur2.lx-focus { position: relative; }
.lx .lx-cur2.lx-focus::after { content: ""; position: absolute; inset: 4px; border: 3px dashed var(--cyan); border-radius: 8px; pointer-events: none; }
.lx-kits { display: grid; gap: 1.2cqi; }
.lx-kits.two { grid-template-columns: 1fr 1fr; }
.lx-kit { display: grid; gap: 0.8em; padding: 1.3cqi 1.5cqi; border-radius: 12px; background: var(--panel); }
.lx-kit[data-player="1"], .lx-ready[data-player="1"], .lx-res-player[data-player="1"] { --accent: var(--orange); }
.lx-kit[data-player="2"], .lx-ready[data-player="2"], .lx-res-player[data-player="2"] { --accent: var(--cyan); }
.lx-kit-id { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 1.2em; }
.lx-kit-face { width: 104px; aspect-ratio: 208 / 264; border-radius: 8px; overflow: hidden; background: var(--night-deep); }
.lx-kits.two .lx-kit-face { width: 52px; border-radius: 6px; }
.lx-kit-face.empty { background: rgb(255 255 255 / 0.04); }
.lx-who { display: grid; gap: 0.35em; justify-items: start; min-width: 0; }
.lx-pn { font: italic 900 0.85em/1 "Exo 2", sans-serif; color: var(--night); background: var(--accent, var(--orange)); padding: 0.25em 0.5em; border-radius: 4px; }
.lx-rn { font: italic 900 clamp(24px, 4.2cqi, 44px)/0.95 "Exo 2", sans-serif; text-transform: uppercase; color: var(--accent); }
.lx-kits.two .lx-rn { font-size: clamp(18px, 2.6cqi, 28px); }
.lx-pad { font-size: 0.8125em; color: var(--lime); white-space: nowrap; }
/* Picker: one large icon and the selected name, large < and > buttons with the shoulder keys. */
.lx-pick { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.7em; padding: 0.5em; border-radius: 12px; background: rgb(255 255 255 / 0.035); }
.lx .lx-step { display: grid; place-items: center; align-content: center; gap: 3px; min-height: 66px; min-width: 60px; padding: 4px 12px; }
.lx-chev { font: 900 1.9em/0.8 "Exo 2", sans-serif; font-style: normal; }
.lx-step .lx-key { font-size: 0.72em; height: 1.6em; background: var(--night); }
.lx-pick-show { display: grid; grid-template-columns: 5.6em minmax(0, 1fr); align-items: center; gap: 0.9em; min-width: 0; }
.lx-pick-show.from-next { animation: lx-in-next 200ms var(--ease-out); }
.lx-pick-show.from-prev { animation: lx-in-prev 200ms var(--ease-out); }
@keyframes lx-in-next { from { opacity: 0; transform: translateX(8px); } }
@keyframes lx-in-prev { from { opacity: 0; transform: translateX(-8px); } }
.lx-pick-icon { display: grid; place-items: center; height: 3.4em; }
.lx-board { display: inline-block; width: 1.9em; height: 0.5em; margin-right: 0.45em; border-radius: 0.25em; transform: skewX(var(--skew)) rotate(-10deg); vertical-align: 0.1em;
  background: linear-gradient(90deg, transparent 0 20%, var(--b2) 20% 30%, transparent 30% 70%, var(--b2) 70% 80%, transparent 80%), var(--b1); box-shadow: 1px 1px 0 var(--night-deep); }
.lx-board.big { width: 5.2em; height: 1.3em; margin: 0; border-radius: 0.65em; box-shadow: 3px 3px 0 var(--night-deep); }
/* Uberboard (slot 11 for every rider): animated silver. One background-position sweep, no script. */
.lx-board.uber { background: linear-gradient(100deg, #7d889c 0%, #c9d3e6 30%, #ffffff 42%, #c9d3e6 54%, #7d889c 100%) 0 0 / 260% 100%; animation: lx-silver 2.6s linear infinite; }
@keyframes lx-silver { from { background-position: 100% 0; } to { background-position: -160% 0; } }
.lx-outfit { width: 2.8em; height: 2.8em; border-radius: 10px; background: linear-gradient(135deg, var(--o1) 0 50%, var(--o2) 50%); box-shadow: 3px 3px 0 var(--night-deep), inset 0 0 0 1px oklch(1 0 0 / 0.12); }
.lx-pick-text { display: grid; gap: 0.15em; min-width: 0; }
.lx-pick-text b { font: italic 900 clamp(15px, 2cqi, 22px)/1.05 "Exo 2", sans-serif; text-transform: uppercase; text-wrap: balance; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.lx-pick-text small { color: var(--muted); font-size: 0.8125em; font-variant-numeric: tabular-nums; }
.lx-kits.two .lx-pick-show { grid-template-columns: 4.4em minmax(0, 1fr); gap: 0.6em; }
.lx-kits.two .lx-board.big { width: 4.2em; height: 1.1em; }
.lx-kits.two .lx-outfit { width: 2.4em; height: 2.4em; }
/* Ready-up zone: the central start control on the Riders step. */
.lx-zone { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; padding-block: 1.6cqi 2.2cqi; }
.lx-zone-mid { display: grid; justify-items: center; gap: 0.6em; text-align: center; min-width: 0; }
.lx-zone-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(9em, 0.8fr) minmax(0, 1fr); align-items: center; gap: 1.6cqi; width: 100%; }
.lx-ready { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 0.8em; align-items: center; min-height: clamp(64px, 9cqi, 96px); padding: 0.6em 1em;
  border-radius: 12px; text-align: left; text-transform: none; font: inherit; color: var(--snow); background: var(--panel); box-shadow: inset 0 0 0 2px var(--line);
  transition: scale 140ms var(--ease-out), background-color 160ms ease, box-shadow 160ms ease; }
.lx-ready .lx-pn { grid-row: 1 / 3; font-size: 1em; padding: 0.4em 0.6em; }
.lx-ready b { font: italic 900 clamp(15px, 2.2cqi, 24px)/1.05 "Exo 2", sans-serif; text-transform: uppercase; }
.lx-ready small { color: var(--muted); font-size: 0.85em; }
.lx-ready[data-state="on"] { background: var(--lime); color: var(--night); box-shadow: none; }
.lx-ready[data-state="on"] small { color: var(--night); }
.lx-ready[data-state="on"] .lx-pn { background: var(--night); color: var(--lime); }
.lx-ready[data-state="off"] { background: transparent; }
.lx-ready[data-state="off"] b { color: var(--muted); }
.lx-counting:focus { outline: none; }
.lx:focus { outline: none; }
.lx-status { display: grid; justify-items: center; gap: 0.2em; }
.lx-say { font: italic 900 clamp(15px, 2.2cqi, 24px)/1.05 "Exo 2", sans-serif; text-transform: uppercase; }
.lx-count { font: italic 900 clamp(46px, 8.6cqi, 92px)/0.85 "Exo 2", sans-serif; color: var(--lime); font-variant-numeric: tabular-nums; animation: lx-tick 320ms var(--ease-out) both; }
@keyframes lx-tick { from { opacity: 0; scale: 1.18; } }

/* Loading cover: no pointer events, so the native start prompt (z-index 3) keeps its click. */
.lx.lx-cover { pointer-events: none; background: var(--night-deep); }
.lx.lx-lift { animation: lx-lift 180ms var(--ease-out) both; }
.lx.lx-cover .lx-stall { margin-bottom: 12px; }
.lx.lx-cover .lx-slab-ring:has([data-go="reload"]) { pointer-events: auto; }
@keyframes lx-lift { to { opacity: 0; } }
.lx-cover .lx-main { display: grid; grid-template-rows: none; align-content: end; padding: 4cqi; gap: 1.2cqi; position: relative; }
.lx-cover-art { position: absolute; inset: -4%; background-size: cover; background-position: center; filter: blur(14px) saturate(1.2); opacity: 0.45; transform: scale(1.06); }
.lx-cover .lx-main::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(8 6 26 / 0.15) 0%, rgb(8 6 26 / 0.92) 75%); }
.lx-cover .lx-main > :not(.lx-cover-art) { position: relative; z-index: 1; }
.lx-chip { justify-self: start; padding: 0.35em 0.9em; border-radius: 6px; transform: skewX(var(--skew)); font: italic 900 0.9em/1 "Exo 2", sans-serif; text-transform: uppercase; color: var(--night); background: var(--orange); }
.lx-chip.showoff { background: var(--cyan); }
.lx-chip.freeride { background: var(--snow); }
/* Chrome letters: the brand letter gradient (brand/README.md), as the shell h1. */
.lx-cover h1 { font: italic 900 clamp(32px, 8cqi, 86px)/0.9 "Exo 2", sans-serif; text-transform: uppercase; letter-spacing: -0.01em; }
.lx-line { font-weight: 700; font-size: 1.05em; }
.lx-line span { color: var(--muted); font-weight: 500; }
.lx-loadbar { width: min(100%, 26em); height: 0.5em; border-radius: 0.25em; background: rgb(255 255 255 / 0.1); overflow: hidden; }
.lx-loadbar i { display: block; width: 35%; height: 100%; border-radius: inherit; background: var(--lime); animation: lx-slide 1.1s linear infinite; }
@keyframes lx-slide { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
.lx-tip { color: var(--muted); font-size: 0.9em; }

/* Results: player cards, club leaderboard and the two forward slabs. */
.lx-res { gap: 1.4cqi; }
.lx-res-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 0.6em 1.6em; }
.lx-res-head p { color: var(--muted); }
.lx-res-cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2cqi; align-items: start; }
.lx-res-cols.solo { grid-template-columns: minmax(0, 1fr); max-width: 72cqi; }
.lx-res-left { display: grid; gap: 1cqi; }
.lx-res-player { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1em; padding: 1.2cqi 1.4cqi; border-radius: 10px; background: var(--panel); }
.lx-res-face { width: 3em; aspect-ratio: 208 / 264; border-radius: 6px; overflow: hidden; background: var(--night-deep); }
.lx-res-who { min-width: 0; display: grid; gap: 0.25em; }
.lx-line1 { display: flex; align-items: center; gap: 0.5em; flex-wrap: wrap; }
.lx-res-who b { font: italic 900 1.25em/1.1 "Exo 2", sans-serif; text-transform: uppercase; color: var(--accent); }
.lx-meta { color: var(--muted); font-size: 0.875em; }
.lx-res-num { text-align: right; font-variant-numeric: tabular-nums; }
.lx-place { display: block; font: italic 900 clamp(22px, 4.4cqi, 46px)/0.9 "Exo 2", sans-serif; color: var(--snow); }
.lx-stat { font-weight: 700; }
.lx-xp { display: block; color: var(--lime); font-size: 0.8125em; }
.lx-badge { display: inline-block; padding: 0.1em 0.45em; border-radius: 4px; font: 900 0.7em/1.3 "Exo 2", sans-serif; text-transform: uppercase; background: var(--lime); color: var(--night); }
.lx-res-left.solo .lx-res-player { padding: 2.4cqi 2.2cqi; min-height: 19cqi; }
.lx-res-left.solo .lx-place { font-size: clamp(40px, 8.4cqi, 88px); }
.lx-res-left.solo .lx-stat { font-size: 1.35em; }
.lx-res-left.solo .lx-res-who b { font-size: 1.7em; }
.lx-res-left.solo .lx-res-face { width: 5.5em; }
.lx-more { display: flex; flex-wrap: wrap; gap: 1cqi 1.4cqi; align-items: center; }
/* The run video share row (run-video.js) as a results panel: a small preview beside the title and
   the clip size; the actions and the note use the full panel width, so the three buttons stay on one line. */
.lx .end-event-share { grid-template-columns: minmax(0, 9em) minmax(0, 1fr); grid-template-areas: "preview title" "preview info" "actions actions" "note note";
  gap: 0.5em 1.4cqi; margin: 0; padding: 1cqi 1.4cqi; border: 0; border-radius: 10px; background: var(--panel); }
.lx .end-event-share h3 { align-self: end; }
.lx .end-event-share-preview { max-height: 5.5em; }
.lx .end-event-share-body { display: contents; }
.lx .end-event-share-info { grid-area: info; min-height: 0; align-self: start; }
.lx .end-event-share-actions { grid-area: actions; gap: 0.6em; }
.lx .end-event-share-actions button { min-height: 2.5em; padding: 0 0.9em; white-space: nowrap; }
.lx .end-event-share-download { --fill: var(--lime); --ink: var(--night); }
.lx .end-event-share .end-event-hint { grid-area: note; font-size: 0.8125em; }
/* With the share row, a solo result card gives up its extra height so the row and Change fit. */
.lx-res-left.solo:has(.end-event-share:not([hidden])) .lx-res-player { min-height: 0; padding: 1.4cqi 2.2cqi; }
.lx .end-event-share-download { --fill: var(--lime); --ink: var(--night); }
.lx .end-event-hint { font-size: 0.8125em; }
.lx-board-box { display: grid; gap: 0.4em; min-width: 0; }
.lx-board-box table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.875em; }
.lx-board-box caption { text-align: left; color: var(--muted); padding: 0 0 0.4em; }
.lx-board-box th, .lx-board-box td { padding: 0.45em 0.4em; border-bottom: 1px solid var(--panel-2); text-align: left; overflow-wrap: anywhere; }
.lx-board-box th { color: var(--muted); font-weight: 600; }
.lx-board-box td:last-child, .lx-board-box th:last-child { text-align: right; white-space: nowrap; }
.lx-res-bar .lx-slabs { display: flex; align-items: center; gap: 2.4cqi; }

/* Phone width is not supported for the launcher: say so instead of a cramped picker. */
.lx-narrow { display: none; }
@container lx (max-width: 560px) {
  .lx:not(.lx-cover) .lx-narrow { display: grid; place-items: center; height: 100%; padding: 16px; text-align: center; font-weight: 700; text-wrap: balance; }
  .lx:not(.lx-cover) .lx-main { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .lx-body.enter > *, .lx-pick-show.from-next, .lx-pick-show.from-prev, .lx-count { animation: lx-fade 160ms ease both; }
  @keyframes lx-fade { from { opacity: 0; } }
  .lx-board.uber { animation: none; background-position: 40% 0; }
  .lx-loadbar i { animation: none; width: 100%; opacity: 0.6; }
  .lx.lx-lift { animation: none; opacity: 0; }
  .lx .lx-card, .lx .lx-slab, .lx-ready { transition: none; }
}

/* Boot screen (boot-screen.js): one cover from the engine load to the launcher's Event step.
   Club "Big air" mark (brand/README.md: loading screen), real boot steps, then the start gesture. */
.boot { position: absolute; inset: 0; z-index: 4; display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center;
  padding: 5cqi 6cqi 6.5cqi; overflow: hidden; background: radial-gradient(120% 90% at 20% 0%, #2b1a78 0%, #120d2e 55%, #08061a 100%);
  transition: opacity 220ms var(--ease-out); }
.boot[data-phase="ready"] { cursor: pointer; }
.boot.boot-out { opacity: 0; pointer-events: none; }
.boot-mark { align-self: center; display: grid; place-items: center; width: min(76cqi, 820px); }
.boot-mark img { display: block; width: 100%; height: auto; opacity: 0; transform: translateY(1.6cqi) scale(0.98);
  transition: opacity 500ms var(--ease-out), transform 700ms var(--ease-out); }
.boot-art-in .boot-mark img { opacity: 1; transform: none; }
.boot-out .boot-mark img { transform: scale(1.02); transition: transform 220ms var(--ease-out); }
/* Loading, ready and failure share one cell, so the mark never moves when the foot changes. */
.boot-foot { display: grid; place-items: center; min-height: clamp(110px, 17cqi, 190px); width: 100%; }
.boot-foot > * { grid-area: 1 / 1; }
.boot-load, .boot-ready { display: grid; justify-items: center; transition: opacity 180ms var(--ease-out), transform 260ms var(--ease-out), visibility 0s linear 260ms; }
.boot-load { gap: 1.7cqi; }
.boot-ready { gap: 2.6cqi; opacity: 0; visibility: hidden; transform: translateY(6px) scale(0.96); }
.boot[data-phase="ready"] .boot-load { opacity: 0; visibility: hidden; transform: translateY(-4px); }
.boot[data-phase="ready"] .boot-ready { opacity: 1; visibility: visible; transform: none; transition-delay: 80ms, 80ms, 0s; }
/* Progress: one skewed segment per boot step. Done = orange, the current step runs a light sweep. */
.boot-bar { display: flex; gap: max(6px, 0.9cqi); width: min(46cqi, 440px); }
.boot-bar i { position: relative; flex: 1; height: max(8px, 1.05cqi); overflow: hidden; border-radius: 3px; transform: skewX(var(--skew));
  background: rgb(255 255 255 / 0.12); transition: background-color 300ms var(--ease-out); }
.boot-bar i[data-state="done"] { background: var(--orange); }
.boot-bar i[data-state="now"] { background: rgb(255 106 19 / 0.32); }
.boot-bar i[data-state="now"]::after { content: ""; position: absolute; inset: 0; width: 60%;
  background: linear-gradient(90deg, transparent, var(--orange) 45%, #ffb37f 55%, transparent); animation: boot-sweep 1.15s linear infinite; }
@keyframes boot-sweep { from { transform: translateX(-100%); } to { transform: translateX(170%); } }
.boot-label { display: flex; gap: 0.7em; align-items: baseline; font: italic 800 clamp(12px, 1.7cqi, 17px)/1 "Exo 2", sans-serif;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.boot-count { color: var(--snow); opacity: 0.55; font-variant-numeric: tabular-nums; }
/* The start prompt: the launcher's forward slab shape, with the brand offset shadow. */
.boot-go-ring { border-radius: 6px; }
.boot-go-ring:has(.boot-go:focus-visible) { outline: 3px solid var(--snow); outline-offset: 8px; }
.boot-go-wrap { filter: drop-shadow(6px 6px 0 var(--cyan)); }
.boot .boot-go { display: grid; justify-items: start; align-content: center; gap: 0.3em; text-align: left;
  min-height: clamp(64px, 10cqi, 108px); min-width: clamp(260px, 44cqi, 470px); padding: 0 clamp(50px, 7.4cqi, 80px) 0 clamp(24px, 3.4cqi, 38px);
  background: var(--orange); color: var(--night); clip-path: polygon(3.5% 0, 89% 0, 100% 50%, 89% 100%, 0 100%);
  transition: scale 140ms var(--ease-out), background-color 140ms ease; }
.boot .boot-go::before { display: none; }
.boot .boot-go:focus-visible { outline: none; }
.boot .boot-go:hover, .boot .boot-go:active { transform: none; }
.boot .boot-go:active, .boot-pressed .boot-go { scale: 0.96; }
@media (hover: hover) and (pointer: fine) { .boot .boot-go:hover { background: #ff7d33; } }
.boot-go-kicker { font: italic 800 clamp(11px, 1.4cqi, 15px)/1 "Exo 2", sans-serif; letter-spacing: 0.05em; opacity: 0.75; }
.boot-go-label { font: italic 900 clamp(20px, 3.6cqi, 40px)/1 "Exo 2", sans-serif; white-space: nowrap; }
.boot-note { max-width: 48ch; text-align: center; text-wrap: balance; color: var(--muted); font-size: clamp(12px, 1.5cqi, 15px); line-height: 1.4;
  transition: color 200ms ease; }
/* A controller button on the prompt: a short shake and a brighter note (browsers need a key or a click). */
.boot-nudge .boot-note { color: var(--snow); }
.boot-nudge .boot-go-wrap { animation: boot-nudge 380ms var(--ease-out); }
@keyframes boot-nudge { 0%, 100% { translate: 0; } 25% { translate: -7px 0; } 55% { translate: 5px 0; } 80% { translate: -2px 0; } }
.boot-fail { display: none; gap: 1.4cqi; justify-items: center; text-align: center; }
.boot[data-phase="error"] .boot-fail { display: grid; }
.boot[data-phase="error"] .boot-load, .boot[data-phase="error"] .boot-ready { display: none; }
.boot-fail-title { font: italic 900 clamp(18px, 3cqi, 32px)/1 "Exo 2", sans-serif; text-transform: uppercase; }
.boot-fail-text { max-width: 52ch; color: var(--muted); font-size: clamp(12px, 1.5cqi, 15px); overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) {
  .boot-mark img, .boot-load, .boot-ready { transform: none; transition-property: opacity, visibility; }
  .boot-bar i[data-state="now"]::after { animation: none; display: none; }
  .boot-bar i[data-state="now"] { background: rgb(255 106 19 / 0.6); }
  .boot-nudge .boot-go-wrap { animation: none; }
  .boot .boot-go { transition: background-color 140ms ease; }
  .boot .boot-go:active, .boot-pressed .boot-go { scale: none; }
  .boot-out .boot-mark img { transform: none; }
}
.boot-alert { max-width: 48ch; text-align: center; color: var(--snow); font-weight: 700; font-size: clamp(12px, 1.5cqi, 15px); }
.boot-alert:empty { display: none; }
