/* Colours are CSS variables: the light set in :root, the dark set in the media query below. */
:root {
  color-scheme: light; /* native controls (dropdowns, the search field) follow the theme */
  --bg: #f3f1ec;
  --surface: #ffffff;
  --ink: #141821;
  --muted: #5d6472;
  --line: #dedad2;
  --accent: #c2410c; /* dark enough for white text on it, and for orange text on white (AA) */
  --accent-ink: #ffffff;
  --chip: #ebe8e1;
  --must: #d9480f;
  --good: #e8890c;
  --decent: #6b7a8f;
  --skip: #a3a9b3;
  --h0: #e6e3dc;
  --h1: #f5c9a3;
  --h2: #f08c4a;
  --h3: #d9480f;
  --shadow: 0 1px 2px rgb(20 24 33 / 0.06), 0 4px 14px rgb(20 24 33 / 0.05);
  --live: #d6336c;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0d1321;
    --surface: #161e30;
    --ink: #eef1f6;
    --muted: #97a0b3;
    --line: #26304a;
    --accent: #ff7a2f;
    --accent-ink: #0d1321;
    --chip: #1f2940;
    --must: #ff7a2f;
    --good: #f5a524;
    --decent: #8391a8;
    --skip: #525d73;
    --h0: #222c44;
    --h1: #5a3a2a;
    --h2: #c2602a;
    --h3: #ff7a2f;
    --shadow: none;
    --live: #f0457f;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0 auto;
  max-width: 760px;
  /* The safe-area insets keep content clear of the notch and home bar in the installed app. */
  padding: 0 16px calc(40px + env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 Inter, system-ui, sans-serif;
}
button, select, input { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }

.top { padding: calc(22px + env(safe-area-inset-top)) 0 10px; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { display: block; width: 36px; height: 36px; }
h1 { font: 700 32px/1 'Barlow Condensed', system-ui, sans-serif; letter-spacing: 0.01em; text-transform: uppercase; }
.tld { font-size: 0.6em; font-weight: 600; text-transform: none; letter-spacing: 0; margin-left: 2px; opacity: 0.6; }
.tagline { color: var(--muted); margin-top: 6px; }

.views { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 0; }
.views button {
  min-height: 46px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
  font-weight: 700; font-size: 16px; cursor: pointer;
}
.views button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
/* Two ways filters hide themselves: .replay-only by view (not under Coming up),
   and data-for="tennis all" by sport (app.js sets hidden). */
body[data-view="upcoming"] .replay-only { display: none; }
body:not([data-view="upcoming"]) .upcoming-only { display: none; }
.day { list-style: none; font-weight: 700; font-size: 14px; color: var(--muted); margin: 10px 2px 0; text-transform: uppercase; letter-spacing: 0.04em; }
.soon .badge { border-style: dashed; }
.soon .time { font: 700 26px/1 'Barlow Condensed', system-ui, sans-serif; }
.soon.live .badge { border: 0; background: var(--live); color: #fff; }
.soon.live .tier { font-size: 13px; text-transform: none; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.sports {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
  margin: 14px 0; padding: 4px; border-radius: 12px; background: var(--chip);
}
.sports button {
  min-height: 44px; border: 0; border-radius: 9px; background: transparent;
  font-weight: 600; cursor: pointer;
}
.sports button[aria-pressed="true"] { background: var(--surface); box-shadow: var(--shadow); color: var(--accent); }

.services h2 { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.hint { color: var(--muted); font-weight: 400; margin-left: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500;
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.favs { margin-top: 16px; }
.favs-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.favs-toggle {
  display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 0; border: 0; background: none;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.favs-toggle .caret { display: inline-block; font-size: 12px; margin-right: 2px; }
.favs-toggle[aria-expanded="true"] .caret { transform: rotate(90deg); }
.favs-toggle .count {
  font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--chip); color: var(--muted);
}
.favs-toggle .count:empty { display: none; }
#favs-body { margin-top: 6px; }
#favs-body .small { margin-bottom: 8px; }
.favs .chip.only { min-height: 36px; font-size: 14px; flex: none; }
.favs .chip.only[aria-pressed="false"] { border-color: var(--accent); color: var(--accent); }
.favs .chip.only:disabled { opacity: 0.5; cursor: default; border-color: var(--line); color: var(--muted); }
.favs .chip.fav::after { content: '✕'; margin-left: 8px; font-size: 12px; opacity: 0.6; }
#fav-q {
  display: block; width: 100%; min-height: 42px; margin-top: 8px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
#fav-hits { margin-top: 8px; }
#fav-hits .chip { min-height: 36px; font-size: 14px; border-style: dashed; }
.star { /* sits right after the name; the invisible ::after makes it easy to hit */
  position: relative; border: 0; background: none; padding: 0; margin-left: 0.2em;
  font-size: 0.85em; line-height: 1; color: var(--accent); cursor: pointer; vertical-align: 0.05em;
}
.star::after { content: ''; position: absolute; inset: -10px -8px; }
.title .name { display: inline; }
.title .keep { white-space: nowrap; } /* a followed name's last word and its star */
.title .elo { font-weight: 400; color: var(--muted); font-size: 0.8em; }

.filters { margin: 16px 0 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.filters summary { padding: 12px 14px; cursor: pointer; font-weight: 600; min-height: 44px; }
.filters .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 14px 12px; }
.filters label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.filters select {
  min-height: 40px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink); width: 100%;
}
.filters .check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 15px; min-height: 40px; }
.filters .check input { width: 20px; height: 20px; accent-color: var(--accent); }
.filters .small { padding: 0 14px 14px; }
[hidden] { display: none !important; }
.comps { display: flex; gap: 8px; overflow-x: auto; margin: -4px -16px 14px; padding: 2px 16px 4px; scrollbar-width: none; }
.comps .chip { flex: none; min-height: 36px; font-size: 14px; }
.chip .n { margin-left: 6px; font-size: 12px; font-weight: 600; opacity: 0.65; font-variant-numeric: tabular-nums; }
.filters summary .count {
  margin-left: 6px; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
}
.reset {
  margin: 0 14px 14px; min-height: 40px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line); background: transparent; font-weight: 600; cursor: pointer;
}
.small { font-size: 13px; color: var(--muted); }

/* Custom scoring (football): sliders with a "standard" mark, competition boosts, calibration mode. */
.tuning > .small { padding: 0 14px 10px; margin: 0; }
.tuning .t-status { color: var(--ink); }
.tuning .sliders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; padding: 4px 14px 14px; }
.slider { display: grid; gap: 2px; min-width: 0; }
.s-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.filters .s-label { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }
.s-val { font-size: 13px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.s-track { position: relative; padding-bottom: 16px; }
.s-track { touch-action: pan-y; } /* vertical swipes scroll the page; app.js moves the knob on sideways drags */
/* Our own track and a bigger knob (26 px, THUMB in app.js), the same in every browser. */
.s-track input {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 34px; margin: 2px 0 0;
  background: transparent; --fill: 50%;
}
.s-track input::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--accent) var(--fill), var(--line) var(--fill));
}
.s-track input::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--accent) var(--fill), var(--line) var(--fill)); }
.s-track input::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 1px 4px rgb(0 0 0 / 0.3);
}
.s-track input::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 1px 4px rgb(0 0 0 / 0.3); }
.s-track input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.s-track input:disabled { opacity: 0.45; }
.s-std {
  position: absolute; bottom: 0; transform: translateX(-50%); font-size: 10.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; pointer-events: none;
}
.s-std::before { content: ''; position: absolute; left: 50%; top: -6px; width: 2px; height: 5px; margin-left: -1px; background: var(--muted); border-radius: 1px; }
.filters .slider .small { margin: 0; padding: 0; }
.s-weights { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; color: var(--ink) !important; }
.t-head { font-size: 15px; font-weight: 600; margin: 0; padding: 4px 14px 2px; }
.tuning .boosts { padding-top: 6px; }
.reset:disabled { opacity: 0.45; cursor: default; }
.calib-result { font-size: 14.5px; font-weight: 700; color: var(--live); }
.calc-btn {
  justify-self: start; margin-top: 4px; border: 0; background: none; padding: 6px 0; min-height: 36px;
  color: var(--ink); font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.calc { padding: 10px 12px; border-radius: 10px; background: var(--chip); font-size: 13.5px; display: grid; gap: 6px; min-width: 0; }
.calc h4 { margin: 4px 0 0; font-size: 14px; }
.calc ul.goals { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.calc ul.goals li { display: grid; grid-template-columns: 3.6em 2.6em 1fr; }
.calc ul.goals li span:nth-child(-n+2) { color: var(--muted); }
.facts { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; table-layout: fixed; }
.facts th, .facts td { padding: 3px 0 3px 8px; vertical-align: top; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.facts col.label { width: 40%; }
.facts thead th { border-top: 0; font-size: 12px; font-weight: 600; color: var(--ink); text-align: right; vertical-align: bottom; overflow-wrap: normal; hyphens: auto; }
.facts tbody th { padding-left: 0; text-align: left; font-weight: 400; color: var(--muted); }
.facts td { text-align: right; }
.facts tr.both th { padding-top: 10px; text-align: right; font-size: 12px; font-weight: 600; color: var(--ink); } /* totals and minutes: not one team's */
.facts tr.both td, .facts tr.both th { border-top: 0; }
.calc-lines { list-style: none; margin: 0; padding: 0; display: grid; font-variant-numeric: tabular-nums; }
.calc-lines li { display: grid; grid-template-columns: 3.6em minmax(0, 1fr) auto; gap: 0 8px; padding: 4px 0; border-top: 1px solid var(--line); }
.calc-lines .calc-headings { border-top: 0; font-size: 12px; color: var(--muted); font-weight: 600; padding-top: 0; }
.calc-lines .pts { font-weight: 700; color: var(--accent); }
.calc-lines .neg .pts { color: var(--muted); }
.calc-lines .run { color: var(--muted); text-align: right; }
.calc-lines .how { grid-column: 2 / -1; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.calc-sum { font-weight: 700; margin: 0; }
@media (max-width: 560px) { .tuning .sliders { grid-template-columns: 1fr; } }
/* On phones, panels that open inside a card (facts and calculation, "Why this score?", line-ups) use
   the full card width, under the badge too (76px column + 14px gap): the badge column is empty there. */
@media (max-width: 560px) { .card .calc, .card .why, .card .lineups { margin-left: -90px; } }

.status { color: var(--muted); font-size: 14px; margin: 14px 0 8px; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.card {
  display: grid; grid-template-columns: 76px 1fr; gap: 14px;
  padding: 14px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.card.is-watched { opacity: 0.55; }
.badge {
  --c: var(--skip);
  display: grid; align-content: center; justify-items: center; gap: 2px;
  border-radius: 12px; border: 2px solid var(--c); padding: 8px 2px; align-self: start;
}
.card[data-tier="must"] .badge { --c: var(--must); background: var(--must); color: var(--accent-ink); }
.card[data-tier="good"] .badge { --c: var(--good); }
.card[data-tier="decent"] .badge { --c: var(--decent); }
.num { font: 700 30px/1 'Barlow Condensed', system-ui, sans-serif; }
.tier { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; text-align: center; }
.body { min-width: 0; display: grid; gap: 4px; }
.meta { font-size: 12.5px; color: var(--muted); }
.meta .limited { font-style: italic; }
.title { font-size: 17px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.reveal {
  border: 1px dashed var(--line); background: var(--chip); border-radius: 8px;
  padding: 6px 10px; min-height: 36px; cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 500;
}
.sub { font-size: 13.5px; color: var(--muted); }
.strip { position: relative; display: flex; gap: 3px; margin-top: 6px; }
.strip .skip {
  position: absolute; top: -3px; bottom: -3px; border-radius: 3px;
  background: repeating-linear-gradient(135deg, var(--surface) 0 3px, transparent 3px 6px);
  outline: 1px solid var(--muted); outline-offset: -1px; opacity: 0.85;
}
.strip i { flex: 1; height: 8px; border-radius: 2px; background: var(--h0); }
.strip .h1 { background: var(--h1); }
.strip .h2 { background: var(--h2); }
.strip .h3 { background: var(--h3); }
.advice { font-size: 14.5px; font-weight: 600; margin-top: 2px; }
.advice::before { content: '⏩ '; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.svc { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  display: inline-flex; align-items: center; min-height: 32px;
  font-size: 12.5px; font-weight: 600; padding: 0 12px; border-radius: 999px;
  background: var(--chip); color: var(--ink); text-decoration: none;
}
.pill.mine { background: var(--accent); color: var(--accent-ink); }
.pill .go { font-size: 0.75em; margin-left: 0.4em; }
.watched {
  border: 1px solid var(--line); background: transparent; border-radius: 8px;
  min-height: 36px; padding: 0 10px; font-size: 13px; cursor: pointer; color: var(--muted);
}
.watched[aria-pressed="true"] { color: var(--ink); }
.why-btn {
  justify-self: start; margin-top: 4px; border: 0; background: none; padding: 6px 0; min-height: 36px;
  color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer;
}
.lineup-btn, .pace-btn {
  justify-self: start; margin-top: 4px; border: 0; background: none; padding: 6px 0; min-height: 36px;
  color: var(--ink); font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.pace { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.lineups {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 16px;
  padding: 10px 12px; border-radius: 10px; background: var(--chip); font-size: 14px;
}
.lineups h4 { font-size: 14.5px; font-weight: 700; margin: 0 0 4px; }
.lineups h4 small { font-size: 12.5px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.lineups ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.lineups li { display: grid; grid-template-columns: 1.7em 1fr auto; gap: 6px; align-items: baseline; }
.lineups li.new-line { margin-top: 6px; }
.lineups .n { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.lineups .name { min-width: 0; overflow-wrap: anywhere; }
.lineups .pos { color: var(--muted); font-size: 12px; }
.lineups .bench-btn {
  margin-top: 4px; border: 0; background: none; padding: 6px 0; min-height: 36px;
  color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer;
}
.lineups .bench { font-size: 13px; color: var(--muted); line-height: 1.45; }
.cal { margin-top: 6px; }
.cal-btn {
  border: 0; background: none; padding: 6px 0; min-height: 36px;
  color: var(--ink); font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.cal-links { list-style: none; margin: 4px 0 6px; padding: 0; display: grid; gap: 6px; }
.cal-links li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-team { font-weight: 600; margin-right: auto; }
.cal-links .pill { border: 0; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; }
.why { position: relative; margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: var(--chip); font-size: 14px; }
.why-close {
  position: absolute; top: 2px; right: 2px; width: 36px; height: 36px; border: 0; border-radius: 999px;
  background: none; color: var(--muted); font-size: 15px; cursor: pointer;
}
.why-close:hover { background: var(--chip); color: var(--ink); }
/* Room for the ✕ on the first row only (the reasons' first line, or an F1 qualifying result). */
.why > ul > li:first-child, .why > .result:nth-child(2) { margin-right: 30px; }
.why ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.why li { display: grid; grid-template-columns: 3.4em 1fr; }
.why .pts { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.why .neg .pts { color: var(--muted); }
.why .small { margin-top: 6px; }
.why .result-btn { margin-top: 6px; color: var(--live); }
.why .result {
  margin-top: 10px; padding: 10px; border-radius: 8px; border: 2px solid var(--live);
  background: var(--surface); font-size: 15px;
}
.why .result-text { font-weight: 700; }
.why .goals { margin-top: 6px; gap: 2px; font-size: 14px; font-variant-numeric: tabular-nums; }
.why .goals li { grid-template-columns: 3.6em 2.6em 1fr; } /* 3.6em fits "90+2'" */
.why .goals li span:nth-child(-n+2) { color: var(--muted); }
.why .subs-btn {
  display: block; margin-top: 6px; border: 0; background: none; padding: 6px 0; min-height: 36px;
  color: var(--ink); font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.why .subs { margin-top: 2px; }
.why .subs li { grid-template-columns: 3.6em 1fr; }
.why .subs li span:nth-child(2) { color: var(--ink); }
dialog {
  border: 1px solid var(--line); border-radius: 16px; padding: 20px; max-width: min(92vw, 420px);
  background: var(--surface); color: var(--ink);
}
dialog::backdrop { background: rgb(0 0 0 / 0.5); }
dialog h2 { font-size: 19px; margin-bottom: 10px; }
dialog p { margin-bottom: 8px; color: var(--muted); }
.dlg-buttons { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.dlg-buttons button { min-height: 44px; padding: 0 16px; border-radius: 10px; font-weight: 600; cursor: pointer; }
.dlg-buttons .secondary { border: 1px solid var(--line); background: transparent; }
.dlg-buttons .danger { border: 0; background: var(--accent); color: var(--accent-ink); }
.more {
  display: block; width: 100%; margin-top: 12px; min-height: 48px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer;
}
.foot { margin-top: 28px; font-size: 12.5px; color: var(--muted); display: grid; gap: 4px; }
.share { margin-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.share button {
  min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); font-weight: 600; font-size: 14px; cursor: pointer;
}
/* The install card under the title (like the Substitutor app's). */
.install-card {
  display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 10px 4px 10px 12px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow);
}
.install-card img { flex: none; width: 44px; height: 44px; border-radius: 11px; }
.install-card .grow { flex: 1; min-width: 0; line-height: 1.3; }
.install-card .small { margin-top: 2px; }
.install-go {
  border: 0; border-radius: 999px; padding: 0 18px; min-height: 40px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 15px; cursor: pointer;
}
.install-hide { min-width: 40px; min-height: 40px; border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; }
.steps { margin: 0 0 8px; padding-left: 22px; color: var(--ink); }
.steps li { margin: 10px 0; padding-left: 4px; }
/* Safari's share symbol: a box with an arrow up. */
.share-icon { display: inline-block; position: relative; width: 14px; height: 14px; margin: 0 2px -1px; border: 2px solid var(--accent); border-top-color: transparent; border-radius: 2px; }
.share-icon::before { content: ''; position: absolute; left: 4px; top: -8px; width: 2px; height: 12px; background: var(--accent); }
.share-icon::after { content: ''; position: absolute; left: 1px; top: -8px; width: 6px; height: 6px; border: solid var(--accent); border-width: 2px 0 0 2px; transform: rotate(45deg); }

@media (max-width: 380px) {
  .card { grid-template-columns: 64px 1fr; gap: 10px; }
  .filters .grid { grid-template-columns: 1fr; }
}

/* ─── Glass look (2026-10-10, the owner asked for "iOS glass, like ProQuiz") ───────────────────
   Only with the "Glass look" setting on (body.glass, the default). Frosted, see-through panels (the owner kept the original, smaller corner rounding) over a soft glow that drifts slowly behind everything.
   Real blur (backdrop-filter) only on a few big panels and dialogs; the many cards fake it with a
   translucent fill, a top highlight and a rim, so long lists still scroll smoothly on phones.
   The glow is two fixed layers moved with transform only; prefers-reduced-motion stops it. */
body.glass{
  --glass: rgb(255 255 255 / 0.62); /* the panels' own colour */
  --glass-strong: rgb(255 255 255 / 0.8); /* dialogs and selected controls */
  --glass-edge: rgb(255 255 255 / 0.9); /* rim light around an edge */
  --glass-line: rgb(20 24 33 / 0.08); /* the outer hairline, so white glass shows on a light page */
  --glass-shine: rgb(255 255 255 / 0.95); /* the bright line along the top */
  --glass-shadow: 0 1px 1px rgb(20 24 33 / 0.04), 0 10px 30px rgb(20 24 33 / 0.08);
  --glass-blur: 20px;
  --glow-a: rgb(255 122 47 / 0.32); /* orange, the accent */
  --glow-b: rgb(240 69 127 / 0.22); /* pink, the LIVE colour */
  --glow-c: rgb(56 140 255 / 0.2); /* blue */
  --bg: #f1eee8;
  --chip: rgb(20 24 33 / 0.06);
  --line: rgb(20 24 33 / 0.12);
}
@media (prefers-color-scheme: dark) {
  body.glass{
    --glass: rgb(30 40 64 / 0.5);
    --glass-strong: rgb(34 45 72 / 0.82);
    --glass-edge: rgb(255 255 255 / 0.1);
    --glass-line: rgb(255 255 255 / 0.06);
    --glass-shine: rgb(255 255 255 / 0.16);
    --glass-shadow: 0 12px 34px rgb(0 0 0 / 0.35);
    --glow-a: rgb(255 122 47 / 0.26);
    --glow-b: rgb(240 69 127 / 0.2);
    --glow-c: rgb(56 140 255 / 0.24);
    --bg: #0a0f1c;
    --chip: rgb(255 255 255 / 0.07);
    --line: rgb(255 255 255 / 0.1);
  }
}

/* The glow: drawn at 70% of the screen and scaled up, so the GPU keeps two small pictures. */
body.glass::before,
body.glass::after {
  content: ''; position: fixed; left: 15%; top: 15%; width: 70%; height: 70%;
  z-index: -1; pointer-events: none; will-change: transform;
}
body.glass::before {
  background:
    radial-gradient(30% 34% at 28% 30%, var(--glow-a), transparent 72%),
    radial-gradient(24% 28% at 78% 74%, var(--glow-c), transparent 72%);
  animation: glow-a 52s ease-in-out infinite alternate;
}
body.glass::after {
  background:
    radial-gradient(26% 30% at 72% 22%, var(--glow-b), transparent 72%),
    radial-gradient(22% 26% at 22% 82%, var(--glow-c), transparent 72%);
  animation: glow-b 67s ease-in-out infinite alternate;
}
@keyframes glow-a {
  from { transform: translate3d(-6%, -4%, 0) scale(2.2); }
  50% { transform: translate3d(4%, 5%, 0) scale(2.45); }
  to { transform: translate3d(7%, -5%, 0) scale(2.25); }
}
@keyframes glow-b {
  from { transform: translate3d(5%, 4%, 0) scale(2.3); }
  50% { transform: translate3d(-5%, -3%, 0) scale(2.2); }
  to { transform: translate3d(-3%, 6%, 0) scale(2.5); }
}
@media (prefers-reduced-motion: reduce) {
  body.glass::before, body.glass::after { animation: none; transform: scale(2.3); }
}

/* Glass surfaces. Cards: faked (no blur). */
body.glass .card,
body.glass .views button,
body.glass .chip,
body.glass .share button,
body.glass .more,
body.glass #fav-q {
  background-color: var(--glass);
  background-image: linear-gradient(180deg, rgb(255 255 255 / 0.12), transparent 60%);
  border-color: var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-shine), inset 0 0 0 1px var(--glass-edge), var(--glass-shadow);
}
body.glass .card.soon.live { box-shadow: inset 0 1px 0 var(--glass-shine), inset 0 0 0 1px var(--glass-edge), 0 0 0 1.5px color-mix(in srgb, var(--live) 45%, transparent), var(--glass-shadow); }
body.glass .chip, body.glass .share button { box-shadow: inset 0 1px 0 var(--glass-shine), inset 0 0 0 1px var(--glass-edge); }

/* Real blur: the big panels and the dialogs. */
body.glass .install-card,
body.glass .filters,
body.glass .sports,
body.glass dialog {
  background-color: var(--glass);
  background-image: linear-gradient(180deg, rgb(255 255 255 / 0.14), rgb(255 255 255 / 0.03) 40%, transparent 75%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-shine), inset 0 0 0 1px var(--glass-edge), var(--glass-shadow);
}
body.glass dialog { background-color: var(--glass-strong); }
body.glass dialog::backdrop { background: rgb(0 0 0 / 0.35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* Selected controls: a raised glass "thumb", like iOS segmented controls. */
body.glass .sports button[aria-pressed="true"] {
  background: var(--glass-strong);
  box-shadow: inset 0 1px 0 var(--glass-shine), 0 2px 8px rgb(20 24 33 / 0.12);
}
body.glass .views button[aria-pressed="true"] {
  background-color: var(--ink); color: var(--bg); border-color: transparent;
  background-image: linear-gradient(180deg, rgb(255 255 255 / 0.16), transparent 55%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25), 0 8px 22px rgb(20 24 33 / 0.22);
}
body.glass .chip[aria-pressed="true"] { border-color: var(--accent); }
body.glass .chip[aria-pressed="true"], body.glass .pill.mine, body.glass .install-go, body.glass .dlg-buttons .danger {
  background-color: var(--accent);
  background-image: linear-gradient(180deg, rgb(255 255 255 / 0.22), transparent 60%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.35), 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* The score badge: a glossy tile. */
body.glass .badge {
  background-image: linear-gradient(180deg, rgb(255 255 255 / 0.18), transparent 60%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25);
}
body.glass .card[data-tier="must"] .badge, body.glass .soon.live .badge { box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.4), 0 6px 18px color-mix(in srgb, var(--c, var(--live)) 35%, transparent); }
body.glass .soon.live .badge { --c: var(--live); }

/* Inner panels (line-ups, "Why this score?", filters' dropdowns): a lighter frosted tint. */
body.glass .lineups, body.glass .why, body.glass .calc, body.glass .reveal, body.glass .pill { background-color: var(--chip); }
/* Dropdowns stay solid: the browser draws the open list with the select's colour, and a
   see-through one made it unreadable in dark mode. */
body.glass .filters select, body.glass .filters select option { background-color: var(--surface); color: var(--ink); }
body.glass .pill { box-shadow: inset 0 0 0 1px var(--glass-line); }
/* Dashed outlines (search suggestions, hidden names) keep a visible dash: no glass rim on top of them. */
body.glass #fav-hits .chip, body.glass .reveal {
  border-color: color-mix(in srgb, var(--muted) 55%, transparent);
  box-shadow: none;
}
body.glass .soon:not(.live) .badge { background-image: none; box-shadow: none; } /* the gloss would fill the gaps in the dashed outline */
/* The league row scrolls sideways, which clips anything outside it: room for the selected chip's glow to fade out. */
body.glass .comps { padding-top: 6px; padding-bottom: 18px; margin-top: -8px; margin-bottom: 0; }
