:root {
  --pond-deep:     #E8F5E9;
  --frog-green:    #6FCF8A;
  --lily-light:    #1E3328;
  --pad-cream:     #0F1A14;
  --water-blue:    #B3E5FC;
  --cattail-gold:  #C9A84A;
  --warning-coral: #EF9A9A;
  --text-soft:     #A8B5AB;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--pad-cream);
  color: var(--pond-deep);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  color: var(--pond-deep);
}

/* ── Header / Hero ─────────────────────────────────────────────────────── */
.site-header {
  background: var(--lily-light);
  border-bottom: 1px solid rgba(111,207,138,0.2);
  padding: 1.25rem 2rem 1rem;
}

.hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.hero-frog {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.wordmark {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 2rem;
  color: var(--pond-deep);
  line-height: 1.1;
}

.tagline {
  font-size: 0.875rem;
  color: var(--text-soft);
  margin-top: 0.15rem;
}

/* ── Date picker ─────────────────────────────────────────────────────────── */
.date-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.date-pill {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid rgba(111,207,138,0.25);
  background: rgba(111,207,138,0.08);
  color: var(--text-soft);
  font-family: 'Inter', sans-serif;
  transition: background 0.15s, color 0.15s;
}

.date-pill:hover { background: rgba(111,207,138,0.18); color: var(--pond-deep); }
.date-pill.active { background: var(--frog-green); color: #0B1510; border-color: var(--frog-green); }


/* ── Main layout ────────────────────────────────────────────────────────── */
.main-layout {
  max-width: 1360px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.content-col {
  width: 100%;
  min-width: 0;
}

/* ── Ad slot ────────────────────────────────────────────────────────────── */
.ad-slot {
  min-height: 90px;
  background: var(--lily-light);
  border: 1px dashed rgba(111,207,138,0.25);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

/* ── Pro teaser (full-width banner) ─────────────────────────────────────── */
.pro-teaser {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--lily-light);
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
  border: 1px solid rgba(111,207,138,0.2);
  margin-bottom: 1.25rem;
}

.pro-badge {
  display: inline-block;
  background: var(--cattail-gold);
  color: #0B1510;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 0.68rem;
  padding: 0.12rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.pro-teaser p {
  font-size: 0.85rem;
  color: var(--text-soft);
  line-height: 1.4;
}

/* ── State panels ───────────────────────────────────────────────────────── */
.state-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem;
  text-align: center;
  gap: 1rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(111,207,138,0.15);
  border-top-color: var(--frog-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.state-panel h2 { font-size: 1.2rem; }
.state-panel p  { color: var(--text-soft); font-size: 0.9rem; max-width: 420px; }

/* ── Pending panel ──────────────────────────────────────────────────────── */
.pending-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4rem 2rem 3rem;
  text-align: center;
  gap: 0.75rem;
}

.pending-icon { font-size: 2.5rem; margin-bottom: 0.25rem; }
.pending-panel h2 { font-size: 1.4rem; }
.pending-panel .sub {
  color: var(--text-soft);
  font-size: 0.9rem;
  max-width: 380px;
  line-height: 1.6;
}

.backtest-prompt {
  margin-top: 1.5rem;
  background: var(--lily-light);
  border: 1px solid rgba(111,207,138,0.2);
  border-radius: 16px;
  padding: 1.5rem 2rem;
  text-align: left;
  max-width: 420px;
  width: 100%;
}

.backtest-prompt h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-soft);
  margin-bottom: 0.85rem;
}

.backtest-prompt p {
  font-size: 0.875rem;
  color: var(--text-soft);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.backtest-grid { display: flex; flex-direction: column; gap: 0.5rem; }

.backtest-btn {
  width: 100%;
  padding: 0.65rem 1rem;
  background: rgba(111,207,138,0.06);
  border: 1px solid rgba(111,207,138,0.2);
  border-radius: 12px;
  color: var(--pond-deep);
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s, border-color 0.15s;
}

.backtest-btn:hover { background: rgba(111,207,138,0.15); border-color: var(--frog-green); }
.backtest-btn .btn-date { font-weight: 600; }
.backtest-btn .btn-label { font-size: 0.78rem; color: var(--text-soft); }

/* ── Report header ──────────────────────────────────────────────────────── */
.report-header { margin-bottom: 2rem; }
.report-header h1 { font-size: 1.6rem; }
.report-header p  { color: var(--text-soft); font-size: 0.875rem; margin-top: 0.25rem; }

/* ── Game section ───────────────────────────────────────────────────────── */
.game-section { margin-bottom: 2.5rem; }

.game-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-soft);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(111,207,138,0.2);
}

.game-timestamps {
  font-size: 0.62rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.2px;
  margin-top: 0.25rem;
  opacity: 0.85;
}

.game-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 1100px) { .game-cards { grid-template-columns: 1fr; } }

/* ── Matchup card ───────────────────────────────────────────────────────── */
.matchup-card {
  display: flex;
  background: var(--lily-light);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  min-height: 400px;
  margin-bottom: 20px;
}

@media (max-width: 640px) { .matchup-card { flex-direction: column; } }

/* ── Pitcher panel ──────────────────────────────────────────────────────── */
.card-left {
  flex: 0 0 56%;
  padding: 1.5rem;
  border-right: 1px solid rgba(111,207,138,0.15);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}

@media (max-width: 640px) {
  .card-left { flex: none; border-right: none; border-bottom: 1px solid rgba(111,207,138,0.15); }
}

.pitcher-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.team-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  flex-shrink: 0;
}

.pitcher-name-block { flex: 1; min-width: 0; }

.pitcher-name {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: 'Quicksand', sans-serif;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--pond-deep);
}

.hand-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  background: rgba(111,207,138,0.2);
  color: var(--frog-green);
  vertical-align: middle;
  margin-left: 0.3rem;
}

.pitcher-team-name {
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Stat row */
.stat-row { display: flex; gap: 0.4rem; }

.stat-cell {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 0.45rem 0.4rem;
  text-align: center;
}

.stat-val { font-size: 0.95rem; font-weight: 700; color: var(--pond-deep); }
.stat-lbl {
  font-size: 0.6rem;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.1rem;
}

/* Style tags */
.style-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.style-tag {
  padding: 0.18rem 0.5rem;
  border-radius: 99px;
  font-size: 0.66rem;
  font-weight: 700;
  background: rgba(111,207,138,0.12);
  color: var(--pond-deep);
  border: 1px solid rgba(111,207,138,0.3);
}

/* Style summary */
.style-summary {
  font-size: 0.8rem;
  color: var(--text-soft);
  line-height: 1.55;
  padding: 0.6rem 0.85rem;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  border-left: 3px solid var(--frog-green);
}

/* Arsenal */
.section-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}

.arsenal-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
}

.arsenal-code {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--pond-deep);
  font-family: monospace;
  min-width: 22px;
}

.arsenal-name {
  font-size: 0.72rem;
  color: var(--text-soft);
  min-width: 82px;
  flex-shrink: 0;
  white-space: nowrap;
}

.arsenal-bar-wrap {
  flex: 1;
  height: 4px;
  background: rgba(111,207,138,0.12);
  border-radius: 99px;
  overflow: hidden;
}

.arsenal-bar-fill {
  height: 100%;
  background: var(--frog-green);
  border-radius: 99px;
  opacity: 0.85;
}

.arsenal-pct {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--pond-deep);
  min-width: 34px;
  text-align: right;
}

.arsenal-velo {
  font-size: 0.68rem;
  color: var(--text-soft);
  min-width: 50px;
  text-align: right;
}

/* ── Batters panel ──────────────────────────────────────────────────────── */
.card-right {
  flex: 1;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}

.batters-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.1rem;
}

.opp-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
}

.batters-title {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'Quicksand', sans-serif;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.batters-subtitle {
  font-size: 0.67rem;
  color: var(--text-soft);
  opacity: 0.7;
  margin-top: 0.1rem;
}

/* Batter row */
.batter-row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.75rem 1rem;
  background: #243B2E;
  border-radius: 8px;
  transition: transform 150ms ease, box-shadow 150ms ease;
  cursor: default;
}

.batter-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.batter-row.top-batter {
  border: 2px solid var(--cattail-gold);
}

.conf-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.batter-rank {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-soft);
  min-width: 12px;
  padding-top: 2px;
  flex-shrink: 0;
}

.batter-info { flex: 1; min-width: 0; }

.batter-name-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.12rem;
}

.batter-name {
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Quicksand', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--pond-deep);
}

.batter-pos {
  font-size: 0.63rem;
  color: var(--text-soft);
  background: var(--lily-light);
  padding: 0.05rem 0.28rem;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Result pills — hit / miss / dnp */
.result-pill {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
  letter-spacing: 0.2px;
  flex-shrink: 0;
  margin-left: auto;
  white-space: nowrap;
}

.result-hit  { background: rgba(111,207,138,0.2);  color: var(--frog-green); }
.result-miss { background: rgba(239,154,154,0.15); color: var(--warning-coral); }
.result-dnp  { background: rgba(168,181,171,0.1);  color: var(--text-soft); }

.batter-stats-line {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--frog-green);
  margin-bottom: 0.1rem;
}

.batter-reason {
  font-size: 0.68rem;
  color: var(--text-soft);
  line-height: 1.35;
}

/* Pitch hit % breakdown */
.pitch-hit-table {
  margin-top: 0.5rem;
  background: var(--pad-cream);
  border: 1px solid rgba(111,207,138,0.1);
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  overflow: hidden;
  width: 100%;
}

/* Grid layout: code | badge | h/s | bar | pct — fixes overlap */
.ph-row {
  display: grid;
  grid-template-columns: 22px 44px 40px 1fr 44px;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.66rem;
}

.ph-code {
  font-family: monospace;
  font-weight: 700;
  color: var(--pond-deep);
}

.ph-badge {
  font-size: 0.54rem;
  font-weight: 800;
  padding: 0.05rem 0.28rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.ph-badge.hot  { background: rgba(111,207,138,0.2);  color: var(--frog-green); }
.ph-badge.cold { background: rgba(180,60,60,0.35);   color: #FFCDD2; }

.ph-hs {
  color: var(--text-soft);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ph-bar-wrap {
  height: 3px;
  background: rgba(111,207,138,0.1);
  border-radius: 99px;
  overflow: hidden;
}

.ph-bar-fill { height: 100%; border-radius: 99px; }

.ph-pct {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ph-nodata {
  font-size: 0.66rem;
  color: var(--text-soft);
  font-style: italic;
}

/* ── Bullpen ────────────────────────────────────────────────────────────── */
.bullpen-section {
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(111,207,138,0.15);
}

.bp-bar-fill  { background: var(--cattail-gold) !important; opacity: 0.75; }
.bp-code      { color: var(--text-soft) !important; }

.bp-unavailable {
  font-size: 0.75rem;
  color: var(--text-soft);
  padding: 0.25rem 0;
  opacity: 0.6;
}

/* ── No games ───────────────────────────────────────────────────────────── */
.no-games { text-align: center; padding: 4rem 2rem; color: var(--text-soft); }
.no-games h2 { font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--pond-deep); }

/* ── Expected hit rate ──────────────────────────────────────────────────── */
.ehr-block {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--pond-deep);
  margin-bottom: 0.18rem;
}

.ehr-block strong { font-weight: 800; color: var(--frog-green); }
.ehr-coverage     { color: var(--text-soft); font-weight: 400; }
.ehr-null         { color: var(--text-soft); font-style: italic; }

.ehr-limited {
  display: inline-block;
  background: rgba(239,154,154,0.15);
  color: var(--warning-coral);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 99px;
  margin-left: 0.3rem;
  vertical-align: middle;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-soft);
  font-size: 0.8rem;
  border-top: 1px solid rgba(111,207,138,0.2);
  margin-top: 2rem;
}
