/* TV scoreboard. The stage is always 1920×1080 and scaled to the screen (see app.js),
   so the layout matches docs/mockups/tv-*.png on any TV. */
:root {
  --bg: #f3f6fb; --card: #ffffff; --ink: #13213a; --muted: #6b7894; --line: #dde4ef;
  --blue: #2f6fcf; --blue-soft: #e4eefb; --red: #d21034; --green: #1e9e5a;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #fff; }
body { font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--ink); cursor: none; }
#stage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; background: var(--bg);
  display: grid; grid-template-columns: 1fr 540px; overflow: hidden; }
#stage.full { grid-template-columns: 1fr; }
#stage.full aside.queue { display: none; }
main { display: flex; flex-direction: column; min-width: 0; position: relative; }

/* header */
header.top { height: 120px; flex: none; display: flex; align-items: center; gap: 22px; padding-right: 48px; background: var(--card); border-bottom: 1px solid var(--line); position: relative; }
header.top::after { content: ''; position: absolute; left: 0; right: 0; bottom: -7px; height: 6px; background: repeating-linear-gradient(90deg, var(--blue) 0 120px, transparent 120px 150px); opacity: .9; }
.flag { width: 120px; height: 120px; flex: none; }
.bar-logo { height: 112px; width: auto; display: block; }
.brand-sub { font-size: 20px; font-weight: 700; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; line-height: 1.2; padding-left: 18px; border-left: 2px solid var(--line); }
.slide-title { margin-left: auto; font-size: 30px; font-weight: 800; color: var(--blue); text-transform: uppercase; letter-spacing: 3px; white-space: nowrap; }
.content { flex: 1; padding: 40px 48px 32px; min-height: 0; overflow: hidden; }

/* cards and tables */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px 26px; box-shadow: 0 2px 10px rgba(19,33,58,.05); min-height: 0; overflow: hidden; }
.card h3 { font-size: 30px; font-weight: 800; margin-bottom: 10px; display: flex; align-items: center; gap: 12px; }
.card h3::before { content: ''; width: 10px; height: 28px; border-radius: 3px; background: var(--red); flex: none; }
table.std { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.std th { font-size: .63em; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; padding: 8px 6px; text-align: center; border-bottom: 2px solid var(--line); }
table.std td { padding: .4em 6px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.std tr:last-child td { border-bottom: none; }
table.std .name { text-align: left; width: 60%; }
table.std tr.leader td { font-weight: 800; }
table.std tr.out td { color: #a8b2c4; }
table.std tr.out td.name { text-decoration: line-through; }
.card { display: flex; flex-direction: column; }
.fit { font-size: 36px; flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }

.groups { display: grid; gap: 28px; height: 100%; grid-auto-rows: 1fr; }
.groups.n1 { grid-template-columns: 1fr; }
.groups.n2 { grid-template-columns: 1fr 1fr; }
.groups.n3, .groups.n4 { grid-template-columns: 1fr 1fr; }

.group-one { display: grid; grid-template-columns: 1fr 1.05fr; gap: 32px; height: 100%; }
.group-one .fit > table { flex: 1; }
.group-one .fit { font-size: 50px; }
.group-one table.std th { font-size: .48em; height: 3em; padding: 0 6px; }
.group-one table.std td { padding: 0 8px; }
table.cross { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.cross td, table.cross th { text-align: center; padding: 0 8px; border: 1px solid var(--line); }
table.cross th { font-size: .58em; height: 2.7em; color: var(--muted); font-weight: 600; background: #fafbfd; }
table.cross th.rowh { text-align: left; color: var(--ink); font-size: .75em; font-weight: 700; white-space: nowrap; padding: 0 16px; }
table.cross td.diag { background: #d9dee7; }
table.cross td.win { color: var(--green); font-weight: 800; }
table.cross td.loss { color: #111; font-weight: 600; }
.legend { margin-top: 16px; font-size: 19px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px 28px; }
.legend span { white-space: nowrap; }
.legend b.g { color: var(--green); }
.legend b.k { color: #111; }

/* now playing / next match */
.duel { height: 100%; display: grid; grid-template-columns: 1fr auto 1fr; grid-template-rows: auto auto; align-content: center; align-items: center; gap: 70px 40px; }
.duel .sub { grid-column: 1 / -1; text-align: center; font-size: 110px; line-height: 1; color: var(--blue); font-weight: 900; letter-spacing: 6px; text-transform: uppercase; }
.duel .side { text-align: center; min-width: 0; }
.duel .pname { font-size: 100px; font-weight: 800; line-height: 1.05; text-transform: uppercase; letter-spacing: 1px; overflow-wrap: anywhere; }
.duel.next .pname { font-size: 110px; }
.duel .stats { margin-top: 30px; font-size: 34px; color: var(--muted); line-height: 1.6; font-variant-numeric: tabular-nums; }
.duel .stats b { color: var(--ink); }
.duel .vs { font-size: 64px; font-weight: 900; color: var(--red); }

/* play-off bracket */
.bracket { position: relative; height: 100%; }
.bracket svg.lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.bracket .col-t { position: absolute; top: 0; font-size: 20px; font-weight: 800; letter-spacing: 3px; color: var(--muted); text-transform: uppercase; }
.bm { position: absolute; background: var(--card); border: 2px solid var(--line); border-radius: 16px; overflow: hidden; }
.bm .t { font-size: 17px; text-transform: uppercase; letter-spacing: 2px; color: var(--muted); font-weight: 800; padding: 12px 22px 6px; display: flex; justify-content: space-between; }
.bm .p { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 42px; font-weight: 700; padding: 12px 22px; border-top: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.bm .p span { overflow: hidden; text-overflow: ellipsis; }
.bm .p.tbd { color: #a8b2c4; font-style: italic; }
.bm .p.win { color: var(--green); }
.bm .p.lose { color: #a8b2c4; }
.bm .p .s { font-style: normal; font-size: 18px; font-weight: 700; color: var(--blue); background: var(--blue-soft); border-radius: 8px; padding: 3px 10px; flex: none; }
.bm.final { border-color: var(--blue); border-width: 3px; box-shadow: 0 6px 20px rgba(47,111,207,.15); }
.bm.final .t { color: #fff; background: var(--blue); padding-bottom: 12px; }
.bm.third { border-style: dashed; }
.bm.third .t { color: var(--blue); }
.bm.live { box-shadow: 0 0 0 4px rgba(47,111,207,.35); }

/* podium */
.podium { height: 100%; display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: end; gap: 40px; padding: 0 120px; }
.podium .col { text-align: center; }
.podium .nm { font-size: 76px; font-weight: 900; text-transform: uppercase; margin-bottom: 24px; overflow-wrap: anywhere; line-height: 1.05; }
.podium .block { border-radius: 18px 18px 0 0; display: grid; place-items: center; font-size: 120px; font-weight: 900; color: #fff; }
.podium .p1 .block { height: 520px; background: var(--blue); }
.podium .p2 .block { height: 380px; background: #5b8ddb; }
.podium .p3 .block { height: 280px; background: #8fb1e6; }
.podium .medal { font-size: 72px; margin-bottom: 10px; }

/* queue panel (always on the right) */
aside.queue { background: var(--card); border-left: 1px solid var(--line); display: flex; flex-direction: column; padding: 32px 30px 24px; gap: 18px; height: 1080px; min-width: 0; }
.qhead { font-size: 30px; font-weight: 800; text-transform: uppercase; letter-spacing: 3px; color: var(--blue); }
.qbig { border-radius: 18px; padding: 20px 24px; }
.qbig.now { background: var(--blue); color: #fff; }
.qbig.next { background: var(--blue-soft); }
.qlabel { font-size: 18px; text-transform: uppercase; letter-spacing: 2px; font-weight: 700; opacity: .85; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qbig.next .qlabel { color: var(--blue); }
.qp { font-size: 42px; font-weight: 800; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qvs { font-size: 20px; font-weight: 700; margin: 2px 0; }
.qbig.now .qvs { color: #ffd2da; }
.qbig.next .qvs { color: var(--red); }
.qrest { flex: 1; position: relative; overflow: hidden; min-height: 0; }
.qrest-inner { will-change: transform; } /* scrolled by app.js, keeps its place across updates */
.qrow { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); font-size: 28px; }
.qn { color: var(--muted); font-variant-numeric: tabular-nums; }
.qm { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; } /* two lines: names stay whole */
.qm > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qm i { font-style: normal; color: var(--red); font-weight: 700; margin-right: 10px; font-size: .75em; }
.qg { font-size: 16px; font-weight: 700; color: var(--blue); background: var(--blue-soft); border-radius: 8px; padding: 3px 9px; white-space: nowrap; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.qfade { position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: linear-gradient(transparent, #fff); }
.qrest::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 36px; z-index: 1; background: linear-gradient(#fff, transparent); }
.qempty { font-size: 24px; color: var(--muted); }

/* splash before the start: logo and rolling balls (splash.js) */
.splash { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; z-index: 5; background: #fff; overflow: hidden; }
.splash-logo { position: absolute; left: 510px; top: 350px; width: 900px; height: auto; will-change: transform; }
.ball { position: absolute; left: 0; top: 0; width: 84px; height: 84px; border-radius: 50%; background: var(--c); display: grid; place-items: center; will-change: transform; box-shadow: 0 6px 14px rgba(19,33,58,.14); }
.ball span { width: 44px; height: 44px; border-radius: 50%; background: #fff; color: #111; font-size: 25px; font-weight: 800; display: grid; place-items: center; line-height: 1; }
.ball.stripe { background: linear-gradient(#fff 0 23%, var(--c) 23% 77%, #fff 77%); box-shadow: inset 0 0 0 2px rgba(19,33,58,.10), 0 6px 14px rgba(19,33,58,.14); }
.ball.cue { background: #fff; box-shadow: inset 0 0 0 3px #d9dee7, 0 6px 14px rgba(19,33,58,.14); }
.ball.cue .dot { position: absolute; left: 24px; top: 24px; width: 12px; height: 12px; border-radius: 50%; background: #D21034; }
