/* The Games page (public/js/views/games.js): tiles that fill their row, games still to play, and one club's schedule.
   Colours are the site's tokens (site.css), so the light and dark themes both read; a club's chip is tcVars (--tc). */

/* Every club: the tiles fill the row (no empty columns beside a day of two games), at least 280 px each. */
.games-directory .matchup-grid { display: flex; flex-wrap: wrap; gap: 12px; }
main.content-pages .games-directory .matchup-grid { gap: 12px; }
.games-directory .matchup-grid > .score { flex: 1 1 280px; min-width: min(100%, 280px); }
main.content-pages .games-directory .score:is(.scheduled,.today,.pending) { border-top-style: dashed; }
main.content-pages .games-directory .score.today { border-top-color: var(--brand); border-top-style: solid; }
.games-directory .score.today .st, .games-directory .score.scheduled .st { color: var(--text-2); }
main.content-pages .games-directory .score.is-live { border-top-color: var(--wrong); border-top-style: solid; }
.games-directory .score.is-live .st, .ts-status.is-live { color: var(--wrong); font-weight: 700; }
.games-directory .score.is-live .st::before, .ts-status.is-live::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--wrong); margin-right: 6px; vertical-align: 1px; }
/* A final from the live feed, before the refresh loads the game (views/games.js liveWords): grey, as the game page's FINAL badge
   (audit 2026-11-08: the list's green "FINAL · LIVE FEED" read as a game still on). Live is the only coloured state. */
main.content-pages .games-directory .score.feed-final { border-top-color: var(--final-grey, #4b5563); border-top-style: solid; }
.games-directory .score.feed-final .st, .ts-status.feed-final { color: var(--text-2); font-weight: 700; }
.games-directory .score.feed-final .st::before, .ts-status.feed-final::before { content: ''; display: inline-block; width: 7px; height: 7px; background: var(--final-grey, #4b5563); margin-right: 6px; vertical-align: 1px; }
:root[data-theme="dark"] .games-directory .score.feed-final, :root[data-theme="dark"] .ts-status.feed-final { --final-grey: #9ca3af; }
.games-block { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 26px 0 0; padding-bottom: 6px; border-bottom: 2px solid var(--border-strong); }
.games-block + .section { margin-top: 12px; }

/* ---------- one club's schedule ---------- */
.ts-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--tc, var(--border-strong)); }
.ts-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ts-chip { flex: 0 0 auto; display: inline-grid; place-items: center; min-width: 54px; height: 54px; padding: 0 6px; background: var(--tc, var(--muted)); color: var(--surface); font-weight: 800; font-size: .95rem; letter-spacing: .04em; }
.ts-name { margin: 0 0 3px; font-size: 1.35rem; line-height: 1.15; overflow-wrap: anywhere; }
.ts-kpis { display: flex; flex-wrap: wrap; gap: 0; flex: 1 1 420px; border: 1px solid var(--border); }
.ts-kpi { flex: 1 1 88px; display: grid; gap: 3px; padding: 8px 10px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 0 -1px -1px 0; background: var(--surface-2); }
.ts-k { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ts-v { font-size: 1.15rem; font-variant-numeric: tabular-nums; color: var(--text); }

.ts-next { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 16px; margin-top: 12px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--tc, var(--border-strong)); color: var(--text); text-decoration: none; }
.ts-next:hover, .ts-next:focus-visible { border-color: var(--text); border-left-color: var(--tc, var(--text)); background: var(--surface-2); text-decoration: none; color: var(--text); }
.ts-next .ts-k { grid-column: 1; }
.ts-next-line { grid-column: 1; font-size: 1.2rem; overflow-wrap: anywhere; }
.ts-next-when { grid-column: 1; color: var(--text-2); font-size: .9rem; }
.ts-next-go { grid-column: 2; grid-row: 1 / span 3; font-weight: 700; color: var(--link); white-space: nowrap; }

.ts-lists { display: grid; grid-template-columns: minmax(0, 1fr); }
.ts-block { margin-top: 22px; min-width: 0; }
.ts-block .section-head { margin-bottom: 8px; }
.ts-list { border: 1px solid var(--border); background: var(--surface); }
.ts-cols, .ts-row { display: grid; grid-template-columns: 8.5em minmax(0, 1fr) auto 4.2em; align-items: center; gap: 10px; padding: 0 12px; }
.ts-up { grid-template-columns: 8.5em minmax(0, 1fr) auto; }
.ts-cols { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-bottom: 5px; }
.ts-cols span:nth-child(n+3) { text-align: right; }
.ts-row { min-height: 46px; border-top: 1px solid var(--border); color: var(--text); text-decoration: none; font-variant-numeric: tabular-nums; }
.ts-row:hover, .ts-row:focus-visible { background: var(--row-hover); color: var(--text); text-decoration: none; }
.ts-month { padding: 6px 12px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); border-top: 1px solid var(--border); }
.ts-list > .ts-month:first-child { border-top: 0; }
.ts-date { font-size: .86rem; color: var(--text-2); display: grid; }
.ts-today { font-style: normal; font-size: .75rem; font-weight: 700; color: var(--brand-ink); text-transform: uppercase; letter-spacing: .05em; }
.ts-opp { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ts-where { flex: 0 0 1.4em; font-size: .8rem; color: var(--muted); }
.ts-ochip { flex: 0 0 auto; border-left: 4px solid var(--tc, var(--muted)); padding: 2px 0 2px 6px; font-size: .75rem; font-weight: 700; min-width: 40px; }
.ts-oname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-res { text-align: right; white-space: nowrap; }
.ts-wl { display: inline-block; min-width: 1.3em; text-align: center; }
.ts-row.won .ts-wl { color: var(--right); }
.ts-row.lost .ts-wl { color: var(--wrong); }
.ts-rec { text-align: right; color: var(--text-2); font-size: .88rem; }
.ts-res .ts-status { font-size: inherit; }
.ts-status { text-align: right; white-space: nowrap; font-size: .88rem; color: var(--text-2); }
.ts-more { margin-top: 8px; width: 100%; justify-content: center; }

@media (max-width: 480px) {
  .ts-head { padding: 12px; }
  .ts-chip { min-width: 46px; height: 46px; font-size: .85rem; }
  .ts-name { font-size: 1.15rem; }
  .ts-kpis { flex-basis: 100%; }
  .ts-oname { display: none; }
  .ts-kpi { padding: 6px 8px; }
  .ts-v { font-size: 1rem; }
  .ts-next { padding: 12px; }
  .ts-cols, .ts-row { grid-template-columns: 5.2em minmax(0, 1fr) auto 2.9em; gap: 8px; padding: 0 10px; }
  .ts-up { grid-template-columns: 5.2em minmax(0, 1fr) auto; }
  .ts-date { font-size: .8rem; }
  .ts-where { flex-basis: 1.1em; }
}
/* A final from the live feed in the results, "W 118–104 · Final · live feed", wraps in its column on a phone instead of running over the
   opponent (it took the whole row at 320 px; Codex audit 2026-11-08, a game moved from Upcoming as it went final). */
.ts-pending .ts-res, .ts-pending .ts-status { white-space: normal; }
.ts-pending .ts-res { grid-column: 3 / span 2; max-width: 13em; line-height: 1.25; }
.ts-pending .ts-rec:empty { display: none; }
@media (max-width: 520px) { .ts-pending .ts-res { max-width: 10.5em; font-size: .8rem; } }
