/* ── DiamondTrack Styles ── */
:root {
  --navy: #1a2b4a;
  --navy-light: #243a5e;
  --green: #4caf50;
  --green-dark: #388e3c;
  --sky: #5b9bd5;
  --sky-dark: #4a89c0;
  --orange: #e8742a;
  --orange-dark: #d4631f;
  --white: #ffffff;
  --gray-100: #f5f5f5;
  --gray-200: #e0e0e0;
  --gray-300: #bdbdbd;
  --gray-600: #757575;
  --gray-800: #424242;
  --red: #ef5350;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--navy);
  color: var(--white);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  overflow-x: hidden;
}

#app {
  min-height: 100%;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

/* ── Buttons ── */
button {
  font-family: inherit;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.08s, opacity 0.08s;
  -webkit-user-select: none;
  user-select: none;
}
button:active {
  transform: scale(0.95);
  opacity: 0.85;
}

.btn-primary {
  background: var(--green);
  color: var(--white);
  font-size: 1.2rem;
  padding: 16px 32px;
  width: 100%;
}
.btn-primary:active { background: var(--green-dark); }

.btn-secondary {
  background: var(--navy-light);
  color: var(--white);
  font-size: 1rem;
  padding: 12px 20px;
  border: 2px solid var(--gray-300);
}

.btn-danger {
  background: var(--red);
  color: var(--white);
  font-size: 0.9rem;
  padding: 10px 16px;
}

.btn-share {
  background: var(--sky);
  color: var(--white);
  font-size: 1rem;
  padding: 14px 16px;
}

/* ── Header / Logo ── */
.header {
  text-align: center;
  padding: 0;
}
.header .logo-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 2px;
}
.header .logo-title .diamond { color: var(--white); }
.header .logo-title .track { color: var(--orange); }
.header .logo-img {
  width: 420px;
  max-width: 95%;
  height: auto;
  margin: 0;
}

/* ── Screen Container ── */
.screen {
  padding: 16px;
  padding-bottom: 72px;
  max-width: 480px;
  margin: 0 auto;
  overflow-x: hidden;
}

/* ── Game List (Home) ── */
.game-list {
  list-style: none;
  margin-top: 16px;
}
.game-card {
  background: var(--navy-light);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 4px solid var(--sky);
}
.game-card:active { background: #2d4a75; }
.game-card .game-date {
  font-size: 0.8rem;
  color: var(--gray-300);
}
.game-card .game-opponent {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 2px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.game-score {
  font-size: 0.85rem;
  font-weight: 800;
}
.game-card .game-line {
  font-size: 0.85rem;
  color: var(--gray-200);
}
.game-card.in-progress {
  border-left-color: var(--green);
}
.game-card.scheduled {
  border-left-color: var(--gray-600);
}
.game-card.scheduled.locked {
  opacity: 0.55;
}
.game-card.scheduled .scheduled-badge {
  font-size: 0.7rem;
  color: var(--gray-400);
  margin-left: 6px;
}
.game-card.scheduled .scheduled-badge.ready {
  color: var(--green);
}
.section-heading {
  font-size: 0.85rem;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 20px 0 8px;
}

/* ── Form ── */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--gray-300);
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-group input, .form-group select {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: 2px solid var(--navy-light);
  background: var(--navy-light);
  color: var(--white);
  font-size: 1rem;
  font-family: inherit;
}
.form-group input[type="date"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  max-width: 100%;
  min-width: 0;
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--sky);
}

/* ── Toggle Switch ── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}
.toggle-row .toggle-label {
  font-size: 1rem;
  font-weight: 600;
}
.toggle {
  position: relative;
  width: 56px;
  height: 30px;
  background: var(--gray-600);
  border-radius: 15px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle.on { background: var(--green); }
.toggle .toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  background: var(--white);
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle.on .toggle-knob { transform: translateX(26px); }

/* ── Live Game: Context Bar ── */
.context-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--navy-light);
  padding: 10px 16px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 1.1rem;
  font-weight: 700;
}
.context-bar > * { flex: 1; text-align: center; }
.context-bar > *:first-child { text-align: left; }
.context-bar > *:last-child { text-align: right; }

/* ── Lineup Strip ── */
.lineup-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 4px;
  margin-bottom: 8px;
  scrollbar-width: none;
}
.lineup-strip::-webkit-scrollbar { display: none; }
.lineup-chip {
  min-width: 44px;
  padding: 4px 6px;
  border-radius: 10px;
  background: var(--navy-light);
  color: var(--gray-300);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid transparent;
  gap: 1px;
}
.lineup-chip.lineup-active {
  background: var(--sky);
  color: var(--white);
  border-color: rgba(255,255,255,0.4);
}
.lineup-jersey { font-size: 0.85rem; }
.lineup-res { font-size: 0.6rem; text-transform: uppercase; opacity: 0.85; }
.lineup-res-hit { color: var(--green); }
.lineup-res-out { color: var(--orange); }
.lineup-res-reach { color: var(--sky); }
.lineup-chip.lineup-active .lineup-res-reach { color: var(--white); }

/* ── At-Bat Log ── */
.ab-log { margin-bottom: 8px; }
.ab-log-header {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gray-300);
  cursor: pointer;
  padding: 6px 12px;
  background: var(--navy-light);
  border-radius: 8px;
  text-align: center;
}
.ab-log-list {
  max-height: 160px;
  overflow-y: auto;
  background: var(--navy-light);
  border-radius: 0 0 8px 8px;
  padding: 4px 10px;
}
.ab-log-header + .ab-log-list { border-radius: 0 0 8px 8px; }
.ab-log-header:has(+ .ab-log-list) { border-radius: 8px 8px 0 0; }
.ab-log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.ab-log-item:active { background: rgba(255,255,255,0.08); border-radius: 4px; }
.ab-log-item:last-child { border-bottom: none; }
.ab-log-jersey {
  font-weight: 700;
  min-width: 36px;
  cursor: pointer;
  color: var(--sky);
  text-decoration: underline;
  text-decoration-style: dashed;
}
.ab-log-result { min-width: 36px; font-weight: 700; text-align: center; }
.ab-log-hit { color: var(--green); }
.ab-log-out { color: var(--orange); }
.ab-log-reach { color: var(--sky); }
.ab-log-pc { color: var(--gray-300); min-width: 28px; text-align: right; }
.ab-log-inn { color: var(--gray-300); min-width: 40px; text-align: right; }
.ab-log-rbi { color: var(--sky); font-weight: 700; min-width: 24px; text-align: center; }

/* ── Edit At-Bat Modal ── */
.edit-field-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gray-300);
  margin: 10px 0 4px;
  text-align: center;
}
.edit-result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 8px 0;
}
.edit-result-grid button {
  padding: 10px 4px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  border: 2px solid transparent;
}
.edit-result-grid button.edit-selected {
  outline: 2px solid var(--sky);
  outline-offset: 1px;
}
.edit-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 6px 0;
}
.edit-stepper button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: 700;
}
.edit-stepper span {
  font-size: 1.2rem;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}

/* ── Tab Toggle ── */
.tab-toggle {
  display: flex;
  background: var(--navy-light);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
}
.tab-toggle button {
  flex: 1;
  padding: 12px;
  font-size: 1rem;
  border-radius: 0;
  background: transparent;
  color: var(--gray-300);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.tab-toggle button.active {
  background: var(--sky);
  color: var(--white);
}

/* ── AB Grid ── */
.ab-label {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  text-align: center;
  color: var(--gray-200);
}

.btn-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}
.btn-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.btn-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.btn-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.btn-grid button {
  padding: 16px 4px;
  font-size: 1rem;
  font-weight: 700;
  min-height: 56px;
}

.btn-hit { background: var(--green); color: var(--white); }
.btn-hit:active { background: var(--green-dark); }
.btn-reach { background: var(--sky); color: var(--white); }
.btn-reach:active { background: var(--sky-dark); }
.btn-out { background: var(--orange); color: var(--white); }
.btn-out:active { background: var(--orange-dark); }

/* ── Run Tracking Row ── */
.run-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.run-row button {
  flex: 1;
  padding: 14px 8px;
  font-size: 0.9rem;
  background: var(--navy-light);
  color: var(--white);
  border: 2px solid var(--gray-600);
}

/* ── Action Row ── */
.action-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.action-row button {
  flex: 1;
  padding: 14px 8px;
  font-size: 0.85rem;
}
.btn-undo {
  background: var(--gray-600);
  color: var(--white);
}
.btn-next-inning {
  background: var(--sky);
  color: var(--white);
}
.btn-end-game {
  background: var(--red);
  color: var(--white);
}

/* ── Pitching Mode ── */
.pitcher-bar {
  text-align: center;
  margin-bottom: 10px;
}
.pitcher-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--sky);
  cursor: pointer;
  border-bottom: 1px dashed var(--sky);
  padding-bottom: 2px;
}
.pitch-count-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 1rem;
}
.pitch-count-dots .batter-label {
  font-weight: 700;
  margin-right: 12px;
  font-size: 1.1rem;
}
.dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  display: inline-block;
}
.dot.filled-ball { background: var(--sky); border-color: var(--sky); }
.dot.filled-strike { background: var(--orange); border-color: var(--orange); }
.dot-separator {
  font-size: 1.4rem;
  color: var(--gray-300);
  margin: 0 4px;
}

.pitch-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.pitch-buttons button {
  padding: 24px 8px;
  font-size: 1.3rem;
  font-weight: 800;
  min-height: 72px;
}
.btn-ball { background: var(--sky); color: var(--white); }
.btn-strike { background: var(--orange); color: var(--white); }

.btn-foul {
  flex: 1;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  background: var(--navy-light);
  color: var(--orange);
  border: 2px solid var(--orange);
}
.btn-wp {
  flex: 1;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  background: var(--navy-light);
  color: var(--red);
  border: 2px solid var(--red);
}

.pitch-result-label {
  font-size: 0.85rem;
  color: var(--gray-300);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  text-align: center;
  font-weight: 600;
}

.pitch-other-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.pitch-other-row button {
  flex: 1;
  padding: 12px 4px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--navy-light);
  color: var(--white);
  border: 2px solid var(--gray-600);
}

/* ── Earned Run Prompt ── */
.er-prompt {
  background: rgba(0,0,0,0.8);
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.er-prompt-inner {
  background: var(--navy-light);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  max-width: 320px;
  width: 90%;
}
.er-prompt-inner h3 {
  margin-bottom: 12px;
  font-size: 1.1rem;
}
.er-prompt-inner .er-buttons {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.er-prompt-inner .er-buttons button {
  flex: 1;
  padding: 14px;
  font-size: 1rem;
}

/* ── Stats Tables ── */
.stats-section {
  margin-bottom: 24px;
}
.stats-section h2 {
  font-size: 1rem;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--navy-light);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
}
.stat-box {
  background: var(--navy-light);
  border-radius: 8px;
  padding: 10px 6px;
  text-align: center;
}
.stat-box .stat-value {
  font-size: 1.3rem;
  font-weight: 800;
}
.stat-box .stat-label {
  font-size: 0.7rem;
  color: var(--gray-300);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.event-log {
  margin-top: 16px;
}
.event-log h3 {
  font-size: 0.9rem;
  color: var(--gray-300);
  margin-bottom: 8px;
}
.event-item {
  background: var(--navy-light);
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
}
.event-item .event-inning {
  color: var(--sky);
  font-weight: 600;
  min-width: 50px;
}

/* ── Per-Game Table ── */
.game-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-top: 8px;
}
.game-table th {
  background: var(--navy-light);
  padding: 8px 4px;
  text-align: center;
  color: var(--gray-300);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  position: sticky;
  top: 0;
}
.game-table td {
  padding: 8px 4px;
  text-align: center;
  border-bottom: 1px solid var(--navy-light);
}
.game-table tr:active { background: var(--navy-light); }
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
}

/* ── Nav Bar (fixed footer) ── */
.nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  background: var(--navy-light);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 10px 0 calc(10px + var(--safe-bottom));
  z-index: 50;
}
.nav-bar button {
  background: transparent;
  color: var(--gray-300);
  padding: 6px 0;
  font-size: 0.65rem;
  border-radius: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.nav-bar button svg { opacity: 0.8; }
.nav-bar button:active { color: var(--white); }
.nav-bar button:active svg { opacity: 1; }

/* ── Flash Feedback ── */
.flash {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(0,0,0,0.85);
  color: var(--white);
  padding: 20px 40px;
  border-radius: 16px;
  font-size: 1.5rem;
  font-weight: 800;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 200;
}
.flash.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ── Header Row (score + back) ── */
.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.scoreboard {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.sb-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--sky);
  letter-spacing: 0.5px;
}
.sb-cell {
  background: var(--navy-light);
  color: var(--white);
  font-size: 1.2rem;
  font-weight: 800;
  min-width: 32px;
  text-align: center;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.1);
  font-variant-numeric: tabular-nums;
}
.sb-sep {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--white);
  opacity: 0.5;
}
.header-opponent {
  font-size: 1rem;
  color: var(--white);
  white-space: nowrap;
}
.header-vs {
  color: var(--sky);
}
/* ── Line Score Table ── */
.line-score {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}
.line-score th,
.line-score td {
  padding: 4px 6px;
  text-align: center;
  color: var(--white);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.line-score th {
  font-weight: 600;
  color: var(--sky);
  font-size: 0.7rem;
}
.line-score .ls-team {
  text-align: left;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--sky);
  padding-right: 10px;
}
.line-score .ls-total {
  font-weight: 800;
  border-left: 1px solid rgba(255,255,255,0.15);
}
/* ── Out Dots (header) ── */
.out-dots {
  display: flex;
  gap: 8px;
  cursor: pointer;
  padding: 8px;
  align-items: center;
}
.out-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid var(--orange);
  background: transparent;
  transition: background 0.1s;
}
.out-dot-filled {
  background: var(--orange);
}

/* ── Score Adjust Overlay ── */
.score-adjust-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 12px 0;
}
.score-adjust-row button {
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.score-adjust-label {
  font-size: 1.1rem;
  min-width: 80px;
  text-align: center;
}

/* ── Back Button ── */
.back-btn {
  background: none;
  color: var(--sky);
  font-size: 0.9rem;
  padding: 8px 0;
  margin-bottom: 12px;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-300);
}
.empty-state p {
  font-size: 1rem;
  margin-bottom: 8px;
}

/* ── Settings ── */
.settings-section {
  background: var(--navy-light);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.settings-section h3 {
  font-size: 0.85rem;
  color: var(--gray-300);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.settings-section .btn-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.settings-section .btn-row button { flex: 1; }

/* ── Photo Upload ── */
.photo-upload {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  margin: 0 auto 8px;
  border: 2px dashed var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
}
.photo-upload:active { border-color: var(--sky); }
.photo-placeholder {
  font-size: 0.75rem;
  color: var(--gray-300);
  text-align: center;
  padding: 8px;
}
.photo-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.btn-small-danger {
  background: transparent;
  color: var(--red);
  font-size: 0.75rem;
  padding: 4px 10px;
  border: 1px solid var(--red);
  border-radius: 6px;
  display: block;
  margin: 0 auto;
}

/* ── Confirm Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
}
.direction-picker {
  background: var(--navy-light);
  border-radius: 16px;
  padding: 20px 24px;
  text-align: center;
}
.direction-label {
  font-size: 0.85rem;
  color: var(--gray-300);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.direction-skip {
  background: none;
  color: var(--gray-300);
  font-size: 0.85rem;
  padding: 8px;
  margin-top: 8px;
}

/* ── Sparklines ── */
.sparkline-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.sparkline-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--navy-light);
  border-radius: 8px;
  padding: 8px 12px;
}
.sparkline-label {
  font-size: 0.75rem;
  color: var(--gray-300);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 50px;
  flex-shrink: 0;
}
.sparkline-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--white);
  width: 40px;
  text-align: right;
  flex-shrink: 0;
}

.modal-box {
  background: var(--navy-light);
  border-radius: 16px;
  padding: 24px;
  max-width: 300px;
  width: 90%;
  text-align: center;
}
.modal-box h3 { margin-bottom: 8px; }
.modal-box p { color: var(--gray-300); font-size: 0.9rem; margin-bottom: 16px; }
.modal-box .modal-buttons { display: flex; gap: 10px; }
.modal-box .modal-buttons button { flex: 1; padding: 12px; }

/* ── Batter Label (tappable) ── */
.batter-label-tap {
  border-bottom: 1px dashed var(--gray-300);
  cursor: pointer;
  padding-bottom: 2px;
}
.batter-highlighted {
  position: relative;
  z-index: 1;
  border-bottom: none;
}
.batter-highlighted::before {
  content: '';
  position: absolute;
  inset: -2px -4px;
  background: var(--hl-color, var(--sky));
  opacity: 0.55;
  border-radius: 3px 5px 4px 6px;
  clip-path: polygon(
    2% 8%, 6% 0%, 15% 5%, 28% 1%, 42% 4%, 55% 0%, 68% 3%, 80% 1%, 92% 5%, 98% 2%,
    100% 15%, 97% 35%, 100% 55%, 98% 75%, 100% 90%, 96% 98%,
    85% 95%, 70% 100%, 55% 96%, 40% 100%, 25% 97%, 12% 100%, 4% 96%, 0% 92%,
    2% 75%, 0% 55%, 3% 35%, 0% 15%
  );
  z-index: -1;
}



/* ── Pitching Line Canvas ── */
#pitching-line {
  border-radius: 8px;
}

/* ── Scouting Cards ── */
.scout-card {
  background: var(--navy-light);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 4px solid var(--orange);
}
.scout-card:active { background: #2d4a75; }

/* ── Pitch Sequence Dots ── */
.pitch-sequence {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.pitch-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.pitch-dot-ball { background: var(--sky); }
.pitch-dot-strike { background: var(--orange); }
.pitch-dot-foul { background: var(--gray-300); }
.pitch-dot-inplay { background: var(--green); }

/* ── Help Screen ── */
.help-section {
  margin-bottom: 24px;
}
.help-section h2 {
  font-size: 1rem;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--navy-light);
}
.help-list {
  list-style: none;
  padding: 0;
}
.help-list li {
  background: var(--navy-light);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
  font-size: 0.9rem;
  line-height: 1.4;
}
.abbr-table {
  width: 100%;
  border-collapse: collapse;
}
.abbr-table tr:nth-child(odd) {
  background: var(--navy-light);
}
.abbr-table td {
  padding: 8px 10px;
  font-size: 0.85rem;
}
.abbr-table td:first-child {
  font-weight: 700;
  color: var(--sky);
  width: 70px;
}
