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

body {
  background: #0a0a14;
  color: #f0e6d3;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  overflow: hidden;
  height: 100vh;
}

#app {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100vh;
  padding: 8px;
}

#header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 6px;
}

#header h1 {
  font-size: 18px;
  color: #f0e6d3;
  letter-spacing: 1px;
}

.park-name {
  font-size: 12px;
  color: #8888aa;
  font-style: italic;
}

/* --- Score Bug (broadcast-style horizontal bar) --- */
#score-bug {
  display: flex;
  align-items: center;
  gap: 0;
  background: #12121e;
  border: 1px solid #222233;
  border-radius: 4px;
  padding: 6px 0;
  margin-bottom: 6px;
  min-height: 52px;
}

.bug-divider {
  width: 1px;
  height: 36px;
  background: #222233;
  flex-shrink: 0;
}

/* Teams + scores */
.bug-teams {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 14px;
  min-width: 110px;
}

.bug-team-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.bug-team-abbr {
  font-weight: bold;
  font-size: 14px;
  letter-spacing: 1px;
}

.bug-score {
  font-size: 20px;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  min-width: 24px;
  text-align: right;
}

/* Inning */
.bug-inning {
  padding: 0 14px;
  font-size: 20px;
  font-weight: bold;
  color: #f0e6d3;
  text-align: center;
  min-width: 48px;
}

/* Count (B/S/O) */
.bug-count {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 14px;
}

.bug-count-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  line-height: 1.1;
  letter-spacing: 2px;
}

.bug-count-label {
  width: 12px;
  font-weight: bold;
  color: #8888aa;
}

#count-balls { color: #2ecc71; }
#count-strikes { color: #e74c3c; }
#count-outs { color: #f1c40f; }

/* Bases (mini diamond in score bug) */
.bug-bases {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 0 14px;
}

.base-row {
  display: flex;
  gap: 16px;
}

.base {
  width: 14px;
  height: 14px;
  border: 2px solid #444466;
  transform: rotate(45deg);
  background: transparent;
  transition: background-color 0.2s;
}

.base.occupied {
  background: #f1c40f;
  border-color: #f1c40f;
}

/* Matchup info */
.bug-matchup {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 14px;
  font-size: 12px;
  min-width: 120px;
}

.bug-matchup-row {
  display: flex;
  gap: 4px;
}

.bug-matchup-label {
  color: #8888aa;
  font-weight: bold;
}

.bug-pitch-count {
  color: #8888aa;
}

/* --- Game container --- */
#game-container {
  display: flex;
  justify-content: center;
}

#game-canvas {
  border: 1px solid #222233;
  border-radius: 4px;
  background: #0a0a14;
}

/* --- Line score --- */
#line-score {
  margin-top: 6px;
  overflow-x: auto;
  user-select: none;
  caret-color: transparent;
}

.line-score-table {
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.line-score-table th,
.line-score-table td {
  padding: 4px 10px;
  text-align: center;
  border: 1px solid #222233;
  min-width: 28px;
}

.line-score-table th {
  color: #8888aa;
  font-weight: normal;
}

.line-score-table .team-cell {
  text-align: left;
  font-weight: bold;
}

.line-score-table .total {
  font-weight: bold;
  border-left: 2px solid #444466;
}

.line-score-table .current-inning {
  background: rgba(255, 255, 255, 0.06);
}

/* --- Play description --- */
.play-description {
  margin-top: 6px;
  font-size: 14px;
  font-weight: bold;
  color: #f0e6d3;
  text-align: center;
  min-height: 20px;
  transition: opacity 0.3s;
}

.play-description.flash {
  color: #ffffff;
}
