/* North Star Wiffle — big-TV live board. Dark, high-contrast, fills the screen,
   no interaction. Design tokens mirror styles.css. */

:root {
  --navy:   #0C1E52;
  --navy-2: #0a1842;
  --red:    #CC1427;
  --gold:   #F5A01A;
  --panel:  #12295f;
  --panel-2:#0f2350;
  --line:   rgba(255,255,255,0.12);
  --text:   #F4F2EC;
  --muted:  #9fb0d0;
  --font-display: 'Anton', sans-serif;
  --font-body:    'Poppins', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  background: var(--navy);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  cursor: none;
  display: flex;
  flex-direction: column;
}

img { display: block; object-fit: contain; }

/* ── Header ───────────────────────────────────────────────────────── */
.tvHead {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 28px;
  background: var(--navy-2);
  border-bottom: 3px solid var(--gold);
}
.tvHead-logo { height: 46px; width: auto; }
.tvHead-title {
  font-family: var(--font-display);
  font-size: 34px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.tvHead-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
}
.tvHead-updated { font-size: 18px; color: var(--muted); }
.tvHead-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 18px;
  color: #ff5566;
}
.tvHead-live[hidden] { display: none; }

.tvDot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(204,20,39,0.6);
  animation: tvPulse 1.4s infinite;
}
@keyframes tvPulse {
  0%   { box-shadow: 0 0 0 0 rgba(204,20,39,0.6); }
  70%  { box-shadow: 0 0 0 12px rgba(204,20,39,0); }
  100% { box-shadow: 0 0 0 0 rgba(204,20,39,0); }
}

/* ── Layout grid ──────────────────────────────────────────────────── */
.tvGrid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 58fr 42fr;
  gap: 18px;
  padding: 18px;
  min-height: 0;
}
.tvCol { min-height: 0; display: flex; flex-direction: column; }
.tvCol-side {
  display: grid;
  grid-template-rows: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

/* ── Panels ───────────────────────────────────────────────────────── */
.tvPanel, .tvSchedule {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.tvPanel-head {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: 12px 20px;
  background: var(--navy-2);
  border-bottom: 2px solid var(--gold);
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.tvPanel-note {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

/* ── Schedule column ──────────────────────────────────────────────── */
.tvSchedule {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  gap: 12px;
}
.tvSchedule::-webkit-scrollbar { width: 0; height: 0; }

.tvRnd {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
}
.tvRnd + .tvRnd { margin-top: 2px; }
.tvRnd.is-next {
  background: rgba(245,160,26,0.10);
  outline: 2px solid rgba(245,160,26,0.55);
}
.tvRnd-time {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--gold);
  line-height: 1.05;
}
.tvRnd-games {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tvLunch {
  grid-column: 1 / -1;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--navy);
  background: var(--gold);
  border-radius: 8px;
  padding: 8px 14px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── Game cards ───────────────────────────────────────────────────── */
.tvGm {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: 8px;
  padding: 8px 12px;
}
.tvGm.on-a { border-left-color: var(--gold); }
.tvGm.on-b { border-left-color: #4f7cff; }
.tvGm.is-final { opacity: .82; }

.tvGm-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.tvTag {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.12);
}
.tvTag.pool-1 { background: var(--gold); color: var(--navy); }
.tvTag.pool-2 { background: #4f7cff; color: #fff; }
.tvTag.field { background: rgba(255,255,255,0.10); color: var(--muted); }
.tvGm-id {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: .03em;
}
.tvGm-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.tvGm-status.live { color: #ff5566; }

.tvGm-side {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 0;
}
.tvGm-logo { width: 30px; height: 30px; flex: 0 0 auto; }
.tvGm-name {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: .01em;
  line-height: 1.05;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tvGm-name.tbd {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  color: var(--muted);
}
.tvGm-score {
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--muted);
  min-width: 34px;
  text-align: right;
}
.tvGm-side.won .tvGm-name { color: var(--gold); }
.tvGm-side.won .tvGm-score { color: var(--text); }

/* Live games: show the running score in full white so it reads at a glance. */
.tvGm.is-live .tvGm-score { color: var(--text); }

/* ── Bracket ──────────────────────────────────────────────────────── */
.tvSub {
  font-family: var(--font-display);
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gold);
  margin: 8px 4px 2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.tvBkt {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.tvBkt-head {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin-bottom: 6px;
}
.tvBkt-gm { margin-bottom: 10px; }
.tvBkt-gm.is-final-game { border-left-color: var(--red); }

/* ── Standings ────────────────────────────────────────────────────── */
.tvStandings {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-content: start;
}
.tvStandings::-webkit-scrollbar { width: 0; height: 0; }
.tvStd { min-width: 0; }
.tvStd-cap {
  font-family: var(--font-display);
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 4px 10px;
  border-radius: 6px 6px 0 0;
}
.tvStd-cap.pool-1 { background: var(--gold); color: var(--navy); }
.tvStd-cap.pool-2 { background: #4f7cff; color: #fff; }

.tvStd-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: var(--panel-2);
  border-radius: 0 0 6px 6px;
  overflow: hidden;
}
.tvStd-table th,
.tvStd-table td {
  padding: 7px 3px;
  text-align: center;
  font-size: 16px;
  border-bottom: 1px solid var(--line);
}
.tvStd-table th:not(:first-child),
.tvStd-table td:not(:first-child) { width: 10%; }
.tvStd-table th {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--muted);
}
.tvStd-table td:not(:first-child) {
  overflow: hidden;
  white-space: nowrap;
}
.tvStd-table th:first-child,
.tvStd-table td:first-child { text-align: left; }
.tvStd-table tbody tr:last-child td { border-bottom: 0; }
.tvStd-table tr.advances td { background: rgba(245,160,26,0.10); }

.tvStd-team { display: flex; align-items: center; gap: 8px; }
.tvStd-logo { width: 24px; height: 24px; flex: 0 0 auto; }
.tvStd-name {
  font-weight: 600;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tvStd-name.tbd { color: var(--muted); font-weight: 500; font-size: 14px; }

/* ── Leaderboards (IP / HR) ───────────────────────────────────────── */
.tvLeader {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 16px 14px;
}
.tvLeader::-webkit-scrollbar { width: 0; height: 0; }
.tvLeader-list { list-style: none; }
.tvLeader-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 4px;
  border-bottom: 1px solid var(--line);
}
.tvLeader-list li:last-child { border-bottom: 0; }
.tvLeader-rank {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--gold);
  min-width: 28px;
  text-align: center;
}
.tvLeader-name {
  font-weight: 600;
  font-size: 20px;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tvLeader-team {
  font-size: 15px;
  color: var(--muted);
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 34%;
}
.tvLeader-val {
  font-family: var(--font-display);
  font-size: 26px;
  min-width: 40px;
  text-align: right;
}
.tvLeader-val.over { color: #ff5566; }

.tvEmpty {
  color: var(--muted);
  font-size: 17px;
  text-align: center;
  padding: 24px 0;
}

/* ── Champion banner ──────────────────────────────────────────────── */
.tvChampion {
  text-align: center;
  padding: 18px;
  margin-top: 8px;
  background: linear-gradient(180deg, rgba(245,160,26,0.18), transparent);
  border: 1px solid rgba(245,160,26,0.4);
  border-radius: 12px;
}
.tvChampion-lbl {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--gold);
  font-size: 16px;
}
.tvChampion-logo { width: 96px; height: 96px; margin: 10px auto; }
.tvChampion-name {
  font-family: var(--font-display);
  font-size: 40px;
  text-transform: uppercase;
}

/* ── 4K scaling ───────────────────────────────────────────────────── */
@media (min-width: 2560px) {
  .tvHead-title { font-size: 46px; }
  .tvPanel-head { font-size: 34px; }
  .tvRnd-time { font-size: 30px; }
  .tvGm-name { font-size: 32px; }
  .tvGm-score { font-size: 40px; }
  .tvStd-table th, .tvStd-table td { font-size: 24px; }
  .tvStd-cap { font-size: 26px; }
  .tvLeader-name { font-size: 27px; }
  .tvLeader-val { font-size: 34px; }
  .tvLeader-rank { font-size: 30px; }
  .tvHead-logo { height: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .tvDot { animation: none; }
}
