/* Theme tokens and global defaults */
:root {
  --bg-start: #02060b;
  --bg: #07111f;
  --bg-end: #0b1b31;
  --panel: rgba(10, 23, 42, 0.86);
  --panel-strong: rgba(10, 23, 42, 0.96);
  --line: rgba(144, 180, 221, 0.2);
  --text: #f3f7fb;
  --muted: #9db3c9;
  --accent: #ffb703;
  --theme-primary-rgb: 0, 138, 230;
  --theme-secondary-rgb: 11, 27, 49;
  --accent-rgb: 255, 183, 3;
  --accent-contrast-rgb: 255, 226, 138;
  --danger: #ef476f;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --text-shadow-soft: 0 2px 10px rgba(2, 6, 11, 0.4);
  --text-shadow-strong: 0 3px 12px rgba(2, 6, 11, 0.5);
}

* {
  box-sizing: border-box;
}

.is-hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "IBM Plex Sans", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(var(--theme-primary-rgb), 0.22), transparent 28%),
    radial-gradient(circle at bottom right, rgba(var(--accent-rgb), 0.13), transparent 28%),
    linear-gradient(145deg, var(--bg-start) 0%, var(--bg) 48%, var(--bg-end) 100%);
}

/* Shared shell layout */
button,
select {
  font: inherit;
}

.app-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 20px 24px;
}

.topbar,
.controls,
.dashboard-grid,
.dashboard-actions,
.matchup-grid,
.details-grid,
.score-strip,
.hero-footer,
.panel-header,
.player-header,
.probable-pitchers,
.linescore-row {
  display: flex;
  gap: 16px;
}

.topbar,
.hero-footer,
.panel-header,
.player-header,
.probable-pitchers {
  align-items: center;
  justify-content: space-between;
}

.details-grid .panel .panel-header {
  margin-bottom: 12px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin-bottom: 10px;
  gap: 12px;
}

.team-label,
.mode-label,
.section-label,
.meta-label,
.status-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  color: var(--muted);
  text-shadow: var(--text-shadow-soft);
}

.brand-block h1,
.score-side h2,
.player-card h3,
.center-state,
.score-value,
.countdown {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
}

.brand-block h1 {
  font-size: clamp(1.9rem, 3.3vw, 2rem);
  line-height: 0.82;
  text-shadow: var(--text-shadow-strong);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo,
.team-logo,
.player-photo {
  object-fit: contain;
}

.brand-logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.controls {
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 8px;
}

.header-select,
.dashboard-action-button {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 12px;
  color: var(--text);
  background: var(--panel);
  height: 42px;
}

.header-select:focus-visible,
.dashboard-action-button:focus-visible {
  outline: 2px solid rgba(var(--accent-contrast-rgb), 0.96);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.18);
}

.dashboard-action-button {
  cursor: pointer;
  white-space: nowrap;
}

.header-select {
  min-width: 280px;
}

.dashboard-actions {
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.status-banner {
  min-height: 0;
  margin-bottom: 0;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: rgba(8, 16, 31, 0.35);
  color: var(--muted);
  font-size: 0.95rem;
}

.status-banner.is-error {
  border-color: rgba(239, 71, 111, 0.35);
  background: rgba(239, 71, 111, 0.12);
  color: #ffd9e2;
}

.status-banner-inline {
  margin-top: 6px;
}

.dashboard-grid {
  flex-direction: column;
}

/* Core surfaces */
.hero-card,
.player-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  padding: 20px;
}

.hero-meta {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.status-label {
  justify-self: end;
  text-align: right;
}

.updated-clock {
  margin: 0;
  justify-self: center;
  color: var(--muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 1rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
  text-shadow: var(--text-shadow-soft);
}

/* Hero scoreboard layout */
.celebration-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(24px, 10vh) max(18px, 10vw);
  background: rgba(2, 6, 11, 0.34);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.98);
  transition: opacity 320ms ease, transform 320ms ease;
  z-index: 30;
}

.celebration-modal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.celebration-modal.is-exiting {
  opacity: 0;
  transform: translateY(-8px) scale(1.02);
}

.celebration-card {
  --celebration-flare-rgb: var(--accent-rgb);
  --celebration-secondary-rgb: 255, 214, 109;
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(12px, 2.6vh, 30px);
  width: min(80vw, 1600px);
  height: 80vh;
  max-width: 100%;
  max-height: 100%;
  padding: clamp(28px, 4vw, 72px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(7, 17, 31, 0.76), rgba(7, 17, 31, 0.9)),
    rgba(10, 23, 42, 0.84);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  backdrop-filter: blur(18px) saturate(135%);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  text-align: center;
  overflow: hidden;
}

.celebration-card::before,
.celebration-card::after {
  content: "";
  position: absolute;
  inset: -18%;
  opacity: 0;
  pointer-events: none;
}

.celebration-card::before {
  background:
    radial-gradient(circle at center, rgba(var(--celebration-flare-rgb), 0.28), transparent 54%),
    radial-gradient(circle at center, rgba(var(--celebration-secondary-rgb), 0.14), transparent 72%);
}

.celebration-card::after {
  background:
    repeating-linear-gradient(
      115deg,
      rgba(var(--celebration-secondary-rgb), 0.14) 0 14px,
      transparent 14px 38px
    );
  mix-blend-mode: screen;
}

.celebration-card.is-pitcher {
  --celebration-flare-rgb: 93, 211, 158;
  --celebration-secondary-rgb: 144, 237, 205;
  border-color: rgba(93, 211, 158, 0.28);
}

.celebration-card.is-batter {
  --celebration-flare-rgb: var(--accent-rgb);
  --celebration-secondary-rgb: 255, 214, 109;
  border-color: rgba(var(--accent-rgb), 0.28);
}

.celebration-card.is-fan-moment {
  border-color: rgba(var(--celebration-flare-rgb), 0.78);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(var(--celebration-secondary-rgb), 0.22),
    0 0 48px rgba(var(--celebration-flare-rgb), 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.celebration-card.is-fan-moment[data-impact-context="game_tying"] {
  --celebration-secondary-rgb: 176, 234, 255;
}

.celebration-card.is-fan-moment[data-impact-context="go_ahead"] {
  --celebration-secondary-rgb: 255, 222, 120;
}

.celebration-card.is-fan-moment[data-impact-context="insurance"] {
  --celebration-secondary-rgb: 255, 176, 112;
}

.celebration-card.is-fan-moment::before,
.celebration-card.is-fan-moment::after {
  opacity: 1;
}

.celebration-card.is-fan-moment::before {
  animation: celebrationPanelGlow 2.1s ease-in-out infinite;
}

.celebration-card.is-fan-moment::after {
  animation: celebrationPanelSweep 3.2s linear infinite;
}

.celebration-card.is-fan-moment[data-impact-context="go_ahead"]::after {
  animation-duration: 2.3s;
}

.celebration-fx {
  position: absolute;
  inset: -6%;
  pointer-events: none;
  z-index: 0;
}

.celebration-fx > span {
  position: absolute;
  opacity: 0;
}

.celebration-fx-burst {
  inset: 10%;
  border-radius: 50%;
  background:
    repeating-conic-gradient(
      from 0deg,
      rgba(var(--celebration-flare-rgb), 0.48) 0deg 12deg,
      transparent 12deg 24deg
    );
  mix-blend-mode: screen;
  transform: scale(0.42);
  filter: blur(1px);
}

.celebration-fx-ring {
  top: 50%;
  left: 50%;
  width: min(54vw, 760px);
  aspect-ratio: 1;
  border: 2px solid rgba(var(--celebration-secondary-rgb), 0.58);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.36);
  box-shadow:
    0 0 26px rgba(var(--celebration-flare-rgb), 0.28),
    inset 0 0 20px rgba(var(--celebration-secondary-rgb), 0.12);
}

.celebration-fx-ring.is-secondary {
  width: min(70vw, 980px);
  border-color: rgba(var(--celebration-flare-rgb), 0.34);
  box-shadow: 0 0 34px rgba(var(--celebration-flare-rgb), 0.22);
}

.celebration-fx-particles {
  inset: 8%;
  background:
    radial-gradient(circle at 18% 26%, rgba(var(--celebration-secondary-rgb), 0.98) 0 1.8%, transparent 2.3%),
    radial-gradient(circle at 30% 18%, rgba(var(--celebration-flare-rgb), 0.84) 0 1.4%, transparent 2%),
    radial-gradient(circle at 76% 22%, rgba(var(--celebration-secondary-rgb), 0.92) 0 1.5%, transparent 2.1%),
    radial-gradient(circle at 82% 31%, rgba(var(--celebration-flare-rgb), 0.84) 0 1.2%, transparent 1.8%),
    radial-gradient(circle at 22% 74%, rgba(var(--celebration-flare-rgb), 0.88) 0 1.4%, transparent 2%),
    radial-gradient(circle at 70% 70%, rgba(var(--celebration-secondary-rgb), 0.92) 0 1.7%, transparent 2.4%),
    radial-gradient(circle at 54% 82%, rgba(var(--celebration-flare-rgb), 0.78) 0 1.4%, transparent 2%);
  filter: drop-shadow(0 0 10px rgba(var(--celebration-secondary-rgb), 0.2));
}

.celebration-fx-firework {
  top: 8%;
  width: min(24vw, 300px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.98) 0 6%, transparent 6.8%),
    repeating-conic-gradient(
      from 0deg,
      rgba(var(--celebration-secondary-rgb), 0.82) 0deg 10deg,
      transparent 10deg 24deg
    );
  mix-blend-mode: screen;
  filter: blur(0.2px) drop-shadow(0 0 18px rgba(var(--celebration-flare-rgb), 0.26));
}

.celebration-fx-firework.is-left {
  left: 6%;
}

.celebration-fx-firework.is-right {
  right: 6%;
}

.celebration-media {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.celebration-team-logo,
.celebration-player-photo {
  position: absolute;
  flex-shrink: 0;
  opacity: 0.94;
}

.celebration-team-logo {
  top: clamp(26px, 4vh, 58px);
  left: clamp(26px, 3vw, 58px);
  width: clamp(84px, 10vw, 180px);
  height: clamp(84px, 10vw, 180px);
  object-fit: contain;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.3));
}

.celebration-player-photo {
  top: clamp(24px, 3.5vh, 52px);
  right: clamp(24px, 3vw, 52px);
  width: clamp(120px, 12vw, 240px);
  height: auto;
  aspect-ratio: 2 / 3;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.28), rgba(var(--theme-secondary-rgb), 0.16)),
    rgba(255, 255, 255, 0.04);
}

.celebration-player-photo.has-image:not(.is-fallback) {
  background: var(--portrait-matte, transparent);
  object-fit: contain;
  object-position: center bottom;
}

.celebration-player-photo.is-fallback {
  padding: clamp(24px, 2.4vw, 36px);
}

.celebration-label,
.celebration-detail,
.celebration-actor {
  margin: 0;
  position: relative;
  z-index: 1;
}

.celebration-label {
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(4.6rem, 13vw, 12rem);
  font-weight: 900;
  display: block;
  max-width: min(100%, 9.6ch);
  line-height: 0.94;
  color: #ffffff;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-wrap: balance;
  -webkit-text-fill-color: #ffffff;
  -webkit-text-stroke: 10px rgba(80, 89, 102, 0.96);
  paint-order: stroke fill;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.26),
    0 0 18px rgba(4, 11, 22, 0.42),
    0 0 36px rgba(4, 11, 22, 0.28),
    6px 8px 0 rgba(3, 8, 15, 0.4),
    0 14px 30px rgba(0, 0, 0, 0.5);
}

.celebration-detail {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: clamp(1.3rem, 3vw, 2.8rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: var(--text-shadow-soft);
}

.celebration-actor {
  font-size: clamp(1.8rem, 4vw, 3.6rem);
  line-height: 1.05;
  color: rgba(243, 247, 251, 0.92);
  text-shadow: var(--text-shadow-soft);
}

.celebration-card.is-fan-moment[data-hype-tier="2"] .celebration-fx-burst,
.celebration-card.is-fan-moment[data-hype-tier="3"] .celebration-fx-burst,
.celebration-card.is-fan-moment[data-hype-tier="4"] .celebration-fx-burst,
.celebration-card.is-fan-moment[data-hype-tier="5"] .celebration-fx-burst {
  opacity: 0.44;
  animation: celebrationBurstSpin 2.4s linear infinite;
}

.celebration-card.is-fan-moment[data-hype-tier="2"] .celebration-fx-ring,
.celebration-card.is-fan-moment[data-hype-tier="3"] .celebration-fx-ring,
.celebration-card.is-fan-moment[data-hype-tier="4"] .celebration-fx-ring,
.celebration-card.is-fan-moment[data-hype-tier="5"] .celebration-fx-ring {
  opacity: 0.78;
  animation: celebrationRingExpand 1.55s ease-out infinite;
}

.celebration-card.is-fan-moment[data-hype-tier="3"] .celebration-fx-ring.is-secondary,
.celebration-card.is-fan-moment[data-hype-tier="4"] .celebration-fx-ring.is-secondary,
.celebration-card.is-fan-moment[data-hype-tier="5"] .celebration-fx-ring.is-secondary {
  opacity: 0.5;
  animation: celebrationRingExpand 1.95s ease-out infinite 0.24s;
}

.celebration-card.is-fan-moment[data-impact-context="game_tying"] .celebration-fx-ring.is-secondary {
  opacity: 0.44;
  animation: celebrationRingExpand 1.7s ease-out infinite 0.16s;
}

.celebration-card.is-fan-moment[data-hype-tier="3"] .celebration-fx-particles,
.celebration-card.is-fan-moment[data-hype-tier="4"] .celebration-fx-particles,
.celebration-card.is-fan-moment[data-hype-tier="5"] .celebration-fx-particles {
  opacity: 0.74;
  animation: celebrationParticlesDrift 2.8s linear infinite;
}

.celebration-card.is-fan-moment[data-impact-context="insurance"] .celebration-fx-particles {
  opacity: 0.88;
  animation-duration: 2.2s;
}

.celebration-card.is-fan-moment[data-hype-tier="4"] .celebration-fx-firework,
.celebration-card.is-fan-moment[data-hype-tier="5"] .celebration-fx-firework {
  opacity: 1;
  animation: celebrationFireworkPop 1.2s steps(2, end) infinite;
}

.celebration-card.is-fan-moment[data-hype-tier="5"] .celebration-fx-firework {
  animation-duration: 0.92s;
}

.celebration-card.is-fan-moment[data-hype-tier="2"] .celebration-label,
.celebration-card.is-fan-moment[data-hype-tier="3"] .celebration-label {
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  -webkit-text-stroke: 10px rgba(80, 89, 102, 0.96);
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.24),
    0 0 18px rgba(6, 15, 28, 0.36),
    0 0 34px rgba(6, 15, 28, 0.24),
    0 0 22px rgba(var(--celebration-flare-rgb), 0.4),
    6px 8px 0 rgba(3, 8, 15, 0.38),
    0 12px 28px rgba(0, 0, 0, 0.46);
  animation: celebrationHeadlinePunch 420ms cubic-bezier(0.16, 1, 0.3, 1), celebrationLabelPulse 1.8s ease-in-out infinite;
}

.celebration-card.is-fan-moment[data-hype-tier="4"] .celebration-label,
.celebration-card.is-fan-moment[data-hype-tier="5"] .celebration-label {
  background: linear-gradient(
    180deg,
    #fffdf5 0%,
    #fff2a8 22%,
    rgba(var(--celebration-secondary-rgb), 1) 46%,
    #ff8a00 72%,
    #ff3b30 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 4px rgba(23, 20, 24, 0.94);
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.2),
    0 0 22px rgba(255, 219, 92, 0.34),
    0 0 40px rgba(255, 76, 54, 0.28),
    6px 8px 0 rgba(12, 8, 10, 0.38),
    0 14px 28px rgba(0, 0, 0, 0.46);
  animation:
    celebrationHeadlinePunch 420ms cubic-bezier(0.16, 1, 0.3, 1),
    celebrationMegaFlash 1.35s steps(2, end) infinite;
}

.celebration-card.is-fan-moment[data-hype-tier="5"] {
  animation: celebrationGrandSlamThump 1.08s ease-in-out infinite;
}

.celebration-card.is-fan-moment[data-hype-tier="5"] .celebration-label {
  letter-spacing: 0.05em;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.22),
    0 0 34px rgba(255, 231, 122, 0.46),
    0 0 60px rgba(255, 59, 48, 0.42),
    8px 10px 0 rgba(12, 8, 10, 0.4),
    0 16px 32px rgba(0, 0, 0, 0.54);
}

.celebration-card.is-fan-moment[data-hype-tier="4"] .celebration-detail,
.celebration-card.is-fan-moment[data-hype-tier="4"] .celebration-actor,
.celebration-card.is-fan-moment[data-hype-tier="5"] .celebration-detail,
.celebration-card.is-fan-moment[data-hype-tier="5"] .celebration-actor {
  animation: celebrationSublineRise 620ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.celebration-card.is-fan-moment[data-impact-context="game_tying"] .celebration-detail {
  color: rgba(223, 247, 255, 0.96);
  letter-spacing: 0.16em;
}

.celebration-card.is-fan-moment[data-impact-context="go_ahead"] .celebration-detail {
  color: rgba(255, 240, 179, 0.98);
  letter-spacing: 0.18em;
  text-shadow:
    0 0 18px rgba(var(--celebration-secondary-rgb), 0.28),
    var(--text-shadow-soft);
}

.celebration-card.is-fan-moment[data-impact-context="insurance"] .celebration-detail {
  color: rgba(255, 225, 198, 0.96);
}

@keyframes celebrationPanelGlow {
  0%, 100% {
    transform: scale(0.96);
    opacity: 0.38;
  }
  50% {
    transform: scale(1.04);
    opacity: 0.92;
  }
}

@keyframes celebrationPanelSweep {
  0% {
    transform: translateX(-12%) rotate(0deg);
    opacity: 0.12;
  }
  50% {
    opacity: 0.28;
  }
  100% {
    transform: translateX(12%) rotate(4deg);
    opacity: 0.12;
  }
}

@keyframes celebrationBurstSpin {
  0% {
    transform: scale(0.36) rotate(0deg);
  }
  100% {
    transform: scale(1.06) rotate(180deg);
  }
}

@keyframes celebrationRingExpand {
  0% {
    transform: translate(-50%, -50%) scale(0.34);
    opacity: 0.78;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.08);
    opacity: 0;
  }
}

@keyframes celebrationParticlesDrift {
  0% {
    transform: translateY(8px) scale(0.98);
    opacity: 0.2;
  }
  30% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-18px) scale(1.08);
    opacity: 0.12;
  }
}

@keyframes celebrationFireworkPop {
  0% {
    transform: scale(0.24);
    opacity: 0;
  }
  25% {
    opacity: 0.96;
  }
  100% {
    transform: scale(1.1);
    opacity: 0;
  }
}

@keyframes celebrationHeadlinePunch {
  0% {
    transform: scale(0.72);
    opacity: 0;
  }
  80% {
    transform: scale(1.06);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

@keyframes celebrationLabelPulse {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes celebrationMegaFlash {
  0%, 100% {
    filter: brightness(1) saturate(1);
  }
  50% {
    filter: brightness(1.18) saturate(1.16);
  }
}

@keyframes celebrationGrandSlamThump {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.014);
  }
}

@keyframes celebrationSublineRise {
  0% {
    transform: translateY(18px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.score-strip {
  align-items: center;
  margin: 24px 0 0;
  padding: 18px 22px;
  border-radius: 4px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.score-side,
.center-status {
  min-height: 120px;
}

.score-side {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.score-side::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  background-image: var(--side-logo);
  background-repeat: no-repeat;
  background-size: auto 100%;
  background-position: var(--side-watermark-position, center center);
  filter: grayscale(1);
}

.score-side.has-watermark::before {
  opacity: var(--side-watermark-opacity, 0.05);
}

/* Team-side watermark backgrounds intentionally stay behind the readable
   foreground content. Team-specific tuning is injected from app.js. */
.score-side-text {
  min-width: 0;
  width: fit-content;
  max-width: 100%;
  display: grid;
  justify-items: center;
}

.team-logo {
  width: 74px;
  height: 74px;
}
.score-side > * {
  position: relative;
  z-index: 2;
}

.score-side-meta,
.live-side-card {
  position: relative;
  z-index: 2;
}

.team-record {
  display: none;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-shadow: var(--text-shadow-soft);
}

.team-standing {
  display: none;
  font-size: 0.98rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: var(--text-shadow-soft);
}

.score-side-meta {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-height: 52px;
}

.score-side h2 {
  font-size: clamp(1.9rem, 2.8vw, 3rem);
  line-height: 0.95;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-wrap: balance;
  text-align: center;
  text-shadow: var(--text-shadow-strong);
}

.score-side-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: fit-content;
  max-width: 100%;
  position: relative;
  z-index: 1;
}

.score-side.score-side-compact .score-side-main {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 10px;
  width: 100%;
}

.score-side.score-side-compact .score-side-text {
  width: auto;
  gap: 4px;
}

.score-side.score-side-compact .score-value {
  justify-self: center;
  margin-bottom: 6px;
}

.score-side.score-side-live .score-side-meta {
  display: none;
}

.home-main {
  flex-direction: row-reverse;
}

.live-side-card {
  width: min(100%, 390px);
  position: relative;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  grid-template-areas:
    "photo body"
    "photo stats";
  gap: 10px 12px;
  align-items: stretch;
  padding: 10px 12px;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(8, 16, 31, 0.22);
  -webkit-backdrop-filter: blur(14px) saturate(125%);
  backdrop-filter: blur(14px) saturate(125%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  text-align: left;
}

.live-side-card.has-batting-order::after,
.player-card.has-batting-order::after {
  content: attr(data-batting-order);
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-contrast-rgb), 0.34);
  background:
    linear-gradient(180deg, rgba(17, 30, 51, 0.96), rgba(10, 18, 33, 0.92)),
    rgba(8, 16, 31, 0.92);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.01em;
  text-shadow:
    0 2px 10px rgba(2, 6, 11, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.08);
  z-index: 3;
}

.live-side-card.has-batting-order::after {
  top: 10px;
  right: 12px;
}

.live-side-card.has-batting-order .live-side-name,
.live-side-card.has-batting-order .live-side-meta-text {
  padding-right: 58px;
}

/* Live hero-side player cards use a frosted treatment so the large team
   watermark still hints through without fighting the foreground text. */
.live-side-stats {
  grid-area: stats;
  margin-top: 0;
  min-width: 0;
}

.live-side-label {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--muted);
  text-shadow: var(--text-shadow-soft);
}

.live-side-player {
  display: contents;
}

.live-side-player > div {
  display: grid;
  grid-area: body;
  align-content: start;
  gap: 6px;
  min-width: 0;
}

.live-side-photo {
  grid-area: photo;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 2 / 3;
  border-radius: 4px;
  border: 1px solid var(--line);
  object-fit: contain;
  object-position: center bottom;
  align-self: start;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.28), rgba(var(--theme-secondary-rgb), 0.16)),
    rgba(255, 255, 255, 0.04);
}

.live-side-photo.has-image:not(.is-fallback),
.player-photo.has-image:not(.is-fallback) {
  background: var(--portrait-matte, transparent);
}

.live-side-photo.is-fallback {
  padding: 18px;
}

.live-side-name {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.55rem;
  line-height: 0.95;
  color: var(--text);
  text-shadow: var(--text-shadow-strong);
}

.live-side-meta-text {
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--muted);
  text-shadow: var(--text-shadow-soft);
  white-space: pre-line;
}

.score-value {
  font-size: clamp(3.6rem, 8vw, 5.8rem);
  line-height: 0.85;
  color: var(--accent);
  text-shadow: var(--text-shadow-strong);
}

.score-value.score-value-record {
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1;
  color: var(--text);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  letter-spacing: 0.04em;
}

.center-status {
  flex: 0 0 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 10px 8px;
}

.center-state {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  text-shadow: var(--text-shadow-strong);
}

.inning-state-markup,
.inning-state-value {
  display: inline-flex;
  align-items: flex-start;
}

.inning-state-markup {
  gap: 0.14em;
  white-space: nowrap;
}

.inning-state-indicator {
  min-width: 0.62em;
  height: 0.72em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-top: 0.08em;
}

.inning-state-indicator-icon {
  display: block;
  background: var(--muted);
  filter: drop-shadow(0 1px 0 rgba(2, 6, 11, 0.28));
}

.inning-state-indicator-icon.is-top,
.inning-state-indicator-icon.is-bottom {
  width: 0.48em;
  height: 0.38em;
}

.inning-state-indicator-icon.is-top {
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.inning-state-indicator-icon.is-bottom {
  clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
}

.inning-state-indicator-icon.is-mid {
  background: transparent;
  color: var(--muted);
  font-size: 0.42em;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.inning-state-indicator-icon.is-end {
  background: transparent;
  color: var(--muted);
  font-size: 0.42em;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.inning-state-value {
  gap: 0.02em;
  line-height: 0.92;
}

.inning-state-number {
  color: var(--text);
}

.inning-state-suffix {
  font-size: 0.42em;
  line-height: 1;
  color: var(--muted);
  padding-top: 0.24em;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

/* Countdown / inning-center readout */
.countdown {
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  line-height: 0.9;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-variant-numeric: tabular-nums;
  text-shadow: var(--text-shadow-strong);
}

.countdown-launch {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.14em;
}

.countdown-segment {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.02em;
}

.countdown-value {
  color: var(--text);
  line-height: 1;
}

.countdown-unit,
.countdown-sign {
  color: rgba(157, 179, 201, 0.72);
}

.countdown-unit {
  font-size: 0.42em;
  line-height: 1;
  margin-top: 0.08em;
}

.bases-mini {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.bases-mini.is-visible {
  display: flex;
}

.base-dots {
  display: flex;
  gap: 10px;
}

.base-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: transparent;
  display: inline-block;
}

.base-dot.is-active {
  background: rgba(var(--accent-rgb), 0.92);
  border-color: rgba(var(--accent-contrast-rgb), 0.98);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.35);
}

.base-diamond {
  position: relative;
  width: 70px;
  height: 70px;
}

.base {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.08);
  transform: rotate(45deg);
}

.base.second {
  top: 2px;
  left: 24px;
}

.base.third {
  top: 24px;
  left: 2px;
}

.base.first {
  top: 24px;
  left: 46px;
}

.base.home {
  top: 46px;
  left: 24px;
  background: rgba(var(--accent-rgb), 0.15);
}

.base.is-active {
  background: rgba(var(--accent-rgb), 0.78);
  border-color: rgba(var(--accent-contrast-rgb), 0.95);
}

/* Count chips and mode-specific center detail text */
.count-state,
.player-meta,
.meta-value,
.recent-play {
  color: var(--muted);
}

.count-state {
  display: flex;
  justify-content: center;
}

.elapsed-time {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  min-height: 1.1rem;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  text-shadow: var(--text-shadow-soft);
}

.elapsed-label {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.elapsed-value {
  font-size: 0.92rem;
  color: rgba(233, 240, 247, 0.86);
}

.count-layout {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.count-chip {
  display: grid;
  gap: 4px;
  min-width: 84px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
}

.count-chip-label,
.count-status-text {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-shadow: var(--text-shadow-soft);
}

.count-status-text {
  display: grid;
  justify-items: center;
  gap: 3px;
  text-transform: uppercase;
}

.pregame-detail-line {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.15;
  color: var(--muted);
}

.pregame-detail-location {
  font-size: clamp(0.92rem, 1.5vw, 1.1rem);
}

.pregame-detail-time {
  font-size: clamp(1.02rem, 1.9vw, 1.32rem);
  color: var(--text);
  margin-top: 0.28em;
}

.count-chip-value {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--accent);
  text-shadow: var(--text-shadow-soft);
}

/* Lower layout rows */
.hero-footer,
.matchup-grid,
.details-grid,
.active-games-panel {
  margin-top: 10px;
}

.hero-footer {
  align-items: start;
  min-height: 0;
}

.hero-footer .meta-label:empty,
.hero-footer .meta-value:empty {
  display: none;
}

.matchup-grid,
.details-grid {
  flex-wrap: wrap;
}

.matchup-grid {
  margin-top: 6px;
}

.details-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  align-items: stretch;
  margin-top: 6px;
}

.details-grid-live {
  margin-top: 2px;
}

.active-games-panel .panel-header {
  margin-bottom: 12px;
}

.active-games-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.active-games-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.active-game-card {
  width: 100%;
  min-height: 126px;
  display: grid;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.active-game-card:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--accent-contrast-rgb), 0.55);
  background: rgba(255, 255, 255, 0.05);
}

.active-game-card:focus-visible {
  outline: 2px solid rgba(var(--accent-contrast-rgb), 0.96);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.18);
}

.active-game-card-header,
.active-game-team-row,
.active-game-team-label {
  display: flex;
  align-items: center;
}

.active-game-card-header,
.active-game-team-row {
  justify-content: space-between;
  gap: 12px;
}

.active-game-card-status,
.active-game-card-action {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.active-game-card-action {
  text-align: right;
}

.active-game-card-body {
  display: grid;
  gap: 10px;
}

.active-game-team-label {
  gap: 8px;
  min-width: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.4rem;
  line-height: 0.92;
}

.active-game-team-label.is-winner {
  padding: 6px 10px 6px 6px;
  border: 1px solid rgba(248, 228, 169, 0.38);
  border-radius: 4px;
  background: #5f470f;
  color: #f8f3e2;
  box-shadow: inset 0 0 0 1px rgba(255, 240, 194, 0.12);
}

.logo-badge {
  --logo-badge-border: rgba(255, 255, 255, 0.22);
  --logo-badge-glow: rgba(255, 255, 255, 0.14);
  width: 52px;
  height: 52px;
  position: relative;
  display: block;
  flex-shrink: 0;
  border-radius: 14px;
  border: 1px solid var(--logo-badge-border);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(251, 253, 255, 0.98), rgba(226, 234, 244, 0.94)),
    rgba(255, 255, 255, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 20px rgba(0, 0, 0, 0.2),
    0 0 18px var(--logo-badge-glow);
}

.logo-badge-inline {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.logo-badge-placeholder {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(26, 45, 70, 0.1), rgba(26, 45, 70, 0.18)),
    rgba(255, 255, 255, 0.5);
}

.active-game-team-logo {
  position: absolute;
  inset: 0;
  margin: auto;
  width: auto;
  height: auto;
  max-width: calc(100% - 10px);
  max-height: calc(100% - 10px);
  display: block;
  object-fit: contain;
  object-position: center;
}

.active-game-team-score {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 1.55rem;
  line-height: 1;
  color: var(--accent);
}

/* Player cards */
.player-card,
.panel {
  flex: 1 1 320px;
  padding: 20px;
}

.player-card {
  position: relative;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  grid-template-areas:
    "label label"
    "photo name"
    "photo meta"
    "photo stats";
  gap: 10px 16px;
  align-items: stretch;
}

.player-card.has-batting-order::after {
  top: 16px;
  right: 20px;
  min-width: 46px;
  height: 46px;
  font-size: 2.2rem;
}

.details-grid > .panel {
  min-width: 0;
  height: 100%;
}

.notes-panel {
  display: flex;
  flex-direction: column;
}

.notes-panel .panel-header {
  flex: 0 0 auto;
}

.notes-panel .recent-play,
.notes-panel .upcoming-schedule {
  flex: 0 0 auto;
}

.notes-panel .recent-play {
  flex: 1 1 auto;
}

.notes-panel .probable-pitchers {
  margin-top: auto;
  align-items: flex-end;
}

.notes-panel .probable-pitchers > div {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.player-header {
  display: contents;
}

.player-header > div {
  display: contents;
}

.player-photo {
  grid-area: photo;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 2 / 3;
  border-radius: 4px;
  flex-shrink: 0;
  align-self: start;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.28), rgba(var(--theme-secondary-rgb), 0.16)),
    rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.player-photo.has-image {
  object-fit: contain;
  object-position: center bottom;
  padding: 0;
}

.player-photo.is-fallback {
  padding: 24px;
}

.player-card > .section-label {
  grid-area: label;
}

.player-card h3 {
  grid-area: name;
  font-size: 2rem;
  line-height: 0.95;
}

.player-card.has-batting-order h3,
.player-card.has-batting-order .player-meta {
  padding-right: 70px;
}

.player-meta,
.player-line,
.recent-play,
.meta-value {
  margin: 0;
}

.player-meta {
  grid-area: meta;
  white-space: pre-line;
}

.player-line,
.recent-play {
  font-size: 1.05rem;
  line-height: 1.55;
}

/* Pregame schedule strip */
.upcoming-schedule {
  margin: 0;
  padding-top: 6px;
}

.schedule-strip {
  display: grid;
  grid-template-columns: repeat(var(--schedule-columns, 5), minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}

.schedule-item {
  display: grid;
  justify-items: stretch;
  align-content: start;
  gap: 5px;
  min-height: 126px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
}

.schedule-item-home {
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.12), rgba(var(--theme-primary-rgb), 0.05)),
    rgba(255, 255, 255, 0.038);
  border-color: rgba(var(--accent-rgb), 0.24);
}

.schedule-item-away {
  background:
    linear-gradient(180deg, rgba(6, 15, 28, 0.44), rgba(4, 11, 22, 0.28)),
    rgba(255, 255, 255, 0.02);
  border-color: rgba(143, 188, 230, 0.12);
}

.schedule-item-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  justify-self: center;
}

.schedule-item-date,
.schedule-item-site,
.schedule-item-time {
  margin: 0;
}

.schedule-item-date {
  display: grid;
  gap: 2px;
  justify-items: center;
  text-align: center;
}

.schedule-item-weekday {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.66rem;
  text-shadow: var(--text-shadow-soft);
}

.schedule-item-day {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--text);
}

.schedule-item-site {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  min-height: 2.05rem;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.schedule-item-logo-wrap {
  display: grid;
  place-items: center;
  min-height: 44px;
}

.schedule-item-logo {
  position: absolute;
  inset: 0;
  margin: auto;
  width: auto;
  height: auto;
  max-width: calc(100% - 14px);
  max-height: calc(100% - 14px);
  display: block;
  object-fit: contain;
  object-position: center;
}

.schedule-item-logo-placeholder {
  width: 100%;
  height: 100%;
}

.schedule-item-time {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.3;
  color: var(--text);
}

.schedule-empty {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

/* Stat blocks shared by large cards and compact live role cards */
.player-stats {
  grid-area: stats;
  margin-top: 4px;
  min-width: 0;
}

.player-stat-block {
  display: grid;
  gap: 10px;
}

.player-stat-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.035);
}

.player-stat-summary-compact {
  padding: 8px 10px;
  gap: 10px;
  border-radius: 4px;
}

.player-stat-summary-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

.player-stat-summary-value {
  color: var(--text);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.98rem;
  line-height: 1.4;
  text-align: right;
}

.player-stat-metrics {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 6px;
}

.player-stat-chip {
  display: grid;
  gap: 6px;
  justify-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 9px 8px 8px;
  background: rgba(255, 255, 255, 0.04);
}

.player-stat-chip-label {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  font-weight: 600;
  text-transform: uppercase;
}

.player-stat-chip-divider {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
}

.player-stat-chip-value {
  color: var(--text);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

.player-stat-metrics-compact {
  gap: 4px;
}

.player-stat-metrics-compact .player-stat-chip {
  gap: 4px;
  padding: 7px 5px 6px;
}

.player-stat-metrics-compact .player-stat-chip-label {
  font-size: 0.58rem;
}

.player-stat-metrics-compact .player-stat-chip-value {
  font-size: 0.82rem;
}

/* Linescore table
   - app.js always pads the display to innings 1-9
   - the table can still expand for extras
   - active and future half-innings are styled differently */
.linescore {
  display: grid;
  gap: 10px;
  padding-top: 6px;
}

.linescore-table-wrap {
  display: grid;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.linescore-game-meta {
  color: var(--muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.linescore-grid {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  width: max-content;
  min-width: 100%;
}

.linescore-totals-group {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-left: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.linescore-empty {
  padding: 18px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.linescore-team-column {
  display: grid;
  flex: 0 0 92px;
  width: 92px;
  grid-template-rows: 21px 42px 42px;
  gap: 0;
}

.linescore-team-label {
  min-width: 92px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: left;
}

.linescore-team-spacer {
  width: 92px;
}

.linescore-team-label,
.linescore-stat-column {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.linescore-stat-column {
  display: grid;
  grid-template-rows: 21px 42px 42px;
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.linescore-stat-header,
.linescore-stat-value {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.linescore-team-identity {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  line-height: 1;
}

.linescore-logo-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.linescore-team-logo {
  position: absolute;
  inset: 0;
  margin: auto;
  width: auto;
  height: auto;
  max-width: calc(100% - 8px);
  max-height: calc(100% - 8px);
  display: block;
  object-fit: contain;
  object-position: center;
}

.linescore-team-text {
  line-height: 1;
}

.linescore-team-label.is-away,
.linescore-stat-value.is-away {
  background: rgba(255, 255, 255, 0.035);
}

.linescore-team-label.is-home,
.linescore-stat-value.is-home {
  background: rgba(var(--theme-primary-rgb), 0.08);
}

.linescore-team-label.is-away {
  border-radius: 4px 4px 0 0;
}

.linescore-team-label.is-home {
  border-top: 0;
  border-radius: 0 0 4px 4px;
}

.linescore-team-label.is-winner,
.linescore-stat-value.is-winner {
  background: #5f470f;
  color: #f8f3e2;
}

.linescore-team-label.is-winner {
  border-color: rgba(248, 228, 169, 0.38);
  box-shadow: inset 0 0 0 1px rgba(255, 240, 194, 0.12);
}

.linescore-stat-header {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
}

.linescore-stat-value {
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 700;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.linescore-stat-value.is-total.is-away {
  background: rgba(255, 255, 255, 0.055);
}

.linescore-stat-value.is-total.is-home {
  background: rgba(var(--theme-primary-rgb), 0.12);
}

.linescore-stat-value.is-total.is-winner {
  background: #735617;
  color: #fff7df;
  box-shadow: inset 0 1px 0 rgba(255, 241, 199, 0.12);
}

.linescore-totals-group .linescore-stat-value.is-total.is-winner {
  background: #684c0d;
  color: #fff7df;
  box-shadow:
    inset 0 1px 0 rgba(255, 243, 205, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.16);
}

.linescore-totals-group .linescore-stat-column.is-total {
  background: rgba(var(--accent-rgb), 0.08);
  border-color: var(--line);
  box-shadow: none;
}

.linescore-totals-group .linescore-stat-header {
  background: rgba(255, 255, 255, 0.03);
}

.linescore-stat-column.is-current-inning {
  border-color: rgba(var(--accent-contrast-rgb), 0.55);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-contrast-rgb), 0.14);
}

.linescore-stat-column.is-current-inning .linescore-stat-header {
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.14);
}

.linescore-stat-column.is-total {
  background: rgba(var(--accent-rgb), 0.08);
}

.linescore-stat-column.is-total .linescore-stat-value {
  background: rgba(var(--accent-rgb), 0.04);
}

.linescore-stat-value.is-active {
  background: rgba(var(--accent-rgb), 0.14);
}

.linescore-stat-value.is-unplayed {
  opacity: 0.38;
}

.debug-panel {
  margin-top: 10px;
}

.site-footer {
  margin-top: 12px;
  padding: 10px 2px 2px;
  display: grid;
  gap: 4px;
}

.site-footer-eyebrow,
.site-footer-copy {
  margin: 0;
}

.site-footer-eyebrow {
  color: rgba(157, 179, 201, 0.64);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-shadow: var(--text-shadow-soft);
}

.site-footer-copy {
  max-width: 96ch;
  color: rgba(157, 179, 201, 0.78);
  font-size: 0.76rem;
  line-height: 1.5;
}

.site-footer a {
  color: rgba(var(--accent-contrast-rgb), 0.92);
  text-decoration-color: rgba(var(--accent-contrast-rgb), 0.46);
  text-underline-offset: 0.16em;
}

.site-footer a:hover {
  color: var(--text);
  text-decoration-color: rgba(var(--accent-contrast-rgb), 0.82);
}

.site-footer a:focus-visible {
  outline: 2px solid rgba(var(--accent-contrast-rgb), 0.96);
  outline-offset: 2px;
  border-radius: 2px;
}

.debug-output {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.92rem;
  line-height: 1.5;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.linescore-row {
  align-items: center;
  padding: 10px 12px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
}

.linescore-row strong,
.linescore-row span {
  min-width: 32px;
  text-align: center;
}

.linescore-row strong:first-child {
  min-width: 72px;
  text-align: left;
  color: var(--muted);
}

@media (max-width: 900px) {
  .topbar,
  .hero-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .controls {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .dashboard-actions {
    justify-content: flex-start;
  }

  .score-strip {
    flex-direction: column;
    align-items: stretch;
  }

  .center-status {
    flex: 1 1 auto;
  }

  .header-select {
    min-width: 0;
    width: 100%;
  }

  .dashboard-action-button {
    width: 100%;
  }

  .linescore-grid {
    gap: 4px;
  }

  .linescore-team-column {
    flex-basis: 78px;
    width: 78px;
  }

  .linescore-team-label,
  .linescore-team-spacer {
    min-width: 78px;
    width: 78px;
  }

  .linescore-stat-column {
    flex-basis: 38px;
    width: 38px;
    min-width: 38px;
  }

  .details-grid {
    grid-template-columns: 1fr;
  }

  .active-games-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .live-side-card {
    grid-template-columns: 88px minmax(0, 1fr);
    min-height: 138px;
  }

  .live-side-photo {
    min-height: 0;
  }

  .player-card {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .player-photo {
    min-height: 0;
  }
}
