/* Self-hosted so the first paint never waits on a third-party connection.
   Latin subset only, which is every glyph this site actually sets. */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/Archivo-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/Archivo-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/Archivo-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/IBMPlexMono-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/IBMPlexMono-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/IBMPlexMono-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* REDSEC design tokens. Exported from the brand direction so the build starts
   from the same values as the mockups. */
/* The tracker palette. Names are unchanged from the first system so every rule
   below inherits the retune, and the light theme redefines the same names. */
:root {
  --chrome: #171B20;
  /* The R mark, in whichever colour reads on this ground. */
  --mark: url("/static/logo.png");
  --ground: #0F1216;
  --panel:  #171B20;
  --panel2: #1C2127;
  --rule:   #252A31;
  --line:   #20252B;
  --bar:    #2E343C;
  --faint:  #626A73;
  --muted:  #889099;
  --text:   #E2E6EA;
  --bright: #FFFFFF;
  /* Reserved: live, losses, and the leading edge of a wipe. Nothing else. */
  --accent: #FF4438;
  --rise:   #5FD38A;
  --gold:   #E8B341;

  /* Squad monograms. Muted enough to sit behind a name without shouting. */
  --m0:#4A6FA5; --m1:#7A4A8C; --m2:#2F7D6B; --m3:#A05A2C;
  --m4:#7C5CBF; --m5:#3F7A3F; --m6:#A8484E; --m7:#3D6E8E;

  /* Placement bands: a value ramp, not a set of hues. The system spends its
     one colour on the thing worth marking — a win — and reads the rest as
     brightness, the way the rest of the site does. */
  --b-win:#FF4438; --b-podium:#CED4DA; --b-top:#848D96;
  --b-mid:#4C555E; --b-low:#2B3238;

  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r: 3px;
  --header-h: 50px;
  --strip-h: 40px;
  /* The chrome's side inset: whatever puts its edges on the content column's,
     which is 1100px wide with the gutter inside it. 100% rather than 100vw,
     so a scrollbar does not push the chrome out of line with the page. */
  --inset: max(var(--gutter), calc((100% - 1100px) / 2 + var(--gutter)));
  --rail-w: 296px;
  --gutter: 20px;
}

/* Light is a first-class theme, not an afterthought: the same names, different
   values. The attribute wins over the media query so a stated choice sticks. */
:root[data-theme="light"] {
  --chrome: #FFFFFF;
  --mark: url("/static/logo-dark.png");
  --ground: #F1F3F5;
  --panel:  #FFFFFF;
  --panel2: #F7F8FA;
  --rule:   #DFE3E8;
  --line:   #EAEDF0;
  --bar:    #C9D0D8;
  --faint:  #98A0A8;
  --muted:  #69717A;
  --text:   #1B1F24;
  --bright: #000000;
  --accent: #DC3A2E;
  --rise:   #2E9E5F;
  --gold:   #9A6B10;
  --b-win:#DC3A2E; --b-podium:#2B3238; --b-top:#6B747D;
  --b-mid:#AEB6BE; --b-low:#DDE2E6;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --chrome: #FFFFFF;
    --mark: url("/static/logo-dark.png");
    --ground: #F1F3F5;
    --panel:  #FFFFFF;
    --panel2: #F7F8FA;
    --rule:   #DFE3E8;
    --line:   #EAEDF0;
    --bar:    #C9D0D8;
    --faint:  #98A0A8;
    --muted:  #69717A;
    --text:   #1B1F24;
    --bright: #000000;
    --accent: #DC3A2E;
    --rise:   #2E9E5F;
    --gold:   #9A6B10;
    --b-win:#DC3A2E; --b-podium:#2B3238; --b-top:#6B747D;
    --b-mid:#AEB6BE; --b-low:#DDE2E6;
  }
}

*, *::before, *::after { box-sizing: border-box; }

/* The system used to forbid border radius outright, to read as documents rather
   than cards. The tracker layout is built on cards, so a small radius is the
   rule now — small enough that tables still read as tables. */
html, body { border-radius: 0; }
input, button, select, textarea { border-radius: var(--r); }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--bright); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

h1, h2, h3 { font-family: var(--sans); margin: 0; }
h1 { font-size: 27px; font-weight: 700; color: var(--bright); letter-spacing: -0.01em; }
h2 { font-size: 19px; font-weight: 700; color: var(--bright); }
h3 { font-size: 13px; font-weight: 600; color: var(--bright); }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.bright { color: var(--bright); }
/* Numbers and dates never wrap: a wrapped figure changes row height, which on
   a live table reads as the layout breaking. */
.num { font-variant-numeric: tabular-nums; font-family: var(--mono); text-align: right; white-space: nowrap; }

/* ---------- Header ---------- */
.header {
  height: var(--header-h);
  background: var(--chrome);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 var(--inset);
  position: sticky;
  top: 0;
  z-index: 40;
}

/* Logo only. Sized up from the lockup, since it is now carrying the header
   by itself, and given its own hit area rather than inheriting the text's. */
.wordmark { display: flex; align-items: center; padding: 4px; margin-left: -4px; }
/* The R, as a background so the theme can swap it: an <img> src cannot
   follow a stylesheet, and the toggle only ever changes the stylesheet. */
.mark { display: block; background: var(--mark) center / contain no-repeat; }
.wordmark .mark { width: 28px; height: 28px; }
.wordmark:hover { opacity: 0.85; }

/* The active tab is filled, not underlined: at this size a line under two
   words is easy to miss and the fill never is. */
.nav { display: flex; gap: 2px; flex: 1; }
/* Icon-only: a fixed square so the row reads as a set of controls, with the
   name carried by title and aria-label rather than by visible text. */
.nav a {
  display: grid; place-items: center;
  width: 36px; height: 32px;
  color: var(--muted);
  border-radius: var(--r);
}
.ico {
  width: 20px; height: 20px; display: block;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: square; stroke-linejoin: miter;
}
.nav a:hover { background: var(--panel2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--accent); color: #fff; }
.nav a[aria-current="page"] .ico { stroke-width: 2; }

.header-tools { display: flex; align-items: center; gap: 8px; }

.search input {
  background: var(--ground);
  border: 1px solid var(--rule);
  color: var(--text);
  font-family: var(--sans);
  font-size: 12.5px;
  padding: 6px 9px;
  width: 150px;
}
.search input::placeholder { color: var(--faint); }

/* Two square controls: the theme, and the global spoiler seal. */
.icon-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover { color: var(--text); border-color: var(--faint); }

.spoiler-toggle {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  color: var(--muted);
  font-family: var(--sans);
  padding: 0;
  cursor: pointer;
}
.spoiler-toggle [data-spoiler-label] { display: none; }
.spoiler-toggle:hover { border-color: var(--faint); color: var(--text); }
.spoiler-toggle .pip { width: 14px; height: 12px; background: var(--bar); display: block;
  border-radius: 1px; }
.spoiler-toggle[aria-pressed="false"] { color: var(--text); }
.spoiler-toggle[aria-pressed="false"] .pip { background: var(--rise); }

@media (max-width: 860px) {
  .header { gap: 10px; overflow-x: auto; }
  .search { display: none; }

}

/* ---------- Context strip ---------- */
.strip {
  height: var(--strip-h);
  background: var(--chrome);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 var(--inset);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.strip .sep { color: var(--rule); }
.strip .spacer { flex: 1; }

/* Status first, then the trail, then whatever the page keeps in view. Status
   is a badge rather than a crumb: "Live" is not a place you can go back to. */
.strip-status { display: inline-flex; align-items: center; gap: 7px; flex: none; }
.strip-status.is-live { color: var(--accent); }
.strip-meta { display: flex; align-items: center; gap: 14px; flex: none; margin-left: auto; }

.crumbs { flex: 1; min-width: 0; }
.crumbs ol { display: flex; align-items: center; gap: 10px; list-style: none;
  margin: 0; padding: 0; min-width: 0; }
.crumbs > ol > li { display: flex; align-items: center; gap: 10px; min-width: 0; white-space: nowrap; }
.crumbs > ol > li + li::before { content: "/"; color: var(--rule); }
.crumbs a { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.crumbs a:hover { color: var(--bright); }
.crumbs [aria-current="page"] { color: var(--text); }

/* The last crumb, when it has siblings, opens into them. */
.crumb-switch { position: relative; }
.crumb-switch summary { cursor: pointer; list-style: none; color: var(--text); }
.crumb-switch summary::-webkit-details-marker { display: none; }
.crumb-switch summary::after { content: " ▾"; color: var(--faint); }
.crumb-switch[open] summary::after { content: " ▴"; }
.crumb-switch ul {
  position: absolute; top: calc(100% + 10px); left: -10px; z-index: 20;
  min-width: 150px; max-height: 60vh; overflow-y: auto;
  list-style: none; margin: 0; padding: 4px 0;
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r);
}
.crumb-switch li { display: block; }
.crumb-switch a { display: block; padding: 7px 12px; color: var(--muted); }
.crumb-switch a:hover { color: var(--bright); background: var(--chrome); }
.crumb-switch a[aria-current="page"] { color: var(--bright); box-shadow: inset 2px 0 0 var(--accent); }

/* A phone has room for where you came from and where you are, not the whole
   way down. The parent turns into a back link; the rest of the trail and
   anything purely informational drop out. */
@media (max-width: 620px) {
  .crumbs > ol > li:not(:nth-last-child(-n+2)) { display: none; }
  .crumbs > ol > li:nth-last-child(2)::before { content: none; }
  .crumbs > ol > li:nth-last-child(2) > a::before { content: "‹ "; }
  .strip-meta .info { display: none; }
}

.live-dot {
  width: 7px; height: 7px;
  background: var(--accent);
  display: inline-block;
  animation: pulse 1.6s ease-in-out infinite;
}
.live-label { color: var(--accent); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- Layout ---------- */
.body { max-width: 1100px; margin: 0 auto; padding: 16px var(--gutter) 60px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--rail-w); gap: 26px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 22px; }
/* The fixture feed spaces itself through its own cards. */
.feed { min-width: 0; }

.page-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

.panel { background: var(--panel); border: 1px solid var(--rule);
  border-radius: var(--r); overflow: hidden; }
.panel-head {
  height: 34px;
  background: var(--chrome);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.panel-body { padding: 14px; }
.panel-body p { margin: 0 0 10px; }
.panel-body p:last-child { margin-bottom: 0; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 14px; }
thead th {
  height: 34px;
  background: var(--chrome);
  border-bottom: 1px solid var(--rule);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 0 12px;
  white-space: nowrap;
}
thead th.num { text-align: right; }
/* Numeric columns are fixed pixel widths, never percentages — values must not
   shift the layout as they update on a live table. */
th.w-pos { width: 52px; }
th.w-num { width: 72px; }
th.w-wide { width: 92px; }

tbody td {
  height: 45px;
  padding: 0 12px;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
/* No zebra striping: the dividers are enough, and stripes fight the bars. */
tbody tr:hover td { background: #1D2126; }

td.pos { color: var(--muted); font-variant-numeric: tabular-nums; }
td.name { color: var(--bright); font-weight: 500; }
td.key { color: var(--bright); font-weight: 600; }

.team-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* Most squads have no logo, so the empty state is a plain square, not a glyph. */
.logo {
  width: 22px; height: 22px; flex: none;
  background: var(--ground); border: 1px solid var(--rule); border-radius: 2px;
  display: grid; place-items: center; overflow: hidden;
}
.logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* Ours, standing in for theirs: dimmed and inset so it never reads as a claim
   about who the squad is. */
.logo .is-fallback { width: 14px; height: 14px; opacity: 0.38; }
/* A face fills its square; a logo is fitted inside it. */
.logo img.photo { object-fit: cover; }
.team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { color: var(--muted); font-size: 12px; }

.rise { color: var(--rise); }
.drop { color: var(--accent); }

/* ---------- The redaction device ---------- */
/* A bar always covers something real. The value stays in the DOM and stays
   readable by screen readers; the bar is a visual layer over it. */
.seal { position: relative; display: inline-block; vertical-align: middle; }
.seal > .seal-value {
  opacity: 0;
  user-select: none;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.seal > .seal-bar {
  position: absolute;
  inset: 0;
  min-width: 100%;
  background: var(--bar);
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: block;
  /* The bar tracks the width of what it covers, so a sealed table has rhythm
     instead of reading as a loading skeleton. */
  transform-origin: left center;
  transition: transform 220ms ease-out;
}
/* Touch target is padded, not the bar: the bar stays the height of its text. */
.seal > .seal-bar::before {
  content: "";
  position: absolute;
  inset: -14px -4px;
}
.seal > .seal-bar::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 5px;
  background: var(--accent);
  opacity: 0;
}

.seal.revealed > .seal-value { opacity: 1; }
.seal.revealed > .seal-bar { transform: scaleX(0); pointer-events: none; }
.seal.wiping > .seal-bar::after { opacity: 1; }

/* Loading and unknown states are the same bars, un-tappable — a sealed table
   and a loading table look related instead of unrelated. */
.seal.static > .seal-bar { cursor: default; pointer-events: none; }
.seal.pending > .seal-bar {
  background: repeating-linear-gradient(135deg, var(--bar) 0 6px, #262B32 6px 12px);
}

/* Only one animation exists in the system. Honour the preference to skip it. */
@media (prefers-reduced-motion: reduce) {
  .seal > .seal-bar { transition: none; }
  .live-dot { animation: none; }
}

.reveal-all {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 6px 0;
}
.reveal-all:hover { color: var(--bright); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 11px 16px;
  min-height: 40px;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--chrome); font-weight: 600; }
.btn-secondary { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn-tertiary { background: var(--panel); border-color: var(--rule); color: var(--text); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn[hidden] { display: none; }

/* ---------- Forms ---------- */
label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
input[type="text"], input[type="email"], input[type="password"], input[type="url"],
input[type="number"], select, textarea {
  width: 100%;
  background: var(--ground);
  border: 1px solid var(--rule);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px;
}
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }

/* ---------- Rail ---------- */
.rail { display: flex; flex-direction: column; gap: 18px; position: sticky; top: calc(var(--header-h) + 14px); }
.rail .rank-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--rule); font-family: var(--mono); font-size: 13px; }
.rail .rank-row:last-child { border-bottom: none; }
.rail .rank-row .p { color: var(--muted); width: 22px; font-variant-numeric: tabular-nums; }
.rail .rank-row .n { color: var(--bright); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Empty and sparse states ---------- */
/* "Nobody has sourced this yet" is a primary state here, not an edge case. */
.empty { padding: 30px 14px; text-align: center; color: var(--muted); }
.empty .bars { display: flex; flex-direction: column; gap: 7px; align-items: center; margin-bottom: 14px; }
.empty .bars i { display: block; height: 10px; background: var(--bar); }
.empty p { margin: 0 0 4px; font-size: 13px; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--rule);
  padding: 24px var(--gutter) 40px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.footer .disclaimer { flex: 1; min-width: 260px; }

/* ---------- Prose ---------- */
.prose { max-width: 68ch; }
.prose p { margin: 0 0 12px; }
.prose h2 { margin: 24px 0 10px; }
.prose code { font-family: var(--mono); font-size: 12px; background: var(--chrome); padding: 2px 5px; }
.prose ul { margin: 0 0 12px; padding-left: 18px; }
.prose li { margin-bottom: 5px; }

/* ---------- Mobile ---------- */
/* A six-column standings table does not survive 390px. Secondary columns are
   dropped rather than scaled, leaving position, squad and the decisive figure. */
@media (max-width: 900px) {
  :root { --gutter: 16px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; }
  .header { gap: 14px; overflow-x: auto; }
  .search { display: none; }
  .nav { gap: 14px; }
  td.collapse, th.collapse { display: none; }
  thead th { padding: 0 8px; }
  tbody td { padding: 0 8px; }
}

/* ---------- Event pages: overview, then the funnel ---------- */
/* The round navigation is also the shape of the tournament: each segment is
   sized by the field that survived into it. */
.funnel { display: flex; gap: 2px; margin: 0 0 20px; }
.funnel .seg {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  padding: 13px 16px;
  color: var(--muted);
  font-family: var(--mono);
  min-width: 0;
  display: block;
}
.funnel .seg:hover { background: #1D2126; color: var(--text); }
.funnel .seg.is-current { border-bottom-color: var(--accent); color: var(--text); }
.funnel .seg .r { display: block; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; }
.funnel .seg.is-current .r { color: var(--bright); }
.funnel .seg .n {
  display: block; font-size: 24px; font-weight: 600; color: var(--bright);
  font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 3px;
}
.funnel .seg .sub { display: block; font-size: 11px; white-space: nowrap; }
.funnel .seg .drop { color: var(--accent); }
.funnel .overview { flex: 0 0 auto; }
.funnel .overview .n { font-size: 15px; margin-top: 7px; letter-spacing: 0.06em; }

.section-head { margin: 26px 0 12px; }
.note { font-size: 12px; margin: 10px 0 0; }
a.quiet { color: inherit; }

/* The podium is the thing a visitor most wants and most fears seeing, so it
   is the most deliberate seal on the site. */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.place { background: var(--panel); border: 1px solid var(--rule); padding: 16px 14px; }
.place .p {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 9px;
}
.place .who { font-size: 19px; font-weight: 700; color: var(--bright); }
.place .stat { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 5px; }
.place.first { border-color: var(--bar); }
.place.first .who { font-size: 24px; }

.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 1px; background: var(--rule); border: 1px solid var(--rule);
}
.facts.wide { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.fact { background: var(--panel); padding: 13px 14px; }
.fact dt {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 5px;
}
.fact dd {
  margin: 0; font-family: var(--mono); font-size: 18px; color: var(--bright);
  font-variant-numeric: tabular-nums;
}
.facts.wide .fact dd { font-size: 15px; }
.fact dd small { font-size: 12px; color: var(--muted); }
.unknown { color: var(--muted); }

/* A round: every lobby side by side, because a lobby is the only scope in
   which a standings table means anything. */
.sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--rule); align-self: start; }
.card-head {
  display: flex; align-items: center; gap: 10px;
  background: var(--chrome); border-bottom: 1px solid var(--rule);
  padding: 0 12px; height: 34px;
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.card-head .n { margin-left: auto; }
.card table { font-size: 13px; }
.card tbody td { height: 38px; }
.card .more {
  display: block; width: 100%; background: none; border: 0;
  border-top: 1px solid var(--rule); color: var(--muted);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 11px; min-height: 40px; cursor: pointer;
}
.card .more:hover { color: var(--bright); }
/* A folded card is narrow, so it carries only the decisive figure. The rest of
   the columns appear when it expands to the full width of the sheet. */
.card:not(.expanded) .extra { display: none; }

/* Every row is in the DOM for search engines; the fold is presentational,
   and without JavaScript the whole table simply shows. */
.card.folded tbody tr:nth-child(n + 6) { display: none; }
.card .when-open { display: none; }
.card.folded .when-open { display: none; }
.card.folded .when-folded { display: inline; }
.card:not(.folded) .when-folded { display: none; }
.card:not(.folded) .when-open { display: inline; }
.card.expanded { grid-column: 1 / -1; }
tr.qualified td:first-child { box-shadow: inset 3px 0 0 var(--rise); }

.submit-strip { margin-top: 30px; }
.submit-strip .panel-body { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.submit-strip p { flex: 1; min-width: 280px; margin: 0; }

@media (max-width: 760px) {
  .funnel { overflow-x: auto; }
  .podium { grid-template-columns: 1fr; }
  .sheet { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Legacy tournaments ---------- */
/* A published leaderboard with no per-match record beneath it. Marked plainly
   rather than dressed up, so nobody mistakes it for the same kind of record as
   an event we hold every game for. */
.legacy-tag {
  color: var(--bright);
  background: var(--bar);
  padding: 3px 8px;
  letter-spacing: 0.14em;
}
.legacy-flag {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); border: 1px solid var(--rule);
  padding: 2px 6px; margin-left: 8px; white-space: nowrap;
}

/* ---------- Schedule ---------- */
/* Filter chips report their own effect, so nobody clicks into an empty list. */
.chips { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--rule); border-right: 0;
  color: var(--muted); font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 9px 14px; min-height: 38px;
}
.chip:last-child { border-right: 1px solid var(--rule); }
.chip:hover { color: var(--bright); }
.chip.is-current { color: var(--bright); background: var(--chrome); }
.chip .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.is-current .n { color: var(--text); }

td.countdown { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.soon { color: var(--bright); }
.mono-sm { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.live-now { border-color: var(--bar); margin-bottom: 22px; }

/* ---------- Search ---------- */
.search-form { display: flex; gap: 0; margin: 0 0 22px; max-width: 560px; }
.search-form input { border-right: 0; }
.search-form .btn { flex: none; }
td.kind {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Home: the strip and the river ---------- */
.next-strip {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: var(--chrome); border: 1px solid var(--rule);
  padding: 14px 18px; margin-bottom: 24px;
}
.next-strip.is-live { border-color: var(--bar); }
.next-strip .when {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; white-space: nowrap;
}
.next-strip .what { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; }
.next-strip .what a { color: var(--bright); font-weight: 600; font-size: 15px; }
.next-strip .what .muted { font-family: var(--mono); font-size: 11px; }

/* One dated stream, so the page reads top to bottom rather than as three
   stacked lists. */
.river { list-style: none; margin: 0; padding: 0; }
.river-item {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 14px; align-items: baseline;
  padding: 12px 14px; border-bottom: 1px solid var(--rule);
}
.river-item:last-child { border-bottom: 0; }
.river-item .kind {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
}
.river-item .kind-amendment { color: var(--accent); }
.river-item .entry { min-width: 0; }
.river-item .entry a { color: var(--bright); font-weight: 500; }
.river-item .when {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.standout .who { font-size: 19px; font-weight: 700; color: var(--bright); margin-bottom: 4px; }
.standout .muted { font-family: var(--mono); font-size: 12px; }

@media (max-width: 620px) {
  .river-item { grid-template-columns: minmax(0, 1fr) auto; }
  .river-item .kind { grid-column: 1 / -1; }
}
/* The rail carries both ranking positions and countdowns; a countdown needs
   its own width rather than the 22px a position needs. */
.rail .rank-row .p { white-space: nowrap; }
.rail .rank-row .p:has(.soon), .rail .rank-row .p:has(.live-label),
.rail .rank-row .p .muted { width: auto; }
.rail .rank-row .p { width: auto; min-width: 22px; }

/* ---------- Score matrix ---------- */
/* The identity column stays put while the games scroll, which is the whole
   reason a twenty-squad, ten-game grid is readable at all. */
.matrix-scroll { overflow-x: auto; }
table.matrix { min-width: max-content; }
table.matrix th, table.matrix td { white-space: nowrap; }

.sticky-pos, .sticky-team { position: sticky; z-index: 2; }
.sticky-pos { left: 0; width: 46px; }
.sticky-team { left: 46px; min-width: 168px; }
thead .sticky-pos, thead .sticky-team { background: var(--chrome); z-index: 3; }
tbody .sticky-pos, tbody .sticky-team { background: var(--panel); }
tbody tr:hover .sticky-pos, tbody tr:hover .sticky-team { background: #1D2126; }
/* A rule on the sticky edge, so the frozen columns read as a held-back pane. */
.sticky-team { box-shadow: inset -1px 0 0 var(--rule); }

.game-head { text-align: center !important; border-left: 1px solid var(--rule); }
.game-head a { color: var(--muted); }
.game-head a:hover { color: var(--bright); }
.sub-head {
  text-align: center !important; padding: 0 0 6px !important;
  font-size: 9px !important; color: var(--muted); font-weight: 500 !important;
}
td.cell {
  text-align: center; font-family: var(--mono); font-size: 13px;
  font-variant-numeric: tabular-nums; padding: 0 9px; color: var(--text);
}
td.cell.k { color: var(--muted); border-right: 1px solid var(--rule); }
td.cell.none { color: var(--rule); }

/* Rank tinting: the grid should read as who-won-what before any number does.
   One hue, varying weight, so the single-accent rule holds.
   The tint is part of what the bar hides. Shown under a sealed cell it would
   give away every game's winner while the numbers were still covered, which
   defeats the point of sealing them. */
td.cell:has(.seal.revealed).r1 { background: rgba(255, 68, 56, 0.22); color: var(--bright); font-weight: 600; }
td.cell:has(.seal.revealed).r2 { background: rgba(255, 68, 56, 0.15); color: var(--bright); }
td.cell:has(.seal.revealed).r3 { background: rgba(255, 68, 56, 0.10); color: var(--bright); }
td.cell:has(.seal.revealed).r5 { background: rgba(255, 68, 56, 0.06); }
td.cell:has(.seal.revealed).r10 { background: rgba(255, 68, 56, 0.03); }

/* The cut line is a row, not a colour the reader has to decode. */
tr.cut-line td {
  height: 26px; padding: 0 12px; background: var(--chrome);
  border-top: 1px solid var(--rise); border-bottom: 1px solid var(--rule);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--rise);
}

/* ---------- Provenance ---------- */
.provenance { margin-top: 22px; }
.prov-block { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--rule); }
.prov-block:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.prov-block h3 {
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 8px;
}
.prov-block p { max-width: 74ch; }
.curve { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px !important; }
.band {
  font-family: var(--mono); font-size: 11px; color: var(--text);
  background: var(--ground); border: 1px solid var(--rule); padding: 4px 8px;
}
.prov-list { list-style: none; margin: 0; padding: 0; }
.prov-list li {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline;
  padding: 7px 0; border-bottom: 1px solid var(--rule);
  font-family: var(--mono); font-size: 12px;
}
.prov-list li:last-child { border-bottom: 0; }
.prov-list .who { color: var(--bright); }
.card-foot { display: flex; border-top: 1px solid var(--rule); }
.card-foot .more { flex: 1; border-top: 0; text-align: center; text-decoration: none; }
.card-foot .more + .more { border-left: 1px solid var(--rule); }
.card-head a { color: var(--muted); }
.card-head a:hover { color: var(--bright); }

/* ---------- Two ways to read a round ---------- */
.view-tabs { display: flex; gap: 0; margin: 0 0 18px; }
.view-tab {
  background: var(--panel); border: 1px solid var(--rule); border-right: 0;
  color: var(--muted); font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 10px 16px; min-height: 40px; display: inline-flex; align-items: center;
}
.view-tab:last-child { border-right: 1px solid var(--rule); }
.view-tab:hover { color: var(--bright); }
.view-tab.is-current { color: var(--bright); background: var(--chrome); border-bottom-color: var(--accent); }

.lobby-bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1px; background: var(--rule); }
.lobby-bar {
  display: flex; flex-direction: column; gap: 3px;
  background: var(--panel); padding: 13px 14px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.lobby-bar:hover { background: #1D2126; }
.lobby-bar .lab {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--bright); margin-bottom: 3px;
}
.lobby-bar .stat b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
td.lobby-cell { font-family: var(--mono); font-size: 12px; }

/* A tournament is one row, however many regions it runs in. */
.next-strip .what .title { color: var(--bright); font-weight: 600; font-size: 15px; }
.next-strip .what a { color: var(--muted); }
.next-strip .what a:hover { color: var(--bright); }
.next-row {
  display: flex; gap: 12px; align-items: baseline;
  padding: 10px 12px; border-bottom: 1px solid var(--rule);
  font-family: var(--mono); font-size: 13px;
}
.next-row:last-child { border-bottom: 0; }
.next-row .when { white-space: nowrap; color: var(--muted); }
.next-row .what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.next-row .title { color: var(--bright); }
.next-row .regions { font-size: 11px; color: var(--muted); }
.next-row .regions a { color: var(--muted); }
.next-row .regions a:hover { color: var(--bright); }
td.regions-cell { font-family: var(--mono); font-size: 12px; }

/* ---------- Headline figures with their standing ---------- */
.headline-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px; background: var(--rule); border: 1px solid var(--rule);
  margin-bottom: 10px;
}
.headline-stat { background: var(--panel); padding: 14px 16px; }
.headline-stat .lab {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
  /* A definition is available on every label, so say so. */
  cursor: help; border-bottom: 1px dotted var(--rule); display: inline-block;
}
.headline-stat .val {
  font-family: var(--mono); font-size: 27px; font-weight: 600;
  color: var(--bright); font-variant-numeric: tabular-nums; line-height: 1.1;
}
.headline-stat .bench {
  display: flex; align-items: baseline; gap: 8px; margin-top: 7px;
  font-family: var(--mono); font-size: 11px;
}
/* A standing against the field is not a result, so it uses brightness rather
   than the accent — which stays reserved for live, losses and actions. */
.band-chip {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 6px; border: 1px solid var(--rule);
}
.band-great { color: var(--bright); border-color: var(--bar); background: var(--bar); }
.band-good { color: var(--text); border-color: var(--bar); }
.band-avg { color: var(--muted); }
.band-poor { color: var(--muted); border-color: transparent; }

/* ---------- Superlatives ---------- */
/* A scoreboard is a list; these are the sentences inside it. */
.superlatives {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 1px; background: var(--rule); border: 1px solid var(--rule);
  margin-bottom: 22px;
}
.superlative { background: var(--panel); padding: 13px 15px; }
.superlative .kind {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 7px;
}
.superlative .who { font-size: 16px; font-weight: 600; color: var(--bright); margin-bottom: 3px; }
.superlative .who a { color: inherit; }
.superlative .val {
  font-family: var(--mono); font-size: 12px; color: var(--text);
  display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
}
.superlative .val .muted { font-size: 11px; }

/* ---------- Leaderboard: sortable, shaded ---------- */
.scroll-x { overflow-x: auto; }
table.lb { min-width: 720px; }
.sort { color: var(--muted); display: inline-flex; gap: 5px; align-items: baseline; cursor: help; }
.sort:hover { color: var(--bright); }
.sort.is-sorted { color: var(--bright); }
.sort .arrow { color: var(--accent); font-size: 9px; }

/* One hue at varying strength, so a dense table becomes scannable without
   adding chrome and without spending a second colour. */
td.heat {
  background: rgba(255, 68, 56, calc(var(--heat, 0) * 0.0022));
  font-variant-numeric: tabular-nums;
}
td.heat:first-of-type { font-weight: 600; }

/* ---------- The funnel and the ratings ---------- */
.funnel-stats, .rating-pair {
  display: grid; gap: 1px; background: var(--rule);
  border: 1px solid var(--rule); margin-bottom: 18px;
}
.funnel-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.rating-pair { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.funnel-step, .rating { background: var(--panel); padding: 14px 16px; }
.funnel-step .lab, .rating .lab {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
  cursor: help; border-bottom: 1px dotted var(--rule); display: inline-block;
}
.funnel-step .val, .rating .val {
  font-family: var(--mono); font-size: 24px; font-weight: 600;
  color: var(--bright); font-variant-numeric: tabular-nums; line-height: 1.15;
}
.funnel-step .sub, .rating .sub { font-family: var(--mono); font-size: 11px; margin-top: 4px; }

/* ---------- Rankings landing ---------- */
/* Each region is ranked on its own, so each gets its own card rather than a
   filter on one table. */
.region-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 14px;
}
.region-card { background: var(--panel); border: 1px solid var(--rule); align-self: start; }
.region-head {
  display: flex; align-items: baseline; gap: 12px;
  background: var(--chrome); border-bottom: 1px solid var(--rule);
  padding: 13px 14px;
}
.region-head .name {
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  letter-spacing: 0.12em; color: var(--bright);
}
.region-head .count {
  margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.region-head:hover .name { color: var(--bright); }
.region-card tbody td { height: 40px; }
.region-card .more { display: block; text-align: center; text-decoration: none; }

/* ==========================================================================
   Fixture cards
   One card per fixture. Time on the left, the squads stacked inside with the
   figure they earned right-aligned, event and tags on the right. A finished
   card carries the podium; an upcoming one carries the seeds, so both read as
   the same object.
   ========================================================================== */

.daylab {
  display: flex; align-items: baseline; gap: 9px;
  margin: 0 0 7px; padding: 0 2px;
}
.daylab b { font-size: 13px; font-weight: 700; color: var(--text); }
.daylab .n { font-size: 11.5px; color: var(--faint); }
.daylab .r { margin-left: auto; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.daylab + .daylab, .mcard + .daylab, .mini + .daylab { margin-top: 20px; }

.mcard {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 200px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  margin-bottom: 6px;
  overflow: hidden;
}
.mcard:hover { background: var(--panel2); border-color: var(--faint); }
.mcard.is-next { box-shadow: inset 3px 0 0 var(--accent); }

.mcard .mtime { padding: 10px 0 10px 12px; border-right: 1px solid var(--line); }
.mcard .mtime .t {
  display: block;
  font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  color: var(--text); font-variant-numeric: tabular-nums;
}
.mcard .mtime .d { display: block; font-size: 10.5px; color: var(--faint); margin-top: 2px; }
.mcard.is-next .mtime .d { color: var(--accent); font-weight: 600; }

.mcard .msquads { padding: 6px 0; min-width: 0; }
.srow {
  display: grid; grid-template-columns: 20px 22px minmax(0, 1fr) 54px;
  gap: 8px; align-items: center; padding: 1px 12px; height: 24px;
}
.srow .pl { font-family: var(--mono); font-size: 10.5px; color: var(--faint); text-align: right; }
.srow .nm {
  font-size: 13px; font-weight: 600; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.srow .pt {
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
  text-align: right; font-variant-numeric: tabular-nums;
}
/* A row of regions rather than squads: no crest column to leave room for, and
   the badge sets its own height, so the row is not clipped to the 22px slot the
   logo used to sit in. */
.srow.is-region { grid-template-columns: 20px minmax(0, 1fr) 54px; height: auto; padding: 2px 12px; }
.srow.is-region .nm { overflow: visible; }
.srow.is-first .nm, .srow.is-first .pt { color: var(--bright); font-weight: 700; }
.srow.is-first .pl { color: var(--gold); }
.mcard .mrest { padding: 2px 12px 0; font-size: 11px; color: var(--faint); }

.mcard .mevent {
  padding: 10px 12px; border-left: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: center; gap: 5px; min-width: 0;
}
.mcard .mevent .n {
  font-size: 12.5px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mcard .mevent .n .sub { color: var(--faint); font-weight: 400; }

.tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tg {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 5px; border-radius: 2px;
  background: var(--ground); color: var(--muted); border: 1px solid var(--rule);
}
.tg.rg { color: var(--text); }
.tg.hot { background: var(--accent); color: #fff; border-color: transparent; }

/* A cup three weeks out does not earn the same card as one on Saturday. */
.mini {
  display: grid; grid-template-columns: 84px 22px minmax(0, 1fr) auto;
  gap: 10px; align-items: center;
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r);
  margin-bottom: 4px; padding: 7px 12px;
}
.mini:hover { background: var(--panel2); border-color: var(--faint); }
.mini .t { font-family: var(--mono); font-size: 12px; color: var(--muted);
  font-variant-numeric: tabular-nums; }
.mini .n { font-size: 13px; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.mini .n .sub { color: var(--faint); font-weight: 400; }

/* Squads have no logos. A monogram keyed off the name gives every row the
   texture a logo would, and stays the same wherever the squad appears. */
.lg {
  width: 22px; height: 22px; border-radius: 2px;
  display: grid; place-items: center;
  font-family: var(--sans); font-size: 9px; font-weight: 700;
  letter-spacing: -0.02em; color: #fff; text-transform: uppercase; flex: none;
}
.lg.h0 { background: var(--m0); } .lg.h1 { background: var(--m1); }
.lg.h2 { background: var(--m2); } .lg.h3 { background: var(--m3); }
.lg.h4 { background: var(--m4); } .lg.h5 { background: var(--m5); }
.lg.h6 { background: var(--m6); } .lg.h7 { background: var(--m7); }
.lg.sm { width: 18px; height: 18px; font-size: 8px; }

@media (max-width: 720px) {
  /* The event column has nowhere to go sideways, so it becomes a strip along
     the bottom. Hiding it would leave three cups on one day telling apart
     only by their squad lists. */
  .mcard { grid-template-columns: 62px minmax(0, 1fr); }
  .mcard .mevent {
    grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line);
    flex-direction: row; align-items: center; gap: 9px; padding: 7px 12px;
  }
  .mcard .mevent .n { flex: 1; min-width: 0; }
  .srow { grid-template-columns: 18px 22px minmax(0, 1fr) 46px; gap: 6px; padding: 1px 9px; }
  .mini { grid-template-columns: 56px 22px minmax(0, 1fr) auto; gap: 8px; }
}

/* The strip of filters under the header: plain links, the active one underlined
   in the accent, and a count on the right that says what the list will hold. */
.subnav {
  background: var(--chrome);
  border-bottom: 1px solid var(--rule);
}
.subnav .inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 15px;
  height: 34px; font-size: 12px;
  overflow-x: auto; white-space: nowrap;
}
.subnav a { color: var(--muted); font-weight: 600; padding: 2px 0;
  border-bottom: 2px solid transparent; }
.subnav a:hover { color: var(--text); }
.subnav a.is-current { color: var(--bright); border-bottom-color: var(--accent); }
.subnav .div { width: 1px; height: 13px; background: var(--rule); flex: none; }
.subnav .count { margin-left: auto; color: var(--faint); font-family: var(--mono);
  font-size: 11px; }

/* Rail boxes: a titled card with rows, and an optional row of scope tabs. */
.railbox { background: var(--panel); border: 1px solid var(--rule);
  border-radius: var(--r); margin-bottom: 14px; overflow: hidden; }
.railbox > .h {
  display: flex; align-items: center; padding: 8px 11px;
  border-bottom: 1px solid var(--rule);
  font-size: 12px; font-weight: 700; color: var(--text);
}
.railbox > .h a { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--muted); }
.railbox > .h a:hover { color: var(--accent); }
.railtabs { display: flex; gap: 2px; padding: 6px 7px; border-bottom: 1px solid var(--rule); }
.railtabs a, .railtabs button {
  flex: 1; text-align: center; background: var(--ground);
  border: 1px solid var(--rule); border-radius: 2px;
  color: var(--muted); font-family: var(--sans); font-size: 11px; font-weight: 600;
  padding: 4px 0; cursor: pointer;
}
.railtabs button:hover { color: var(--text); border-color: var(--faint); }
.railtabs a.is-current, .railtabs button.is-current {
  background: var(--accent); color: #fff; border-color: transparent;
}
/* Every scope ships with the page; all but one are folded away. */
.railpanel.is-hidden { display: none; }

.railrow {
  display: grid; grid-template-columns: 18px 22px minmax(0, 1fr) auto;
  gap: 8px; align-items: center; padding: 6px 11px;
  border-bottom: 1px solid var(--line);
}
.railrow:last-child { border-bottom: 0; }
.railrow:hover { background: var(--panel2); }
.railrow .p { font-family: var(--mono); font-size: 11px; color: var(--faint); text-align: right; }
.railrow .n { font-size: 12.5px; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.railrow .n em { font-style: normal; font-family: var(--mono); font-size: 9.5px;
  color: var(--faint); margin-left: 6px; }
.railrow .v { font-family: var(--mono); font-size: 11.5px; color: var(--text);
  font-variant-numeric: tabular-nums; }
.railrow.is-top .p { color: var(--gold); font-weight: 700; }

.railevent {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 9px; align-items: center; padding: 8px 11px;
  border-bottom: 1px solid var(--line);
}
.railevent:last-child { border-bottom: 0; }
.railevent:hover { background: var(--panel2); }
.railevent .crest {
  width: 30px; height: 30px; border-radius: 2px;
  background: var(--ground); border: 1px solid var(--rule);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 9px; font-weight: 600; color: var(--muted);
  line-height: 1.05; text-align: center;
}
.railevent .n { font-size: 12.5px; font-weight: 600; }
.railevent .s { font-size: 10.5px; color: var(--faint); margin-top: 1px; }
.railevent .w { font-family: var(--mono); font-size: 11px; color: var(--muted);
  white-space: nowrap; }
.railevent.is-next .w { color: var(--accent); font-weight: 600; }

/* ==========================================================================
   News
   ========================================================================== */

.newslist { display: flex; flex-direction: column; gap: 6px; }
.newsrow {
  display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px;
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 12px 14px;
}
.newsrow:hover { background: var(--panel2); border-color: var(--faint); }
.newsrow .d { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.newsrow .t { display: block; font-size: 15px; font-weight: 700; color: var(--text);
  letter-spacing: -0.01em; }
.newsrow:hover .t { color: var(--bright); }
.newsrow .x { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
@media (max-width: 620px) {
  .newsrow { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

/* The lead on the front page: the newest post, given the room to be read. */
.lead-post {
  display: block; background: var(--panel); border: 1px solid var(--rule);
  border-radius: var(--r); padding: 16px 18px; margin-bottom: 6px;
}
.lead-post:hover { border-color: var(--faint); background: var(--panel2); }
.lead-post .k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent); }
.lead-post .t { display: block; font-size: 23px; font-weight: 700; color: var(--bright);
  letter-spacing: -0.02em; line-height: 1.15; margin: 6px 0 5px; }
.lead-post .x { display: block; font-size: 13.5px; color: var(--muted); }
.lead-post .d { font-family: var(--mono); font-size: 10.5px; color: var(--faint);
  margin-top: 8px; display: block; }

/* Body copy is the one place on the site with a reading measure. */
.post { max-width: 720px; }
.prose { font-size: 15px; line-height: 1.65; color: var(--text); }
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 16px; }
.prose h2 { font-size: 19px; margin: 28px 0 10px; }
.prose h3 { font-size: 15px; margin: 22px 0 8px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--bright); border-bottom: 1px solid var(--bar); }
.prose a:hover { border-bottom-color: var(--accent); }
.prose code {
  font-family: var(--mono); font-size: 0.9em;
  background: var(--panel2); border: 1px solid var(--rule); border-radius: 2px;
  padding: 1px 4px;
}
.prose pre {
  background: var(--panel2); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 12px 14px; overflow-x: auto;
}
.prose pre code { background: none; border: 0; padding: 0; }
.prose blockquote {
  margin: 0 0 16px; padding-left: 14px;
  border-left: 2px solid var(--bar); color: var(--muted);
}
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 16px; }
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: 7px 9px;
  text-align: left; }
.prose img { max-width: 100%; height: auto; }
.backlink { margin-top: 28px; font-size: 13px; }
.backlink a { color: var(--muted); }
.backlink a:hover { color: var(--bright); }

/* The news desk form. */
.newsform { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.newsform label { display: flex; flex-direction: column; gap: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); }
.newsform input[type="text"], .newsform input:not([type]), .newsform textarea {
  background: var(--ground); border: 1px solid var(--rule); border-radius: var(--r);
  color: var(--text); font-family: var(--sans); font-size: 13.5px; padding: 8px 10px;
}
.newsform textarea { font-family: var(--mono); font-size: 13px; line-height: 1.55;
  resize: vertical; }
.newsform .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.newsform .inline { flex-direction: row; align-items: center; gap: 7px;
  text-transform: none; font-size: 13px; letter-spacing: 0; color: var(--text); }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer;
  font-family: var(--sans); font-size: 11px; font-weight: 600; padding: 0; }
.linkbtn:hover { color: var(--accent); }

/* Cover art. Fixed 1200×630 aspect so a post's space does not jump while the
   image loads, and so a missing file leaves a gap rather than a reflow. */
.post .cover {
  display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630;
  object-fit: cover; border: 1px solid var(--rule); border-radius: var(--r);
  margin-bottom: 22px; background: var(--panel2);
}
.lead-post { position: relative; overflow: hidden; }
.lead-post.has-cover { padding: 0; }
.lead-post.has-cover .cover {
  display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630;
  object-fit: cover; border-bottom: 1px solid var(--rule); background: var(--panel2);
}
.lead-post.has-cover .k,
.lead-post.has-cover .t,
.lead-post.has-cover .x,
.lead-post.has-cover .d { padding-left: 18px; padding-right: 18px; }
.lead-post.has-cover .k { display: block; padding-top: 14px; }
.lead-post.has-cover .d { padding-bottom: 16px; }

.newsrow.has-cover { grid-template-columns: 120px 92px minmax(0, 1fr); align-items: center; }
.newsrow .thumb {
  width: 120px; height: 63px; object-fit: cover;
  border: 1px solid var(--rule); border-radius: 2px; background: var(--panel2);
  display: block;
}
@media (max-width: 620px) {
  .newsrow.has-cover { grid-template-columns: minmax(0, 1fr); }
  .newsrow .thumb { width: 100%; height: auto; aspect-ratio: 1200 / 630; }
}

/* ==========================================================================
   Profiles — squads and players
   ========================================================================== */

.b-win { background: var(--b-win); }
.b-podium { background: var(--b-podium); }
.b-top { background: var(--b-top); }
.b-mid { background: var(--b-mid); }
.b-low { background: var(--b-low); }

/* The header: who this is, and the one number that places them. */
.profile-head {
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r);
  margin-bottom: 14px; overflow: hidden;
}
.profile-head .top {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 16px; align-items: center; padding: 16px 18px;
}
.profile-head .id { min-width: 0; }

/* The record as a line to read rather than a row of cells to scan: the figures
   carry the weight, the words between them carry the meaning. */
.statline {
  border-top: 1px solid var(--rule); background: var(--panel2);
  padding: 9px 18px; font-size: 13px; color: var(--muted); line-height: 1.7;
}
/* Each figure is one unit: glyph, number, word. They wrap together rather
   than the glyph stranding itself at the end of a line. */
.statline .stat { white-space: nowrap; margin-right: 16px; }
.ico-s {
  width: 13px; height: 13px; margin-right: 5px; vertical-align: -2px;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: square; stroke-linejoin: miter;
  opacity: 0.65;
}
.statline b {
  font-family: var(--mono); font-size: 15px; font-weight: 600;
  color: var(--bright); font-variant-numeric: tabular-nums;
}
.statline b.is-key { color: var(--accent); }
.statline .at { color: var(--faint); font-size: 12px; }
@media (max-width: 620px) {
  .profile-head .top { grid-template-columns: 44px minmax(0, 1fr); }
  .statline { padding: 9px 14px; }
}
.profile-head .crest {
  width: 56px; height: 56px; border-radius: var(--r);
  background: var(--ground); border: 1px solid var(--rule);
  display: grid; place-items: center; overflow: hidden;
}
.profile-head .crest img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* The crest holds the same logo box a table row does; here it fills the frame. */
.profile-head .crest .logo { width: 100%; height: 100%; border: 0; border-radius: 0; background: none; }
.profile-head .crest .is-fallback { width: 30px; height: 30px; opacity: 0.38; }
.profile-head h1 { font-size: 26px; letter-spacing: -0.025em; line-height: 1.1; }
.profile-head .meta {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-top: 5px; font-size: 12.5px; color: var(--muted);
}
.profile-head .meta a { color: var(--text); font-weight: 600; }
.profile-head .rankblock { text-align: right; white-space: nowrap; }
.profile-head .rankblock .pos {
  font-family: var(--mono); font-size: 30px; font-weight: 600; color: var(--bright);
  line-height: 1; font-variant-numeric: tabular-nums;
}
.profile-head .rankblock .of { font-size: 13px; color: var(--faint); }
.profile-head .rankblock .lab {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--faint); margin-top: 5px;
}
.profile-head .rankblock .mv { font-family: var(--mono); font-size: 11px; margin-left: 6px; }
.profile-head .rankblock .pos .q { vertical-align: 9px; }
.mv-up { color: var(--rise); }
.mv-down { color: var(--accent); }
@media (max-width: 620px) {
  .profile-head .crest { width: 44px; height: 44px; }
  .profile-head .rankblock { grid-column: 1 / -1; text-align: left; }
}

/* Headline numbers, sized to be read across the room. */
.statgrid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  background: var(--rule); gap: 1px;
  border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden;
  margin-bottom: 14px;
}
.statcard { background: var(--panel); padding: 12px 14px; }
.statcard .lab {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--faint);
}
.statcard .val {
  font-family: var(--mono); font-size: 24px; font-weight: 600; color: var(--bright);
  line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums;
}
.statcard .val small { font-size: 13px; color: var(--muted); font-weight: 400; }
.statcard .sub { font-size: 11px; color: var(--faint); margin-top: 3px; }
.statcard.is-key .val { color: var(--b-win); }

/* A value against the field it was measured in. The tick is the median, so the
   bar answers "compared with whom" without a second chart. */
.benchrow {
  display: grid; grid-template-columns: 116px minmax(0, 1fr) 62px;
  gap: 12px; align-items: center; padding: 8px 14px;
  border-bottom: 1px solid var(--line);
}
.benchrow:last-child { border-bottom: 0; }
.benchrow .lab { font-size: 12.5px; color: var(--text); font-weight: 600; }
.benchrow .track {
  position: relative; height: 8px; background: var(--ground);
  border: 1px solid var(--rule); border-radius: 2px; overflow: hidden;
}
.benchrow .fill { position: absolute; inset: 0 auto 0 0; background: var(--b-top); }
.benchrow .fill.is-high { background: var(--b-podium); }
.benchrow .fill.is-low { background: var(--b-mid); }
.benchrow .tick {
  position: absolute; top: -3px; bottom: -3px; width: 1px;
  background: var(--bright); opacity: 0.55;
}
.benchrow .v {
  font-family: var(--mono); font-size: 12.5px; color: var(--bright);
  text-align: right; font-variant-numeric: tabular-nums;
}
.benchlegend {
  padding: 7px 14px; font-size: 11px; color: var(--faint);
  border-top: 1px solid var(--line);
}

/* Every game as a bar: height is where they finished in that field, colour is
   the band. Read left to right, oldest to newest. */
.gamechart {
  display: flex; align-items: flex-end; gap: 3px;
  height: 108px; padding: 14px 14px 0; overflow-x: auto;
}
.gamechart .g { flex: 1 0 14px; min-width: 9px; height: 100%;
  display: flex; align-items: flex-end; position: relative; }
.gamechart .g i { display: block; width: 100%; border-radius: 1px 1px 0 0; }
.gamechart .g:hover i { outline: 1px solid var(--bright); }
.chartfoot {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 9px 14px 12px; font-size: 11px; color: var(--faint);
}
.chartfoot .key { display: flex; align-items: center; gap: 5px; }
.chartfoot .key i { width: 12px; height: 8px; border-radius: 1px; display: block; }
.chartfoot .axis { margin-left: auto; font-family: var(--mono); font-size: 10px; }

/* Distribution: where a squad's finishes actually land. */
.distrib { padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; }
.distrow { display: grid; grid-template-columns: 74px minmax(0, 1fr) 54px;
  gap: 10px; align-items: center; }
.distrow .lab { font-size: 12px; color: var(--muted); }
.distrow .track { height: 14px; background: var(--ground);
  border: 1px solid var(--rule); border-radius: 2px; overflow: hidden; }
.distrow .track i { display: block; height: 100%; }
.distrow .v { font-family: var(--mono); font-size: 12px; color: var(--text);
  text-align: right; font-variant-numeric: tabular-nums; }
.distrow .v small { color: var(--faint); }

/* The conversion funnel, as three narrowing bars. */
.funnel { padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; }
.funnelrow { display: grid; grid-template-columns: 104px minmax(0, 1fr) 52px;
  gap: 10px; align-items: center; }
.funnelrow .lab { font-size: 12px; color: var(--muted); }
.funnelrow .track { height: 16px; background: var(--ground);
  border: 1px solid var(--rule); border-radius: 2px; overflow: hidden; }
.funnelrow .track i { display: block; height: 100%; background: var(--b-top); }
.funnelrow.is-last .track i { background: var(--b-win); }
.funnelrow .v { font-family: var(--mono); font-size: 13px; color: var(--bright);
  text-align: right; font-variant-numeric: tabular-nums; }

/* Recent finishes, newest first — the quick read before any chart. */
.formstrip { display: flex; gap: 4px; padding: 12px 14px; flex-wrap: wrap; }
.formstrip .f {
  min-width: 26px; height: 24px; padding: 0 6px; border-radius: 2px;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: #0B0E11;
}
.formstrip .f.b-mid, .formstrip .f.b-low { color: var(--text); }
:root[data-theme="light"] .formstrip .f.b-low,
:root[data-theme="light"] .formstrip .f.b-mid { color: #1B1F24; }

/* Placement chips inside tables. */
.pchip {
  display: inline-grid; place-items: center; min-width: 26px; height: 20px;
  padding: 0 5px; border-radius: 2px;
  font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: #0B0E11;
}
.pchip.b-mid, .pchip.b-low { color: var(--text); }
:root[data-theme="light"] .pchip.b-low, :root[data-theme="light"] .pchip.b-mid { color: #1B1F24; }

/* ---------- Brand assets page ---------- */
/* Transparent artwork is shown on the brand ground so it reads as shipped. */
.asset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 16px; }
.asset { margin: 0; border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--panel); padding: 14px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; }
.asset img { max-width: 100%; height: auto; border-radius: var(--r); }
.asset figcaption { font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.asset-wide { grid-column: 1 / -1; }
.asset-dark { background: #0F1216; }
.asset-dark figcaption { color: #889099; }
.asset-file { min-height: 120px; }
.asset-file-ext { font-family: var(--mono); font-size: 22px; font-weight: 600;
  letter-spacing: 0.12em; color: var(--muted); border: 1px solid var(--rule);
  border-radius: var(--r); padding: 14px 22px; }
@media (max-width: 620px) {
  .asset-grid { grid-template-columns: minmax(0, 1fr); }
}

/* The quartile chip and the field median, inline on a benchmark row. */
.benchrow .lab em {
  font-style: normal; font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 1px 4px; border-radius: 2px; margin-left: 6px;
  border: 1px solid var(--rule); color: var(--muted);
}
.benchrow .v small { color: var(--faint); font-size: 10.5px; }
.asset-light { background: #F1F3F5; border-color: #DFE3E8; }
.asset-light figcaption { color: #69717A; }

/* auto-fit leaves a half-empty final row on a phone, and the gap colour then
   reads as an empty panel. An even split fills the grid instead. */
@media (max-width: 620px) {
  .statgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================================
   The performance chart
   One bright line on a hairline grid. The accent marks wins and nothing else.
   ========================================================================== */

.chartbox { background: var(--panel); border: 1px solid var(--rule);
  border-radius: var(--r); margin-bottom: 14px; overflow: hidden; }
.chartbox > .h {
  display: flex; align-items: baseline; gap: 10px; padding: 11px 14px;
  border-bottom: 1px solid var(--rule);
  font-size: 12.5px; font-weight: 700; color: var(--text);
}
.chartbox > .h .n { font-family: var(--mono); font-size: 10.5px; color: var(--faint);
  font-weight: 400; letter-spacing: 0.06em; }
.chartbox > .h .legend { margin-left: auto; display: flex; gap: 14px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em;
  color: var(--faint); font-weight: 400; }
.chartbox > .h .legend i { display: inline-block; width: 14px; height: 2px;
  vertical-align: 3px; margin-right: 5px; }
.chartbox > .h .legend i.p { background: var(--bright); }
.chartbox > .h .legend i.w { background: var(--bar); opacity: 0.75; height: 7px; }
.chartbox > .h .legend i.m { width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); vertical-align: 0; }

.chart { display: block; width: 100%; height: auto; }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .axis { fill: var(--faint); font-family: var(--mono); font-size: 13px; }
.chart .wash { fill: var(--bright); opacity: 0.05; }
.chart .series { fill: none; stroke: var(--bright); stroke-width: 2.2;
  stroke-linejoin: round; stroke-linecap: round; }
.chart .wash2 { fill: var(--bar); opacity: 0.30; }
.chart .dot { fill: var(--panel); stroke: var(--bright); stroke-width: 2; }
.chart .dot.is-marked { fill: var(--accent); stroke: var(--accent); }
.chart .hit { fill: transparent; cursor: help; }
.chart .dot { pointer-events: none; }
.chart .node:hover .dot { stroke: var(--accent); r: 6; }
.chartaxis {
  display: flex; justify-content: space-between; padding: 0 14px 11px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em;
  color: var(--faint);
}

/* A run of results, newest first. Brightness carries the placement; the accent
   is a win and nothing else. */
.formstrip .f.b-win { color: #fff; }
.formstrip .f.b-podium, .pchip.b-podium { color: #0B0E11; }
:root[data-theme="light"] .formstrip .f.b-podium,
:root[data-theme="light"] .pchip.b-podium { color: #fff; }

/* The hint. One character, quiet until hovered, carrying the sentence that
   used to sit under every figure. */
.q {
  display: inline-grid; place-items: center;
  width: 14px; height: 14px; padding: 0; margin-left: 5px;
  border: 1px solid var(--rule); border-radius: 50%;
  background: transparent; color: var(--faint);
  font-family: var(--sans); font-size: 9px; font-weight: 700; line-height: 1;
  cursor: help; vertical-align: 2px;
}
.q:hover { border-color: var(--accent); color: var(--text); }

/* Figures read as one strip rather than a wall of equal cards: label above,
   number below, separated by rules and sized to their content. */
.specs {
  display: flex; flex-wrap: wrap; align-items: stretch;
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r);
  margin-bottom: 14px; overflow: hidden;
}
/* Items stretch to fill whatever row they land on, so a wrap never leaves
   a ragged gap of bare panel at the end. */
.specs .s { flex: 1 1 auto; padding: 11px 16px 12px;
  border-right: 1px solid var(--rule); min-width: 0; }
.specs .s:last-child { border-right: 0; }
.specs .lab {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--faint); white-space: nowrap;
}
.specs .val {
  font-family: var(--mono); font-size: 22px; font-weight: 600; color: var(--bright);
  line-height: 1.15; margin-top: 3px; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.specs .val small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 3px; }
.specs .s.is-key .val { color: var(--accent); }
/* One mark for the whole strip, parked at the end so it never interrupts the
   rhythm of the figures. */
.specs .hintcell {
  flex: 0 0 auto; margin-left: auto; display: grid; place-items: center;
  padding: 0 12px;
}
.specs .hintcell .q { margin-left: 0; }
@media (max-width: 620px) {
  .specs .s { flex: 1 0 44%; border-bottom: 1px solid var(--rule); padding: 10px 14px; }
}

/* A dateline sits above a headline, not under it. */
.dateline {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 7px;
}
.algostamp { font-family: var(--mono); font-size: 11px; color: var(--faint);
  margin: -8px 0 20px; }
/* Facts about a game — its date, its map — as chips beside the title. */
.headchips { display: inline-flex; gap: 5px; margin-left: 12px; vertical-align: 5px; }

/* ==========================================================================
   Live search
   ========================================================================== */

.search { position: relative; }
.suggest {
  position: absolute; top: calc(100% + 6px); right: 0;
  width: 360px; max-height: 60vh; overflow-y: auto; z-index: 60;
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
:root[data-theme="light"] .suggest { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14); }

.suggest-row {
  display: grid; grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px; align-items: baseline;
  padding: 8px 11px; border-bottom: 1px solid var(--line);
  color: var(--text);
}
.suggest-row .b { min-width: 0; }
.suggest-row:last-child { border-bottom: 0; }
.suggest-row .k {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--faint);
}
.suggest-row .l {
  display: block; font-size: 13.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.suggest-row .s {
  display: block; font-family: var(--mono); font-size: 10px; color: var(--faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px;
}
/* Hover and keyboard selection are the same state, so the two never disagree
   about which row Enter will open. */
.suggest-row.is-active { background: var(--accent); color: #fff; }
.suggest-row.is-active .k, .suggest-row.is-active .s { color: rgba(255, 255, 255, 0.75); }
.suggest-empty { padding: 12px; font-size: 12.5px; color: var(--faint); }

@media (max-width: 860px) { .suggest { width: 100vw; right: -12px; } }

/* ---------- Mobile search ---------- */

/* The field is present at desktop widths, so the control that opens it is not. */
.search-toggle { display: none; }

@media (max-width: 860px) {
  .search-toggle { display: grid; }

  /* The form drops out of the header row and becomes a bar beneath it, full
     width, with the suggestion list flowing under the input rather than
     floating over a layout that has no room for it. */
  .search {
    display: none;
    position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 55;
    background: var(--chrome); border-bottom: 1px solid var(--rule);
    padding: 10px 14px;
  }
  .search.is-open { display: block; }
  .search input { width: 100%; font-size: 16px; padding: 9px 11px; }

  .suggest {
    position: static; width: auto; margin-top: 8px;
    max-height: 56vh; box-shadow: none;
  }
}

/* ---- region badges ------------------------------------------------------
   A region as a mark: globe glyph with the part of the world it covers filled,
   plus the two-letter code, because three globes are not distinguishable from
   one another at 16px without it. The hue separates them at a glance; the code
   and the title carry it for anyone the hue does not reach. */
.rgns { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; vertical-align: middle; }
.rgn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 6px 1px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel2);
  color: var(--muted);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 18px;
  white-space: nowrap;
}
.rgn .ico-s {
  width: 13px; height: 13px; display: block;
  fill: none; stroke: currentColor; stroke-width: 1.3;
}
.rgn .ico-s .fill { fill: currentColor; stroke: none; opacity: 1; }
/* The equator and the outline sit over the shaded half, so they need to read
   against it as well as against the chip behind it. */
.rgn .ico-s circle, .rgn .ico-s line { stroke: currentColor; }
.rgn-americas { color: #E0A33E; border-color: #E0A33E44; }
.rgn-emea     { color: #5FA8E8; border-color: #5FA8E844; }
.rgn-apac     { color: #6FC08A; border-color: #6FC08A44; }
.rgn-link { text-decoration: none; }
.rgn-link:hover .rgn { border-color: currentColor; background: var(--panel); }

/* ---- country flags ------------------------------------------------------
   Served from /static/flags, the same as the fonts: nothing is asked of a
   third party at page load. A code with no file falls back to the img's alt
   text, which is the two-letter code — readable, and obviously a gap rather
   than a broken layout. */
.flag {
  display: inline-block;
  width: 20px; height: 15px;
  vertical-align: -2px;
  margin-right: 6px;
  border-radius: 2px;
  object-fit: cover;
  background: var(--panel2);
  font-size: 9px; font-weight: 700; color: var(--muted);
}
.profile-head .flag { width: 24px; height: 18px; vertical-align: -3px; }

/* ---- the next cup -------------------------------------------------------
   Not a result, so not the results card: nothing here is a standing, and the
   three editions are the point. Each tile is a way into one region's event. */
.nextcard {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  box-shadow: inset 3px 0 0 var(--accent);
  padding: 12px 14px 14px 16px;
  margin-bottom: 6px;
  display: flex; flex-direction: column; gap: 4px;
}
.nexthead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.nexthead .n { font-size: 17px; font-weight: 700; color: var(--bright); }
.nexthead .tags { display: flex; gap: 6px; }
/* The date and countdown are on the day header directly above; the card does
   not repeat them. */

.edtiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.edtile {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel2);
  text-decoration: none;
  min-width: 0;
}
.edtile:hover { border-color: var(--faint); background: var(--panel); }
.edtop { display: flex; align-items: center; gap: 8px; }
.edway { display: flex; align-items: center; gap: 8px; text-decoration: none; min-width: 0; }
.edway:hover .edname { color: var(--bright); }
.edcrests { text-decoration: none; }
.edfacts {
  display: flex; align-items: baseline; gap: 8px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.edpot { color: var(--text); font-weight: 500; }
.edpot .unknown { color: var(--faint); font-weight: 400; }
.edin { color: var(--faint); }
/* Crests of the ranked squads that have entered: recognition at a glance, the
   name on the title for anyone who wants it. */
.edcrests { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.edcrest img, .edcrest svg { width: 18px; height: 18px; border-radius: 3px; display: block; }
.edmore { font-family: var(--mono); font-size: 10px; color: var(--faint); margin-left: 2px; }
/* The region is spelled out beside the badge here, so the badge drops its code
   and is left as the mark. */
.edtile .rgn { padding: 1px 4px; }
.edtile .rgn b { display: none; }
.edtile .edname {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Signup state sits at the end of the tile, and only when an organizer has
   actually said. */
.reg {
  margin-left: auto;
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  white-space: nowrap;
  color: var(--faint);
}
/* The signup link is the one thing on the card that leaves the site, so it
   says so rather than looking like another internal link. */
a.reg { text-decoration: underline; text-underline-offset: 2px; }
a.reg::after { content: " \2197"; font-size: 9px; }
.reg-open { color: var(--ok, #6FC08A); }
.reg-closed { color: var(--faint); }
.reg-invite { color: var(--muted); }

@media (max-width: 560px) {
  .edtiles { grid-template-columns: 1fr; }
}

/* ---- a cup that has not happened yet ------------------------------------
   The page answers different questions before a cup than after it: what it
   pays, when it starts, whether signups are open, and who has entered. */
.upcoming-panel {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 14px 16px;
  margin-bottom: 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.up-top {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  align-items: start;
}
.up-top .k {
  display: block;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 4px;
}
.up-top b { font-size: 17px; font-weight: 700; color: var(--bright); }
.up-top .iso { display: block; font-family: var(--mono); font-size: 11px; color: var(--faint); margin-top: 2px; }
.up-top .unknown { font-size: 14px; font-weight: 400; color: var(--faint); }
.up-reg .btn { margin-top: 2px; }
/* The destination in plain sight: a button says what happens, the host says
   where it goes. */
.reglink {
  display: block; margin-top: 6px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.section-head .count { font-family: var(--mono); font-size: 12px; color: var(--faint); }
table.entrants .pos { font-family: var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- whole-card links ---------------------------------------------------
   A card is one thing to click, but a card also holds links of its own — a
   squad, a region, an organizer's signup page. Nesting those inside one big
   anchor is invalid HTML and the browser tears the layout apart, so the card
   gets a stretched link underneath instead and the real links sit above it. */
.is-clickable { position: relative; }
.is-clickable .stretch {
  position: absolute; inset: 0;
  z-index: 0;
  border-radius: inherit;
}
.is-clickable > *:not(.stretch) { position: relative; z-index: 1; }
/* Anything the reader can click inside the card has to sit above the stretched
   link, or the card swallows it. */
.is-clickable a:not(.stretch),
.is-clickable button { position: relative; z-index: 2; }
.mini.is-clickable:hover, .nextcard.is-clickable:hover { background: var(--panel2); }
.is-clickable .stretch:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* A deadline is only worth the space while it is still a deadline. */
.edclose { color: var(--accent); font-weight: 600; }
.reg-soon { color: var(--muted); }
.regnote {
  display: block; margin-top: 6px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}

/* ---- an upcoming cup's entry list ---------------------------------------
   The list is the page, so it gets the main column and the cup's own facts go
   in the rail. Ranked squads are the part a reader scans for, so they are
   tiles with a crest and a position; everyone else is a roll call. */
/* No rules between tiles: the position and crest already set the rhythm, and
   a short last row ends in the panel's own ground instead of a grey block. */
.entrgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  border-top: 1px solid var(--line);
  overflow: hidden;
}
.entrant {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px;
  background: var(--panel);
  text-decoration: none;
  min-width: 0;
}
.entrant:hover { background: var(--panel2); }
.entrant .pos {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  color: var(--muted); min-width: 20px;
  font-variant-numeric: tabular-nums;
}
.entrant .logo img { width: 20px; height: 20px; border-radius: 3px; display: block; }
.entrant .nm {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.entrant:hover .nm { color: var(--bright); }

.rollcall {
  padding: 10px 12px 12px;
  columns: 4 150px;
  column-gap: 18px;
}
.rollcall a {
  display: block; break-inside: avoid;
  padding: 3px 0;
  font-size: 12.5px; color: var(--muted); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rollcall a:hover { color: var(--text); }
.rollcall .flag { width: 15px; height: 11px; margin-right: 5px; }

/* How full the field is, against the cap the organizer published. */
.capbar { margin-top: 12px; display: grid; gap: 4px; }
.capbar .lab {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--faint);
}
.capbar .track {
  height: 8px; background: var(--ground);
  border: 1px solid var(--rule); border-radius: 2px; overflow: hidden;
}
.capbar .track i { display: block; height: 100%; background: var(--accent); }
.capbar .v { font-family: var(--mono); font-size: 12px; color: var(--text); }

/* Label and value down a rail panel, where a five-across fact grid would wrap
   into a column of half-empty cells. */
.deflist { margin: 0; display: grid; gap: 9px; }
.deflist > div { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.deflist dt {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--faint);
}
.deflist dd { margin: 0; font-size: 13px; color: var(--text); }
.deflist dd .muted { font-size: 11px; }

/* Stacked on a phone, what a cup pays and how to enter it come before the
   list of who already has. */
@media (max-width: 900px) {
  .layout.is-upcoming .rail { order: -1; }
}

/* ---------- Admin: logos and headshots ---------- */
.btn-sm { padding: 5px 10px; min-height: 28px; font-size: 11px; }
.imagelist .panel-head { gap: 16px; }
.imagefilter { flex: 1; max-width: 320px; background: var(--ground); color: var(--text);
  border: 1px solid var(--rule); border-radius: var(--r); padding: 6px 10px; font: inherit; }
.imagetoggle { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.imagelist .w-img { width: 56px; }
.imagepreview { width: 40px; height: 40px; }
.imagepreview .is-fallback { width: 24px; height: 24px; }
.imageactions { white-space: nowrap; }
.imageactions > * + * { margin-left: 8px; }
