/* Competitions & Leagues (cp-formats.js, cp-event.js, cp-scoring.js, cp-boards.js). The office's work is one desktop
   window, at every width; Live Scoring is a phone and the court's TV side by side (stacked on a narrow screen); the
   wallboard is a TV that rises over the office's window as a window switch is drawn (reference.md §3a). */
.cp-win { left: 26px; top: 20px; width: 848px; height: 500px; }
.cp-win .dv-url-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cp-who { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 5px;
  font: 600 8.5px/1 Geist, Arial, sans-serif; color: #4a463d; white-space: nowrap; }
.cp-who i { width: 15px; height: 15px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 6.5px; letter-spacing: .02em; color: #fff; }

.cp-dev { position: absolute; }
.cp-view { position: absolute; overflow: hidden; }
.cp-page { position: absolute; inset: 0; overflow: hidden; background: #fff; }
.cp-if { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; pointer-events: none; background: #fff; }
/* A page change by the same person: later pages lie over earlier ones and cross-fade in (0.5 s). */
.cp-later { opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility 0s .5s; }
.cp-later.is-on { opacity: 1; visibility: visible; transition: opacity .5s ease, visibility 0s; }
.cp-loading .cp-page { visibility: hidden; }   /* an empty device while a page loads: never a page loading on camera */
/* Real pages kept off camera (the scorers' phones while the wallboard is shown): laid out, never seen. */
.cp-hidden { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.cp-hidden .cp-if { position: absolute; left: 0; top: 0; }

/* The phone: one plain rounded frame (as the narrow composition's), and the TV: a dark bezel, 16:9, on a small stand. */
.cp-phone { border-radius: 30px; background: #1b1a17; box-shadow: 0 0 0 1px rgba(27, 26, 23, .08), 0 22px 50px -18px rgba(27, 26, 23, .45); }
.cp-phone .cp-view { left: 8px; top: 8px; right: 8px; bottom: 8px; border-radius: 23px; background: #F2F4F9; }
.cp-tv-bezel { position: absolute; left: 0; right: 0; top: 0; padding: 9px; border-radius: 9px; background: #15161a;
  box-shadow: 0 0 0 1px rgba(27, 26, 23, .12), 0 26px 50px -20px rgba(27, 26, 23, .5); }
.cp-tv .cp-view { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 2px; background: #0A1430; }
.cp-tv-stand { position: absolute; left: 50%; width: 120px; height: 16px; transform: translateX(-50%); border-radius: 0 0 6px 6px;
  background: linear-gradient(#2a2b30, #15161a); clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%); }
.cp-label { position: absolute; left: 0; right: 0; text-align: center; font: 600 9px/1 Geist, Arial, sans-serif; color: #6e6a60; letter-spacing: .02em; white-space: nowrap; }

/* Live Scoring: the phone on the left, the court's TV on the right. */
.cp-L-pair .cp-phone { left: 52px; top: 16px; width: 228px; height: 488px; }
.cp-L-pair .cp-phone .cp-label { bottom: -14px; }
.cp-L-pair .cp-tv { left: 310px; top: 96px; width: 566px; }
.cp-L-pair .cp-tv .cp-tv-stand { top: calc((566px - 18px) * 9 / 16 + 18px); }
.cp-L-pair .cp-tv .cp-label { top: calc((566px - 18px) * 9 / 16 + 44px); }
/* Narrow: the TV across the top, the phone under it (same page at a shorter phone's height). */
[data-mode="narrow"].cp-L-pair .cp-tv { left: 14px; top: 12px; width: 312px; }
[data-mode="narrow"].cp-L-pair .cp-tv .cp-tv-bezel { padding: 6px; border-radius: 7px; }
[data-mode="narrow"].cp-L-pair .cp-tv .cp-tv-stand { top: calc((312px - 12px) * 9 / 16 + 12px); width: 80px; height: 10px; }
[data-mode="narrow"].cp-L-pair .cp-tv .cp-label { top: calc((312px - 12px) * 9 / 16 + 28px); }
[data-mode="narrow"].cp-L-pair .cp-phone { left: 60px; top: 228px; width: 220px; height: 340px; border-radius: 26px; }
[data-mode="narrow"].cp-L-pair .cp-phone .cp-view { border-radius: 19px; }
[data-mode="narrow"].cp-L-pair .cp-phone .cp-label { display: none; }

/* Live Dashboards: the TV rises over the office's window (a: steps back 0.6 s; b: comes forward 0.7 s, 0.85 s after). */
.cp-L-boards .cp-tv { left: 84px; top: 40px; width: 732px; }
.cp-L-boards .cp-tv .cp-tv-stand { top: calc((732px - 18px) * 9 / 16 + 18px); width: 150px; height: 20px; }
.cp-L-boards .cp-tv .cp-label { top: calc((732px - 18px) * 9 / 16 + 50px); }
.cp-L-boards .cp-dev-a { transition: transform .6s cubic-bezier(.4, 0, .2, 1), filter .6s ease, opacity .6s ease; transform-origin: 50% 35%; }
.cp-L-boards .cp-dev-a.is-back { transform: translateY(-8px) scale(.92); filter: brightness(.82) saturate(.75); opacity: .72; }
.cp-L-boards .cp-dev-a:not(.is-back) { transition-duration: .7s; transition-timing-function: cubic-bezier(.2, .7, .2, 1); }
.cp-L-boards .cp-dev-b { opacity: 0; visibility: hidden; transform: translateY(44px) scale(.96);
  transition: transform .6s cubic-bezier(.4, 0, .2, 1), opacity .45s ease .15s, visibility 0s .6s; }
.cp-L-boards .cp-dev-b.is-on { opacity: 1; visibility: visible; transform: none; transition: transform .7s cubic-bezier(.2, .7, .2, 1), opacity .45s ease, visibility 0s; }

/* A match carried on the order of play (a script's drag has no drag image of its own). */
.cp-ghost { position: absolute; left: 0; top: 0; z-index: 40; display: flex; flex-direction: column; gap: 2px; padding: 4px 7px; max-width: 150px;
  background: #fff; border-radius: 5px; box-shadow: 0 6px 18px rgba(27, 26, 23, .22), 0 0 0 1px #c9c3b6;
  font: 600 7px/1.15 Geist, Arial, sans-serif; color: #1b1a17; opacity: 0; pointer-events: none; transition: opacity .15s ease; }
.cp-ghost small { font-size: 5.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #8a6d1d; }
.cp-ghost.is-on { opacity: .94; }
/* The live line over the wallboard: what the viewer is watching is live. */
.cp-live { position: absolute; z-index: 30; display: flex; align-items: center; gap: 6px; padding: 5px 10px 5px 8px; border-radius: 999px;
  background: rgba(10, 20, 48, .92); color: #fff; font: 600 9px/1 Geist, Arial, sans-serif; letter-spacing: .02em;
  opacity: 0; transform: translateY(-6px); transition: opacity .35s ease, transform .5s cubic-bezier(.2, .85, .2, 1); pointer-events: none; }
.cp-live i { width: 7px; height: 7px; border-radius: 50%; background: #E75055; box-shadow: 0 0 0 0 rgba(231, 80, 85, .6); animation: cp-pulse 1.6s ease-out infinite; }
@keyframes cp-pulse { 0% { box-shadow: 0 0 0 0 rgba(231, 80, 85, .55); } 80%, 100% { box-shadow: 0 0 0 7px rgba(231, 80, 85, 0); } }
.cp-live.is-on { opacity: 1; transform: none; }
.cp-L-boards .cp-live { left: 50%; top: 10px; transform: translate(-50%, -6px); }
.cp-L-boards .cp-live.is-on { transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .cp-later, .cp-later.is-on, .cp-L-boards .cp-dev-a, .cp-L-boards .cp-dev-a:not(.is-back), .cp-L-boards .cp-dev-b, .cp-L-boards .cp-dev-b.is-on,
  .cp-ghost, .cp-live, .cp-live.is-on { transition: none; }
  .cp-live i { animation: none; }
}
