.league-page {
  line-height: normal;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

:where(.league-page) button {
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  min-height: 38px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 5px;
  padding: 7px 12px;
}

:where(.league-page) button:hover {
  background: #edf3f8;
  border-color: #b8c9db;
}

:where(.league-page) button:focus-visible,
:where(.league-page) svg circle:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

:where(.league-page) h1 {
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.045em;
  margin: 0;
  font-weight: 750;
}

:where(.league-page) h2 {
  font-size: 23px;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0;
}

:where(.league-page) .section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
}

:where(.league-page) .section-head p {
  color: var(--muted);
  font-size: 12px;
  margin: 7px 0 0;
}

:where(.league-page) .section-head .elo-note {
  margin: 0;
}

:where(.league-page) .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

:where(.league-page) .explorer {
  display: block;
}

:where(.league-page) .plot-area {
  min-width: 0;
  padding-bottom: 12px;
}

:where(.league-page) .plot-tools {
  padding: 18px 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

:where(.league-page) #chart-wrap {
  width: 100%;
  padding: 0 12px;
  min-height: 400px;
}

:where(.league-page) #chart {
  display: block;
  width: 100%;
  height: 420px;
  overflow: visible;
}

:where(.league-page) .inspection {
  background: #f8fafc;
  min-height: 93px;
  border-top: 1px solid var(--line);
  padding: 16px 22px;
  font-size: 12px;
  line-height: 1.65;
}

:where(.league-page) .inspection[hidden] {
  display: none;
}

:where(.league-page) .inspection-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

:where(.league-page) .inspection-head strong {
  font-size: 13px;
}

:where(.league-page) .inspection-head span {
  color: var(--muted);
}

:where(.league-page) .match-detail {
  display: inline-block;
  margin-right: 18px;
}

:where(.league-page) .inspection .rating {
  font-size: 15px;
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
}

:where(.league-page) .inspection .result-note {
  color: var(--muted);
}

:where(.league-page) .positive {
  color: #26704c !important;
}

:where(.league-page) .negative {
  color: #a14b45 !important;
}

:where(.league-page) #leaderboard {
  margin-top: 30px;
}

:where(.league-page) .table-scroll {
  overflow-x: auto;
  position: relative;
}

:where(.league-page) .elo-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  table-layout: fixed;
  min-width: 900px;
}

:where(.league-page) .elo-table th,
:where(.league-page) .elo-table td {
  width: auto;
  min-width: 0;
  padding: 12px 20px;
  white-space: nowrap;
  text-align: right;
  font-size: 12px;
}

:where(.league-page) .elo-table th {
  background: #f8fafc;
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.055em;
}

:where(.league-page) .elo-table td {
  border-top: 1px solid #e8edf2;
  vertical-align: top;
}

:where(.league-page) .elo-table th:first-child,
:where(.league-page) .elo-table td:first-child {
  text-align: left;
}

:where(.league-page) .elo-table td:first-child {
  color: var(--muted);
  width: 65px;
}

:where(.league-page) .elo-table th:nth-child(2),
:where(.league-page) .elo-table td:nth-child(2) {
  text-align: left;
}

:where(.league-page) .elo-table td:nth-child(2) {
  width: 40%;
  font-size: 13px;
}

:where(.league-page) .elo-table th:nth-child(1) {
  width: 12%;
}

:where(.league-page) .elo-table th:nth-child(2) {
  width: 32%;
}

:where(.league-page) .elo-table th:nth-child(3),
:where(.league-page) .elo-table th:nth-child(5),
:where(.league-page) .elo-table th:nth-child(6) {
  width: 10%;
}

:where(.league-page) .elo-table th:nth-child(4) {
  width: 14%;
}

:where(.league-page) .elo-table th:nth-child(7) {
  width: 12%;
}

:where(.league-page) .elo-table td:nth-child(3) {
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

:where(.league-page) .elo-table .swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  margin-right: 9px;
}

:where(.league-page) .player-trophies {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 0.6em;
}

:where(.league-page) .pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

:where(.league-page) .pagination > div {
  display: flex;
  gap: 8px;
}

:where(.league-page) .pagination button:disabled {
  opacity: 0.4;
  cursor: default;
  background: white;
}

:where(.league-page) .refresh-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

:where(.league-page) .refresh-tools button {
  font-size: 12px;
  min-height: 36px;
  min-width: 104px;
}

:where(.league-page) .refresh-tools span {
  font-size: 11px;
  color: var(--muted);
}

:where(.league-page) .store-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

:where(.league-page) .store-filter .refresh-tools {
  margin-left: auto;
}

:where(.league-page) .sr-only {
  padding: 0;
  margin: -1px;
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  :where(.league-page) button {
    min-height: 44px;
  }
  :where(.league-page) h2 {
    font-size: 21px;
  }
  :where(.league-page) .section-head {
    align-items: flex-start;
  }
  :where(.league-page) .plot-tools {
    padding: 14px 12px 0;
    gap: 8px;
  }
  :where(.league-page) #chart-wrap {
    padding: 0 4px;
    min-height: 350px;
  }
  :where(.league-page) #chart {
    height: 365px;
  }
  :where(.league-page) .inspection {
    padding: 14px;
    min-height: 106px;
  }
  :where(.league-page) #leaderboard {
    margin-top: 24px;
  }
  :where(.league-page) .elo-table th,
  :where(.league-page) .elo-table td {
    padding: 12px;
  }
  :where(.league-page) .elo-table {
    min-width: 640px;
  }
  :where(.league-page) .elo-table .swatch {
    display: none;
  }
  /* Keep rank, player and Elo visible together on narrow phones. */
  :where(.league-page) .elo-table th:nth-child(1) {
    width: 44px;
  }
  :where(.league-page) .elo-table th:first-child,
  :where(.league-page) .elo-table td:first-child {
    padding-inline: 8px;
  }
  :where(.league-page) .elo-table th:nth-child(2) {
    width: 160px;
  }
  :where(.league-page) .elo-table th:nth-child(3) {
    width: 76px;
  }
  :where(.league-page) .elo-table th:nth-child(4) {
    width: 104px;
  }
  :where(.league-page) .elo-table th:nth-child(n + 5) {
    width: auto;
  }
  :where(.league-page) .elo-table td:nth-child(2) {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  :where(.league-page) .player-trophies {
    max-width: 100%;
    flex-wrap: wrap;
    margin-left: 0;
  }
  :where(.league-page) .player-trophies:empty {
    display: none;
  }
  :where(.league-page) .pagination {
    padding: 12px;
  }
  :where(.league-page) .refresh-tools button {
    min-height: 44px;
  }
  :where(.league-page) .refresh-tools {
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .league-page {
    scroll-behavior: auto;
  }
}
