:root {
  --design-width: 1850;
  --design-height: 850;
  --ui-scale: 1;

  --cc-navy-1000: #00101f;
  --cc-navy-950: #001326;
  --cc-navy-925: #01182d;
  --cc-navy-900: #02172c;
  --cc-navy-850: #03213d;
  --cc-navy-800: #063768;
  --cc-navy-760: #06477b;

  --cc-blue-700: #0068d8;
  --cc-blue-600: #087dff;
  --cc-blue-500: #078fe8;
  --cc-blue-400: #06a8f5;

  --cc-cyan: #09c8ff;
  --cc-cyan-bright: #23d7ff;

  --cc-court: #08a761;
  --cc-court-light: #18bd72;
  --cc-court-line: #dcfff6;

  --cc-yellow: #ffc52b;
  --cc-white: #f7fbff;
  --cc-muted: #c4d9ec;

  --ui-font: Inter, "SF Pro Display", "SF Pro Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  font-family: var(--ui-font);
  color-scheme: dark;
  background: #000;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 100%;
  min-height: 100%;
  background: #000;
}

body {
  overflow: hidden;
  color: var(--cc-white);
  font-family: var(--ui-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  user-select: none;
}

button {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.referee-viewport {
  position: relative;
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 30%, rgba(0, 123, 196, 0.11), transparent 42%),
    #000;
}

.referee-stage {
  position: relative;
  width: calc(1850px * var(--ui-scale));
  height: calc(850px * var(--ui-scale));
  flex: 0 0 auto;
}

.referee-canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 1850px;
  height: 850px;
  overflow: hidden;
  transform: scale(var(--ui-scale));
  transform-origin: top left;
  background: var(--cc-navy-900);
}

.referee-header {
  position: absolute;
  inset: 0 0 auto 0;
  width: 1850px;
  height: 127px;
  border-bottom: 2px solid #08b9f4;
  background:
    radial-gradient(circle at 13% -40%, rgba(0, 156, 241, 0.42), transparent 43%),
    linear-gradient(90deg, #074f88 0%, #052b51 31%, #031b33 61%, #02172d 100%);
}

.icon-button {
  display: grid;
  place-items: center;
  background: transparent;
}

.menu-button {
  position: absolute;
  left: 42px;
  top: 31px;
  width: 79px;
  height: 66px;
}

.hamburger {
  width: 53px;
  display: grid;
  gap: 9px;
}

.hamburger i {
  display: block;
  height: 7px;
  border-radius: 8px;
  background: white;
}

.brand-wrap {
  position: absolute;
  left: 168px;
  top: 24px;
  width: 421px;
  height: 81px;
  display: flex;
  align-items: center;
}

.referee-brand {
  display: block;
  width: 411px;
  height: 74px;
  object-fit: contain;
  object-position: left center;
}

.referee-title {
  position: absolute;
  left: 746px;
  top: 23px;
  width: 380px;
  text-align: center;
}

.referee-title__sport {
  font-size: 44px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: 3.8px;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
}

.referee-title__role {
  margin-top: 10px;
  color: #dceeff;
  font-size: 24px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 8.5px;
}

.match-format {
  position: absolute;
  left: 1187px;
  top: 30px;
  width: 220px;
  height: 70px;
  display: grid;
  place-items: center;
  border: 2px solid #1c5b90;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(4, 42, 77, 0.96), rgba(1, 24, 46, 0.96));
  color: #f6fbff;
  font-size: 30px;
  font-weight: 650;
  box-shadow: inset 0 0 0 1px rgba(105, 198, 255, 0.05);
}

.mode-switch {
  position: absolute;
  left: 1425px;
  top: 29px;
  width: 167px;
  height: 72px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 2px solid #008fe9;
  border-radius: 13px;
  overflow: hidden;
  background: #02152a;
}

.mode-switch__item {
  background: transparent;
  font-size: 30px;
  font-weight: 760;
}

.mode-switch__item + .mode-switch__item {
  border-left: 1px solid #007acc;
}

.mode-switch__item.is-active {
  color: #00162a;
  background: linear-gradient(180deg, #1fb9ff, #0b8ee7);
}

.settings-button {
  position: absolute;
  left: 1612px;
  top: 28px;
  width: 80px;
  height: 73px;
  border: 2px solid #3b6b9a;
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(5, 37, 69, 0.95), rgba(1, 20, 38, 0.98));
}

.settings-button svg {
  width: 43px;
  height: 43px;
  fill: none;
  stroke: white;
  stroke-width: 2.5;
}

.device-time {
  position: absolute;
  right: 44px;
  top: 49px;
  min-width: 96px;
  color: white;
  font-size: 31px;
  line-height: 1;
  font-weight: 520;
  text-align: right;
}

.score-strip {
  position: absolute;
  left: 0;
  top: 127px;
  width: 1622px;
  height: 159px;
  background:
    radial-gradient(circle at 50% 5%, #09a9fb 0%, #088fe6 40%, #0766a8 100%);
}

.games-card {
  position: absolute;
  top: 13px;
  height: 137px;
  display: grid;
  align-content: center;
  justify-items: center;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(2, 35, 65, 0.99), rgba(0, 20, 39, 0.99));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 1px 0 rgba(255, 255, 255, 0.03);
}

.games-card--left {
  left: 43px;
  width: 175px;
}

.games-card--right {
  left: 1458px;
  width: 144px;
}

.games-card__value {
  font-size: 93px;
  line-height: 0.82;
  font-weight: 850;
  letter-spacing: -4px;
}

.games-card__label {
  margin-top: 8px;
  color: #d2e7f7;
  font-size: 22px;
  line-height: 1;
  font-weight: 650;
}

.spoken-score-card {
  position: absolute;
  left: 589px;
  top: 13px;
  width: 673px;
  height: 133px;
  display: grid;
  justify-items: center;
  align-content: center;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(2, 35, 64, 0.99), rgba(0, 18, 35, 0.99));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 1px 0 rgba(255, 255, 255, 0.03);
}

.spoken-score {
  margin-top: -2px;
  color: #fff;
  font-size: 87px;
  line-height: 0.9;
  font-weight: 850;
  letter-spacing: 15px;
  text-shadow: 0 3px 3px rgba(0, 0, 0, 0.2);
}

.spoken-score-labels {
  margin-top: 8px;
  width: 453px;
  display: grid;
  grid-template-columns: 1fr 36px 1fr 36px 1fr;
  align-items: center;
  justify-items: center;
  color: #d2e6f7;
  font-size: 21px;
  line-height: 1;
  font-weight: 650;
  letter-spacing: 1.4px;
}

.spoken-score-labels b {
  font-weight: 500;
}

.live-body {
  position: absolute;
  left: 0;
  top: 286px;
  width: 1622px;
  height: 379px;
  display: grid;
  grid-template-columns: 505px 720px 397px;
}

.team-zone {
  position: relative;
  height: 379px;
  padding: 13px 13px 15px;
  background:
    radial-gradient(circle at 50% 0%, rgba(7, 89, 157, 0.94), rgba(3, 48, 91, 0.98) 66%, rgba(2, 40, 77, 1));
}

.team-zone--left {
  border-right: 2px solid #15c9ff;
}

.team-zone--right {
  border-left: 2px solid #15c9ff;
}

.player-card {
  height: 100%;
  overflow: hidden;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(6, 71, 126, 0.8), rgba(4, 53, 100, 0.9));
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.12);
}

.player-row {
  height: 50%;
  padding: 15px 23px 10px;
  display: flex;
  align-items: flex-start;
}

.player-row + .player-row {
  border-top: 2px solid rgba(80, 213, 255, 0.85);
}

.player-copy {
  width: 100%;
  min-width: 0;
}

.player-name {
  color: white;
  font-size: 36px;
  line-height: 1.12;
  font-weight: 760;
  letter-spacing: -0.8px;
  white-space: nowrap;
}

.player-meta {
  margin-top: 14px;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 17px;
}

.player-badge {
  display: inline-flex;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  padding: 3px 17px 4px;
  border-radius: 18px;
  font-size: 23px;
  line-height: 1;
  font-weight: 650;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.player-badge--band {
  border: 4px solid var(--cc-yellow);
  color: #ffe12f;
  background: rgba(0, 24, 47, 0.92);
}

.player-badge--no-band {
  border: 4px solid #9bb8da;
  color: #eef6ff;
  background: rgba(0, 24, 47, 0.86);
}

.player-badge--server {
  min-width: 144px;
  border: 3px solid #0dc7ff;
  color: white;
  background: linear-gradient(180deg, #087dff, #0064d6);
  box-shadow: 0 0 18px rgba(0, 149, 255, 0.38);
}

.band-dots {
  display: inline-flex;
  align-items: center;
  gap: 15px;
}

.band-dots i {
  display: block;
  width: 41px;
  height: 41px;
  border-radius: 50%;
  background: var(--cc-yellow);
  box-shadow: inset 0 0 0 1px rgba(86, 57, 0, 0.2);
}

.court-stage {
  position: relative;
  width: 720px;
  height: 379px;
  padding: 0 12px;
  background:
    linear-gradient(90deg, rgba(0, 130, 73, 0.34), transparent 5%, transparent 95%, rgba(0, 130, 73, 0.34)),
    #08a761;
  box-shadow:
    inset 4px 0 8px rgba(36, 255, 194, 0.68),
    inset -4px 0 8px rgba(36, 255, 194, 0.68),
    0 0 14px rgba(0, 247, 185, 0.28);
}

.court-inner {
  position: absolute;
  inset: 0 13px;
  border: 3px solid rgba(229, 255, 249, 0.92);
  background:
    radial-gradient(circle at 50% 43%, rgba(27, 196, 115, 0.95), rgba(9, 168, 97, 0.99) 58%, rgba(6, 153, 88, 1) 100%);
}

.court-center-line {
  position: absolute;
  left: 50%;
  top: 0;
  width: 3px;
  height: 100%;
  transform: translateX(-50%);
  background: rgba(231, 255, 250, 0.95);
}

.court-short-line {
  position: absolute;
  left: 50%;
  width: 3px;
  height: 113px;
  transform: translateX(-50%);
  background: rgba(231, 255, 250, 0.95);
}

.court-short-line--top {
  top: 0;
}

.court-short-line--bottom {
  bottom: 0;
}

.court-watermark {
  position: absolute;
  left: 50%;
  top: 127px;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 4px;
  opacity: 0.24;
}

.court-watermark img {
  width: 53px;
  height: 53px;
}

.court-watermark span {
  font-size: 22px;
  line-height: 1;
  font-weight: 850;
}

.court-score {
  position: absolute;
  top: 118px;
  color: white;
  font-size: 132px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: -5px;
  text-shadow: 0 3px 3px rgba(0, 0, 0, 0.12);
}

.court-score--left {
  left: 135px;
}

.court-score--right {
  right: 136px;
}

.match-action-rail {
  position: absolute;
  left: 1622px;
  top: 127px;
  width: 228px;
  height: 538px;
  padding: 13px 20px 22px;
  display: grid;
  grid-template-rows: 139px 148px 166px;
  gap: 21px;
  border-left: 2px solid #079ee3;
  background:
    linear-gradient(180deg, #001c35 0%, #00152a 100%);
}

.rail-action {
  width: 188px;
  border: 2px solid #2c679c;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(3, 35, 65, 0.99), rgba(0, 18, 36, 0.99));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.015);
}

.rail-action strong {
  display: block;
  color: white;
  font-size: 61px;
  line-height: 0.96;
  font-style: italic;
  font-weight: 850;
}

.rail-action span {
  display: block;
  margin-top: 13px;
  color: #d6e6f4;
  font-size: 21px;
  line-height: 1.1;
  font-weight: 650;
  letter-spacing: .8px;
}

.rail-action--pip {
  border-color: #03b8ff;
  box-shadow:
    inset 0 0 0 1px rgba(0, 199, 255, 0.25),
    0 0 14px rgba(0, 170, 255, 0.11);
}

.rail-action--pip.is-active strong {
  text-shadow:
    0 0 10px rgba(16, 136, 255, 0.95),
    0 0 22px rgba(16, 136, 255, 0.75);
}

.rail-action--pip.is-active span {
  color: #36d2ff;
}

.rail-action--change svg {
  width: 55px;
  height: 55px;
  fill: none;
  stroke: white;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rail-action--change span {
  margin-top: 5px;
}

.referee-controls {
  position: absolute;
  left: 0;
  top: 665px;
  width: 1850px;
  height: 185px;
  border-top: 2px solid #00a9ed;
  background:
    radial-gradient(circle at 45% 115%, rgba(0, 86, 143, 0.24), transparent 34%),
    linear-gradient(180deg, #041d35 0%, #001326 100%);
}

.control {
  position: absolute;
  top: 24px;
  height: 124px;
  display: grid;
  align-content: center;
  justify-items: center;
  border: 1.5px solid #068cdb;
  border-radius: 21px;
  background:
    linear-gradient(180deg, #04213d, #011629);
}

.control:active,
.rail-action:active,
.icon-button:active,
.mode-switch__item:active {
  transform: translateY(1px);
  filter: brightness(1.12);
}

.control--start {
  left: 40px;
  width: 268px;
  border-color: #00bfff;
  background:
    radial-gradient(circle at 50% 0%, rgba(24, 182, 255, 0.32), transparent 45%),
    linear-gradient(135deg, #118cff, #006df7);
  box-shadow: 0 0 22px rgba(0, 142, 255, 0.28);
}

.control--undo {
  left: 333px;
  width: 196px;
}

.control--left {
  left: 562px;
  width: 233px;
}

.control--right {
  left: 969px;
  width: 254px;
}

.control--end {
  left: 1271px;
  width: 239px;
}

.control--more {
  left: 1560px;
  width: 248px;
}

.control-icon {
  width: 54px;
  height: 54px;
  fill: none;
  stroke: white;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.control-icon--play {
  width: 52px;
  height: 52px;
  fill: white;
  stroke: none;
}

.control-value {
  color: white;
  font-size: 43px;
  line-height: 1;
  font-weight: 850;
}

.control-label {
  margin-top: 11px;
  color: white;
  font-size: 22px;
  line-height: 1;
  font-weight: 760;
  letter-spacing: .7px;
}

.control--score .control-label {
  margin-top: 14px;
}

.stop-glyph {
  display: block;
  width: 39px;
  height: 39px;
  border-radius: 5px;
  background: white;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}

.more-glyph {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.more-glyph i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: white;
}

.control-divider {
  position: absolute;
  top: 33px;
  width: 2px;
  height: 103px;
  background:
    linear-gradient(transparent, rgba(46, 153, 216, 0.74) 12%, rgba(46, 153, 216, 0.74) 88%, transparent);
}

.control-divider--center {
  left: 880px;
}

.control-divider--end {
  left: 1534px;
}

.demo-toast {
  position: absolute;
  left: 50%;
  bottom: 26px;
  z-index: 30;
  max-width: 620px;
  min-height: 0;
  padding: 0;
  transform: translateX(-50%) translateY(16px);
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: transparent;
  font-size: 19px;
  font-weight: 650;
  pointer-events: none;
  opacity: 0;
  transition: opacity .16s ease, transform .16s ease;
}

.demo-toast.is-visible {
  min-height: 48px;
  padding: 12px 18px;
  transform: translateX(-50%) translateY(0);
  border-color: rgba(62, 185, 255, .45);
  background: rgba(1, 25, 47, .96);
  color: white;
  box-shadow: 0 8px 24px rgba(0,0,0,.32);
  opacity: 1;
}

.demo-sheet {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: none;
}

.demo-sheet.is-open {
  display: block;
}

.demo-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 9, 18, .72);
  backdrop-filter: blur(4px);
}

.demo-sheet__panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 740px;
  min-height: 258px;
  transform: translate(-50%, -50%);
  padding: 38px 42px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  border: 2px solid rgba(71, 205, 255, .7);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(17, 75, 119, .95), rgba(1, 26, 49, .97));
  box-shadow: 0 28px 90px rgba(0, 0, 0, .52);
}

.demo-sheet__panel h2 {
  margin: 8px 0 8px;
  font-size: 36px;
}

.demo-sheet__panel p {
  max-width: 510px;
  margin: 0;
  color: #cfe3f4;
  font-size: 19px;
  line-height: 1.45;
  font-weight: 500;
}

.eyebrow {
  color: #24ccff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2.4px;
}

.sheet-close {
  min-width: 130px;
  height: 54px;
  border: 2px solid #1ba9ec;
  border-radius: 14px;
  background: #053a68;
  font-size: 19px;
  font-weight: 750;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* ============================================================
   FINAL SCORE CONFIRMATION MODAL
   Reference coordinate system: 1850 x 850
   UI-only frontend prototype.
   ============================================================ */

.final-score-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(0, 10, 25, 0.69);
  -webkit-backdrop-filter: blur(2px) brightness(0.62);
  backdrop-filter: blur(2px) brightness(0.62);
}

.final-score-overlay[hidden] {
  display: none;
}

.final-score-design {
  position: relative;
  flex: none;
  width: 1850px;
  height: 850px;
  transform: scale(var(--ui-scale));
  transform-origin: center center;
  overflow: hidden;
  background: transparent;
}

.final-score-modal {
  position: absolute;
  left: 468px;
  top: 130px;
  width: 917px;
  height: 529px;
  padding: 36px 60px 33px;
  border: 2px solid rgba(116, 226, 255, 0.95);
  border-radius: 32px;
  color: #f7fbff;
  background:
    radial-gradient(circle at 12% 92%, rgba(25, 220, 235, 0.28), transparent 32%),
    radial-gradient(circle at 94% 3%, rgba(79, 196, 255, 0.34), transparent 36%),
    linear-gradient(145deg, rgba(10, 59, 101, 0.91), rgba(1, 20, 43, 0.97) 55%, rgba(5, 55, 96, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 0 38px rgba(68, 187, 255, 0.14),
    0 0 24px rgba(49, 197, 255, 0.36),
    0 26px 80px rgba(0, 0, 0, 0.52);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  backdrop-filter: blur(22px) saturate(1.35);
}

.final-score-close {
  position: absolute;
  left: 20px;
  top: 18px;
  width: 82px;
  height: 68px;
  display: grid;
  place-items: center;
  padding: 0 0 5px;
  border: 2px solid rgba(111, 213, 255, 0.95);
  border-radius: 15px;
  color: #ffffff;
  background: linear-gradient(145deg, rgba(73, 142, 202, 0.58), rgba(28, 82, 136, 0.68));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 0 17px rgba(35, 194, 255, 0.50);
  font: inherit;
  font-size: 54px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.final-score-heading {
  text-align: center;
}

.final-score-heading h2 {
  margin: 0;
  font-size: 48px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -1px;
}

.final-score-heading p {
  margin: 19px 0 0;
  color: #c7d9ec;
  font-size: 29px;
  line-height: 1;
  font-weight: 500;
}

.final-score-card {
  width: 695px;
  height: 221px;
  margin: 25px auto 23px;
  padding: 17px 22px;
  border: 2px solid rgba(88, 181, 235, 0.73);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(0, 25, 47, 0.92), rgba(0, 45, 61, 0.80));
  box-shadow: inset 0 0 18px rgba(31, 159, 212, 0.10);
}

.final-score-team {
  height: 91px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  align-items: center;
  gap: 22px;
}

.final-score-names {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding-left: 14px;
  font-size: 29px;
  line-height: 1.18;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.final-score-names span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.final-score-value {
  width: 120px;
  height: 82px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(57, 129, 206, 0.54);
  border-radius: 13px;
  color: #ffffff;
  background: linear-gradient(145deg, rgba(26, 73, 135, 0.92), rgba(18, 48, 99, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 5px 14px rgba(0, 0, 0, 0.18);
  font-size: 50px;
  line-height: 1;
  font-weight: 800;
}

.final-score-divider {
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(31, 137, 207, 0.45),
    rgba(31, 137, 207, 0.94),
    rgba(31, 137, 207, 0.45)
  );
}

.final-score-actions {
  width: 795px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.final-score-button {
  height: 90px;
  border-radius: 21px;
  font: inherit;
  font-size: 29px;
  line-height: 1;
  font-weight: 800;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.final-score-button--cancel {
  border: 2px solid rgba(93, 189, 240, 0.72);
  color: #ffffff;
  background: linear-gradient(145deg, rgba(46, 115, 161, 0.82), rgba(30, 78, 115, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 9px 20px rgba(0, 0, 0, 0.18);
}

.final-score-button--save {
  border: 2px solid rgba(160, 248, 255, 0.96);
  color: #001d3a;
  background: linear-gradient(145deg, #6be8ff, #12bdf8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.70),
    0 0 19px rgba(37, 222, 255, 0.64),
    0 10px 24px rgba(0, 78, 124, 0.32);
}

.final-score-close:focus-visible,
.final-score-button:focus-visible {
  outline: 3px solid rgba(92, 221, 255, 0.95);
  outline-offset: 3px;
  box-shadow: 0 0 16px rgba(33, 216, 255, 0.58);
}

@media (hover: hover) and (pointer: fine) {
  .final-score-close:hover,
  .final-score-button--cancel:hover {
    filter: brightness(1.12);
  }

  .final-score-button--save:hover {
    filter: brightness(1.07);
  }
}


/* ============================================================
   FINAL SCORE CANVAS ALIGNMENT FIX
   Modal now shares the referee 1850 x 850 coordinate system.
   ============================================================ */
.final-score-overlay {
  position: absolute;
  inset: 0;
  width: 1850px;
  height: 850px;
  z-index: 1000;
  overflow: hidden;
}

.final-score-design {
  position: absolute;
  inset: 0;
  width: 1850px;
  height: 850px;
  transform: none;
  transform-origin: top left;
}

/* ============================================================
   STAGES 9E-26 — LIVE REFEREE BINDING
   Additions only; the approved control geometry is unchanged.
   ============================================================ */

.match-clock {
  position: absolute;
  left: 250px;
  top: 30px;
  width: 300px;
  height: 104px;
  display: grid;
  align-content: center;
  justify-items: center;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(2, 35, 65, 0.86), rgba(0, 20, 39, 0.86));
}

.match-clock__label {
  color: #d2e7f7;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
}

.match-clock__value {
  margin-top: 6px;
  color: #fff;
  font-size: 50px;
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

[data-referee-phase="paused"] .match-clock__value {
  color: var(--cc-yellow);
}

.link-status {
  position: absolute;
  left: 1282px;
  top: 52px;
  width: 160px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 28px;
  background: rgba(0, 20, 39, 0.82);
  color: #d2e7f7;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 1.4px;
}

.link-status i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #8aa3b8;
}

.link-status[data-state="online"] i { background: #36e28b; }
.link-status[data-state="reconnecting"] i { background: var(--cc-yellow); }
.link-status[data-state="offline"] i { background: #ff5d5d; }

.rally-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 2;
  transform: translateX(-50%);
  padding: 8px 18px;
  border-radius: 18px;
  background: rgba(0, 32, 22, 0.72);
  color: #dcfff6;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1.6px;
  pointer-events: none;
}

.court-stage.is-rally-live {
  box-shadow:
    inset 0 0 0 6px rgba(255, 197, 43, 0.9),
    0 0 18px rgba(255, 197, 43, 0.45);
}

/* Disabled controls stay in place and read as unavailable. */
.control:disabled,
.rail-action:disabled {
  opacity: 0.36;
  filter: saturate(0.5);
  cursor: default;
}

.referee-canvas.is-busy .control--score,
.referee-canvas.is-busy .rail-action--sideout {
  filter: brightness(1.35);
}

.rail-action--change.is-required {
  border-color: var(--cc-yellow);
  box-shadow: 0 0 0 3px rgba(255, 197, 43, 0.6), 0 0 26px rgba(255, 197, 43, 0.55);
  animation: change-ends-pulse 1.1s ease-in-out infinite;
}

@keyframes change-ends-pulse {
  50% { box-shadow: 0 0 0 6px rgba(255, 197, 43, 0.25), 0 0 34px rgba(255, 197, 43, 0.7); }
}

.final-score-modal {
  top: 105px;
  height: 590px;
}

.final-score-meta {
  margin: 12px 0 0 !important;
  color: #8fe6ff !important;
  font-size: 23px !important;
  font-weight: 650 !important;
  min-height: 23px;
}

.final-score-card {
  margin: 18px auto 20px;
}

.match-summary-modal {
  left: 375px;
  top: 60px;
  width: 1100px;
  height: auto;
  max-height: 740px;
}

.match-summary-body {
  display: grid;
  gap: 18px;
  margin: 22px 0 24px;
}

.match-summary-teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.match-summary-team {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 14px 22px;
  border: 2px solid rgba(88, 181, 235, 0.6);
  border-radius: 17px;
  background: rgba(0, 25, 47, 0.8);
  font-size: 25px;
  font-weight: 650;
}

.match-summary-team.is-winner {
  border-color: var(--cc-yellow);
}

.match-summary-team strong {
  font-size: 46px;
  font-weight: 850;
}

.match-summary-team small {
  display: block;
  color: #c7d9ec;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1.4px;
}

.match-summary-games {
  width: 100%;
  border-collapse: collapse;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}

.match-summary-games th,
.match-summary-games td {
  padding: 8px 14px;
  border-bottom: 1px solid rgba(88, 181, 235, 0.35);
  text-align: left;
}

.match-summary-games th {
  color: #8fe6ff;
  font-size: 19px;
  letter-spacing: 1.4px;
}

.match-summary-stats,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0;
}

.match-summary-stats div,
.stats-grid div {
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(0, 25, 47, 0.75);
}

.match-summary-stats dt,
.stats-grid dt {
  color: #c7d9ec;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.match-summary-stats dd,
.stats-grid dd {
  margin: 4px 0 0;
  font-size: 32px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.final-score-button:disabled {
  opacity: 0.5;
  cursor: default;
}

/* MORE sheet */
.more-sheet {
  position: absolute;
  left: 230px;
  top: 70px;
  width: 1390px;
  height: 710px;
  display: grid;
  grid-template-rows: auto 1fr;
  border: 2px solid rgba(71, 205, 255, .7);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(17, 75, 119, .97), rgba(1, 26, 49, .98));
  box-shadow: 0 28px 90px rgba(0, 0, 0, .52);
  overflow: hidden;
}

.more-sheet__header {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 24px 32px;
  border-bottom: 2px solid rgba(71, 205, 255, .35);
}

.more-sheet__header h2 {
  margin: 0;
  font-size: 36px;
}

.more-tabs {
  display: flex;
  flex: 1;
  gap: 10px;
}

.more-tab {
  height: 58px;
  padding: 0 26px;
  border: 2px solid #1c5b90;
  border-radius: 14px;
  background: #02152a;
  font-size: 22px;
  font-weight: 750;
}

.more-tab.is-active {
  color: #00162a;
  border-color: #1fb9ff;
  background: linear-gradient(180deg, #1fb9ff, #0b8ee7);
}

.more-pane {
  padding: 22px 32px;
  overflow: auto;
}

.history-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.history-list li {
  display: grid;
  grid-template-columns: 90px 1fr 160px;
  gap: 16px;
  padding: 10px 6px;
  border-bottom: 1px solid rgba(88, 181, 235, 0.25);
}

.history-list li span:first-child {
  color: #8fb7d6;
}

.history-list li.is-reverted {
  color: #8fa7bb;
  text-decoration: line-through;
}

.history-list li.is-correction {
  color: var(--cc-yellow);
}

.toggle-row,
.slider-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 18px;
  font-size: 24px;
  font-weight: 650;
}

.toggle-row input {
  width: 34px;
  height: 34px;
}

.slider-row input {
  width: 420px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 24px;
  margin-bottom: 20px;
}

.category-grid label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
}

.category-grid input {
  width: 28px;
  height: 28px;
}

.pill-button {
  display: inline-grid;
  place-items: center;
  min-width: 190px;
  height: 64px;
  padding: 0 26px;
  border: 2px solid #1ba9ec;
  border-radius: 16px;
  background: #053a68;
  color: #fff;
  font-size: 22px;
  font-weight: 750;
  text-decoration: none;
}

.pill-button--primary {
  border-color: rgba(160, 248, 255, 0.96);
  color: #001d3a;
  background: linear-gradient(145deg, #6be8ff, #12bdf8);
}

.pill-button--danger {
  border-color: #ff8a8a;
  background: #5a1520;
}

.pill-button.is-selected {
  color: #001d3a;
  border-color: #8ff0ff;
  background: linear-gradient(145deg, #6be8ff, #12bdf8);
}

.pill-button:disabled {
  opacity: 0.45;
}

.pane-note {
  margin: 0 0 22px;
  color: #c7d9ec;
  font-size: 20px;
}

.options-actions {
  display: flex;
  gap: 16px;
}

/* Voice pack: the Kokoro calls saved on this device (MORE > Audio) */
.voice-pack {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 22px;
  padding: 16px 20px;
  border: 1px solid rgba(88, 181, 235, 0.35);
  border-radius: 16px;
}

.voice-pack__title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 750;
}

.voice-pack__detail {
  margin: 0;
}

.voice-pack[data-state="ready"] .voice-pack__title {
  color: #6bf0a8;
}

.voice-pack[data-state="unavailable"] .voice-pack__title {
  color: var(--cc-yellow);
}

/* Setup panel: assignment inbox, sign-in, takeover, pre-match steps */
.setup-panel {
  position: absolute;
  left: 0;
  top: 127px;
  z-index: 60;
  width: 1850px;
  height: 723px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(9, 169, 251, 0.18), transparent 50%),
    var(--cc-navy-900);
}

.setup-panel[hidden] {
  display: none;
}

.setup-card {
  width: 1500px;
  max-height: 680px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: 30px 40px;
  border: 2px solid rgba(71, 205, 255, .6);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(17, 75, 119, .9), rgba(1, 26, 49, .96));
}

.setup-header h2 {
  margin: 6px 0 0;
  font-size: 44px;
}

.setup-header p {
  margin: 8px 0 0;
  color: #c7d9ec;
  font-size: 24px;
}

.setup-body {
  overflow: auto;
  font-size: 24px;
}

.setup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
}

.setup-actions .pill-button {
  min-width: 240px;
  height: 80px;
  font-size: 26px;
}

.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.setup-tile {
  display: grid;
  gap: 12px;
  padding: 18px 22px;
  border: 2px solid rgba(88, 181, 235, 0.45);
  border-radius: 18px;
  background: rgba(0, 25, 47, 0.7);
}

.setup-tile h3 {
  margin: 0;
  color: #8fe6ff;
  font-size: 22px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.setup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.setup-row .choices {
  display: flex;
  gap: 10px;
}

.setup-row .pill-button {
  min-width: 140px;
  height: 58px;
  font-size: 20px;
}

.assignment-list {
  display: grid;
  gap: 14px;
}

.assignment-item {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 18px 24px;
  border: 2px solid rgba(88, 181, 235, 0.5);
  border-radius: 18px;
  background: rgba(0, 25, 47, 0.75);
  color: #fff;
  text-decoration: none;
}

.assignment-item strong {
  font-size: 30px;
}

.assignment-item small {
  display: block;
  color: #c7d9ec;
  font-size: 18px;
  letter-spacing: 1.2px;
}

/* CourtCast Open Play logo (900 x 265) in the header brand slot. */
.brand-wrap {
  top: 9px;
  height: 109px;
}

.referee-brand {
  width: 420px;
  height: 106px;
}

/* ============================================================
   CENTRE ALIGNMENT
   The court occupies x 505-1225 (centre 865). The spoken score and
   the +1 LEFT | +1 RIGHT pair share that centre line so the call,
   the court halves, and the scoring buttons line up vertically.
   ============================================================ */
.spoken-score-card {
  left: 529px; /* 865 - 673 / 2 */
}

.match-clock {
  left: 234px;
  width: 280px;
}

.link-status {
  left: 1250px; /* centred in the gap between the score and right games */
}

.control-divider--center {
  left: 864px;
}

.control--left {
  left: 572px;
  width: 233px; /* right edge 805: 60px left of centre */
}

.control--right {
  left: 925px;
  width: 233px; /* left edge 925: 60px right of centre */
}

/* ============================================================
   BALANCED SIZES
   Score strip: Games | Match | call | Live | Games share one card
   height with 24px gaps. Controls come in matched pairs —
   START = UNDO, +1 LEFT = +1 RIGHT (centred on the court, x 865),
   END MATCH = MORE — with 24px gaps and a wider separation before
   the destructive END MATCH.
   ============================================================ */
.games-card,
.match-clock,
.link-status,
.spoken-score-card {
  top: 13px;
  height: 133px;
}

.games-card--left {
  left: 24px;
  width: 160px;
}

.match-clock {
  left: 208px;
  width: 297px;
}

/* .spoken-score-card stays at 529-1202 (centred on the court). */

.link-status {
  left: 1226px;
  width: 188px;
  border-radius: 18px;
  font-size: 24px;
}

.games-card--right {
  left: 1438px;
  width: 160px;
}

.control--start {
  left: 40px;
  width: 242px;
}

.control--undo {
  left: 306px;
  width: 242px;
}

.control--left {
  left: 572px;
  width: 233px;
}

.control-divider--center {
  left: 864px;
}

.control--right {
  left: 925px;
  width: 233px;
}

.control--end {
  left: 1302px;
  width: 242px;
}

.control-divider--end {
  left: 1555px;
}

.control--more {
  left: 1568px;
  width: 242px;
}

/* Header title: centred on the court (x 865) like the score and +1 pair;
   wide enough for a club name, which shrinks to fit (renderHeaderTitle). */
.referee-title {
  left: 595px;
  width: 540px; /* 595 + 540 / 2 = 865 */
}

.referee-title__sport {
  overflow: hidden;
  white-space: nowrap;
  letter-spacing: 2px;
}

.referee-title__role {
  letter-spacing: 5px;
  white-space: nowrap;
}

/* Match format: hidden until a match is open; room for "11pt per game"
   now that the unused W/PM switch is gone. */
.match-format {
  width: 400px;
}

.match-format[hidden] {
  display: none;
}

/* Open Play: "Before the match" — sides, who serves, who wears the band. */
.quick-start { display: grid; gap: 12px; width: 100%; }
.quick-start-row { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; align-items: center; gap: 12px; }
.quick-start-label { font-size: 14px; font-weight: 800; letter-spacing: 0.02em; }
.quick-start-options { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-start-options .pill-button { min-width: 140px; }
@media (max-width: 700px) {
  .quick-start-row { grid-template-columns: 1fr; gap: 6px; }
}
