:root {
  --navy: #02172c;
  --navy-deep: #001326;
  --line: #1c5b90;
  --cyan: #09c8ff;
  --yellow: #ffc52b;
  --white: #f7fbff;
  --muted: #c4d9ec;
  color-scheme: dark;
  font-family: Inter, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--navy-deep);
  color: var(--white);
}

.production {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  grid-template-areas:
    "header header"
    "picker program"
    "audio program";
  gap: 20px;
  padding: 20px;
}

.production-header {
  grid-area: header;
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid #08b9f4;
}

.production-brand { height: 40px; }
.production-header h1 { margin: 0; font-size: 24px; }
.production-header p { margin: 4px 0 0; color: var(--muted); }

.production-views {
  margin-left: auto;
  display: flex;
  gap: 12px;
}

.production-views a,
.broadcast-audio button,
.announcer-only button {
  padding: 10px 16px;
  border: 2px solid #1ba9ec;
  border-radius: 12px;
  background: #053a68;
  color: var(--white);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.court-picker { grid-area: picker; }
.broadcast-audio { grid-area: audio; }
.program { grid-area: program; }

.court-picker h2,
.broadcast-audio h2 { margin: 0 0 4px; font-size: 20px; }
.hint { margin: 0 0 12px; color: var(--muted); font-size: 14px; }

.court-list { display: grid; gap: 10px; }

.court-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #021f3a;
  color: var(--white);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.court-option[aria-selected="true"] {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(9, 200, 255, 0.35);
}

.court-option strong { font-size: 18px; }
.court-option small { display: block; color: var(--muted); font-size: 13px; }
.court-option .score { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }

.toggle { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.categories { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin: 12px 0; font-size: 15px; }
.categories label { display: flex; gap: 8px; align-items: center; }
.actions { display: flex; gap: 10px; }

/* Voice pack: the Kokoro calls saved on this device. */
.voice-pack { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.voice-pack__title { margin: 0 0 2px; font-weight: 700; }
.voice-pack__detail { margin-bottom: 8px; }
.voice-pack[data-state="ready"] .voice-pack__title { color: #6bf0a8; }
.voice-pack[data-state="unavailable"] .voice-pack__title { color: var(--yellow); }
.broadcast-audio button:disabled { opacity: 0.45; cursor: default; }

/* Program scorebug — also the OBS browser-source graphic. */
.scorebug {
  width: min(100%, 880px);
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(4, 33, 61, 0.96), rgba(0, 19, 38, 0.96));
  border: 2px solid #08b9f4;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
}

.scorebug[data-empty="true"] { opacity: 0.55; }

.scorebug__meta {
  display: flex;
  justify-content: space-between;
  padding: 10px 20px;
  background: linear-gradient(90deg, #0068d8, #09a9fb);
  font-weight: 800;
  letter-spacing: 1.5px;
}

.scorebug__row {
  display: grid;
  grid-template-columns: 28px 1fr 70px 110px;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-top: 1px solid rgba(9, 200, 255, 0.25);
  font-size: 30px;
  font-weight: 700;
}

.scorebug__serve {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.scorebug__row.is-serving .scorebug__serve {
  background: var(--yellow);
  box-shadow: 0 0 12px rgba(255, 197, 43, 0.7);
}

.scorebug__games {
  text-align: center;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.scorebug__score {
  text-align: center;
  font-size: 46px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.scorebug__call {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  border-top: 1px solid rgba(9, 200, 255, 0.25);
  color: var(--muted);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 4px;
}

.scorebug__banner {
  padding: 4px 12px;
  border-radius: 10px;
  background: var(--yellow);
  color: #001326;
  letter-spacing: 1.5px;
}

.announcer-only { display: none; }

/* OBS scoreboard: graphic only, transparent page. */
.production[data-view="scoreboard"] {
  display: block;
  padding: 24px;
}

body:has(.production[data-view="scoreboard"]) { background: transparent; }

.production[data-view="scoreboard"] > :not(.program),
.production[data-view="announcer"] > :not(.announcer-only) {
  display: none;
}

/* OBS announcer: audio-only source with a minimal status card. */
.production[data-view="announcer"] {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.production[data-view="announcer"] .announcer-only {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 30px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #021f3a;
}

@media (max-width: 760px) {
  .production {
    grid-template-columns: 1fr;
    grid-template-areas: "header" "program" "picker" "audio";
  }
  .production-header { flex-wrap: wrap; }
  .production-views { margin-left: 0; }
}
