/* Kanit (SIL OFL 1.1, see assets/fonts/OFL.txt), bundled so the page makes no outside requests */
@font-face { font-family: "Kanit"; font-style: normal; font-weight: 300; font-display: swap; src: url("assets/fonts/kanit-300.woff2") format("woff2"); }
@font-face { font-family: "Kanit"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/kanit-400.woff2") format("woff2"); }
@font-face { font-family: "Kanit"; font-style: normal; font-weight: 500; font-display: swap; src: url("assets/fonts/kanit-500.woff2") format("woff2"); }
@font-face { font-family: "Kanit"; font-style: normal; font-weight: 600; font-display: swap; src: url("assets/fonts/kanit-600.woff2") format("woff2"); }

/* PuzzleBang 2026 palette (from the hunt's own stylesheet) */
:root {
  --night-deepest: #05070d;
  --night-deep: #0a1019;
  --night-mid: #12212a;
  --night-teal: #1d3a3a;
  --moonlit-teal: #284b42;
  --corn-gold: #f5c542;
  --corn-gold-light: #f8d572;
  --on-gold: #0b1f14;
  --leaf-green: #b6e36b;
  --sage: #a9c79b;
  --cream: #eaf0dc;
  --sage-light: #cfe0b6;
  --muted-green: #7fa274;

  --line: rgba(234, 240, 220, .12);
  --line-strong: rgba(234, 240, 220, .26);
  --hover: rgba(234, 240, 220, .05);
  --wrong: #ec8a7c;
  --radius: 14px;
  --font: "Kanit", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.puzzlebang-root { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--night-deepest); color: var(--cream); font: 300 16px/1.5 var(--font); }
b, strong, h1, h2, h3, h4 { font-weight: 500; }
a { color: var(--corn-gold); text-decoration: none; }
a:hover { color: var(--corn-gold-light); }
button, input, select { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); font-size: .86em; }
:focus-visible { outline: 2px solid var(--corn-gold); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--corn-gold); color: var(--on-gold); padding: 8px 14px; border-radius: 20px; }
.skip:focus { left: 8px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted-green); }
.spacer { flex: 1; }
.loading, .empty { padding: 56px 16px; text-align: center; color: var(--sage-light); }

/* ---------- Header, nav, footer ---------- */
.main-header { position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; gap: 16px; padding: 12px 24px; }
.header-skyline { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; object-position: right bottom; pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent 30%, #000 80%); mask-image: linear-gradient(to right, transparent 30%, #000 80%); }
.logo { flex: none; display: block; }
.logo img { width: 60px; height: 60px; display: block; }
.title-wrapper { color: inherit; flex: 1; min-width: 0; }
.title-wrapper:hover { color: inherit; }
.title { margin: 0; font-size: 1.7rem; line-height: 1.15; white-space: nowrap; }
.subtitle { margin: 0; font-size: 1.05rem; color: var(--sage-light); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.snapshot { font-size: .85rem; color: var(--muted-green); font-weight: 300; }
.site-nav { display: flex; gap: 6px; flex: none; padding: 4px; border-radius: 24px; background: rgba(5,7,13,.72); border: 1px solid var(--line); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.site-nav a { flex: none; padding: 6px 16px; border-radius: 20px; color: var(--sage-light); font-weight: 500; white-space: nowrap; }
.site-nav a:hover { background: var(--hover); color: var(--cream); }
.site-nav a.active { background: var(--corn-gold); color: var(--on-gold); }
.main-wrapper { flex: 1; border-top: 5px solid var(--cream); border-bottom: 5px solid var(--cream); background: var(--night-deep); padding: 4px 0 56px; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; outline: none; }
.main-footer { display: flex; justify-content: center; align-items: flex-end; min-height: 100px; padding: 16px; text-align: center; font-size: .85rem; color: var(--muted-green);
  background: var(--night-deepest) url("assets/cornfield.svg") repeat-x bottom center / auto 100%; }
.main-footer a { color: var(--sage); }

/* ---------- Shared building blocks ---------- */
section { margin-top: 40px; }
.section-title { margin: 0 0 12px; font-size: 1.35rem; }
.section-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-row .section-title { margin: 0; }
.controls { display: flex; gap: 10px; align-items: center; }
.page-head { margin: 28px 0 22px; }
.page-head h2 { margin: 0; font-size: 2rem; line-height: 1.2; }
.page-head p { margin: 4px 0 0; color: var(--sage-light); }
.eyebrow { display: block; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-green); font-weight: 400; }
.panel { background: var(--night-mid); border-radius: var(--radius); }
.foot { margin: 10px 0 0; font-size: .85rem; color: var(--muted-green); }
.back { display: inline-block; margin-top: 22px; color: var(--sage-light); font-size: .95rem; }
.back:hover { color: var(--cream); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grid2.stretch { align-items: stretch; }
.table-wrap { overflow-x: auto; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 18px; border: 1px solid var(--line-strong); background: transparent; color: var(--cream); cursor: pointer; font-weight: 500; font-size: .9rem; white-space: nowrap; }
.btn:hover { background: var(--hover); color: var(--cream); }
.btn.gold { background: var(--corn-gold); border-color: var(--corn-gold); color: var(--on-gold); min-width: 96px; }
.btn.gold:hover { background: var(--corn-gold-light); }
.btn:disabled { opacity: .45; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--corn-gold); cursor: pointer; font-weight: 500; }
.seg { display: inline-flex; background: var(--night-deep); border: 1px solid var(--line-strong); border-radius: 18px; padding: 0; }
.seg button { border: 0; background: transparent; border-radius: 17px; height: 34px; padding: 0 14px; cursor: pointer; color: var(--sage-light); font-size: .9rem; white-space: nowrap; }
.seg button.active { background: var(--corn-gold); color: var(--on-gold); font-weight: 500; }

/* Kernels: one per puzzle */
.kernels { display: inline-flex; gap: 3px; align-items: center; flex: none; }
.kernel { display: inline-block; width: 10px; height: 14px; flex: none; border-radius: 50% 50% 45% 45% / 62% 62% 38% 38%; background: rgba(234,240,220,.07); border: 1.5px solid rgba(234,240,220,.14); }
.kernel.gap { margin-left: 5px; }
.kernel.done { background: var(--corn-gold); border-color: var(--corn-gold); }
.kernel.accepted { background: linear-gradient(to top, var(--corn-gold) 50%, transparent 50%); border-color: var(--corn-gold); }
.kernel.open { border-color: var(--sage); }
.kernel.note { background: var(--sage); border-color: var(--sage); border-radius: 3px; }
.key { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 10px; font-size: .82rem; color: var(--muted-green); }
.swatch { display: inline-block; width: 14px; height: 10px; border-radius: 3px; background: rgba(234,240,220,.08); }
.swatch.done { background: var(--corn-gold); }
.swatch.open { background: var(--moonlit-teal); }
.key span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* ---------- Results ---------- */
.hero-card { background: var(--night-mid); border: 2px dashed var(--cream); border-radius: 44px; margin: 26px 10px 0; padding: 32px 40px;
  box-shadow: 0 0 0 8px var(--night-mid), 0 0 0 10px var(--cream), inset 0 0 0 8px var(--night-mid), inset 0 0 0 10px var(--cream); }
.hero-card h2 { margin: 0; font-size: 2.2rem; line-height: 1.15; }
.hero-card h2 em { font-style: normal; color: var(--corn-gold); }
.hero-card > p { margin: 6px 0 0; color: var(--sage-light); font-size: 1.05rem; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.tile { display: flex; flex-direction: column; min-width: 0; background: var(--night-deep); border-radius: 16px; padding: 12px 16px; }
.tile .label { font-size: .78rem; color: var(--muted-green); text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; }
.tile strong { font-size: 1.7rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.tile strong small { font-size: .55em; color: var(--sage); font-weight: 400; }
.tile .sub { font-size: .88rem; color: var(--sage-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.board { overflow: hidden; }
.lb { display: grid; grid-template-columns: 34px minmax(0, 1fr) 236px 84px 76px 70px 56px; gap: 14px; align-items: center; padding: 0 18px; }
.lb-head { height: 42px; border-bottom: 1px solid var(--line); }
.th { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-green); white-space: nowrap; }
.th:hover, .th.sorted { color: var(--cream); }
.lb .c { text-align: center; }
.lb .r { text-align: right; }
.lb-row { min-height: 58px; color: var(--cream); border-bottom: 1px solid var(--line); }
.lb-row:last-child { border-bottom: 0; }
.lb-row:hover { background: var(--hover); color: var(--cream); }
.place { font-variant-numeric: tabular-nums; color: var(--sage); font-weight: 500; }
.who { display: flex; flex-direction: column; min-width: 0; }
.who b, .who small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who b { font-size: 1.02rem; }
.who small { font-size: .84rem; color: var(--muted-green); }
.prog { display: flex; align-items: center; gap: 10px; }
.count { font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; }
.count small { color: var(--muted-green); font-weight: 300; }
.dnf { color: var(--muted-green); font-weight: 500; letter-spacing: .04em; }

.race-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
.race-chart { display: flex; padding: 14px 8px 6px 8px; min-width: 0; }
.race-y { flex: none; }
.race-y text, .race text { fill: var(--sage-light); font-size: 13px; font-family: var(--font); font-weight: 400; }
.race-scroll { flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: var(--moonlit-teal) transparent; padding-bottom: 6px; }
.race-scroll::-webkit-scrollbar { height: 8px; }
.race-scroll::-webkit-scrollbar-thumb { background: var(--moonlit-teal); border-radius: 4px; }
.adj { border-bottom: 1px dotted var(--muted-green); cursor: help; }
.scrub .cut { stroke: var(--cream); stroke-width: 1.5; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.scrub-legend .cut-key { display: inline-block; width: 0; height: 10px; border-left: 1.5px dashed var(--cream); margin-right: 6px; vertical-align: -1px; }
.race { display: block; max-width: none; user-select: none; }
.race .grid { stroke: rgba(234,240,220,.08); }
.race .series { fill: none; stroke: var(--sage); stroke-width: 1.6; stroke-opacity: .55; stroke-linejoin: round; }
.race .series.fin { stroke: var(--sage-light); stroke-opacity: .75; }
.race .series.dnf { stroke-dasharray: 4 4; }
.race.focus .series { stroke-opacity: .14; }
.race .series.hot { stroke: var(--corn-gold); stroke-opacity: 1; stroke-width: 2.6; }
.race .dot { fill: var(--sage-light); }
.race .bg { fill: transparent; }
.race .series { pointer-events: none; }
.race .series.hot { stroke-width: 3; }
.race-label { fill: var(--corn-gold) !important; font-size: 13px !important; font-weight: 500; paint-order: stroke; stroke: var(--night-mid); stroke-width: 4px; pointer-events: none; }
.race .cursor { stroke: var(--corn-gold); stroke-width: 1.5; stroke-opacity: .8; }
.standings { border-left: 1px solid var(--line); padding: 14px 16px; }
.standings-head { font-size: .85rem; color: var(--muted-green); margin-bottom: 6px; white-space: nowrap; }
.standings-head b { color: var(--cream); font-variant-numeric: tabular-nums; }
.standings ol { list-style: none; margin: 0; padding: 0; }
.standings li { display: grid; grid-template-columns: minmax(0, 1fr) auto 24px; gap: 10px; align-items: center; height: 30px; padding: 0 6px; margin: 0 -6px; border-radius: 8px; font-size: .9rem; }
.standings li.hot { background: rgba(245,197,66,.1); }
.standings li.out .nm { color: var(--muted-green); }
.standings li { cursor: pointer; }
.standings li.locked { box-shadow: inset 2px 0 0 var(--corn-gold); background: rgba(245,197,66,.1); }
.standings .nm { display: block; color: var(--cream); }
.standings .nm:hover { color: var(--corn-gold); }
.standings-foot { margin: 10px 0 0; font-size: .78rem; color: var(--muted-green); }
.standings .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.standings .kernel { width: 7px; height: 10px; border-width: 1px; }
.standings .kernel.gap { margin-left: 3px; }
.standings .ct { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; }
.standings .ct small { color: var(--muted-green); font-weight: 300; }

/* ---------- Compare ---------- */
.pcard, .hcard { padding: 18px 20px; }
.pcard h4, .hcard h4 { margin: 0; font-size: 1.15rem; }
.pgroup { margin-top: 14px; }
.pgroup-h { font-size: .85rem; color: var(--sage-light); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 64px; gap: 12px; align-items: center; height: 30px; color: var(--cream); border-radius: 8px; }
.bar-row:hover { color: var(--corn-gold); }
.bar-row .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .r { text-align: right; }
.bar { height: 10px; background: rgba(234,240,220,.05); border-radius: 5px; }
.bar i { display: block; height: 100%; border-radius: 5px; }
.bar i.fin { background: var(--corn-gold); }
.bar i.dnf { border: 1.5px solid var(--sage); }
.bar i.over { border-right: 0; border-radius: 5px 0 0 5px; -webkit-mask-image: linear-gradient(to right, #000 80%, transparent); mask-image: linear-gradient(to right, #000 80%, transparent); }
.hcard-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.hcard-head span { font-size: .88rem; color: var(--muted-green); white-space: nowrap; }
.hrow { display: grid; grid-template-columns: minmax(0, 1fr) auto 64px; gap: 14px; align-items: center; min-height: 50px; color: var(--cream); border-top: 1px solid var(--line); }
.hrow:hover { color: var(--cream); background: var(--hover); }
.hrow .r { text-align: right; }

/* ---------- Puzzles ---------- */
.pgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pz { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; color: var(--cream); border: 1px solid transparent; }
.pz:hover { color: var(--cream); border-color: var(--line-strong); }
.pz-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pz-top h4 { margin: 0; font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pz-top span { font-size: .78rem; color: var(--muted-green); white-space: nowrap; }
.pz-solved { display: grid; gap: 5px; font-size: .88rem; color: var(--sage-light); }
.solve-bar { height: 6px; border-radius: 3px; background: rgba(234,240,220,.08); overflow: hidden; }
.solve-bar i { display: block; height: 100%; background: var(--corn-gold); }
.pz dl { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; margin: 0; }
.pz dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-green); white-space: nowrap; }
.pz dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }

.matrix { border-collapse: separate; border-spacing: 3px; margin: 8px auto; font-size: .78rem; }
.matrix th { font-weight: 400; color: var(--sage); padding: 4px 2px; vertical-align: bottom; text-align: center; width: 64px; line-height: 1.2; }
.matrix th a { color: inherit; }
.matrix th a:hover { color: var(--cream); }
.matrix th.rowh { text-align: left; width: auto; padding-right: 12px; white-space: nowrap; vertical-align: middle; font-size: .9rem; }
.matrix th.rowh a { color: var(--cream); }
.cell { display: flex; align-items: center; justify-content: center; width: 64px; height: 32px; border-radius: 8px; font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; background: rgba(234,240,220,.04); color: var(--muted-green); }
.cell.done { background: var(--corn-gold); color: var(--on-gold); }
.cell.accepted { background: rgba(245,197,66,.35); }
.cell.open { background: var(--moonlit-teal); }
.cell:hover { outline: 2px solid var(--cream); outline-offset: 1px; }

/* ---------- Split view: list + story ---------- */
.split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.side { position: sticky; top: 12px; padding: 6px; max-height: calc(100vh - 24px); overflow-y: auto; }
.side-item { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 7px 10px; border-radius: 10px; color: var(--cream); }
.side-item:hover { background: var(--hover); color: var(--cream); }
.side-item.active { background: var(--moonlit-teal); }
.si-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; white-space: nowrap; }
.si-name, .si-name small { overflow: hidden; text-overflow: ellipsis; }
.si-name small { font-size: .74rem; color: var(--muted-green); }
.side-item.active .si-name small { color: var(--sage-light); }
.si-meta { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; font-size: .82rem; color: var(--sage-light); font-variant-numeric: tabular-nums; white-space: nowrap; }
.si-meta small { font-size: .72rem; color: var(--muted-green); }
.side-item.active .si-meta small { color: var(--sage-light); }
.si-track { grid-column: 2 / 4; position: relative; height: 3px; margin-top: 5px; border-radius: 2px; background: rgba(234,240,220,.06); }
.si-track i { position: absolute; top: 0; bottom: 0; border-radius: 2px; background: var(--sage); opacity: .6; }
.si-track i.done { background: var(--corn-gold); opacity: 1; }

.story { padding: 22px 24px; min-width: 0; }
.story-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.story-head h3 { margin: 0; font-size: 1.6rem; line-height: 1.2; }
.story-head h3 a { color: var(--cream); }
.story-head h3 a:hover { color: var(--corn-gold); }
.status { flex: none; font-size: .82rem; font-weight: 500; padding: 3px 12px; border-radius: 14px; border: 1px solid var(--line-strong); color: var(--sage-light); white-space: nowrap; }
.status.done { background: var(--corn-gold); border-color: var(--corn-gold); color: var(--on-gold); }
.status.accepted { border-color: var(--corn-gold); color: var(--corn-gold); }
.facts { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: stretch; margin-top: 18px; }
.answer-box { background: var(--night-deep); border-radius: 12px; padding: 12px 16px; min-width: 0; }
.answer-box code { display: block; font-size: 1.35rem; color: var(--corn-gold); font-weight: 600; overflow-wrap: anywhere; letter-spacing: .02em; }
.answer-box.none code { color: var(--muted-green); }
.label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-green); margin-bottom: 2px; }
.facts dl { display: grid; grid-template-columns: repeat(4, auto); gap: 4px 22px; margin: 0; align-content: center; }
.facts dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-green); white-space: nowrap; }
.facts dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.writeup { margin-top: 16px; }
.clamp { position: relative; max-height: 15em; overflow: hidden; }
.clamp:not(.open)::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4em; background: linear-gradient(transparent, var(--night-mid)); pointer-events: none; }
.clamp.open { max-height: none; }
pre.text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 300 .95rem/1.6 var(--font); color: var(--cream); }
.writeup pre.text { background: var(--night-deep); border-radius: 12px; padding: 14px 16px; }
.writeup .clamp:not(.open)::after { background: linear-gradient(transparent, var(--night-deep)); border-radius: 0 0 12px 12px; }
.more { margin-top: 6px; font-size: .9rem; }
.story-tabs { margin: 24px 0 8px; }
.story-tabs .muted { color: inherit; opacity: .7; font-variant-numeric: tabular-nums; }
.story-pane[hidden] { display: none; }
.story-pane > p.muted { margin: 12px 0; }
.answer-scroll { max-height: 560px; overflow-y: auto; border-radius: 10px; background: var(--night-deep); }
.answers-table th { position: sticky; top: 0; background: var(--night-deep); }
.answers-table td { padding: 7px 14px; }
.answers-table code { color: var(--cream); overflow-wrap: anywhere; }
.answers-table .res { white-space: nowrap; font-weight: 500; }
.answers-table tr.bad .res { color: var(--wrong); }
.answers-table tr.ok .res { color: var(--corn-gold); }
.answers-table tr.ok code { color: var(--corn-gold); }
.feed-list { list-style: none; margin: 0; padding: 0; }
.fi { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 14px; padding: 9px 0; border-top: 1px solid var(--line); }
.fi > time { font-size: .82rem; color: var(--muted-green); font-variant-numeric: tabular-nums; padding-top: 2px; white-space: nowrap; }
.fi b { font-weight: 500; }
.fi.wrong b { color: var(--wrong); }
.fi.right b, .fi.solved b { color: var(--corn-gold); }
.fi.hint b, .fi.open b { color: var(--sage-light); }
.fi.note pre.text { margin-top: 4px; color: var(--sage-light); }
.fi.note .clamp { max-height: 8em; }
.fi code { color: var(--cream); }
.answers { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.answers li { display: flex; justify-content: space-between; gap: 12px; }
.answers li code { overflow-wrap: anywhere; }
.answers time { font-size: .78rem; color: var(--muted-green); white-space: nowrap; }
.answers.scroll { max-height: 280px; overflow-y: auto; padding-right: 8px; }
details > summary { cursor: pointer; }

/* ---------- Agent page ---------- */
.agent-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 32px; margin: 10px 0 0; }
.agent-head h2 { margin: 0; font-size: 2.2rem; line-height: 1.15; }
.agent-head p { margin: 2px 0 0; }
.agent-stats { display: flex; gap: 28px; margin: 0; }
.agent-stats dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-green); white-space: nowrap; }
.agent-stats dd { margin: 0; font-size: 1.45rem; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.agent-stats dd small { font-size: .62em; color: var(--sage); font-weight: 300; }
.aside { margin: 12px 0 0; font-size: .9rem; color: var(--sage-light); }
.aside.pauses { margin-top: 4px; padding-left: 1.1rem; display: grid; gap: 2px; }
.aside.pauses b { font-weight: 500; color: var(--cream); }
.video { margin-top: 18px; }
.video-start { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--night-mid); color: var(--cream); cursor: pointer; text-align: left; }
.video-start:hover { border-color: var(--line-strong); }
.video-start b { display: block; font-weight: 500; }
.video-start small { display: block; font-size: .82rem; color: var(--muted-green); }
.play-dot { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--corn-gold); color: var(--on-gold); font-size: .95rem; padding-left: 3px; flex: none; }
.video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-link { display: inline-block; margin-top: 6px; font-size: .85rem; }
.has-video { color: var(--corn-gold); font-size: .7em; vertical-align: 2px; margin-left: 4px; }
.tabs { display: flex; gap: 4px; margin: 24px 0 16px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 9px 16px; color: var(--sage-light); font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--cream); }
.tabs a.active { color: var(--corn-gold); border-bottom-color: var(--corn-gold); }

/* Replay */
.player { padding: 14px 18px 12px; }
.player-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.clock { display: flex; align-items: baseline; gap: 10px; min-width: 230px; }
.clock strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.clock span { font-size: .85rem; color: var(--muted-green); white-space: nowrap; }
.rp-score { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.scrub { position: relative; height: 46px; margin-top: 12px; }
.scrub svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.scrub rect { fill: var(--moonlit-teal); }
.scrub .solve-tick { stroke: var(--corn-gold); stroke-width: 2; vector-effect: non-scaling-stroke; }
.scrub input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; }
.scrub input::-webkit-slider-runnable-track { height: 46px; background: transparent; }
.scrub input::-moz-range-track { height: 46px; background: transparent; }
.scrub input::-webkit-slider-thumb { -webkit-appearance: none; width: 3px; height: 46px; background: var(--cream); border-radius: 2px; box-shadow: 0 0 0 3px rgba(234,240,220,.2); }
.scrub input::-moz-range-thumb { width: 3px; height: 46px; background: var(--cream); border: 0; border-radius: 2px; }
.scrub-legend { display: flex; gap: 18px; margin-top: 6px; font-size: .78rem; color: var(--muted-green); white-space: nowrap; overflow: hidden; }
.scrub-legend .tick { display: inline-block; width: 2px; height: 10px; background: var(--corn-gold); margin-right: 6px; vertical-align: -1px; }
.replay-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; margin-top: 16px; align-items: start; }
.replay-grid h4 { margin: 0 0 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-green); font-weight: 400; }
.now-panel { padding: 18px 20px; min-width: 0; }
.now { min-height: 116px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.now-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--corn-gold); }
.now-text { display: flex; gap: 12px; margin: 6px 0 0; font-size: 1.25rem; line-height: 1.4; }
.now-text .ico { color: var(--corn-gold); flex: none; width: 1.2em; text-align: center; }
.now-text code { color: var(--corn-gold); }
.snip { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; font-size: .9rem; color: var(--sage-light); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 64px 18px minmax(0, 1fr); gap: 8px; padding: 6px 0; font-size: .9rem; color: var(--sage-light); }
.feed li.muted { display: block; }
.feed time { color: var(--muted-green); font-variant-numeric: tabular-nums; font-size: .82rem; padding-top: 1px; }
.feed .ico { color: var(--sage); text-align: center; }
.feed .snip { -webkit-line-clamp: 1; font-size: .82rem; }
.maze-panel { padding: 18px 20px; }
.maze { width: 100%; display: block; background: var(--night-deep); border-radius: 10px; }
.maze > rect { fill: #1d3a3a; }
#rp-maze .trail { fill: none; stroke: var(--corn-gold); stroke-opacity: .25; stroke-width: .18; stroke-linejoin: round; }
#rp-maze .trail-recent { fill: none; stroke: var(--corn-gold); stroke-opacity: .85; stroke-width: .28; stroke-linejoin: round; stroke-linecap: round; }
#rp-maze .lm { fill: var(--night-deep); stroke: var(--sage); stroke-width: .16; }
#rp-maze .lm.done { fill: var(--corn-gold); stroke: none; }
#rp-maze .me { fill: var(--cream); stroke: var(--night-deepest); stroke-width: .18; }
.mk { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.mk.me { background: var(--cream); }
.mk.lm { border: 1.5px solid var(--sage); }
.mk.done { background: var(--corn-gold); }

/* Raw data */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar input, .toolbar select { height: 36px; background: var(--night-mid); border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 12px; color: var(--cream); }
.toolbar input { width: 240px; }
.toolbar .muted { font-size: .9rem; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th { text-align: left; font-weight: 400; font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-green); padding: 12px 14px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 9px 14px; border-bottom: 1px solid var(--line); color: var(--sage-light); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data td small { display: block; color: var(--muted-green); }
table.data .r { text-align: right; }
pre.raw { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: .78rem; color: var(--sage-light); background: var(--night-deep); border-radius: 10px; padding: 12px; max-height: 480px; overflow: auto; margin: 8px 0 0; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 16px 0; color: var(--sage-light); font-size: .9rem; }
.run-meta { margin-top: 16px; padding: 14px 18px; }
.run-meta > summary { color: var(--sage-light); font-weight: 500; }
.run-meta dl { margin-top: 12px; }
dl.defs { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 8px 20px; margin: 0; }
dl.defs.pad { padding: 18px 20px; }
dl.defs dt { color: var(--cream); font-weight: 500; }
dl.defs dd { margin: 0; color: var(--sage-light); overflow-wrap: anywhere; }

/* About */
.prose { padding: 18px 22px; color: var(--sage-light); }
.prose h4 { margin: 0 0 8px; font-size: 1.1rem; color: var(--cream); }
.prose p { margin: 0 0 10px; }
.prose ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 6px; }
.prose details { margin: 10px 0; }
.prose summary { color: var(--corn-gold); font-weight: 500; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.about-table td a { color: var(--cream); }

/* Tooltip & toast */
#tip { position: fixed; z-index: 60; max-width: 280px; pointer-events: none; white-space: pre-line; background: var(--night-deepest); border: 1px solid var(--line-strong); border-radius: 10px; padding: 7px 11px; font-size: .84rem; line-height: 1.4; color: var(--cream); box-shadow: 0 6px 18px rgba(0,0,0,.5); }
#toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 30px); opacity: 0; background: var(--corn-gold); color: var(--on-gold); padding: 8px 18px; border-radius: 20px; font-weight: 500; transition: .2s; pointer-events: none; z-index: 70; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .replay-grid { grid-template-columns: minmax(0, 1fr) 320px; }
  .lb { grid-template-columns: 30px minmax(0, 1fr) 210px 80px 70px 64px 50px; gap: 10px; }
}
@media (max-width: 900px) {
  .main-header { flex-wrap: wrap; }
  .site-nav { order: 3; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2, .race-wrap, .replay-grid { grid-template-columns: minmax(0, 1fr); }
  .standings { border-left: 0; border-top: 1px solid var(--line); }
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lb { grid-template-columns: 26px minmax(0, 1fr) auto 72px; padding: 0 14px; }
  .hide-s { display: none; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; display: flex; gap: 6px; overflow-x: auto; max-height: none; scrollbar-width: thin; }
  .side-item { flex: none; grid-template-columns: 12px auto; grid-template-rows: auto; padding: 8px 12px; }
  .side-item .si-meta, .side-item .si-track, .si-name small { display: none; }
  .facts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .main-header { flex-wrap: wrap; padding: 10px 16px 12px; gap: 10px 12px; }
  .logo img { width: 44px; height: 44px; }
  .title { font-size: 1.3rem; }
  .subtitle { font-size: .9rem; }
  .snapshot { display: none; }
  .site-nav { width: 100%; justify-content: space-between; gap: 2px; }
  .site-nav a { padding: 5px 10px; font-size: .86rem; }
  .container { padding: 0 16px; }
  .hero-card { margin: 18px 8px 0; padding: 22px 20px; border-radius: 28px; }
  .hero-card h2 { font-size: 1.55rem; }
  .hero-card > p { font-size: .95rem; }
  .tile { padding: 10px 12px; }
  .tile .label { font-size: .68rem; }
  .tile strong { font-size: 1.3rem; }
  .lb { grid-template-columns: 20px minmax(0, 1fr) 64px; grid-template-areas: "p who t" "p prog prog"; row-gap: 4px; padding: 10px 14px; }
  .lb-head { display: none; }
  .lb-row > :nth-child(1) { grid-area: p; align-self: start; padding-top: 2px; }
  .lb-row > :nth-child(2) { grid-area: who; }
  .lb-row > :nth-child(3) { grid-area: prog; }
  .lb-row > :nth-child(4) { grid-area: t; align-self: start; padding-top: 2px; }
  .pgrid { grid-template-columns: minmax(0, 1fr); }
  .page-head h2, .agent-head h2 { font-size: 1.6rem; }
  .agent-stats { width: 100%; justify-content: space-between; gap: 12px; }
  .agent-stats dd { font-size: 1.15rem; }
  .story { padding: 18px 16px; }
  .story-head h3 { font-size: 1.3rem; }
  .facts dl { grid-template-columns: repeat(2, auto); justify-content: start; }
  .fi { grid-template-columns: 58px minmax(0, 1fr); gap: 10px; }
  .clock { min-width: 0; }
  .rp-score { margin-left: 0; }
  .scrub-legend span:last-child { display: none; }
  .bar-row { grid-template-columns: 96px minmax(0, 1fr) 56px; }
  .hrow .kernels { display: none; }
  dl.defs { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  dl.defs dd { margin-bottom: 10px; }
  .toolbar input { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
