:root {
  color-scheme: dark;
  --bg: #141b20;
  --surface: #1c252b;
  --line: #35424b;
  --text: #eff2ed;
  --muted: #abb8bd;
  --accent: #f1cf69;
}
* {
  box-sizing: border-box;
  letter-spacing: 0;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 14px;
}
[hidden] {
  display: none !important;
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 1px solid #50616b;
  background: #26333b;
  border-radius: 4px;
  padding: 8px 12px;
  font-weight: 600;
}
button:hover {
  background: #364953;
  border-color: #a2b5bb;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
button.icon {
  width: 36px;
  height: 36px;
  padding: 7px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
}
svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
.topbar {
  max-width: 1600px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}
.back {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
  white-space: nowrap;
}
h1 > span {
  color: var(--accent);
}
h1 b {
  font-size: 10px;
  color: #121b17;
  background: #7ce1ae;
  padding: 3px 5px;
  vertical-align: middle;
  border-radius: 2px;
}
.settings {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--muted);
}
label {
  display: flex;
  align-items: center;
  gap: 4px;
}
input {
  accent-color: #efc75a;
}
main {
  max-width: 1560px;
  margin: auto;
  padding: 16px 24px 32px;
  min-width: 0;
}
.schedule-heading,
.date-controls,
.feed-status {
  display: flex;
  align-items: center;
  gap: 8px;
}
.schedule-heading {
  justify-content: space-between;
  margin-bottom: 12px;
}
input[type="date"] {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 7px;
  width: 150px;
  border-radius: 3px;
}
.feed-status {
  font-size: 11px;
  color: var(--muted);
}
.games {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 8px;
  scrollbar-width: thin;
  min-height: 78px;
}
.game-button {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 14px;
  flex: 0 0 146px;
  text-align: left;
  font-size: 12px;
  background: #1b252b;
  border: 1px solid #35454e;
  padding: 9px 12px;
  min-height: 74px;
}
.game-button small {
  grid-column: 1/-1;
  color: var(--muted);
  font-size: 10px;
}
.game-button[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 2px var(--accent);
}
.game-button b {
  font-variant-numeric: tabular-nums;
}
.game-button .is-live {
  color: #83e8ae;
}
.venue-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}
.venue-line > div {
  display: flex;
  align-items: center;
  gap: 10px;
}
.venue-line h2 {
  font-size: 15px;
  margin: 0;
}
.state-label {
  font-size: 10px;
  color: #7fe0af;
  text-transform: uppercase;
  font-weight: 800;
  border-left: 3px solid currentColor;
  padding-left: 7px;
}
#weather {
  font-size: 11px;
  color: var(--muted);
}
.broadcast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 282px;
  gap: 20px;
  align-items: start;
  max-width: min(100%, calc((100dvh - 450px) * 1.5 + 302px));
  margin-inline: auto;
}
.main-field {
  min-width: 0;
}
.field {
  position: relative;
  width: 100%;
  aspect-ratio: 3/2;
  background: #254b39;
  overflow: hidden;
  container-type: inline-size;
  box-shadow: inset 0 0 0 1px #60737b;
}
#field {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}
.broadcast-hud {
  position: absolute;
  z-index: 3;
  right: 1.1%;
  bottom: 1.2%;
  left: 1.1%;
  display: grid;
  grid-template:
    "score pitch" 5.5cqw
    "count pitch" 2.6cqw /
    minmax(0, 1fr) clamp(72px, 21cqw, 180px);
  gap: 2px;
  pointer-events: none;
  filter: drop-shadow(0 3px 8px #000b);
}
.scoreboard {
  grid-area: score;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(48px, 10cqw) minmax(0, 1fr);
  background: rgb(8 16 21 / 92%);
  color: #f3f6f3;
  min-height: 0;
  align-items: stretch;
  border-left: 3px solid var(--accent);
}
.club {
  display: flex;
  align-items: center;
  gap: clamp(3px, 0.7cqw, 8px);
  padding: clamp(3px, 0.55cqw, 7px) clamp(5px, 0.8cqw, 10px);
  border-top: 2px solid var(--club, #496776);
  min-width: 0;
}
.club > div {
  min-width: 0;
  flex: 1;
}
.club span:not(.team-mark) {
  font-size: clamp(7px, 1.15cqw, 12px);
  font-weight: 750;
  display: block;
  overflow-wrap: anywhere;
}
.club small {
  display: block;
  color: #aebbc0;
  font-size: clamp(6px, 0.78cqw, 8px);
  margin-top: 1px;
}
.club > strong {
  font-size: clamp(10px, 3.1cqw, 30px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.home {
  text-align: right;
}
.team-mark {
  display: grid;
  place-items: center;
  background: var(--club, #496776);
  color: white;
  text-shadow: 0 1px 2px #000;
  font-size: clamp(7px, 1.1cqw, 11px);
  font-weight: 900;
  width: clamp(20px, 3.8cqw, 36px);
  height: clamp(20px, 3.8cqw, 36px);
  flex: 0 0 clamp(20px, 3.8cqw, 36px);
  border-radius: 50%;
}
.inning {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgb(31 46 54 / 96%);
  text-align: center;
  padding: 3px;
}
.inning strong {
  font-size: clamp(7px, 1.2cqw, 12px);
  text-transform: uppercase;
}
.inning span {
  color: #b8c5c9;
  font-size: clamp(6px, 0.8cqw, 8px);
  margin-top: 1px;
}
.count-strip {
  grid-area: count;
  display: flex;
  align-items: center;
  gap: clamp(5px, 1.2cqw, 14px);
  min-height: 0;
  padding: 2px clamp(6px, 1cqw, 12px);
  font-size: clamp(7px, 0.95cqw, 10px);
  background: rgb(25 38 45 / 94%);
}
.count-strip #mode {
  margin-left: auto;
  color: var(--accent);
  font-weight: 800;
  font-size: clamp(6px, 0.85cqw, 9px);
}
#outs {
  white-space: nowrap;
}
#count {
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
#bases {
  position: relative;
  width: clamp(18px, 3cqw, 29px);
  height: clamp(14px, 2.3cqw, 22px);
  flex-shrink: 0;
}
#bases span {
  position: absolute;
  width: clamp(5px, 0.85cqw, 8px);
  height: clamp(5px, 0.85cqw, 8px);
  border: 1px solid #899b9f;
  transform: rotate(45deg);
  background: #30424a;
}
#bases [data-base="2"] {
  top: 0;
  left: 40%;
}
#bases [data-base="3"] {
  left: 8%;
  top: 45%;
}
#bases [data-base="1"] {
  left: 72%;
  top: 45%;
}
#bases .occupied {
  background: #f5cf67;
  border-color: #ffeaaa;
}
#base-text {
  color: var(--muted);
  font-size: clamp(6px, 0.85cqw, 9px);
}
.play-caption {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #202e36;
  min-height: 66px;
}
.play-caption > span {
  font-size: 10px;
  color: var(--accent);
  font-weight: 800;
  max-width: 100px;
  flex-shrink: 0;
}
.play-caption p {
  flex: 1;
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  min-width: 0;
}
.play-caption #live {
  font-size: 11px;
}
.linescore-wrap {
  overflow-x: auto;
  margin-top: 14px;
  scrollbar-width: thin;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 11px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
th,
td {
  padding: 7px 5px;
  min-width: 23px;
  border-bottom: 1px solid var(--line);
}
th {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
}
th:first-child,
td:first-child {
  text-align: left;
  min-width: 44px;
}
td:nth-last-child(3) {
  font-weight: 850;
  color: var(--accent);
}
.source-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #8e9fa7;
  font-size: 9px;
  margin-top: 10px;
}
.game-detail > section {
  border-bottom: 1px solid var(--line);
  padding: 0 0 18px;
  margin-bottom: 18px;
}
h3 {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  margin: 0 0 10px;
}
.matchup > strong {
  font-size: 22px;
  line-height: 1.25;
  display: block;
  color: #f1cf69;
}
.matchup > span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 15px;
}
.matchup > b {
  display: block;
  font-size: 15px;
  margin-top: 4px;
}
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.section-heading > span {
  font-size: 10px;
  color: var(--muted);
}
#velocity {
  font-size: 15px;
}
.pitch-detail {
  display: flex;
  gap: 16px;
  align-items: center;
}
.broadcast-hud .pitch-section {
  grid-area: pitch;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: clamp(3px, 0.55cqw, 6px) clamp(5px, 0.75cqw, 8px);
  min-width: 0;
  background: rgb(8 16 21 / 94%);
  border-left: 2px solid #6e858f;
}
.broadcast-hud .section-heading {
  align-items: center;
}
.broadcast-hud .section-heading h3 {
  margin: 0;
  font-size: clamp(6px, 0.8cqw, 8px);
}
.broadcast-hud #velocity {
  font-size: clamp(7px, 1cqw, 10px);
}
.broadcast-hud .pitch-detail {
  gap: clamp(4px, 0.7cqw, 8px);
  min-height: 0;
}
.broadcast-hud .pitch-detail strong {
  display: block;
  overflow: hidden;
  color: #f3d478;
  font-size: clamp(7px, 1cqw, 10px);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.broadcast-hud .pitch-detail p {
  display: -webkit-box;
  overflow: hidden;
  margin: 1px 0 0;
  font-size: clamp(6px, 0.8cqw, 8px);
  line-height: 1.2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.broadcast-hud .zone {
  width: clamp(24px, 4.6cqw, 44px);
  height: 100%;
  min-height: 14px;
  max-height: 48px;
}
@container (max-width: 500px) {
  .club > div > span {
    display: none !important;
  }
  .club > div::before {
    content: attr(data-abbr);
    display: block;
    font-size: 10px;
    font-weight: 850;
  }
  .club > strong {
    font-size: 13px;
  }
  .count-strip {
    font-size: 8px;
    line-height: 1;
  }
  #base-text {
    display: none;
  }
  .broadcast-hud {
    gap: 1px;
  }
  .club {
    padding-block: 1px;
  }
  .club small,
  .inning span,
  .broadcast-hud .section-heading h3,
  .broadcast-hud .pitch-detail p {
    display: none;
  }
  .broadcast-hud .pitch-section {
    grid-template-rows: auto minmax(0, 1fr);
    padding: 2px 3px;
  }
  .broadcast-hud .pitch-detail {
    gap: 3px;
  }
  .broadcast-hud .zone {
    width: clamp(16px, 4.6cqw, 23px);
  }
}
.pitch-detail > div:last-child {
  min-width: 0;
  flex: 1;
}
.pitch-detail strong {
  font-size: 13px;
}
.pitch-detail p {
  font-size: 11px;
  color: var(--muted);
  margin: 6px 0;
  line-height: 1.5;
}
.zone {
  position: relative;
  width: 116px;
  height: 132px;
  background: #10191e;
  flex-shrink: 0;
  border: 1px solid #344650;
  overflow: hidden;
}
.strike-zone {
  position: absolute;
  left: 25%;
  top: 25%;
  width: 50%;
  height: 50%;
  border: 1px solid #d6dfdf;
  background-image:
    linear-gradient(
      to right,
      transparent 32%,
      #5a696c 33%,
      transparent 34%,
      transparent 65%,
      #5a696c 66%,
      transparent 67%
    ),
    linear-gradient(
      to bottom,
      transparent 32%,
      #5a696c 33%,
      transparent 34%,
      transparent 65%,
      #5a696c 66%,
      transparent 67%
    );
}
#pitch-dot {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #f5cf67;
  border: 2px solid #fff;
  transform: translate(-50%, -50%);
}
.play-feed ol {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 400px;
  overflow: auto;
  scrollbar-width: thin;
}
.play-feed li {
  border-top: 1px solid var(--line);
}
.play-feed button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
  padding: 10px 2px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
}
.play-feed button:hover {
  background: #26363f;
}
.play-feed button > small {
  display: block;
  color: var(--accent);
  font-size: 9px;
  margin-bottom: 4px;
}
.play-feed button[aria-pressed="true"] {
  background: #33444d;
}
.play-feed .no-plays {
  color: var(--muted);
  padding: 12px 0;
  font-size: 12px;
}
#error {
  border-left: 3px solid #ed946b;
  padding: 10px 12px;
  background: #352923;
  font-size: 12px;
  margin: 10px 0;
}
#empty {
  padding: 70px 16px;
  text-align: center;
  border-block: 1px solid var(--line);
  margin-top: 12px;
}
#empty h2 {
  font-size: 22px;
}
#empty p {
  color: var(--muted);
  font-size: 13px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 1000px) {
  .broadcast {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 14px;
  }
  .team-mark {
    display: none;
  }
  .topbar,
  main {
    padding-inline: 16px;
  }
  .back span {
    display: none;
  }
}
@media (max-height: 650px) {
  .broadcast {
    max-width: 100%;
  }
}
@media (max-width: 760px) {
  .topbar {
    padding: 12px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .topbar h1 {
    font-size: 22px;
  }
  .settings {
    margin-left: auto;
    gap: 8px;
    font-size: 10px;
  }
  main {
    padding: 12px 8px 24px;
  }
  .broadcast {
    display: block;
    max-width: 100%;
  }
  .game-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 20px;
  }
  .play-feed {
    grid-column: 1/-1;
  }
  .play-feed ol {
    max-height: 280px;
  }
  .game-detail > section {
    margin: 0;
  }
  .game-button {
    flex-basis: 126px;
  }
  .venue-line h2 {
    font-size: 13px;
  }
  .venue-line {
    gap: 6px;
  }
  #weather {
    display: none;
  }
  #base-text {
    display: none;
  }
  .play-caption {
    padding: 10px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .play-caption p {
    font-size: 11px;
  }
  .play-caption > span {
    max-width: 62px;
    font-size: 9px;
  }
  .matchup > strong {
    font-size: 19px;
  }
  .source-line {
    font-size: 8px;
  }
  .schedule-heading {
    gap: 4px;
  }
  #connection {
    max-width: 95px;
    font-size: 10px;
  }
  .date-controls {
    gap: 4px;
  }
  #today {
    font-size: 11px;
    padding: 8px;
  }
  input[type="date"] {
    width: 130px;
    font-size: 12px;
  }
  .date-controls .icon {
    width: 28px;
    flex-basis: 28px;
    padding: 4px;
  }
  .feed-status {
    gap: 4px;
  }
}
.uniform-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 0 0 12px;
  font-size: 12px;
}
.uniform-controls[hidden], .uniform-controls label[hidden] { display: none; }
.uniform-controls label { display: flex; align-items: center; gap: 8px; }
.uniform-controls select { max-width: 230px; color: #e5eee4; background: #223127; border: 1px solid #65755c; padding: 6px; border-radius: 4px; }
@media (max-width: 380px) {
  .schedule-heading {
    flex-wrap: wrap;
  }
  .feed-status {
    width: 100%;
    justify-content: flex-end;
  }
  #connection {
    max-width: none;
  }
  .settings {
    width: 100%;
    justify-content: flex-end;
  }
  #connection {
    max-width: 62px;
  }
  .game-detail {
    gap: 12px;
  }
}
