/* ── HOLDING VIEW ──
   A list of matches waiting for a ring, grouped by how close they are to going.
   Rows flash when a match moves into staging. `body.holding-tv` is the kiosk layout. */

.holding-toolbar {
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  background:var(--panel); padding:10px 16px; border-bottom:1px solid var(--border);
}
.holding-search {
  flex:1 1 220px; max-width:360px; font:inherit; font-family:'DM Sans',sans-serif; font-size:13px;
  padding:6px 10px; border-radius:6px;
  background:var(--ncta-input-bg); color:var(--ncta-text); border:1px solid var(--ncta-border);
}
.holding-search:focus-visible { outline:2px solid var(--red); outline-offset:1px; }
.holding-count { margin-left:auto; font-family:'DM Sans',sans-serif; font-size:12px; color:var(--muted); }

.holding-list { max-width:1000px; margin:0 auto; padding:12px 16px 24px; font-family:'DM Sans',sans-serif; color:var(--text); }
.holding-group { margin-bottom:18px; }
/* Plain section headings, no box. */
.holding-group-head {
  display:flex; justify-content:space-between; align-items:center; margin:0 0 8px; padding:0 2px;
  font-size:18px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--text);
}
.holding-group-n { background:var(--red); color:#fff; border-radius:999px; padding:1px 11px; font-size:15px; letter-spacing:0; }

.holding-row {
  /* Fixed first column (not auto, and in `ch` so it scales with text size
     in kiosk mode instead of a literal px count): every row's later columns
     then start at the same x regardless of match-number digit count, so
     "vs" and everything after it lines up across every row in the list. */
  display:grid; grid-template-columns:5.5ch minmax(0,1fr) auto auto; align-items:center; gap:4px 14px;
  width:100%; box-sizing:border-box; margin-bottom:6px; padding:10px 14px; text-align:left;
  font:inherit; color:inherit; cursor:pointer;
  background:var(--card-bg); border:1px solid var(--border); border-left:4px solid var(--border); border-radius:8px;
}
.holding-row:hover { border-color:var(--red); }
.holding-row:focus-visible { outline:2px solid var(--red); outline-offset:1px; }
.holding-row-staging { border-left-color:var(--red); }
.holding-row-holding { border-left-color:var(--yellow,#eab308); }
.holding-row-called { border-left-color:var(--muted); }

.holding-num { font-weight:700; font-size:15px; }
.holding-div { grid-column:2 / 5; font-size:12px; color:var(--muted); }
/* Fixed-width blue-name column (`ch`, not content-sized or a literal px
   count): "vs" then sits at the same x on every row regardless of how long
   each team's name is, and the column scales with `.holding-teams`' own
   font size so this still holds in kiosk mode's bigger type. Long names
   wrap within their column instead of pushing "vs" sideways. */
.holding-teams {
  grid-column:2; display:grid; grid-template-columns:minmax(14ch,22ch) auto minmax(0,1fr);
  column-gap:10px; align-items:start; min-width:0; font-size:15px;
}
/* overflow-wrap:normal (not anywhere) — wrap between words, never mid-word
   ("Northe"/"astern"). In kiosk mode a word too long for its column just
   bleeds past the edge instead, which grows .holding-list's scrollWidth —
   exactly what fitHoldingTv() (holding-view.js) already watches for, so it
   picks a smaller font instead of ever breaking the word. */
.holding-team { display:block; overflow-wrap:normal; padding-left:8px; border-left:3px solid transparent; }
.holding-team-blue { grid-column:1; border-left-color:#2563eb; }
.holding-team-red { grid-column:3; border-left-color:var(--red); }
.holding-roster { display:block; margin-top:2px; font-size:11px; color:var(--muted); }
.holding-athlete { margin-right:8px; white-space:nowrap; }
.holding-athlete-wt {
  display:inline-block; min-width:1em; margin-right:3px;
  font-weight:700; color:var(--text); opacity:.6;
}
.holding-vs { grid-column:2; align-self:center; font-size:11px; color:var(--muted); text-transform:uppercase; }
.holding-ring { color:var(--yellow,#eab308); font-weight:700; white-space:nowrap; }
/* Status as bold colored text. */
.holding-status { font-size:15px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; white-space:nowrap; }
.holding-status-called { color:var(--muted); }
.holding-status-holding { color:var(--yellow,#b45309); }
.holding-status-staging { color:var(--red); }
.holding-ci { margin-right:4px; font-weight:700; }
.holding-ci-yes { color:#16a34a; }
.holding-ci-no { color:var(--muted); }
.holding-empty { padding:40px 0; text-align:center; color:var(--muted); font-size:14px; }

/* Flash when a match moves into staging. Duration comes from --holding-flash-ms. */
.holding-flash { animation:holding-flash var(--holding-flash-ms,6000ms) ease-out 1; }
@keyframes holding-flash {
  0%, 20%, 40%, 60% { background:var(--red); color:#fff; }
  10%, 30%, 50%, 70% { background:var(--card-bg); }
  100% { background:var(--card-bg); }
}
.holding-flash .holding-status { color:inherit; }
@media (prefers-reduced-motion: reduce) {
  .holding-flash { animation:none; outline:3px solid var(--red); outline-offset:-3px; }
}

@media (max-width:560px) {
  .holding-row { grid-template-columns:4.5ch minmax(0,1fr); }
  .holding-div, .holding-teams { grid-column:2; }
  .holding-ring, .holding-status { grid-column:2; }
  /* Everything below the match #/division line lines up on one left edge
     (13px = the team rows' own 3px bar + 10px padding), so the card reads
     as one aligned column instead of a zig-zag of different insets. */
  .holding-div, .holding-status { padding-left:13px; }
  /* Stack blue team / vs / red team in a single column instead of the
     desktop three-column layout — no room here for side-by-side teams. */
  .holding-teams { grid-template-columns:1fr; row-gap:6px; margin-top:4px; }
  .holding-team-blue, .holding-team-red, .holding-vs { grid-column:1; }
  .holding-team { width:100%; padding-left:10px; }
  .holding-vs { justify-self:center; margin:2px 0; font-size:12px; font-weight:700; }
  .holding-ring { padding-left:13px; }
}

/* Kiosk mode (?tv=1): just the list, in big type. */
body.holding-tv header, body.holding-tv .tabs, body.holding-tv .site-footer { display:none; }
body.holding-tv .holding-toolbar { background:transparent; border:0; }
/* Flow matches into as many columns as the screen's width allows (a TV has
   plenty of width to spare) instead of one long column, so a full slate of
   matches fits on screen without scrolling. Rows/headers don't split
   mid-element across a column break; a header tries not to end up alone at
   the bottom of a column with its first row stranded in the next one. */
/* The page itself never scrolls in kiosk mode. fitHoldingTv() (holding-view.js)
   sets an explicit height (so the columns run all the way to the bottom of
   the screen, not just as deep as the content happens to need) and a
   font-size — binary-searched after every render to the largest size that
   still fits without overflowing, so few matches show big and many matches
   shrink down to fit, rather than a size tuned for one particular match
   count. The clamp() here is just the pre-JS fallback for the first paint.
   column-fill:auto (not balance) fills the first column all the way to the
   bottom before spilling into the next one, instead of spreading rows evenly
   and leaving every column equally short. */
body.holding-tv .holding-list {
  max-width:none; margin:0; font-size:clamp(13px, 1.4vw, 23px);
  overflow:hidden;
  /* fitHoldingTv() (holding-view.js) sets column-count (never column-width)
     at every font-size it tries: pairing column-width with column-count lets
     the browser silently add an extra column past the ones that fit on
     screen — invisible here since this box clips overflow, so a whole group
     could render completely off-screen rather than wrapping. column-count
     alone always divides the full, on-screen width into exactly that many
     columns, so there's nowhere for content to hide. column-count:2 here is
     only the pre-JS fallback for the first paint. */
  column-count:2; column-gap:28px; column-fill:auto;
}
body.holding-tv .holding-row, body.holding-tv .holding-group-head {
  break-inside:avoid; -webkit-column-break-inside:avoid;
}
body.holding-tv .holding-group-head { break-after:avoid; }
body.holding-tv .holding-row { padding:.5em .8em; }
body.holding-tv .holding-num, body.holding-tv .holding-teams { font-size:1.15em; }
/* Kiosk columns are narrower than a full desktop row, so give the
   blue-name column less room and the status text less room (abbreviated)
   than on desktop — keeps team-blue | vs | team-red side by side (2 lines
   tall) instead of falling back to the much taller stacked mobile layout. */
body.holding-tv .holding-teams { grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); }
body.holding-tv .holding-team { min-width:0; }
/* The status text is redundant in kiosk mode — each row already sits under
   a group heading ("Called to Holding" etc.) — and as an `auto`-sized grid
   track it was reserving a lot of width for the longest status string,
   squeezing the red-team column down to nothing in a narrower kiosk
   column. Dropping it frees that width back up for the team names. */
body.holding-tv .holding-status { display:none; }
body.holding-tv .holding-roster { font-size:.5em; }
body.holding-tv .holding-div { font-size:.6em; }
body.holding-tv .holding-group-head { font-size:1em; }
body.holding-tv .holding-group-n { font-size:.8em; }
