/* Records, figure tables and league leaders share fixed numeric columns. */
.club-statistics,
.club-records {
  min-width: 0;
}
.club-statistics > .scene-section-heading,
.club-records > .scene-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 16px;
}
.stats-period {
  display: block;
  font-size: var(--ui-label, 11px);
  color: var(--dim);
  margin-top: 4px;
}
.stats-scope {
  flex: none;
  gap: 8px;
}
.club-stats-tabs {
  margin-top: 12px;
}
.stats-table-scroll {
  overflow: auto;
  max-width: 100%;
  border: 1px solid var(--edge);
  margin: 12px 0 16px;
  background: var(--navy);
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.stats-table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--ui-body, 13px);
  font-variant-numeric: tabular-nums;
}
.stats-table-scroll caption {
  text-align: left;
  padding: 12px;
  font-weight: 700;
  color: var(--cream);
  background: var(--panel);
}
:is(.club-statistics, .position-records) .stats-table-scroll caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  clip-path: inset(50%);
  overflow: hidden;
}
.stats-table-scroll :is(th, td) {
  text-align: right;
  padding: 8px 10px;
  border-bottom: 1px solid var(--edge);
  white-space: nowrap;
}
.stats-table-scroll thead th {
  color: var(--dim);
  font-size: var(--ui-label, 11px);
  font-weight: 650;
  height: 38px;
}
.stats-table-scroll abbr {
  text-decoration: none;
}
.club-statistics .stats-table-scroll thead th {
  padding: 0;
}
.stat-sort {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.stats-table-scroll th:first-child .stat-sort {
  justify-content: flex-start;
}
.stat-sort-icon {
  flex: none;
  opacity: 0.5;
}
.stats-table-scroll [aria-sort] .stat-sort {
  color: var(--gold);
}
.stats-table-scroll [aria-sort] .stat-sort-icon {
  opacity: 1;
}
.stat-sort:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -3px;
}
.stats-table-scroll th:first-child {
  text-align: left;
  min-width: 136px;
}
.stats-table-scroll tbody th:first-child {
  position: sticky;
  left: 0;
  padding-block: 0;
  background: var(--navy);
}
.stats-table-scroll th small,
.stats-table-scroll td small {
  display: block;
  font-size: var(--ui-label, 11px);
  font-weight: 450;
  color: var(--dim);
  white-space: normal;
  margin-top: 3px;
}
.stat-player {
  width: 100%;
  max-width: 156px;
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--cream);
  font-size: var(--ui-body, 13px);
  font-weight: 650;
  line-height: 1.3;
  text-align: left;
  white-space: normal;
}
.stats-help {
  border-top: 1px solid var(--edge);
  margin-top: 16px;
}
.stats-help > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  font-size: var(--ui-label, 11px);
  color: var(--dim);
  cursor: pointer;
  list-style: none;
}
.stats-help > summary::-webkit-details-marker {
  display: none;
}
.stats-help > summary::after {
  content: '+';
  color: var(--gold);
  font-size: var(--type-name);
}
.stats-help[open] > summary::after {
  content: '−';
}
.stats-help dl {
  display: grid;
  gap: 7px;
  margin: 0 0 12px;
  font-size: var(--ui-label, 11px);
}
.stats-help dl > div {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
}
.stats-help dd {
  margin: 0;
  color: var(--dim);
}
.record-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 24px;
}
.record-cards > div {
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: start;
  min-width: 0;
  min-height: 104px;
  padding: 12px;
  border: 1px solid var(--edge);
  background: var(--navy);
}
.record-cards dt,
.record-cards small {
  font-size: var(--ui-label, 11px);
  color: var(--dim);
}
.record-cards dd {
  font-size: var(--type-number);
  font-weight: 800;
  line-height: 1.2;
  color: var(--gold);
  margin: 7px 0;
  font-variant-numeric: tabular-nums;
}
.record-cards small {
  overflow-wrap: anywhere;
  line-height: 1.3;
}
.position-records .stats-table-scroll th:first-child {
  min-width: 44px;
}
.position-records .stats-table-scroll td:nth-child(2) {
  text-align: left;
}
.heritage-titles {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 4px 0 12px;
}
.heritage-titles > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--edge);
  background: var(--navy);
  color: var(--gold);
  font-size: var(--ui-label, 11px);
}
.heritage-innings {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-block: 8px;
  font-size: var(--ui-body, 13px);
}
.heritage-innings strong {
  margin-left: auto;
  color: var(--gold);
  font-size: var(--type-title);
}
.heritage-innings small,
.franchise-history p {
  font-size: var(--ui-label, 11px);
  color: var(--dim);
}
.franchise-history p {
  margin: 8px 0 12px;
}
.league-stats-coverage {
  margin: 0 0 12px;
  font-size: var(--ui-label, 11px);
  color: var(--dim);
}
.league-cap-lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.league-leaderboard {
  min-width: 0;
}
.league-leaderboard > h3 {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--gold);
}
.league-leaderboard.bowling > h3 {
  color: var(--purple);
}
.league-leaderboard > h3 > span {
  font-size: var(--ui-label, 11px);
  font-weight: 500;
  color: var(--dim);
  text-align: right;
}
.league-cap {
  flex: none;
}
.league-leaders {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--edge);
}
.league-leader {
  display: grid;
  grid-template-columns: 16px 30px minmax(0, 1fr) 62px;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--edge);
  background: var(--navy);
  min-width: 0;
}
.league-leader:last-child {
  border-bottom: 0;
}
.league-leader.cap-holder {
  box-shadow: inset 3px 0 var(--gold);
}
.leader-rank {
  font-size: var(--ui-label, 11px);
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.leader-player {
  min-width: 0;
}
.leader-player > strong {
  display: block;
  font-size: var(--ui-body, 13px);
  line-height: 1.3;
  font-weight: 700;
  color: var(--cream);
  overflow-wrap: anywhere;
}
.leader-player > .team-name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--ui-label, 11px);
  line-height: 1.3;
  color: var(--dim);
  margin-top: 3px;
}
.leader-player .team-badge {
  width: 16px;
  height: 19px;
  flex: none;
}
.leader-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 8px;
  margin: 5px 0 0;
  color: var(--dim);
  font-size: var(--type-caption);
  line-height: 1.4;
}
.leader-metrics > div {
  display: flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}
.leader-metrics dt {
  font-weight: 400;
}
.leader-metrics dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  color: var(--cream);
}
.leader-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  color: var(--gold);
  font-size: var(--type-number);
  line-height: 1.15;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.leader-total > small {
  display: block;
  font-size: var(--ui-label, 11px);
  font-weight: 500;
  color: var(--dim);
  margin-top: 4px;
}
.league-stats-help {
  margin-top: 16px;
}
.league-stats-help summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  font-size: var(--ui-label, 11px);
  color: var(--dim);
}
@container game (max-width:700px) {
  .record-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .league-cap-lists {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  #game-frame .league-screen .section-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
