.classement-page {
  --lb-text: #f5f5f5;
  --lb-muted: #9ca3af;
  --lb-border: #444;
  --lb-border-soft: #3b3b3b;
  --lb-surface: radial-gradient(circle at 10% -10%, rgba(59, 91, 167, 0.18), transparent 34%),
    radial-gradient(circle at 90% -5%, rgba(255, 203, 5, 0.1), transparent 28%),
    linear-gradient(180deg, #171717 0%, #121212 100%);
  --lb-card: #1a1a1a;
  --lb-accent: #ffcb05;
  width: min(1220px, 100% - 2rem);
  margin: 1rem auto 0;
  padding: 0 0 4.6rem;
  color: var(--lb-text);
  font-family: "Sora", "Segoe UI", sans-serif;
}

.classement-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at 10% -10%, rgba(59, 91, 167, 0.18), transparent 34%),
    radial-gradient(circle at 90% -5%, rgba(255, 203, 5, 0.1), transparent 28%),
    linear-gradient(180deg, #171717 0%, #121212 100%);
}

.leaderboard-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem 1rem;
  align-items: start;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  border: 2px solid var(--lb-border);
  background: #2a2a2a;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.35);
}

.leaderboard-hero__content {
  display: grid;
  gap: 0.34rem;
  align-content: center;
}

.leaderboard-kicker {
  margin: 0;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--lb-accent);
  font-weight: 700;
}

.leaderboard-hero h1 {
  margin: 0;
  font-family: "Oxanium", "Sora", sans-serif;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.08;
  letter-spacing: 0.02em;
}

.leaderboard-hero p {
  margin: 0;
  max-width: 54ch;
  color: var(--lb-muted);
  line-height: 1.45;
  font-size: 0.9rem;
}

.leaderboard-hero__panel {
  display: grid;
  gap: 0.55rem;
}

.leaderboard-mode-switch {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
  border-radius: 12px;
  border: 2px solid var(--lb-border-soft);
  background: #202020;
  padding: 0.4rem;
}

.leaderboard-mode-button {
  border: 2px solid #444;
  border-radius: 8px;
  background: #1a1a1a;
  color: #a4abb4;
  min-height: 36px;
  padding: 0.42rem 0.5rem;
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, background-color 0.16s ease;
}

.leaderboard-mode-button:hover {
  border-color: #ffcb05;
  color: #fff;
}

.leaderboard-mode-button.is-active {
  color: #101010;
  border-color: #ffcb05;
  background: #ffcb05;
}

.leaderboard-mode-button:focus-visible {
  outline: 2px solid rgba(255, 203, 5, 0.82);
  outline-offset: 2px;
}

.leaderboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.42rem;
}

.leaderboard-metric {
  border-radius: 10px;
  border: 1px solid #3b3b3b;
  background: #1a1a1a;
  padding: 0.46rem 0.54rem;
}

.leaderboard-metric span {
  display: block;
  font-size: 0.56rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
}

.leaderboard-metric strong {
  display: block;
  margin-top: 0.18rem;
  font-family: "Oxanium", "Sora", sans-serif;
  font-size: 0.94rem;
  line-height: 1;
  color: #f5f5f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.leaderboard-status {
  margin: 1rem 0 0;
  border-radius: 13px;
  border: 2px solid #444;
  background: #1a1a1a;
  color: #f5f5f5;
  padding: 0.74rem 0.9rem;
  font-size: 0.9rem;
}

.leaderboard-status.is-error {
  border-color: rgba(255, 134, 134, 0.54);
  background: rgba(102, 30, 36, 0.5);
  color: #ffd9d9;
}

.leaderboard-status.is-muted {
  border-color: rgba(255, 203, 5, 0.35);
  background: rgba(255, 203, 5, 0.12);
  color: #ffe8a3;
}

.leaderboard-table-shell {
  margin-top: 1rem;
  border-radius: 24px;
  border: 2px solid var(--lb-border);
  background: #2a2a2a;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.4);
  padding: 0.86rem;
  position: relative;
}

.leaderboard-table-shell::before {
  content: "";
  position: absolute;
  left: 1rem;
  right: 1rem;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 203, 5, 0.45), transparent);
}

.leaderboard-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.15rem 0.4rem 0.7rem;
  flex-wrap: nowrap;
}

.leaderboard-table-header h2 {
  margin: 0;
  font-family: "Oxanium", "Sora", sans-serif;
  font-size: clamp(1.28rem, 2.2vw, 1.6rem);
  line-height: 1;
  letter-spacing: 0.03em;
}

.leaderboard-table-header p {
  margin: 0;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9ca3af;
  white-space: nowrap;
}

.leaderboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.52rem;
}

.leaderboard-table th {
  text-align: left;
  padding: 0.28rem 0.75rem 0.5rem;
  color: #9ca3af;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}


.leaderboard-table td {
  text-align: left;
  padding: 0.78rem 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #1a1a1a;
}

.leaderboard-table td:first-child {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px 0 0 14px;
}

.leaderboard-table td:last-child {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 14px 14px 0;
}

.leaderboard-row {
  cursor: pointer;
  animation: leaderboard-row-in 0.42s ease both;
  animation-delay: calc(var(--row-index, 0) * 35ms);
}

.leaderboard-row:hover td {
  background: #242424;
  border-color: rgba(255, 203, 5, 0.35);
}

.leaderboard-row:focus-visible {
  outline: none;
}

.leaderboard-row:focus-visible td {
  border-color: rgba(255, 203, 5, 0.7);
  box-shadow: inset 0 0 0 1px rgba(255, 203, 5, 0.65);
}

.leaderboard-row.is-top-1 td {
  border-color: rgba(255, 213, 128, 0.56);
  background: linear-gradient(165deg, rgba(52, 42, 20, 0.8), rgba(20, 20, 20, 0.9));
}

.leaderboard-row.is-top-2 td {
  border-color: rgba(255, 255, 255, 0.26);
  background: linear-gradient(165deg, rgba(44, 44, 44, 0.78), rgba(20, 20, 20, 0.9));
}

.leaderboard-row.is-top-3 td {
  border-color: rgba(248, 176, 116, 0.42);
  background: linear-gradient(165deg, rgba(52, 37, 23, 0.78), rgba(20, 20, 20, 0.9));
}

.leaderboard-rank-cell {
  width: 84px;
}

.leaderboard-rank-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #1a1a1a;
  color: #c9cdd4;
  font-family: "Oxanium", "Sora", sans-serif;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  padding: 0.34rem 0.56rem;
}

.leaderboard-row.is-top-1 .leaderboard-rank-chip {
  border-color: rgba(255, 219, 132, 0.72);
  background: rgba(255, 214, 124, 0.2);
  color: #ffe8b4;
}

.leaderboard-row.is-top-2 .leaderboard-rank-chip {
  border-color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.12);
  color: #f5f5f5;
}

.leaderboard-row.is-top-3 .leaderboard-rank-chip {
  border-color: rgba(245, 186, 132, 0.66);
  background: rgba(245, 186, 132, 0.14);
  color: #ffe1ca;
}

.leaderboard-player-cell {
  min-width: 220px;
}

.leaderboard-player {
  display: flex;
  align-items: center;
  gap: 0.68rem;
  min-width: 0;
}

.leaderboard-player img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #1a1a1a;
  object-fit: cover;
}

.leaderboard-player > div {
  min-width: 0;
}

.leaderboard-player__name {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  max-width: 100%;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-player__presence {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.66rem;
  color: #9ca3af;
  line-height: 1.25;
}

.leaderboard-player__presence.is-online {
  color: #95f0bf;
}

.leaderboard-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #9ca3af;
  flex-shrink: 0;
}

.leaderboard-dot.is-online {
  background: #2de896;
  box-shadow: 0 0 10px rgba(45, 232, 150, 0.74);
}

.leaderboard-score-cell {
  min-width: 150px;
  width: 24%;
}

.leaderboard-score {
  display: inline-flex;
}

.leaderboard-score__value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  min-width: 88px;
  border-radius: 11px;
  border: 1px solid rgba(255, 203, 5, 0.38);
  background: rgba(255, 203, 5, 0.12);
  padding: 0.35rem 0.66rem;
  font-family: "Oxanium", "Sora", sans-serif;
  font-size: 0.98rem;
  line-height: 1;
  color: #ffe8a3;
}

.leaderboard-stat-cell {
  min-width: 94px;
  width: 11%;
}

.leaderboard-stat-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  min-width: 72px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #1a1a1a;
  padding: 0.32rem 0.58rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #f5f5f5;
  letter-spacing: 0.02em;
}


.leaderboard-empty-cell {
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: #1a1a1a;
  color: #c9cdd4;
  text-align: center;
  padding: 1.18rem 0.9rem;
  font-size: 0.9rem;
}

@media (max-width: 1040px) {
  .leaderboard-hero {
    grid-template-columns: 1fr;
  }

  .leaderboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .classement-page {
    width: min(1220px, 100% - 1.2rem);
    margin-top: 1rem;
  }

  .leaderboard-table-shell {
    padding: 0.68rem;
  }

  .leaderboard-score-cell {
    min-width: 120px;
  }
}

@media (max-width: 820px) {
  .leaderboard-mode-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .leaderboard-score-cell {
    min-width: 112px;
  }
}

@media (max-width: 620px) {
  .leaderboard-hero,
  .leaderboard-table-shell {
    border-radius: 20px;
  }

  .leaderboard-hero {
    padding: 0.86rem;
  }

  .leaderboard-mode-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .leaderboard-metrics {
    grid-template-columns: 1fr;
  }

  .leaderboard-table-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
}

@media (max-width: 520px) {
  .leaderboard-mode-switch {
    grid-template-columns: 1fr;
  }

  .leaderboard-table {
    border-spacing: 0 0.42rem;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding: 0.64rem;
  }

  .leaderboard-player img {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .leaderboard-player__presence {
    display: none;
  }

  .leaderboard-rank-chip {
    min-width: 48px;
    font-size: 0.84rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .leaderboard-row {
    animation: none;
  }

  .leaderboard-mode-button,
  .leaderboard-row {
    transition: none;
  }
}

@keyframes leaderboard-row-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
