/* ── Score header ───────────────────────────────────────────────────────── */

.bs-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 0 1.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
}

.bs-header__team {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.bs-header__team--home {
  justify-content: flex-end;
}

.bs-header__logo {
  width: 48px;
  height: 48px;
  image-rendering: auto;
}

.bs-header__team-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.bs-header__team-info--home {
  text-align: right;
}

.bs-header__team-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

.bs-header__team-label {
  font-size: 0.75rem;
  color: #6b7280;
}

.bs-header__score {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  flex-shrink: 0;
}

.bs-header__runs {
  font-size: 2rem;
  font-weight: 700;
  min-width: 1.75rem;
  color: var(--color-text);
}

.bs-header__status-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 5rem;
}

.bs-header__status {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
  white-space: nowrap;
}

.bs-header__status--live {
  color: #16a34a;
}

.bs-header__date {
  font-size: 0.7rem;
  color: #9ca3af;
}

/* ── Mobile tabs (hidden on wide) ───────────────────────────────────────── */

.bs-tabs {
  display: none;
  gap: 0;
  margin-bottom: 1rem;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.bs-tabs__tab {
  flex: 1;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--color-surface);
  color: #6b7280;
  border: none;
  cursor: pointer;
  letter-spacing: 0.03em;
}

.bs-tabs__tab--active {
  background: var(--color-primary);
  color: #fff;
}

[data-theme="dark"] .bs-tabs__tab--active {
  color: var(--color-bg);
}

/* ── Two-panel layout ───────────────────────────────────────────────────── */

.bs-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 2rem;
}

.bs-panel {
  min-width: 0;
  display: grid;
  grid-row: span 2;
  grid-template-rows: subgrid;
  align-content: start;
}

/* ── Section (hitting / pitching block) ─────────────────────────────────── */

.bs-section {
  margin-bottom: 1.5rem;
}

.bs-section__heading {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 0.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--color-border);
}

.bs-section__heading .team-logo {
  width: 16px;
  height: 16px;
  margin-right: 0;
}

/* ── Box score table ────────────────────────────────────────────────────── */

.bs-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.bs-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.8rem;
  white-space: nowrap;
}

.bs-table th,
.bs-table td {
  padding: 0.3rem 0.5rem;
  text-align: right;
  border-bottom: 1px solid var(--color-border);
}

.bs-table th {
  background: var(--color-surface);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: #6b7280;
}

.bs-table th.left,
.bs-table td.left {
  text-align: left;
}

.bs-table td a {
  color: var(--color-primary);
  text-decoration: none;
}

.bs-table td a:hover {
  text-decoration: underline;
}

.bs-table tr:hover td {
  background: color-mix(in srgb, var(--color-primary) 6%, var(--color-bg));
}

.bs-table__totals td {
  font-weight: 600;
  background: var(--color-surface);
  border-top: 2px solid var(--color-border);
}

.bs-table__totals:hover td {
  background: var(--color-surface);
}

/* ── Small screens ──────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .bs-header__team-name {
    font-size: 0.875rem;
  }

  .bs-header__logo {
    width: 36px;
    height: 36px;
  }

  .bs-header__runs {
    font-size: 1.5rem;
  }

  .bs-tabs {
    display: flex;
  }

  .bs-panels {
    display: block;
  }

  .bs-panel {
    display: block;
  }

  .bs-panel[data-panel="home"] {
    display: none;
  }
}
