/* =====================================================================
   BETROX Shop · shared/tvboard.css
   ---------------------------------------------------------------------
   Shared look of the two live TV boards (Link 4 live-zeit, Link 5 live-liga).
   Same family as the chosen TV look "Variant A" (screens/variant-a/):
   1920 x 1080 design stage, scaled + letterboxed by shared/tvboard.js.

   Load after ../shared/tokens.css and before the app's own styles.css.
   The odds-change blink (.bx-tile.chg), SPIELSITUATION (.bx-sus-row, .bx-sus)
   and TOR! (.bx-goal-row, .bx-goal-badge, .bx-gnew) animations come from
   tokens.css; this file only lays out the board around them.
   ===================================================================== */

html, body { height: 100%; margin: 0; overflow: hidden; background: #000; }

.tv-viewport { position: fixed; inset: 0; overflow: hidden; background: #000; }
.tv-stage {
  position: absolute; left: 0; top: 0;
  width: 1920px; height: 1080px;
  transform-origin: 0 0;
  background: var(--bg); color: var(--ink);
  font-family: var(--sans);
  display: flex; flex-direction: column; overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none; -webkit-user-select: none;
}
.tv-stage .num { font-variant-numeric: tabular-nums; }

/* ---------- header ---------- */
.tv-hdr {
  height: 104px; flex-shrink: 0; padding: 0 40px;
  background: var(--bar); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
}
.tv-hdr-left { display: flex; align-items: center; gap: 36px; min-width: 0; }
.tv-brand { font-family: var(--cond); font-weight: 800; font-size: 52px; letter-spacing: .02em; line-height: 1; white-space: nowrap; }
.tv-brand .bet { color: #FFF; }
.tv-brand .rox { color: var(--accent); }
.tv-hdr-sep { width: 1px; height: 48px; background: var(--line-3); flex-shrink: 0; }
.tv-hdr-live { display: flex; align-items: center; gap: 16px; min-width: 0; }
.tv-hdr-live .bx-live-dot { width: 14px; height: 14px; }
.tv-hdr-title { font-family: var(--cond); font-weight: 700; font-size: 40px; letter-spacing: .04em; line-height: 1; white-space: nowrap; }
.tv-hdr-count {
  margin-left: 8px; padding: 6px 14px; border-radius: 999px; background: var(--tile);
  color: var(--ink-2); font-size: 20px; font-weight: 600; white-space: nowrap;
}
.tv-hdr-mode {
  display: inline-flex; align-items: center; gap: 10px; min-width: 0;
  padding: 6px 16px 6px 12px; border-radius: 8px;
  background: var(--accent-tint); border: 1px solid var(--accent-line); color: var(--accent);
  font-family: var(--cond); font-weight: 700; font-size: 24px; letter-spacing: .06em; line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 720px;
}
.tv-hdr-mode svg { flex-shrink: 0; }
.tv-hdr-mode .tv-flag { width: 30px; height: 20px; }
.tv-hdr-right { display: flex; align-items: center; gap: 40px; flex-shrink: 0; }
.tv-hdr-right .bx-conn { font-size: 20px; padding: 8px 16px; }
.tv-pager { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.tv-pager-label { font-size: 20px; font-weight: 600; color: var(--muted); letter-spacing: .08em; white-space: nowrap; }
.tv-pager-segs { display: flex; gap: 6px; }
.tv-seg { width: 64px; height: 6px; border-radius: 3px; background: var(--line-3); overflow: hidden; }
.tv-seg i { display: block; height: 6px; width: 0; background: var(--accent); }
.tv-seg.done i { width: 100%; }
.tv-seg.cur i { animation: tv-fill var(--page-ms, 24000ms) linear var(--page-delay, 0ms) forwards; }
.tv-pager-segs.single .tv-seg i { width: 100%; animation: none; }
.tv-clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.tv-clock-time { font-family: var(--cond); font-weight: 700; font-size: 52px; font-variant-numeric: tabular-nums; }
.tv-clock-date { font-size: 20px; font-weight: 600; color: var(--muted); margin-top: 4px; white-space: nowrap; }

/* ---------- main board ---------- */
.tv-main { flex: 1; min-height: 0; padding: 24px 40px; display: flex; }
.tv-board {
  flex: 1; min-width: 0; border-radius: var(--r-lg); background: var(--board); border: 1px solid var(--line);
  overflow: hidden; display: flex; flex-direction: column; position: relative;
}
.tv-row {
  flex-shrink: 0; padding: 0 20px;
  display: grid; grid-template-columns: var(--tv-cols); column-gap: 20px; align-items: center;
}
.tv-head {
  height: 62px; background: var(--board-head); border-bottom: 1px solid var(--line-2);
  font-size: 20px; font-weight: 700; color: var(--muted); letter-spacing: .08em;   /* TV: >= 20 px at 3-4 m */
}
.tv-head .c { text-align: center; }
.tv-head .hi { color: var(--ink-2); }
.tv-grp-head { display: flex; flex-direction: column; gap: 4px; }
.tv-grp-sub { display: flex; gap: 8px; font-size: 20px; color: var(--ink-2); }
.tv-grp-sub span { flex: 1; text-align: center; }
.tv-grp-sub .line-h { flex: 0 0 52px; width: 52px; font-size: 16px;   /* narrow column; the line value below is 22 px */ color: var(--muted); }

.tv-rows { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.tv-rows.enter { animation: tv-pagein .5s ease-out; }

/* group header row (time band / league) */
.tv-group {
  height: 46px; flex-shrink: 0; padding: 0 20px 0 0;
  display: flex; align-items: center; gap: 14px;
  background: #0D1017; border-bottom: 1px solid var(--line-2); border-top: 1px solid var(--line-2);
  position: relative;
}
.tv-group:first-child { border-top: 0; }
.tv-group::before { content: ''; align-self: stretch; width: 6px; flex-shrink: 0; background: var(--grp-accent, var(--line-3)); }
.tv-group-title {
  font-family: var(--cond); font-weight: 800; font-size: 26px; letter-spacing: .05em; line-height: 1;
  color: var(--ink); white-space: nowrap;
}
.tv-group-sub { font-size: 20px; font-weight: 700; color: var(--muted); letter-spacing: .08em; white-space: nowrap; }
.tv-group-tag {
  padding: 3px 10px; border-radius: 6px; font-family: var(--cond); font-weight: 700; font-size: 21px; letter-spacing: .04em;
  background: var(--tile); color: var(--grp-accent, var(--ink-2)); line-height: 1.1; white-space: nowrap;
}
.tv-group-cont { font-size: 20px; font-weight: 600; color: var(--muted-2); letter-spacing: .06em; white-space: nowrap; }
.tv-group-count { margin-left: auto; font-size: 20px; font-weight: 600; color: var(--muted); white-space: nowrap; }

/* match row */
.tv-match {
  --row-bg: var(--board);
  height: 64px; background: var(--row-bg); border-bottom: 1px solid #191D28;
}
.tv-match.alt { --row-bg: var(--board-alt); }
.tv-match.top { --row-bg: #14130D; }
.tv-match.top.alt { --row-bg: #171509; }

.tv-mcell { display: flex; flex-direction: column; gap: 6px; }
.tv-mcell .mlabel { font-family: var(--cond); font-weight: 700; font-size: 30px; line-height: 1; color: var(--live-ink); white-space: nowrap; }
.tv-mcell .mlabel.long { font-size: 23px; }
.tv-mcell .mlabel.ht { color: var(--ht); }
.tv-mcell .bx-prog { width: 76px; }

.tv-league { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tv-league-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.tv-league-name { font-size: 20px; font-weight: 700; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-league-cc { font-size: 16px; font-weight: 700; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tv-teams { display: flex; flex-direction: column; min-width: 0; }
.tv-team { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 600; line-height: 27px; white-space: nowrap; min-width: 0; }
.tv-team .nm { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tv-team.lose, .tv-goals .lose { color: var(--ink-dim); }
.tv-team.scorer { color: #FFFFFF; }

.tv-goals {
  display: flex; flex-direction: column; align-items: center;
  font-family: var(--cond); font-weight: 700; font-size: 27px; line-height: 27px; font-variant-numeric: tabular-nums;
}

/* odds groups (value-only Variant A tiles; .bx-tile gives the change animation) */
.tv-grp { display: flex; gap: 8px; align-items: center; min-width: 0; }
.tv-hline { width: 52px; flex-shrink: 0; text-align: center; font-family: var(--cond); font-weight: 600; font-size: 22px; color: var(--ink-2); }
.tv-odd.bx-tile {
  flex: 1; min-width: 0; height: 46px; padding: 0 6px; border-radius: var(--r-sm);
  justify-content: center; transition: background-color .6s ease, box-shadow .6s ease;
}
.tv-odd .vv { display: inline-flex; align-items: center; gap: 4px; }
.tv-odd .v { font-size: 29px; }
.tv-odd.is-wide .v { font-size: 25px; letter-spacing: -.01em; }
.tv-odd.is-wide .vv { gap: 2px; }
.tv-odd.is-locked { color: var(--muted-2); }
.tv-odd .bx-arr { width: 14px; height: 12px; }
.tv-grp .bx-locked-bar { height: 46px; min-height: 46px; }
.tv-grp .tv-na {
  flex: 1; height: 46px; border-radius: var(--r-sm); border: 1px dashed #20253A;
  display: flex; align-items: center; justify-content: center; color: var(--muted-2); font-size: 22px; font-family: var(--cond);
}
.tv-match.top .tv-odd.bx-tile:not(.chg):not(.is-locked) { --odd-bg: #24200F; }

/* SPIELSITUATION band spans all odds columns */
.tv-match .bx-sus { grid-column: var(--tv-odds-span); height: 46px; min-height: 46px; }
.tv-match .bx-sus .title { font-size: 30px; }
.tv-match .bx-sus .sub { font-size: 20px; }
.tv-match .bx-sus .t { font-size: 30px; }

/* empty / loading states */
.tv-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  color: var(--muted); text-align: center; padding: 40px;
}
.tv-empty svg { color: var(--line-3); }
.tv-empty-title { font-family: var(--cond); font-weight: 700; font-size: 44px; color: var(--ink-2); letter-spacing: .02em; }
.tv-empty-text { font-size: 24px; font-weight: 600; }

/* "Nächste Spiele" fallback list (live-liga with a league filter and nothing live) */
.tv-next { width: 1180px; max-width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.tv-next-title { font-family: var(--cond); font-weight: 700; font-size: 26px; letter-spacing: .06em; color: var(--accent); text-align: left; }
.tv-next-row {
  display: grid; grid-template-columns: 190px minmax(0, 1fr) 420px; gap: 24px; align-items: center;
  height: 66px; padding: 0 20px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line-2); text-align: left;
}
.tv-next-when { display: flex; flex-direction: column; line-height: 1.1; }
.tv-next-when b { font-family: var(--cond); font-weight: 700; font-size: 30px; color: var(--accent); font-variant-numeric: tabular-nums; }
.tv-next-when span { font-size: 18px; font-weight: 700; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.tv-next-teams { font-size: 23px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-next-row .tv-grp .bx-tile { height: 46px; flex: 1; }
.tv-next-row .bx-tile .k { font-size: 20px; }
.tv-next-row .bx-tile .v { font-size: 27px; }

/* ---------- flags (inline SVG, see BX.tvboard.flag) ---------- */
.tv-flag { display: inline-block; width: 36px; height: 24px; border-radius: 3px; overflow: hidden; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }
.tv-flag svg { width: 100%; height: 100%; }
.tv-league .tv-flag { width: 30px; height: 20px; }

/* ---------- footer ---------- */
.tv-ftr {
  height: 64px; flex-shrink: 0; padding: 0 40px;
  background: var(--bar); border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  font-size: 20px; font-weight: 600; color: var(--muted);
}
.tv-ftr .bx-legal { font-size: 20px; }
.tv-match .bx-locked-bar { font-size: 20px; }
.tv-legend { display: flex; align-items: center; gap: 30px; }
.tv-legend > span { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.tv-lg-sw { width: 26px; height: 22px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; }
.tv-lg-sw.up { background: var(--up-solid); }
.tv-lg-sw.down { background: var(--down-solid); }
.tv-lg-sw svg { width: 14px; height: 12px; fill: #FFF; }
.tv-legend .ht-tag { font-family: var(--cond); font-weight: 700; color: var(--ht); }
.tv-legend .bx-ic { color: var(--muted); }
.tv-ftr .bx-legal { flex-wrap: nowrap; white-space: nowrap; }

/* ---------- motion ---------- */
@keyframes tv-fill { from { width: 0; } to { width: 100%; } }
@keyframes tv-pagein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .tv-rows.enter { animation: none; }
  .tv-seg.cur i { animation: none; width: 100%; }
  .tv-odd.bx-tile { transition: none; }
}

/* ---------- column grid (set on .tv-board) ---------- */
.tv-board {
  /* MIN | SPIEL | TOR | SIEGWETTE | HANDICAP (line + 1/X/2) | DOPPELTE CHANCE */
  --tv-cols: 104px minmax(0, 1fr) 44px 300px 360px 300px;
  --tv-odds-span: 4 / 7;
}
.tv-board.with-league {
  /* MIN | LIGA | SPIEL | TOR | SIEGWETTE | HANDICAP | DOPPELTE CHANCE */
  --tv-cols: 104px 260px minmax(0, 1fr) 44px 270px 330px 270px;
  --tv-odds-span: 5 / 8;
}
.tv-stage [hidden] { display: none !important; }
.tv-board.is-empty .tv-head { display: none; }
