/* Hallmark · shape: app screen · genre: atmospheric · theme: custom, wotreborn.com's (its tokens, as the account page carries them; system faces, since these pages load nothing from elsewhere) · scope: app
 * nav: a top bar, the logo and three links · signature: the ledger, the ranked table in tabular numerals with the sorted column lit in gold · states: full, empty, search-empty, not found, error; no loading state, the pages arrive rendered
 * axes: dark/grotesk-heavy/warm · posture: restrained · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S4 R5 V4 · weakest: H, a ranked table argues by its numbers; the one gold column says what the board is sorted by */

/* ---- tokens: the account page's (public/index.html), wotreborn.com's tokens.css */
:root {
  color-scheme: dark;
  --space-3xs: 2px; --space-2xs: 4px; --space-xs: 8px; --space-sm: 12px; --space-md: 16px; --space-lg: 24px; --space-xl: 40px; --space-2xl: 64px; --space-3xl: 96px;
  --text-xs: 0.8125rem; --text-sm: 0.875rem; --text-md: 1rem; --text-lg: 1.125rem; --text-xl: 1.266rem; --text-2xl: 1.602rem; --text-3xl: 2.027rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-micro: 120ms; --dur-short: 220ms;
  --color-paper: oklch(13.5% 0.01 250); --color-paper-2: oklch(17.5% 0.012 250); --color-paper-3: oklch(22% 0.014 250);
  --color-ink: oklch(95% 0.012 85); --color-ink-2: oklch(84% 0.012 85); --color-muted: oklch(68% 0.014 250);
  --color-rule: oklch(28% 0.012 250); --color-rule-2: oklch(40% 0.012 250);
  --color-accent: oklch(80% 0.13 84); --color-accent-ink: oklch(16% 0.02 250); --color-focus: oklch(84% 0.13 86);
  --color-error: oklch(72% 0.15 27); --color-success: oklch(76% 0.13 150);
  --font-display: "Archivo", "Bahnschrift", "Segoe UI Variable Display", system-ui, -apple-system, sans-serif;
  --font-body: "Archivo", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-code: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --radius: 0;
  --control-height: 40px;
  --container: 64rem;
}

/* ---- base: what the Floor decided */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scrollbar-color: var(--color-muted) var(--color-paper); }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; background: var(--color-paper); color: var(--color-ink); font-family: var(--font-body); font-size: var(--text-md); line-height: 1.5; -webkit-font-smoothing: antialiased; caret-color: var(--color-accent); }
::selection { background: color-mix(in oklab, var(--color-accent) 22%, transparent); color: var(--color-ink); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
h1, h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-stretch: 80%; letter-spacing: -0.02em; line-height: 1; text-wrap: balance; overflow-wrap: break-word; min-width: 0; }
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-xl); margin: var(--space-2xl) 0 var(--space-md); }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; transition: color var(--dur-short) var(--ease-out), text-decoration-color var(--dur-short) var(--ease-out); }
a:hover { text-decoration-color: var(--color-accent); }
img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: clip; clip-path: inset(50%); white-space: nowrap; }
.cmd { font-family: var(--font-code); font-size: 0.95em; color: var(--color-ink); }

/* ---- the shell: one top bar, one capped column */
.bar { border-bottom: 1px solid var(--color-rule); background: var(--color-paper-2); }
.bar-in, main, .foot { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--space-md); }
.bar-in { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); min-height: 64px; }
.mark { display: flex; align-items: center; gap: var(--space-sm); min-height: 44px; text-decoration: none; font-family: var(--font-display); font-weight: 800; font-stretch: 80%; font-size: var(--text-lg); }
.mark:hover { color: var(--color-ink); }
.bar nav { display: flex; gap: var(--space-2xs); }
.bar nav a { display: flex; align-items: center; min-height: 44px; padding-inline: var(--space-sm); color: var(--color-ink-2); font-size: var(--text-sm); font-weight: 500; text-decoration: none; transition: color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out); }
.bar nav a:hover { color: var(--color-ink); background: var(--color-paper-3); }
.bar nav a:active { background: var(--color-rule); }
.bar nav a[aria-current="page"] { color: var(--color-ink); box-shadow: inset 0 -2px 0 var(--color-accent); }
.bar nav a { white-space: nowrap; }
@media (max-width: 40rem) {
  .mark span { display: none; }
  .bar nav a { padding-inline: var(--space-xs); }
}
main { flex: 1; padding-block: var(--space-2xl) var(--space-3xl); }
.foot { padding-block: var(--space-lg) var(--space-xl); border-top: 1px solid var(--color-rule); color: var(--color-muted); font-size: var(--text-sm); }
.foot a { color: var(--color-ink-2); }

/* ---- the board's head: the title and the search on one line */
.head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--space-md) var(--space-lg); margin-bottom: var(--space-lg); }
.search { display: flex; gap: var(--space-xs); width: min(100%, 22rem); }
.search input { flex: 1; min-width: 0; min-height: var(--control-height); padding: 0 var(--space-sm); border: 1px solid var(--color-muted); border-radius: var(--radius); background: var(--color-paper); color: var(--color-ink); transition: border-color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out); }
.search input::placeholder { color: var(--color-muted); }
.search input:hover { border-color: var(--color-ink-2); }
.search input:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -1px; background: var(--color-paper-2); }
.search input:disabled { opacity: 0.55; cursor: not-allowed; }
button.secondary { min-height: var(--control-height); padding: 0 var(--space-md); border: 1px solid var(--color-rule-2); border-radius: var(--radius); background: transparent; color: var(--color-ink); font-weight: 500; cursor: pointer; transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
button.secondary:hover { background: var(--color-paper-3); border-color: var(--color-muted); }
button.secondary:active { transform: translateY(1px); }
button.secondary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* what the board is ranked by: a row of tabs, scrolling sideways on a phone rather than wrapping */
.sorts { display: flex; overflow-x: auto; border-bottom: 1px solid var(--color-rule); margin-bottom: var(--space-md); scrollbar-width: none; }
.sorts a { flex: none; display: flex; align-items: center; min-height: 44px; padding-inline: var(--space-md); color: var(--color-ink-2); font-size: var(--text-sm); font-weight: 500; text-decoration: none; transition: color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out); }
.sorts a:hover { color: var(--color-ink); background: var(--color-paper-3); }
.sorts a:active { background: var(--color-rule); }
.sorts a:focus-visible { outline-offset: -2px; }
.sorts a[aria-current="true"] { color: var(--color-ink); box-shadow: inset 0 -2px 0 var(--color-accent); }
.note { color: var(--color-muted); font-size: var(--text-sm); margin-bottom: var(--space-md); }

/* ---- the ledger: horizontal rules only, numbers in tabular figures, the sorted column in gold */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: var(--space-sm) var(--space-sm); border-bottom: 1px solid var(--color-rule); text-align: right; white-space: nowrap; }
thead th { color: var(--color-muted); font-size: var(--text-sm); font-weight: 500; border-bottom-color: var(--color-rule-2); }
tbody th { font-weight: 500; text-align: left; }
th.who, td.who, .recent th:nth-child(-n + 2), .recent td:first-child { text-align: left; }
tbody tr { transition: background-color var(--dur-micro) var(--ease-out); }
tbody tr:hover { background: var(--color-paper-2); }
.rank { width: 3.5rem; color: var(--color-muted); text-align: left; }
.board tbody tr:nth-child(-n + 3) .rank { color: var(--color-ink); font-weight: 700; }
.who a { display: inline-block; padding-block: var(--space-2xs); text-decoration: none; }
.who a:hover { text-decoration: underline; text-decoration-color: var(--color-accent); }
td.on { color: var(--color-accent); font-weight: 700; }
.when { color: var(--color-muted); }
td.won { color: var(--color-success); font-weight: 500; }
td.lost { color: var(--color-muted); }
/* on a phone the rank and the name stay put while the numbers scroll under them */
@media (max-width: 40rem) {
  .board .rank, .board .who { position: sticky; background: var(--color-paper); }
  .board .rank { left: 0; z-index: 1; width: 2.75rem; }
  .board .who { left: 2.75rem; z-index: 1; box-shadow: 1px 0 0 var(--color-rule); }
  .board tbody tr:hover .rank, .board tbody tr:hover .who { background: var(--color-paper-2); }
}

/* ---- a player */
.who-head { display: grid; gap: var(--space-sm); margin-bottom: var(--space-xl); }
.since { color: var(--color-ink-2); }
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-block: 1px solid var(--color-rule); }
.figures div { padding: var(--space-lg) var(--space-md); border-left: 1px solid var(--color-rule); }
.figures div:first-child { border-left: 0; padding-left: 0; }
.figures dt { color: var(--color-muted); font-size: var(--text-sm); white-space: nowrap; }
.figures dd { margin: var(--space-2xs) 0 0; font-size: var(--text-2xl); font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 40rem) {
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures div:nth-child(odd) { border-left: 0; padding-left: 0; }
  .figures div:nth-child(n + 3) { border-top: 1px solid var(--color-rule); }
}
.trend { margin: var(--space-xl) 0 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-xs) var(--space-sm); }
.trend figcaption { grid-column: 1 / -1; color: var(--color-ink-2); font-size: var(--text-sm); }
.trend svg { width: 100%; height: 120px; display: block; background: var(--color-paper-2); }
.trend polyline { fill: none; stroke: var(--color-accent); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.trend circle { fill: var(--color-accent); }
.trend .half { stroke: var(--color-rule-2); stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.scale { display: flex; flex-direction: column; justify-content: space-between; color: var(--color-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }

/* ---- empty, not found, broken: what belongs here and the one thing that fills it */
.empty { display: grid; gap: var(--space-sm); padding: var(--space-xl) 0; max-width: 40rem; color: var(--color-ink-2); }
.empty h1 { color: var(--color-ink); margin-bottom: var(--space-xs); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; } }
