/* QuizDown — the programme. Tokens, type, controls, shell and the between-match screens.
   Direction, palette and rules: docs/DESIGN.md. The stage (matches, couch party) lives in stage.css. */
@font-face { font-family: "Flags"; src: url("flags.woff2") format("woff2"); unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E007F; font-display: swap; }

:root {
  --h: 45; /* current topic hue (HSL degrees from the topic table), set per screen */
  --paper: #F2ECDF; --paper-2: #FAF7EF; --paper-3: #E7DFCD; --rule: #D5CAB3;
  --ink: #1A1712; --ink-2: #5C5446; --ink-3: #6B6152; /* ink-3 is the faintest text: ≥4.5:1 on every paper (WCAG AA) */
  --signal: #B8321A; --on-signal: #FFF8EE;
  --gold: #C98A12; --on-gold: #1A1712;
  --right: #23704A;
  --prussian: #2F5D8A; --plum: #8A2F5E; --forest: #2F7A55;
  --on-topic: #FAF7EF;
  --stage: #100E0B; --stage-2: #1C1813; --stage-3: #2A241C; --stage-ink: #F1EADB; --stage-ink-2: #B8AE9B; --stage-rule: #3A3229;

  --display: "Fraunces", "Flags", Georgia, "Times New Roman", serif;
  --body: "Schibsted Grotesk", "Flags", system-ui, -apple-system, "Segoe UI", sans-serif;
  --t-hero: 900 clamp(3rem, 13vw, 6.5rem)/.88 var(--display);
  --t-1: 800 clamp(2.25rem, 8vw, 3.5rem)/.95 var(--display);
  --t-2: 700 clamp(1.5rem, 4.6vw, 2rem)/1.08 var(--display);
  --t-3: 700 1.25rem/1.15 var(--display);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --r-0: 2px; --r-1: 10px; --r-2: 18px;
  --press: 3px 3px 0 var(--ink);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-snap: cubic-bezier(.34, 1.4, .64, 1);
  --nav-h: 68px;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.08 0 0 0 0 0.05 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: light;

  /* Older names still used by the admin console and a few inline styles. */
  --bg: var(--paper); --surface: var(--paper-2); --surface-2: var(--paper-3); --surface-3: var(--rule); --line: var(--rule);
  --text: var(--ink); --muted: var(--ink-2); --faint: var(--ink-3); --brand: var(--signal); --brand-ink: var(--on-signal);
  --good: var(--right); --bad: var(--signal); --me: var(--gold); --them: var(--ink);
}
:root[data-theme="dark"] {
  --paper: #15120E; --paper-2: #1F1B16; --paper-3: #2A251E; --rule: #3A3229;
  --ink: #F1EADB; --ink-2: #B8AE9B; --ink-3: #9A907E;
  --signal: #F0603F; --on-signal: #15120E;
  --gold: #F0B33A; --on-gold: #15120E;
  --right: #4CB37A;
  --prussian: #7FA8D6; --plum: #D681AE; --forest: #6CC293;
  --on-topic: #15120E;
  --press: 3px 3px 0 #000;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 0.95 0 0 0 0 0.85 0 0 0 .035 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: dark;
}

/* Topic ink. Re-declared wherever a hue is set inline, so a tile's colour follows its own --h.
   OKLCH keeps every hue at the same perceived lightness (yellow and green stay legible). */
:root, [style*="--h:"] { --topic: hsl(var(--h) 52% 36%); --topic-wash: hsl(var(--h) 45% 90%); }
:root[data-theme="dark"], :root[data-theme="dark"] [style*="--h:"] { --topic: hsl(var(--h) 60% 66%); --topic-wash: hsl(var(--h) 25% 20%); }
@supports (color: oklch(from red l c h)) {
  :root, [style*="--h:"] { --topic: oklch(from hsl(var(--h) 80% 50%) .47 .12 h); --topic-wash: oklch(from hsl(var(--h) 80% 50%) .93 .035 h); }
  :root[data-theme="dark"], :root[data-theme="dark"] [style*="--h:"] { --topic: oklch(from hsl(var(--h) 80% 50%) .80 .11 h); --topic-wash: oklch(from hsl(var(--h) 80% 50%) .27 .04 h); }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--paper) var(--grain); color: var(--ink); font: 400 1rem/1.5 var(--body);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow-x: hidden;
  font-feature-settings: "ss01";
}
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); margin: 0; font-optical-sizing: auto; text-wrap: balance; }
h1 { font: var(--t-1); letter-spacing: -.025em; }
h2 { font: var(--t-3); letter-spacing: -.01em; }
h3 { font: 700 1.05rem/1.2 var(--display); }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
b, strong { font-weight: 700; }
::selection { background: var(--gold); color: var(--on-gold); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }
h1:focus, h2:focus, main:focus { outline: none; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--ink); color: var(--paper); border-radius: var(--r-1); font-weight: 700; }
.skip:focus { top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* type helpers */
.kicker { font: italic 500 1rem/1.3 var(--display); color: var(--ink-2); letter-spacing: 0; }
.kicker b { font-weight: 700; font-style: italic; color: var(--ink); }
.label { font: 600 .8125rem/1.3 var(--body); letter-spacing: .02em; color: var(--ink-2); }
.smallcaps { font: 700 .72rem/1.2 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: .875rem; }
.tiny { font-size: .75rem; }
.num { font-variant-numeric: lining-nums tabular-nums; }
.figure { font: 800 1.75rem/1 var(--display); font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.02em; }
.center { text-align: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* layout helpers */
.row { display: flex; align-items: center; gap: var(--s3); }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: var(--s4); }
.stack.tight { gap: var(--s2); }
.grow { flex: 1; min-width: 0; }

/* icons */
.g { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.22em; }
.g .f { fill: currentColor; stroke: none; }
.g .mono, .num-mark { font: 800 15px var(--display); fill: currentColor; stroke: none; }

/* ---------- shell ---------- */
.shell { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); }
.shell > main { min-width: 0; width: 100%; max-width: 720px; margin: 0 auto; padding: var(--s4) var(--s4) calc(var(--nav-h) + var(--s7) + env(safe-area-inset-bottom)); }
.shell.bare > main { padding: 0; max-width: none; }
.shell.bare > nav.tabs { display: none; }

nav.tabs {
  position: fixed; inset: auto 0 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding: 0 var(--s2) env(safe-area-inset-bottom);
  background: var(--paper-2); border-top: 1px solid var(--ink);
}
nav.tabs a {
  height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--ink-3); font: 600 .72rem/1 var(--body); position: relative;
}
nav.tabs a .g { width: 24px; height: 24px; }
nav.tabs a[aria-current="page"] { color: var(--ink); }
nav.tabs a[aria-current="page"]::after { content: ""; position: absolute; bottom: 9px; width: 4px; height: 4px; border-radius: 50%; background: var(--signal); }
nav.tabs a[aria-current="page"] span { visibility: hidden; } /* the dot replaces the label */
/* The buzzer: Play is a big red dome on an ink base. */
nav.tabs .play { gap: 4px; }
nav.tabs .play .dome {
  width: 58px; height: 58px; margin-top: -26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--signal); color: var(--on-signal); border: 2px solid var(--ink); box-shadow: 0 5px 0 var(--ink);
  transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out);
}
nav.tabs .play .dome .g { width: 26px; height: 26px; }
nav.tabs .play:active .dome { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
nav.tabs .play small { color: var(--ink); font-weight: 700; }

@media (min-width: 960px) {
  .shell { grid-template-columns: 232px minmax(0, 1fr); }
  .shell.bare { grid-template-columns: minmax(0, 1fr); }
  nav.tabs {
    position: sticky; top: 0; height: 100dvh; grid-template-columns: 1fr; grid-auto-rows: min-content; align-content: start; gap: 2px;
    padding: var(--s5) var(--s4); border-top: 0; border-right: 1px solid var(--rule); background: transparent;
  }
  nav.tabs::before { content: "QuizDown"; order: -2; font: 900 1.6rem/1 var(--display); letter-spacing: -.03em; padding: var(--s1) var(--s3) var(--s5); }
  nav.tabs a { height: 44px; flex-direction: row; justify-content: flex-start; gap: var(--s3); padding: 0 var(--s3); font: 600 1rem/1 var(--body); color: var(--ink-2); border-radius: var(--r-1); }
  nav.tabs a:hover { color: var(--ink); background: var(--paper-3); }
  nav.tabs a[aria-current="page"] { color: var(--ink); background: var(--paper-3); }
  nav.tabs a[aria-current="page"]::after { display: none; }
  nav.tabs a[aria-current="page"] span { visibility: visible; }
  nav.tabs .play { order: -1; height: auto; margin-bottom: var(--s4); padding: 0; background: none !important; }
  nav.tabs .play .dome { margin: 0; width: 100%; height: 52px; border-radius: var(--r-1); grid-auto-flow: column; justify-content: center; gap: var(--s2); box-shadow: var(--press); font: 700 1rem var(--body); }
  nav.tabs .play .dome::after { content: "Play"; }
  nav.tabs .play:hover .dome { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
  nav.tabs .play:active .dome { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
  nav.tabs .play small { display: none; }
  .shell > main { padding-bottom: var(--s8); padding-top: var(--s5); }
}

/* ---------- mastheads ---------- */
.topbar { display: flex; align-items: center; gap: var(--s2); min-height: 48px; margin-bottom: var(--s4); }
.topbar .spacer { flex: 1; }
.topbar h1 { font: 800 1.5rem/1 var(--display); letter-spacing: -.02em; }
.logo { display: inline-flex; align-items: baseline; font: 900 1.6rem/1 var(--display); letter-spacing: -.035em; text-decoration: none; color: var(--ink); white-space: nowrap; }
.logo i { font-style: italic; font-weight: 800; color: var(--signal); }
.logo svg { width: .5em; height: .5em; margin-left: 1px; fill: none; stroke: var(--signal); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 960px) { .topbar .logo { display: none; } }
/* Box-score counters in the top bar: plain figures with a mark, split by hairlines. */
.counters { display: flex; align-items: center; }
.counters > * { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; text-decoration: none; color: var(--ink); font: 700 .95rem/1 var(--body); font-variant-numeric: tabular-nums; position: relative; border-radius: var(--r-1); }
.counters > * + *::before { content: ""; position: absolute; left: 0; top: 25%; bottom: 25%; width: 1px; background: var(--rule); }
.counters a:hover { background: var(--paper-3); }
.counters .streak .g { color: var(--signal); }
.counters .sparkc .g { color: var(--gold); }
.counters .bell { padding: 6px 8px; }
.counters .bell .g, .counters .cogl .g { width: 22px; height: 22px; }
.counters .dot { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--signal); color: var(--on-signal); font: 700 .65rem/17px var(--body); text-align: center; }

.masthead { border-bottom: 3px double var(--ink); padding-bottom: var(--s3); margin-bottom: var(--s5); }
.masthead .dateline { display: flex; justify-content: space-between; gap: var(--s3); border-top: 1px solid var(--ink); margin-top: var(--s3); padding-top: 6px; font: 500 .8125rem/1.3 var(--body); color: var(--ink-2); }
.masthead .hello { font: var(--t-1); letter-spacing: -.03em; margin-top: var(--s2); }
.masthead .hello em { font-style: italic; font-weight: 500; color: var(--ink-2); }

/* ---------- controls ---------- */
button, .btn {
  font: 700 1rem/1.1 var(--body); color: var(--ink); background: var(--paper-2); border: 1.5px solid var(--ink);
  border-radius: var(--r-1); padding: 12px 18px; min-height: 46px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  text-decoration: none; user-select: none; transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out), background .15s, color .15s;
}
@media (hover: hover) { button:hover:not(:disabled), .btn:hover { background: var(--paper-3); } } /* touch screens keep :hover on the last tap; only real pointers get it */
button:disabled { opacity: .45; cursor: default; }
/* Primary = the one thing to do. It sits on an ink offset and presses into it. */
.primary { background: var(--signal); color: var(--on-signal); border-color: var(--ink); box-shadow: var(--press); }
.primary:hover:not(:disabled) { background: var(--signal); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.primary:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
:root[data-theme="dark"] .primary { border-color: #000; }
:root[data-theme="dark"] .primary:hover:not(:disabled) { box-shadow: 4px 4px 0 #000; }
.ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ink:hover:not(:disabled) { background: var(--ink); color: var(--paper); opacity: .9; }
button:active:not(:disabled):not(.primary), .btn:active:not(.primary) { transform: translateY(1px); }
.danger { color: var(--signal); border-color: var(--signal); }
.danger.solid { background: var(--signal); color: var(--on-signal); }
.ghost { background: transparent; border-color: transparent; }
.ghost:hover:not(:disabled) { background: var(--paper-3); }
.link { background: none; border: 0; padding: 4px 0; min-height: 0; font-weight: 600; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 4px; }
.link:hover:not(:disabled) { background: none; color: var(--ink); text-decoration-color: currentColor; }
.big { font-size: 1.1rem; min-height: 56px; padding: 16px 24px; }
.block { width: 100%; }
.icon-btn { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; position: relative; }
.icon-btn .g { width: 22px; height: 22px; }

/* Filter chips: squared tabs, not candy pills. */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; min-height: 36px; border-radius: var(--r-1); background: transparent; border: 1px solid var(--rule); font: 600 .875rem/1 var(--body); white-space: nowrap; color: var(--ink-2); }
button.chip:hover:not(:disabled) { background: var(--paper-3); color: var(--ink); }
button.chip[aria-pressed="true"], .chip[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chips { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.tag { display: inline-block; padding: 2px 6px; border-radius: var(--r-0); font: 700 .7rem/1.3 var(--body); letter-spacing: .04em; background: var(--ink); color: var(--paper); vertical-align: middle; }
.tag.signal { background: var(--signal); color: var(--on-signal); }
.tag.outline { background: none; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--rule); }

label.field { display: flex; flex-direction: column; gap: 6px; font: 600 .875rem/1.3 var(--body); color: var(--ink-2); }
input, select, textarea {
  font: 400 1rem var(--body); color: var(--ink); background: var(--paper-2); border: 1.5px solid var(--rule); border-radius: var(--r-1);
  padding: 13px 14px; width: 100%; transition: border-color .15s;
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 22%, transparent); }
textarea { resize: vertical; min-height: 96px; }
input[type="range"] { padding: 0; accent-color: var(--signal); border: 0; background: none; }
.form-error { color: var(--signal); font-size: .9rem; min-height: 1.3em; font-weight: 600; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) 0; cursor: pointer; }
.switch input { appearance: none; width: 46px; height: 28px; border-radius: 14px; background: var(--paper-3); position: relative; flex: none; padding: 0; border: 1.5px solid var(--ink); cursor: pointer; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: var(--ink); transition: transform .2s var(--ease-snap), background .2s; }
.switch input:checked { background: var(--ink); }
.switch input:checked::after { transform: translateX(18px); background: var(--gold); }
.seg { display: flex; border: 1.5px solid var(--ink); border-radius: var(--r-1); overflow: hidden; }
.seg button { flex: 1; min-height: 40px; padding: 8px 10px; border: 0; border-radius: 0; background: none; font: 600 .875rem var(--body); color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--rule); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ---------- surfaces: rules first, cards when something must be grouped ---------- */
.card { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--r-1); padding: var(--s4); }
.card.flush { padding: 0; overflow: hidden; }
.section { display: flex; flex-direction: column; gap: var(--s3); margin-top: var(--s6); }
.section > header { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); border-bottom: 1px solid var(--ink); padding-bottom: 6px; }
.section > header a, .section > header .link { font: 600 .875rem var(--body); color: var(--ink-2); }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list > li { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--rule); }
.list > li:last-child { border-bottom: 0; }
.list a.rowlink { display: flex; align-items: center; gap: var(--s3); text-decoration: none; flex: 1; min-width: 0; margin: calc(var(--s3) * -1) calc(var(--s4) * -1); padding: var(--s3) var(--s4); }
.list a.rowlink:hover { background: var(--paper-3); }
.list .chev { color: var(--ink-3); }
.empty { padding: var(--s6) var(--s4); color: var(--ink-2); display: flex; flex-direction: column; align-items: flex-start; gap: var(--s3); }
.empty .glyph { color: var(--ink-3); }
.empty .glyph .g { width: 36px; height: 36px; stroke-width: 1.5; }
.empty p { font: italic 500 1.1rem/1.35 var(--display); color: var(--ink-2); max-width: 32ch; }
.skeleton { background: var(--paper-3); border-radius: var(--r-1); opacity: .6; }

/* Box scores: a ruled strip of numbers, like the stats panel under a newspaper match report. */
.boxscore { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.boxscore > * { padding: var(--s3) var(--s3) var(--s3) 0; min-width: 0; text-decoration: none; color: inherit; }
.boxscore > * + * { padding-left: var(--s3); border-left: 1px solid var(--rule); }
.boxscore b { display: block; font: 800 1.6rem/1 var(--display); font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.boxscore span { display: block; margin-top: 4px; font: 500 .8125rem/1.25 var(--body); color: var(--ink-2); }
.boxscore a:hover b { color: var(--signal); }
@media (max-width: 420px) { .boxscore { --cols: 2 !important; } .boxscore > :nth-child(3) { border-left: 0; padding-left: 0; } .boxscore > :nth-child(n+3) { border-top: 1px solid var(--rule); } .boxscore > :nth-child(3):last-child { grid-column: 1 / -1; } }

/* ---------- identity ---------- */
.avatar {
  --size: 40px; width: var(--size); height: var(--size); flex: none; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: hsl(var(--ah, 40) 45% 82%); box-shadow: inset 0 0 0 1.5px var(--ink); font-size: calc(var(--size) * .56); line-height: 1;
}
:root[data-theme="dark"] .avatar { background: hsl(var(--ah, 40) 30% 30%); }
.avatar .portrait { width: 100%; height: 100%; clip-path: circle(50% at 50% 50%); }
.avatar.xl { --size: 104px; box-shadow: inset 0 0 0 2px var(--ink); }
.avatar.lg { --size: 64px; }
.avatar.sm { --size: 28px; box-shadow: inset 0 0 0 1px var(--ink); }
.avatar .flag { position: absolute; right: -2px; bottom: -2px; font-size: calc(var(--size) * .28); }
.tier { display: inline-flex; align-items: center; gap: 4px; font: 700 .8125rem/1 var(--body); color: var(--tc, var(--ink-2)); white-space: nowrap; }
.tier .g { width: 16px; height: 16px; stroke-width: 2; }
.t-Bronze, .tier.Bronze { --tc: #9A5B2A; } .t-Silver, .tier.Silver { --tc: #5F6571; } .t-Gold, .tier.Gold { --tc: #8F620A; }
.t-Platinum, .tier.Platinum { --tc: #3D7C7E; } .t-Diamond, .tier.Diamond { --tc: #3A64A0; } .t-Champion, .tier.Champion { --tc: var(--signal); }
:root[data-theme="dark"] .tier.Bronze { --tc: #D49A6A; } :root[data-theme="dark"] .tier.Silver { --tc: #B9C0CB; } :root[data-theme="dark"] .tier.Gold { --tc: #F0B33A; }
:root[data-theme="dark"] .tier.Platinum { --tc: #7FCFCF; } :root[data-theme="dark"] .tier.Diamond { --tc: #9AB9EA; }
.role { font: 700 .65rem/1.3 var(--body); letter-spacing: .08em; text-transform: uppercase; padding: 2px 6px; border-radius: var(--r-0); background: var(--ink); color: var(--paper); vertical-align: middle; }
/* Level ring: the arc is the share of the way to the next level. */
.ring { --p: 0; --c: var(--topic); width: var(--rs, 60px); height: var(--rs, 60px); border-radius: 50%; flex: none; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--paper-3) 0); }
.ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--rule); }
.ring > * { position: relative; text-align: center; font: 800 1.15rem/1 var(--display); font-variant-numeric: lining-nums; }
.ring small { display: block; font: 600 .6rem/1 var(--body); color: var(--ink-2); margin-bottom: 1px; }
.xpbar { height: 6px; background: var(--paper-3); overflow: hidden; border-radius: 3px; }
.xpbar > i { display: block; height: 100%; width: 0; background: var(--topic); transition: width 1s var(--ease-out); }

/* Split-flap digits (js/flap.js). Each cell is two halves; a change flips the top down over the bottom. */
.flap { display: inline-flex; gap: .06em; font-variant-numeric: lining-nums tabular-nums; perspective: 400px; }
.flap .fc { position: relative; display: inline-block; min-width: .64em; text-align: center; padding: 0 .06em; background: var(--flap-bg, transparent); border-radius: var(--r-0); }
.flap .fc > span { display: block; }
.flap .fc .ft, .flap .fc .fb, .flap .fc .ob { position: absolute; inset: 0; padding: 0 .06em; background: var(--flap-bg, var(--paper)); backface-visibility: hidden; }
.flap .fc .ob { clip-path: inset(50% 0 0 0); }
.flap .fc .ft { clip-path: inset(0 0 50% 0); transform-origin: 50% 50%; animation: flapTop .11s ease-in forwards; }
.flap .fc .fb { clip-path: inset(50% 0 0 0); transform-origin: 50% 50%; transform: rotateX(90deg); animation: flapBottom .11s .11s ease-out forwards; }
@keyframes flapTop { to { transform: rotateX(-90deg); } }
@keyframes flapBottom { to { transform: rotateX(0); } }

/* ---------- home: the programme ---------- */
/* Lead story: today's daily, set like the front-page splash in the topic's ink. */
.lead { position: relative; overflow: hidden; isolation: isolate; border-radius: var(--r-1); padding: var(--s5) var(--s5) var(--s5); background: var(--topic); color: var(--on-topic); display: grid; gap: var(--s3); }
.lead .kicker { color: inherit; opacity: .85; }
.lead h2 { font: var(--t-1); letter-spacing: -.03em; max-width: 12ch; }
.lead p { max-width: 36ch; }
.lead .art { position: absolute; right: -24px; bottom: -28px; width: 190px; height: 190px; opacity: .22; z-index: -1; stroke-width: 1.1; }
.lead .primary { background: var(--paper-2); color: var(--ink); justify-self: start; }
.lead .actions-row { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; margin-top: var(--s2); }
.lead .actions-row a.link { color: inherit; text-decoration-color: currentColor; opacity: .9; }
.lead .clock { font: 600 .8125rem var(--body); opacity: .85; font-variant-numeric: tabular-nums; }
.lead.done .scoreline { font: 800 2.4rem/1 var(--display); font-variant-numeric: lining-nums tabular-nums; }

.guest-banner { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border: 1.5px dashed var(--ink); border-radius: var(--r-1); text-decoration: none; color: var(--ink); margin-bottom: var(--s4); }
.guest-banner .g { color: var(--signal); width: 22px; height: 22px; }
.challenge-card { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--rule); }
.challenge-card:last-child { border-bottom: 0; }
.challenge-card .tg { color: var(--topic); }

/* The couch party advert: an inverted ink box, like a classified ad. */
.advert { display: grid; grid-template-columns: auto 1fr; gap: var(--s2) var(--s4); align-items: center; padding: var(--s4) var(--s5); border-radius: var(--r-1); background: var(--ink); color: var(--paper); }
.advert .g { width: 44px; height: 44px; stroke-width: 1.4; color: var(--gold); grid-row: span 2; }
.advert h2 { font: italic 700 1.4rem/1.1 var(--display); }
.advert p { color: color-mix(in srgb, var(--paper) 75%, transparent); font-size: .9rem; }
.advert .row { grid-column: 1 / -1; margin-top: var(--s2); }
.advert .btn:not(.primary) { background: transparent; color: var(--paper); border-color: color-mix(in srgb, var(--paper) 50%, transparent); }
.advert .btn:not(.primary):hover { background: color-mix(in srgb, var(--paper) 10%, transparent); }
.advert .primary { border-color: var(--paper); box-shadow: 3px 3px 0 var(--paper); }
@media (min-width: 640px) { .advert { grid-template-columns: auto 1fr auto; } .advert .g { grid-row: span 2; } .advert .row { grid-column: 3; grid-row: 1 / span 2; margin: 0; } }

/* Topic tiles: flat ink fills, the glyph in paper. The lead tile spans two columns. */
.scroller { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(156px, 180px); gap: var(--s3); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 calc(var(--s4) * -1); padding: 0 var(--s4) 6px; }
.scroller::-webkit-scrollbar { display: none; }
.scroller > * { scroll-snap-align: start; }
.tile {
  --h: 200; position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: var(--s4); min-height: 164px;
  padding: var(--s4); border-radius: var(--r-1); text-decoration: none; overflow: hidden; isolation: isolate;
  background: var(--topic); color: var(--on-topic); border: 1.5px solid var(--ink);
  transition: transform .14s var(--ease-out), box-shadow .14s var(--ease-out);
}
.tile:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.tile:active { transform: translate(1px, 1px); box-shadow: 0 0 0 var(--ink); }
.tile .g.topic { width: 38px; height: 38px; stroke-width: 1.6; }
.tile .tname { font: 800 1.25rem/1.05 var(--display); letter-spacing: -.015em; }
.tile .tmeta { display: flex; justify-content: space-between; gap: var(--s2); font: 600 .78rem/1.2 var(--body); opacity: .85; margin-top: 4px; }
.tile .tbar { display: block; height: 3px; background: color-mix(in srgb, currentColor 25%, transparent); margin-top: var(--s2); }
.tile .tbar i { display: block; height: 100%; background: currentColor; }
.tile.lead-tile { grid-column: span 2; min-height: 200px; }
.tile.lead-tile .g.topic { position: absolute; right: -10px; top: -10px; width: 150px; height: 150px; opacity: .25; stroke-width: 1.1; z-index: -1; }
.tile.lead-tile .tname { font-size: 1.9rem; }
.featured-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
@media (min-width: 640px) { .featured-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: dense; } .featured-grid .lead-tile { grid-row: span 2; min-height: 0; } .featured-grid .lead-tile .tname { font-size: 2.6rem; } }

/* The index: every topic as a contents line, two columns on wide screens. */
.index { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); column-gap: var(--s6); }
@media (min-width: 640px) { .index { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.index li { border-bottom: 1px solid var(--rule); }
.index a { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: var(--s3); padding: 10px 2px; text-decoration: none; color: inherit; }
.index a:hover .iname { color: var(--topic); }
.index .ig { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--topic); color: var(--on-topic); }
.index .ig .g { width: 22px; height: 22px; }
.index .iname { font: 700 1.1rem/1.15 var(--display); display: block; transition: color .15s; }
.index .imeta { font: 500 .8125rem/1.3 var(--body); color: var(--ink-2); }
.index .index-head { grid-column: 1 / -1; border-bottom: 1px solid var(--ink); padding: var(--s5) 0 6px; font: italic 700 1rem/1.2 var(--display); color: var(--ink-2); }
.index .index-head:first-child { padding-top: var(--s2); }
.index .index-note { grid-column: 1 / -1; border: 0; padding: var(--s3) 0; font: italic 500 .95rem var(--display); color: var(--ink-2); }
/* A topic's level mix (topic page): four ruled segments, lightest to darkest. */
.index .ilv { font: 700 .8125rem var(--body); color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.search { position: relative; }
.search .g { position: absolute; left: 14px; top: 50%; translate: 0 -50%; width: 20px; height: 20px; color: var(--ink-3); }
.search input { padding-left: 44px; }

/* ---------- topic page ---------- */
.hero {
  margin: calc(var(--s4) * -1) calc(var(--s4) * -1) 0; padding: var(--s4) var(--s4) calc(var(--s5) + var(--s6)); position: relative; overflow: hidden; isolation: isolate;
  background: var(--topic); color: var(--on-topic);
}
@media (min-width: 760px) { .hero { margin: 0; border-radius: var(--r-1); padding: var(--s5) var(--s6) calc(var(--s6) * 2.2); } }
.hero .art { position: absolute; right: -30px; bottom: -40px; width: 240px; height: 240px; opacity: .2; z-index: -1; stroke-width: 1; }
.hero .back { color: inherit; border-color: color-mix(in srgb, currentColor 40%, transparent); background: transparent; }
.hero .kicker { color: inherit; opacity: .85; margin-top: var(--s6); }
.hero h1 { font: var(--t-1); font-size: clamp(2.5rem, 10vw, 4rem); letter-spacing: -.035em; margin-top: 2px; max-width: 12ch; }
.hero p { max-width: 38ch; margin-top: var(--s2); opacity: .9; }
.hero .facts { margin-top: var(--s4); font: 600 .8125rem var(--body); opacity: .85; font-variant-numeric: tabular-nums; }
.mycard { background: var(--paper-2); border: 1.5px solid var(--ink); border-radius: var(--r-1); padding: var(--s4); margin: calc(var(--s5) * -1) 0 0; position: relative; display: grid; gap: var(--s4); }
@media (min-width: 760px) { .mycard { margin: calc(var(--s6) * -1) var(--s5) 0; } }
.mystats { display: grid; grid-template-columns: auto 1fr; gap: var(--s4); align-items: center; }
.mystats .title { font: 800 1.3rem/1.1 var(--display); }
.play-cta { display: grid; grid-template-columns: 1fr auto; gap: var(--s3); }

/* League tables. */
.board { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.board li { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr) auto; align-items: center; gap: var(--s3); padding: 9px var(--s4); border-bottom: 1px solid var(--rule); }
.board li:last-child { border-bottom: 0; }
.board li.me { background: color-mix(in srgb, var(--gold) 16%, transparent); box-shadow: inset 3px 0 0 var(--gold); }
.board .pos { font: 800 1.05rem/1 var(--display); color: var(--ink-2); text-align: right; font-variant-numeric: lining-nums tabular-nums; }
.board li:nth-child(-n+3) .pos { color: var(--ink); font-size: 1.3rem; }
.board a, .board .who { display: flex; align-items: center; gap: var(--s3); min-width: 0; text-decoration: none; }
.board .score { font: 800 1.05rem var(--display); font-variant-numeric: lining-nums tabular-nums; text-align: right; display: inline-flex; gap: 6px; align-items: center; }
.board .gap { display: block; text-align: center; color: var(--ink-3); padding: 2px; }
.topthree { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--ink); margin-bottom: var(--s3); }
.topthree a { display: grid; justify-items: start; gap: 6px; padding: var(--s3) var(--s3) var(--s4) 0; text-decoration: none; min-width: 0; }
.topthree a + a { border-left: 1px solid var(--rule); padding-left: var(--s3); }
.topthree .n { font: 900 3.4rem/.85 var(--display); letter-spacing: -.04em; font-variant-numeric: lining-nums; }
.topthree a:first-child .n { color: var(--gold); -webkit-text-stroke: 1px var(--ink); }
.topthree b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- profile ---------- */
.profile-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s4); align-items: center; padding: var(--s2) 0 var(--s4); border-bottom: 1px solid var(--ink); }
.profile-head h1 { font: var(--t-1); font-size: clamp(2rem, 8vw, 3rem); letter-spacing: -.03em; overflow-wrap: anywhere; }
.profile-head .bio { grid-column: 1 / -1; font: italic 500 1.1rem/1.4 var(--display); color: var(--ink-2); max-width: 44ch; }
.profile-head .acts { grid-column: 1 / -1; display: flex; gap: var(--s3); flex-wrap: wrap; }
.seals { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s2) var(--s4); }
.ach { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: var(--s3); align-items: center; padding: var(--s2) 0; }
.ach b { display: block; font: 700 .95rem/1.2 var(--display); }
.ach span { display: block; font-size: .78rem; line-height: 1.3; color: var(--ink-2); }
.ach.locked b { color: var(--ink-3); }
.seal { width: 48px; height: 48px; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.seal.earned { stroke: var(--ink); }
.seal.earned circle:first-child { fill: var(--gold); }
/* Milestone metals: bronze, silver, gold, platinum, diamond. */
.seal.earned.m1 circle:first-child { fill: #C98A5B; }
.seal.earned.m2 circle:first-child { fill: #C8CDD4; }
.seal.earned.m4 circle:first-child { fill: #A9D8D2; }
.seal.earned.m5 circle:first-child { fill: #A8C8F8; }
.seal.earned { stroke: #1A1714; }
.seal.earned .f, .seal.earned .num-mark { fill: #1A1714; }
.ach-group { margin-top: var(--s2); border-top: 1px solid var(--line); }
.ach-group > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) 72px auto 14px; gap: var(--s3); align-items: center; padding: var(--s3) 0; font: 700 .8rem var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.ach-group > summary::-webkit-details-marker { display: none; }
.ach-group > summary::after { content: ''; width: 8px; height: 8px; border: solid var(--ink-3); border-width: 0 2px 2px 0; transform: rotate(45deg); margin: 0 4px 4px 0; transition: transform .2s; }
.ach-group[open] > summary::after { transform: rotate(-135deg); margin-bottom: 0; }
.ach-bar { height: 6px; border-radius: 3px; background: var(--paper-3, rgb(0 0 0 / .08)); overflow: hidden; }
.ach-bar i { display: block; height: 100%; background: var(--gold); border-radius: inherit; }
.ach-grid, .ach-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: var(--s2); padding-bottom: var(--s3); }
.ach-row { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 76px; overflow-x: auto; }
.ach-recent { margin-bottom: var(--s2); }
.ach-tile { display: grid; justify-items: center; gap: 4px; padding: var(--s2) 2px; border-radius: var(--r-1); background: none; border: 0; color: var(--ink); cursor: pointer; }
.ach-tile:hover { background: var(--paper-2, rgb(0 0 0 / .04)); }
.ach-tile span { font-size: .7rem; line-height: 1.2; text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ach-tile.locked { opacity: .45; }
.ach-tile.locked span { color: var(--ink-3); }
.ach-detail { text-align: center; justify-items: center; max-width: 320px; }
.ach-detail-seal .seal { width: 96px; height: 96px; }
.ach-detail.earned .ach-detail-seal { animation: sealIn .5s var(--ease-snap, cubic-bezier(.2, 1.4, .4, 1)) both; }
@keyframes sealIn { from { transform: scale(.6) rotate(-12deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ach-detail.earned .ach-detail-seal { animation: none; } }
.ach-group h3 { font: 700 .8rem var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin-bottom: var(--s2); display: flex; justify-content: space-between; }
.seal.earned .f, .seal.earned .num-mark { fill: var(--ink); }
.seal .inner { stroke-dasharray: 1.5 2.5; stroke-width: 1; }
.seal.locked { stroke: var(--ink-3); opacity: .7; }
.seal.locked .f, .seal.locked .num-mark { fill: var(--ink-3); }
.topic-row { display: flex; align-items: center; gap: var(--s3); }
.topic-row .ring { --rs: 46px; }
.topic-row .ring > * { font-size: .95rem; }
.res { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: var(--r-0); font: 800 .8rem var(--display); flex: none; }
.res.win { background: var(--right); color: var(--paper-2); }
.res.loss { background: var(--signal); color: var(--on-signal); }
.res.draw, .res.none { box-shadow: inset 0 0 0 1px var(--rule); color: var(--ink-2); }

/* ---------- welcome & auth: a typographic poster ---------- */
.welcome { min-height: 100dvh; display: grid; align-content: center; padding: var(--s6) var(--s4); }
.welcome .inner { width: min(460px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: var(--s5); }
.welcome .logo { font-size: 1.8rem; }
.poster { border-top: 3px double var(--ink); border-bottom: 1px solid var(--ink); padding: var(--s4) 0; }
.poster > span { display: block; font: var(--t-hero); font-size: clamp(2.8rem, 14vw, 4.6rem); letter-spacing: -.045em; }
.poster > span:nth-child(2) { color: var(--ink-2); font-weight: 700; }
.poster > span:nth-child(3) { font-style: italic; color: var(--signal); }
.poster small { display: block; margin-top: var(--s3); font: 500 1rem/1.4 var(--body); color: var(--ink-2); letter-spacing: 0; }
.welcome h1 { font: var(--t-1); letter-spacing: -.03em; }
.divider { display: flex; align-items: center; gap: var(--s3); color: var(--ink-3); font: italic 500 .95rem var(--display); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

/* ---------- dialogs & toasts ---------- */
dialog { border: 1.5px solid var(--ink); background: var(--paper-2); color: var(--ink); border-radius: var(--r-2); padding: var(--s5); width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 48px); box-shadow: 6px 6px 0 var(--ink); }
dialog::backdrop { background: color-mix(in srgb, var(--paper) 70%, transparent); }
:root[data-theme="dark"] dialog { box-shadow: 6px 6px 0 #000; }
:root[data-theme="dark"] dialog::backdrop { background: rgb(0 0 0 / .6); }
dialog[open] { animation: rise .26s var(--ease-out); }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.toasts { position: fixed; left: 50%; top: max(12px, env(safe-area-inset-top)); translate: -50% 0; z-index: 50; display: flex; flex-direction: column; gap: var(--s2); width: min(420px, calc(100% - 24px)); pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); border-radius: var(--r-1); padding: var(--s3) var(--s4); font-weight: 600; animation: drop .3s var(--ease-out); pointer-events: auto; display: flex; gap: var(--s2); align-items: center; }
.toast.error { background: var(--signal); color: var(--on-signal); }
.toast.unlock { gap: var(--s3); }
.toast.unlock .seal { width: 40px; height: 40px; flex: none; }
.toast.unlock .tiny { display: block; opacity: .75; text-transform: uppercase; letter-spacing: .08em; }
.toast.unlock b { display: block; font: 800 1.05rem var(--display); }
@keyframes drop { from { transform: translateY(-10px); opacity: 0; } }
.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--s2); }
.avatar-grid button { font-size: 1.6rem; padding: 6px 0; min-height: 52px; border-radius: var(--r-1); background: var(--paper-2); border-color: var(--rule); }
.avatar-grid button .portrait { width: 44px; height: 44px; clip-path: circle(50%); }
.avatar-grid button[aria-pressed="true"] { border-color: var(--ink); background: var(--gold); box-shadow: 2px 2px 0 var(--ink); }
.hue { -webkit-appearance: none; appearance: none; height: 12px; border-radius: 6px; border: 1.5px solid var(--ink) !important; background: linear-gradient(90deg, hsl(0 45% 75%), hsl(60 45% 75%), hsl(120 45% 75%), hsl(180 45% 75%), hsl(240 45% 75%), hsl(300 45% 75%), hsl(360 45% 75%)) !important; }
.odds-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.odds { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.odds td, .odds th { padding: 7px 8px 7px 0; font-size: .875rem; text-align: left; border-bottom: 1px solid var(--rule); }
.odds th { font: 700 .72rem var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); border-bottom-color: var(--ink); }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
/* Page turns, the loading throbber and content arriving live in css/motion.css. */
@keyframes pageIn { from { opacity: 0; transform: translateX(16px); } }
.avatar.mark { font-size: 0; color: var(--ink); }
.avatar.mark .g { width: 55%; height: 55%; }

/* Share sheet (public/js/sharecard.js) */
.share-preview { width: 100%; max-height: 52vh; object-fit: contain; border-radius: var(--r-1); box-shadow: 0 6px 24px rgb(0 0 0 / .18); background: var(--paper-3); }
.share-sheet .row { gap: var(--s2); }
.invite-card h2 { font: italic 800 1.5rem var(--display); }
.invite-link { display: flex; gap: var(--s2); align-items: center; padding: var(--s2) var(--s2) var(--s2) var(--s3); border: 1.5px dashed var(--ink); border-radius: var(--r-1); background: var(--paper-3); }
.invite-link code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 1rem var(--body); }
.invited { display: flex; gap: var(--s2); align-items: center; padding: var(--s3); border: 1.5px solid var(--ink); border-radius: var(--r-1); background: var(--paper-2); font-size: .95rem; }
.invited .g { width: 28px; height: 28px; flex: none; color: var(--signal); }
.contacts-box h2 { font: italic 800 1.25rem var(--display); }
.contacts-box textarea { width: 100%; }

/* Fact of the day on home */
.fact-card { display: grid; gap: var(--s2); margin-top: var(--s5); padding: var(--s4) var(--s4) var(--s3); border-left: 6px solid var(--topic); background: var(--paper-2); border-radius: var(--r-1); color: inherit; text-decoration: none; box-shadow: inset 0 0 0 1px var(--rule); }
.fact-card p { font: italic 600 1.25rem/1.35 var(--display); }
.fact-card .fact-cta { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--topic-ink, var(--ink)); }
.fact-card .fact-cta .g { width: 20px; height: 20px; color: var(--topic); }
.fact-opt { margin-top: var(--s2); }

/* A past match, question by question (views/match.js). */
.mr-score { margin-top: var(--s4); }
.mr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.mr-round { display: grid; gap: var(--s2); padding: var(--s4); }
.mr-q { font: 600 1.05rem/1.35 var(--display); }
.mr-answer { display: flex; gap: 6px; align-items: center; color: var(--ink-2); }
.mr-answer svg { width: 16px; height: 16px; stroke: var(--good, #2E7D4F); fill: none; stroke-width: 2.5; }
.mr-side { display: grid; grid-template-columns: 68px 18px minmax(0, 1fr) auto 38px; gap: var(--s2); align-items: center; padding: 6px var(--s2); border-radius: var(--r-1); background: var(--paper-3); font-size: .9rem; }
.mr-side.right { background: color-mix(in srgb, var(--good, #2E7D4F) 14%, var(--paper-2)); }
.mr-side.wrong { background: color-mix(in srgb, var(--bad, #B8321A) 12%, var(--paper-2)); }
.mr-who { font-weight: 700; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-mark svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.5; display: block; }
.mr-side.right .mr-mark { color: var(--good, #2E7D4F); }
.mr-side.wrong .mr-mark { color: var(--bad, #B8321A); }
.mr-pick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-pts { text-align: right; font-variant-numeric: tabular-nums; }
.h2h { margin-top: var(--s3); }
