/* SSL Database - two looks sharing one design: "Night pitch" (dark) and "Matchday" (light).
   Only colours differ between them; fonts, spacing and corners are shared. Every colour the
   pages use is a variable below, so a page never needs to know which look is on. */

/* ---------------------------------------------------------------- fonts (in the repo: no outside requests) */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-wght-normal.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: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-display: swap;
  src: url("fonts/barlow-condensed-latin-500-normal.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: "Barlow Condensed"; font-weight: 500; font-display: swap;
  src: url("fonts/barlow-condensed-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap;
  src: url("fonts/barlow-condensed-latin-600-normal.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: "Barlow Condensed"; font-weight: 600; font-display: swap;
  src: url("fonts/barlow-condensed-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap;
  src: url("fonts/barlow-condensed-latin-700-normal.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: "Barlow Condensed"; font-weight: 700; font-display: swap;
  src: url("fonts/barlow-condensed-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------------------------------------------------------------- shared design */
:root {
  --font-text: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", "Inter", sans-serif;
  --mono: var(--font-text);                 /* figures: Inter with lining, even-width numbers */
  --code: ui-monospace, "Cascadia Mono", Consolas, monospace;   /* only the fact sheet's text table */
  --r-sm: 4px;                              /* three corner sizes, plus fully round for chips */
  --r: 8px;
  --r-lg: 12px;
  --radius: var(--r-lg);
  color-scheme: dark;
}

/* The SSL's own colours, from the league logo: navy #070B51 and gold #BD9523. */

/* Night pitch (dark): the logo's deep navy, a lighter navy-blue accent, gold for trophies and awards */
:root, :root[data-theme="dark"] {
  --bg: #080b1f;          --bg-2: #0e1230;        --bg-3: #151a40;
  --line: #252b58;        --line-soft: #1b2049;
  --text: #eceef8;        --muted: #9da3c4;       --dim: #8088b9;
  --accent: #8b95ff;      --accent-2: #3a42b8;    --on-accent: #070b30;
  --funnel-mid: #3a42b8;  /* Hall of Fame By class: the league-appearance band */
  --win: #3fc27a;         --draw: #d9a23b;        --loss: #f0605d;      --gold: #d9ae3a;
  --gold-bg: rgba(217, 174, 58, .12);   --gold-line: rgba(217, 174, 58, .4);
  --win-bg: rgba(63, 194, 122, .12);    --win-line: rgba(63, 194, 122, .36);
  --loss-bg: rgba(240, 96, 93, .12);    --loss-line: rgba(240, 96, 93, .38);
  --note-bg: rgba(139, 149, 255, .08);  --note-line: rgba(139, 149, 255, .3);  --note-text: #c4c9ea;
  --warn-text: #e2cf9c;
  --top-bg: rgba(7, 11, 51, .96);       --top-text: #eceef8;    --top-muted: #a3a9cf;
  --top-hover: rgba(255, 255, 255, .07); --top-input: rgba(255, 255, 255, .06); --top-line: rgba(255, 255, 255, .12);
  --shadow: 0 14px 36px rgba(0, 0, 0, .5);
  --pitch-a: #173a2b;     --pitch-b: #0f2a1f;     --pitch-edge: #22503a;  --pitch-line: rgba(255, 255, 255, .08);
  --pitch-text: #e9eef4;  --pitch-sub: #97a8bb;
  --pitch-gold: #d9ae3a;  --pitch-ok: #3fc27a;
  /* chart lines and legend dots */
  --c1: #5ea3ea; --c2: #e9b949; --c3: #3fc27a; --c4: #f08a4b; --c5: #b18cf7; --c6: #3cc6cf; --c7: #f0605d; --c8: #d58ad9;
  --c9: #9ccc65; --c10: #f7b267; --c11: #7fb2ff; --c12: #f472b6; --c13: #a0aec0; --c14: #ffd166; --c15: #06d6a0; --c16: #c9a0ff;
  /* the six positions */
  --pos-gk: #e9b949; --pos-cb: #6fb3ff; --pos-wb: #3cc6cf; --pos-cm: #4fd07f; --pos-wam: #b894ff; --pos-st: #f39052;
  color-scheme: dark;
}

/* Matchday (light): off-white paper, dark ink, the logo's navy as the masthead */
:root[data-theme="light"] {
  --bg: #f3f0e9;          --bg-2: #fffdf9;        --bg-3: #f0ece3;
  --line: #dcd5c6;        --line-soft: #e9e4d8;
  --text: #17212c;        --muted: #535b64;       --dim: #63686d;
  --accent: #2b33a6;      --accent-2: #070b51;    --on-accent: #ffffff;
  --funnel-mid: #b3b8ec;
  --win: #1a7541;         --draw: #8f6208;        --loss: #b8322a;      --gold: #80630d;
  --gold-bg: rgba(201, 150, 30, .13);   --gold-line: rgba(169, 122, 12, .38);
  --win-bg: rgba(30, 138, 76, .1);      --win-line: rgba(30, 138, 76, .32);
  --loss-bg: rgba(200, 55, 45, .08);    --loss-line: rgba(200, 55, 45, .3);
  --note-bg: #eceefa;     --note-line: #c5c9ec;   --note-text: #262c5c;
  --warn-text: #6d5212;
  --top-bg: #070b51;      --top-text: #ffffff;    --top-muted: rgba(255, 255, 255, .74);
  --top-hover: rgba(255, 255, 255, .1); --top-input: rgba(255, 255, 255, .1); --top-line: rgba(255, 255, 255, .2);
  --shadow: 0 12px 30px rgba(23, 33, 44, .16);
  --pitch-a: #2f7a4f;     --pitch-b: #245f3d;     --pitch-edge: #1f5c39;  --pitch-line: rgba(255, 255, 255, .2);
  --pitch-text: #ffffff;  --pitch-sub: rgba(255, 255, 255, .82);
  --pitch-gold: #fff0b3;  --pitch-ok: #d6ffe6;
  --c1: #2f6db5; --c2: #c08a12; --c3: #1f8f55; --c4: #d8642a; --c5: #7b52c9; --c6: #1b9aa3; --c7: #c8372d; --c8: #b04fb3;
  --c9: #5f8f2a; --c10: #c77a1f; --c11: #4a7fd6; --c12: #d6457f; --c13: #6b7785; --c14: #a88a1d; --c15: #0f9b77; --c16: #8f6bd8;
  --pos-gk: #a97a0c; --pos-cb: #2f6db5; --pos-wb: #178a93; --pos-cm: #1e8a4c; --pos-wam: #7b52c9; --pos-st: #cf5a1e;
  color-scheme: light;
}

* { box-sizing: border-box; }

/* hidden means hidden, whatever display a class gives it */
[hidden] { display: none !important; }

/* a visible focus ring for the keyboard, everywhere */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1:focus, h1:focus-visible { outline: none; }

/* "Skip to content": off screen until the keyboard reaches it */
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--bg-2); color: var(--text);
  border: 1px solid var(--accent); border-radius: var(--r); padding: 6px 12px; }
.skip:focus { left: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* a page or table being redrawn: the old one stays, dimmed, until the new one is in */
.busy { opacity: .55; transition: opacity .15s; pointer-events: none; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 14px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

/* links read as text; they show themselves on hover */
a { color: var(--text); text-decoration: none; cursor: pointer; }
a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.note a, .warn a, .sources a, p a { color: var(--accent); }

h1, h2, h3, .display { font-family: var(--font-display); }

/* small drawn icons (web/index.html holds the shapes) */
svg.ic { width: 1em; height: 1em; vertical-align: -.14em; fill: currentColor; flex: none; }
svg.ic.gold { color: var(--gold); }

/* ---------------------------------------------------------------- layout */

header.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: var(--top-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--top-line);
  color: var(--top-text);
}

.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: .3px;
  white-space: nowrap;
  color: var(--top-text);
  line-height: 1;
}
.brand img { width: 34px; height: 34px; display: block; }
.brand:hover { color: var(--top-text); text-decoration: none; }
.brand span { font-weight: 600; color: var(--top-muted); text-transform: uppercase; font-size: 16px; letter-spacing: 1.2px; }

nav.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
nav.tabs a {
  padding: 6px 11px;
  border-radius: var(--r);
  color: var(--top-muted);
  font-weight: 500;
  font-size: 13.5px;
}
nav.tabs a.top { font-family: var(--font-display); font-size: 16.5px; font-weight: 600; letter-spacing: .3px; }
nav.tabs a:hover { background: var(--top-hover); color: var(--top-text); text-decoration: none; }
nav.tabs a.active { background: var(--top-hover); color: var(--top-text); }

.spacer { flex: 1; }

main { max-width: 1280px; margin: 0 auto; padding: 26px 20px 80px; }

/* the look switch */
button.theme { background: var(--top-input); border: 1px solid var(--top-line); color: var(--top-text);
  width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; border-radius: var(--r); }
button.theme:hover { border-color: var(--top-muted); }
button.theme svg.ic { width: 17px; height: 17px; }
:root[data-theme="light"] button.theme .i-sun, :root:not([data-theme="light"]) button.theme .i-moon { display: none; }

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

.search-wrap { position: relative; width: 320px; }
#search {
  width: 100%;
  padding: 8px 12px;
  background: var(--top-input);
  border: 1px solid var(--top-line);
  border-radius: var(--r);
  color: var(--top-text);
  font-size: 13px;
  font-family: inherit;
}
#search:focus { border-color: var(--top-muted); outline: none; }
#search:focus-visible { outline: 2px solid var(--top-muted); outline-offset: 1px; }
#search::placeholder { color: var(--top-muted); opacity: .8; }

.results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  display: none;
}
.results.open { display: block; }
.results .row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
}
.results .row:last-child { border-bottom: none; }
.results .row:hover, .results .row.sel { background: var(--bg-3); }
.results .row .label { font-weight: 500; }
.results .row .sub { color: var(--dim); font-size: 12px; margin-left: auto; }
.results .row.none { cursor: default; }

/* a tinted label: set --k to the colour */
.kind, .grp, .tint { background: color-mix(in srgb, var(--k) 16%, transparent); color: var(--k);
  border: 1px solid color-mix(in srgb, var(--k) 34%, transparent); }
.kind {
  --k: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  border-radius: var(--r-sm);
  font-weight: 600;
}
.kind.player { --k: var(--c1); }
.kind.team { --k: var(--win); }
.kind.season { --k: var(--gold); }
.kind.user { --k: var(--c5); }

/* ---------------------------------------------------------------- cards */

.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-bottom: 16px;
}
/* section headings: the condensed font, sentence case, in text colour */
.card > h2, .card > h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .2px;
  line-height: 1.15;
  color: var(--text);
}
.card > h3 { font-size: 17px; }
.card > h2 .dim, .card > h3 .dim { font-weight: 500; }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid.two { grid-template-columns: minmax(0, 1fr); } }
.grid.tops { margin-bottom: 16px; }
.grid.tops > .card { margin-bottom: 0; }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ---------------------------------------------------------------- stat tiles */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.tile {
  background: var(--bg-3);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  padding: 11px 14px 10px;
}
.tile .v { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: .2px; }
.tile .k {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 5px;
}
.tile .k span, .tile .k .dim, .tile .k a { text-transform: none; letter-spacing: 0; }
.tile .v.gold { color: var(--gold); }
.tile .v.win { color: var(--win); }
.tile .v.loss { color: var(--loss); }

/* ---------------------------------------------------------------- page head */

.pagehead { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.crest {
  width: 48px; height: 48px; border-radius: var(--r-lg); flex: none;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: .5px;
  border: 1px solid var(--line);
}
.pagehead h1 { margin: 0; font-size: 36px; letter-spacing: .2px; font-weight: 700; line-height: 1.05; }
.pagehead .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.pagehead .sub a { color: var(--muted); }
.pagehead .sub a:hover { color: var(--accent); }

/* ---------------------------------------------------------------- tables */

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--bg-2);
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th.sorted { color: var(--text); }
th.sorted::after { content: " ▾"; color: var(--accent); }
th.sorted.asc::after { content: " ▴"; }
td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-3); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; }
td.pos { color: var(--dim); width: 28px; text-align: right; font-size: 12px; }

.scroll { overflow-x: auto; overflow-y: auto; max-height: 70vh; }
.scroll.short { max-height: 340px; }

.w { color: var(--win); font-weight: 600; }
.d { color: var(--draw); font-weight: 600; }
.l { color: var(--loss); font-weight: 600; }
/* promotion and relegation arrows */
.up { color: var(--win); font-weight: 600; }
.down { color: var(--loss); font-weight: 600; }

.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- misc */

.pill {
  display: inline-block;
  padding: 2px 8px;
  margin-bottom: 4px;
  border-radius: 999px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  margin-right: 4px;
}
.pill.gold { background: var(--gold-bg); border-color: var(--gold-line); color: var(--gold); }
.pill.uncertain { border-style: dashed; color: var(--muted); }

.trophy-line { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.trophy-line .n {
  font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--gold);
  min-width: 26px; text-align: right; line-height: 1;
}

button, select, input[type="number"] {
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--r);
  padding: 6px 11px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
button:hover, select:hover { border-color: var(--accent); }
button.primary { background: var(--accent-2); border-color: var(--accent-2); color: #fff; font-weight: 500; }
button.primary:hover { filter: brightness(1.12); }
button:disabled { opacity: 0.5; cursor: default; }

.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
label.ctl { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

.subtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.subtabs button {
  background: none; border: none; border-bottom: 2px solid transparent;
  border-radius: 0; color: var(--muted); padding: 8px 13px;
  font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: .3px;
}
.subtabs button:hover { color: var(--text); }
.subtabs button.active { color: var(--text); border-bottom-color: var(--accent); }

.empty { color: var(--dim); padding: 24px; text-align: center; font-size: 13px; }
.loading { color: var(--muted); padding: 40px; text-align: center; }

.note {
  background: var(--note-bg); border: 1px solid var(--note-line); border-left: 3px solid var(--accent);
  border-radius: var(--r); padding: 10px 14px; font-size: 12.5px; color: var(--note-text); margin-bottom: 16px;
}
.note b { color: var(--text); }

.bar { height: 5px; border-radius: 3px; background: var(--bg-3); overflow: hidden; display: flex; min-width: 70px; }
.bar i { display: block; height: 100%; }
.bar i.w { background: var(--win); }
.bar i.d { background: var(--draw); }
.bar i.l { background: var(--loss); }

.attrs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 3px 16px; }
.attr { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 2px 0; }
.attr .n { flex: 1; color: var(--muted); text-transform: capitalize; }
.attr .v { font-weight: 600; min-width: 20px; text-align: right; }
.attr .m { width: 46px; height: 4px; border-radius: 2px; background: var(--bg-3); overflow: hidden; }
.attr .m i { display: block; height: 100%; background: var(--accent); }

footer {
  border-top: 1px solid var(--line); margin-top: 40px; padding: 16px 20px;
  color: var(--dim); font-size: 12px; text-align: center;
}

@media (max-width: 760px) {
  header.topbar { flex-wrap: wrap; }
  .search-wrap { width: 100%; order: 3; }
  main { padding: 16px 12px 60px; }
  /* a table row stays on one line and the table scrolls sideways; a few text columns wrap */
  td, th { white-space: nowrap; }
  td.wrap { white-space: normal; min-width: 180px; }
  /* tables grow with the page, so a swipe never gets stuck inside a box */
  .scroll, .scroll.short { max-height: none; }
  /* one row of tabs that scrolls sideways */
  .subtabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .subtabs button { white-space: nowrap; }
  /* a chart wider than the screen starts at its latest seasons, fading in on the left */
  .chart.overflows { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28px); mask-image: linear-gradient(90deg, transparent 0, #000 28px); }
  /* filters: a tidy two-column grid, the less-used ones behind "More filters" */
  .controls.explorer, .hs-controls, #hof-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .controls.explorer label.ctl, .hs-controls label.ctl, #hof-controls label.ctl { flex-direction: column; align-items: stretch; gap: 2px; }
  .controls.explorer select, .hs-controls select, #hof-controls select, .controls.explorer input[type=number] { width: 100%; }
  .controls.explorer .more-set[data-folded] { display: none; }
  #hof-q { grid-column: 1 / -1; width: 100%; }
  /* the season page's honours and the pitch fit a phone */
  .pitch { padding: 12px 4px; gap: 10px; }
  .pitch .prow { gap: 2px; }
  .pitch .nm { font-size: 11px; }
  .pitch .cl { display: none; }
  .clubhead h1, .pagehead h1 { font-size: 28px; }
}
/* "More filters" only exists on a phone, where .more-set[data-folded] hides the set.
   The selector has to out-rank `button.btn` further down, which also sets display and
   would otherwise win on specificity: the button then showed on a wide screen with no
   fold rule to act on, so it did nothing (Bob reported it, 2026-10-15). */
.controls .more-filters { display: none; }
.more-set { display: contents; }
@media (max-width: 760px) { .controls .more-filters { display: inline-flex; } }
@media (pointer: coarse) {
  /* big enough to tap */
  button, select, .seg button, .chipbtn, a.btn, input[type=number] { min-height: 40px; }
  button.add, .picked .chip button { min-height: 36px; min-width: 36px; }
  input[type=range] { height: 40px; }
  label.ctl input[type=checkbox] { width: 20px; height: 20px; }
}

details.card > summary { cursor: pointer; font-size: 13px; }
label.ctl input[type="checkbox"] { accent-color: var(--accent); margin: 0; }

/* ================================================================ Hall of Fame and the newer pages */

/* HoF Stats tab: a number with its rank under it; the player column stays put when scrolling sideways */
.hs { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.15; padding: 1px 5px; border-radius: var(--r-sm); }
.hs .rk { font-size: 10.5px; color: var(--dim); }
.hs.top { background: var(--gold-bg); }
.hs.top .rk { color: var(--gold); font-weight: 600; }
.hs.high .rk { color: var(--gold); }
.hs.hundred .rk { color: var(--text); font-weight: 500; }   /* top 100: clearer than the rest (committee's wish) */
.note .hs { vertical-align: middle; }
.hs-sets { margin-bottom: 12px; flex-wrap: wrap; }
.hs-sets button.active { background: var(--bg-3); color: var(--text); }
.hs-range select { margin: 0 2px; }
.hs-table .stick { position: sticky; left: 0; z-index: 1; background: var(--bg-2); }
.hs-table td a .crest-sm { margin-right: 3px; }

/* Squad attributes: shaded cells, and the club page's strengths and weaknesses */
.attr-table .stick { position: sticky; left: 0; z-index: 1; background: var(--bg-2); }
.ac { display: inline-block; min-width: 34px; padding: 1px 5px; border-radius: var(--r-sm); }
.attr-key span { padding: 0 5px; border-radius: var(--r-sm); }
.tile .k .rk-line { text-transform: none; letter-spacing: 0; }
.sp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; }
.sp-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 2px 0; }
.sp-row .n { flex: 1; color: var(--muted); }
.sp-row .v { min-width: 34px; text-align: right; font-weight: 600; }
.sp-row .v.win { color: var(--win); }
.sp-row .v.loss { color: var(--loss); }
.sp-bar { width: 56px; height: 5px; border-radius: 3px; background: var(--bg-3); overflow: hidden; }
.sp-bar i { display: block; height: 100%; }
.sp-bar i.up { background: var(--win); }
.sp-bar i.down { background: var(--loss); }
@media (max-width: 560px) { .sp-grid { grid-template-columns: 1fr; } }

/* The top menu: five items, four of them menus that open on hover (or a tap on a phone). */
header.topbar { flex-wrap: wrap; row-gap: 8px; }
nav.tabs { flex-wrap: nowrap; align-items: center; }
nav.tabs a { white-space: nowrap; }
nav.tabs a.top i { font-style: normal; font-size: 10px; opacity: .6; margin-left: 2px; }
nav.tabs .menu { position: relative; }
nav.tabs .menu.active > a.top { background: var(--top-hover); color: var(--top-text); }
nav.tabs .drop { display: none; position: absolute; top: 100%; left: 0; z-index: 60; min-width: 250px;
  padding: 6px; margin-top: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow); }
nav.tabs .drop::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
nav.tabs .drop a { display: block; padding: 7px 10px; border-radius: var(--r); color: var(--text); font-size: 13.5px;
  font-weight: 600; }
nav.tabs .drop a span { display: block; color: var(--dim); font-size: 11.5px; font-weight: 400; margin-top: 1px; }
nav.tabs .drop a:hover, nav.tabs .drop a.active { background: var(--bg-3); color: var(--text); text-decoration: none; }
nav.tabs .drop a.active { box-shadow: inset 2px 0 0 var(--accent); }
@media (hover: hover) { nav.tabs .menu:hover:not(.shut) .drop, nav.tabs .menu:focus-within:not(.shut) .drop { display: block; } }
nav.tabs .menu.open .drop { display: block; }
nav.tabs .drop a.hof { color: var(--gold); }
nav.tabs .drop a.hof.active { box-shadow: inset 2px 0 0 var(--gold); }
nav.tabs .drop a.hof:hover, nav.tabs .drop a.hof.active { background: var(--gold-bg); color: var(--gold); }
@media (max-width: 760px) {
  header.topbar { padding: 10px 12px; }
  header.topbar nav.tabs { order: 5; flex-basis: 100%; justify-content: space-between; position: relative; }
  nav.tabs a.top { padding: 6px 8px; }
  /* a menu opens across the whole width, so it never runs off the screen */
  nav.tabs .menu { position: static; }
  nav.tabs .drop { left: 0; right: 0; min-width: 0; }
}

.sources { color: var(--dim); font-size: 11.5px; margin: 20px 2px 0; line-height: 1.6; }
.sources b { color: var(--muted); font-weight: 600; }

/* position groups */
.grp { display: inline-block; min-width: 34px; text-align: center; padding: 1px 6px; border-radius: var(--r-sm);
  font-size: 10.5px; font-weight: 700; letter-spacing: .4px; }
.grp.GK { --k: var(--pos-gk); }
.grp.CB { --k: var(--pos-cb); }
.grp.WB { --k: var(--pos-wb); }
.grp.CM { --k: var(--pos-cm); }
.grp.WAM { --k: var(--pos-wam); }
.grp.ST { --k: var(--pos-st); }

.est { font-size: 10px; color: var(--draw); border: 1px dashed var(--gold-line); border-radius: var(--r-sm);
  padding: 0 4px; margin-left: 4px; vertical-align: 1px; }

.status { font-size: 11px; color: var(--muted); }
.status.Active { color: var(--win); }
.status.Retiring { color: var(--draw); }

.chip { display: inline-block; padding: 1px 8px; margin: 1px 3px 1px 0; border-radius: 999px; font-size: 11px;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.gold { background: var(--gold-bg); border-color: var(--gold-line); color: var(--gold); }
.chip.ok { background: var(--win-bg); border-color: var(--win-line); color: var(--win); }
.chip.no { background: var(--loss-bg); border-color: var(--loss-line); color: var(--loss); }

/* eligibility criteria */
.criteria { display: grid; gap: 8px; }
.crit { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: var(--r);
  background: var(--bg-3); border: 1px solid var(--line-soft); }
.crit .mark { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 12px; }
.crit.ok .mark { background: var(--win-bg); color: var(--win); border: 1px solid var(--win-line); }
.crit.no .mark { background: var(--loss-bg); color: var(--loss); border: 1px solid var(--loss-line); }
.crit .t { font-weight: 600; }
.crit .desc { color: var(--muted); font-size: 12.5px; }
.crit.plain .mark { background: var(--bg-2); color: var(--muted); border: 1px solid var(--line); }
details.criteria-card > summary { list-style: none; cursor: pointer; }
details.criteria-card > summary::-webkit-details-marker { display: none; }
details.criteria-card > summary h2 { display: inline-block; margin: 0 0 12px; }
details.criteria-card > summary h2::after { content: " ▾"; color: var(--dim); font-size: 14px; }
details.criteria-card[open] > summary h2::after { content: " ▴"; }
.verdict { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--r);
  font-weight: 600; font-size: 13px; margin-bottom: 12px; }
.verdict.ok { background: var(--win-bg); color: var(--win); border: 1px solid var(--win-line); }
.verdict.no { background: var(--bg-3); color: var(--muted); border: 1px solid var(--line); }

/* percentile bars */
.pct { display: inline-flex; align-items: center; gap: 6px; min-width: 92px; justify-content: flex-end; }
.pct .track { width: 46px; height: 5px; border-radius: 3px; background: var(--bg-3); overflow: hidden; }
.pct .track i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.pct.hi .track i { background: var(--gold); }
.pct .n { font-size: 12px; min-width: 26px; text-align: right; }

/* header buttons */
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.actions a.btn, button.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border-radius: var(--r); background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
  font-size: 13px; font-weight: 500; }
.actions a.btn:hover, button.btn:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }
a.btn.gold, button.btn.gold { background: var(--gold-bg); border-color: var(--gold-line); color: var(--gold); }
button.add { padding: 2px 8px; font-size: 12px; line-height: 1.3; border-radius: var(--r-sm); white-space: nowrap; }
button.add.on { background: var(--gold-bg); border-color: var(--gold-line); color: var(--gold); }

/* comparison basket */
.basket { position: sticky; bottom: 14px; z-index: 40; margin-top: 16px; display: flex; gap: 10px;
  align-items: center; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--r-lg); background: var(--bg-2);
  border: 1px solid var(--note-line); box-shadow: var(--shadow); font-size: 13px; }
.basket .who { color: var(--muted); flex: 1; min-width: 160px; }

/* timeline chart */
.chart { width: 100%; overflow-x: auto; }
.chart svg { display: block; min-width: 560px; width: 100%; height: auto; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* peak vs career */
.vs { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 16px; font-size: 13px; }
.vs .h { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.vs .v { text-align: right; }

/* honours timeline */
.htl { display: grid; gap: 6px; }
.htl .row { display: flex; gap: 10px; align-items: baseline; }
.htl .s { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--muted); min-width: 34px; }

/* comparison */
table.cmp th, table.cmp td { text-align: right; }
table.cmp th:first-child, table.cmp td:first-child { text-align: left; color: var(--muted); }
table.cmp td.best { color: var(--gold); font-weight: 700; }
table.cmp tr.sec td { background: var(--bg-3); color: var(--dim); font-family: var(--font-display); font-size: 13px;
  font-weight: 600; text-transform: uppercase; letter-spacing: .6px; padding-top: 5px; padding-bottom: 5px; }
.picked { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.picked .chip { font-size: 12.5px; padding: 3px 10px; color: var(--text); }
.picked .chip button { background: none; border: none; color: var(--dim); padding: 0 0 0 6px; font-size: 13px; }
.picked .chip button:hover { color: var(--loss); }
.minisearch { position: relative; }
.minisearch input { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); color: var(--text);
  padding: 6px 10px; font-size: 13px; width: 240px; font-family: inherit; }
.minisearch .results { width: 320px; }

/* fact sheet */
.facts label { display: flex; gap: 10px; align-items: flex-start; padding: 6px 4px;
  border-bottom: 1px solid var(--line-soft); cursor: pointer; font-size: 13px; }
.facts label:last-child { border-bottom: none; }
.facts input { margin-top: 3px; accent-color: var(--accent); }
textarea.preview { width: 100%; min-height: 340px; resize: vertical; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r); padding: 12px; font-family: var(--code); font-size: 12px;
  line-height: 1.55; }
.copied { color: var(--win); font-size: 12px; margin-left: 6px; }

/* legacy weights */
.weights { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 6px 24px; }
.weight { display: grid; grid-template-columns: 1fr 110px 34px; gap: 10px; align-items: center; font-size: 12.5px; }
.weight input[type=range] { width: 100%; accent-color: var(--gold); }
.weight .v { text-align: right; color: var(--gold); font-weight: 700; }
.breakdown { color: var(--dim); font-size: 11.5px; }

/* small kicker labels: the condensed font in capitals, for labels inside a card */
.legends h3, .awd h3, .mini3 h3, .minicard h3, .race-xi h3, .race-xi .nx .lbl, .bracket .rlabel {
  font-family: var(--font-display); font-size: 13.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .6px; color: var(--muted);
}

/* award race: won-it ticks, and what the voters value */
.tick { font-weight: 800; }
.tick.y { color: var(--win); }
.tick.n { color: var(--dim); }
.imp { display: grid; gap: 4px; }
.imp .r { display: grid; grid-template-columns: minmax(140px, 1fr) 1fr; gap: 10px; align-items: center; font-size: 12px; }
.imp .b { position: relative; height: 8px; background: var(--bg-3); border-radius: 4px; }
.imp .b i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.imp .b i.p { left: 50%; background: var(--win); }
.imp .b i.m { right: 50%; background: var(--loss); }
.imp .b::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--line); }

/* club legends */
.legends { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 22px; }
.legends h3 { margin: 0 0 6px; }
.legends .li { display: flex; gap: 8px; font-size: 12.5px; padding: 2px 0; }
.legends .li .n { margin-left: auto; color: var(--text); font-weight: 600; }
.legends .li .r { color: var(--dim); width: 16px; text-align: right; }

.season-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.season-grid .card { margin: 0; }

.warn { background: var(--gold-bg); border: 1px solid var(--gold-line); border-left: 3px solid var(--gold);
  border-radius: var(--r); padding: 10px 14px; font-size: 12.5px; color: var(--warn-text); margin-bottom: 16px; }
.warn ul { margin: 4px 0 0; padding-left: 18px; }
.warn li { margin: 2px 0; }

@media (max-width: 760px) {
  /* three rows of header would take a quarter of a phone screen, so it scrolls away */
  header.topbar { position: static; }
  .pagehead h1 { font-size: 28px; }
  .actions { margin-left: 0; }
  .controls.sticky .ctl.slider { flex-wrap: wrap; }
  .minisearch, .minisearch input { width: 100%; }
  .minisearch .results { width: 100%; }
  .weight { grid-template-columns: 1fr 90px 30px; }
}

/* small link buttons inside tables (Roster) and the compare links on Surprises & close calls */
a.btn.small { display: inline-block; padding: 2px 9px; font-size: 12px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--bg-3); color: var(--text); white-space: nowrap; }
a.btn.small:hover { border-color: var(--accent); text-decoration: none; }
.cmp-link { font-size: 11px; margin-left: 4px; color: var(--accent); }

/* usernames: quiet links to the user's page */
a.user { color: var(--muted); }
a.user:hover { color: var(--accent); }
a.chip { text-decoration: none; }

/* the next milestones under a player's figures */
.milestones { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: -6px 0 16px; }

/* ---------------------------------------------------------------- TPE */
.srcbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--bg-3); }
.srcbar i { display: block; height: 100%; }
.srcbar i + i { border-left: 1px solid var(--bg-2); }
details.more { margin-top: 12px; }
details.more > summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
details.more > summary:hover { color: var(--text); }
details.more[open] > summary { margin-bottom: 8px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.seg button { background: transparent; border: 0; border-radius: 0; color: var(--muted); padding: 5px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--bg-3); color: var(--text); }

/* ---------------------------------------------------------------- Cup bracket */
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid.four { grid-template-columns: minmax(0, 1fr); } }
.bracket { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 4px; }
.bracket .round { display: flex; flex-direction: column; min-width: 190px; flex: 1 0 190px; }
.bracket .rlabel { margin-bottom: 8px; }
.bracket .ties { display: flex; flex-direction: column; justify-content: space-around; gap: 8px; flex: 1; }
.bracket .tie { background: var(--bg-3); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 6px 9px; }
.bracket .tie.tba { text-align: center; padding: 12px 8px; border-style: dashed; background: transparent; }
.bracket .side { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12.5px; line-height: 1.7; }
.bracket .side .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bracket .side.won .nm a { color: var(--text); font-weight: 700; }
.bracket .side.lost, .bracket .side.lost .nm a { color: var(--muted); }
.bracket .sc { display: flex; gap: 6px; white-space: nowrap; font-weight: 600; }
.bracket .sc .leg { color: var(--dim); font-weight: 400; }
.bracket .flag { font-size: 10.5px; color: var(--dim); margin-top: 2px; }

/* ---------------------------------------------------------------- TPE: clubs chart */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chipbtn { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 2px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.chipbtn i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.chipbtn.off { background: transparent; color: var(--dim); border-style: dashed; }
.chipbtn.off i { opacity: .45; }
.chipbtn.plain { background: transparent; color: var(--muted); }
.swatch { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
svg.lines g.cl { transition: opacity .12s; }
svg.lines.hot g.cl { opacity: .15; }
svg.lines.hot g.cl.on { opacity: 1; }
svg.lines.hot g.cl.on path { stroke-width: 3.2; }

/* ---------------------------------------------------------------- season awards and leaders */
.awd h3 { margin: 0 0 8px; }
.awr { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.awr:first-of-type { border-top: 0; }
.awr .lbl { color: var(--gold); font-size: 11.5px; font-weight: 600; padding-top: 1px; }
.awr .val div + div { margin-top: 2px; }
.awr .tier { display: inline-block; font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 4px; margin-right: 6px; }
.awr .tally { margin-left: 4px; font-weight: 600; }
.pitch { position: relative; border-radius: var(--r-lg); padding: 14px 8px; display: grid; gap: 14px;
  background: linear-gradient(180deg, var(--pitch-a), var(--pitch-b)); border: 1px solid var(--pitch-edge); overflow: hidden; }
.pitch::before { content: ""; position: absolute; left: 8%; right: 8%; top: 50%; border-top: 1px solid var(--pitch-line); }
.pitch::after { content: ""; position: absolute; left: 50%; top: 50%; width: 70px; height: 70px; margin: -35px 0 0 -35px;
  border: 1px solid var(--pitch-line); border-radius: 50%; }
.pitch .prow { position: relative; z-index: 1; display: flex; justify-content: space-evenly; gap: 6px; }
.pitch .pl { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; flex: 1; max-width: 150px; }
.pitch .pos-badge { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--bg-2); border: 1px solid var(--gold); color: var(--gold); font-size: 10px; font-weight: 700; margin-bottom: 4px; }
.pitch .nm { font-size: 12px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; color: var(--pitch-text); }
.pitch .nm a { color: var(--pitch-text); }
.pitch .cl, .pitch .cl a { font-size: 10.5px; color: var(--pitch-sub); line-height: 1.2; }
.mini3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.mini3 h3, .minicard h3 { margin: 0 0 6px; }
.mrow { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; padding: 2px 0; }
.mrow .r { color: var(--dim); width: 14px; text-align: right; flex: none; }
.mrow .who { flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.3; }
.mrow .sub { display: block; font-size: 11px; color: var(--dim); }
.mrow .sub a { color: var(--muted); }
.mrow .sub a.dim { color: var(--dim); }
.mrow + .mrow { margin-top: 3px; }
.mrow .v { font-weight: 700; white-space: nowrap; }

.minicard { margin-bottom: 0; }
h2.section { margin: 26px 0 12px; font-size: 22px; font-weight: 600; letter-spacing: .2px; color: var(--text); }
.grid.three + h2.section, .grid.three + .grid { margin-top: 16px; }

/* award race: the Team of the Season on a pitch, next in line beside it */
.race-xi { align-items: start; }
.pitch .pl .ch { font-size: 11px; color: var(--pitch-gold); margin-top: 1px; }
.pitch .tick.y { color: var(--pitch-ok); }
.pitch .tick.n { color: var(--pitch-sub); }
.pitch .pl.miss .nm a { opacity: .75; }
.race-xi .nexts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.race-xi .nx .lbl { margin-bottom: 3px; }
.race-xi h3 { margin: 0 0 8px; }

/* a tile that links somewhere (Elo on the club page) */
a.tile { color: inherit; text-decoration: none; }
a.tile:hover { border-color: var(--accent); color: inherit; text-decoration: none; }
svg.spark { display: block; }

/* season predictor */
.pstrip { display: flex; gap: 2px; }
.pstrip i { width: 13px; height: 16px; border-radius: 3px; border: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--accent) calc(var(--p) * 100%), transparent); }
.pstrip i.fin { outline: 2px solid var(--gold); outline-offset: -1px; }
.wdl3 { display: flex; height: 18px; border-radius: 5px; overflow: hidden; font-size: 10.5px; font-weight: 600; }
.wdl3 i { display: flex; align-items: center; justify-content: center; font-style: normal; color: var(--on-accent); min-width: 0; overflow: hidden; }
.wdl3 .h { background: var(--accent); }
.wdl3 .d { background: var(--line); color: var(--text); }
.wdl3 .a { background: var(--gold); }

/* a control bar that stays in view under the top bar (the season predictor) */
.controls.sticky { position: sticky; z-index: 40; background: var(--bg); padding: 8px 0; margin-top: -8px; }
@media (max-width: 760px) { .controls.sticky { position: static; margin-top: 0; } }

/* buttons in the top bar take the bar's colours */
header.topbar > button#refresh { background: var(--top-input); border-color: var(--top-line); color: var(--top-text); }
header.topbar > button#refresh:hover { border-color: var(--top-muted); }

/* ---------------------------------------------------------------- crests (the league's logos, web/img/crests) */
.crest-sm { width: 18px; height: 18px; flex: none; vertical-align: -4px; margin-right: 6px; object-fit: contain; }
a.club { white-space: nowrap; }
.mrow a.club { white-space: normal; }
/* a club without a logo: a small badge in its own colours */
.crest-sm.badge, .crest-lg.badge { display: inline-grid; place-items: center; border-radius: 50%;
  background: var(--b1); color: var(--b2); border: 1px solid color-mix(in srgb, var(--b2) 40%, transparent);
  font-family: var(--font-display); font-weight: 700; line-height: 1; }
.crest-sm.badge { font-size: 10px; }
.crest-lg { width: 76px; height: 76px; flex: none; object-fit: contain; }
.crest-lg.badge { font-size: 26px; }

/* the club page header: crest, name, where they play, in the club's colours */
.clubhead { position: relative; display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 18px 22px; margin-bottom: 18px; border-radius: var(--r-lg); border: 1px solid var(--line);
  border-left: 6px solid var(--club);
  background: linear-gradient(100deg, color-mix(in srgb, var(--club) 20%, var(--bg-2)) 0%, var(--bg-2) 62%); }
.clubhead h1 { margin: 0; font-size: 38px; line-height: 1.05; letter-spacing: .2px; }
.clubhead .sub { color: var(--muted); font-size: 13px; margin-top: 5px; }
.clubhead .sub b { color: var(--text); font-weight: 600; }
.clubhead .stripe { display: flex; gap: 3px; margin-top: 9px; }
.clubhead .stripe i { width: 26px; height: 5px; border-radius: 3px; box-shadow: 0 0 0 1px var(--line-soft); }

/* a long table's "Show all" button */
button.more-rows { display: block; width: 100%; margin-top: 8px; padding: 7px; background: transparent;
  border: 1px dashed var(--line); color: var(--muted); font-size: 12.5px; }
button.more-rows:hover { color: var(--text); border-color: var(--accent); }

/* the Award race's "just for fun" note: gold edge, so it stands apart from the page's other notes */
.note.disclaimer { border-left-color: var(--gold); }

/* ---------------------------------------------------------------- the round-4 pieces */

/* in-page search boxes */
input.search-inline { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); color: var(--text);
  padding: 6px 10px; font-size: 13px; width: 220px; font-family: inherit; }

/* the predictor's slider takes the room there is */
.ctl.slider { flex: 1 1 320px; }
.ctl.slider input[type=range] { flex: 1 1 160px; min-width: 120px; }

/* the season page: an honour on two lines */
.honour { padding: 6px 0; }
.honour + .honour { border-top: 1px solid var(--line-soft); }
.honour .pill { white-space: nowrap; margin: 0; }
.honour .hw { margin-top: 3px; min-width: 0; }

/* league tables: gold for the champions, green up, red down */
tr.row-champ td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
tr.row-up td:first-child { box-shadow: inset 3px 0 0 var(--win); }
tr.row-down td:first-child { box-shadow: inset 3px 0 0 var(--loss); }
tr.row-pick td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.edge { display: inline-block; width: 3px; height: 11px; vertical-align: -1px; margin: 0 3px 0 8px; }
.edge.champ { background: var(--gold); } .edge.up { background: var(--win); } .edge.down { background: var(--loss); }

/* the Seasons page: a card per season */
.season-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.scard { display: block; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 12px; color: var(--text); }
.scard:hover { border-color: var(--accent); text-decoration: none; color: var(--text); }
.scard.live { border-color: var(--gold-line); }
.scard .sn { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1; }
.scard .st { color: var(--muted); font-size: 11.5px; margin: 3px 0 6px; }
.scard .champ { font-size: 12px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the player page's header: a band in the club's colours, like the club page */
.pagehead.playerhead { padding: 16px 20px; border-radius: var(--r-lg); border: 1px solid var(--line);
  border-left: 6px solid var(--club, var(--accent));
  background: linear-gradient(100deg, color-mix(in srgb, var(--club, var(--accent)) 16%, var(--bg-2)) 0%, var(--bg-2) 62%); }

/* one way to list trophies */
.tlist .trophy-line { flex-wrap: wrap; }

/* where a player played: a thin bar of the award groups, widest first */
.posbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden;
  background: var(--line-soft); min-width: 90px; }
.posbar i { display: block; height: 100%; }
.posbar i.g-GK { background: var(--c2); }
.posbar i.g-CB { background: var(--c1); }
.posbar i.g-WB { background: var(--c6); }
.posbar i.g-CM { background: var(--c3); }
.posbar i.g-WAM { background: var(--c5); }
.posbar i.g-ST { background: var(--c4); }
.posbar-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px;
  margin-right: 5px; vertical-align: -1px; }
.posbar-legend i.g-GK { background: var(--c2); } .posbar-legend i.g-CB { background: var(--c1); }
.posbar-legend i.g-WB { background: var(--c6); } .posbar-legend i.g-CM { background: var(--c3); }
.posbar-legend i.g-WAM { background: var(--c5); } .posbar-legend i.g-ST { background: var(--c4); }

/* ---------------------------------------------------------------- Hall of Fame: By class funnel */
.funnel-cell { width: 34%; min-width: 120px; }
.funnel { position: relative; height: 14px; border-radius: 3px; background: var(--line); }
.funnel i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.funnel .f-league, .legend .f-league { background: var(--funnel-mid); }
.funnel .f-elig, .legend .f-elig { background: var(--accent); }
.funnel .f-in, .legend .f-in { background: var(--gold); }
.legend .f-all { background: var(--line); }

/* ---------------------------------------------------------------- player page: the shooting box (goal mouth) */
.shooting .shoot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-bottom: 8px; }
.goalmouth { width: 100%; max-width: 336px; height: auto; flex: none; }
.goalmouth .frame { fill: none; stroke: var(--text); stroke-width: 4; stroke-linejoin: round; }
.goalmouth .ground { stroke: var(--line); stroke-width: 2; }
.goalmouth .zone { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.goalmouth .dot { fill: var(--accent); fill-opacity: .7; }
.goalmouth .top { fill: var(--gold); fill-opacity: .85; }
.shoot-figs { display: grid; gap: 4px; font-size: 13.5px; }
.shoot-figs b { font-size: 16px; }
