:root {
  background: #071017;
  color: #e8eef5;
  font-family: "Roboto Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  --accent-teal: #39a4b5;
  --accent-teal-dark: #86d7e0;
  --accent-red: #ff4057;
  --accent-blue: #78aee8;
  --canvas: #071017;
  --panel: #101922;
  --panel-soft: #15222d;
  --panel-hover: #1a2b37;
  --line: #d8e5ec;
  --soft-line: #263846;
  --text-main: #e8eef5;
  --text-muted: #9badbb;
  --table-head: #0d151d;
  --metric-soft: #203441;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--canvas);
}

.shell {
  min-height: 100vh;
  padding: 18px 34px 28px;
}

.app-masthead {
  align-items: center;
  border-bottom: 3px solid var(--accent-teal);
  display: flex;
  justify-content: space-between;
  margin: 0 34px;
  padding: 8px 0 10px;
}

.app-brand {
  align-items: center;
  color: inherit;
  display: flex;
  gap: 10px;
  text-decoration: none;
}

.app-ball {
  border: 5px solid #556675;
  border-top-color: var(--accent-teal);
  border-radius: 50%;
  display: inline-block;
  height: 62px;
  position: relative;
  width: 62px;
}

.app-ball::before,
.app-ball::after {
  color: var(--accent-red);
  content: "////";
  font-size: 15px;
  font-weight: 900;
  left: 16px;
  letter-spacing: -3px;
  position: absolute;
  transform: rotate(28deg);
}

.app-ball::before {
  top: 12px;
}

.app-ball::after {
  bottom: 12px;
}

.app-word {
  color: var(--accent-teal);
  font-size: 3.8rem;
  font-weight: 300;
  line-height: 0.9;
}

.app-tag {
  color: var(--text-muted);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
}

.app-search {
  border: 1px solid var(--accent-teal);
  color: var(--text-muted);
  font-size: 1.25rem;
  font-weight: 700;
  min-width: 420px;
  padding: 16px 20px;
}

.app-nav {
  align-items: center;
  display: flex;
  gap: 30px;
  margin: 18px 34px 20px;
}

.app-nav a {
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 900;
  text-decoration: none;
}

.app-nav a:hover {
  color: var(--accent-teal);
}

.mlb-badge {
  background: #0d2b52;
  border-radius: 4px;
  color: #ffffff;
  font-weight: 900;
  padding: 7px 12px;
}

.new-badge {
  background: #ff1717;
  border-radius: 4px;
  color: #ffffff;
  font-size: 0.7rem;
  margin-left: 4px;
  padding: 1px 4px;
}

.grid-icon {
  font-size: 1.8rem;
  margin-left: auto;
}

.topbar {
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--accent-teal);
  color: var(--text-main);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 14px 16px;
  position: relative;
}

.game-topbar {
  margin-bottom: 12px;
}

.eyebrow {
  color: var(--accent-teal-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  color: var(--text-main);
  font-size: 1.7rem;
  line-height: 1.1;
}

.status-stack {
  align-items: end;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}

.pill {
  background: var(--accent-red);
  border-radius: 0;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 5px 9px;
  text-transform: uppercase;
  white-space: nowrap;
}

.muted {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.back-link {
  color: var(--accent-red);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.landing-panel {
  background: var(--panel);
  border: 1px solid var(--accent-teal);
}

.landing-heading {
  align-items: baseline;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--accent-teal);
  display: flex;
  gap: 10px;
  padding: 10px 12px;
}

.landing-heading h2 {
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
}

.landing-heading span {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.games-list {
  display: grid;
}

.game-card {
  align-items: center;
  border-bottom: 1px solid var(--soft-line);
  color: inherit;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) 180px;
  padding: 12px 14px;
  text-decoration: none;
}

.game-card:nth-child(even) {
  background: var(--panel-soft);
}

.game-card:hover {
  background: var(--panel-hover);
}

.game-card-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.game-date {
  color: var(--accent-teal-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.game-card-main strong {
  color: var(--text-main);
  font-size: 1rem;
}

.game-card-main small {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-card-score {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.game-card-score span {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.game-card-score strong {
  color: var(--accent-red);
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem;
}

.game-live {
  box-shadow: inset 4px 0 0 var(--accent-red);
}

.game-final {
  box-shadow: inset 4px 0 0 var(--accent-teal);
}

.date-strip {
  align-items: stretch;
  border: 1px solid var(--accent-teal);
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  margin-bottom: 58px;
}

.date-strip > strong {
  align-items: center;
  border-right: 1px solid var(--accent-teal);
  color: var(--text-main);
  display: flex;
  font-size: 1.9rem;
  font-weight: 500;
  justify-content: center;
}

.date-games-strip {
  display: grid;
  grid-auto-columns: minmax(150px, 1fr);
  grid-auto-flow: column;
  overflow-x: auto;
}

.date-game {
  border-right: 1px solid var(--accent-teal);
  color: var(--text-main);
  display: grid;
  gap: 2px;
  padding: 7px 10px;
  text-decoration: none;
}

.date-game span {
  align-items: center;
  display: inline-flex;
  gap: 5px;
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1rem;
  font-weight: 800;
}

.date-game small {
  color: var(--accent-red);
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  justify-self: end;
}

.date-game b {
  color: var(--text-muted);
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 900;
  justify-self: start;
  text-transform: uppercase;
}

.page-heading {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 26px;
}

.page-heading h1 {
  font-size: 2rem;
}

.latest-game-link {
  background: var(--accent-red);
  color: #ffffff;
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 900;
  padding: 9px 12px;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.latest-game-link:hover {
  background: #ff5a70;
}

.landing-section {
  margin-bottom: 36px;
}

.landing-section > h2 {
  color: var(--text-main);
  font-size: 1.25rem;
  margin: 0 0 20px 6px;
}

.schedule-toggle {
  border: 1px solid var(--accent-teal);
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  margin: 0 0 22px;
}

.schedule-toggle-button {
  background: transparent;
  border: 0;
  color: var(--text-main);
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 900;
  padding: 10px 14px;
  text-transform: uppercase;
}

.schedule-toggle-button + .schedule-toggle-button {
  border-left: 1px solid var(--accent-teal);
}

.schedule-toggle-button:hover {
  background: var(--panel-hover);
}

.schedule-toggle-button.active {
  background: var(--accent-teal);
  color: #ffffff;
}

.scoreboard-card-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
}

.scoreboard-card {
  background: var(--panel);
  border: 1px solid var(--line);
}

.scoreboard-card a {
  color: inherit;
  display: block;
  padding: 20px 24px 24px;
  text-decoration: none;
}

.scoreboard-card a:hover {
  background: var(--panel-hover);
}

.cubs-win-celebration {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-self: center;
  margin-top: 14px;
  max-width: 100%;
  pointer-events: none;
  text-align: center;
  width: max-content;
}

.cubs-win-celebration[hidden] {
  display: none;
}

.fly-w {
  animation: fly-w 1.8s ease-out both, flag-wave 1.2s ease-in-out 1.8s infinite;
  background: #ffffff;
  border: 4px solid var(--accent-blue);
  box-shadow: 0 0 0 5px rgba(120, 174, 232, 0.18), 0 14px 34px rgba(0, 0, 0, 0.34);
  color: var(--accent-blue);
  display: inline-grid;
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 4.8rem;
  font-weight: 900;
  height: 128px;
  letter-spacing: 0;
  place-items: center;
  transform-origin: left center;
  width: 158px;
}

.cubs-win-celebration strong {
  animation: win-glow 1.6s ease-in-out infinite alternate;
  color: var(--text-main);
  font-size: 1.55rem;
  font-weight: 900;
  text-transform: uppercase;
}

@keyframes fly-w {
  0% {
    opacity: 0;
    transform: translateX(-240px) translateY(22px) rotate(-18deg) scale(0.48);
  }
  58% {
    opacity: 1;
    transform: translateX(14px) translateY(-8px) rotate(6deg) scale(1.08);
  }
  100% {
    opacity: 1;
    transform: translateX(0) translateY(0) rotate(0deg) scale(1);
  }
}

@keyframes flag-wave {
  0%,
  100% {
    transform: skewY(0deg) rotate(-1deg);
  }
  50% {
    transform: skewY(-7deg) rotate(2deg);
  }
}

@keyframes win-glow {
  from {
    color: var(--text-main);
    text-shadow: 0 0 0 rgba(134, 215, 224, 0);
  }
  to {
    color: #ffffff;
    text-shadow: 0 0 14px rgba(134, 215, 224, 0.55);
  }
}

.scorecard-status {
  border-bottom: 2px solid var(--accent-teal);
  display: flex;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 900;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
}

.scorecard-status span {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: right;
}

.scorecard-start-time {
  color: var(--text-main);
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 900;
  margin: -4px 0 12px;
  text-transform: uppercase;
}

.scorecard-lines {
  display: grid;
  gap: 16px;
}

.scorecard-team {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 48px minmax(0, 1fr) 34px;
}

.team-mark {
  align-items: center;
  color: var(--accent-teal);
  display: flex;
  gap: 7px;
  font-size: 1.1rem;
  font-weight: 900;
  justify-content: center;
}

.team-logo,
.date-team-logo,
.score-team-logo {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}

.team-logo {
  height: 34px;
  width: 34px;
}

.date-team-logo {
  height: 18px;
  width: 18px;
}

.score-strip .score-team-logo {
  height: 30px;
  max-height: 30px;
  max-width: 30px;
  min-height: 0;
  min-width: 0;
  width: 30px;
}

.scorecard-team strong {
  font-size: 1.05rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scorecard-team b {
  font-size: 1.05rem;
  text-align: right;
}

.scorecard-actions {
  background: var(--metric-soft);
  display: grid;
  font-size: 1rem;
  font-weight: 900;
  grid-template-columns: 1fr 1fr;
  margin-top: 18px;
  padding: 10px;
  text-align: center;
}

.score-strip {
  align-items: stretch;
  background: var(--panel);
  border: 1px solid var(--accent-teal);
  display: grid;
  gap: 0;
  grid-template-columns: minmax(0, 1fr) 180px minmax(0, 1fr);
  min-height: 92px;
  margin-bottom: 10px;
}

.score-strip-cubs-win {
  min-height: 250px;
}

.team-score {
  align-items: center;
  display: flex;
  gap: 10px;
  padding: 13px 14px;
}

.team-score-home {
  justify-content: end;
}

.team-score span {
  color: var(--text-main);
  font-weight: 900;
}

.team-score .team-hr-count,
.team-score .team-k-count {
  align-items: center;
  display: inline-flex;
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  gap: 4px;
  line-height: 1;
  padding: 4px 6px;
  transform: rotate(-4deg);
}

.team-score .team-hr-count {
  background: rgba(255, 64, 87, 0.16);
  border: 1px solid rgba(255, 64, 87, 0.72);
  color: #ffdce2;
}

.team-score .team-k-count {
  background: rgba(57, 164, 181, 0.16);
  border: 1px solid rgba(134, 215, 224, 0.72);
  color: #d6fbff;
  transform: rotate(4deg);
}

.team-score .team-hr-count::before,
.team-score .team-k-count::before {
  border: 1px solid currentColor;
  color: #ffffff;
  display: inline-grid;
  font-size: 0.62rem;
  height: 18px;
  place-items: center;
  width: 24px;
}

.team-score .team-hr-count::before {
  background: var(--accent-red);
  content: "HR";
}

.team-score .team-k-count::before {
  background: var(--accent-teal);
  content: "K";
}

.team-score strong {
  color: var(--accent-red);
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 2rem;
}

.team-score small,
.inning-card small {
  color: var(--text-muted);
}

#game-start-time {
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 900;
}

.inning-card {
  align-items: center;
  align-content: center;
  background: var(--panel-soft);
  border-left: 1px solid var(--soft-line);
  border-right: 1px solid var(--soft-line);
  display: grid;
  justify-items: center;
  padding: 18px 14px;
  text-align: center;
}

.inning-card span {
  color: var(--text-main);
  display: block;
  font-weight: 900;
}

.game-summary-grid {
  align-items: stretch;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(680px, 1fr) minmax(420px, 0.78fr);
  margin-bottom: 14px;
}

.current-context-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(210px, 0.72fr) repeat(5, minmax(210px, 1fr));
  margin-bottom: 14px;
}

.table-row-substitute td:nth-child(2) {
  padding-left: 30px;
}

.substitutions-card .leader-list {
  align-content: start;
  max-height: 340px;
  overflow-y: auto;
  scrollbar-color: var(--accent-teal) var(--table-head);
  scrollbar-width: thin;
}

.substitutions-card .leader-list::-webkit-scrollbar {
  width: 8px;
}

.substitutions-card .leader-list::-webkit-scrollbar-thumb {
  background: var(--accent-teal);
}

.substitutions-card .leader-list::-webkit-scrollbar-track {
  background: var(--table-head);
}

.diamond-panel {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  padding: 16px;
}

.current-context-grid .diamond-panel,
.current-context-grid .leader-card {
  min-height: 0;
}

.box-score-panel,
.leader-card,
.table-panel,
.recent-play-panel,
.play-card {
  background: var(--panel);
  border: 1px solid var(--line);
}

.box-score-panel {
  overflow: hidden;
}

.current-at-bat {
  border-top: 1px solid var(--soft-line);
  display: grid;
  gap: 7px;
  min-height: 104px;
  padding: 9px 10px 10px;
}

.current-at-bat > span,
.base-runner-row span {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.current-at-bat strong {
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-at-bat small {
  color: var(--text-muted);
  font-size: 0.76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-at-bat .current-play-detail {
  color: var(--accent-teal);
  font-weight: 900;
}

.current-play-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.current-matchup {
  align-items: center;
  display: flex;
  gap: 5px;
}

.current-at-bat p {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0;
}

.current-at-bat-detail-grid {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 220px;
}

.current-pitch-list {
  display: grid;
  gap: 5px;
}

.current-pitch-row {
  align-items: center;
  background: var(--panel-soft);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(190px, 0.8fr) minmax(260px, 1.4fr);
  overflow-x: auto;
  padding: 5px 6px;
}

.current-pitch-main,
.current-pitch-metrics {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
}

.current-pitch-main strong {
  color: var(--accent-red);
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.current-pitch-main span {
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-pitch-metrics span {
  background: var(--metric-soft);
  color: var(--text-main);
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  padding: 2px 5px;
}

.pitch-zone-panel {
  display: grid;
  gap: 5px;
  justify-items: center;
}

.pitch-zone-panel > span {
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pitch-zone-plot {
  aspect-ratio: 1;
  background:
    linear-gradient(rgba(220, 231, 238, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(220, 231, 238, 0.12) 1px, transparent 1px),
    var(--panel-soft);
  background-size: 33.333% 33.333%;
  border: 1px solid var(--soft-line);
  position: relative;
  width: 136px;
}

.pitch-zone-box {
  border: 2px solid var(--text-main);
  height: 50%;
  left: 29.25%;
  opacity: 0.72;
  position: absolute;
  top: 25%;
  width: 41.5%;
}

.pitch-zone-pitch {
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  font-weight: 900;
  height: 20px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  transform: translate(-50%, -50%);
  width: 20px;
}

.pitch-zone-pitch-strike {
  background: var(--accent-red);
}

.pitch-zone-pitch-ball {
  background: var(--accent-teal);
}

.pitch-zone-empty {
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--soft-line);
  color: var(--text-muted);
  display: flex;
  font-size: 0.7rem;
  font-weight: 900;
  height: 136px;
  justify-content: center;
  padding: 8px;
  text-align: center;
  text-transform: uppercase;
  width: 136px;
}

.current-zone-panel {
  justify-self: center;
  width: 100%;
}

.current-zone-panel .pitch-zone-plot,
.current-zone-panel .pitch-zone-empty {
  width: 180px;
}

.current-zone-panel .pitch-zone-empty {
  height: 180px;
}

.current-zone-panel .pitch-zone-pitch {
  font-size: 0.78rem;
  height: 24px;
  width: 24px;
}

.box-score-heading,
.leader-card h2,
.table-panel h3 {
  background: var(--table-head);
  border-bottom: 2px solid var(--accent-teal);
  color: var(--text-main);
}

.box-score-heading {
  align-items: baseline;
  display: flex;
  gap: 10px;
  padding: 9px 10px;
}

.box-score-heading h2,
.leader-card h2,
.table-panel h3 {
  font-size: 0.95rem;
  font-weight: 900;
  text-transform: uppercase;
}

.box-score-heading span {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.box-score-table th:first-child,
.box-score-table td:first-child {
  color: var(--text-main);
  font-weight: 900;
  text-align: left;
}

.box-score-table th:nth-child(2),
.box-score-table td:nth-child(2) {
  text-align: right;
}

.box-score-table th:nth-last-child(-n + 4),
.box-score-table td:nth-last-child(-n + 4) {
  background: var(--metric-soft);
  font-weight: 900;
}

.leader-card {
  overflow: hidden;
}

.win-probability {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.win-probability-meta {
  align-items: baseline;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-width: 0;
}

.win-probability-meta strong {
  color: var(--accent-red);
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  white-space: nowrap;
}

.win-probability-meta span {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.win-probability-chart {
  display: block;
  height: 128px;
  width: 100%;
}

.win-probability-midline {
  stroke: rgba(216, 229, 236, 0.24);
  stroke-dasharray: 4 5;
  stroke-width: 1;
}

.win-probability-area {
  fill: rgba(255, 64, 87, 0.16);
}

.win-probability-line {
  fill: none;
  stroke: var(--accent-red);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.win-probability-point {
  fill: var(--accent-teal);
  stroke: var(--text-main);
  stroke-width: 1;
}

.recent-play-panel {
  min-width: 0;
  overflow: hidden;
}

.recent-play-heading {
  align-items: baseline;
  background: var(--table-head);
  border-bottom: 2px solid var(--accent-teal);
  color: var(--text-main);
  display: flex;
  gap: 8px;
  padding: 9px 10px;
}

.recent-play-heading h2 {
  font-size: 0.95rem;
  font-weight: 900;
  margin: 0;
  text-transform: uppercase;
}

.recent-play-heading span {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.recent-play-log {
  gap: 4px;
  max-height: 720px;
  overflow: auto;
  padding: 4px;
}

.play-log.recent-play-log {
  gap: 4px;
}

.recent-play-log .play-card {
  overflow: hidden;
}

.recent-play-log .play-row {
  gap: 3px 7px;
  grid-template-areas:
    "inning matchup score bases"
    "inning description description bases";
  grid-template-columns: 64px minmax(0, 1fr) 48px 42px;
  min-height: 0;
  min-width: 0;
  padding: 4px 6px;
}

.recent-play-log .play-inning {
  grid-area: inning;
}

.recent-play-log .play-matchup {
  grid-area: matchup;
}

.recent-play-log .play-description {
  grid-area: description;
}

.recent-play-log .play-description-wrap {
  grid-area: description;
}

.recent-play-log .play-score {
  grid-area: score;
}

.recent-play-log .play-base-state {
  grid-area: bases;
}

.recent-play-log .play-zone-panel {
  display: none;
}

.recent-play-log .play-matchup {
  align-items: baseline;
  display: grid;
  gap: 7px;
  grid-template-columns: minmax(0, 1fr) max-content 28px;
}

.recent-play-log .play-matchup strong {
  grid-column: 1;
  font-size: 0.72rem;
  max-width: 100%;
}

.recent-play-log .play-matchup small {
  grid-column: 2;
  justify-self: end;
}

.recent-play-log .play-home-run-icon,
.recent-play-log .play-strikeout-icon {
  font-size: 0.58rem;
  grid-column: 3;
  height: 18px;
  justify-self: end;
  transform: none;
  width: 24px;
}

.recent-play-log .play-matchup small,
.recent-play-log .play-description,
.recent-play-log .play-score,
.recent-play-log .play-inning,
.recent-play-log .play-win-probability {
  font-size: 0.62rem;
}

.recent-play-log .play-base-mini {
  height: 20px;
  width: 20px;
}

.recent-play-log .play-base-dot {
  height: 7px;
  width: 7px;
}

.recent-play-log .play-zone-panel > span {
  display: none;
}

.recent-play-log .play-zone-panel .pitch-zone-plot,
.recent-play-log .play-zone-panel .pitch-zone-empty {
  width: 58px;
}

.recent-play-log .play-zone-panel .pitch-zone-empty {
  height: 58px;
}

.recent-play-log .play-zone-panel .pitch-zone-pitch {
  font-size: 0.5rem;
  height: 14px;
  width: 14px;
}

.leader-card h2 {
  border-bottom: 2px solid var(--accent-teal);
  font-size: 0.78rem;
  padding: 9px 10px;
}

.leader-list {
  display: grid;
}

.leader-row {
  border-bottom: 1px solid var(--soft-line);
  display: grid;
  gap: 2px;
  padding: 7px 8px;
}

.leader-row:nth-child(even) {
  background: var(--panel-soft);
}

.leader-row:last-child {
  border-bottom: 0;
}

.leader-row strong {
  background: #5b202b;
  color: #ffe5e8;
  display: inline-block;
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  font-weight: 900;
  padding: 2px 5px;
  width: max-content;
}

.leader-row:nth-child(1) strong,
.leader-row:nth-child(2) strong {
  background: var(--accent-red);
  color: #ffffff;
}

.leader-row span {
  color: var(--text-main);
  font-size: 0.76rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-row small,
.leader-empty {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.leader-empty {
  padding: 10px;
}

.base-runners {
  display: grid;
  gap: 6px;
  width: 100%;
}

.base-runner-row {
  align-items: baseline;
  border-top: 1px solid var(--soft-line);
  display: grid;
  gap: 6px;
  grid-template-columns: 46px minmax(0, 1fr);
  padding-top: 7px;
}

.base-runner-row strong {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.15;
  min-width: 0;
  overflow-wrap: anywhere;
}

.base-runner-occupied strong {
  color: var(--text-main);
}

.diamond-wrap {
  aspect-ratio: 1;
  margin: 0 auto;
  max-width: 210px;
  position: relative;
  width: 100%;
}

.base-path {
  background: #5d6f7d;
  height: 2px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform-origin: left center;
  width: 39%;
}

.base-path-left {
  transform: rotate(-45deg);
}

.base-path-right {
  transform: rotate(45deg);
}

.base-path-bottom-left {
  transform: rotate(135deg);
}

.base-path-bottom-right {
  transform: rotate(-135deg);
}

.base-marker {
  background: #dce7ee;
  border: 2px solid #6b7f8f;
  box-shadow: none;
  height: 28px;
  position: absolute;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 28px;
  z-index: 2;
}

.base-occupied {
  background: var(--accent-red);
  border-color: var(--line);
}

.base-first {
  left: 79%;
  top: 50%;
}

.base-second {
  left: 50%;
  top: 21%;
}

.base-third {
  left: 21%;
  top: 50%;
}

.base-home {
  background: var(--accent-blue);
  left: 50%;
  top: 79%;
}

.error {
  background: #33270b;
  border: 1px solid #c79b21;
  color: #ffe6a3;
  margin-bottom: 14px;
  padding: 10px 12px;
}

.stat-section {
  margin-top: 14px;
}

.section-header {
  align-items: baseline;
  background: var(--accent-teal);
  border: 1px solid var(--accent-teal);
  border-radius: 3px;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  margin-bottom: 8px;
  padding: 8px 11px;
  text-align: left;
  width: 100%;
}

.section-header:hover {
  background: var(--accent-teal-dark);
}

.section-title {
  font-size: 0.98rem;
  font-weight: 900;
  text-transform: uppercase;
}

.section-subtitle {
  color: #e9f6f8;
  font-size: 0.86rem;
}

.section-chevron {
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 900;
  margin-left: auto;
  transition: transform 0.15s ease;
}

.section-collapsed .section-chevron {
  transform: rotate(-90deg);
}

.section-body[hidden] {
  display: none;
}

.table-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.table-panel {
  min-width: 0;
  overflow: hidden;
}

.table-panel h3 {
  padding: 9px 10px;
}

.table-scroll {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--soft-line);
  font-size: 0.82rem;
  padding: 6px 7px;
  text-align: right;
  white-space: nowrap;
}

th {
  background: var(--table-head);
  border-bottom: 3px solid var(--line);
  color: var(--text-main);
  font-size: 0.7rem;
  font-weight: 900;
  position: sticky;
  text-transform: uppercase;
  top: 0;
}

td {
  color: var(--text-main);
}

tbody tr:nth-child(even) {
  background: var(--panel-soft);
}

tbody tr:hover {
  background: var(--panel-hover);
}

tr:last-child td {
  border-bottom: 0;
}

th:first-child,
td:first-child,
th:nth-child(2),
td:nth-child(2) {
  text-align: left;
}

.play-log {
  display: grid;
  gap: 7px;
}

.play-card {
  overflow-x: auto;
  overflow-y: hidden;
}

.play-card-expanded {
  border-color: var(--accent-teal);
  box-shadow: inset 4px 0 0 var(--accent-teal);
}

.play-card-scoring {
  border-color: rgba(255, 64, 87, 0.72);
  box-shadow: inset 4px 0 0 var(--accent-red);
}

.play-card-scoring .play-row {
  background: linear-gradient(90deg, rgba(255, 64, 87, 0.16), var(--panel) 34%);
}

.play-card-scoring .play-row:hover {
  background: linear-gradient(90deg, rgba(255, 64, 87, 0.22), var(--panel-hover) 34%);
}

.play-row {
  align-items: center;
  background: var(--panel);
  border: 0;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: 92px minmax(300px, 1fr) minmax(240px, 1.35fr) 88px 50px;
  min-width: 1040px;
  min-height: 0;
  padding: 4px 14px;
  text-align: left;
  width: 100%;
}

.play-row:hover {
  background: var(--panel-hover);
}

.play-inning,
.play-score,
.outs-indicator {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.outs-indicator {
  background: var(--metric-soft);
  border: 1px solid var(--soft-line);
  color: var(--text-main);
  display: inline-flex;
  justify-content: center;
  line-height: 1;
  padding: 4px 5px;
  white-space: nowrap;
}

.play-matchup {
  align-items: baseline;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.play-matchup strong,
.play-matchup small,
.play-description,
.play-description-wrap {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.play-matchup strong {
  align-items: center;
  color: var(--text-main);
  display: flex;
  font-size: 0.82rem;
  font-weight: 900;
  gap: 5px;
  min-width: 0;
}

.play-player {
  align-items: center;
  display: inline-flex;
  gap: 4px;
  min-width: 0;
}

.play-player > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.play-versus {
  color: var(--text-muted);
  flex: 0 0 auto;
}

.play-team-logo {
  display: block;
  flex: 0 0 auto;
  height: 18px;
  max-height: 18px;
  max-width: 18px;
  object-fit: contain;
  width: 18px;
}

.play-matchup small {
  color: var(--accent-teal);
  font-size: 0.7rem;
  font-weight: 900;
}

.play-home-run-icon,
.play-strikeout-icon {
  border: 1px solid currentColor;
  color: #ffffff;
  display: inline-grid;
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.58rem;
  font-weight: 900;
  height: 18px;
  letter-spacing: 0;
  line-height: 1;
  place-items: center;
  transform: rotate(-7deg);
  width: 24px;
}

.play-home-run-icon {
  background: var(--accent-red);
}

.play-strikeout-icon {
  background: var(--accent-teal);
  transform: rotate(7deg);
}

.play-description,
.empty-detail {
  color: var(--text-muted);
}

.play-card-scoring .play-score {
  color: #ffdce2;
}

.play-card-scoring .play-matchup small {
  color: var(--accent-red);
}

.play-description {
  font-size: 0.88rem;
}

.play-description-wrap {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.play-description-wrap .play-description {
  min-width: 0;
}

.play-win-probability {
  background: rgba(255, 64, 87, 0.14);
  border: 1px solid rgba(255, 64, 87, 0.58);
  color: #ffdce2;
  flex: 0 0 auto;
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  padding: 4px 5px;
}

.play-base-state {
  align-items: center;
  display: grid;
  gap: 2px;
  justify-content: center;
  justify-items: center;
  min-width: 0;
}

.play-out-dots {
  display: flex;
  gap: 3px;
}

.play-out-dot {
  background: #627482;
  border-radius: 50%;
  height: 6px;
  width: 6px;
}

.play-out-dot-active {
  background: var(--accent-red);
}

.play-base-mini {
  height: 34px;
  position: relative;
  width: 34px;
}

.play-base-dot {
  background: #dce7ee;
  border: 1px solid #6b7f8f;
  height: 11px;
  position: absolute;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 11px;
}

.play-base-dot-occupied {
  background: var(--accent-red);
  border-color: var(--line);
}

.play-base-dot-first {
  left: 76%;
  top: 52%;
}

.play-base-dot-second {
  left: 50%;
  top: 26%;
}

.play-base-dot-third {
  left: 24%;
  top: 52%;
}

.play-expanded-summary {
  background: var(--panel);
  border-top: 1px solid var(--soft-line);
  display: grid;
  gap: 3px;
  padding: 7px 12px;
}

.play-expanded-summary strong {
  color: var(--accent-teal);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.play-expanded-summary span {
  color: var(--text-main);
  font-size: 0.82rem;
  line-height: 1.35;
}

.play-expanded-detail-grid {
  align-items: center;
  background: var(--panel-soft);
  border-top: 1px solid var(--soft-line);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(720px, 1180px) minmax(220px, 1fr);
  padding: 6px 12px;
}

.play-expanded-detail-grid .play-details {
  border-top: 0;
  max-width: 1180px;
  padding: 0;
}

.play-zone-panel {
  align-self: center;
  justify-items: center;
  justify-self: center;
}

.play-zone-panel > span {
  font-size: 0.6rem;
}

.play-zone-panel .pitch-zone-plot,
.play-zone-panel .pitch-zone-empty {
  width: 180px;
}

.play-zone-panel .pitch-zone-empty {
  height: 180px;
}

.play-zone-panel .pitch-zone-pitch {
  font-size: 0.7rem;
  height: 22px;
  width: 22px;
}

.play-details {
  background: var(--panel-soft);
  border-top: 1px solid var(--soft-line);
  padding: 10px 12px;
}

.detail-grid {
  display: grid;
  gap: 5px;
}

.pitch-detail {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--soft-line);
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(220px, 1fr) max-content;
  padding: 4px 7px;
}

.pitch-detail-main,
.pitch-detail-metrics {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.pitch-detail-main {
  min-width: 0;
}

.pitch-detail-main strong {
  color: var(--accent-red);
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.pitch-detail-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pitch-detail-metrics span {
  background: var(--metric-soft);
  color: var(--text-main);
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  padding: 2px 5px;
}

@media (max-width: 920px) {
  .shell {
    padding: 12px;
  }

  .pitch-detail {
    grid-template-columns: 1fr;
  }

  .app-masthead {
    align-items: flex-start;
    flex-direction: column;
    margin: 0 12px;
  }

  .app-word {
    font-size: 2.7rem;
  }

  .app-tag {
    font-size: 1rem;
  }

  .app-search {
    min-width: 0;
    width: 100%;
  }

  .app-nav {
    gap: 14px;
    margin: 14px 12px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .date-strip {
    grid-template-columns: 1fr;
    margin-bottom: 26px;
  }

  .date-strip > strong {
    border-bottom: 1px solid var(--accent-teal);
    border-right: 0;
    justify-content: flex-start;
    padding: 10px;
  }

  .scoreboard-card-grid {
    grid-template-columns: 1fr;
  }

  .schedule-toggle {
    display: grid;
    width: 100%;
  }

  .topbar {
    flex-direction: column;
    padding: 14px 12px;
  }

  .fly-w {
    font-size: 3.4rem;
    height: 96px;
    width: 120px;
  }

  .cubs-win-celebration strong {
    font-size: 1.15rem;
  }

  .status-stack {
    align-items: start;
  }

  .score-strip,
  .table-grid,
  .game-summary-grid {
    grid-template-columns: 1fr;
  }

  .current-context-grid {
    grid-template-columns: 1fr;
  }

  .team-score-home {
    justify-content: start;
  }

  .inning-card {
    border-left: 0;
    border-right: 0;
    border-top: 1px solid var(--soft-line);
    border-bottom: 1px solid var(--soft-line);
    justify-items: start;
  }

  .game-card {
    grid-template-columns: 1fr;
  }

  .game-card-score {
    justify-items: start;
  }
}

@media (max-width: 680px) {
  .shell {
    padding: 10px;
  }

  .date-strip {
    margin-bottom: 24px;
  }

  .date-strip > strong {
    font-size: 1.35rem;
  }

  .date-games-strip {
    grid-auto-columns: minmax(118px, 42vw);
  }

  .date-game {
    padding: 8px;
  }

  .date-game span {
    font-size: 0.86rem;
  }

  .date-game small {
    font-size: 0.72rem;
    justify-self: start;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
  }

  .page-heading h1 {
    font-size: 1.55rem;
  }

  .schedule-toggle {
    margin-bottom: 18px;
  }

  .schedule-toggle-button {
    font-size: 0.82rem;
    padding: 10px 8px;
  }

  .landing-section > h2 {
    font-size: 1.05rem;
    margin-bottom: 12px;
  }

  .scoreboard-card-grid {
    gap: 12px;
  }

  .scoreboard-card a {
    padding: 14px;
  }

  .scorecard-status {
    align-items: flex-start;
    flex-direction: column;
    font-size: 1rem;
    gap: 4px;
  }

  .scorecard-status span {
    font-size: 0.78rem;
    text-align: left;
  }

  .scorecard-lines {
    gap: 10px;
  }

  .scorecard-team {
    gap: 8px;
    grid-template-columns: 38px minmax(0, 1fr) 30px;
  }

  .team-mark {
    font-size: 1rem;
  }

  .scorecard-team strong,
  .scorecard-team b {
    font-size: 0.95rem;
  }

  .scorecard-actions {
    font-size: 0.9rem;
    margin-top: 14px;
    padding: 8px;
  }

  .game-summary-grid {
    grid-template-columns: 1fr;
  }

  .current-at-bat-detail-grid {
    grid-template-columns: 1fr;
  }

  .current-zone-panel {
    justify-items: center;
  }

  .play-expanded-detail-grid {
    grid-template-columns: 1fr;
  }

  .play-zone-panel {
    justify-items: center;
  }
}

@media (max-width: 480px) {
  .current-pitch-row {
    grid-template-columns: max-content max-content;
  }
}
