/* ============================================================================
   WELL RUN · SIGNAL SYSTEM — WR SCORE · VIRTUAL BOARD
   The Virtual Board page: the hall screen that turns to the sponsor when the
   clock stops, the board that takes the screen's shape, themes and one score.
   ============================================================================ */

/* ── Opening: centred head ──────────────────────────────────────────────── */
.sch-vb-top { max-width: 1120px; gap: 32px; }
.sch-vb-top .sch-h1 { text-wrap: balance; }
.sch-vb-top .sch-body { max-width: 760px; }

/* ── The hall screen on the photo: two layers, one screen ───────────────── */
.sch-vb-stage {
  align-items: flex-start;
  padding: clamp(56px, 4vw, 64px) clamp(16px, 4vw, 64px);
  border-radius: var(--wr-radius-card);
  min-height: clamp(320px, 48vw, 880px);
}
.sch-vb-screen {
  position: relative;
  display: grid;
  width: min(100%, 960px);
  aspect-ratio: 16 / 9;
  container-type: size;
  box-shadow: var(--wr-shadow-md);
}
.sch-vb-layer {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5cqw;
  padding: 4cqw;
  min-width: 0;
  transition: opacity 0.6s var(--wr-ease-out), transform 0.6s var(--wr-ease-out), visibility 0.6s;
}
.sch-vb-layer.is-off { opacity: 0; transform: scale(0.98); visibility: hidden; }
.sch-vb-layer--sponsor { gap: 3.4cqw; }
.sch-vb-screen .sch-label { font-size: clamp(8px, 1.25cqw, 12px); text-align: center; }
.sch-vb-screen__clock { height: 11.6cqw; gap: 1.2cqw; }
.sch-vb-screen__row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  justify-items: center;
  gap: 5cqw;
}
.sch-vb-screen__side { display: flex; flex-direction: column; align-items: center; gap: 1.25cqw; min-width: 0; }
.sch-vb-screen__score { height: 15cqw; gap: 1.25cqw; }
.sch-vb-screen__shot { height: 5.8cqw; gap: 0.8cqw; }
.sch-vb-mini { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 20px; }

/* ── The hall has screens: three dark screens, then the contrast ────────── */
.sch-vb-dark {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr);
  gap: 16px;
  height: clamp(280px, 24vw, 440px);
}
.sch-vb-dark > .sch-shot,
.sch-vb-duo > .sch-shot,
.sch-vb-same__stream { aspect-ratio: auto; }
.sch-vb-versus .sch-fig-cap { gap: 32px; }
.sch-vb-address { aspect-ratio: 16 / 9; display: flex; align-items: center; }
.sch-vb-address__bar {
  width: 100%;
  min-height: 80px;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--wr-black-15);
  border-radius: var(--wr-radius-pill);
  background: var(--wr-white);
  box-shadow: var(--wr-shadow-md);
}
.sch-vb-address__text {
  min-width: 0;
  font-family: var(--sch-mono);
  font-size: var(--sch-t-body);
  font-weight: 600;
  color: var(--wr-black-72);
}
.sch-vb-address__go { margin-left: auto; }

/* Brand marker that sweeps in behind one phrase as it scrolls into view */
.sch-vb-mark { position: relative; display: inline-block; isolation: isolate; padding: 0 0.16em; }
.sch-vb-mark::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: var(--wr-radius-sm);
  background: var(--wr-grad);
  transform-origin: left center;
}
@keyframes schVbMark { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .sch-vb-mark::before { animation: schVbMark linear both; animation-timeline: view(); animation-range: entry 70% cover 45%; }
  }
}

/* ── A proper scoreboard: photo pair ────────────────────────────────────── */
.sch-vb-duo {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 16px;
  align-items: end;
  height: clamp(420px, 36vw, 640px);
}
.sch-vb-duo > :first-child { height: 100%; }
.sch-vb-duo > :last-child { height: 64%; }

/* ── How it works ───────────────────────────────────────────────────────── */
.sch-vb-steps { gap: clamp(32px, 4vw, 64px); }
.sch-vb-steps .sch-flow__item { gap: 20px; }
.sch-vb-steps__top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.sch-vb-steps .sch-flow__n { line-height: 1; }

/* ── It takes the shape of the screen ───────────────────────────────────── */
.sch-vb-shapes { gap: 40px; }
.sch-vb-picker { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.sch-vb-pills { justify-content: center; }
.sch-vb-pills .sch-pill { gap: 10px; }
.sch-vb-caps { display: grid; justify-items: center; width: 100%; text-align: center; }
.sch-vb-cap { grid-area: 1 / 1; max-width: 820px; transition: opacity 0.32s var(--wr-ease-out); }
.sch-vb-cap.is-off { opacity: 0; visibility: hidden; }
.sch-vb-cap b { color: var(--wr-black); font-weight: 700; }

/* One frame that takes the screen's shape; the board inside is sized from
   the frame's short side (the score is a quarter of it). */
.sch-vb-stage-shape {
  container-type: size;
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(320px, 34vw, 600px);
}
.sch-vb-frame {
  container-type: size;
  flex-shrink: 0;
  border: 1px solid var(--wr-black-15);
  border-radius: var(--wr-radius-card);
  overflow: hidden;
}
.sch-vb-frame--ribbon { width: 100cqw; aspect-ratio: 8 / 1; animation: schVbShapeA 0.55s var(--wr-ease-out); }
.sch-vb-frame--tv     { width: min(100cqw, calc(100cqh * 16 / 9)); aspect-ratio: 16 / 9; animation: schVbShapeB 0.55s var(--wr-ease-out); }
.sch-vb-frame--square { width: min(100cqw, 100cqh); aspect-ratio: 1 / 1; animation: schVbShapeC 0.55s var(--wr-ease-out); }
.sch-vb-frame--tall   { width: min(100cqw, calc(100cqh * 9 / 16)); aspect-ratio: 9 / 16; animation: schVbShapeD 0.55s var(--wr-ease-out); }
@keyframes schVbShapeA { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes schVbShapeB { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes schVbShapeC { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes schVbShapeD { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }

.sch-vb-fit { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.sch-vb-fit[hidden] { display: none; }
.sch-vb-frame .sch-label { font-size: clamp(9px, 3.2cqmin, 12px); text-align: center; }
.sch-vb-score { height: 25cqmin; gap: 2cqmin; }
.sch-vb-clock { height: 16cqmin; gap: 1.4cqmin; }
.sch-vb-shot  { height: 10cqmin; gap: 1cqmin; }
.sch-vb-name  { font-size: clamp(10px, 12cqmin, 18px); }
.sch-vb-poss  { width: clamp(12px, 5cqmin, 24px); height: clamp(12px, 5cqmin, 24px); color: var(--wr-orange); }

.sch-vb-fit--ribbon { justify-content: space-between; gap: 2.4cqw; padding: 0 4cqw; }
.sch-vb-fit__mid { display: flex; align-items: center; gap: 1.6cqw; }
.sch-vb-fit--ribbon .sch-vb-score { gap: 2.4cqmin; }

.sch-vb-fit--tv {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  gap: 3cqw;
  padding: 4cqmin;
}
.sch-vb-fit__side { display: flex; flex-direction: column; align-items: center; gap: 2.4cqmin; min-width: 0; }

.sch-vb-fit--square {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: center;
  align-items: center;
  justify-items: end;
  gap: 5cqmin 7cqmin;
  padding: 9cqmin;
}
.sch-vb-fit--square .sch-label { justify-self: start; }

.sch-vb-fit--tall { flex-direction: column; gap: 1.6cqh; padding: 4cqh 3cqw; }
.sch-vb-fit__gap { margin-top: 1.6cqh; }

.sch-vb-note { max-width: 820px; margin: 0 auto; text-align: center; }

/* Never a blank board: live → held → stale, the score stays on screen */
.sch-vb-held {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: clamp(24px, 3vw, 40px);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.sch-vb-held__text { display: flex; flex-direction: column; gap: 12px; }
.sch-vb-held__text .sch-h4 { font-weight: 800; }
.sch-vb-held__board { container-type: inline-size; display: flex; flex-direction: column; gap: 16px; padding: 24px 28px; }
.sch-vb-held__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sch-vb-held__score { height: 17cqw; gap: 2.4cqw; }
.sch-vb-held__clock { height: 8cqw; gap: 1.2cqw; }
.sch-vb-held__tag {
  min-height: 28px;
  padding: 0 12px;
  border-radius: var(--wr-radius-pill);
  border: 1px solid var(--wr-black-15);
  color: var(--wr-black);
}
.sch-vb-held__board .sch-seg__on { transition: fill 0.4s var(--wr-ease-out); }
.sch-vb-held__board.is-live .sch-dot { animation: schRec 1.6s var(--wr-ease-out) infinite; }
.sch-vb-held__board.is-held .sch-vb-held__tag { border-color: var(--wr-orange); }
.sch-vb-held__board.is-held .sch-dot { background: var(--wr-yellow); }
.sch-vb-held__board.is-stale .sch-vb-held__tag { color: var(--wr-black-72); }
.sch-vb-held__board.is-stale .sch-dot { background: var(--wr-black-38); }
.sch-vb-held__board.is-stale .sch-seg__on { fill: var(--wr-black-38); }

/* ── Photo band: three screens, three shapes ─────────────────────────────── */
.sch-vb-band3 {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 8fr) minmax(0, 3fr);
  gap: 16px;
  height: clamp(280px, 24vw, 440px);
}
.sch-vb-band3__item { border-radius: var(--wr-radius-card); }

/* ── Sponsors: the game line (air time only in the stops) ────────────────── */
.sch-vb-line { display: flex; gap: 6px; }
.sch-vb-line__seg { flex: var(--w, 1) 1 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
/* A stop is as wide as its name; the quarters share what is left. */
.sch-vb-line__seg--air { flex: none; width: max-content; }
.sch-vb-bar { display: block; height: 12px; border-radius: var(--wr-radius-pill); background: var(--wr-black-10); }
.sch-vb-line__seg--air .sch-vb-bar { background: var(--wr-grad); }
.sch-vb-line__seg--play { text-align: center; }
.sch-vb-line__seg--end { text-align: right; }
.sch-vb-line .sch-label { overflow-wrap: normal; }

.sch-vb-proof { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.sch-vb-record { position: relative; padding: 8px 32px; display: flex; flex-direction: column; }
.sch-vb-record .sch-row { padding: 16px 0; }
.sch-vb-record__row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) auto; }

/* Corner tally: four brackets draw round the record on hover */
.sch-vb-tally { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 4; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--wr-orange) 55%, transparent)); }
.sch-vb-tally svg { position: absolute; overflow: visible; }
.sch-vb-tally path { fill: none; stroke: var(--wr-orange); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.sch-vb-tally__tl { top: 0; left: 0; }
.sch-vb-tally__tr { top: 0; right: 0; }
.sch-vb-tally__br { bottom: 0; right: 0; }
.sch-vb-tally__bl { bottom: 0; left: 0; }
@media (hover: hover) and (pointer: fine) {
  .sch-vb-tally-host:hover .sch-vb-tally path { animation: schVbTally 3.2s cubic-bezier(0.5, 0, 0.2, 1) infinite; }
  .sch-vb-tally-host:hover .sch-vb-tally__tr path { animation-delay: 0.07s; }
  .sch-vb-tally-host:hover .sch-vb-tally__br path { animation-delay: 0.14s; }
  .sch-vb-tally-host:hover .sch-vb-tally__bl path { animation-delay: 0.21s; }
}
@keyframes schVbTally {
  0%   { stroke-dashoffset: 100; opacity: 0; }
  16%  { opacity: 1; }
  44%  { stroke-dashoffset: 0; opacity: 1; }
  78%  { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

/* ── Your look: the mini board wears a theme ────────────────────────────── */
.sch-vb-theme {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 16 / 9;
  padding: clamp(20px, 5.6cqw, 40px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--wr-black-15);
  border-radius: var(--wr-radius-card);
  transition: border-color 0.4s var(--wr-ease-out);
}
.sch-vb-theme--ink { border-color: var(--wr-black); }
.sch-vb-theme--club { border-color: transparent; }
.sch-vb-theme__bg {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--wr-ease-out);
}
.sch-vb-theme__bg--ink { background: var(--wr-black); }
.sch-vb-theme__bg--club { background: var(--wr-grad); }
.sch-vb-theme--ink .sch-vb-theme__bg--ink,
.sch-vb-theme--club .sch-vb-theme__bg--club { opacity: 1; }
.sch-vb-theme__row { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.sch-vb-theme__score { height: 13.7cqw; gap: 1.7cqw; }
.sch-vb-theme__clock { height: 8cqw; gap: 1.2cqw; }
.sch-vb-theme__logo { visibility: hidden; }
.sch-vb-theme--club .sch-vb-theme__logo { visibility: visible; }
.sch-vb-theme .sch-label { transition: color 0.4s var(--wr-ease-out); }
.sch-vb-theme--ink .sch-label { color: var(--wr-white-65); }
.sch-vb-theme--ink .sch-seg__off { fill: var(--wr-white-10); }
.sch-vb-theme--club .sch-label { color: var(--wr-black); }
.sch-vb-theme--club .sch-seg__on { fill: var(--wr-black); }
.sch-vb-theme--club .sch-seg__off { fill: var(--wr-black-10); }

.sch-vb-swatches { display: flex; align-items: center; gap: 16px; }
.sch-vb-swatch {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--wr-black-15);
  cursor: pointer;
  transition: transform 0.2s var(--wr-ease-out), box-shadow 0.2s var(--wr-ease-out);
}
.sch-vb-swatch--light { background: var(--wr-white); }
.sch-vb-swatch--ink { background: var(--wr-black); border-color: var(--wr-black); }
.sch-vb-swatch--club { background: var(--wr-grad); border-color: transparent; }
.sch-vb-swatch.is-on { box-shadow: 0 0 0 4px var(--wr-white), 0 0 0 6px var(--wr-black); }
@media (hover: hover) and (pointer: fine) { .sch-vb-swatch:hover { transform: translateY(-1px); } }

/* ── The same score, everywhere: three windows on one score ─────────────── */
.sch-vb-samepair { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.sch-vb-links { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.sch-vb-same {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 16px;
  height: clamp(520px, 38vw, 640px);
}
.sch-vb-same__phone {
  grid-row: span 2;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  text-align: center;
}
.sch-vb-same__team { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.sch-vb-same__team .sch-pill { padding: 0 16px; }
.sch-vb-same__board { padding: 24px 32px; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.sch-vb-same__segs {
  container-type: inline-size;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  gap: 4.6cqw;
}
.sch-vb-same__score { height: 18.4cqw; gap: 3.4cqw; }
.sch-vb-same__clock { height: 8cqw; gap: 2.4cqw; }
.sch-vb-same__stream { align-items: flex-end; justify-content: flex-start; }
.sch-vb-bug {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-radius: var(--wr-radius-pill);
  box-shadow: var(--wr-shadow-md);
}

/* ── Works when the internet does not: a card on the photo band ─────────── */
.sch-vb-band {
  padding: clamp(56px, 5vw, 80px) clamp(16px, 5vw, 80px);
  border-radius: var(--wr-radius-card);
  min-height: clamp(480px, 44vw, 800px);
}
.sch-vb-band__card {
  width: min(100%, 1040px);
  padding: clamp(32px, 4vw, 64px);
  box-shadow: var(--wr-shadow-md);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
  text-align: left;
}
.sch-vb-band__icon { width: clamp(96px, 10vw, 176px); height: clamp(96px, 10vw, 176px); }
.sch-vb-stop-a { stop-color: var(--wr-yellow); }
.sch-vb-stop-b { stop-color: var(--wr-orange); }
.sch-vb-band__card .sch-head { gap: 20px; }

/* ── Plans and who it is for ────────────────────────────────────────────── */
.sch-vb-plans__actions { align-items: center; gap: 32px; }
.sch-vb-who { gap: 40px; }

/* ── Breakpoints (1260 · 1024 · 768 · 480) ──────────────────────────────── */
@media (max-width: 1024px) {
  .sch-vb-proof,
  .sch-vb-samepair { grid-template-columns: minmax(0, 1fr); }
  .sch-vb-duo { height: clamp(360px, 56vw, 520px); }
  .sch-vb-held { grid-template-columns: minmax(0, 1fr); }
  .sch-vb-address { aspect-ratio: auto; padding: 8px 0; }
  /* The game line stands up: one row per moment, air time as a bar */
  .sch-vb-line { flex-direction: column; gap: 6px; }
  .sch-vb-line__seg,
  .sch-vb-line__seg--air { flex: none; width: auto; display: grid; grid-template-columns: 12px minmax(0, 1fr); align-items: center; gap: 16px; text-align: left; }
  .sch-vb-line__seg--play,
  .sch-vb-line__seg--end { text-align: left; }
  .sch-vb-bar { width: 12px; height: calc(var(--w, 1) * 10px); }
}
@media (max-width: 768px) {
  .sch-vb-stage { padding-top: 112px; align-items: center; }
  .sch-vb-dark { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 200px; height: auto; }
  .sch-vb-dark > :first-child { grid-column: span 2; }
  .sch-vb-address__bar { min-height: 64px; padding: 12px 20px; gap: 12px; }
  .sch-vb-band3 { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 200px; height: auto; }
  .sch-vb-band3 > :nth-child(2) { grid-column: 1 / -1; grid-row: 1; }
  .sch-vb-record { padding: 8px 20px; }
  .sch-vb-record__row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; }
  .sch-vb-record__row > :first-child { grid-column: 1 / -1; }
  .sch-vb-same { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; height: auto; }
  .sch-vb-same__phone {
    grid-row: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    padding: 24px 16px;
    gap: 16px;
  }
  .sch-vb-same__title { grid-column: 1 / -1; }
  .sch-vb-same__stream { min-height: 220px; }
  .sch-vb-band__card { grid-template-columns: minmax(0, 1fr); }
  .sch-vb-band__icon { width: 72px; height: 72px; }
  .sch-vb-plans__actions { flex-direction: column; gap: 16px; }
}
@media (max-width: 480px) {
  .sch-vb-duo { height: 320px; }
  .sch-vb-held__board { padding: 20px; }
}
@container (max-width: 420px) {
  .sch-vb-screen__meta { display: none; }
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .sch-vb-layer, .sch-vb-cap, .sch-vb-theme, .sch-vb-theme__bg, .sch-vb-theme .sch-label,
  .sch-vb-swatch, .sch-vb-held__board .sch-seg__on { transition: none; }
  .sch-vb-frame--ribbon, .sch-vb-frame--tv, .sch-vb-frame--square, .sch-vb-frame--tall,
  .sch-vb-held__board.is-live .sch-dot,
  .sch-vb-tally-host:hover .sch-vb-tally path { animation: none; }
}
