:root {
  --radius: 14px;
  --space: 1rem;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 80%;
}

body[data-theme="classic"] {
  --bg: #f5f6f9;
  --panel: #ffffff;
  --panel-alt: #fcfdff;
  --ink: #111319;
  --muted: #5d6474;
  --line: #d8ddea;
  --bar-bg: #edf1f9;
  --bar-fill: linear-gradient(90deg, #3a78ff, #14b1ff);
  --hero-grad:
    radial-gradient(circle at 10% -20%, #d5e6ff 0%, transparent 40%),
    radial-gradient(circle at 100% 0%, #d9fff4 0%, transparent 30%),
    #f5f6f9;
}

body[data-theme="ballpark"] {
  --radius: 12px;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg: #e6decc;
  --panel: #f6efdf;
  --panel-alt: #eee4cf;
  --ink: #1f2e24;
  --muted: #506153;
  --line: #d2c3a0;
  --bar-bg: #e8dcc3;
  --bar-fill: linear-gradient(90deg, #b32727, #dd4a32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg);
}

.page {
  width: min(1200px, 93vw);
  margin: 0 auto 3rem;
}

.hero {
  margin: 0 calc(50% - 50vw);
  padding: 1.1rem max(3.5vw, 1rem) 1.3rem;
  background: var(--hero-grad);
  color: #fff;
  border-bottom: 4px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.1);
}

body[data-theme="ballpark"][data-hero-mode="repeat"] .hero,
body[data-theme="ballpark"]:not([data-hero-mode]) .hero {
  background-image:
    linear-gradient(180deg, rgba(6, 25, 15, 0.8), rgba(6, 25, 15, 0.58)),
    url("./assets/ballpark-hero.jpg");
  background-position: center, calc(50% + 300px) 50%;
  background-size: auto, auto 100%;
  background-repeat: no-repeat, repeat-x;
}

body[data-theme="ballpark"][data-hero-mode="crop"] .hero {
  background-image:
    linear-gradient(180deg, rgba(6, 25, 15, 0.8), rgba(6, 25, 15, 0.58)),
    url("./assets/ballpark-hero.jpg");
  background-position: center, calc(50% + 300px) 50%;
  background-size: auto, 88% auto;
  background-repeat: no-repeat, repeat-x;
}

.hero-top {
  max-width: min(1200px, 93vw);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.hero-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.hero h1 {
  margin: 0;
  font-family: "Secular One", var(--font-display);
  letter-spacing: 0.03em;
  font-size: clamp(1.7391rem, 5vw, 3.1304rem);
  line-height: 0.95;
}

.hero p {
  margin: 0.42rem 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
}

.hero .hero-tagline {
  font-weight: 800;
  font-size: 1.08rem;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid #ffd77a;
  background: linear-gradient(180deg, #ffd77a, #ffc246);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #1d220f;
  margin-top: 0.66rem;
  text-decoration: none;
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease;
}

.contact-pill:hover,
.contact-pill:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

body[data-theme="ballpark"] .hero h1 {
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.22);
  letter-spacing: 0.01em;
}

body[data-theme="ballpark"] .hero p {
  color: rgba(255, 255, 255, 0.9);
}

body[data-theme="ballpark"] .hero-top {
  padding: 0;
}

body[data-theme="ballpark"] .hero {
  padding-top: 2rem;
  padding-bottom: 2.1rem;
}

.theme-toggle {
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 140ms ease, background-color 140ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.2);
}

.summary-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(4, max-content);
  gap: 0.45rem;
  justify-content: start;
}

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

body[data-theme="ballpark"] .card,
body[data-theme="ballpark"] .panel,
body[data-theme="ballpark"] .stat-card {
  border-width: 1px;
  box-shadow: 0 1px 2px rgba(30, 32, 22, 0.06);
}

.card {
  padding: 0.58rem 0.74rem;
  width: fit-content;
  max-width: 100%;
  min-height: 0;
  display: block;
}

.card-label {
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-align: center;
}

.card-value {
  margin-top: 0.24rem;
  font-size: 1.34rem;
  font-weight: 700;
  text-align: center;
  overflow-wrap: anywhere;
}

.card-subvalue {
  margin-top: 0.18rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  min-height: 1.15em;
}

.card-subvalue--placeholder {
  visibility: hidden;
}

body[data-theme="ballpark"] .card-value {
  color: #1f2e24;
  text-shadow: none;
}

.panel {
  margin-top: 0.9rem;
  padding: 1rem;
}

.panel h2 {
  margin: 0 0 0.7rem;
  font-size: 1.28rem;
}

.snapshot-panel {
  overflow: hidden;
  padding: 0;
}

.snapshot-graphic {
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  width: 100%;
  max-width: none;
  margin: 0;
}

.snapshot-empty {
  color: var(--muted);
  font-size: 0.92rem;
}

.snapshot-board {
  position: relative;
  border-radius: 0;
  padding: 1rem 1.05rem;
  background:
    linear-gradient(120deg, rgba(26, 49, 38, 0.95), rgba(65, 28, 17, 0.94)),
    radial-gradient(circle at 86% -30%, rgba(255, 214, 120, 0.3), transparent 50%);
  color: #f7f4ea;
  box-shadow: inset 0 0 0 1px rgba(255, 233, 181, 0.24);
  display: grid;
  gap: 0.34rem;
}

.snapshot-board::after {
  content: "";
  position: absolute;
  right: -52px;
  top: -52px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 140, 0.25), rgba(255, 215, 140, 0));
  pointer-events: none;
}

.snapshot-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  border-bottom: 1px solid rgba(255, 228, 164, 0.2);
  padding-bottom: 0.35rem;
}

.snapshot-head h3 {
  margin: 0;
  font-family: "Secular One", var(--font-display);
  font-size: 1.62rem;
  letter-spacing: 0.02em;
}

.snapshot-inline-note {
  font-size: 0.84rem;
  font-weight: 700;
  color: rgba(255, 238, 201, 0.92);
}

.snapshot-head p {
  margin: 0;
  font-size: 0.92rem;
  color: rgba(255, 238, 201, 0.92);
  font-weight: 700;
}

.snapshot-status {
  margin-top: 0.55rem;
  border: 1px solid rgba(255, 226, 170, 0.4);
  border-radius: 999px;
  display: inline-flex;
  padding: 0.24rem 0.6rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #ffe9be;
  background: rgba(86, 38, 19, 0.42);
}

.snapshot-scorebugs {
  margin-top: 0.12rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.scorebug-card {
  --poster-media-width: 210px;
  border: 1px solid rgba(255, 224, 164, 0.28);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(13, 12, 9, 0.8), rgba(30, 18, 13, 0.72)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.025) 0, rgba(255, 255, 255, 0.025) 5px, transparent 5px, transparent 11px);
  padding: 0.22rem 0.26rem;
  display: grid;
  gap: 0.1rem;
  align-content: start;
}

.poster-stat {
  justify-content: flex-start;
}

.poster-layout .scorebug-title {
  font-family: "Secular One", var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  text-transform: none;
  position: static;
  padding: 0 0 0 1.6rem;
}

.scorebug-body.has-zone {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.12rem;
  align-items: start;
}

.scorebug-main {
  display: grid;
  gap: 0.16rem;
  justify-items: stretch;
  width: 100%;
}

.scorebug-main.with-zone {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  column-gap: 0.72rem;
}

.scorebug-meta {
  display: grid;
  gap: 2.05rem;
  min-width: 0;
  padding: 2rem 0.7rem 0 1.6rem;
  position: static;
}

.scorebug-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  margin: 0 -0.26rem 0.55rem;
  padding: 0.82rem 0.26rem 0.78rem;
}

.scorebug-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, #ffd486, #ef9e58);
}

.scorebug-title {
  font-size: 20rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 800;
  color: #ffe3b2;
}

.scorebug-situation {
  display: grid;
  grid-template-columns: minmax(0, 92px) auto auto;
  gap: 0.12rem 0.3rem;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  padding: 0rem 0rem;
  background: linear-gradient(180deg, rgba(20, 22, 27, 0.9), rgba(16, 17, 21, 0.88));
  width: max-content;
  min-width: 200px;
  max-width: 100%;
  overflow: hidden;
  margin-bottom: 0.22rem;
}

.scorebug-team-stack {
  display: grid;
  gap: 0;
  min-width: 0;
  grid-column: 1;
  grid-row: 1 / span 2;
}

.scorebug-team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
  border-radius: 0;
  padding: 0.2rem 0.3rem;
  border: none;
  width: 100%;
  min-width: 0;
}

.scorebug-team-stack .scorebug-team-row:first-child {
  border-radius: 6px 0 0 0;
}

.scorebug-team-stack .scorebug-team-row:last-child {
  border-radius: 0 0 0 6px;
}

.team-key {
  font-size: 0.96rem;
  letter-spacing: 0.01em;
  text-transform: none;
  color: inherit;
  opacity: 0.98;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scorebug-team-row strong {
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1;
  flex: 0 0 1.1rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.scorebug-io {
  display: grid;
  gap: 0.2rem;
  border-radius: 0;
  padding: 0 0.2rem;
  border: none;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 500;
  color: #efe1be;
  text-align: left;
  white-space: nowrap;
  justify-self: center;
  grid-column: 2;
  grid-row: 1 / span 2;
  margin-left: 0.08rem;
  margin-right: 0.08rem;
}

.scorebug-count-block {
  display: grid;
  position: relative;
  top: -2px; /* + moves down, - moves up */
  gap: 0;
  border-radius: 0;
  padding: 0 0.2rem;
  border: none;
  background: transparent;
  text-align: center;
  justify-self: center;
  grid-column: 3;
  grid-row: 1.1;
}

.scorebug-count-label {
  display: none;
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 228, 178, 0.85);
}

.scorebug-count-value {
  font-size: 0.68rem;
  font-weight: 500;
  color: #efe1be;
  line-height: 1;
  letter-spacing: 0.02em;
}

.scorebug-bases {
  position: relative;
  top: 4px;
  width: 2.1rem;
  height: 1.9rem;
  justify-self: center;
  align-self: end;
  grid-column: 3;
  grid-row: 1.6;
}

.scorebug-bases .base {
  position: absolute;
  width: 0.62rem;
  height: 0.62rem;
  border: 1px solid rgba(226, 203, 159, 0.5);
  background: rgba(39, 42, 50, 0.9);
  transform: rotate(45deg);
  border-radius: 1px;
}

.scorebug-bases .base.is-on {
  background: #c8af7a;
  border-color: #dbc18a;
  box-shadow: 0 0 0 1px rgba(219, 193, 138, 0.25);
}

.scorebug-bases .base-second {
  left: 0.73rem;
  top: 0;
}

.scorebug-bases .base-third {
  left: 0.26rem;
  top: 0.62rem;
}

.scorebug-bases .base-first {
  left: 1.2rem;
  top: 0.62rem;
}

.scorebug-call {
  display: flex;
  gap: 0.18rem;
  flex-wrap: wrap;
}

.call-chip {
  border: 1px solid rgba(255, 221, 165, 0.3);
  border-radius: 999px;
  padding: 0.09rem 0.34rem;
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff2d6;
  background: rgba(7, 6, 5, 0.45);
}

.call-chip.call-strike {
  border-color: rgba(122, 197, 255, 0.75);
  background: rgba(42, 99, 150, 0.42);
  color: #d8eeff;
}

.call-chip.call-ball {
  border-color: rgba(255, 187, 122, 0.78);
  background: rgba(151, 79, 35, 0.4);
  color: #ffe5cc;
}

.call-chip.call-neutral {
  border-color: rgba(218, 218, 218, 0.55);
  color: #efefef;
}

.scorebug-player {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 222, 172, 0.94);
}

.scorebug-player-center {
  text-align: left;
  font-size: 0.92rem;
  line-height: 1.3;
  padding-top: 0.18rem;
  margin-bottom: 0.28rem;
}

.scorebug-player-label {
  font-weight: 800;
  margin-right: 0.2rem;
}

.scorebug-player-value {
  font-weight: 700;
}

.scorebug-player-value-highlight {
  display: inline-block;
  padding: 0.03rem 0.24rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 236, 170, 0.65);
  background: rgba(255, 214, 102, 0.2);
  box-shadow: 0 0 0 1px rgba(255, 214, 102, 0.18);
}

.scorebug-player-label-ab {
  color: #ffd0a3;
}

.scorebug-player-value-ab {
  font-size: 0.92rem;
  color: #c7e6ff;
}

.scorebug-player-label-ump {
  color: #ffd0a3;
}

.scorebug-player-value-ump {
  font-size: 0.92rem;
  color: #c7e6ff;
}

.scorebug-badge {
  justify-self: start;
  border-radius: 999px;
  border: 1px solid rgba(255, 214, 151, 0.35);
  padding: 0.11rem 0.43rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff0d2;
  background: rgba(89, 28, 23, 0.52);
}

.scorebug-note {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(210, 236, 255, 0.95);
  line-height: 1.2;
}

.scorebug-zone {
  border: none;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  justify-self: center;
  align-self: start;
  margin-bottom: 0;
}

.scorebug-zone-block {
  display: grid;
  gap: -0.05rem;
  align-content: start;
  justify-items: center;
  transform: none;
  width: 100%;
}

.scorebug-zone-note {
  width: 64%;
  max-width: 64%;
  text-align: center;
  font-size: 0.74rem;
  color: rgba(240, 240, 240, 0.95);
  min-height: 1.2em;
  display: grid;
  gap: 0.1rem;
  justify-items: center;
  margin-top: -3.55rem;
  border: 1px solid rgba(120, 220, 255, 0.55);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(10, 40, 55, 0.62), rgba(8, 25, 35, 0.64));
  padding: 0.24rem 0.36rem;
  box-shadow:
    inset 0 0 0 1px rgba(160, 236, 255, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.28);
}

.scorebug-zone-note span:first-child {
  font-weight: 800;
  letter-spacing: 0.01em;
}

.scorebug-zone-note span:last-child {
  font-size: 0.9rem;
  font-weight: 700;
}

.zone-panel {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.02;
  border-radius: 8px;
  overflow: hidden;
}

.zone-panel::before {
  content: "";
  position: absolute;
  left: 18%;
  top: 11%;
  width: 64%;
  height: 66%;
  background:
    linear-gradient(180deg, rgba(8, 10, 14, 0.45), rgba(10, 8, 6, 0.1)),
    url("./assets/ballpark-hero.jpg");
  background-size: cover;
  background-position: center;
  filter: blur(2px) saturate(0.82);
  transform: none;
  border-radius: 6px;
}

.zone-title,
.zone-margin {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: #d7e9ff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  font-weight: 700;
}

.zone-title {
  top: 3.2%;
  font-size: 0.7rem;
}

.zone-margin {
  top: 9.2%;
  font-size: 0.62rem;
}

.zone-margin-callout {
  position: absolute;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 0.14rem;
  z-index: 6;
  pointer-events: none;
  max-width: 92%;
}

.zone-margin-stem {
  width: 2px;
  height: 52px;
  background: linear-gradient(180deg, rgba(230, 237, 245, 0.95), rgba(230, 237, 245, 0.2));
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(8, 12, 18, 0.2);
}

.zone-margin-label {
  white-space: nowrap;
  max-width: 100%;
  text-align: center;
  font-size: 0.96rem !important;
  font-weight: 800 !important;
  color: #e6edf5;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.72);
}

.zone-rect {
  position: absolute;
  left: 27%;
  top: 18%;
  width: 46%;
  height: 52%;
  background: rgba(202, 229, 255, 0.2);
  border: 1px solid rgba(209, 233, 255, 0.92);
  z-index: 2;
}

.zone-grid {
  position: absolute;
  background: rgba(209, 233, 255, 0.66);
}

.zone-grid.v1,
.zone-grid.v2 {
  top: 0;
  bottom: 0;
  width: 1px;
}

.zone-grid.v1 { left: 33.333%; }
.zone-grid.v2 { left: 66.666%; }

.zone-grid.h1,
.zone-grid.h2 {
  left: 0;
  right: 0;
  height: 1px;
}

.zone-grid.h1 { top: 33.333%; }
.zone-grid.h2 { top: 66.666%; }

.zone-dot-anchor {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #aee3ff;
  border: 2px solid #0b2238;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55), 0 0 7px rgba(116, 196, 255, 0.6);
  transform: translate(-50%, -50%);
  z-index: 5;
}

.zone-ball-image {
  position: absolute;
  display: block;
  object-fit: contain;
  border: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
  image-rendering: -webkit-optimize-contrast;
  image-rendering: auto;
  transform: translate(-50%, -50%);
  z-index: 4;
}

.poster-call {
  font-size: 0.92rem;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: left;
  width: max-content;
  min-width: 200px;
  max-width: 100%;
  justify-self: start;
  margin-top: 0.14rem;
  margin-bottom: 0.2rem;
}

.poster-call.call-strike { color: #bdddff; }
.poster-call.call-ball { color: #ffd9ba; }
.poster-call.call-neutral { color: #f0f0f0; }

.call-swap-shell {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(12, 14, 18, 0.9);
  min-height: 2.55rem;
}

.call-side {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  padding: 0.32rem 0.52rem;
  min-width: 0;
}

.call-side-ump {
  background: linear-gradient(180deg, rgba(111, 116, 126, 0.95), rgba(79, 83, 92, 0.95));
}

.call-side-abs {
  background: linear-gradient(180deg, rgba(68, 206, 103, 0.98), rgba(44, 170, 74, 0.98));
  box-shadow: inset 0 0 16px rgba(137, 255, 174, 0.24);
}

.call-side-ump-ball,
.call-side-ump-strike,
.call-side-ump-neutral {
  background: linear-gradient(180deg, rgba(111, 116, 126, 0.95), rgba(79, 83, 92, 0.95));
}

.call-side-abs-strike {
  background: linear-gradient(180deg, rgba(68, 206, 103, 0.98), rgba(44, 170, 74, 0.98));
}

.call-side-abs-ball {
  background: linear-gradient(180deg, rgba(68, 206, 103, 0.98), rgba(44, 170, 74, 0.98));
}

.call-side-abs-neutral {
  background: linear-gradient(180deg, rgba(68, 206, 103, 0.98), rgba(44, 170, 74, 0.98));
}

.call-icon {
  font-size: 0.92rem;
  line-height: 1;
  opacity: 0.95;
}

.call-text {
  display: grid;
  line-height: 1.14;
  gap: 0.12rem;
  min-width: 0;
}

.call-kicker {
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(245, 246, 250, 0.88);
}

.call-value {
  font-size: 0.86rem;
  font-weight: 500;
  color: #ffffff;
}

.call-swap-divider {
  display: grid;
  place-items: center;
  width: 1.35rem;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.8);
  background: linear-gradient(180deg, rgba(37, 40, 48, 0.95), rgba(25, 27, 33, 0.95));
}

.poster-note {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #f0f0f0;
  min-height: 1.2em;
}

.zone-svg {
  display: block;
  width: 100%;
  height: auto;
}

.zone-fallback {
  min-height: 94px;
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  color: rgba(255, 228, 184, 0.7);
}

.snapshot-lower {
  margin-top: 0.2rem;
  display: grid;
  grid-template-columns: 1fr 1fr 1.1fr;
  gap: 0.5rem;
}

.snapshot-block {
  --snapshot-header-bar: linear-gradient(90deg, #f8cd7d, #ee8f5d);
  position: relative;
  border: 1px solid rgba(255, 220, 154, 0.18);
  border-radius: 8px;
  background: rgba(14, 12, 8, 0.25);
  padding: 0.52rem 0.58rem;
  overflow: hidden;
}

.snapshot-block::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #f8cd7d, #ee8f5d);
}

.snapshot-block h4 {
  position: relative;
  margin: 0 -0.58rem 0.5rem;
  padding: 0 0.58rem 0.4rem;
  font-family: "Secular One", var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  text-transform: none;
  color: rgba(255, 236, 198, 0.95);
}

.snapshot-block h4::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--snapshot-header-bar);
}

.snapshot-block p {
  margin: 0.48rem 0 0;
  font-size: 0.88rem;
  line-height: 1.24;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(251, 247, 239, 0.95);
}

.snapshot-submeta {
  margin-top: 0.42rem;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.snapshot-submeta span {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 223, 166, 0.25);
  border-radius: 999px;
  padding: 0.15rem 0.44rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: rgba(255, 236, 201, 0.95);
  background: rgba(20, 15, 9, 0.35);
}

.snapshot-block-impact::before {
  background: linear-gradient(180deg, #ffa96f, #e25858);
}

.snapshot-block-impact {
  --snapshot-header-bar: linear-gradient(90deg, #ffa96f, #e25858);
}

.snapshot-block-good::before {
  background: linear-gradient(180deg, #8cf5a7, #3dbd73);
}

.snapshot-block-good {
  --snapshot-header-bar: linear-gradient(90deg, #8cf5a7, #3dbd73);
}

.snapshot-block-bad::before {
  background: linear-gradient(180deg, #ffb89f, #df6a57);
}

.snapshot-block-bad {
  --snapshot-header-bar: linear-gradient(90deg, #ffb89f, #df6a57);
}

.snapshot-block-notes::before {
  background: linear-gradient(180deg, #ffd486, #ef9e58);
}

.snapshot-block-notes {
  --snapshot-header-bar: linear-gradient(90deg, #ffd486, #ef9e58);
}

.snapshot-ump-list {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.3rem;
}

.snapshot-ump-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  align-items: center;
  font-size: 1rem;
  font-weight: 600;
  border: 1px solid rgba(255, 230, 184, 0.14);
  border-radius: 7px;
  padding: 0.2rem 0.3rem;
  background: rgba(22, 16, 11, 0.24);
}

.snapshot-ump-main {
  display: grid;
  gap: 0.08rem;
}

.snapshot-ump-name {
  font-weight: 700;
}

.snapshot-ump-game {
  font-size: 0.88rem;
  color: rgba(255, 225, 178, 0.92);
}

.snapshot-ump-stat {
  font-variant-numeric: tabular-nums;
}

.tone-good {
  color: #c7ffd4;
}

.tone-bad {
  color: #ffd0c6;
}

.snapshot-insights {
  margin: 0.24rem 0 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.34rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.snapshot-insights li {
  line-height: 1.3;
  padding: 0.08rem 0;
}

.snapshot-insights li.tone-a {
  color: rgba(245, 228, 194, 0.96);
}

.snapshot-insights li.tone-b {
  color: rgba(207, 235, 255, 0.95);
}

.snapshot-foot {
  margin-top: 0.05rem;
  padding-top: 0.27rem;
  border-top: 1px solid rgba(255, 225, 168, 0.18);
  font-size: 0.68rem;
  color: rgba(245, 223, 184, 0.86);
}

.view-controls {
  display: inline-flex;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.view-toggle {
  border: 1px solid var(--line);
  background: var(--panel-alt);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.33rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.view-toggle.is-active {
  background: linear-gradient(180deg, #294d2f, #1f3c24);
  color: #fff;
  border-color: #1f3c24;
}

.metric-note {
  margin: 0 0 0.7rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.stat-dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.stat-card {
  background: var(--panel-alt);
  padding: 0.8rem;
  animation: rise 420ms ease both;
  position: relative;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(19, 29, 21, 0.06);
}

.stat-card:nth-child(2) { animation-delay: 70ms; }
.stat-card:nth-child(3) { animation-delay: 140ms; }
.stat-card:nth-child(4) { animation-delay: 210ms; }

.stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, #3f82ff, #34c9e8);
}

.stat-card:nth-child(1) {
  background: linear-gradient(180deg, #f6f9ff 0%, #edf3ff 100%);
}

.stat-card:nth-child(1)::before {
  background: linear-gradient(90deg, #396dff, #49c4ff);
}

.stat-card:nth-child(2) {
  background: linear-gradient(180deg, #fff8f1 0%, #ffeedd 100%);
}

.stat-card:nth-child(2)::before {
  background: linear-gradient(90deg, #d26111, #f2a43a);
}

.stat-card:nth-child(3) {
  background: linear-gradient(180deg, #f5fff9 0%, #e8f9ef 100%);
}

.stat-card:nth-child(3)::before {
  background: linear-gradient(90deg, #218b57, #42c27c);
}

.stat-card:nth-child(4) {
  background: linear-gradient(180deg, #fff6fa 0%, #ffebf4 100%);
}

.stat-card:nth-child(4)::before {
  background: linear-gradient(90deg, #be2d67, #e66ca0);
}

body[data-theme="ballpark"] .stat-card {
  box-shadow: 0 4px 10px rgba(55, 37, 14, 0.08);
}

.stat-card h3 {
  margin: 0 0 0.62rem;
  font-size: 1.02rem;
  display: flex;
  align-items: flex-start;
  gap: 0.36rem;
  line-height: 1.2;
  min-height: 2.45rem;
}

.rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.rank-item {
  display: grid;
  grid-template-columns: 1.7rem 1fr auto;
  align-items: center;
  gap: 0.48rem;
  padding: 0.32rem 0.4rem;
  border: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 84%, #fff 16%);
}

.rank-pos {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid color-mix(in srgb, var(--muted) 35%, transparent);
  background: color-mix(in srgb, var(--panel) 80%, #fff 20%);
  font-variant-numeric: tabular-nums;
}

.stat-card:nth-child(1) .rank-pos {
  border-color: #4a8dff;
  color: #295cc7;
  background: #e9f1ff;
}

.stat-card:nth-child(2) .rank-pos {
  border-color: #df9647;
  color: #995400;
  background: #ffefd8;
}

.stat-card:nth-child(3) .rank-pos {
  border-color: #4aa56e;
  color: #1c6f43;
  background: #e6f7ed;
}

.stat-card:nth-child(4) .rank-pos {
  border-color: #ce5f8e;
  color: #9c2d5b;
  background: #fde7f1;
}

.rank-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-value {
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1050px;
}

th,
td {
  text-align: left;
  padding: 0.68rem 0.62rem;
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
}

th + th,
td + td {
  border-left: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-weight: 700;
  white-space: normal;
  line-height: 1.2;
  vertical-align: bottom;
}

thead .group-row th {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.76rem;
  color: color-mix(in srgb, var(--muted) 88%, #111 12%);
  background: color-mix(in srgb, var(--panel) 92%, #fff 8%);
  vertical-align: middle;
}

thead .group-row th.group-label-sticky {
  text-transform: none;
  letter-spacing: 0;
  font-size: 1rem;
  background: transparent;
  vertical-align: bottom;
}

thead .column-row th {
  font-size: 0.95rem;
}

thead .group-row th.group-performance,
thead .column-row th.group-performance {
  background: #eef7ff;
}

thead .group-row th.group-miss-quality,
thead .column-row th.group-miss-quality {
  background: #f3fbf2;
}

thead .group-row th.group-context,
thead .column-row th.group-context,
thead .group-row th.group-game-context,
thead .column-row th.group-game-context {
  background: #f2f4f7;
}

tbody td.group-performance {
  background: color-mix(in srgb, #eef7ff 58%, transparent);
}

tbody td.group-miss-quality {
  background: color-mix(in srgb, #f3fbf2 62%, transparent);
}

tbody td.group-context {
  background: color-mix(in srgb, #f2f4f7 70%, transparent);
}

tbody td.group-game-context {
  background: color-mix(in srgb, #f2f4f7 70%, transparent);
}

td {
  white-space: nowrap;
}

body[data-theme="ballpark"] th,
body[data-theme="ballpark"] td {
  font-size: 1rem;
  letter-spacing: 0;
}

body[data-theme="ballpark"] tbody tr:hover {
  background: rgba(66, 248, 255, 0.1);
}

.low-sample-row {
  opacity: 0.72;
}

.cell-muted {
  color: var(--muted);
}

.tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--muted) 45%, transparent);
  font-size: 0.68rem;
  line-height: 1;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel) 80%, #fff 20%);
  vertical-align: middle;
}

body[data-theme="ballpark"] .tip {
  border-color: #a79266;
  color: #6c5c36;
  background: #efe5cf;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .stat-dashboard {
    grid-template-columns: 1fr 1fr;
  }
  .snapshot-scorebugs {
    grid-template-columns: 1fr;
  }
  .scorebug-card { --poster-media-width: 194px; }
  .scorebug-main.with-zone {
    grid-template-columns: 1fr;
    row-gap: 0.18rem;
  }
  .scorebug-zone {
    width: calc(var(--poster-media-width) * 1.02);
    justify-self: center;
  }
  .scorebug-player-center,
  .poster-call,
  .poster-note {
    text-align: center;
  }
  .snapshot-lower {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .hero-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .theme-toggle {
    align-self: flex-start;
  }

  .hero-controls {
    flex-wrap: wrap;
  }

  .page {
    width: 95vw;
  }

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

  .stat-dashboard {
    grid-template-columns: 1fr;
  }

  .snapshot-lower {
    grid-template-columns: 1fr;
  }

  .snapshot-board {
    aspect-ratio: auto;
    padding: 0.7rem;
  }

  .scorebug-body.has-zone {
    grid-template-columns: 1fr;
  }

  .scorebug-main.with-zone {
    grid-template-columns: minmax(0, 1fr) 122px;
    column-gap: 0.32rem;
    align-items: start;
  }

  .scorebug-zone {
    width: 122px;
    justify-self: end;
    align-self: start;
  }

  .scorebug-zone-block {
    width: 122px;
    justify-items: end;
    align-content: start;
    transform: none;
  }

  .scorebug-zone-note {
    width: 100%;
    max-width: 122px;
    margin-top: 0.16rem;
  }

  .snapshot-head h3 {
    font-size: 1.3rem;
  }

  .snapshot-head p {
    font-size: 0.84rem;
  }

  .scorebug-head {
    padding-top: 0.32rem;
    padding-bottom: 0.3rem;
  }

  .scorebug-situation {
    grid-template-columns: 88px auto auto;
    width: max-content;
    min-width: 0;
    max-width: 176px;
    justify-self: start;
  }

  .scorebug-team-row {
    padding: 0.16rem 0.24rem;
  }

  .team-key {
    max-width: 52px;
  }

  .poster-layout .scorebug-title {
    font-size: 1.1rem;
  }

  .team-key,
  .scorebug-team-row strong {
    font-size: 0.96rem;
  }

  .scorebug-player-center,
  .poster-call,
  .poster-note {
    text-align: left;
    justify-self: start;
  }

  .scorebug-player-center,
  .scorebug-player-value-ab,
  .scorebug-player-value-ump {
    font-size: 0.86rem;
  }

  .snapshot-ump-item,
  .snapshot-ump-stat,
  .snapshot-insights {
    font-size: 0.92rem;
  }

  .snapshot-ump-game {
    font-size: 0.8rem;
  }

  .snapshot-insights {
    gap: 0.24rem;
  }

  .snapshot-insights li {
    line-height: 1.24;
    padding: 0.04rem 0;
  }
}
