/* AIL Cup — pit-wall timing screen for a 1:10 robot racing league */
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(../fonts/barlow-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url(../fonts/barlow-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(../fonts/barlow-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(../fonts/barlow-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url(../fonts/barlow-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-display: swap; src: url(../fonts/barlow-condensed-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(../fonts/barlow-condensed-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(../fonts/barlow-condensed-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(../fonts/barlow-condensed-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(../fonts/barlow-condensed-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF; }

:root {
  --bg: #e9edf1;
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --ink: #14243b;
  --muted: #5b6b7f;
  --line: #cbd3dc;
  --signal: #f2c230;
  --signal-ink: #14243b;
  --kerb: #d7262e;
  --go: #1c9a57;
  --energy: #0e9aab;
  --track: #3a4553;
  --track-edge: #f4f6f9;
  --focus: #2f6fde;
  --radius: 10px;
  --gutter: 16px;
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12171d; --surface: #1b222b; --surface-2: #222a35; --ink: #e8edf3; --muted: #93a1b2;
    --line: #2d3742; --kerb: #ff4a52; --go: #34c27a; --energy: #2cc4d6; --track: #2a323d;
    --track-edge: #c9d2dc; --focus: #7aa7ff; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 "Barlow", system-ui, sans-serif;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
h1, h2, h3, .cond { font-family: "Barlow Condensed", "Barlow", sans-serif; font-weight: 700; letter-spacing: .01em; line-height: 1.1; }
h1 { font-size: 2rem; margin: 0 0 .25rem; }
h2 { font-size: 1.45rem; margin: 0 0 .75rem; }
h3 { font-size: 1.15rem; margin: 0 0 .5rem; font-weight: 600; }
p { margin: 0 0 .75rem; }
a { color: inherit; }
.num, td.num, .time { font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- header: the kerb stripe is the one loud element ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar::before {
  content: ""; display: block; height: 6px;
  background: repeating-linear-gradient(90deg, var(--kerb) 0 22px, #fff 22px 44px);
}
.topbar-inner { max-width: 1040px; margin: 0 auto; padding: 10px var(--gutter); display: flex; align-items: center; gap: 12px; }
.wordmark { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.5rem; text-decoration: none; letter-spacing: .02em; }
.wordmark span { color: var(--muted); font-weight: 500; }
@media (max-width: 599px) { .wordmark span { display: none; } }
.topbar .spacer { flex: 1; }
.who { font-size: .875rem; color: var(--muted); text-align: right; line-height: 1.2; }
.who b { color: var(--ink); font-weight: 600; }

/* ---------- nav: bottom bar on phones, inline on desktop ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line); display: flex;
}
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: .75rem; font-weight: 500; min-width: 0;
}
.nav a svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] svg { stroke: var(--ink); }
.nav a[aria-current="page"]::after { content: ""; width: 20px; height: 3px; border-radius: 2px; background: var(--signal); margin-top: 2px; }
@media (min-width: 860px) {
  body { padding-bottom: 0; }
  .nav { position: static; height: auto; border: 0; background: none; gap: 4px; padding: 0; }
  .nav a { flex: none; flex-direction: row; font-size: .95rem; padding: 8px 12px; border-radius: 8px; gap: 8px; }
  .nav a svg { width: 18px; height: 18px; }
  .nav a[aria-current="page"] { background: var(--surface-2); }
  .nav a[aria-current="page"]::after { display: none; }
  .topbar-inner { gap: 20px; }
}

main { max-width: 1040px; margin: 0 auto; padding: 20px var(--gutter) 40px; }
.stack > * + * { margin-top: 16px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2, .panel-head h3 { margin: 0; }
.grid2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid2 { grid-template-columns: 1fr 1fr; } }

/* ---------- status chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px; font-size: .8rem; font-weight: 600; border: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.chip.live { background: var(--kerb); color: #fff; border-color: var(--kerb); }
.chip.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blink 1.2s infinite; }
.chip.practice { background: var(--signal); color: var(--signal-ink); border-color: var(--signal); }
.chip.finished { color: var(--muted); }
.chip.ok { color: var(--go); border-color: currentColor; background: none; }
.chip.bad { color: var(--kerb); border-color: currentColor; background: none; }
@keyframes blink { 50% { opacity: .2; } }

/* ---------- weekend hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero .round { color: var(--muted); font-weight: 500; }
.hero h1 { font-size: clamp(2rem, 7vw, 3rem); }
.countdown { display: flex; gap: 18px; margin: 14px 0 4px; flex-wrap: wrap; }
.countdown .unit { min-width: 56px; }
.countdown .v { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 2.4rem; line-height: 1; font-variant-numeric: tabular-nums; }
.countdown .l { font-size: .8rem; color: var(--muted); }
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 14px; }
.timeline div { border-top: 4px solid var(--line); padding-top: 6px; font-size: .78rem; color: var(--muted); line-height: 1.25; }
.timeline div.done { border-color: var(--ink); color: var(--ink); }
.timeline div.now { border-color: var(--signal); color: var(--ink); font-weight: 600; }
.timeline b { display: block; font-weight: 600; color: var(--ink); }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.kv > div { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
.kv .k { font-size: .8rem; color: var(--muted); }
.kv .v { font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: 1.35rem; font-variant-numeric: tabular-nums; }

/* ---------- forms ---------- */
label { display: block; font-weight: 500; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.field .hint { font-size: .85rem; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 6px; padding: 10px 12px; min-height: 44px;
}
textarea.code { font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; min-height: 320px; tab-size: 4; white-space: pre; }
input[type=range] { width: 100%; accent-color: var(--ink); height: 32px; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--ink); vertical-align: middle; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1 1 160px; min-width: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  font: 600 1rem "Barlow", sans-serif; border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); cursor: pointer; text-decoration: none;
}
.btn.primary { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.btn.danger { color: var(--kerb); border-color: currentColor; background: none; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }

.param { padding: 12px 0; border-bottom: 1px solid var(--line); }
.param:last-child { border-bottom: 0; }
.param .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.param .val { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.param .help { font-size: .85rem; color: var(--muted); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; max-width: 100%; flex-wrap: wrap; }
.seg button { font: 600 .9rem "Barlow", sans-serif; border: 0; background: var(--surface); color: var(--muted); padding: 8px 12px; min-height: 40px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }

.notice { border-left: 4px solid var(--signal); background: var(--surface-2); padding: 10px 12px; border-radius: 0 8px 8px 0; }
.notice.err { border-color: var(--kerb); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 50; background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 8px; max-width: calc(100vw - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.err { background: var(--kerb); color: #fff; }
@media (min-width: 860px) { .toast { bottom: 24px; } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th { text-align: left; font-weight: 500; font-size: .8rem; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.pos { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.15rem; width: 36px; }
th.r, td.r { text-align: right; }
.swatch { display: inline-block; width: 4px; height: 18px; border-radius: 2px; vertical-align: middle; margin-right: 8px; }
.me td { background: color-mix(in srgb, var(--signal) 18%, transparent); }

/* ---------- energy gauge ---------- */
.gauge { position: relative; height: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; min-width: 80px; }
.gauge > i { position: absolute; inset: 0 auto 0 0; background: var(--energy); }
.gauge.over > i { background: var(--kerb); }

.runs { list-style: none; padding: 0; margin: 0; }
.runs li { border-top: 1px solid var(--line); padding: 12px 0; }
.runs li:first-child { border-top: 0; }
.laps { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.laps span { background: var(--surface-2); border-radius: 6px; padding: 2px 8px; font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-variant-numeric: tabular-nums; }
.laps span.best { background: color-mix(in srgb, var(--go) 22%, transparent); }
pre.log { background: var(--surface-2); border-radius: 8px; padding: 10px; font-size: .8rem; overflow-x: auto; white-space: pre-wrap; max-height: 220px; }

/* ---------- viewer ---------- */
.viewer { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 860px) { .viewer { grid-template-columns: 1fr 280px; } }
.viewer canvas { width: 100%; display: block; background: var(--surface-2); touch-action: pan-y; }
.viewer .stage { position: relative; }
.viewer .clock { position: absolute; left: 12px; top: 10px; font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.4rem; font-variant-numeric: tabular-nums; background: color-mix(in srgb, var(--surface) 85%, transparent); padding: 0 8px; border-radius: 6px; }
.viewer .badge { position: absolute; right: 12px; top: 12px; }
.viewer .controls { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.viewer .controls input[type=range] { flex: 1 1 140px; }
.tower { border-left: 1px solid var(--line); }
@media (max-width: 859px) { .tower { border-left: 0; border-top: 1px solid var(--line); } }
.tower ol { list-style: none; margin: 0; padding: 0; }
.tower li { display: grid; grid-template-columns: 26px 4px 1fr auto; align-items: center; gap: 8px; padding: 7px 12px; border-bottom: 1px solid var(--line); }
.tower li .p { font-family: "Barlow Condensed", sans-serif; font-weight: 700; }
.tower li .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tower li .g { font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; }
.tower li .gauge { grid-column: 3 / 5; height: 6px; }
.tower li.out .n { color: var(--muted); text-decoration: line-through; }
.tower h3 { padding: 10px 12px 6px; margin: 0; }

.segs { list-style: none; margin: 0; padding: 0; }
.segs li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.segs li:first-child { border-top: 0; }
.segs .t { font-weight: 600; }

.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; -webkit-overflow-scrolling: touch; }
.tabs button { flex: none; font: 600 .95rem "Barlow", sans-serif; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 6px 14px; min-height: 40px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }

.auth { max-width: 420px; margin: 4vh auto 0; }
.auth .brand { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 3.2rem; line-height: .95; margin-bottom: 6px; }
.auth .brand small { display: block; font-size: 1.1rem; color: var(--muted); font-weight: 500; margin-top: 6px; }
.token-list { font: 600 1.05rem ui-monospace, Menlo, Consolas, monospace; background: var(--surface-2); padding: 12px; border-radius: 8px; word-break: break-all; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.viewer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.viewer-head h3 { margin: 0; }
#viewer { scroll-margin-top: 80px; }

/* =================================================================== */
/* Public site: landing + rules                                         */
/* =================================================================== */
.pubnav { display: flex; align-items: center; gap: 4px; }
.pubnav a:not(.btn) { text-decoration: none; color: var(--muted); font-weight: 500; padding: 8px 10px; border-radius: 8px; }
.pubnav a[aria-current="page"]:not(.btn) { color: var(--ink); background: var(--surface-2); }
@media (max-width: 420px) { .pubnav a:not(.btn) { padding: 8px 6px; font-size: .95rem; } }
.btn.ghost { background: transparent; color: inherit; border-color: currentColor; }

/* hero: full-bleed night band */
.hero2 {
  --night: #0d1726; --night-ink: #e8edf3; --night-muted: #9fb0c4;
  width: 100vw; margin-left: calc(50% - 50vw); margin-top: -20px;
  background: var(--night); color: var(--night-ink);
  display: grid; grid-template-columns: 1fr; gap: 20px;
  padding: 28px max(var(--gutter), calc((100vw - 1040px) / 2 + var(--gutter))) 24px;
  border-bottom: 6px solid transparent;
  border-image: repeating-linear-gradient(90deg, var(--kerb) 0 22px, #fff 22px 44px) 6;
}
.hero2 h1 { font-size: clamp(2.6rem, 11vw, 4.6rem); line-height: .92; margin: 0 0 14px; letter-spacing: -.005em; }
.hero2 h1 span { color: var(--signal); }
.hero2 .lede { color: var(--night-muted); font-size: 1.08rem; max-width: 34em; margin-bottom: 18px; }
.hero2 .cta { display: flex; flex-wrap: wrap; gap: 10px; }
.hero2 .btn.ghost { color: var(--night-ink); border-color: rgba(232,237,243,.35); }
.hero2 .btn.ghost:hover { border-color: var(--night-ink); }
.hero-visual { position: relative; min-width: 0; }
.hero-stage { border-radius: 12px; overflow: hidden; background: #0b1422; }
.hero-stage canvas { display: block; width: 100%; }
.hero-stage.empty { display: none; }
.hero-cap { color: var(--night-muted); font-size: .85rem; margin: 8px 2px 0; }
.hero-tower { font-family: "Barlow Condensed", sans-serif; margin-top: 10px; background: rgba(13,23,38,.92);
  border: 1px solid rgba(232,237,243,.14); border-radius: 10px; padding: 8px 10px; font-variant-numeric: tabular-nums; }
.hero-tower:empty { display: none; }
.hero-tower .tw-head { display: flex; justify-content: space-between; color: var(--signal); font-weight: 600; font-size: .95rem; padding-bottom: 4px; border-bottom: 1px solid rgba(232,237,243,.14); margin-bottom: 4px; }
.hero-tower ol { list-style: none; margin: 0; padding: 0; }
.hero-tower li { display: grid; grid-template-columns: 18px 4px 1fr auto 46px; align-items: center; gap: 8px; padding: 3px 0; font-size: 1.02rem; }
.hero-tower li b { color: var(--night-muted); font-weight: 600; text-align: right; }
.hero-tower li .sw { width: 4px; height: 16px; border-radius: 2px; }
.hero-tower li .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-tower li .g { color: var(--night-muted); text-align: right; white-space: nowrap; }
.hero-tower li.out .n { text-decoration: line-through; color: var(--night-muted); }
.hero-tower .bat { position: relative; height: 6px; border-radius: 3px; background: rgba(232,237,243,.14); overflow: hidden; }
.hero-tower .bat i { position: absolute; inset: 0 auto 0 0; background: #2cc4d6; }
.hero-tower .bat.low i { background: var(--kerb); }
.hero2 .cta { align-items: center; }
.hero2 .textlink { color: var(--night-ink); font-weight: 600; padding: 0 6px; text-underline-offset: 4px; }
@media (min-width: 900px) {
  .hero2 { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: 40px; padding-top: 44px; padding-bottom: 40px; }
  .hero-tower ol { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
}

.stats-line { font-family: "Barlow Condensed", sans-serif; font-size: 1.15rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 4px 0 0; }
.stats-line b { color: var(--ink); font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.stats-line .stat { white-space: nowrap; }
.stats-line .stat + .stat::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--line); margin: 0 10px 0 0; vertical-align: middle; }

.next-up h2 { font-size: 1.9rem; margin: 6px 0 0; }

/* scoreboard */
.board { list-style: none; margin: 0; padding: 0; }
.board li { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--line); }
.board li:first-child { border-top: 0; }
.board .pos { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.8rem; text-align: center; color: var(--muted); line-height: 1; }
.board li.podium .pos { color: var(--ink); }
.board li.p1 .pos { background: var(--signal); color: var(--signal-ink); border-radius: 8px; padding: 6px 0; }
.board .bwho { min-width: 0; display: grid; gap: 4px; text-align: left; }
.board .h { font-weight: 600; font-size: 1.12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .meta { font-size: .82rem; color: var(--muted); }
.board .pbar { height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.board .pbar i { display: block; height: 100%; border-radius: 2px; }
.board .pts { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 2rem; font-variant-numeric: tabular-nums; text-align: right; line-height: 1; }
.board .pts small { display: block; font-size: .78rem; font-weight: 500; color: var(--muted); }
.board-empty { padding: 26px 8px; text-align: center; color: var(--muted); }

/* how it works: a real sequence, so numbered */
.how h2 { margin-bottom: 14px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: s; grid-template-columns: 1fr; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li { counter-increment: s; border-top: 4px solid var(--ink); padding-top: 10px; }
.steps li:last-child { border-top-color: var(--signal); }
.steps li::before { content: counter(s); font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 2.4rem; line-height: 1; color: var(--muted); display: block; margin-bottom: 4px; }
.steps h3 { font-size: 1.3rem; margin-bottom: 4px; }
.steps p { color: var(--muted); margin: 0; }

/* two cups */
.cups { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .cups { grid-template-columns: 1fr 1fr; } }
.cup { padding: 20px; border-radius: var(--radius); color: var(--night-ink, #e8edf3); }
.cup.eff { background: #0e6b78; }
.cup.race { background: #14243b; }
.cup h2 { font-size: 2rem; margin-bottom: 8px; }
.cup p { color: rgba(232,237,243,.85); }
.cup ul { margin: 0; padding-left: 18px; color: rgba(232,237,243,.85); }
.cup.race h2 { color: var(--signal); }

.site-foot { border-top: 1px solid var(--line); padding-top: 16px; color: var(--muted); }
.site-foot p { margin: 0 0 6px; }

/* rules */
.rules-head h1 { font-size: clamp(2.4rem, 9vw, 3.6rem); }
.rules-head .lede { color: var(--muted); max-width: 40em; }
.rules-body { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
.rules-body > *, .rules-text { min-width: 0; }
@media (min-width: 900px) { .rules-body { grid-template-columns: 220px minmax(0, 1fr); } .rules-toc { position: sticky; top: 90px; align-self: start; } }
.rules-toc ol { margin: 0; padding-left: 22px; font-family: "Barlow Condensed", sans-serif; font-size: 1.05rem; }
.rules-toc li { padding: 3px 0; }
.rules-toc a { text-decoration: none; color: var(--muted); }
.rules-toc a:hover { color: var(--ink); }
@media (max-width: 899px) { .rules-toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
  .rules-toc ol { columns: 2; column-gap: 18px; } }
.rules-text { counter-reset: rule; max-width: 46em; }
.rule { counter-increment: rule; padding: 18px 0; border-top: 1px solid var(--line); scroll-margin-top: 84px; }
.rule:first-child { border-top: 0; padding-top: 0; }
.rule h2 { display: flex; gap: 12px; align-items: baseline; }
.rule h2::before { content: counter(rule); color: var(--signal-ink); background: var(--signal); border-radius: 6px; min-width: 32px; text-align: center; padding: 2px 6px; font-size: 1.1rem; }
.rule ul { padding-left: 20px; margin: 0 0 10px; }
.rule li { margin-bottom: 6px; }
.rule .val { font-family: "Barlow Condensed", sans-serif; font-size: 1.12em; font-variant-numeric: tabular-nums; }
.rule td.wrap { white-space: normal; min-width: 180px; }
.points-table th, .points-table td { padding: 6px 8px; }
pre.code-sample { background: #0d1726; color: #e8edf3; border-radius: 10px; padding: 14px; overflow-x: auto; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
