/* app.css: one stylesheet for the public bracket, the control screens, and the broadcast output. */
/* Fonts are served from this host so the screens do not depend on a third party at the range. Both are SIL Open Font License. */
@font-face { font-family: 'Bebas Neue'; font-weight: 400; font-display: swap; src: url('fonts/bebas-neue-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 500; font-display: swap; src: url('fonts/barlow-condensed-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url('fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url('fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); }
:root {
  --ink: #0b0b0d;
  --panel: #15161a;
  --panel-2: #1d1f25;
  --line: #2c2f38;
  --paper: #f3f0e8;
  --dim: #9a9ca6;
  --red: #c8102e;
  --red-deep: #8f0b20;
  --navy: #10224a;
  --gold: #d8ab4c;
  --gold-deep: #9c7426;
  --green: #2fbf71;
  /* Bebas Neue matches the stream package. It ships in one weight; heavier weights below are synthesized, which gives the added heft. */
  --display: 'Bebas Neue', 'Arial Narrow', Impact, sans-serif;
  --stencil: 'Bebas Neue', 'Arial Narrow', Impact, sans-serif;
  --label: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--paper); }
body { font-family: var(--label); font-size: 18px; line-height: 1.35; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; text-wrap: balance; }

/* ── Bracket ─────────────────────────────────────── */
.bk { display: inline-flex; flex-direction: column; gap: 26px; }
.bk-sechead { font-family: var(--label); font-weight: 700; font-size: 15px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.bk-rounds { display: flex; gap: 26px; align-items: stretch; }
.bk-round { display: flex; flex-direction: column; width: 250px; flex: none; }
.bk-rlabel { font-weight: 600; font-size: 14px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); padding-bottom: 8px; white-space: nowrap; }
.bk-col { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 10px; }
.bk-bout { position: relative; display: block; width: 100%; padding: 0; text-align: left; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--line); }
button.bk-bout:hover { border-color: var(--dim); }
.bk-bout.st-dead { visibility: hidden; }
.bk-bout.st-ready { border-left-color: var(--red); }
.bk-bout.is-current { border-color: var(--gold); border-left-color: var(--gold); box-shadow: 0 0 0 2px rgba(216, 171, 76, 0.35); }
.bk-id { position: absolute; right: 6px; top: -9px; padding: 0 5px; background: var(--ink); font-size: 11px; letter-spacing: 0.1em; color: var(--dim); }
.bk-slot { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; }
.bk-slot + .bk-slot { border-top: 1px solid var(--line); }
.bk-seed { width: 18px; flex: none; text-align: right; font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; }
.bk-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--display); font-weight: 400; font-size: 23px; letter-spacing: 0.04em; line-height: 1; padding-top: 2px; text-transform: uppercase; }
.bk-tick { font-weight: 700; font-size: 12px; letter-spacing: 0.08em; color: var(--ink); background: var(--gold); padding: 0 5px; }
.bk-slot.is-win .bk-name { color: #fff; }
.bk-slot.is-lose .bk-name { color: var(--dim); text-decoration: line-through; text-decoration-color: rgba(154, 156, 166, 0.5); }
.bk-slot.is-tbd .bk-name, .bk-slot.is-bye .bk-name { font-family: var(--label); font-weight: 500; font-size: 15px; letter-spacing: 0.04em; text-transform: none; color: #6f727c; }

/* ── Public page ─────────────────────────────────── */
.pub { min-height: 100vh; }
.pub-head { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-bottom: 3px solid var(--red); background: linear-gradient(180deg, #17181c, var(--ink)); }
.pub-head img { height: 56px; width: auto; }
.pub-head h1 { font-size: clamp(24px, 5vw, 38px); line-height: 1; }
.pub-head p { margin: 4px 0 0; color: var(--dim); letter-spacing: 0.14em; text-transform: uppercase; font-size: 14px; }
.pub-status { display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line); font-size: 18px; font-weight: 600; }
.pub-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dim); flex: none; }
.pub-status.is-live .pub-dot { background: var(--red); box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.25); }
.pub-status.is-done .pub-dot { background: var(--gold); }
.pub-scroll { overflow-x: auto; padding: 22px 20px 28px; -webkit-overflow-scrolling: touch; }
.pub-empty { padding: 40px 20px; color: var(--dim); max-width: 60ch; }
.pub-teams { padding: 0 20px 32px; }
.pub-teams h2 { font-size: 22px; margin-bottom: 10px; }
.pub-teams ol { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.pub-teams li { display: grid; grid-template-columns: 30px 1fr; gap: 0 8px; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); }
.pub-teams li.is-out { opacity: 0.5; }
.pub-teams .n { grid-row: span 2; align-self: center; text-align: right; color: var(--dim); font-variant-numeric: tabular-nums; }
.pub-teams b { font-family: var(--display); font-size: 20px; text-transform: uppercase; letter-spacing: 0.02em; }
.pub-teams span.s { color: var(--dim); font-size: 15px; }
.pub-foot { padding: 14px 20px 26px; color: var(--dim); font-size: 14px; letter-spacing: 0.08em; }
.pub-foot a { color: var(--paper); }
body.is-embed .pub-head, body.is-embed .pub-foot { display: none; }

/* ── Control screens (director, producer) ────────── */
.ctl { max-width: 880px; margin: 0 auto; padding: 14px 14px 80px; }
.ctl.is-wide { max-width: 1500px; }
.ctl-top { display: flex; align-items: center; gap: 12px; padding: 4px 0 14px; }
.ctl-top h1 { font-size: 24px; flex: 1; line-height: 1.05; }
.ctl-conn { display: flex; align-items: center; gap: 6px; font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.ctl-conn i { width: 12px; height: 12px; border-radius: 50%; background: var(--red); }
.ctl-conn.is-on i { background: var(--green); }
.ctl h2 { font-size: 16px; font-family: var(--label); font-weight: 700; letter-spacing: 0.22em; color: var(--gold); margin: 22px 0 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 18px; background: var(--panel-2); border: 1px solid var(--line); color: var(--paper); font-family: var(--label); font-weight: 700; font-size: 18px; letter-spacing: 0.08em; text-transform: uppercase; }
.btn:hover { border-color: var(--dim); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-red { background: var(--red); border-color: var(--red); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn-sm { min-height: 40px; padding: 0 12px; font-size: 15px; }
.btn.is-on { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ctl input[type=text], .ctl input[type=password], .ctl select { width: 100%; min-height: 52px; padding: 0 12px; background: #0f1013; border: 1px solid var(--line); color: var(--paper); font: inherit; font-size: 20px; }
.ctl input:focus, .ctl select:focus, .btn:focus-visible, .bk-bout:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ctl label { display: block; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); margin-bottom: 4px; }
.grid3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; }
@media (max-width: 640px) { .grid3 { grid-template-columns: 1fr; } }
.msg { margin: 10px 0; padding: 10px 12px; background: #2a1116; border: 1px solid var(--red); display: none; }
.msg.is-on { display: block; }
.card { background: var(--panel); border: 1px solid var(--line); padding: 14px; }
.tlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tlist li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); }
.tlist .n { text-align: right; color: var(--dim); font-variant-numeric: tabular-nums; font-size: 20px; }
.tlist b { display: block; font-family: var(--display); font-size: 22px; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.1; }
.tlist small { color: var(--dim); font-size: 15px; }
.now { border: 2px solid var(--gold); background: var(--panel); padding: 14px; }
.now-round { font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); font-size: 16px; }
.now-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
@media (max-width: 520px) { .now-pick { grid-template-columns: 1fr; } }
.pick { min-height: 150px; padding: 14px; background: var(--panel-2); border: 2px solid var(--line); text-align: left; display: flex; flex-direction: column; justify-content: center; }
.pick:hover, .pick:focus-visible { border-color: var(--gold); }
.pick .t { font-family: var(--display); font-weight: 900; font-size: clamp(28px, 6vw, 44px); line-height: 0.95; text-transform: uppercase; overflow-wrap: anywhere; }
.pick .s { margin-top: 8px; color: var(--dim); font-size: 18px; }
.pick .k { margin-top: 10px; font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.deck { color: var(--dim); margin-top: 10px; font-size: 17px; }
.sheet { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.82); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.sheet.is-on { display: flex; }
.sheet .card { width: min(560px, 100%); border-color: var(--gold); }
.sheet h3 { font-size: 34px; line-height: 1; margin: 6px 0 4px; }
.sheet p { margin: 6px 0 14px; color: var(--dim); }
.sheet .row .btn { flex: 1; }
.scenes { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
.preview { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line); overflow: hidden; }
.preview iframe { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; border: 0; transform-origin: 0 0; }
.ctl-scroll { overflow-x: auto; padding: 12px 2px 6px; }

/* ── Broadcast output: a fixed 1920x1080 canvas, scaled to the window ── */
body.out { overflow: hidden; background: #000; cursor: none; }
.canvas { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; overflow: hidden; background: var(--out-bg, #0b0b0d); }
.canvas.is-key { background: var(--key, #00ff00); }
.scene { position: absolute; inset: 0; display: none; }
.scene.is-on { display: block; }
.art { position: absolute; inset: 0; background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(200, 16, 46, 0.20), transparent 70%),
    radial-gradient(ellipse 120% 70% at 50% 115%, rgba(16, 34, 74, 0.75), transparent 62%),
    linear-gradient(180deg, #121317, #08080a); }
.art.has-img { background-size: cover; background-position: center; }
.art::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, var(--dim, 0.5)); }
/* Supplied background art is busy in the middle; text-heavy scenes sit on a heavier wash. */
.art.has-img { --dim: 0.82; }
.sc-matchup .art.has-img { --dim: 0.55; }
.sc-sponsor .art.has-img { --dim: 0.7; }
/* The supplied background carries a badge in its top-left corner; start the title to the right of it. */
.canvas.has-bg .o-top { left: 350px; }
.o-top { position: absolute; left: 80px; right: 80px; top: 54px; display: flex; align-items: center; justify-content: space-between; z-index: 2; }
.o-top img { height: 150px; width: auto; }
.o-event { font-family: var(--stencil); font-size: 56px; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1; }
.o-event small { display: block; margin-top: 10px; font-family: var(--label); font-weight: 600; font-size: 26px; letter-spacing: 0.42em; color: var(--gold); }
.o-rule { height: 4px; background: linear-gradient(90deg, transparent, var(--red) 20%, var(--red) 80%, transparent); }

/* Head-to-head backer bar: left team, center plate, right team. */
.bar { position: absolute; left: 70px; right: 70px; display: grid; grid-template-columns: 1fr 250px 1fr; align-items: stretch; z-index: 2; }
.bar-side { position: relative; display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 0 70px;
  background: linear-gradient(180deg, #1c1d22, #0d0e11); border-top: 3px solid var(--gold-deep); border-bottom: 3px solid var(--red); }
.bar-side.l { clip-path: polygon(0 0, calc(100% - 46px) 0, 100% 100%, 0 100%); padding-right: 96px; border-left: 26px solid var(--navy); }
.bar-side.r { clip-path: polygon(46px 0, 100% 0, 100% 100%, 0 100%); padding-left: 96px; text-align: right; border-right: 26px solid var(--navy); }
.bar-side::before { content: ""; position: absolute; top: 0; bottom: 0; width: 14px; background: var(--red); }
.bar-side.l::before { left: 0; } .bar-side.r::before { right: 0; }
.bar-team { font-family: var(--display); font-weight: 900; text-transform: uppercase; line-height: 0.92; letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; }
.bar-shooters { margin-top: 12px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: #d9d6cd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-seed { font-weight: 700; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.bar-mid { position: relative; margin: 0 -46px; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: linear-gradient(180deg, #24252b, #101114); clip-path: polygon(0 0, 100% 0, calc(100% - 46px) 100%, 46px 100%); }
.bar-round { font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; line-height: 1.05; padding: 0 30px; }
.bar-vs { margin-top: 10px; padding: 2px 26px 6px; background: linear-gradient(180deg, #e8c46c, var(--gold-deep)); color: var(--ink); font-family: var(--display); font-weight: 900; font-style: italic; line-height: 1; }

.sc-matchup .bar { top: 400px; height: 330px; }
.sc-matchup .bar-team { font-size: 136px; }
.sc-matchup .bar-team.is-long { font-size: 98px; }
.sc-matchup .bar-shooters { font-size: 30px; }
.sc-matchup .bar-seed { font-size: 24px; }
.sc-matchup .bar-round { font-size: 30px; }
.sc-matchup .bar-vs { font-size: 84px; }
.o-deck { position: absolute; left: 0; right: 0; bottom: 96px; text-align: center; z-index: 2; font-weight: 600; font-size: 30px; letter-spacing: 0.3em; text-transform: uppercase; color: #d9d6cd; }
.o-deck b { color: var(--gold); font-weight: 700; }

.sc-lower .bar { bottom: 70px; height: 170px; }
.sc-lower .bar-team { font-size: 80px; }
.sc-lower .bar-team.is-long { font-size: 60px; }
.sc-lower .bar-shooters { font-size: 22px; margin-top: 8px; }
.sc-lower .bar-seed { display: none; }
.sc-lower .bar-round { font-size: 20px; }
.sc-lower .bar-vs { font-size: 46px; }

.o-center { position: absolute; inset: 250px 120px 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; z-index: 2; }
.o-kicker { font-family: var(--stencil); font-size: 64px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); line-height: 1; }
.o-big { margin-top: 26px; font-family: var(--display); font-weight: 900; font-size: 230px; line-height: 0.9; text-transform: uppercase; max-width: 1600px; overflow-wrap: anywhere; text-wrap: balance; }
.o-big.is-long { font-size: 160px; }
.o-sub { margin-top: 30px; font-weight: 600; font-size: 44px; letter-spacing: 0.24em; text-transform: uppercase; }
.o-note { margin-top: 34px; font-weight: 600; font-size: 30px; letter-spacing: 0.3em; text-transform: uppercase; color: #cfccc3; }
.o-note b { color: var(--gold); }
.sc-champion .o-kicker { font-size: 84px; }

.sc-bracket .o-top { top: 34px; }
.sc-bracket .o-top img { height: 96px; }
.sc-bracket .o-event { font-size: 46px; }
.sc-bracket .o-event small { font-size: 20px; margin-top: 6px; }
.o-bracket { position: absolute; left: 60px; right: 60px; top: 160px; bottom: 44px; display: flex; align-items: center; justify-content: center; z-index: 2; }
.o-bracket .bk-bout { background: rgba(21, 22, 26, 0.92); }
.sc-sponsor img { position: absolute; left: 20%; top: 16%; width: 60%; height: 68%; object-fit: contain; z-index: 2; }
