/* Broadcast board (spectator view). A fixed 1920x1080 stage scaled to the window,
   so it renders the same in an OBS browser source and in a test window. Solid
   colours and hard edges only; motion uses transform, opacity and clip-path. */

.bc {
  --bc-bg: #eceeea;
  --bc-panel: #ffffff;
  --bc-panel-2: #f5f6f4;
  --bc-line: #d3d9d4;
  --bc-text: #1c211e;
  --bc-muted: #5f6862;
  --bc-p0: #2a64ad;
  --bc-p1: #bd620c;
  /* Neutral ink for bans and the active phase; red read as a team colour. */
  --bc-strike: #2b302d;
  --bc-ink: #ffffff;
  --bc-scale: 1;
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--bc-bg);
  color: var(--bc-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  cursor: default;
  user-select: none;
}

.bc-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1920px;
  height: 1080px;
  display: grid;
  grid-template-rows: 112px 1fr 96px;
  transform: translate(-50%, -50%) scale(var(--bc-scale));
  transform-origin: center;
}

[data-player="0"] { --bc-team: var(--bc-p0); }
[data-player="1"] { --bc-team: var(--bc-p1); }
b[data-player] { color: var(--bc-team); font-weight: 750; }

.bc-art { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; opacity: 0; transition: opacity .35s ease; }
.bc-art.loaded { opacity: 1; }

/* Top bar */
.bc-top { display: grid; justify-content: center; align-items: center; padding: 0 48px; border-bottom: 2px solid var(--bc-line); }
.bc-phases { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.bc-phases li { position: relative; border: 1px solid var(--bc-line); min-width: 150px; padding: 14px 18px; background: var(--bc-panel); color: var(--bc-muted); font-size: 22px; font-weight: 650; text-align: center; transition: background .3s ease, color .3s ease; }
.bc-phases li.done { color: var(--bc-text); }
.bc-phases li.done::before { content: "✓"; margin-right: 8px; color: var(--bc-muted); }
.bc-phases li.active { background: var(--bc-text); color: var(--bc-ink); }
.bc-phases li.active { border-color: var(--bc-text); }

/* Board */
.bc-board { display: grid; grid-template-columns: 640px 1fr 640px; gap: 40px; padding: 34px 48px 28px; min-height: 0; }

/* Teams */
.bc-team { display: grid; grid-template-rows: auto 1fr auto; gap: 20px; min-height: 0; border-top: 6px solid var(--bc-team); padding-top: 18px; }
.bc-team-head { border: 1px solid var(--bc-line); display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; padding: 0 22px; background: var(--bc-panel); transition: background .35s ease, color .35s ease; }
.bc-team-id { display: grid; gap: 2px; min-width: 0; }
.bc-team-name { overflow: hidden; font-size: 38px; font-weight: 800; letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }
.bc-team-status { min-height: 26px; color: var(--bc-muted); font-size: 21px; font-weight: 600; }
.bc-score { display: inline-block; font-size: 64px; font-weight: 800; line-height: 1; }
.bc-team.on-clock .bc-team-head { border-color: var(--bc-team); background: var(--bc-team); color: var(--bc-ink); }
.bc-team.on-clock .bc-team-status { color: var(--bc-ink); }
.bc-team.on-clock .bc-team-status { animation: bc-status-in .45s ease both; }

.bc-picks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 16px; min-height: 0; }
.bc-pick { border: 1px solid var(--bc-line); position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; min-height: 0; padding: 14px 14px 12px; background: var(--bc-panel); overflow: hidden; }
.bc-pick-art { display: grid; place-items: center; min-height: 0; padding: 6px 10px 0; }
/* Mega and regional names run long, so names wrap to two balanced lines. */
.bc-pick-name { display: -webkit-box; overflow: hidden; font-size: 20px; font-weight: 700; line-height: 1.15; text-align: center; text-wrap: balance; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.bc-pick.filled { background: var(--bc-panel-2); box-shadow: inset 0 -5px 0 var(--bc-team); }

/* The slot the active player fills next: a solid frame that eases in and out. */
.bc-pick.next, .bc-ban.next { box-shadow: inset 0 0 0 3px var(--bc-team); animation: bc-next 1.8s ease-in-out infinite; }

.bc-bans { display: grid; grid-template-columns: auto repeat(6, minmax(0, 1fr)); align-items: center; gap: 10px; }
.bc-bans-label { width: 76px; color: var(--bc-muted); font-size: 21px; font-weight: 650; }
.bc-ban { border: 1px solid var(--bc-line); position: relative; aspect-ratio: 1; background: var(--bc-panel); overflow: hidden; }
.bc-ban-art { position: absolute; inset: 8px; display: grid; place-items: center; }
.bc-ban.filled .bc-art.loaded { opacity: .55; filter: grayscale(1); }
.bc-ban.filled::after { content: ""; position: absolute; left: -10%; top: 50%; width: 120%; height: 6px; background: var(--bc-strike); transform: rotate(-35deg); transform-origin: center; }

/* Center column */
.bc-center { display: grid; grid-template-rows: 1fr auto; gap: 22px; min-height: 0; padding-top: 24px; }
.bc-featured { border: 1px solid var(--bc-line); position: relative; display: grid; grid-template-rows: auto 1fr auto auto; justify-items: center; align-items: center; gap: 10px; min-height: 0; padding: 28px 26px 30px; background: var(--bc-panel); overflow: hidden; }
.bc-featured.is-pick { box-shadow: inset 0 -8px 0 var(--bc-team); }
.bc-featured.is-ban { box-shadow: inset 0 -8px 0 var(--bc-team); }
.bc-stamp { padding: 6px 22px; background: var(--bc-team); color: var(--bc-ink); font-size: 26px; font-weight: 800; }
.bc-featured.is-ban .bc-stamp { background: var(--bc-strike); color: #fff; }
.bc-featured-art { position: relative; display: grid; place-items: center; width: 100%; height: 100%; min-height: 0; }
.bc-featured-art .bc-art { max-width: 380px; max-height: 380px; }
.bc-featured.is-ban .bc-art.loaded { filter: grayscale(1); opacity: .6; }
.bc-featured.is-ban .bc-featured-art::after { content: ""; position: absolute; left: 6%; right: 6%; top: 50%; height: 10px; background: var(--bc-strike); transform: rotate(-35deg); }
.bc-featured-name { font-size: 42px; font-weight: 800; letter-spacing: -.01em; line-height: 1.1; text-align: center; text-wrap: balance; }
.bc-featured-by { color: var(--bc-muted); font-size: 26px; }
.bc-featured.is-empty { grid-template-rows: 1fr auto auto 1fr; align-content: center; }
.bc-featured.is-empty::before { content: ""; }
.bc-featured-title { font-size: 54px; font-weight: 800; letter-spacing: -.01em; text-align: center; }
.bc-clock { position: absolute; z-index: 2; left: 0; right: 0; top: 106px; height: 10px; }
.bc-clock[hidden] { display: none; }
.bc-clock.is-paused .bc-clock-bar { background: var(--bc-muted); }
.bc-clock-bar { display: block; width: 100%; height: 100%; background: var(--bc-team); transform-origin: center; }
.bc-ban.skipped::after { content: ""; position: absolute; left: 30%; right: 30%; top: calc(50% - 2px); height: 4px; background: var(--bc-line); }
.bc-featured.is-skipped .bc-featured-art::after { display: none; }
.bc-featured.is-skipped .bc-featured-name { color: var(--bc-muted); }
.bc-next:empty { visibility: hidden; }
.bc-next { border: 1px solid var(--bc-line); min-height: 64px; margin: 0; padding: 16px 20px; background: var(--bc-panel); font-size: 27px; font-weight: 600; text-align: center; }

/* Footer */
.bc-foot { display: flex; align-items: center; gap: 22px; padding: 0 48px; border-top: 2px solid var(--bc-line); }
.bc-foot-label { color: var(--bc-muted); font-size: 21px; font-weight: 650; white-space: nowrap; }
/* Up to 48 Pokémon in game 5 of a best of 5: chips shrink to fit one row. */
.bc-foot-group { display: flex; align-items: center; gap: 16px; flex: 1 1 0; min-width: 0; }
.bc-locked { flex: 1; min-width: 0; display: flex; flex-wrap: nowrap; gap: 6px; overflow: hidden; }
.bc-foot-group.is-random .bc-art.loaded { filter: grayscale(1); opacity: .55; }
.bc-locked-mon { flex: 0 1 58px; min-width: 0; aspect-ratio: 1; border: 1px solid var(--bc-line); padding: 3px; background: var(--bc-panel); }
.bc-locked-mon .bc-art.loaded { opacity: .7; }


/* Series winner, stays up once the series ends. */
.bc-champion { position: absolute; inset: 0; display: grid; place-items: center; background: var(--bc-bg); }
.bc-champion[hidden] { display: none; }
.bc-champion-card { border: 1px solid var(--bc-line); display: grid; justify-items: center; gap: 12px; width: 1240px; padding: 64px 64px 56px; background: var(--bc-panel); border-top: 12px solid var(--bc-team); }
.bc-champion-kicker { color: var(--bc-muted); font-size: 30px; font-weight: 650; }
.bc-champion-card strong { font-size: 128px; font-weight: 850; letter-spacing: -.025em; line-height: 1.05; color: var(--bc-team); }
.bc-champion-score { font-size: 54px; font-weight: 800; }
.bc-champion-team { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; width: 100%; margin-top: 24px; }
.bc-champion-team span { border: 1px solid var(--bc-line); display: grid; place-items: center; min-width: 0; aspect-ratio: 1; padding: 12px; background: var(--bc-panel-2); }

/* Animations */
.bc-landing { animation: bc-land .7s cubic-bezier(.2, .8, .2, 1) both; }
.bc-landing .bc-art { animation: bc-rise .7s .08s cubic-bezier(.2, .8, .2, 1) both; }
.bc-landing .bc-pick-name { animation: bc-name-in .5s .25s ease both; }
.bc-striking { animation: bc-land .5s cubic-bezier(.2, .8, .2, 1) both; }
.bc-striking::after { animation: bc-strike .35s .3s cubic-bezier(.6, 0, .3, 1) both; }
.bc-enter-left { animation: bc-from-left .6s cubic-bezier(.2, .8, .2, 1) both; }
.bc-enter-right { animation: bc-from-right .6s cubic-bezier(.2, .8, .2, 1) both; }
.bc-enter-left .bc-stamp, .bc-enter-right .bc-stamp { animation: bc-stamp .45s .25s cubic-bezier(.3, 1.4, .5, 1) both; }
.bc-enter-left .bc-featured-art::after, .bc-enter-right .bc-featured-art::after { animation: bc-strike .35s .45s cubic-bezier(.6, 0, .3, 1) both; }
.bc-enter-up { animation: bc-from-below .6s cubic-bezier(.2, .8, .2, 1) both; }
.bc-bump { animation: bc-bump .45s cubic-bezier(.3, 1.4, .5, 1); }
.bc-champion-in { animation: bc-fade .5s ease both; }
.bc-champion-in .bc-champion-card { animation: bc-from-below .7s .15s cubic-bezier(.2, .8, .2, 1) both; }
.bc-champion-in .bc-champion-team span { animation: bc-rise .5s cubic-bezier(.2, .8, .2, 1) both; }
.bc-champion-in .bc-champion-team span:nth-child(2) { animation-delay: .5s; }
.bc-champion-in .bc-champion-team span:nth-child(3) { animation-delay: .58s; }
.bc-champion-in .bc-champion-team span:nth-child(4) { animation-delay: .66s; }
.bc-champion-in .bc-champion-team span:nth-child(5) { animation-delay: .74s; }
.bc-champion-in .bc-champion-team span:nth-child(6) { animation-delay: .82s; }
.bc-champion-in .bc-champion-team span:nth-child(1) { animation-delay: .42s; }

@keyframes bc-land {
  0% { transform: translateY(-28px) scale(1.06); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: none; opacity: 1; }
}
/* Moves artwork only: its opacity follows the load state, so animating opacity
   here made freshly picked artwork flash. */
@keyframes bc-rise { from { transform: translateY(18px); } to { transform: none; } }
@keyframes bc-name-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bc-strike { from { transform: rotate(-35deg) scaleX(0); } to { transform: rotate(-35deg) scaleX(1); } }
@keyframes bc-from-left { from { transform: translateX(-70px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bc-from-right { from { transform: translateX(70px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bc-from-below { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bc-stamp { from { transform: scale(1.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bc-bump { 0% { transform: translateY(14px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes bc-next { 0%, 100% { box-shadow: inset 0 0 0 3px var(--bc-team); } 50% { box-shadow: inset 0 0 0 3px transparent; } }
@keyframes bc-status-in { from { transform: translateX(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bc-fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .bc *, .bc *::before, .bc *::after { animation: none !important; transition: none !important; }
}
