/* SnookerStation web product — STRUCTURE (WEB_PRODUCT_v0_2). Loaded after theme.css, which holds every colour.
   Rules this file keeps, each checked by render.mjs:
   - no colour literal here: only var(--token), transparent and currentColor;
   - mobile first: the base is a 360 px phone; wider screens add columns in the min-width blocks at the end;
   - running text is 16 px or more; only labels (.lbl, .tag, .chip, th) are smaller;
   - every link, button and input is at least 44 x 44 px;
   - EDGES: a box's line is a real border, never a clip. The cut corners are a mask over two corners only, and the
     diagonal across each cut is painted. (v0.1 cut corners with clip-path over a border: the diagonal had no line,
     and a box whose height was not a whole pixel lost its bottom or right line.)
   Pictures of the design, not code to ship. */

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page-bg) var(--page); background-color: var(--page); color: var(--text); font: 500 1rem/1.45 var(--font-ui); -webkit-font-smoothing: antialiased; min-height: 100vh; padding-bottom: 4.5rem; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: var(--link); text-decoration: none; }
a, button, summary { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; justify-content: center; }
input, select { font: inherit; color: inherit; min-height: 44px; }
:focus { outline: none; }
:focus-visible { box-shadow: var(--focus-ring); }
[hidden] { display: none !important; }
.tnum { font-variant-numeric: tabular-nums; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dim { color: var(--text-dim); } .faint { color: var(--text-faint); }
svg.ic { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 3; stroke-linejoin: miter; stroke-linecap: square; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- the box: a real border, two cut corners by mask, the diagonals painted ---------- */
.box, .btn, .tag, .chip, .seg > button, .field, .pick, .padb {
  --c: var(--cut-md); --frame: var(--edge); --fill: var(--fill-card);
  border: var(--bw) solid var(--frame);
  background:
    linear-gradient(135deg, var(--frame) calc(var(--c) * .7071 + 1.5px), transparent 0) border-box,
    linear-gradient(315deg, var(--frame) calc(var(--c) * .7071 + 1.5px), transparent 0) border-box,
    var(--fill) border-box;
  -webkit-mask: linear-gradient(135deg, transparent calc(var(--c) * .7071), var(--solid) 0), linear-gradient(315deg, transparent calc(var(--c) * .7071), var(--solid) 0);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
.box:focus-visible, .btn:focus-visible, .pick:focus-visible, .padb:focus-visible, .seg > button:focus-visible { box-shadow: none; --frame: var(--edge-accent); border-width: var(--bw-strong); }

/* ---------- labels: the only text under 16 px ---------- */
.lbl { font: 600 .75rem/1.2 var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); }
.tag, .chip { --c: var(--cut-xs); --frame: var(--edge-quiet); --fill: var(--fill-tag); display: inline-flex; align-items: center; gap: .375rem; padding: .25rem .5rem; font: 600 .75rem/1.2 var(--font-display); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; color: var(--text-dim); }
.chip--live { --frame: var(--edge-live); --fill: var(--fill-live); color: var(--live); }
.chip--ok { --frame: var(--edge-live); color: var(--live); }
.chip--warn { --frame: var(--edge-warn); --fill: var(--fill-warn); color: var(--warn); }
.chip--accent { --frame: var(--edge-accent); --fill: var(--fill-accent-soft); color: var(--accent-text); }
.chip--soon { --frame: var(--edge-accent); --fill: var(--fill-accent-soft); color: var(--accent-text); }
.dot { width: .5rem; height: .5rem; background: currentColor; flex: none; }
.chip--live .dot { animation: pulse 1.2s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .35; } to { opacity: 1; } }
.rec { color: var(--danger); } .rec .dot { border-radius: 50%; }

/* ---------- mock-up chrome (not product; the checks skip it) ---------- */
.sample { background: var(--fill-accent-soft); color: var(--accent-text); font: 600 .75rem/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; text-align: center; padding: .5rem 1rem; border-bottom: 1px solid var(--gold-600); }
.proto { background: var(--panel-850); color: var(--text-dim); padding: .5rem 1rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--edge-dim); }
.proto span { font: 600 .6875rem/1 var(--font-display); letter-spacing: .1em; text-transform: uppercase; }
.proto button { min-height: 1.75rem; min-width: 0; padding: .125rem .5rem; font-size: .8125rem; border: 1px solid var(--edge-dim); background: var(--panel-700); }
.proto button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* ---------- header, the phone's tab bar, footer ---------- */
.hdr { position: sticky; top: 0; z-index: 10; background: var(--bar-bg); border-bottom: 1px solid var(--hairline); }
.hdr__in { max-width: 75rem; margin: 0 auto; padding: .25rem 1rem; display: flex; align-items: center; gap: .5rem; min-height: 3.25rem; }
.brand { flex-direction: column; align-items: flex-start; justify-content: center; color: inherit; }
.wm { display: inline-flex; transform: skewX(-6deg); transform-origin: left bottom; font: italic 700 1.375rem/.9 var(--font-display); text-transform: uppercase; white-space: nowrap; }
.wm b { color: var(--gold-300); font-weight: 700; } .wm i { color: var(--emerald-300); font-style: inherit; }
.wm-bar { height: 3px; width: 100%; margin-top: 4px; background: linear-gradient(90deg, var(--gold-400) 0 47%, var(--emerald-500) 47% 100%); }
.sp { flex: 1; }
.hdr .nav { display: none; }
.hdr .me { padding: 0 .625rem; white-space: nowrap; font: 700 1rem/1 var(--font-title); letter-spacing: .04em; text-transform: uppercase; color: var(--text); border: 1px solid var(--edge-quiet); gap: .5rem; }
.hdr .me .dot { color: var(--live); }
.lang { display: inline-flex; border: 1px solid var(--stale); }
.lang button { padding: 0 .625rem; font: 600 .75rem/1 var(--font-display); letter-spacing: .1em; color: var(--text-dim); }
.lang button[aria-pressed="true"] { background: var(--emerald-700); color: var(--text); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--bar-bg); border-top: 1px solid var(--edge); }
.tabbar a { flex-direction: column; justify-content: center; gap: .125rem; min-height: 3.5rem; color: var(--text-dim); font: 600 .75rem/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase; }
.tabbar a[aria-current="page"] { color: var(--text); box-shadow: inset 0 3px 0 var(--accent); }
.tabbar svg.ic { width: 1.375rem; height: 1.375rem; }
.subnav { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--hairline); padding: 0 1rem; max-width: 75rem; margin: 0 auto; }
.subnav a { flex: none; padding: 0 .75rem; font: 600 1rem/1 var(--font-title); letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); white-space: nowrap; }
.subnav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); }
.ftr { max-width: 75rem; margin: 2.5rem auto 0; padding: 1rem 1rem 1.5rem; color: var(--text-faint); border-top: 1px solid var(--hairline); display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; align-items: center; }
.ftr p { flex-basis: 100%; }
.ftr a { color: var(--text-dim); }

/* ---------- page ---------- */
main { max-width: 75rem; margin: 0 auto; padding: 1rem 1rem 0; }
main.narrow { max-width: 34rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: 0 .25rem; align-items: center; color: var(--text-faint); margin: -.5rem 0 .25rem; }
.crumbs a { color: var(--text-dim); padding-right: .5rem; }
.h1 { font: 700 2rem/1 var(--font-title); text-transform: uppercase; letter-spacing: .01em; }
.h1::after { content: ""; display: block; width: 3.5rem; height: 3px; margin-top: .5rem; background: var(--accent); }
.sub { color: var(--text-dim); margin: .5rem 0 1rem; }
.sec { margin-top: 1.75rem; }
.sec__head { display: flex; align-items: center; gap: .625rem; margin-bottom: .625rem; min-height: 44px; }
.sec__head::before { content: ""; width: .3125rem; height: 1.375rem; background: var(--accent); flex: none; }
.sec__title { font: 700 1.375rem/1 var(--font-title); text-transform: uppercase; }
.sec__head .more { margin-left: auto; padding-left: .75rem; font: 600 1rem/1 var(--font-title); letter-spacing: .04em; text-transform: uppercase; }
.note { color: var(--text-dim); margin-top: .5rem; }
.stack > * + * { margin-top: .625rem; }
.cols { display: grid; gap: .75rem; }
.asof { display: flex; flex-wrap: wrap; gap: .375rem; align-items: center; color: var(--text-faint); margin-top: .5rem; }

/* ---------- cards ---------- */
.card { padding: .875rem 1rem; display: block; color: inherit; }
.card--hi { --frame: var(--edge-live); --fill: var(--fill-card-hi); }
.card--warn { --frame: var(--edge-warn); }
.card--accent { --frame: var(--edge-accent); }
.card__title { font: 700 1.25rem/1.1 var(--font-title); text-transform: uppercase; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.card__title .chip, .card__title .tag { margin-left: auto; }
.banner { --frame: var(--edge-warn); --fill: var(--fill-warn); --c: var(--cut-sm); padding: .75rem 1rem; display: flex; gap: .625rem; align-items: flex-start; color: var(--text-2); }
.banner--info { --frame: var(--edge-live); --fill: var(--fill-live); }
.banner svg.ic { margin-top: .2em; color: var(--warn); } .banner--info svg.ic { color: var(--live); }

/* live card and event card: the whole card is the link */
.lc { --frame: var(--edge-live); padding: .75rem 1rem; display: block; color: inherit; }
.lc__top { display: flex; align-items: center; gap: .5rem; min-height: 1.5rem; }
.lc__top .chip, .lc__top .rec { margin-left: auto; }
.lc__row { display: grid; grid-template-columns: minmax(0, 1fr) 2rem 2.5rem; gap: .5rem; align-items: baseline; margin-top: .375rem; font: 700 1.375rem/1.15 var(--font-title); }
.lc__row .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc__row .f { color: var(--accent-text); text-align: right; font-variant-numeric: tabular-nums; }
.lc__row .p { font: 600 1rem/1 var(--font-ui); color: var(--text-dim); text-align: right; font-variant-numeric: tabular-nums; }
.lc__foot { margin-top: .5rem; color: var(--text-dim); display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.ec { padding: .75rem 1rem; display: block; color: inherit; }
.ec__top { display: flex; align-items: center; gap: .5rem; } .ec__top .chip { margin-left: auto; }
.ec__name { font: 700 1.375rem/1.05 var(--font-title); text-transform: uppercase; margin: .375rem 0 .25rem; }
.ec__meta { color: var(--text-dim); }

/* rows that are links: a list where every row is one 44 px target */
.rows { border: 1px solid var(--edge); background: var(--fill-card); }
.rows > li + li, .rows > a + a, .rows > div + div { border-top: 1px solid var(--hairline); }
.rowlink { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .125rem .75rem; align-items: center; padding: .5rem .875rem; min-height: 3.25rem; color: var(--text); width: 100%; }
.rowlink b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowlink .s { grid-column: 1; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowlink .r { grid-row: 1 / span 2; grid-column: 2; justify-self: end; text-align: right; }
.rowlink .v { font: 700 1.375rem/1 var(--font-title); font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .375rem 1rem; }
.kv dt { color: var(--text-faint); } .kv dd { font-variant-numeric: tabular-nums; }

/* ---------- buttons, fields ---------- */
.btn { --c: var(--cut-sm); --frame: var(--edge-quiet); --fill: var(--fill-secondary); justify-content: center; text-align: center; gap: .5rem; min-height: 3rem; padding: 0 1.125rem; font: 700 1.0625rem/1 var(--font-title); letter-spacing: .05em; text-transform: uppercase; color: var(--text); }
.btn--primary { --frame: var(--gold-600); --fill: var(--fill-primary); color: var(--on-accent); }
.btn--danger { --frame: var(--edge-danger); --fill: var(--fill-danger); }
.btn--ghost { --frame: var(--edge-dim); --fill: transparent; color: var(--link); }
.btn--wide { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }
.form > * + * { margin-top: .875rem; }
.form label { display: block; font-weight: 600; margin-bottom: .375rem; }
.field { --c: var(--cut-sm); --frame: var(--edge-quiet); --fill: var(--fill-inset); display: flex; align-items: center; padding: 0 .75rem; min-height: 3rem; }
.field input { background: none; border: 0; width: 100%; min-width: 0; }
.field input::placeholder { color: var(--text-faint); }
.check { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); gap: .625rem; align-items: start; padding: .5rem 0; min-height: 44px; width: 100%; text-align: left; justify-content: start; }
.check .bx { width: 1.75rem; height: 1.75rem; border: 2px solid var(--edge-quiet); background: var(--fill-inset); display: inline-flex; align-items: center; justify-content: center; color: var(--on-accent); }
.check[aria-checked="true"] .bx { background: var(--accent); border-color: var(--accent); }
.check .bx svg.ic { width: 1.125rem; height: 1.125rem; stroke-width: 5; opacity: 0; } .check[aria-checked="true"] .bx svg.ic { opacity: 1; }
.seg { display: flex; gap: .25rem; flex-wrap: wrap; }
.seg > button { --c: var(--cut-sm); --frame: var(--edge-quiet); --fill: var(--fill-inset); padding: 0 .875rem; font-weight: 600; color: var(--text-dim); min-width: 3.5rem; }
.seg > button[aria-checked="true"], .seg > button[aria-pressed="true"] { --frame: var(--edge-live); --fill: var(--fill-on); color: var(--text); }
.opts > * + * { margin-top: .5rem; }
.pick { --c: var(--cut-sm); --frame: var(--edge-quiet); --fill: var(--fill-inset); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .125rem .75rem; align-items: center; padding: .625rem .875rem; min-height: 3.25rem; width: 100%; text-align: left; color: var(--text); }
.pick[aria-selected="true"], .pick[aria-checked="true"] { --frame: var(--edge-accent); --fill: var(--focus-fill); border-width: var(--bw-strong); }
.pick .s { grid-column: 1 / -1; color: var(--text-dim); font-weight: 500; }
.fine { color: var(--text-faint); }

/* ---------- score, the live log, frames ---------- */
.score { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem 1rem; align-items: end; }
.score .name { font: 700 1.25rem/1.1 var(--font-title); min-width: 0; overflow-wrap: anywhere; }
.score .name.r, .score .pts.r { text-align: right; }
.score .pts { font: 700 3.25rem/1 var(--font-title); font-variant-numeric: tabular-nums; }
.score .mid { grid-column: 1 / -1; display: flex; justify-content: center; gap: .75rem; align-items: center; flex-wrap: wrap; margin-top: .25rem; }
.score .frames { font: 700 1.5rem/1 var(--font-title); padding: .25rem .75rem; border: 1px solid var(--edge); font-variant-numeric: tabular-nums; }
.score .brk b { color: var(--accent-text); font: 700 1.5rem/1 var(--font-title); }
.attable { display: inline-block; width: .75rem; height: .75rem; background: var(--accent); margin-right: .375rem; }
.ball { width: 1.75rem; height: 1.75rem; flex: none; display: inline-flex; align-items: center; justify-content: center; font: 700 1rem/1 var(--font-title); color: var(--ball-ink); border: 1px solid var(--ball-rim); border-radius: 50%; }
.ball[data-v="1"] { background: var(--ball-1); } .ball[data-v="2"] { background: var(--ball-2); color: var(--ball-ink-dark); } .ball[data-v="3"] { background: var(--ball-3); } .ball[data-v="4"] { background: var(--ball-4); } .ball[data-v="5"] { background: var(--ball-5); } .ball[data-v="6"] { background: var(--ball-6); } .ball[data-v="7"] { background: var(--ball-7); }
.ball[data-v="foul"] { background: none; border: 2px solid var(--warn); color: var(--warn); border-radius: 0; width: auto; padding: 0 .375rem; }
.ball[data-v="end"] { background: none; border: 1px dashed var(--stale); color: var(--stale); border-radius: 0; }
.log > li { padding: .625rem 0; border-top: 1px solid var(--hairline); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .375rem .75rem; align-items: center; }
.log > li:first-child { border-top: 0; }
.log .who { font: 700 1.125rem/1.1 var(--font-title); }
.log .brk { font: 700 1.25rem/1 var(--font-title); font-variant-numeric: tabular-nums; color: var(--text-2); }
.log .balls { grid-column: 1 / -1; display: flex; gap: .25rem; flex-wrap: wrap; align-items: center; }
.log .ev { color: var(--warn); } .log .ev.he { color: var(--live); }
.log .now { background: var(--fill-now); box-shadow: inset 4px 0 0 var(--accent); padding-left: .625rem; margin-left: -.625rem; padding-right: .625rem; margin-right: -.625rem; }
.log .now .brk { color: var(--accent-text); }
.fline { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: .125rem .625rem; align-items: center; padding: .5rem .875rem; min-height: 3.25rem; color: var(--text); width: 100%; }
.fline .no { font: 700 1.25rem/1 var(--font-title); color: var(--text-faint); grid-row: 1 / span 2; }
.fline .sc { font: 700 1.25rem/1 var(--font-title); font-variant-numeric: tabular-nums; grid-row: 1 / span 2; grid-column: 3; }
.fline .s { grid-column: 2; color: var(--text-faint); }

/* the stream box: nothing of YouTube's loads before the press */
.yt { aspect-ratio: 16 / 9; border: 1px solid var(--edge); background: var(--fill-glass); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; text-align: center; padding: .75rem; }
.yt .play { width: 4rem; height: 4rem; min-height: 4rem; background: var(--accent); color: var(--on-accent); justify-content: center; border-radius: 50%; }
.yt .play svg.ic { width: 1.75rem; height: 1.75rem; }

/* ---------- tables: narrow first; .opt columns appear from 600 px ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: .625rem .375rem; border-top: 1px solid var(--hairline); vertical-align: middle; }
.tbl thead th { border-top: 0; font: 600 .75rem/1 var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); white-space: nowrap; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .pos { width: 1.75rem; font: 700 1.125rem/1 var(--font-title); color: var(--text-faint); }
.tbl .pts { font: 700 1.25rem/1 var(--font-title); color: var(--accent-text); }
.tbl .opt { display: none; }
.tbl tr.cut td { border-bottom: 2px solid var(--gold-600); }
.tbl tr.me td { background: var(--fill-live); }
.tbl .wd { text-decoration: line-through; color: var(--text-faint); }
.tbl td a { color: var(--text); font-weight: 600; }
.tbl tr.detail td { border-top: 0; padding-top: 0; color: var(--text-dim); }
.hs { color: var(--stale); white-space: nowrap; }
.scroller { overflow-x: auto; }

/* ---------- ranking lists (the station's RankingList, narrow first) ---------- */
.rk > li + li { border-top: 1px solid var(--hairline); }
.rk a, .rk .row { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: 0 .625rem; align-items: center; padding: .5rem .875rem; min-height: 3.5rem; color: var(--text); width: 100%; }
.rk .pos { font: 700 1.25rem/1 var(--font-title); color: var(--text-faint); grid-row: 1 / span 2; }
.rk .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk .s { grid-column: 2; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk .v { grid-row: 1 / span 2; grid-column: 3; text-align: right; font: 700 1.625rem/1 var(--font-title); font-variant-numeric: tabular-nums; }
.rk .v small { display: block; font: 600 1rem/1.2 var(--font-ui); }
.up { color: var(--up); } .down { color: var(--down); }
.rk .band { padding: .5rem .875rem; background: var(--fill-tile); }
.rk--top .pos { color: var(--accent-text); }

/* ---------- bracket: one round at a time on a phone ---------- */
.round-nav { display: flex; gap: .5rem; align-items: center; margin-bottom: .625rem; }
.round-nav .cur { flex: 1; text-align: center; font: 700 1.125rem/1 var(--font-title); text-transform: uppercase; }
.round { display: none; } .round[data-active] { display: block; }
.round__title { display: none; }
.fix { --c: var(--cut-sm); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .125rem .75rem; padding: .625rem .875rem; color: inherit; width: 100%; min-height: 4.5rem; }
.fix + .fix { margin-top: .5rem; }
.fix .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .fix .n.w { font-weight: 700; }
.fix .sc { font: 700 1.125rem/1.3 var(--font-title); text-align: right; font-variant-numeric: tabular-nums; }
.fix .meta { grid-column: 1 / -1; color: var(--text-faint); display: flex; gap: .5rem; align-items: center; }
.fix--live { --frame: var(--edge-live); }

/* ---------- the station's player page blocks: glass sections, stat tiles, the rating block, charts ---------- */
.glass { border: 1px solid var(--edge-glass); background: var(--fill-glass); padding: .875rem; }
.glass + .glass { margin-top: 1rem; }
.glass__h { display: flex; align-items: center; gap: .625rem; font: 700 1.375rem/1 var(--font-title); text-transform: uppercase; margin-bottom: .75rem; flex-wrap: wrap; }
.glass__h::before { content: ""; width: .25rem; height: 1.25rem; background: var(--accent); flex: none; }
.glass__h .chip, .glass__h .tag { margin-left: auto; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.tile { background: var(--fill-tile); border: 1px solid var(--edge-dim); border-left: 3px solid var(--emerald-500); padding: .625rem .75rem; }
.tile .v { font: 700 2rem/1 var(--font-title); font-variant-numeric: tabular-nums; margin: .375rem 0 .25rem; }
.tile p { color: var(--text-dim); }
.tile--wide { grid-column: 1 / -1; }
.rating { display: flex; align-items: baseline; gap: .625rem; flex-wrap: wrap; }
.rating .game { font: 600 1rem/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--live); }
.rating .n { font: 700 2.5rem/1 var(--font-title); font-variant-numeric: tabular-nums; }
.rating .prov { color: var(--accent-text); }
.hist > li { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: .125rem .5rem; padding: .5rem 0; border-top: 1px solid var(--hairline); }
.hist .d { color: var(--text-faint); font-variant-numeric: tabular-nums; }
.chart { display: block; width: 100%; height: auto; margin-top: .5rem; }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .line { fill: none; stroke: var(--chart-1); stroke-width: 3; stroke-linejoin: round; }
.chart .line2 { fill: none; stroke: var(--chart-2); stroke-width: 3; stroke-linejoin: round; }
.chart .prov { stroke-dasharray: 2 6; opacity: .7; }
.chart .area { fill: var(--chart-1-fill); }
.chart .pt { fill: var(--chart-1); } .chart .pt2 { fill: var(--chart-2); }
.chart .ring { fill: none; stroke: var(--accent); stroke-width: 3; }
.chart .band-a { fill: var(--chart-band-a); } .chart .band-b { fill: var(--chart-band-b); }
.chart text { fill: var(--text-dim); font: 600 34px var(--font-ui); }
.chart text.val { fill: var(--text); font: 700 40px var(--font-title); }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.legend i { display: inline-block; width: 1rem; height: .25rem; margin-right: .375rem; vertical-align: middle; background: var(--chart-1); } .legend i.two { background: var(--chart-2); }
.clubsplit > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .125rem .75rem; padding: .625rem 0; border-top: 1px solid var(--hairline); align-items: center; }
.clubsplit > li:first-child { border-top: 0; }
.clubsplit .v { font: 700 1.5rem/1 var(--font-title); font-variant-numeric: tabular-nums; grid-row: 1 / span 2; grid-column: 2; text-align: right; }
.clubsplit .s { color: var(--text-faint); }

/* ---------- account: the station's settings shape ---------- */
.idx { display: flex; overflow-x: auto; border: 1px solid var(--edge-glass); background: var(--fill-glass); }
.idx a { padding: 0 .875rem; white-space: nowrap; color: var(--text-dim); font-weight: 600; }
.idx a[aria-current="true"] { color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); background: var(--fill-live); }
.idx a.danger { color: var(--danger); }
.srows { border: 1px solid var(--edge-glass); background: var(--fill-glass); padding: 0 .875rem; }
.srow { padding: .875rem 0; border-top: 1px solid var(--hairline); display: grid; gap: .5rem; }
.srow:first-child { border-top: 0; }
.srow .help { color: var(--text-dim); font-weight: 400; }
.srow b.lab { font-weight: 600; }
.ro { border: 1px dashed var(--edge-quiet); padding: .25rem .5rem; justify-self: start; }
.conn { padding: .875rem 1rem; }
.conn b { font: 700 1.25rem/1.1 var(--font-title); display: block; }
.conn .chip { margin: .375rem 0; }
.conn--ok { --frame: var(--edge-live); } .conn--wait { --frame: var(--edge-quiet); } .conn--no { --frame: var(--edge-warn); }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .25rem; counter-reset: s; margin-bottom: 1rem; }
.steps li { counter-increment: s; padding-top: .375rem; border-top: 3px solid var(--edge); font: 600 .75rem/1.2 var(--font-display); letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.steps li::before { content: counter(s) " "; }
.steps li[data-done] { border-color: var(--emerald-500); color: var(--text-dim); }
.steps li[aria-current="step"] { border-color: var(--accent); color: var(--text); }
.qr { width: 8rem; height: 8rem; flex: none; background: conic-gradient(from 90deg at 25% 25%, var(--ink-100) 25%, var(--hall-900) 0 50%, var(--ink-100) 0 75%, var(--hall-900) 0) 0 0 / 1rem 1rem, var(--ink-100); border: .5rem solid var(--ink-100); }
.state-h { display: inline-block; margin-bottom: .375rem; color: var(--accent-text); border: 1px dashed var(--gold-600); padding: .25rem .5rem; }

/* ---------- "Coming soon" ---------- */
.soon { --frame: var(--edge-accent); --fill: var(--fill-accent-soft); padding: .875rem 1rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem .75rem; align-items: center; }
.soon b { font: 700 1.25rem/1.1 var(--font-title); text-transform: uppercase; }
.soon p { grid-column: 1 / -1; color: var(--text-dim); }

/* ---------- the front page's hero: a poster first, then the film over it (FRONT_PAGE_FILM_v0_1.md) ---------- */
.hero { position: relative; overflow: hidden; background: var(--page); border-bottom: 1px solid var(--edge); height: 15.5rem; }
.hero picture, .hero img, .hero video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; display: block; }
.hero video { opacity: 0; transition: opacity .6s linear; } .hero video[data-on] { opacity: 1; }
/* the hall's air, as on the station's menu (snooker-app menu.css, "optional atmosphere"): rays that breathe, fog that drifts,
   dust that falls. Nothing is fetched or moved until the film has ended (.hero[data-rest]); transform and opacity only. */
.hero__air { position: absolute; inset: 0; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity 1.6s linear; }
.hero[data-rest] .hero__air { opacity: 1; }
.air { position: absolute; will-change: transform, opacity; }
.hero[data-rest] .air--rays { inset: 0; background: url(img/rays.png) center / cover no-repeat; animation: air-breathe 9s ease-in-out infinite alternate; }
.hero[data-rest] .air--fog { left: 0; top: 0; width: 3840px; height: 100%; background: url(img/fog.png) 0 0 / 1920px 100% repeat-x; animation: air-drift 150s linear infinite; }
.hero[data-rest] .air--f2 { top: 8%; opacity: .55; animation-duration: 230s; animation-direction: reverse; }
.hero[data-rest] .air--dust { left: -1024px; top: -1024px; width: 3968px; height: 3128px; background: url(img/dust-far.png) 0 0 / 1024px 1024px repeat; animation: air-fall 120s linear infinite; }
.hero[data-rest] .air--near { background-image: url(img/dust-near.png); animation: air-fall 70s linear infinite, air-twinkle 6s ease-in-out infinite alternate; }
@keyframes air-breathe { from { opacity: .6; } to { opacity: 1; } }
@keyframes air-drift { to { transform: translate3d(-1920px, 0, 0); } }
@keyframes air-fall { to { transform: translate3d(1024px, 1024px, 0); } }
@keyframes air-twinkle { from { opacity: .55; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hero__air { display: none; } }
.hero__shade { position: absolute; inset: 0; background: var(--hero-shade); transform: scaleY(-1); }   /* on a phone the words are at the top, over the dark hall: the shade is deepest there */
.hero__in { position: absolute; left: 0; right: 0; top: 0; max-width: 75rem; margin: 0 auto; padding: .875rem 1rem 0; }
.hero h1 { font: 700 2.25rem/.95 var(--font-title); text-transform: uppercase; }
.hero h1 em { font-style: normal; color: var(--accent-text); }
.hero .lead { display: none; color: var(--text-2); margin-top: .5rem; max-width: 30rem; }
.hero .btn { margin-top: .625rem; }
.chips { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; }
.chips a { flex: none; padding: 0 .875rem; border: 1px solid var(--edge); background: var(--fill-card); color: var(--text); font-weight: 600; gap: .5rem; }
.chips a .dot { color: var(--live); }
.hdr .find-link { width: 44px; justify-content: center; color: var(--text); border: 1px solid var(--edge-quiet); }
.find { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }

/* ---------- scoring on a phone ---------- */
.sb { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.sb .side { padding: .625rem .75rem; text-align: center; }
.sb .side[data-at] { --frame: var(--edge-accent); --fill: var(--fill-card-hi); border-width: var(--bw-strong); }
.sb .nm { font: 700 1.125rem/1.1 var(--font-title); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb .pt { font: 700 3.5rem/1 var(--font-title); font-variant-numeric: tabular-nums; }
.sb .fr { color: var(--text-dim); }
.statusline { display: flex; justify-content: space-between; gap: .5rem; align-items: center; flex-wrap: wrap; padding: .5rem 0; }
.statusline b { font: 700 1.25rem/1 var(--font-title); color: var(--accent-text); }
.pad { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.padb { --c: var(--cut-sm); --frame: var(--edge-quiet); --fill: var(--fill-secondary); min-height: 4rem; flex-direction: column; gap: .125rem; font: 700 1.125rem/1 var(--font-title); letter-spacing: .03em; text-transform: uppercase; color: var(--text); }
.padb .ball { width: 2.25rem; height: 2.25rem; font-size: 1.125rem; }
.padb[aria-disabled="true"] { --frame: var(--edge-quiet); color: var(--text-faint); } .padb[aria-disabled="true"] .ball { opacity: .3; }
.padb--on { --frame: var(--edge-accent); border-width: var(--bw-strong); }
.padb--wide { grid-column: span 2; }
.padb--warn { --frame: var(--edge-warn); color: var(--warn); }
.clock { text-align: center; padding: .5rem; }
.clock .t { font: 700 4.5rem/1 var(--font-title); font-variant-numeric: tabular-nums; color: var(--accent-text); }
.clock .bar { height: .5rem; background: var(--fill-inset); border: 1px solid var(--edge-dim); margin-top: .375rem; }
.clock .bar i { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(.4); }
.clock--low .t { color: var(--danger); } .clock--low .bar i { background: var(--danger); }
.ondevice { display: flex; gap: .5rem; align-items: center; color: var(--text-dim); padding: .5rem 0; }

/* ---------- wider screens ---------- */
@media (min-width: 600px) {
  .tbl .opt { display: table-cell; }
  .tbl tr.detail { display: none; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hist > li { grid-template-columns: 6.5rem minmax(0, 1fr); }
}
@media (min-width: 720px) {
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .hdr .nav { display: flex; gap: .25rem; }
  .hdr .nav a { padding: 0 .75rem; font: 600 1rem/1 var(--font-title); letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); }
  .hdr .nav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); }
  .wm { font-size: 1.75rem; }
  main { padding-top: 1.5rem; }
  .h1 { font-size: 2.5rem; }
  .cols--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols--main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
  .cols--main-r { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; }
  .stack-md > * + * { margin-top: 0; }
  .score { grid-template-columns: 1fr auto 1fr; }
  .score .mid { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; }
  .score .name { font-size: 1.5rem; grid-row: 1; } .score .name.r { grid-column: 3; } .score .pts { font-size: 4rem; grid-row: 2; } .score .pts.r { grid-column: 3; }
  .log > li { grid-template-columns: 8rem minmax(0, 1fr) auto; } .log .balls { grid-column: 2; grid-row: 1; } .log .brk { grid-column: 3; }
  .round-nav { display: none; }
  .bracket { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(15rem, 1fr); gap: 1rem; }
  .round, .round[data-active] { display: flex; flex-direction: column; justify-content: space-around; }
  .round__title { display: block; font: 700 1.125rem/1 var(--font-title); text-transform: uppercase; color: var(--text-dim); margin-bottom: .625rem; }
  .rk a, .rk .row { grid-template-columns: 2.5rem minmax(0, 2fr) minmax(0, 3fr) auto; }
  .rk .s { grid-column: 3; grid-row: 1 / span 2; } .rk .pos, .rk .v { grid-row: 1; } .rk .v { grid-column: 4; }
  .rk .v small { display: inline; margin-left: .5rem; }
  .acct { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
  .idx { flex-direction: column; position: sticky; top: 4.5rem; overflow: visible; }
  .idx a[aria-current="true"] { box-shadow: inset 4px 0 0 var(--accent); }
  .srow { grid-template-columns: minmax(0, 18rem) minmax(0, 1fr) auto; gap: .75rem 1.5rem; align-items: center; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tiles--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .glass { padding: 1.25rem; }
  .hero { height: min(62vh, 36rem); }
  .hero img, .hero video { object-position: 50% 50%; }
  .hero__shade { transform: none; }
  .hero__in { top: auto; bottom: 0; padding: 0 1rem 2.5rem; }
  .hero h1 { font-size: 4.5rem; } .hero .lead { display: block; font-size: 1.25rem; }
  .ftr p { flex-basis: auto; margin-right: auto; }
}
