/* Nov 30 (Nicholas): TV mode (tv.html / tv.js). 16:9, readable across a room, never scrolls. Sized off the viewport. */
:root { --bg: #060a16; --card: #111a30; --card2: #0d1528; --line: rgba(148,163,255,.2); --text: #f2f5ff; --muted: #9fb0d6;
  --accent: #1a9fff; --green: #34d399; --amber: #fbbf24; --rose: #fb7185; --gold: #f5c542; --silver: #c9d1dc; --bronze: #d08a4f;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif; }
* { box-sizing: border-box; }
html { font-size: min(calc(100vw / 87), calc(100vh / 49)); }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--font); }
body.tv-idle, body.tv-idle * { cursor: none !important; }
.tv-root { height: 100vh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: .7rem; padding: .9rem 1.1rem .8rem;
  background: radial-gradient(ellipse at 15% -10%, rgba(26,159,255,.16), transparent 55%), radial-gradient(ellipse at 100% 110%, rgba(52,211,153,.10), transparent 55%), var(--bg); }
.tv-nosp .tv-root { grid-template-rows: auto minmax(0, 1fr); }
.tv-loading { grid-row: 1 / -1; align-self: center; text-align: center; font-size: 2rem; color: var(--muted); }

/* header */
.tv-head { display: flex; align-items: center; gap: 1.2rem; min-width: 0; padding-bottom: .55rem; border-bottom: 1px solid var(--line); }
.tv-logo { height: 3rem; width: 3rem; flex: none; object-fit: contain; }
.tv-title { min-width: 0; flex: 1; }
.tv-title h1 { margin: 0; font-size: 2.05rem; line-height: 1.1; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.tv-title p { margin: .2rem 0 0; font-size: 1rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-right { display: flex; align-items: center; gap: 1rem; flex: none; }
.tv-pill { font-size: .95rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: .3rem .85rem; border-radius: 999px; }
.tv-pill.live { background: rgba(251,113,133,.18); color: var(--rose); animation: tvpulse 2s ease-in-out infinite; }
.tv-pill.up { background: rgba(26,159,255,.16); color: #7cc4ff; }
.tv-pill.done { background: rgba(52,211,153,.16); color: var(--green); }
.tv-sub { font-size: 1rem; color: var(--muted); }
.tv-clock { font-size: 1.9rem; font-weight: 750; font-variant-numeric: tabular-nums; }
@keyframes tvpulse { 50% { opacity: .55; } }

/* main split */
.tv-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 1.1rem; min-height: 0; }
.tv-main.solo { grid-template-columns: minmax(0, 1fr); }
.tv-left, .tv-rightp { min-height: 0; display: flex; flex-direction: column; position: relative; }
.tv-box { flex: 1; min-height: 0; overflow: hidden; position: relative; }
.tv-probe { position: absolute; left: -99999px; top: 0; visibility: hidden; overflow: hidden; display: block; }
.tv-panel-h { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.tv-panel-h h2 { margin: 0; font-size: 1.15rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #7cc4ff; }
.tv-pg { font-size: .9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tv-rightp > .tv-pg { position: absolute; right: 0; top: .1rem; }

/* courts */
.tv-cgrid { display: grid; grid-template-columns: 1fr; gap: .5em; }
.tv-main.solo .tv-cgrid { grid-template-columns: 1fr 1fr; }
.tv-court { display: grid; grid-template-columns: 4.6em minmax(0, 1fr); background: var(--card); border: 1px solid var(--line); border-radius: .8em; overflow: hidden; }
.tv-court.busy { border-color: rgba(52,211,153,.4); }
.tv-court.wait { border-color: rgba(251,191,36,.35); }
.tv-court.free { opacity: .7; }
.tv-cnum { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 2.3em; font-weight: 850; line-height: 1; background: rgba(26,159,255,.12); color: #bfe2ff; }
.tv-court.busy .tv-cnum { background: rgba(52,211,153,.14); color: #a7f3d0; }
.tv-cnum small { font-size: .36em; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .2em; }
.tv-cbody { padding: .45em .8em .5em; min-width: 0; }
.tv-now-l { font-size: .78em; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .15em; }
.tv-livedot { color: var(--rose); animation: tvpulse 1.6s ease-in-out infinite; }
.tv-row { display: flex; align-items: center; justify-content: space-between; gap: .8em; font-size: 1.22em; line-height: 1.4; }
.tv-row.win { color: var(--green); font-weight: 750; }
.tv-team { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-seed { display: inline-block; min-width: 1.5em; margin-right: .35em; font-style: normal; font-size: .75em; color: var(--muted); text-align: center; border: 1px solid var(--line); border-radius: .4em; }
.tv-sc { flex: none; font-weight: 800; font-variant-numeric: tabular-nums; font-size: 1.3em; }
.tv-sc.live { color: var(--amber); }
.tv-wait { font-size: 1.1em; color: #fde68a; } .tv-wait small { display: block; font-size: .8em; color: var(--muted); }
.tv-free { font-size: 1.15em; color: var(--muted); padding: .55em 0; }
.tv-next { margin-top: .3em; padding-top: .3em; border-top: 1px dashed var(--line); font-size: .95em; color: #c9d4f2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-next span { font-size: .72em; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: .55em; }
.tv-next em { font-style: normal; color: var(--muted); }
.tv-court.pre .tv-cbody { display: flex; flex-direction: column; justify-content: center; padding: .7em .9em; }
.tv-pre-c { font-size: 1.45em; font-weight: 750; } .tv-pre-t { font-size: .95em; color: var(--muted); }
.tv-note { margin: .4em .2em; font-size: 1em; color: var(--muted); }

/* pools / standings */
.tv-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(22em, 1fr)); gap: .7em; align-content: start; }
.tv-pool { background: var(--card); border: 1px solid var(--line); border-radius: .8em; padding: .55em .8em .5em; }
.tv-pool h3 { margin: 0 0 .3em; display: flex; justify-content: space-between; align-items: baseline; gap: .6em; font-size: 1.25em; font-weight: 800; }
.tv-pool h3 small { font-size: .85em; font-weight: 600; color: var(--muted); }
.tv-pool table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tv-pool th { font-size: .74em; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: left; padding: .15em .3em; border-bottom: 1px solid var(--line); }
.tv-pool td { font-size: 1.1em; padding: .22em .3em; border-bottom: 1px solid rgba(148,163,255,.08); }
.tv-pool tr:last-child td { border-bottom: 0; }
.tv-pool .r { width: 2em; color: var(--muted); text-align: center; }
.tv-pool .n { width: 3.4em; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.tv-pool .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-pool .up { color: var(--green); } .tv-pool .down { color: var(--rose); }

/* bracket */
.tv-bracket { display: flex; gap: .8em; align-items: stretch; width: max-content; min-width: 100%; }
.tv-bcol { display: flex; flex-direction: column; min-width: 15em; flex: 1; }
.tv-bcol-h { font-size: .8em; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: center; margin-bottom: .35em; }
.tv-bcol-m { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: .45em; }
.tv-bm { background: var(--card); border: 1px solid var(--line); border-radius: .6em; padding: .3em .6em .35em; }
.tv-bm.live { border-color: rgba(251,191,36,.55); } .tv-bm.done { border-color: rgba(52,211,153,.35); }
.tv-bm.bye { opacity: .6; } .tv-bt { font-size: 1.05em; } .tv-bt.muted { color: var(--muted); font-size: .85em; }
.tv-bl { font-size: .68em; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tv-bm .tv-row { font-size: 1.02em; line-height: 1.35; } .tv-bm .tv-sc { font-size: 1.05em; }
.tv-third { margin-top: .8em; } .tv-third::before { content: ""; display: block; height: 1px; background: var(--line); margin-bottom: .6em; }
.tv-champ { font-size: 1.1em; font-weight: 800; color: var(--gold); }
.tv-champ.big { text-align: center; font-size: 1.8em; margin: .6em 0; }

/* team battle */
.tv-tbpanel { display: flex; flex-direction: column; height: 100%; }
.tv-tbboard { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: .8em; margin-bottom: .8em; }
.tv-tbside { background: var(--card); border: 2px solid var(--line); border-radius: 1em; padding: .7em 1em; text-align: center; }
.tv-tbside.blue { border-color: rgba(26,159,255,.6); background: linear-gradient(180deg, rgba(26,159,255,.18), var(--card)); }
.tv-tbside.black { border-color: rgba(220,226,240,.35); background: linear-gradient(180deg, rgba(255,255,255,.07), var(--card)); }
.tv-tbside.lead { box-shadow: 0 0 0 3px var(--gold); }
.tv-tbside .nm { font-size: 1.5em; font-weight: 800; }
.tv-tbside .big { font-size: 4.6em; font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; }
.tv-tbside .big span { color: var(--muted); margin: 0 .2em; font-weight: 600; }
.tv-tbside .cap { font-size: .8em; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tv-tbside .pd { font-size: 1.05em; margin-top: .25em; color: var(--muted); } .tv-tbside .pd b { color: var(--text); }
.tv-tbside .pd.up b { color: var(--green); } .tv-tbside .pd.down b { color: var(--rose); }
.tv-tbvs { align-self: center; font-size: 1.4em; font-weight: 900; color: var(--muted); }
.tv-dot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; margin-right: .4em; vertical-align: .02em; }
.tv-dot.blue { background: var(--accent); } .tv-dot.black { background: #0b0d12; box-shadow: 0 0 0 2px #cfd6e6 inset; }
.tv-top td { font-size: 1.02em; padding: .17em .3em; }

/* sponsors */
.tv-foot { display: flex; align-items: center; gap: 1rem; min-width: 0; height: 4.6rem; border-top: 1px solid var(--line); padding-top: .55rem; }
.tv-foot-label { flex: none; font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); writing-mode: horizontal-tb; }
.tv-marquee { flex: 1; min-width: 0; overflow: hidden; display: flex; height: 100%; justify-content: center; }
.tv-marquee.moving { justify-content: flex-start; -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.tv-track[hidden] { display: none; }
.tv-track { display: flex; align-items: center; gap: 2.4rem; padding-right: 2.4rem; flex: none; }
.tv-marquee.moving .tv-track { animation: tvscroll var(--tv-dur, 30s) linear infinite; }
@keyframes tvscroll {
  from { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
  to { -webkit-transform: translate3d(-50%, 0, 0); transform: translate3d(-50%, 0, 0); }
}
.tv-sp { display: flex; align-items: center; gap: .7rem; flex: none; white-space: nowrap; }
.tv-sp-img { display: flex; align-items: center; justify-content: center; height: 3.3rem; padding: .25rem .6rem; background: #fff; border-radius: .5rem; }
.tv-sp-img img { max-height: 2.8rem; max-width: 10rem; width: auto; height: auto; object-fit: contain; display: block; }
.tv-sp b { font-size: 1.15rem; font-weight: 750; }
.tv-sp-text span { display: flex; flex-direction: column; line-height: 1.15; }
.tv-sp-text small { font-size: .8rem; color: var(--muted); }
.tv-medal { width: 1.3rem; height: 1.3rem; border-radius: 50%; flex: none; background: var(--muted); }
.tv-sp-text.gold .tv-medal { background: radial-gradient(circle at 35% 30%, #fff3b0, var(--gold) 55%, #a87a12); }
.tv-sp-text.silver .tv-medal { background: radial-gradient(circle at 35% 30%, #fff, var(--silver) 55%, #7d8796); }
.tv-sp-text.bronze .tv-medal { background: radial-gradient(circle at 35% 30%, #ffd9b5, var(--bronze) 55%, #7a4a22); }
.tv-sp-text.gold b { color: #ffe7a0; }

/* controls (appear on mouse move) */
.tv-ctrl { position: fixed; top: .8rem; right: .8rem; display: flex; gap: .5rem; z-index: 5; }
.tv-ctrl[hidden] { display: none; }
.tv-ctrl button, .tv-ctrl a { font: 600 15px var(--font); color: var(--text); background: rgba(17,26,48,.92); border: 1px solid var(--line); border-radius: 999px; padding: .5rem 1rem; cursor: pointer; text-decoration: none; }
.tv-ctrl button:hover, .tv-ctrl a:hover { border-color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .tv-marquee.moving .tv-track { animation-duration: calc(var(--tv-dur, 30s) * 2); } .tv-pill.live, .tv-livedot { animation: none; } }
/* Nov 30 (Nicholas): "everything on one TV" - no paging; courts / standings / bracket are sized to fit (tv.js fit()) */
.tv-main.wide { grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); }
.tv-in { min-width: 0; }
.tv-in .tv-panel-h h2 { font-size: 1.15em; }
.tv-lowerwrap { margin-top: .8em; padding-top: .6em; border-top: 1px solid var(--line); }
.tv-cgrid { gap: .45em; }
/* Nov 30 (Nicholas): solid white sponsors bar, logos float on it (no boxes); text-only sponsors dark on white */
.tv-root { padding-bottom: 0; }
.tv-foot { background: #fff; border-top: 0; margin: 0 -1.1rem; padding: .35rem 1.1rem; height: 5rem; }
.tv-foot-label { color: #5b6478; }
.tv-sp-img { background: transparent; padding: 0; border-radius: 0; height: 4.1rem; }
.tv-sp-img img { max-height: 4.1rem; max-width: 12rem; }
.tv-sp b { color: #0f172a; }
.tv-sp-text small { color: #5b6478; }
.tv-sp-text.gold b { color: #0f172a; }
.tv-marquee.moving { -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.tv-nosp .tv-root { padding-bottom: .8rem; }
.tv-court { grid-template-columns: 4.6em minmax(14em, 1fr); }
.tv-pool table { min-width: 16em; }
.tv-cgrid { min-height: 100%; grid-auto-rows: 1fr; }
.tv-cbody { display: flex; flex-direction: column; justify-content: center; }
.tv-pool .n { width: 2.4em; }
.tv-pool th:last-child, .tv-pool td:last-child { width: 3.1em; }
.tv-pool .r { width: 1.6em; }
.tv-openrow { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: .5em; padding: .4em .7em; border: 1px dashed var(--line); border-radius: .8em; color: var(--muted); font-size: 1em; }
.tv-openrow span { font-size: .8em; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; margin-right: .3em; }
.tv-ochip { display: inline-flex; align-items: center; justify-content: center; min-width: 2em; height: 2em; padding: 0 .4em; border-radius: .5em; background: rgba(26,159,255,.12); color: #bfe2ff; font-size: 1.15em; }
.tv-cgrid { grid-auto-rows: auto; align-content: stretch; }
.tv-bcol { min-width: 11em; }
.tv-cwrap { display: flex; flex-direction: column; gap: .45em; min-height: 100%; }
.tv-cwrap > .tv-cgrid { flex: 1; min-height: 0; grid-auto-rows: 1fr; }
.tv-openrow { grid-column: auto; flex: none; }
.tv-cwrap > .tv-cgrid { grid-auto-rows: auto; align-content: start; }
.tv-cwrap > .tv-cgrid:empty { display: none; }
.tv-cwrap > .tv-openrow:only-of-type { margin-top: 0; }
.tv-court { grid-template-columns: 3.8em minmax(14em, 1fr); }
.tv-cnum { font-size: 2.1em; }
.tv-cbody { padding: .4em .6em .45em; }
.tv-court { grid-template-columns: 3.6em minmax(12em, 1fr); }
/* compact court card: the court number is a header strip, so names get the full card width */
.tv-court { display: flex; flex-direction: column; }
.tv-cnum { flex-direction: row; align-items: baseline; justify-content: flex-start; gap: .35em; font-size: 1.35em; line-height: 1.1; padding: .22em .5em .18em; }
.tv-cnum small { font-size: .6em; letter-spacing: .1em; margin: 0; }
.tv-cbody { padding: .3em .6em .4em; }
.tv-court.pre .tv-cnum { font-size: 1.6em; }
.tv-cbody { min-width: 13em; }
/* Dec 1 (Nicholas): always-moving ticker on the white bar; styled names for text-only sponsors */
.tv-marquee { justify-content: flex-start; }
.tv-marquee .tv-track {
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
}
.tv-track { gap: 0; padding-right: 0; }
.tv-sp { padding: 0 1.6rem; position: relative; }
.tv-sp::after { content: ""; position: absolute; right: 0; top: 18%; bottom: 18%; width: 1px; background: #d6dbe6; }
.tv-sp-text b { font-size: 1.35rem; font-weight: 800; letter-spacing: -.005em; color: #0f172a; }
.tv-sp-text small { font-size: .85rem; color: #5b6478; margin-top: .1rem; }
.tv-sp-text .tv-medal { width: 1.5rem; height: 1.5rem; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.tv-sp-text.silver b { color: #1f2937; }
/* Dec 1: tier labels in the ticker (Gold, Silver, Equipment Sponsor, Charitable Partners) */
.tv-sp-tier { flex: none; display: inline-flex; align-items: center; gap: .5rem; margin: 0 .6rem 0 1.2rem; padding: .35rem .9rem; border-radius: 999px; font-size: .95rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; color: #fff; background: #8a6d12; }
.tv-sp-tier .tv-medal { width: 1.1rem; height: 1.1rem; box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.tv-sp-tier.gold { background: linear-gradient(135deg, #b8860b, #e0b423); }
.tv-sp-tier.silver { background: linear-gradient(135deg, #6b7280, #a7afbb); }
.tv-sp-tier.bronze { background: linear-gradient(135deg, #7a4a22, #c47f45); }
.tv-sp-tier.equipment { background: linear-gradient(135deg, #155e6e, #22a0b8); }
.tv-sp-tier.charity { background: linear-gradient(135deg, #8c1830, #d03a58); }
.tv-sp-tier.gold .tv-medal { background: radial-gradient(circle at 35% 30%, #fff3b0, var(--gold) 55%, #a87a12); }
.tv-sp-tier.silver .tv-medal { background: radial-gradient(circle at 35% 30%, #fff, var(--silver) 55%, #7d8796); }
.tv-sp-tier.bronze .tv-medal { background: radial-gradient(circle at 35% 30%, #ffd9b5, var(--bronze) 55%, #7a4a22); }
.tv-sp-text.equipment .tv-medal, .tv-sp-tier.equipment .tv-medal { background: radial-gradient(circle at 35% 30%, #c9f3fb, #22a0b8 55%, #155e6e); }
.tv-sp-text.charity .tv-medal, .tv-sp-tier.charity .tv-medal { background: radial-gradient(circle at 35% 30%, #ffd1db, #d03a58 55%, #8c1830); }
.tv-sp-text .tv-medal { width: 1.15rem; height: 1.15rem; }
.tv-sp-tier + .tv-sp { padding-left: .8rem; }

/* Dec 1 (Nicholas): sponsor logos (plaque crops) float on the white bar at one consistent height. */
.tv-sp-logo.only .tv-sp-img { height: 3.6rem; }
.tv-sp-logo.only .tv-sp-img img { height: 3.6rem; max-height: 3.6rem; width: auto; max-width: 19rem; object-fit: contain; border-radius: .35rem; }
.tv-sp-logo.only { padding: 0 1.05rem; }
.tv-sp-logo.only .tv-sp-img, .tv-sp-logo.only .tv-sp-img img { height: 3.3rem; max-height: 3.3rem; }

/* Dec 1 (Nicholas): Team Battle courts advance on their own; a court already on a later round gets a highlighted round label. */
.tv-court.ahead .tv-now-l { color: #7ee2b8; }
/* Dec 1 (Nicholas): stacked doubles names on court cards (one player per line) */
.tv-team.tv-stack { display: flex; align-items: center; flex: 1 1 auto; min-width: 0; white-space: normal; overflow: visible; }
.tv-pls { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.15; }
.tv-pl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-court .tv-row { padding: .12em 0; }
.tv-court .tv-row + .tv-row { border-top: 1px solid rgba(255,255,255,.06); }
.tv-court .tv-cbody { min-width: 9em; } /* Dec 1: stacked names need less width, so cards can scale up */

/* Dec 1 (Nicholas): "Court" and the number share one size and one weight on every court card, every tournament. */
.tv-court .tv-cnum {
  font-size: 1em;
  font-weight: 700;
  align-items: center;
  gap: .3em;
  letter-spacing: .02em;
  line-height: 1.1;
  padding: .18em .55em .16em;
  white-space: nowrap;
}
.tv-court .tv-cnum small {
  font-size: 1em;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-transform: none;
  color: inherit;
  margin: 0;
}
.tv-court.pre .tv-cnum { font-size: 1em; }

/* Dec 1 (Nicholas): CMPBA (and any group with tvBackdrop / a matching cover) gets a faded logo behind the TV board. */
.tv-root { position: relative; }
.tv-root.tv-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--tv-brand-img);
  background-repeat: no-repeat;
  background-position: center 42%;
  background-size: min(78vmin, 920px);
  opacity: .22;
  pointer-events: none;
  z-index: 0;
  filter: saturate(1.05);
}
.tv-root.tv-brand > * { position: relative; z-index: 1; }

/* Dec 1 (Nicholas): CMPBA-only TV palette — richer emerald gradient, soft vignette,
   faint gold Islamic lattice in the corners, gold headings and card hairlines, cream header text.
   Quiet enough that sponsors, standings, and matchups stay in front. Other tournaments are unchanged. */
.tv-root.tv-brand-cmpba {
  --cm-cream: #f6efdc;
  --cm-cream-2: #efe4c8;
  --cm-gold: #c9a227;
  --cm-gold-2: #e6c25a;
  background:
    radial-gradient(ellipse at 50% 42%, transparent 26%, rgba(2, 10, 6, .58) 100%),
    radial-gradient(ellipse at 50% 38%, rgba(29, 107, 69, .55) 0%, rgba(14, 61, 38, .28) 46%, transparent 70%),
    linear-gradient(180deg, #11462c 0%, #0b2f1e 40%, #071910 100%);
}
body.tv-brand-cmpba { background: #071910; }
.tv-root.tv-brand-cmpba::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .17;
  background-image: url("/cmpba-tv-lattice.svg");
  background-repeat: repeat;
  background-size: min(38vmin, 400px);
  -webkit-mask-image: radial-gradient(ellipse 62% 56% at 50% 42%, transparent 36%, rgba(0,0,0,.4) 68%, #000 100%);
  mask-image: radial-gradient(ellipse 62% 56% at 50% 42%, transparent 36%, rgba(0,0,0,.4) 68%, #000 100%);
}

.tv-brand-cmpba .tv-title h1,
.tv-brand-cmpba .tv-clock { color: var(--cm-cream); }
.tv-brand-cmpba .tv-title p,
.tv-brand-cmpba .tv-sub { color: #d9cc9e; }
.tv-brand-cmpba .tv-head { border-bottom-color: rgba(201, 162, 39, .55); }
.tv-brand-cmpba .tv-panel-h h2 { color: var(--cm-gold-2); }
.tv-brand-cmpba .tv-pool h3 { color: var(--cm-cream); }

.tv-brand-cmpba .tv-court,
.tv-brand-cmpba .tv-pool,
.tv-brand-cmpba .tv-tbside,
.tv-brand-cmpba .tv-bm {
  background: rgba(5, 14, 10, .92);
  border: 1px solid rgba(201, 162, 39, .28);
  border-top: 2px solid rgba(201, 162, 39, .72);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .38);
}
.tv-brand-cmpba .tv-court.busy { border-color: rgba(201, 162, 39, .45); border-top-color: rgba(230, 194, 90, .9); }
.tv-brand-cmpba .tv-cnum {
  background: rgba(14, 61, 38, .72);
  color: var(--cm-gold-2);
}
.tv-brand-cmpba .tv-court.busy .tv-cnum {
  background: rgba(16, 74, 45, .8);
  color: var(--cm-gold-2);
}

/* Team colors stay distinct (blue Falcons, black/white Scorpions); gold hairline is just the brand edge. */
.tv-brand-cmpba .tv-tbside.blue {
  background: linear-gradient(180deg, rgba(26, 159, 255, .34), rgba(6, 14, 24, .94));
  border-color: rgba(26, 159, 255, .55);
  border-top: 2px solid rgba(201, 162, 39, .72);
}
.tv-brand-cmpba .tv-tbside.black {
  background: linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(8, 8, 12, .95));
  border-color: rgba(220, 226, 240, .42);
  border-top: 2px solid rgba(201, 162, 39, .72);
}

.tv-brand-cmpba .tv-foot { /* keep the sponsors bar solid white */ }
