/* Footy Data — night game at the footy: mown turf, line paint, scoreboard yellow. Dark-only by design. */
:root {
  --turf-a: #0c2416;
  --turf-b: #0f2c1b;
  --panel: rgba(6, 16, 10, .84);
  --panel-solid: #08150d;
  --panel-line: rgba(244, 241, 232, .14);
  --paint: #f4f1e8;
  --dim: #a9b8ad;
  --bulb: #ffc72c;
  --sherrin: #d6202a;
  --win: #4be38a;
  --loss: #ff6b6b;
  --board: #050806;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --cond: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--turf-a); }
body {
  margin: 0; min-height: 100%;
  color: var(--paint); font-family: var(--body); font-size: 15px; line-height: 1.5;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(255,255,255,.06), transparent 60%),
    radial-gradient(140% 100% at 50% 50%, transparent 55%, rgba(0,0,0,.55) 100%),
    repeating-linear-gradient(90deg, var(--turf-a) 0 90px, var(--turf-b) 90px 180px);
  background-attachment: fixed;
}
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--bulb); outline-offset: 2px; }

/* Header */
.site-head {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: rgba(5, 10, 7, .92); backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--paint);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: #050a07; }
.head-in { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 18px; min-height: 60px; flex-wrap: wrap; padding-block: 6px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 900; font-size: 26px; letter-spacing: .02em; text-transform: uppercase; }
.brand svg { width: 34px; height: 22px; }
.brand span { color: var(--bulb); }
.nav { display: flex; gap: 2px; flex-wrap: wrap; margin-left: auto; }
.nav a {
  text-decoration: none; font-family: var(--cond); font-weight: 700; font-size: 16px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--dim);
  padding: 6px 12px; border-radius: 4px;
}
.nav a:hover { color: var(--paint); background: rgba(255,255,255,.06); }
.nav a[aria-current="page"] { color: var(--board); background: var(--bulb); }

/* Layout */
main.page {
  max-width: 1240px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 28px 56px;
  display: flex; flex-direction: column; gap: 32px;
}
.eyebrow { font-family: var(--cond); font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--bulb); font-size: 14px; }
h1, h2, h3 { font-family: var(--display); text-transform: uppercase; margin: 0; text-wrap: balance; }
h1 { font-weight: 900; font-size: clamp(40px, 7vw, 84px); line-height: .9; }
h2 { font-weight: 800; font-size: 24px; letter-spacing: .1em; display: flex; align-items: center; gap: 12px; }
h2::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, var(--paint), transparent); opacity: .45; }
h3 { font-weight: 800; font-size: 20px; letter-spacing: .06em; }
.lede { color: var(--dim); max-width: 66ch; margin: 0; font-size: 16px; }
.section { display: flex; flex-direction: column; gap: 14px; }

.panel { background: var(--panel); border: 1px solid var(--panel-line); border-radius: 10px; padding: 18px 20px; box-shadow: 0 14px 34px rgba(0,0,0,.3); }
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); }
.grid > * { min-width: 0; }

.logo { display: block; object-fit: contain; filter: drop-shadow(0 0 1px rgba(255,255,255,.7)) drop-shadow(0 4px 10px rgba(0,0,0,.45)); }
.club-chip { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; min-width: 0; }
.club-chip img { width: 26px; height: 26px; flex: none; }
.club-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.club-chip:hover span { text-decoration: underline; text-decoration-color: var(--bulb); text-underline-offset: 3px; }

/* Scoreboard number */
.sb { background: var(--board); border: 2px solid #1d2a22; border-radius: 6px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.sb b { font-family: var(--display); font-weight: 900; font-size: 34px; line-height: 1; color: var(--bulb); font-variant-numeric: tabular-nums; text-shadow: 0 0 14px rgba(255,199,44,.35); }
.sb i { font-style: normal; font-family: var(--cond); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.sb-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--panel-line); background: var(--panel); }
table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
table.data th, table.data td { padding: 9px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid rgba(244,241,232,.07); }
table.data th { font-family: var(--cond); font-weight: 700; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); background: var(--panel-solid); position: sticky; top: 0; }
table.data th.l, table.data td.l { text-align: left; }
table.data th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
table.data th button:focus-visible { outline: 2px solid var(--bulb); outline-offset: 2px; }
table.data th[aria-sort] { color: var(--bulb); }
table.data th[aria-sort="descending"] button::after { content: "▼"; font-size: 9px; }
table.data th[aria-sort="ascending"] button::after { content: "▲"; font-size: 9px; }
table.data tbody tr:hover { background: rgba(255,199,44,.06); }
table.data td.hi { color: var(--bulb); font-weight: 700; }
.rank { font-family: var(--display); font-weight: 900; font-size: 18px; color: var(--dim); }
tr.top8 .rank { color: var(--paint); }
tr.cut td { border-bottom: 2px dashed rgba(255,199,44,.45); }

/* Controls */
.controls { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-family: var(--cond); font-weight: 700; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.field input, .field select {
  font: 500 15px var(--body); color: var(--paint); background: var(--board);
  border: 1px solid var(--panel-line); border-radius: 6px; padding: 8px 10px; min-width: 0;
}
.field input[type="search"] { width: min(100%, 260px); }
.seg { display: inline-flex; border: 1px solid var(--panel-line); border-radius: 6px; overflow: hidden; }
.seg button { font: 700 14px var(--cond); letter-spacing: .1em; text-transform: uppercase; background: var(--board); color: var(--dim); border: 0; padding: 9px 14px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--bulb); color: var(--board); }
.muted { color: var(--dim); }
.small { font-size: 13px; }

/* Result rows */
.result { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(244,241,232,.07); }
.result:last-child { border-bottom: 0; }
.result .rd { font-family: var(--cond); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.result .score { font-family: var(--display); font-weight: 900; font-size: 20px; font-variant-numeric: tabular-nums; text-align: center; white-space: nowrap; }
.result .away { justify-self: end; }
.result > span:nth-child(2) { display: flex; align-items: center; gap: 6px; min-width: 0; }
.wl { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 4px; font: 800 12px var(--cond); color: var(--board); }
.wl.W { background: var(--win); } .wl.L { background: var(--loss); } .wl.D { background: var(--dim); }

.pill { display: inline-block; font: 700 12px var(--cond); letter-spacing: .14em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: var(--bulb); color: var(--board); }
.pick { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 52px; padding: 6px 8px; border-radius: 6px; background: var(--board); border: 1px solid #1d2a22; }
.pick b { font-family: var(--display); font-weight: 900; font-size: 22px; line-height: 1; color: var(--bulb); }
.pick i { font-style: normal; font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.pick.r1 { border-color: var(--bulb); }
.picks { display: flex; flex-wrap: wrap; gap: 6px; }

footer.site-foot { max-width: 1240px; margin: 0 auto; padding: 18px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); color: var(--dim); font-size: 13px; border-top: 1px solid var(--panel-line); }

@media (max-width: 640px) {
  .brand { font-size: 22px; }
  .nav { margin-left: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .nav a { font-size: 14px; padding: 6px 9px; }
  .result { grid-template-columns: 52px minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; }
  .result .score { font-size: 16px; }
  .club-chip img { width: 22px; height: 22px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
