/* Game page (#game/<id>): header with the matchup, plate umpire, and accuracy, then the game's tabs and cards. */
.game-page { display: grid; gap: 14px; min-width: 0; }
.game-page .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.game-back { display: inline-flex; align-items: center; justify-self: start; gap: 8px; min-height: 32px; color: #b7dcff; font-size: 12px; font-weight: 700; text-decoration: none; }
.game-back:hover, .game-back:focus-visible { color: #fff; }

.game-hero {
  display: grid;
  grid-template-columns: minmax(190px, .8fr) minmax(360px, 1.5fr) minmax(250px, 1fr);
  align-items: center;
  gap: 22px;
  min-height: 132px;
  padding: 18px 22px;
  border: 1px solid #637380;
  border-radius: 12px;
  background: linear-gradient(145deg, #4a5966, #384550);
  box-shadow: 0 12px 30px #17212b33;
}
.game-kicker { color: #a9d3fb; font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.game-kicker i { margin-right: 5px; color: #f5bf70; }
.game-hero-meta { display: grid; gap: 6px; min-width: 0; }
.game-hero-meta h2 { margin: 0; color: #f6fbff; font-size: clamp(17px, 1.5vw, 21px); line-height: 1.2; letter-spacing: -.02em; }
.game-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.game-chips span { padding: 3px 9px; border: 1px solid #6f8292; border-radius: 99px; background: #2c3944; color: #d6e3ec; font-size: 10px; font-weight: 700; }

/* Scoreboard: away and home mirrored around the "@", scores toward the middle. */
.game-scoreboard { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid #5d6f7d; border-radius: 10px; background: #2b3741; }
.game-scoreboard-at { color: #9fb3c2; font-size: 13px; font-weight: 800; }
.game-team { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-width: 0; }
.game-team.is-home { grid-template-columns: auto minmax(0, 1fr) 44px; text-align: right; }
.game-team.is-home .game-team-logo { order: 3; }
.game-team.is-home .game-team-name { order: 2; }
.game-team.is-home .game-team-score { order: 1; }
.game-team-logo { position: relative; display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid #cddbe7; border-radius: 9px; background: #e7eef5; }
.game-team-logo img { position: absolute; inset: 3px; width: 36px; height: 36px; object-fit: contain; opacity: 0; transition: opacity .15s; }
.game-team-logo img.is-loaded { opacity: 1; }
.game-team-logo img.is-loaded + .game-team-fallback { visibility: hidden; }
.game-team-fallback { color: #294a64; font-size: 11px; font-weight: 850; }
.game-team-name { display: grid; min-width: 0; gap: 2px; }
/* Long team names ("Toros de la Sierra") wrap to two lines instead of truncating. */
.game-team-name strong { display: -webkit-box; overflow: hidden; color: #f3f8fc; font-size: 13px; font-weight: 800; line-height: 1.2; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.game-team-name small { color: #a9bfce; font-size: 10px; font-weight: 600; }
.game-team-score { color: #fff; font-size: 30px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }

.game-hero-umpire { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 16px; min-width: 0; }
.game-umpire { display: grid; gap: 4px; min-width: 0; }
.game-umpire-link, .game-umpire > strong { display: inline-flex; align-items: center; justify-self: start; gap: 7px; max-width: 100%; padding: 0; border: 0; background: none; color: #f6fbff; font-size: 15px; font-weight: 800; text-align: left; }
.game-umpire-link i { color: #9dccff; font-size: 11px; }
.game-umpire-link:hover, .game-umpire-link:focus-visible { color: #b7dcff; outline: none; text-decoration: underline; }
.game-accuracy { display: grid; justify-items: end; gap: 3px; }
.game-accuracy strong { color: #f6fbff; font-size: 30px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.game-accuracy strong em { font-size: 17px; font-style: normal; }
.game-accuracy > span:not(.game-accuracy-track) { color: #c3d2dd; font-size: 10px; }
.game-accuracy-track { width: 120px; height: 5px; overflow: hidden; border-radius: 99px; background: #26313a; }
.game-accuracy-track span { display: block; height: 100%; border-radius: inherit; background: #63c59a; }
.game-accuracy.is-watch .game-accuracy-track span { background: #f0c46a; }
.game-accuracy.is-low .game-accuracy-track span { background: #f17b83; }
.game-accuracy.is-strong strong { color: #b9f0d4; }
.game-accuracy.is-watch strong { color: #ffe1a1; }
.game-accuracy.is-low strong { color: #ffc0c4; }
.game-report { display: flex; grid-column: 1 / -1; align-items: center; gap: 10px; }
.game-report .game-log-report-status { color: #c3d2dd; font-size: 10px; }
.game-report .game-log-report-status.is-error { color: #ffb4b9; }

.game-skeleton { display: block; width: 70%; height: 14px; border-radius: 6px; background: linear-gradient(90deg, #ffffff10, #ffffff22, #ffffff10); background-size: 200% 100%; animation: game-shimmer 1.2s linear infinite; }
.game-skeleton.is-short { width: 40%; }
.game-skeleton.is-tall { width: 100%; height: 44px; }
.game-hero-meta .game-skeleton + .game-skeleton, .game-hero-umpire .game-skeleton + .game-skeleton { margin-top: 8px; }
@keyframes game-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .game-skeleton { animation: none; } }

/* Game tabs: same weight as the main tab bar, scoped to this game. */
.game-tabs { display: flex; gap: 6px; padding: 4px; overflow-x: auto; border: 1px solid #5d6f7d; border-radius: 10px; background: #2b3741; scrollbar-width: none; }
.game-tabs::-webkit-scrollbar { display: none; }
.game-tab { display: inline-flex; flex: 1 0 auto; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 16px; border-radius: 7px; color: #c9d7e2; font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.game-tab i { color: #9dccff; }
.game-tab:hover, .game-tab:focus-visible { background: #ffffff10; color: #fff; outline: none; }
.game-tab.is-active { background: #2f7fd8; color: #fff; box-shadow: 0 4px 12px #1b5ea84d; }
.game-tab.is-active i { color: #fff; }

.game-notice { display: grid; justify-items: center; gap: 8px; padding: 34px 20px; border: 1px dashed #6f8292; border-radius: 12px; color: #d6e3ec; text-align: center; }
.game-notice i { color: #9dccff; font-size: 22px; }
.game-notice strong { color: #f6fbff; font-size: 15px; }
.game-notice span { color: #c3d2dd; font-size: 12px; }
.game-hero .game-notice { grid-column: 1 / -1; padding: 10px; border: 0; }

@media (max-width: 1280px) {
  .game-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .game-scoreboard { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 600px) {
  .game-hero { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 14px; }
  .game-scoreboard { grid-row: auto; gap: 8px; padding: 10px; }
  .game-team, .game-team.is-home { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 4px; text-align: center; }
  .game-team.is-home .game-team-logo, .game-team.is-home .game-team-name, .game-team.is-home .game-team-score { order: 0; }
  .game-team-score { font-size: 26px; }
  /* Three tabs share the width; long labels wrap instead of scrolling out of view. */
  .game-tab { flex: 1 1 0; flex-direction: column; gap: 3px; min-height: 48px; padding: 4px 6px; white-space: normal; text-align: center; }
  .game-tab span { font-size: 10px; line-height: 1.2; }
}


/* Missed calls tab: summary stats, then the zone plot beside the call-by-call table. */
.missed-calls { display: grid; gap: 14px; }
.missed-calls-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.missed-stat { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 10px; padding: 12px 14px; border: 1px solid #5d6f7d; border-radius: 10px; background: linear-gradient(145deg, #4a5966, #3d4a56); }
.missed-stat i { grid-row: span 2; color: #9dccff; font-size: 16px; }
.missed-stat strong { color: #f6fbff; font-size: 24px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.missed-stat span { color: #c3d2dd; font-size: 10px; font-weight: 700; }
.missed-stat.is-false i { color: #f17b83; }
.missed-stat.is-missed i { color: #4ca3f8; }
.missed-stat.is-impact i { color: #f0c46a; }
.missed-calls-layout { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(0, 1.6fr); gap: 12px; align-items: start; }
.missed-calls-plot { height: 420px; }
.missed-calls-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin: 2px 0 4px; color: #cbd6e0; font-size: 10px; }
.missed-calls-legend span { display: inline-flex; align-items: center; gap: 6px; }
.missed-calls-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.missed-calls-legend .is-false { background: #f17b83; }
.missed-calls-legend .is-missed { background: #4ca3f8; }
.missed-calls-legend .is-impact { border: 2px solid #ffe1a1; }
.missed-calls-table-wrap { overflow-x: auto; }
.missed-calls-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.missed-calls-table th { padding: 8px 10px; background: #2b3741; color: #b7cbd8; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.missed-calls-table td { padding: 9px 10px; border-top: 1px solid #ffffff12; color: #e3ebf1; vertical-align: top; }
.missed-calls-table td small { display: block; margin-top: 2px; color: #a9bfce; font-size: 10px; }
.missed-calls-table tr.is-impact td { background: #f0c46a0f; }
.missed-calls-table tr.is-impact td:first-child { box-shadow: inset 3px 0 0 #f0c46a; }
.missed-inning { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; }
.missed-inning i { color: #9dccff; }
.missed-call-badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 10px; font-weight: 800; }
.missed-call-badge.is-false { background: #5a3138; color: #ffc0c4; }
.missed-call-badge.is-missed { background: #23405c; color: #b7dcff; }
.missed-impact { display: inline-flex; align-items: center; gap: 5px; color: #ffe1a1; font-weight: 800; }
@media (max-width: 1100px) {
  .missed-calls-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .missed-calls-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .missed-calls-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .missed-calls-plot { height: 340px; }
  /* Each call becomes a card; cells carry their own labels. */
  .missed-calls-table thead { display: none; }
  .missed-calls-table, .missed-calls-table tbody, .missed-calls-table tr { display: block; }
  .missed-calls-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; padding: 12px 4px; border-top: 1px solid #ffffff12; }
  .missed-calls-table td { padding: 0; border: 0; }
  .missed-calls-table td::before { display: block; margin-bottom: 2px; color: #b7cbd8; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; content: attr(data-label); }
}
/* Selecting a row of the call-by-call table shows only that call on the strike zone. */
.missed-call-row { cursor: pointer; transition: opacity .15s, background-color .15s; }
.missed-call-row:hover td { background: #ffffff0d; }
.missed-call-row:focus-visible { outline: 2px solid #c4e8ff; outline-offset: -2px; }
.missed-call-row.is-dimmed { opacity: .5; }
.missed-calls-table tr.missed-call-row.is-selected td { background: #4ca3f826; }
.missed-calls-table tr.missed-call-row.is-selected td:first-child { box-shadow: inset 4px 0 0 #9dccff; }
.missed-calls-filter { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 6px; padding: 6px 6px 6px 12px; border: 1px solid #9dccff66; border-radius: 8px; background: #4ca3f81f; color: #e3f1ff; font-size: 11px; font-weight: 700; }
.missed-calls-filter[hidden] { display: none; }
.missed-calls-filter button { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 4px 11px; border: 1px solid #9bbdd2; border-radius: 6px; background: #354c5d; color: #eaf5ff; font-size: 11px; font-weight: 750; cursor: pointer; }
.missed-calls-filter button:hover { border-color: #d1eaff; background: #426078; }
.report-stage .missed-calls-filter { display: none; }
