/* Layout: one column; progress at the top, compact category tiles that expand, the video grid below. */
:root {
  --paper: #f2f4f8;
  --surface: #ffffff;
  --ink: #15203b;
  --muted: #5a6683;
  --line: #d9deea;
  --club: #d1256c;       /* accent: passes, likes */
  --club-soft: #fbe3ed;
  --orbit: #128f82;      /* progress */
  --orbit-soft: #d6efeb;
  --track: #e3e7f0;
  --star: #e2a412;

  --f-display: "Unbounded", "Trebuchet MS", system-ui, sans-serif;
  --f-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --radius: 14px;
  --max: 1080px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1322; --surface: #151d31; --ink: #e8ecf5; --muted: #98a3bd;
    --line: #26304a; --club: #ff5c97; --club-soft: #3a1a2b; --orbit: #3dd6c4;
    --orbit-soft: #123430; --track: #222c45; --star: #f5bf3c; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d1322; --surface: #151d31; --ink: #e8ecf5; --muted: #98a3bd;
  --line: #26304a; --club: #ff5c97; --club-soft: #3a1a2b; --orbit: #3dd6c4;
  --orbit-soft: #123430; --track: #222c45; --star: #f5bf3c; color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
/* keep [hidden] working on elements that set their own display (e.g. .cats) */
[hidden] { display: none !important; }
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
h1, h2, h3 { text-wrap: balance; margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--club); outline-offset: 3px; border-radius: 6px; }
.mono { font-family: var(--f-mono); }
.num { font-variant-numeric: tabular-nums; }
.label {
  font-size: 12px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}

/* ---------- header ---------- */
.top { padding-block: 28px 8px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { flex: none; display: block; }
.brand b { font: 600 18px/1 var(--f-display); letter-spacing: -.01em; }
.updated { font-size: 13px; color: var(--muted); }

/* ---------- progress ---------- */
.hero { padding-block: 24px 32px; display: grid; gap: 18px; }
.hero h1 {
  font: 500 clamp(40px, 8vw, 84px)/1 var(--f-display);
  letter-spacing: -.03em;
  display: flex; align-items: baseline; gap: .18em; flex-wrap: wrap;
}
.hero h1 .of { color: var(--muted); font-weight: 300; font-size: .5em; }
.hero-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 56px; align-items: start; }
.hero p { margin: 0; color: var(--muted); font-size: 19px; line-height: 1.6; max-width: 68ch; text-wrap: pretty; }
.hero p strong { color: var(--ink); }
.hero p a { color: var(--ink); text-decoration-color: var(--orbit); text-underline-offset: 3px; text-decoration-thickness: 2px; }
.hero p a:hover { color: var(--orbit); }

.bar { height: 14px; background: var(--track); border-radius: 99px; overflow: hidden; position: relative; }
.bar > i { display: block; height: 100%; background: var(--orbit); border-radius: 99px; min-width: 14px; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.bar.sm { height: 6px; }
.bar.sm > i { min-width: 0; }
.bar.sm > i.some { min-width: 6px; }

.facts { display: grid; grid-template-columns: repeat(2, auto); gap: 18px 40px; margin: 4px 0 0; }
@media (max-width: 860px) {
  .hero-body { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(4, auto); justify-content: start; gap: 10px 32px; }
  .hero p { font-size: 16px; line-height: 1.5; }
}
@media (max-width: 560px) { .facts { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: 8px; } .facts dd { font-size: 18px; } }
.facts div { display: grid; gap: 0; }
.facts dt { order: 2; font-size: 13px; color: var(--muted); }
.facts dd { order: 1; margin: 0; font: 500 22px/1.2 var(--f-display); font-variant-numeric: tabular-nums; }

/* ---------- groups ---------- */
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h2 { font: 500 24px/1.2 var(--f-display); letter-spacing: -.01em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 8px; margin-bottom: 40px; }
@media (max-width: 560px) { .tile { padding: 12px 14px; gap: 8px; } .t-name { font-size: 15px; } .t-count { font-size: 14px; } }
.tiles:has(+ .detail:not([hidden])) { margin-bottom: 8px; }
.tile {
  all: unset; box-sizing: border-box; cursor: pointer; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; align-items: center;
}
.tile:hover { border-color: var(--muted); }
.tile:focus-visible { outline: 2px solid var(--club); outline-offset: 2px; }
.tile[aria-expanded="true"] { border-color: var(--orbit); box-shadow: inset 0 0 0 1px var(--orbit); }
.t-name { font-weight: 700; font-size: 16px; }
.t-count { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.t-count b { color: var(--ink); }
.tile .bar { grid-column: 1; }
.tile .chev { grid-column: 2; justify-self: end; }
.chev { transition: transform .2s; color: var(--muted); }
.tile[aria-expanded="true"] .chev { transform: rotate(180deg); }

.detail {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 6px 18px 14px; margin-bottom: 40px; display: grid; gap: 14px;
}
.block h3 { font: 600 15px/1.3 var(--f-body); padding: 10px 0 6px; display: flex; justify-content: space-between; gap: 12px; }
.block h3 span { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.cat { display: grid; grid-template-columns: minmax(0, 1fr) 140px 56px; gap: 14px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); font-size: 15px; }
.cat .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.cat .n b { color: var(--ink); }
@media (max-width: 560px) { .cat { grid-template-columns: minmax(0, 1fr) 54px; } .cat .bar { grid-column: 1 / -1; grid-row: 2; } }
.note { margin: 0; font-size: 14px; color: var(--muted); max-width: 70ch; }

/* ---------- feed ---------- */
.feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 20px; margin-bottom: 56px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.player { position: relative; aspect-ratio: 9 / 16; max-height: 560px; width: 100%; max-width: 100%; background: var(--ink); overflow: hidden; }
.player.wide { aspect-ratio: 16 / 9; }
.player img, .player iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.player .poster {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 10px; text-align: center;
  color: var(--paper); font-family: var(--f-mono); font-size: 30px; letter-spacing: .08em;
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--club) 35%, var(--ink)) 0, var(--ink) 70%);
}
.player .poster small { font: 500 13px/1.3 var(--f-body); letter-spacing: 0; opacity: .75; }
.play {
  position: absolute; inset: 0; display: grid; place-items: center; background: transparent;
  border: 0; cursor: pointer; text-decoration: none;
}
.play span {
  width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--club) 92%, transparent); color: #fff;
  box-shadow: 0 6px 24px rgb(0 0 0 / .35); transition: transform .15s;
}
.play:hover span { transform: scale(1.06); }
.meta { padding: 16px 18px 18px; display: grid; gap: 10px; }
.meta-top { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.title { display: grid; gap: 2px; min-width: 0; }
.title .pname { font-weight: 700; font-size: 15px; }
.fam { font-size: 14px; color: var(--muted); }
.when { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.meta-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.search {
  display: flex; align-items: center; gap: 10px; margin: -2px 0 18px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 99px; color: var(--muted);
  max-width: 460px;
}
.search:focus-within { border-color: var(--orbit); box-shadow: 0 0 0 1px var(--orbit); }
.search svg { flex: none; }
.search input {
  all: unset; flex: 1; min-width: 0; padding: 11px 0; color: var(--ink);
  font: 500 16px/1.2 var(--f-body);
}
.search input::placeholder { color: var(--muted); opacity: 1; }

/* siteswap: always on one line, each throw in a box with the colour of its club */
.ss { display: inline-flex; flex-wrap: nowrap; gap: 3px; font-family: var(--f-mono); font-weight: 600; white-space: nowrap; }
.ss b { min-width: 1.45em; padding: 2px 0; text-align: center; border-radius: 5px; background: var(--track); font-weight: 600; }
.ss.lg { font-size: 22px; }
.ss.sm { font-size: 14px; }
/* club colours, matched to the bodies of our real clubs */
.c-w { background: #eeeff2 !important; color: #15203b; box-shadow: inset 0 0 0 1px #c3c8d4; }
.c-b { background: #1f4fd1 !important; color: #fff; }
.c-o { background: #ee5a2c !important; color: #fff; }
.c-r { background: #e6386a !important; color: #fff; }

.stars { position: relative; display: inline-block; font-size: 17px; line-height: 1; letter-spacing: 2px; color: var(--track); white-space: nowrap; }
.stars::before { content: "★★★★★"; }
.stars::after { content: "★★★★★"; position: absolute; left: 0; top: 0; width: var(--pct); overflow: hidden; color: var(--star); }
.unrated { font-size: 13px; color: var(--muted); }

.like {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px 7px 10px; border-radius: 99px;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  font: 600 14px/1 var(--f-body); cursor: pointer; font-variant-numeric: tabular-nums;
}
.like svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .15s; }
.like[aria-pressed="true"] { border-color: var(--club); color: var(--club); background: var(--club-soft); }
.like[aria-pressed="true"] svg { fill: currentColor; }
.like:active svg { transform: scale(1.25); }

.legend { display: flex; gap: 14px; align-items: center; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* ---------- list without video ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 40px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; color: var(--muted); }

.empty { padding: 28px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
footer { padding-block: 24px 48px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
