.boxscore-page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 24px 20px 56px;
  color: #333;
  font-family: var(--font-body);
}

.boxscore-page section {
  margin-bottom: 0;
}

.boxscore-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}

.boxscore-kicker {
  margin: 0 0 6px;
  color: #666;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.boxscore-header h1 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.boxscore-meta {
  margin: 7px 0 0;
  color: #666;
  font-size: 14px;
}

.boxscore-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  color: var(--ink);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.boxscore-back:hover {
  border-color: var(--ink);
  color: var(--ink-strong);
}

.boxscore-summary-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(360px, 1.15fr);
  gap: 16px;
  align-items: start;
}

.boxscore-player-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  margin-top: 18px;
}

.boxscore-scoreboard,
.boxscore-section {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  overflow: hidden;
}

.boxscore-section {
  margin-top: 18px;
}

.boxscore-summary-grid .boxscore-section {
  margin-top: 0;
}

.boxscore-player-grid .boxscore-section {
  margin-top: 0;
}

.boxscore-panel-head,
.boxscore-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  background: #f8f8f8;
  border-bottom: 1px solid var(--hairline);
}

.boxscore-panel-head h2,
.boxscore-section__head h2 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 15px;
  font-weight: 700;
}

.boxscore-panel-head span,
.boxscore-section__head span,
.boxscore-team-labels {
  color: #777;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.boxscore-team {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.boxscore-team + .boxscore-team {
  border-top: 1px solid #eee;
}

.boxscore-team img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.boxscore-team__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.boxscore-team__body strong {
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.boxscore-team__body span {
  color: #777;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.boxscore-team__side {
  margin-bottom: 2px;
}

.boxscore-team__score {
  color: var(--ink-strong);
  font-size: 28px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.boxscore-teamstats {
  display: flex;
  flex-direction: column;
}

.boxscore-teamstat {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid #eee;
  background: #fff;
}

.boxscore-teamstat:last-child {
  border-bottom: 0;
}

.boxscore-teamstat:nth-child(odd):not(.boxscore-teamstat--head) {
  background: #f8f8f8;
}

.boxscore-teamstat--head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding-top: 10px;
  padding-bottom: 10px;
  background: #f1f1f1;
  border-bottom: 1px solid #ddd;
}

.boxscore-teamstat__team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.boxscore-teamstat__team img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.boxscore-teamstat__team strong {
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.boxscore-teamstat__heading {
  color: #777;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-align: center;
}

.boxscore-teamstat strong {
  color: var(--ink-strong);
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.boxscore-teamstat span {
  color: #555;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.boxscore-table-wrap {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
}

.boxscore-table-wrap--goalies {
  margin-top: 14px;
}

.boxscore-table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.boxscore-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 5px;
  border-bottom: 1px solid var(--frost);
  background: var(--sheet);
  color: var(--twill);
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-align: right;
  text-transform: uppercase;
  white-space: nowrap;
}

.boxscore-table .boxscore-group-row td {
  position: sticky;
  left: 0;
  z-index: 1;
  padding: 6px 9px;
  border-top: 8px solid #fff;
  border-bottom: 1px solid #d8dde6;
  background: #eef1f5;
  color: var(--ink);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  box-shadow: none;
}

.boxscore-table td,
.boxscore-table tbody th {
  padding: 4px 5px;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-strong);
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
}

.boxscore-table tbody tr {
  background: #fff;
}

.boxscore-table tbody tr:nth-child(even) {
  background: var(--ice);
}

.boxscore-table tbody tr:hover,
.boxscore-table tbody tr:hover td:first-child {
  background: rgba(27, 79, 140, 0.08);
}

.boxscore-table th:first-child,
.boxscore-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 0;
  width: 37%;
  max-width: 180px;
  color: var(--board);
  font-weight: 600;
  text-align: left;
  background: inherit;
  box-shadow: inset -1px 0 0 #d8dde6;
}

.boxscore-table thead th:first-child {
  z-index: 3;
  color: var(--twill);
  background: var(--sheet);
  box-shadow: inset -1px 0 0 var(--frost);
}

.boxscore-table .boxscore-group-row td,
.boxscore-table .boxscore-group-row td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 0;
  max-width: none;
  padding: 6px 9px;
  border-top: 8px solid #fff;
  border-bottom: 1px solid #d8dde6;
  background: #eef1f5;
  color: var(--ink);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  box-shadow: none;
}

.boxscore-table a {
  color: var(--ink-strong);
  font-weight: 700;
  text-decoration: none;
}

.boxscore-table a:hover {
  color: var(--goal-red);
  text-decoration: underline;
}

.boxscore-player {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.boxscore-player img {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border: 1px solid #e1e5ec;
  border-radius: 50%;
  background: #f4f6fa;
  object-fit: cover;
}

.boxscore-player__text {
  min-width: 0;
}

.boxscore-player__text a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.boxscore-optional {
  display: none;
}

.boxscore-player__text span {
  display: block;
  margin-top: 1px;
  color: #888;
  font-size: 10px;
  font-weight: 600;
}

.boxscore-empty {
  margin: 14px;
  padding: 14px;
  border: 1px dashed #d8dde6;
  border-radius: 4px;
  color: #666;
  background: #fafafa;
  font-size: 14px;
}

@media (max-width: 900px) {
  .boxscore-summary-grid,
  .boxscore-player-grid {
    grid-template-columns: 1fr;
  }

  .boxscore-table-wrap {
    max-height: none;
  }
}

@media (min-width: 1180px) {
  .boxscore-optional {
    display: table-cell;
  }

  .boxscore-table th:first-child,
  .boxscore-table td:first-child {
    width: 30%;
  }
}

@media (max-width: 700px) {
  .boxscore-page {
    padding: 16px 0 40px;
  }

  .boxscore-header {
    flex-direction: column;
    gap: 12px;
  }

  .boxscore-header h1 {
    font-size: 21px;
  }

  .boxscore-back {
    width: 100%;
  }

  .boxscore-panel-head,
  .boxscore-section__head {
    padding: 10px 12px;
  }

  .boxscore-team {
    grid-template-columns: 36px minmax(0, 1fr) 42px;
    gap: 10px;
    padding: 11px 12px;
  }

  .boxscore-team img {
    width: 34px;
    height: 34px;
  }

  .boxscore-team__body strong {
    font-size: 15px;
  }

  .boxscore-team__score {
    font-size: 24px;
  }

  .boxscore-teamstat {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    padding: 8px 12px;
  }
}

/* ── Tabs ─────────────────────────────────────────────────────────────── */

.boxscore-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--hairline);
}

.boxscore-tab {
  padding: 9px 16px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  margin-bottom: -1px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.boxscore-tab:hover {
  background: #f4f6f9;
}

.boxscore-tab--active {
  border-color: var(--hairline);
  color: #1a1a1a;
  background: #fff;
}

/* ── Lineup tab ───────────────────────────────────────────────────────── */

.lineup-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  margin-bottom: 10px;
}

.lineup-legend__keys {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #555;
  font-size: 13px;
}

.lineup-legend__keys li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lineup-legend__toggle {
  color: #2f6fbf;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.lineup-legend__toggle:hover {
  text-decoration: underline;
}

/* Fill level reads as certainty, so the glyph carries the state on its own —
   colour only reinforces it. */
.lineup-symbol {
  font-size: 13px;
  line-height: 1;
}

.lineup-symbol--confirmed { color: #1f8a4c; }
.lineup-symbol--projected { color: #b3801a; }
.lineup-symbol--out       { color: #b03636; }
.lineup-symbol--unknown   { color: #8a8a8a; }

.lineup-info {
  margin-bottom: 18px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: #fff;
}

.lineup-info > summary {
  padding: 10px 14px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.lineup-info__body {
  padding: 0 14px 12px;
  border-top: 1px solid #eee;
  color: #555;
  font-size: 13px;
  line-height: 1.55;
}

.lineup-info__body p {
  margin: 10px 0 0;
}

.lineup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.lineup-team {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  overflow: hidden;
}

.lineup-team__head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f8f8f8;
  border-bottom: 1px solid #eee;
}

.lineup-team__head img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.lineup-team__side {
  display: block;
  color: #777;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lineup-team__title strong {
  color: var(--ink-strong);
  font-size: 15px;
}

.lineup-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid #e0e0e0;
  border-radius: 999px;
  background: #fff;
  color: #555;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.lineup-status--confirmed { border-color: #bfe3cd; background: #f2fbf5; color: #1f6b3f; }
.lineup-status--projected { border-color: #ecdcb6; background: #fdf8ec; color: #8a6410; }

.lineup-goalie {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  padding: 11px 14px;
  border-bottom: 1px solid #f0f0f0;
}

.lineup-goalie__label {
  color: #777;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lineup-goalie__name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
}

.lineup-jersey {
  color: #888;
  font-size: 12px;
  font-weight: 500;
}

.lineup-unit-block {
  padding: 10px 14px 4px;
  border-bottom: 1px solid #f0f0f0;
}

.lineup-unit-block:last-child {
  border-bottom: none;
}

.lineup-unit-block__heading {
  margin: 0 0 6px;
  color: #777;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lineup-unit {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  padding: 5px 0;
}

.lineup-unit__label {
  color: #555;
  font-size: 12px;
  font-weight: 700;
}

.lineup-unit__players {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.lineup-unit__players li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lineup-unit__players a {
  color: var(--ink-strong);
  text-decoration: none;
}

.lineup-unit__players a:hover {
  text-decoration: underline;
}

.lineup-tag {
  padding: 1px 5px;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  color: #777;
  background: #fafafa;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lineup-tag--gtd {
  border-color: #ecdcb6;
  color: #8a6410;
  background: #fdf8ec;
}

.lineup-empty {
  margin: 0;
}

@media (max-width: 900px) {
  .lineup-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .lineup-legend,
  .lineup-info {
    margin-left: 12px;
    margin-right: 12px;
  }

  .boxscore-tabs {
    margin-left: 12px;
    margin-right: 12px;
  }

  .lineup-unit {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px;
  }
}
