/* The record page. Layout from V2 (koroilabs #26): one column, models as rows, each
   record on a strip so the comparison reads by eye before the digits. The tick on
   each straight-up strip is V1's: how many of the same games the favourite won.
   Colour: the Koroi Labs stall tokens (app/styles.css). The house look is dark only. */
:root {
  color-scheme: dark;
  --bg: #0f1117;
  --surface: #1a1d27;
  --elevated: #242836;
  --border: #333847;
  --fg: #e8eaed;
  --fg-2: #9aa0b0;
  --muted: #6b7280;
  --accent: #5b8def;
  --accent-hover: #4a7dde;
  --win: #5b8def;
  --loss: #3a4052;
  --tie: #fbbf24;
  --tick: #f0efec;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  --t-xs: 0.75rem; --t-sm: 0.875rem; --t-base: 1rem; --t-lg: 1.25rem; --t-xl: 1.6rem; --t-2xl: clamp(2rem, 6vw, 3rem);
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem; --s-5: 1.5rem; --s-6: 2rem; --s-8: 3rem;
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-sans); background: var(--bg); color: var(--fg); line-height: 1.55; }
button { font: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.page { max-width: 960px; margin: 0 auto; padding-inline: max(16px, var(--s-4)); padding-block: 0 var(--s-8); display: flex; flex-direction: column; gap: var(--s-6); }

.crumb { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; padding-top: var(--s-4); font-size: var(--t-sm); color: var(--fg-2); }
.crumb strong { color: var(--fg); }
.crumb-state { margin-left: auto; font-size: var(--t-xs); color: var(--muted); }

h2 { font-size: var(--t-lg); font-weight: 700; text-wrap: balance; }
p { max-width: 68ch; }

/* --- hero --- */
.hero { display: flex; flex-direction: column; gap: var(--s-3); padding-top: var(--s-4); }
.hero-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); }
.league-switch { display: inline-flex; padding: 3px; gap: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.league-switch button { border: 0; background: transparent; color: var(--fg-2); font-size: var(--t-sm); font-weight: 700; letter-spacing: 0.04em; padding: 6px 16px; min-height: 36px; border-radius: 999px; cursor: pointer; }
.league-switch button:hover { color: var(--fg); }
.league-switch button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.eyebrow { font-size: var(--t-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-2); }
.hero-title { font-size: var(--t-2xl); line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; text-wrap: balance; }
.attest { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); font-size: var(--t-lg); }
.attest-line { font-weight: 600; }
.games { font-family: var(--font-mono); font-size: var(--t-sm); color: var(--fg-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 10px; font-variant-numeric: tabular-nums; }
.games b { color: var(--fg); font-weight: 700; }

/* --- the pitch --- */
.pitch { display: flex; flex-direction: column; gap: var(--s-3); }
.pitch h2 { font-size: var(--t-xl); line-height: 1.2; }
.pitch p { color: var(--fg); font-size: 1.0625rem; }
.pitch p + p { color: var(--fg-2); }

/* --- the bar to beat --- */
.bar { display: flex; flex-direction: column; gap: var(--s-3); }
.fav-card { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--s-3) var(--s-5); align-items: center; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--tick); border-radius: var(--radius); padding: var(--s-4) var(--s-5); }
.fav-rec { display: flex; flex-direction: column; gap: 2px; }
.fav-rec .rec { font-size: var(--t-xl); }
.fav-sub { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--fg-2); }
.fav-text { font-size: var(--t-sm); color: var(--fg-2); }

/* --- the board --- */
.board { display: flex; flex-direction: column; gap: var(--s-3); }
.board-head { display: flex; flex-direction: column; gap: var(--s-1); }
.board-note { font-size: var(--t-sm); color: var(--fg-2); }
.board-why { font-size: var(--t-sm); color: var(--fg-2); max-width: 78ch; }
.legend { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); font-size: var(--t-xs); color: var(--fg-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 12px; height: 8px; border-radius: 2px; }
.sw-w, .seg-w { background: var(--win); }
.sw-l, .seg-l { background: var(--loss); }
.sw-t, .seg-t { background: var(--tie); }
.sw-tick { width: 2px; height: 12px; border-radius: 0; background: var(--tick); }

.desks { list-style: none; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.desk { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.55fr); gap: var(--s-3) var(--s-5); padding: var(--s-4) var(--s-5); align-items: start; }
.desk + .desk { border-top: 1px solid var(--border); }
.loading { padding: var(--s-4) var(--s-5); color: var(--fg-2); }
.desk-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.desk-name { font-weight: 700; font-size: var(--t-base); }
.desk-does { font-size: var(--t-sm); color: var(--fg-2); line-height: 1.4; }
.desk-key { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--muted); margin-top: 2px; }
.desk-agree { font-size: var(--t-xs); color: var(--fg-2); margin-top: var(--s-1); line-height: 1.5; }
.desk-agree b { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--fg); font-weight: 700; }
.agree-label { color: var(--muted); }

.col { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.col-label { font-size: var(--t-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-2); }
.rec { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--t-lg); font-weight: 700; line-height: 1.2; }
.rec small { font-size: var(--t-xs); font-weight: 400; color: var(--fg-2); }
.rec-absent { font-family: var(--font-sans); font-size: var(--t-sm); font-weight: 400; font-style: italic; color: var(--fg-2); }
.vs-fav { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--fg-2); }

.strip { position: relative; display: flex; gap: 1px; height: 10px; border-radius: 2px; margin: 4px 0 2px; }
.strip > i { display: block; min-width: 0; flex-basis: 0; }
.strip > i:first-child { border-radius: 2px 0 0 2px; }
.strip > i:last-of-type { border-radius: 0 2px 2px 0; }
.fav-tick { position: absolute; top: -4px; width: 2px; height: 18px; margin-left: -1px; background: var(--tick); box-shadow: 0 0 0 2px var(--surface); }

/* --- a desk's calls, folded --- */
.calls { grid-column: 1 / -1; font-size: var(--t-sm); }
.calls-summary { cursor: pointer; color: var(--fg-2); font-size: var(--t-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; list-style: none; }
.calls-summary::-webkit-details-marker { display: none; }
.calls-summary::before { content: '▸ '; }
.calls[open] .calls-summary::before { content: '▾ '; }
.calls-week { font-size: var(--t-xs); font-weight: 700; color: var(--muted); margin: var(--s-3) 0 var(--s-1); }
.calls-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.call { padding: var(--s-2) 0; border-top: 1px solid var(--border); }
.call-game { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-1) var(--s-3); }
.call-title { font-weight: 700; }
.call-final { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--fg-2); }
.call-when { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--muted); margin: 2px 0 0; }
.desk-lead { display: block; margin-top: 2px; }
.desk-vsclose { display: block; margin-top: 2px; }
/* The closing line: a benchmark, not a model. Set apart from the four above it. */
.desk-close { border-top: 2px solid var(--border) !important; background: color-mix(in srgb, var(--border) 18%, transparent); }
.call-cells { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px var(--s-3); margin: var(--s-1) 0 0; font-family: var(--font-mono); font-size: var(--t-xs); }
.call-cells dt { color: var(--fg-2); }
.call-cells dd { margin: 0; color: var(--fg); }
.call-result { color: var(--fg-2); }

/* --- the two asks --- */
.act { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-4); }
.act-block { display: flex; flex-direction: column; gap: var(--s-2); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s-4) var(--s-5); }
.act-block p { font-size: var(--t-sm); color: var(--fg-2); }
.act-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin-top: auto; padding-top: var(--s-2); }
.act-btn { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 11px 20px; font-weight: 700; font-size: var(--t-base); cursor: pointer; transition: background 150ms ease; }
.act-btn-2 { background: var(--elevated); border: 1px solid var(--border); color: var(--fg); }
.act-btn:hover:not(:disabled) { background: var(--accent-hover); }
.act-btn:disabled { opacity: 0.45; cursor: default; }
.soon { font-size: var(--t-sm); color: var(--fg-2); }

/* --- the fine print --- */
.fine { display: flex; flex-direction: column; gap: var(--s-4); padding-top: var(--s-5); border-top: 1px solid var(--border); }
.rules { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--s-1) var(--s-4); font-size: var(--t-sm); max-width: 78ch; }
.rules dt { color: var(--fg-2); }
.rules dd { color: var(--fg); }
.rules > div:not([hidden]) { display: contents; }
.provenance { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--muted); overflow-wrap: anywhere; }
.disclaimer { font-size: var(--t-sm); color: var(--fg-2); }
.desk-ruling { font-size: var(--t-xs); color: var(--fg-2); margin-top: var(--s-1); }
.copyright { font-size: var(--t-xs); color: var(--muted); }

/* --- narrower --- */
@media (max-width: 880px) {
  .desk { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.6fr); }
  .desk-id { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .desk { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: var(--s-4); }
  .col-brier { grid-column: 1 / -1; flex-direction: row; align-items: baseline; gap: var(--s-2); }
  .col-brier .rec { font-size: var(--t-base); }
  .fav-card { grid-template-columns: minmax(0, 1fr); padding: var(--s-4); }
  .act { grid-template-columns: minmax(0, 1fr); }
  .rules { grid-template-columns: minmax(0, 1fr); }
  .rules dd { margin-bottom: var(--s-2); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
