:root {
  color-scheme: dark;
  --bg: #101116;
  --surface: #191b22;
  --surface-2: #252832;
  --line: #3b3f4a;
  --muted: #a9adb8;
  --text: #f7f7f8;
  --accent: #d33d43;
  --accent-dark: #8d2228;
  --softball: #eff10b;
  --green: #49a33a;
  --gold: #d0ab3b;
  --danger: #d84a4f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
}

button, select { font: inherit; }
button { cursor: pointer; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: #15161c;
}

.header-inner {
  width: min(1160px, calc(100% - 32px));
  min-height: 86px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-ball { width: 58px; height: 58px; object-fit: contain; }
.brand span, .brand strong { display: block; letter-spacing: 0; }
.brand strong { font: 900 23px/1 Georgia, serif; }
.brand-subtitle { margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }

.season-picker { display: grid; gap: 5px; min-width: 250px; }
.season-picker span { color: var(--muted); font-size: 12px; font-weight: 800; }
.season-picker select {
  width: 100%;
  padding: 10px 34px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
}

.status-band {
  width: min(1160px, calc(100% - 32px));
  margin: 56px auto;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
  font-size: 18px;
  font-weight: 700;
}

.app-shell { width: min(1160px, calc(100% - 32px)); margin: 0 auto; flex: 1 0 auto; }
.team-heading { padding: 34px 0 22px; }
.eyebrow { margin: 0 0 5px; color: var(--softball); font-size: 13px; font-weight: 900; text-transform: uppercase; }
h1 { margin: 0; font: 900 clamp(36px, 6vw, 66px)/1 Georgia, serif; }
.updated { margin: 10px 0 0; color: var(--muted); font-size: 13px; }

.section-tabs {
  display: flex;
  gap: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.section-tabs button {
  min-width: 110px;
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.section-tabs button.active { border-color: var(--accent); background: var(--accent); color: white; }
#view { padding: 26px 0 64px; }

.scoreboard {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border: 1px solid var(--line);
  background: var(--surface);
}

.score-cell { padding: 20px 12px; text-align: center; border-right: 1px solid var(--line); }
.score-cell:last-child { border-right: 0; }
.score-cell span { display: block; color: var(--muted); font-size: 12px; font-weight: 900; }
.score-cell strong { display: block; margin-top: 5px; font-size: 29px; }

.section-title { margin: 34px 0 15px; font: 900 26px Georgia, serif; }
.leader-grid, .profile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.leader-board, .profile-panel { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); overflow: hidden; }
.leader-board { overflow: visible; }
.panel-heading { margin: 0; padding: 15px 17px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 900; text-transform: uppercase; }
.leader-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; min-height: 49px; padding: 8px 16px; border-bottom: 1px solid #2d3039; }
.leader-row:last-child { border-bottom: 0; }
.rank { color: var(--muted); font-weight: 900; }
.rank.medal-1 { color: #f0c94c; }
.rank.medal-2 { color: #c5cad1; }
.rank.medal-3 { color: #bf8158; }
.leader-row a, .leader-row span { color: var(--text); font-weight: 800; text-decoration: none; }
.leader-name { position: relative; min-width: 0; }
.leader-row strong { color: var(--softball); font-size: 18px; }
.leader-row .tip-kicker { color: var(--softball); font-size: 11px; }
.leader-row .player-profile-tip strong { color: white; font-size: 15px; }

.recent-list { display: grid; gap: 9px; }
.game-strip {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 24px;
  min-height: 72px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}
.game-strip.win { border-left-color: #55ad49; }
.game-strip.loss { border-left-color: var(--danger); }
.game-date { color: var(--muted); font-size: 13px; font-weight: 800; }
.game-opponent { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; font-weight: 900; }
.game-result { margin-right: 4px; color: var(--muted); font-size: 12px; font-style: normal; font-weight: 950; }
.game-strip.win .game-result { color: #55ad49; }
.game-strip.loss .game-result { color: var(--danger); }
.game-summary { display: flex; gap: 15px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.game-summary b { font-weight: 850; }
.game-score { font-size: 20px; font-weight: 950; }

.stats-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }
.stats-table { width: 100%; min-width: 760px; border-collapse: collapse; background: var(--surface); }
.stats-table th { padding: 13px 10px; background: #292c35; color: var(--muted); font-size: 12px; text-align: center; }
.stats-table th:first-child, .stats-table td:first-child { text-align: left; }
.stats-table td { padding: 14px 10px; border-top: 1px solid #30333c; text-align: center; font-weight: 800; }
.stats-table tbody tr { cursor: pointer; }
.stats-table tbody tr:hover { background: #242730; }
.stats-table .player-name { position: relative; font-weight: 950; }

.game-box-wrap { width: min(100%, 660px); border-radius: 4px; }
.game-box-score { min-width: 0; table-layout: fixed; }
.game-box-score caption { padding: 10px 12px; background: #292c35; color: white; font-size: 13px; font-weight: 950; text-align: left; text-transform: uppercase; }
.game-box-score .batter-column { width: 46%; }
.game-box-score .number-column { width: 10.8%; }
.game-box-score th { padding: 8px 7px; font-size: 11px; }
.game-box-score td { padding: 9px 7px; font-size: 14px; }
.game-box-score tbody tr:nth-child(even) { background: #1e2028; }

.player-profile-tip {
  position: absolute;
  z-index: 20;
  top: 50%;
  left: calc(100% + 14px);
  width: 270px;
  padding: 15px 40px 15px 16px;
  border: 2px solid var(--softball);
  border-radius: 6px;
  background: #242730;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .42);
  color: white;
  text-align: left;
  transform: translateY(-50%);
}

.player-profile-tip::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -9px;
  width: 14px;
  height: 14px;
  border-left: 2px solid var(--softball);
  border-bottom: 2px solid var(--softball);
  background: #242730;
  transform: translateY(-50%) rotate(45deg);
}

.tip-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--softball);
  font-size: 11px;
  font-weight: 950;
}

.player-profile-tip strong { display: block; font-size: 15px; line-height: 1.35; }
.tip-close { position: absolute; top: 5px; right: 7px; padding: 4px 7px; border: 0; background: transparent; color: white; font-size: 22px; line-height: 1; }

.back-button {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: white;
  font-weight: 900;
}
.detail-heading { margin: 18px 0 22px; }
.detail-heading p { margin: 0 0 5px; color: var(--muted); font-weight: 800; }
.detail-heading h2 { margin: 0; font: 900 38px Georgia, serif; }

.game-recap-header {
  width: min(100%, 660px);
  margin: 18px 0 14px;
  border: 1px solid var(--line);
  border-top: 5px solid #777b85;
  border-radius: 5px;
  background: var(--surface);
  overflow: hidden;
}
.game-recap-header.win { border-top-color: #55ad49; }
.game-recap-header.loss { border-top-color: var(--danger); }
.recap-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 15px; border-bottom: 1px solid var(--line); background: #292c35; }
.recap-meta > div { display: flex; align-items: center; gap: 10px; }
.final-label { color: white; font-size: 12px; font-weight: 950; }
.recap-date { color: var(--muted); font-size: 12px; font-weight: 800; }
.result-badge { min-width: 62px; padding: 5px 10px; border-radius: 999px; background: #777b85; color: white; font-size: 12px; font-weight: 950; text-align: center; }
.game-recap-header.win .result-badge { background: #3e9236; }
.game-recap-header.loss .result-badge { background: var(--danger); }
.recap-team { display: grid; grid-template-columns: 86px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 62px; padding: 10px 16px; border-bottom: 1px solid #30333c; color: var(--muted); }
.recap-team:last-child { border-bottom: 0; }
.recap-team.winner { color: white; background: #20232b; }
.team-designation { font-size: 10px; font-weight: 950; color: var(--muted); }
.recap-team strong { overflow: hidden; color: inherit; font: 900 20px Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }
.recap-team b { color: inherit; font-size: 30px; font-variant-numeric: tabular-nums; }

.spray-panel { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); padding: 18px; }
.spray-chart { display: block; width: min(100%, 620px); margin: 0 auto; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 10px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 900; }
.legend-line { width: 24px; height: 3px; background: var(--legend-color); }
.profile-panel { min-height: 312px; display: flex; flex-direction: column; padding-bottom: 0; }
.profile-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; flex: 1 1 0; min-height: 42px; padding: 8px 16px; }
.profile-row span { color: var(--muted); font-weight: 700; }
.profile-row strong { font-size: 17px; }
.profile-group { flex: 0 0 auto; min-height: 38px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.profile-group span { font-size: 13px; font-weight: 950; text-transform: uppercase; }
.profile-group-hits { border-left: 4px solid #55ad49; background: rgba(85, 173, 73, .15); }
.profile-group-hits span { color: #70d365; }
.profile-group-outs { border-left: 4px solid var(--danger); background: rgba(216, 74, 79, .15); }
.profile-group-outs span { color: #ff7478; }
.profile-direction-row { padding-left: 20px; }

.story { margin-top: 20px; }
.inning-block { padding: 8px 0 22px; border-bottom: 1px solid var(--line); }
.inning-block:last-child { border-bottom: 0; }
.inning-title { margin: 10px 0 15px; font: 900 28px Georgia, serif; }
.play { position: relative; margin-left: 11px; padding: 0 0 25px 31px; border-left: 1px solid #5a5e68; }
.play:last-child { padding-bottom: 4px; }
.play::before { content: ""; position: absolute; top: 3px; left: -6px; width: 11px; height: 11px; border-radius: 50%; background: var(--softball); box-shadow: 0 0 0 3px var(--surface); }
.outcome-pill { display: inline-block; padding: 4px 10px; border: 1px solid var(--softball); border-radius: 999px; background: #292c35; color: var(--softball); font-size: 12px; font-weight: 950; }
.play p { margin: 9px 0 0; max-width: 760px; color: #e8e9ec; font-size: 17px; line-height: 1.45; }
.play p strong { color: white; }

.empty { padding: 30px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); text-align: center; font-weight: 700; }

footer { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 90px; margin-top: auto; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 900; }
.footer-ball { width: 28px; height: 28px; }
.footer-brand { display: grid; gap: 2px; }
.footer-brand strong { color: var(--text); font: 900 13px/1 Georgia, serif; }
.footer-brand small { color: var(--muted); font-size: 9px; font-weight: 800; }

@media (max-width: 700px) {
  .header-inner { min-height: 78px; }
  .brand-ball { width: 48px; height: 48px; }
  .brand strong { font-size: 19px; }
  .season-picker { min-width: 0; width: 48%; }
  .season-picker select { min-width: 0; }
  .season-picker span { display: none; }
  .team-heading { padding-top: 26px; }
  .section-tabs { width: 100%; overflow: hidden; }
  .section-tabs button { min-width: 0; width: 0; flex: 1 1 0; padding-inline: 8px; }
  .scoreboard { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; }
  .score-cell { min-width: 0; padding-inline: 4px; }
  .score-cell span { font-size: 10px; }
  .score-cell strong { font-size: 25px; }
  .player-profile-tip {
    position: fixed;
    top: auto;
    right: 16px;
    bottom: 20px;
    left: 16px;
    width: auto;
    transform: none;
  }
  .player-profile-tip::before { display: none; }
  .recap-team { grid-template-columns: 68px minmax(0, 1fr) auto; gap: 8px; padding-inline: 12px; }
  .recap-team strong { font-size: 17px; }
  .recap-team b { font-size: 27px; }
  .score-cell:nth-child(3) { border-right: 0; }
  .score-cell:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .leader-grid, .profile-grid { grid-template-columns: 1fr; }
  .game-strip { grid-template-columns: 72px minmax(0, 1fr) auto; gap: 4px 10px; padding-inline: 12px; }
  .game-date { grid-column: 1; grid-row: 1 / span 2; }
  .game-opponent { grid-column: 2; grid-row: 1; }
  .game-summary { grid-column: 2; grid-row: 2; gap: 12px; font-size: 11px; }
  .game-score { grid-column: 3; grid-row: 1 / span 2; }
}
