html.leaderboard-root {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

.leaderboard-page .top-nav a.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.95), rgba(118, 75, 162, 0.92));
  box-shadow: 0 8px 22px rgba(116, 94, 232, 0.45);
}

.leaderboard-main {
  margin-top: 28px;
  margin-bottom: 42px;
}

.leaderboard-hero {
  border: 1px solid rgba(121, 171, 246, 0.34);
  border-radius: 22px;
  padding: 30px 28px;
  background:
    radial-gradient(900px 320px at 100% -10%, rgba(37, 99, 235, 0.3), transparent 64%),
    radial-gradient(760px 260px at 0% 120%, rgba(56, 189, 248, 0.16), transparent 65%),
    linear-gradient(145deg, rgba(6, 23, 66, 0.94), rgba(8, 44, 112, 0.92));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

.leaderboard-hero h1 {
  margin: 0;
  font: 800 clamp(1.8rem, 3vw, 2.7rem)/1.12 "Manrope", "Segoe UI", sans-serif;
  color: #f5f1ff;
}

.leaderboard-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.leaderboard-hero p {
  margin: 10px 0 0;
  color: #c8dcfb;
  font-size: 1rem;
  line-height: 1.45;
}

.leaderboard-filters {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.leaderboard-metrics {
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.leaderboard-filter-btn {
  border: 1px solid rgba(121, 171, 246, 0.52);
  border-radius: 999px;
  background: rgba(9, 9, 16, 0.58);
  color: #f3ebff;
  font: 700 0.95rem/1 "Manrope", "Segoe UI", sans-serif;
  padding: 11px 16px;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.leaderboard-filter-btn:hover {
  border-color: rgba(157, 202, 255, 0.78);
  transform: translateY(-1px);
}

.leaderboard-filter-btn.active {
  border-color: rgba(157, 202, 255, 0.7);
  background: linear-gradient(135deg, rgba(44, 127, 255, 0.94), rgba(31, 97, 214, 0.9));
  box-shadow: 0 10px 26px rgba(38, 109, 226, 0.42);
}

.leaderboard-table-shell {
  margin-top: 16px;
  border: 1px solid rgba(122, 157, 215, 0.28);
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(5, 11, 24, 0.92), rgba(5, 9, 18, 0.96));
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.35);
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  color: #edf4ff;
  font-family: "Manrope", "Segoe UI", sans-serif;
}

.leaderboard-table thead th {
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  color: #b5c8eb;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(122, 157, 215, 0.32);
  background: rgba(7, 15, 31, 0.92);
  padding: 14px 16px;
}

.leaderboard-table .col-rank {
  width: 68px;
}

.leaderboard-table .col-views {
  width: 180px;
  text-align: right;
}

.leaderboard-table tbody tr {
  border-bottom: 1px solid rgba(95, 125, 182, 0.2);
}

.leaderboard-table tbody tr:last-child {
  border-bottom: none;
}

.leaderboard-table tbody tr.rank-1 {
  background: linear-gradient(90deg, rgba(250, 204, 21, 0.14), rgba(250, 204, 21, 0.02));
}

.leaderboard-table tbody tr.rank-2 {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.16), rgba(148, 163, 184, 0.03));
}

.leaderboard-table tbody tr.rank-3 {
  background: linear-gradient(90deg, rgba(251, 146, 60, 0.13), rgba(251, 146, 60, 0.02));
}

.rank-cell {
  font-size: 1.3rem;
  font-weight: 800;
  color: #f4f8ff;
  padding: 14px 16px;
}

.profile-cell {
  padding: 10px 16px;
}

.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.avatar-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(176, 198, 236, 0.3);
  background: rgba(28, 37, 53, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
}

.avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-fallback {
  color: #cddaf2;
  font-size: 1rem;
  font-weight: 800;
}

.meta {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.display-name {
  font-size: 1.08rem;
  font-weight: 800;
  color: #f5f8ff;
}

.display-name-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.premium-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 1;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.premium-mark-icon {
  width: 1.2em;
  height: 1.2em;
  display: block;
  object-fit: contain;
}

.leaderboard-table tbody tr.rank-1 .display-name {
  color: #facc15;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.38), 0 0 22px rgba(234, 179, 8, 0.24);
}

.leaderboard-table tbody tr.rank-2 .display-name {
  color: #dbe7ff;
  text-shadow: 0 0 10px rgba(219, 231, 255, 0.34), 0 0 20px rgba(147, 197, 253, 0.2);
}

.leaderboard-table tbody tr.rank-3 .display-name {
  color: #fdba74;
  text-shadow: 0 0 10px rgba(253, 186, 116, 0.36), 0 0 20px rgba(251, 146, 60, 0.22);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .leaderboard-table tbody tr.rank-1 .display-name {
    background: linear-gradient(106deg, #fff4c9 0%, #fde68a 48%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.32));
  }

  .leaderboard-table tbody tr.rank-2 .display-name {
    background: linear-gradient(106deg, #f8fbff 0%, #dbeafe 52%, #93c5fd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 0 8px rgba(186, 230, 253, 0.28));
  }

  .leaderboard-table tbody tr.rank-3 .display-name {
    background: linear-gradient(106deg, #fff1e4 0%, #fdba74 48%, #f97316 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 0 8px rgba(253, 186, 116, 0.28));
  }
}

.username {
  font-size: 0.9rem;
  color: #9db2d7;
}

.views-cell {
  padding: 14px 16px;
  text-align: right;
  font-size: 1.28rem;
  font-weight: 800;
  color: #e9f4ff;
  white-space: nowrap;
}

.empty-cell {
  padding: 26px 16px;
  text-align: center;
  color: #a6bddf;
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  .leaderboard-table {
    table-layout: fixed;
  }

  .leaderboard-table .col-rank {
    width: 52px;
  }

  .leaderboard-table .col-views {
    width: 104px;
  }

  .leaderboard-main {
    margin-top: 18px;
  }

  .leaderboard-hero {
    padding: 20px 16px;
    border-radius: 16px;
  }

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

  .leaderboard-metrics {
    margin-top: 8px;
    justify-content: flex-start;
  }

  .leaderboard-table thead th {
    padding: 12px 10px;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
  }

  .rank-cell {
    padding: 12px 10px;
    font-size: 1.1rem;
  }

  .profile-cell {
    padding: 10px;
  }

  .profile-link {
    gap: 8px;
    min-width: 0;
  }

  .avatar-wrap {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .display-name {
    font-size: 0.95rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .premium-mark {
    flex-basis: auto;
  }

  .premium-mark-icon {
    width: 1.1em;
    height: 1.1em;
  }

  .username {
    font-size: 0.8rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .meta {
    min-width: 0;
    width: 100%;
  }

  .views-cell {
    padding: 12px 10px;
    font-size: 1rem;
  }
}

@media (max-width: 520px) {
  .leaderboard-table .col-rank {
    width: 44px;
  }

  .leaderboard-table .col-views {
    width: 84px;
  }

  .leaderboard-table thead th {
    padding: 11px 8px;
    font-size: 0.64rem;
    letter-spacing: 0.03em;
  }

  .rank-cell {
    padding: 11px 8px;
    font-size: 1rem;
  }

  .profile-cell {
    padding: 9px 8px;
  }

  .views-cell {
    padding: 11px 8px;
    font-size: 0.92rem;
  }
}
