:root {
  color-scheme: light dark;
}

.leaderboard-header {
  position: sticky;
  top: 0;
  z-index: 9;
  backdrop-filter: blur(12px);
  background: rgba(15, 27, 55, 0.85);
  border-bottom: 1px solid rgba(198, 162, 95, 0.25);
}

.leaderboard-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 0.5rem;
}

.leaderboard-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--cream);
  font-family: "Cormorant Garamond", "Times New Roman", serif;
  font-size: 1.25rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.leaderboard-brand img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(198, 162, 95, 0.35);
  padding: 0.25rem;
  background: rgba(27, 43, 85, 0.6);
}

.leaderboard-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.leaderboard-nav a {
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(246, 239, 230, 0.78);
  padding: 0.25rem 0;
}

.leaderboard-nav a:hover,
.leaderboard-nav a:focus-visible {
  color: var(--gold);
}

.leaderboard-hero__inner {
  display: grid;
  gap: clamp(2rem, 5vw, 3rem);
  align-items: center;
}

@media (min-width: 860px) {
  .leaderboard-hero__inner {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  }
}

.leaderboard-hero__content {
  display: grid;
  gap: 0.75rem;
  color: rgba(246, 239, 230, 0.88);
}

.leaderboard-hero__content h1 {
  font-size: clamp(2.2rem, 3vw + 1rem, 3.4rem);
  color: var(--cream);
}

.leaderboard-meta {
  margin: 0;
  padding: clamp(1.5rem, 3vw, 2rem);
  border-radius: 1.5rem;
  border: 1px solid rgba(198, 162, 95, 0.28);
  background: rgba(27, 43, 85, 0.55);
  display: grid;
  gap: 1rem;
}

.leaderboard-meta div {
  display: grid;
  gap: 0.25rem;
}

.leaderboard-meta dt {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(246, 239, 230, 0.68);
}

.leaderboard-meta dd {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--cream);
}

.leaderboard-panel {
  display: grid;
  gap: 1.5rem;
}

.leaderboard-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.leaderboard-panel__header h2 {
  margin: 0.25rem 0 0;
  font-size: clamp(1.8rem, 2vw + 1rem, 2.2rem);
}

.leaderboard-panel__status {
  margin: 0.75rem 0 0;
  color: rgba(15, 27, 55, 0.7);
  font-size: 0.95rem;
}

.leaderboard-panel__updated {
  margin: 0;
  color: rgba(15, 27, 55, 0.55);
  font-size: 0.85rem;
}

.section--light .leaderboard-panel__status,
.section--light .leaderboard-panel__updated {
  color: rgba(15, 27, 55, 0.62);
}

.leaderboard-table-wrapper {
  overflow-x: auto;
  border-radius: 1.2rem;
  border: 1px solid rgba(198, 162, 95, 0.24);
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  background: rgba(246, 239, 230, 0.96);
}

.leaderboard-table thead th {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-align: left;
  padding: 1rem 1.25rem;
  color: rgba(15, 27, 55, 0.7);
  background: rgba(198, 162, 95, 0.18);
  border-bottom: 1px solid rgba(198, 162, 95, 0.28);
}

.leaderboard-table tbody td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(198, 162, 95, 0.18);
  color: rgba(15, 27, 55, 0.86);
  vertical-align: top;
}

.leaderboard-table tbody tr:nth-child(odd) td {
  background: rgba(198, 162, 95, 0.08);
}

.leaderboard-table tbody tr:nth-child(even) td {
  background: rgba(246, 239, 230, 0.96);
}

.leaderboard-row--first td {
  font-weight: 600;
  position: relative;
}

.leaderboard-row--first td:first-child::before {
  content: "★";
  color: var(--gold);
  margin-right: 0.35rem;
}

.leaderboard-table tbody td:first-child {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
  color: rgba(15, 27, 55, 0.7);
}

.leaderboard-table tbody td:nth-child(n + 3) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.leaderboard-player-name {
  display: block;
  font-weight: 600;
  color: rgba(15, 27, 55, 0.88);
}

.leaderboard-player-note {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: rgba(15, 27, 55, 0.6);
}

.leaderboard-placeholder {
  padding: 2rem 1.5rem;
  text-align: center;
  color: rgba(15, 27, 55, 0.6);
}

.leaderboard-footer {
  margin-top: auto;
  padding: 2rem 0 3rem;
  border-top: 1px solid rgba(198, 162, 95, 0.25);
  background: rgba(15, 27, 55, 0.85);
  color: rgba(246, 239, 230, 0.75);
}

.leaderboard-footer p {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 640px) {
  .leaderboard-table {
    min-width: 520px;
  }

  .leaderboard-header__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .leaderboard-nav {
    justify-content: flex-start;
  }
}
