/* un:tricky club. Early-2000s theme from brand/README.md (round 2). */

@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;
  --purple: #3a1f8f;
  --panel: #1c1447;
  --panel-2: #271c5e;
  --orange: #ff6a13;
  --cyan: #22d3ff;
  --lime: #c6ff1a;
  --snow: #f4f8ff;
  --muted: #c4bde8;
  --chrome: linear-gradient(180deg, #ffffff 0%, #d3e3f7 40%, #55688f 49%, #a3b8da 57%, #f2f7ff 85%, #ffffff 100%);
  --sky: radial-gradient(120% 90% at 20% 0%, #2b1a78 0%, #120d2e 55%, #08061a 100%);

  --step-display: clamp(2.5rem, 1.4rem + 4.4vw, 5.25rem);
  --step-head: clamp(1.75rem, 1.3rem + 1.8vw, 2.75rem);
  --step-lead: clamp(1.1875rem, 1.1rem + 0.4vw, 1.4375rem);
  --step-body: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);

  --margin: clamp(16px, 3vw, 40px);
  --radius: 16px;
  --skew: -12deg;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  font-family: "Exo 2", system-ui, sans-serif;
  font-size: var(--step-body);
  line-height: 1.5;
  background: var(--night-deep);
  color: var(--snow);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; display: flex; flex-direction: column; background: var(--sky) fixed; overflow-x: clip; }
main { flex: 1; }
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
p { text-wrap: pretty; }
a { color: inherit; }
::selection { background: var(--orange); color: var(--night); }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

h1, h2, h3 { font-style: italic; font-weight: 900; letter-spacing: -0.01em; line-height: 0.95; text-transform: uppercase; text-wrap: balance; }
h1 { font-size: var(--step-display); }
h2 { font-size: var(--step-head); }
h3 { font-size: var(--step-lead); }

/* Chrome letters with the logo's dark outline and orange drop. Page titles only. */
.chrome {
  background: var(--chrome); -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;
}

.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; }

/* ---------- Buttons: skewed like the wordmark, hard offset shadow ---------- */
.button {
  --shadow: var(--cyan);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  background: var(--orange); color: var(--night);
  font: italic 900 1.0625rem/1 "Exo 2", sans-serif; text-transform: uppercase; letter-spacing: 0.01em; text-decoration: none;
  border: 0; border-radius: 10px; cursor: pointer;
  transform: skewX(var(--skew));
  box-shadow: 5px 5px 0 var(--shadow);
  transition: transform 140ms var(--ease-out), box-shadow 140ms var(--ease-out), background-color 140ms;
}
.button > span { display: inline-block; transform: skewX(12deg); }
.button:hover { transform: skewX(var(--skew)) translate(-2px, -2px); box-shadow: 7px 7px 0 var(--shadow); }
.button:active { transform: skewX(var(--skew)) translate(3px, 3px); box-shadow: 2px 2px 0 var(--shadow); }
.button-cyan { background: var(--cyan); --shadow: var(--orange); }
.button-ghost { background: var(--panel-2); color: var(--snow); --shadow: var(--night-deep); }
.button:disabled { background: var(--panel-2); color: var(--muted); --shadow: var(--night-deep); cursor: not-allowed; transform: skewX(var(--skew)); }
.button-small { min-height: 42px; padding: 0 18px; font-size: 0.9375rem; box-shadow: 4px 4px 0 var(--shadow); }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: clamp(80px, 10vw, 160px);
  background: var(--night-deep); padding: 40px var(--margin) 32px;
  display: grid; grid-template-columns: auto 1fr 1fr; gap: 32px 48px; align-items: start;
}
.site-footer img { height: 72px; width: auto; }
.site-footer ul { display: grid; gap: 6px; font-weight: 700; }
.site-footer ul a { text-decoration: none; }
.site-footer ul a:hover { color: var(--cyan); }
.site-footer .fine { color: var(--muted); grid-column: 2 / -1; max-width: 65ch; }
.site-footer .fine a { color: var(--snow); }
/* Community link: the free third column on wide screens, its own row on narrow ones. */
.footer-club { display: grid; justify-items: start; gap: 14px; }
.footer-club p { color: var(--muted); }
.discord-link { min-height: 44px; }
.discord-link > span { display: inline-flex; align-items: center; gap: 10px; }
.discord-link svg { flex: none; width: 20px; height: 20px; fill: currentColor; }
.notice .discord-link { justify-self: start; margin-top: 6px; }

/* ---------- Sparkles ---------- */
.sparkle { position: absolute; width: 24px; height: 24px; fill: var(--lime); pointer-events: none; animation: twinkle 2.2s ease-in-out 2; }
.sparkle.white { fill: var(--snow); animation-delay: -1.3s; }
@keyframes twinkle { 0%, 100% { transform: scale(0.6) rotate(0deg); opacity: 0.55; } 50% { transform: scale(1) rotate(45deg); opacity: 1; } }

/* ---------- Lander ---------- */
.hero {
  position: relative; overflow: clip;
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 4vw, 64px);
  padding: clamp(8px, 2vw, 24px) var(--margin) clamp(40px, 5vw, 72px);
  min-height: min(760px, calc(100svh - 90px));
}
.hero-logo { width: 100%; max-width: 900px; margin-left: -3%; }
.hero-copy { display: grid; gap: 24px; justify-items: start; }
.hero-copy h1 { font-size: clamp(2.5rem, 1.2rem + 4.2vw, 5rem); }
.hero-copy .lead { font-size: var(--step-lead); max-width: 30ch; font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: 18px 22px; align-items: center; padding-top: 6px; }

.section { padding: clamp(96px, 11vw, 180px) var(--margin) 0; }
.section > h2 { margin-bottom: 28px; }

/* Ride with a friend: two screens, the picture goes out, the controller comes back. */
.coop { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr); gap: clamp(28px, 4vw, 64px); align-items: center; }
.coop-copy { display: grid; gap: 18px; }
.coop-copy > p { font-size: var(--step-lead); max-width: 34ch; }
.coop-points { display: grid; gap: 14px; }
.coop-points li { max-width: 42ch; color: var(--muted); }
.coop-points strong { display: block; color: var(--snow); font-style: italic; font-weight: 900; text-transform: uppercase; font-size: 1.125rem; }
.coop-demo { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) clamp(56px, 7vw, 110px) minmax(0, 1fr); align-items: center; }
.coop-screen { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--purple); }
.coop-screen.p1 { box-shadow: 0 0 0 3px var(--night), 8px 8px 0 3px var(--orange); }
.coop-screen.p2 { box-shadow: 0 0 0 3px var(--night), 8px 8px 0 3px var(--cyan); }
.coop-screen img { width: 100%; height: 100%; object-fit: cover; }
.coop-screen.p1 img { animation: drift 9s ease-in-out infinite alternate; }
.coop-screen.p2 img { animation: drift 9s ease-in-out -4.5s infinite alternate; }
@keyframes drift { from { scale: 1; } to { scale: 1.08; translate: -2% 1%; } }
.coop-pill { position: absolute; left: 8px; bottom: 8px; padding: 3px 8px; border-radius: 7px; background: #120d2ed9; font-size: clamp(0.6875rem, 0.6rem + 0.3vw, 0.8125rem); font-weight: 600; color: var(--muted); box-shadow: 2px 2px 0 var(--orange); }
.p2 .coop-pill { box-shadow: 2px 2px 0 var(--cyan); }
.coop-pill b { color: var(--snow); font-style: italic; margin-right: 4px; }
.coop-tag { position: absolute; right: 8px; top: 8px; padding: 3px 7px; border-radius: 6px; background: var(--night); font: italic 900 0.75rem/1 "Exo 2", sans-serif; text-transform: uppercase; }
.p1 .coop-tag { color: var(--orange); }
.p2 .coop-tag { color: var(--cyan); }
.coop-link { display: grid; gap: 14px; padding: 0 6px; }
.lane { position: relative; height: 8px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.lane i { position: absolute; top: 0; width: 22%; height: 100%; border-radius: 99px; }
.lane.video i { background: var(--orange); animation: to-right 1.8s linear infinite; }
.lane.input i { background: var(--cyan); animation: to-left 1.2s linear infinite; }
.lane i:nth-child(2) { animation-delay: -0.6s; }
.lane i:nth-child(3) { animation-delay: -1.2s; }
.lane.input i:nth-child(2) { animation-delay: -0.4s; }
.lane.input i:nth-child(3) { animation-delay: -0.8s; }
@keyframes to-right { from { translate: -110% 0; } to { translate: 460% 0; } }
@keyframes to-left { from { translate: 460% 0; } to { translate: -110% 0; } }
@keyframes to-down { from { translate: 0 -110%; } to { translate: 0 400%; } }
@keyframes to-up { from { translate: 0 400%; } to { translate: 0 -110%; } }
.coop-demo figcaption { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: center; padding-top: 22px; color: var(--muted); font-weight: 600; }
.coop-pause { border: 0; background: none; color: var(--cyan); font: 700 1rem/1.4 "Exo 2", sans-serif; text-decoration: underline; cursor: pointer; padding: 0; }
.coop-demo.paused img, .coop-demo.paused .lane i { animation-play-state: paused; }
.key::before { content: ""; display: inline-block; width: 18px; height: 8px; border-radius: 99px; margin-right: 8px; vertical-align: 0.1em; }
.key.video::before { background: var(--orange); }
.key.input::before { background: var(--cyan); }

/* What the port adds: a two-column list, no cards. */
.feature-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: clamp(28px, 3vw, 44px) clamp(28px, 4vw, 64px); }
.feature-list li { display: grid; gap: 6px; align-content: start; }
.feature-list strong { font-style: italic; font-weight: 900; text-transform: uppercase; font-size: var(--step-lead); line-height: 1.05; }
.feature-list li:nth-child(3n+1) strong { color: var(--cyan); }
.feature-list li:nth-child(3n+2) strong { color: var(--orange); }
.feature-list li:nth-child(3n) strong { color: var(--lime); }
.feature-list p { max-width: 42ch; }
.feature-list a { color: var(--cyan); font-weight: 700; }

/* On the boards: live top 5. */
.board-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 14px 24px; }
.board-note { color: var(--muted); margin: 10px 0 20px; }
.board-preview > p:last-child { margin-top: 26px; }
.top-riders { display: grid; gap: 8px; }
.top-riders li:not(.top-empty) {
  display: grid; grid-template-columns: 3ch 52px minmax(0, 1fr) auto auto; align-items: center; gap: 12px 18px;
  padding: 10px 20px 10px 14px; border-radius: 12px; background: var(--panel);
}
.top-riders li:nth-child(even):not(.top-empty) { background: var(--panel-2); }
.top-rank { font: italic 900 1.5rem/1 "Exo 2", sans-serif; text-align: center; }
.top-face { width: 52px; height: 66px; border-radius: 8px; overflow: hidden; background: var(--orange); }
.top-face img { width: 100%; height: 100%; object-fit: cover; }
.top-name { font-style: italic; font-weight: 900; font-size: 1.25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-name small { font-style: normal; font-weight: 600; font-size: 0.875rem; color: var(--muted); margin-left: 4px; }
.top-detail { color: var(--muted); font-variant-numeric: tabular-nums; }
.top-points { min-width: 8ch; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.top-empty { padding: 28px 22px; border-radius: 12px; background: var(--panel); color: var(--muted); }
.top-empty a { color: var(--cyan); font-weight: 700; }

/* Club pass call to action: the copy and a sample pass. */
.pass-cta { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(32px, 6vw, 96px); align-items: center; }
.pass-cta-copy { display: grid; gap: 18px; justify-items: start; }
.pass-cta-copy .lead { font-size: var(--step-lead); max-width: 34ch; }
.pass-points { display: grid; gap: 8px; }
.pass-points li { padding-left: 26px; position: relative; }
.pass-points li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 12px; height: 12px; border-radius: 3px; background: var(--lime); rotate: 45deg; }
.pass-demo { justify-self: center; }

/* ---------- Page heads (inner pages) ---------- */
.page-head { padding: clamp(16px, 3vw, 40px) var(--margin) 28px; display: grid; gap: 14px; }
.page-head p { color: var(--muted); max-width: 60ch; font-size: var(--step-lead); }

/* ---------- Leaderboard ---------- */
.board-controls { padding: 0 var(--margin); display: grid; gap: 14px; }
.tabs { display: flex; flex-wrap: wrap; gap: 10px 8px; padding: 4px 4px 8px; }
.tabs button, .modes button {
  flex: none; border: 0; cursor: pointer; font: italic 800 0.9375rem/1 "Exo 2", sans-serif; text-transform: uppercase;
  min-height: 44px; padding: 0 16px; border-radius: 8px; color: var(--snow); background: var(--panel);
  transform: skewX(var(--skew)); transition: background-color 140ms, color 140ms, transform 140ms var(--ease-out);
}
.tabs button > span, .modes button > span { display: inline-block; transform: skewX(12deg); }
.tabs button:hover, .modes button:hover { background: var(--panel-2); }
.tabs button[aria-selected="true"] { background: var(--orange); color: var(--night); }
.modes button[aria-pressed="true"] { background: var(--cyan); color: var(--night); }
.tabs button:active, .modes button:active { transform: skewX(var(--skew)) scale(0.96); }
/* Leaderboard: retail tabs, then the custom course pack on its own row under its credit. */
.board-tabs { display: grid; gap: 14px; }
.tab-row { display: flex; flex-wrap: wrap; gap: 10px 8px; }
.tab-pack { display: grid; gap: 10px; padding-top: 4px; }
.tab-pack-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); font-size: 0.875rem; }
.tab-pack-head b { color: var(--snow); font: italic 800 0.875rem/1 "Exo 2", sans-serif; text-transform: uppercase; }
.pack-tag { padding: 4px 8px; border-radius: 6px; background: #22d3ff24; color: var(--cyan); font: italic 800 0.6875rem/1 "Exo 2", sans-serif; letter-spacing: 0.04em; text-transform: uppercase; }
.filters { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: end; justify-content: space-between; }
.modes { display: flex; gap: 8px; flex-wrap: wrap; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; }
.field input, .field select {
  font: inherit; color: var(--snow); background: var(--night-deep); border: 2px solid var(--panel-2); border-radius: 10px;
  min-height: 46px; padding: 0 14px; min-width: 0;
}
.field input:focus-visible, .field select:focus-visible { outline: 3px solid var(--lime); outline-offset: 1px; }
.search { flex: 1 1 220px; max-width: 340px; }

.table-wrap { margin: 18px var(--margin) 0; background: var(--panel); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
caption { text-align: left; padding: 18px 20px 6px; font-weight: 700; color: var(--muted); }
th, td { text-align: left; padding: 12px 20px; white-space: nowrap; }
thead th { font-style: italic; font-weight: 800; text-transform: uppercase; font-size: 0.875rem; color: var(--muted); }
thead th button { all: unset; cursor: pointer; }
thead th button:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
tbody tr:nth-child(odd) { background: var(--panel-2); }
td.rider { display: flex; align-items: center; gap: 10px; }
td.rider img { width: 32px; height: 40px; object-fit: cover; border-radius: 6px; background: var(--orange); }
td.rank { font-style: italic; font-weight: 900; font-size: 1.125rem; width: 4.5em; }
/* Podium rows: ranks 1–3 on every board. A slow sheen crosses a metal tint. */
[data-podium] { --podium: #ffb81c; --podium-sheen: #fff3c4; }
[data-podium="silver"] { --podium: #c9d3e3; --podium-sheen: #ffffff; --podium-delay: 0.35s; }
[data-podium="bronze"] { --podium: #e07a33; --podium-sheen: #ffd6b8; --podium-delay: 0.7s; }
tbody tr[data-podium], .top-riders li[data-podium]:not(.top-empty) {
  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;
}
[data-podium] :is(td.rank, .top-rank) { color: var(--podium-sheen); text-shadow: 0 1px 0 #08061a, 0 0 6px #08061a; }
@keyframes podium-sheen { to { background-position: 0% 0, 0 0; } }
@media (prefers-reduced-motion: reduce) { [data-podium] { animation: none; } }
.state { padding: 36px 20px 44px; display: grid; gap: 10px; justify-items: start; }
.state p { color: var(--muted); max-width: 58ch; }
.state strong { font-style: italic; font-weight: 900; text-transform: uppercase; font-size: var(--step-lead); }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; padding: 16px var(--margin) 0; }
.pager .count { color: var(--muted); }
.pager .pages { display: flex; align-items: center; gap: 14px; }
.pager .field { grid-auto-flow: column; align-items: center; gap: 10px; }
/* Modder credit for the custom course pack: quiet, but always readable. */
.course-credit { margin-top: 12px; color: var(--muted); font-size: 0.875rem; max-width: 75ch; }
.pass-credit { margin-top: 16px; }

/* ---------- Find a game ---------- */
.lobby-host { display: grid; gap: 2px; }
.lobby-host small { color: var(--muted); font-size: 0.8125rem; }
.lobby-course { white-space: normal; }
.lobby-course span { display: block; }
.lobby-course small { display: block; max-width: 30ch; margin-top: 2px; color: var(--muted); font-size: 0.8125rem; }
.lobby-note { white-space: normal; min-width: 12ch; max-width: 28ch; color: var(--muted); }
.lobby-state { display: inline-block; padding: 3px 10px; border-radius: 7px; font-weight: 700; font-size: 0.875rem; background: var(--night-deep); box-shadow: 2px 2px 0 var(--muted); }
.lobby-waiting { box-shadow: 2px 2px 0 var(--lime); }
.lobby-racing { box-shadow: 2px 2px 0 var(--cyan); }
.lobby-full { box-shadow: 2px 2px 0 var(--orange); }
.lobby-closed { color: var(--muted); font-style: italic; }
.lobby-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.lobby-watch { color: var(--muted); font-size: 0.8125rem; font-weight: 700; white-space: nowrap; }
.lobby-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.lobby-actions .button:disabled { opacity: 0.65; }
.lobby-sort { display: none; }
[data-lobbies]:focus { outline: none; }
[data-lobbies]:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
@media (max-width: 640px) {
  /* Cards: host and the join action first, the details wrap below. */
  .lobby-sort { display: grid; flex: 1 1 100%; }
  .lobby-table thead { display: none; } /* the Sort by menu replaces the column buttons */
  .lobby-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 14px 16px; }
  .lobby-table td { padding: 0; white-space: normal; font-size: 0.875rem; color: var(--muted); }
  .lobby-table td.rider { flex: 1 1 60%; min-width: 0; font-size: var(--step-body); color: var(--snow); }
  .lobby-table .lobby-action { margin-left: auto; }
  .lobby-table .lobby-action:has(.button-ghost) { flex: 1 1 100%; margin-left: 0; }
  .lobby-table .lobby-action:has(.button-ghost) .lobby-actions { justify-content: flex-start; }
  .lobby-table td:not(.rider):not(.lobby-action) { order: 1; }
  .lobby-note { max-width: none; min-width: 0; }
}

/* ---------- Sign up ---------- */
.form-status { color: var(--lime); font-weight: 600; }

/* ---------- Season pass = rider profile ---------- */
.pass {
  position: relative; width: min(380px, 100%); color: var(--night);
  background: var(--snow); border-radius: 18px; overflow: hidden;
  -webkit-mask: radial-gradient(circle 13px at 32px 28px, #0000 98%, #000 100%);
  mask: radial-gradient(circle 13px at 32px 28px, #0000 98%, #000 100%);
}
.pass-wrap { filter: drop-shadow(10px 10px 0 var(--orange)); rotate: -3deg; transition: rotate 300ms var(--ease-out), translate 300ms var(--ease-out); }
.pass-wrap:hover { rotate: 0deg; translate: 0 -4px; }
.pass-band { background: var(--orange); padding: 12px 18px 10px 62px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pass-band b { font-style: italic; font-weight: 900; font-size: 1.5rem; text-transform: uppercase; line-height: 1; }
.pass-band span { font-style: italic; font-weight: 900; font-size: 1.25rem; }
.pass-body { padding: 18px; display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 16px; }
.pass-photo { width: 104px; aspect-ratio: 88 / 112; background: var(--cyan); border-radius: 10px; display: grid; place-items: center; overflow: hidden; }
.pass-photo img { width: 82%; }
.pass-photo[data-tone="lime"] { background: var(--lime); }
.pass-photo[data-tone="purple"] { background: var(--purple); }
.pass-id { display: grid; gap: 10px; align-content: start; }
.pass-id .mark { width: 150px; }
.pass-lines { display: grid; gap: 6px; font: 600 0.8125rem/1.3 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.pass-lines div { display: flex; align-items: baseline; gap: 6px; }
.pass-lines dt { flex: none; }
.pass-lines .leader { flex: 1; min-width: 12px; border-bottom: 2px dotted #120d2e80; translate: 0 -3px; }
.pass-lines dd { font-weight: 800; }
.pass-stats { margin: 0 18px; background: var(--night); color: var(--snow); border-radius: 12px; padding: 14px 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
.pass-stats div { display: grid; gap: 2px; align-content: start; }
.pass-stats dt { font-size: 0.8125rem; color: var(--muted); line-height: 1.2; }
.pass-stats dd { font-style: italic; font-weight: 900; font-size: 1.25rem; line-height: 1.1; }
.pass-foot { padding: 14px 18px 16px; display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.barcode { display: flex; align-items: stretch; height: 34px; gap: 2px; }
.barcode i { display: block; background: var(--night); }
.pass-url { font: 700 0.8125rem/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; text-align: right; overflow-wrap: anywhere; }

/* Sign-up page: big pass on the left, form on the right, no empty column. */
.signup {
  padding: clamp(8px, 2vw, 24px) var(--margin) 0;
  display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 28px clamp(32px, 5vw, 80px);
  align-items: start; max-width: 1280px; margin: 0 auto; width: 100%;
}
.signup-head { grid-column: 1 / -1; display: grid; gap: 10px; }
.signup-head p { color: var(--muted); font-size: var(--step-lead); max-width: 60ch; }
.signup-head .closed { font-size: var(--step-body); color: var(--snow); }
.signup-head .closed strong { color: var(--lime); font-style: italic; text-transform: uppercase; font-weight: 900; margin-right: 6px; }
.signup-pass { position: sticky; top: 24px; display: grid; justify-items: center; padding: 8px 0 24px; }
.pass-lg { zoom: 1.32; }
.signup-form { background: var(--panel); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); display: grid; gap: 22px; }
.signup-form .field { gap: 8px; }
.signup-form .help { color: var(--muted); }
.signup-form .avatar-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.signup-form .avatar-group legend { display: none; }
.signup-submit { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.signup-submit .form-status { color: var(--muted); font-weight: 600; }

.signup-pass { grid-row: span 2; }
.signup-login { grid-column: 2; background: var(--panel); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); display: grid; gap: 12px; }
.signup-login h2 { font-size: var(--step-lead); }
.login-row { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; }
.login-row input {
  flex: 1 1 240px; min-width: 0; min-height: 46px; padding: 0 14px; border-radius: 10px;
  font: 700 1rem/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--snow); background: var(--night-deep); border: 2px solid var(--panel-2);
}
.login-key { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 14px; }
[data-key-note], [data-key-status] { margin-top: 10px; }
.login-key code {
  font: 800 clamp(1.125rem, 1rem + 0.8vw, 1.5rem)/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.08em;
  background: var(--snow); color: var(--night); padding: 10px 16px; border-radius: 10px; box-shadow: 5px 5px 0 var(--orange); user-select: all;
}

/* Rider name on the photo box until the headshot file exists. */
.pass-photo img.headshot { width: 100%; height: 100%; object-fit: cover; }
.pass-photo { color: var(--night); }
.pass-rider { font-style: italic; font-weight: 900; text-transform: uppercase; font-size: 1.0625rem; line-height: 1; text-align: center; padding: 0 6px; overflow-wrap: anywhere; }
.pass-photo[data-tone="purple"] { color: var(--snow); }

/* Rider picker on /signup/. */
.help { font-size: 0.9375rem; }
.form-error { color: var(--orange); font-weight: 700; min-height: 0; }
.form-error:empty { display: none; }
.field input[aria-invalid="true"] { border-color: var(--orange); }
.avatars { display: grid; gap: 14px; width: 100%; justify-self: stretch; }
.field-label { font-weight: 700; color: var(--snow) !important; }
.avatar-group { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 8px; }
.avatar-group legend { padding: 0; margin-bottom: 8px; font-style: italic; font-weight: 800; text-transform: uppercase; color: var(--muted); }
.avatar-group, .avatar-grid { width: 100%; justify-self: stretch; }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.avatar-tile { position: relative; cursor: pointer; display: block; }
.avatar-tile input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.avatar-tile .pass-photo {
  width: 100%; border-radius: 10px; font-style: italic; font-weight: 900; text-transform: uppercase; font-size: 0.8125rem;
  text-align: center; overflow-wrap: anywhere; padding: 4px;
  transition: transform 140ms var(--ease-out), box-shadow 140ms var(--ease-out);
}
.avatar-tile:hover .pass-photo { transform: translateY(-2px); }
.avatar-tile input:checked + .pass-photo { box-shadow: 0 0 0 4px var(--night), 0 0 0 7px var(--orange); }
.avatar-tile input:focus-visible + .pass-photo { outline: 3px solid var(--lime); outline-offset: 7px; }

/* Mini pass: lobby list and player chip. */
.mini-pass {
  display: inline-grid; grid-template-columns: 40px auto; gap: 2px 12px; align-items: center;
  background: var(--snow); color: var(--night); border-radius: 12px; padding: 8px 18px 8px 8px;
  box-shadow: 5px 5px 0 var(--orange);
}
.mini-pass .pass-photo { width: 40px; grid-row: span 2; border-radius: 8px; }
.mini-pass .pass-rider { font-size: 0.875rem; padding: 0; }
.mini-pass b { font-style: italic; font-weight: 900; text-transform: uppercase; line-height: 1; }
.mini-pass span { font: 600 0.8125rem/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

.account { padding: 0 var(--margin); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.account-side { display: grid; gap: 28px; max-width: 560px; }
.account-side p { color: var(--muted); }
.account-side h2 { margin-bottom: 12px; }
.notice { background: var(--panel); border-radius: var(--radius); padding: 20px 22px; display: grid; gap: 8px; }
.notice strong { color: var(--lime); font-style: italic; text-transform: uppercase; font-weight: 900; }

/* ---------- Entrances ---------- */
.rise { animation: rise 700ms var(--ease-out) both; animation-delay: calc(var(--d, 0) * 80ms); }
@keyframes rise { from { opacity: 0; translate: 0 22px; } }


/* Sections rise in as they scroll into view, part by part. Without support they simply show. */
@supports (animation-timeline: view()) {
  .section > *, .coop-copy > *, .feature-list > li, .top-riders > li, .pass-cta-copy > * {
    animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 70%;
  }
}

/* ---------- Narrow screens ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 0; }
  .hero-logo { max-width: 680px; }
  .coop, .pass-cta, .account { grid-template-columns: 1fr; }
  .pass-demo { justify-self: start; }
  .site-footer { grid-template-columns: 1fr; }
  .site-footer .fine { grid-column: auto; }
  .account .pass-wrap { justify-self: center; }
  .signup { grid-template-columns: 1fr; }
  .signup-login { grid-column: auto; }
  .signup-pass { grid-row: auto; }
  .signup-pass { position: static; }
  .pass-lg { zoom: 1; }
}
@media (max-width: 560px) {
  .hero .sparkle { display: none; }
  .coop-demo { grid-template-columns: 1fr; gap: 0; }
  /* Stacked screens: the lanes run down (picture to player 2) and up (controller to player 1). */
  .coop-link { grid-template-columns: 8px 8px; justify-content: center; gap: 28px; height: 84px; padding: 18px 0; box-sizing: content-box; }
  .lane { width: 8px; height: 100%; }
  .lane i { left: 0; width: 100%; height: 26%; }
  .lane.video i { animation-name: to-down; }
  .lane.input i { animation-name: to-up; }
  .coop-demo figcaption { flex-direction: column; align-items: center; gap: 6px; }
  .top-riders li:not(.top-empty) { grid-template-columns: 3ch 44px minmax(0, 1fr) auto; padding-right: 14px; }
  .top-face { width: 44px; height: 56px; }
  .top-detail { display: none; }
  .search { max-width: none; }
  .signup-form .avatar-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 12px; }
  /* Each leaderboard row scrolls on its own; the padding keeps the skewed focus ring inside the scroll box. */
  .board-tabs { overflow: visible; padding-bottom: 0; }
  .tab-row { flex-wrap: nowrap; overflow-x: auto; margin: -8px -12px 0; padding: 8px 12px 12px; }
  th, td { padding: 10px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0ms !important; }
  .pass-wrap:hover { rotate: -3deg; translate: none; }
}

/* ---------- Controls: blueprint sheets (/controls/) ---------- */
.sheet {
  --paper: #0b1f57; --line: #dff4ff; --grid: #22d3ff1f;
  margin: 0 var(--margin) 28px; border-radius: var(--radius); overflow: hidden;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 24px 24px,
    radial-gradient(120% 100% at 50% 0%, #15308a 0%, var(--paper) 70%);
  box-shadow: inset 0 0 0 2px #22d3ff59, 10px 10px 0 var(--night-deep);
  color: var(--line);
}
.sheet-title {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; padding: 14px 20px;
  border-bottom: 2px solid #22d3ff59; font: 600 0.8125rem/1.3 ui-monospace, "SF Mono", Menlo, Consolas, monospace; text-transform: uppercase; letter-spacing: 0.06em;
}
.sheet-title strong { font: italic 900 var(--step-lead)/1 "Exo 2", sans-serif; letter-spacing: 0; color: var(--snow); }
.sheet-title span:last-child { margin-left: auto; color: #9fd8f0; }
.sheet-drawing { padding: clamp(8px, 2vw, 24px); }
.sheet figcaption { padding: 14px 20px 18px; border-top: 2px dashed #22d3ff40; color: #bfe6f7; max-width: 90ch; }

.bp-svg { width: 100%; height: auto; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; overflow: visible; }
.bp-svg .g-move, .controls-table .g-move { --c: var(--cyan); }
.bp-svg .g-air, .controls-table .g-air { --c: var(--orange); }
.bp-svg .g-grab, .controls-table .g-grab { --c: var(--lime); }
.bp-svg .g-boost, .controls-table .g-boost { --c: var(--snow); }
.bp-svg .g-system, .controls-table .g-system { --c: var(--muted); }
.bp-svg .g-unused, .controls-table .g-unused { --c: #b4bede; }
.bp-svg .g-page, .bp-svg .bp-page, .controls-table .g-page { --c: #9fd8f0; }
.bp-svg .g-unused > :first-child, .bp-svg .bp-callout.g-unused polyline { stroke-dasharray: 5 5; }

.bp-body path:first-child { fill: #22d3ff0d; stroke: var(--line); stroke-width: 2.5; }
.bp-faint { fill: none; stroke: #dff4ff55; stroke-width: 1.5; stroke-dasharray: 6 6; }
.bp-axis { fill: none; stroke: #22d3ff40; stroke-width: 1; stroke-dasharray: 18 6 3 6; }
.bp-part > :first-child { fill: #0b1f57; stroke: var(--c); stroke-width: 2.5; transition: fill 150ms ease, stroke-width 150ms ease; }
.bp-part.lit > :first-child, .bp-part:hover > :first-child { fill: color-mix(in oklab, var(--c) 35%, #0b1f57); stroke-width: 4; }
.bp-glyph { fill: var(--c); font: italic 900 22px "Exo 2", sans-serif; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.bp-callout polyline { fill: none; stroke: var(--c); stroke-width: 1.75; opacity: 0.75; transition: opacity 150ms ease, stroke-width 150ms ease; }
.bp-callout.lit polyline { opacity: 1; stroke-width: 3; }
.bp-dot { fill: var(--c); }
.bp-name { fill: var(--c); font-size: 19px; font-weight: 700; letter-spacing: 0.04em; }
.bp-act { fill: var(--line); font-size: 17px; }
.bp-callout.lit .bp-act { fill: var(--snow); font-weight: 700; }

.bp-plate { fill: #22d3ff0a; stroke: var(--line); stroke-width: 2.5; }
.bp-key rect { fill: none; stroke: #dff4ff4d; stroke-width: 1.5; }
.bp-key .bp-legend { fill: #dff4ffb3; font-size: 15px; }
.bp-key.bp-part rect, .bp-key.bp-page rect { stroke: var(--c); stroke-width: 2.5; fill: #0b1f57; }
.bp-key.bp-part .bp-legend, .bp-key.bp-page .bp-legend { fill: var(--snow); font-weight: 700; }
.bp-tag { fill: var(--c); font-size: 15px; font-weight: 700; }
.bp-key-legend rect { fill: var(--c); }

/* Table and key caps. */
.controls-table { padding-top: clamp(40px, 5vw, 72px); }
.controls-table .table-wrap { margin: 0; }
.controls-table th[scope="row"] { font-weight: 700; white-space: normal; }
/* Group swatch, the same shape as the drawing key. */
.controls-table th[scope="row"]::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 10px; border-radius: 3px; background: var(--c); vertical-align: -1px; }
.controls-table td { white-space: normal; }
.controls-table tr.lit { background: color-mix(in oklab, var(--c) 18%, var(--panel)); }
kbd {
  display: inline-block; min-width: 2em; padding: 2px 8px; margin: 2px 6px 2px 0; text-align: center;
  font: 700 0.875rem/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;
}

@media (max-width: 720px) {
  /* Keep the drawings readable: scroll them sideways instead of shrinking the labels. */
  .sheet-drawing { overflow-x: auto; overscroll-behavior-x: contain; }
  .bp-svg { min-width: 720px; }
  .sheet-title span:last-child { margin-left: 0; }
}

.controls-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-top: 18px; }
.controls-notes p { color: var(--muted); }

/* ---------- Dialogs (/dialog.js): replaces window.confirm ---------- */
.club-dialog {
  width: min(520px, 100vw - 32px); max-width: none; padding: 0; border: 0; overflow: visible;
  background: transparent; color: var(--snow);
  opacity: 1; scale: 1; transition: opacity 200ms var(--ease-out), scale 200ms var(--ease-out);
}
@starting-style { .club-dialog[open] { opacity: 0; scale: 0.96; } }
.club-dialog::backdrop { background: #08061ae0; }
.club-dialog form {
  display: grid; gap: 12px; padding: 28px 28px 30px; border-radius: var(--radius);
  background: var(--panel); box-shadow: 0 0 0 2px #f4f8ff1f, 10px 10px 0 var(--orange);
}
.club-dialog h2 { font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem); }
.club-dialog p { color: var(--muted); max-width: 40ch; }
.club-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 14px 18px; padding-top: 12px; }
@media (prefers-reduced-motion: reduce) { .club-dialog { transition: none; } }
.sheet-tabs { padding: 0 calc(var(--margin) + 4px) 14px; }

/* ---------- Settings (/account/settings/) ---------- */
.settings { padding: 0 var(--margin); display: grid; gap: 18px; max-width: 860px; }
.setting { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 32px; align-items: center; padding: clamp(20px, 3vw, 32px); border-radius: var(--radius); background: var(--panel); }
.setting h2 { font-size: var(--step-lead); }
.setting p { color: var(--muted); margin-top: 8px; max-width: 60ch; }
.switch {
  position: relative; display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 0;
  border: 0; background: none; color: var(--snow); font: italic 900 1rem/1 "Exo 2", sans-serif; text-transform: uppercase; cursor: pointer;
}
.switch::before { content: ""; width: 64px; height: 36px; border-radius: 99px; background: var(--panel-2); box-shadow: inset 0 0 0 2px #f4f8ff33; transition: background-color 150ms; }
.switch-knob { position: absolute; left: 4px; top: 50%; width: 28px; height: 28px; margin-top: -14px; border-radius: 50%; background: var(--snow); transition: translate 200ms var(--ease-out); }
.switch[aria-checked="true"]::before { background: var(--lime); box-shadow: none; }
.switch[aria-checked="true"] .switch-knob { translate: 28px 0; background: var(--night); }
.switch-state { min-width: 3ch; }
.switch:disabled { cursor: wait; opacity: 0.7; }
.switch:focus-visible { outline: 3px solid var(--lime); outline-offset: 4px; border-radius: 99px; }
@media (max-width: 560px) { .setting { grid-template-columns: 1fr; } }

/* Onboarding uses the club typography and existing action buttons. */
.coop-copy .actions { margin-top: 24px; }
.bring-game { display: grid; gap: 20px; }
.bring-game > p { max-width: 70ch; }
