/* TV screens: live board and order of play. Readable from across the room. */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.tv { background: var(--ink); color: #fff; font-family: var(--font-body); font-variant-numeric: tabular-nums; }
.tv-loading, .tv-empty { padding: 3rem; font-size: 1.6rem; }
.tv-head { display: flex; align-items: center; gap: 2rem; padding: 0.8rem 2rem; background: var(--club); color: var(--on-club, #fff); border-bottom: 8px solid var(--tin); flex-wrap: wrap; }
.tv-head h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.8rem, 3.2vw, 3rem); margin: 0; line-height: 1; margin-right: auto; }
#clock-now { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.6rem, 2.6vw, 2.6rem); opacity: 0.9; }
.tv-date { font-weight: 700; font-size: 1.3rem; }
.cd { display: grid; justify-items: center; line-height: 1; }
.cd-call { font-weight: 700; font-size: 1rem; }
.cd-time { font-family: var(--font-display); font-weight: 800; font-size: 2.4rem; }
.cd--huge .cd-time { font-size: clamp(3rem, 6vw, 5.5rem); }
.cd--huge .cd-call { font-size: 1.2rem; }
.cd--warn .cd-time { color: var(--ball); }
.cd--done .cd-time { color: #ff8a80; }

.courts { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 1rem; padding: 1rem 1.5rem; }
@media (max-width: 60rem) { .courts { grid-template-columns: 1fr; } }
.court { background: #fff; color: var(--ink); border-radius: 14px; overflow: hidden; border-top: 10px solid var(--rule); }
.court--live { border-top-color: var(--ball); }
.court--done { border-top-color: var(--club); }
.court header { display: flex; justify-content: space-between; align-items: baseline; padding: 0.6rem 1rem 0; }
.court h2 { font-family: var(--font-display); font-weight: 800; font-size: 2.2rem; margin: 0; line-height: 1; }
.court-state { font-weight: 800; text-transform: none; color: var(--muted); }
.court--live .court-state { color: var(--ink); background: var(--ball); padding: 0.1rem 0.6rem; border-radius: 999px; }
.teams { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0.8rem; align-items: center; padding: 0.4rem 1rem 0.6rem; font-weight: 800; font-size: 1.25rem; border-bottom: 2px solid var(--rule); }
.tp { font-family: var(--font-display); font-weight: 800; font-size: 2.6rem; line-height: 1; }
.tp em, .ln-score em { font-style: normal; color: var(--muted); margin: 0 0.15em; }
.tp--none { color: var(--muted); font-size: 1.6rem; }
.ln-right { text-align: right; justify-self: end; }
.lines { list-style: none; margin: 0; padding: 0; }
.ln { display: grid; grid-template-columns: 2rem 1fr auto 1fr; gap: 0.6rem; align-items: center; padding: 0.55rem 1rem; border-top: 1px solid var(--rule); font-size: 1.15rem; }
.ln-pos { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--muted); }
.ln-p { display: flex; align-items: center; gap: 0.45rem; font-weight: 700; }
.ln-p.ln-right { justify-content: flex-end; }
.ln-score { font-family: var(--font-display); font-weight: 800; font-size: 2.4rem; line-height: 1; white-space: nowrap; }
.ln-score--small { font-family: var(--font-body); font-size: 1rem; font-weight: 600; color: var(--muted); }
.ln--live { background: #fffaf0; }
.ln-games { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: baseline; font-size: 0.95rem; color: var(--muted); font-weight: 600; }
.ln-prev span { margin-right: 0.5rem; }
.ln-timer { color: var(--ink); background: var(--ball); padding: 0.05rem 0.5rem; border-radius: 999px; font-weight: 800; }
.ln-timer .cd-time { font-family: var(--font-body); font-size: 1rem; }
.ln-timer .cd-call { font-size: 0.9rem; }
.ball { width: 0.85rem; height: 0.85rem; border-radius: 50%; background: var(--ball); box-shadow: 0 0 0 2px var(--ink); flex: none; }
.shirt { width: 0.9rem; height: 1.3rem; border-radius: 3px; border: 1px solid rgb(0 0 0 / 0.25); flex: none; }
.tv-next { padding: 0.8rem 2rem 1.4rem; font-size: 1.15rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem; }
.conn { position: fixed; right: 1rem; bottom: 0.6rem; color: var(--ball); font-weight: 700; }

/* Order of play */
.oop-scroll { overflow-x: auto; padding: 1rem 1.5rem; }
.oop { width: 100%; border-collapse: separate; border-spacing: 0.4rem; font-size: 1.15rem; }
.oop thead th { font-family: var(--font-display); font-weight: 800; font-size: 1.8rem; text-align: left; padding: 0.3rem 0.6rem; }
.oop tbody th { text-align: left; vertical-align: top; padding: 0.6rem; white-space: nowrap; }
.oop-time { font-family: var(--font-display); font-weight: 800; font-size: 2rem; display: block; line-height: 1; }
.tag { display: inline-block; margin-top: 0.3rem; background: var(--ball); color: var(--ink); font-weight: 800; padding: 0.05rem 0.5rem; border-radius: 999px; font-size: 0.9rem; }
.tag--next { background: #fff; }
.oc { background: rgb(255 255 255 / 0.08); border-radius: 10px; padding: 0.6rem 0.8rem; vertical-align: top; }
.oc-teams { display: block; font-weight: 700; }
.oc-teams em { font-style: normal; opacity: 0.6; }
.oc-state { display: inline-block; margin-top: 0.3rem; font-weight: 800; font-size: 0.95rem; }
.oc--live { background: #fff; color: var(--ink); box-shadow: inset 0 6px 0 var(--ball); }
.oc--live .oc-state { background: var(--ball); padding: 0 0.5rem; border-radius: 999px; }
.oc--done { opacity: 0.7; }
.oc-stage { display: block; font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.75; }
.oc--booked { background: transparent; border: 2px dashed rgb(255 255 255 / 0.3); }
.oc--booked .oc-teams { font-weight: 600; opacity: 0.85; }
.row--now .oc { outline: 2px solid var(--ball); }
.empty-cell { background: transparent; }
@media (max-width: 40rem) {
  .tv-head { padding: 0.6rem 1rem; gap: 1rem; }
  .courts { padding: 0.6rem; }
  .ln { font-size: 1rem; }
}

/* Order of play: players under each match */
.oc-lines { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.15rem; font-size: 0.95rem; }
.oc-line { display: grid; grid-template-columns: 1.4ch 1fr; column-gap: 0.4rem; align-items: baseline; font-weight: 500; }
.oc-line .oc-score { grid-column: 2; }
.oc-line em { font-style: normal; opacity: 0.6; }
.oc-pos { font-family: var(--font-display); font-weight: 800; opacity: 0.6; min-width: 1ch; }
.oc-score { font-weight: 700; opacity: 0.8; }
.oc-score--live { background: var(--ball); color: var(--ink); padding: 0 0.4rem; border-radius: 999px; opacity: 1; }
.oc--live .oc-line { color: var(--ink); }
.tag--soon { background: transparent; color: #fff; border: 1px solid rgb(255 255 255 / 0.5); display: inline-flex; gap: 0.25rem; }
.tag--soon .cd-time { font-family: var(--font-body); font-size: 0.9rem; font-weight: 800; }
.oop-more { padding: 0 1.5rem 1.5rem; }
.oop-more a { color: #fff; }

/* Live board: richer lines */
.boxtag { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 4px; background: var(--ball); color: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: 1rem; }
.chip { display: inline-block; padding: 0.05rem 0.55rem; border-radius: 999px; font-weight: 800; font-size: 0.9rem; }
.chip--ball { background: var(--ink); color: var(--ball); }
.chip--pen { background: var(--tin); color: #fff; }
.ln-win { color: var(--club-ink, var(--ink)); font-weight: 800; }
.ln-win::after { content: " ✓"; }
.ln-final { color: var(--muted); }
.ln[data-focus] { cursor: pointer; }
.ln[data-focus]:hover, .ln[data-focus]:focus-visible { outline: 3px solid var(--ball); outline-offset: -3px; }
.tv-hint { margin: 0.6rem 1.5rem 0; opacity: 0.7; }
.tv-back { font: inherit; font-weight: 700; background: transparent; color: inherit; border: 2px solid currentColor; border-radius: 8px; padding: 0.4rem 0.9rem; cursor: pointer; }

/* Focus view: one match */
.focus { padding: 1rem 1.5rem 2rem; }
.fb-team { font-weight: 700; font-size: 1.2rem; margin-right: auto; }
.fx-tp { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; margin-left: 0.4rem; }
.fb-call { text-align: center; font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 5vw, 3.5rem); margin: 0.4rem 0 1rem; display: flex; gap: 1rem; justify-content: center; align-items: center; flex-wrap: wrap; }
.fb-court { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.fb-side { position: relative; background: #fff; color: var(--ink); border-radius: 16px; padding: 2rem 1rem 1.5rem; display: grid; justify-items: center; gap: 0.5rem; overflow: hidden; }
.fb-side--serving { box-shadow: inset 0 0 0 6px var(--ball); }
.fb-side--won { box-shadow: inset 0 0 0 6px var(--club); }
.fb-shirt { position: absolute; inset: 0 0 auto 0; height: 22px; background: var(--shirt, #fff); border-bottom: 1px solid rgb(0 0 0 / 0.12); }
.fb-name { margin: 0; font-size: clamp(1.8rem, 4vw, 3.2rem); text-align: center; }
.fb-score { font-family: var(--font-display); font-weight: 800; font-size: clamp(6rem, 18vw, 14rem); line-height: 0.9; }
.fb-boxes { display: flex; gap: 0.6rem; }
.fb-box { width: 3.6rem; height: 3.6rem; display: grid; place-items: center; border-radius: 10px; font-family: var(--font-display); font-weight: 800; font-size: 2rem; color: #c9c4d3; border: 3px solid #e3e0ea; }
.fb-box--on { background: var(--ball); color: var(--ink); border-color: var(--ink); }
.fb-serve { font-weight: 700; font-size: 1.2rem; min-height: 1.4em; }
.fb-games { color: var(--muted); font-weight: 700; font-size: 1.3rem; }
.fb-extra { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: center; margin-top: 1.2rem; }
.fb-games-table { border-collapse: collapse; font-size: 1.3rem; }
.fb-games-table th, .fb-games-table td { padding: 0.3rem 0.9rem; border-bottom: 1px solid rgb(255 255 255 / 0.15); text-align: center; }
.fb-games-table td { font-family: var(--font-display); font-weight: 800; font-size: 2rem; opacity: 0.6; }
.fb-games-table td.w { opacity: 1; color: var(--ball); }
.fb-pens { list-style: none; padding: 0; margin: 0; font-size: 1.2rem; display: grid; gap: 0.4rem; }
.fb-pens li { background: var(--tin); color: #fff; padding: 0.3rem 0.8rem; border-radius: 8px; font-weight: 700; }
.fb-final { text-align: center; font-size: 1.6rem; font-weight: 700; margin-top: 1rem; }
@media (max-width: 40rem) { .fb-court { grid-template-columns: 1fr; } }
.oc-line .oc-score { justify-self: start; }
.fb-pens { align-self: flex-start; }
.cd--date .cd-time { font-size: clamp(1.4rem, 2.6vw, 2.4rem) !important; }
.tv-round { font-family: var(--font-body); font-weight: 700; font-size: 0.55em; opacity: 0.85; margin-left: 0.5rem; white-space: nowrap; }
.oop-round { display: block; font-weight: 700; opacity: 0.8; margin-top: 0.15rem; }

/* Order of play: courts down the left, time blocks across (Now, Up next, Upcoming) */
.oop--courts { border-spacing: 0.6rem; width: max-content; min-width: 100%; }
.oop--courts .oop-corner { position: sticky; left: 0; z-index: 2; background: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; text-align: left; vertical-align: bottom; }
.oop--courts .oop-court { position: sticky; left: 0; z-index: 1; background: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: clamp(1.6rem, 2.4vw, 2.2rem); white-space: nowrap; padding: 0.6rem 0.8rem 0.6rem 0; vertical-align: top; }
.oop--courts .oop-col { text-align: left; vertical-align: bottom; padding: 0 0.2rem 0.3rem; min-width: 24rem; }
.oop--courts .oop-col .tag { margin: 0 0 0.3rem; }
.oop--courts .oop-col .oop-time { font-size: 2rem; display: block; }
.oop--courts .oc { min-width: 24rem; max-width: 30rem; }
.oop--courts .oc-teams { font-size: 1.15rem; }
.tag--later { background: transparent; color: #fff; border: 1px solid rgb(255 255 255 / 0.45); }
.oop-hint { padding: 0 1.5rem; opacity: 0.65; margin: 0; }
/* Score directly below the players, on one line */
.oc-line { grid-template-columns: 1.4ch 1fr; }
.oc-scoreline { grid-column: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; margin: 0.1rem 0 0.25rem; }
.oc-scoreline .oc-score { grid-column: auto; justify-self: auto; }
.court-stage { font-family: var(--font-body); font-size: 1rem; font-weight: 800; color: var(--club-ink, var(--ink)); background: var(--ball); padding: 0.05rem 0.5rem; border-radius: 999px; vertical-align: middle; }

/* Way back from the live screens (phones and tablets); ?kiosk=1 hides it on a TV */
.tv-nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; align-items: center; padding: 0.45rem 1.5rem; background: rgb(0 0 0 / 0.35); font-size: 0.95rem; }
.tv-nav a { color: #fff; text-decoration: none; font-weight: 600; opacity: 0.85; }
.tv-nav a:hover, .tv-nav a:focus-visible { opacity: 1; text-decoration: underline; }
.tv-nav a[aria-current="page"] { opacity: 1; border-bottom: 2px solid var(--ball); }
.tv-nav a:first-child { margin-right: auto; }

/* Picking a competition and a day */
.tv-pick { display: flex; flex-wrap: wrap; align-items: end; gap: 0.6rem 1.2rem; padding: 0.6rem 1.5rem; background: rgb(0 0 0 / 0.2); }
.tv-pick__f { display: grid; gap: 0.15rem; font-size: 0.8rem; font-weight: 600; opacity: 0.95; }
.tv-pick__f span { text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.75; }
.tv-pick select { font: inherit; font-size: 1rem; font-weight: 700; padding: 0.45rem 0.6rem; min-height: 2.6rem; border-radius: 8px; border: 0; background: #fff; color: var(--ink); max-width: 80vw; }
.tv-pick__day { display: inline-flex; align-items: end; gap: 0.4rem; }
.tv-pick__step { display: inline-grid; place-items: center; min-width: 2.6rem; min-height: 2.6rem; border-radius: 8px; background: rgb(255 255 255 / 0.14); color: #fff; text-decoration: none; font-size: 1.3rem; font-weight: 700; }
.tv-pick__live { color: var(--ball); font-weight: 700; padding-bottom: 0.6rem; }

/* Finished matches under the courts */
.tv-done { margin: 0.4rem 1.5rem 2rem; padding-top: 1rem; border-top: 2px solid rgb(255 255 255 / 0.18); }
.tv-done h2 { font-family: var(--font-display); font-weight: 800; font-size: 1.8rem; margin: 0 0 0.6rem; }
.tv-done h2 span { opacity: 0.6; }
.dn-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr)); gap: 0.6rem; }
.dn { background: rgb(255 255 255 / 0.08); border-radius: 10px; padding: 0.6rem 0.9rem; display: grid; gap: 0.2rem; }
.dn-where { font-size: 0.85rem; opacity: 0.7; }
.dn-names { font-size: 1.1rem; }
.dn-names em { opacity: 0.6; font-style: normal; }
.dn .ln-win { font-weight: 700; color: var(--ball); }
.dn-score b { font-family: var(--font-display); font-size: 1.3rem; }
.dn-games { opacity: 0.8; }
