.leaderboard-stage {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: 100vh;
}

.lb-wrap {
  position: relative;
  z-index: 3;
  padding: 26px 20px;
  /* narrower content area so player list doesn't span too wide */
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lb-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.lb-table {
  /* Allow the table to scroll when there are many rows */
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  display: block;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(10,10,10,0.64), rgba(12,12,12,0.54));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.02);
  /* control row heights */
  --lb-row-h: 48px;
  --lb-head-h: 56px;
}

.lb-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.lb-sub-dot {
  padding: 0 6px;
  opacity: 0.8;
}

.lb-pager {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 12px;
  flex-shrink: 0;
}

.lb-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--white);
  text-decoration: none;
  user-select: none;
  flex-shrink: 0;
}
.lb-btn:hover {
  border-color: rgba(255, 255, 255, 0.18);
}
.lb-btn.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.lb-row {
  display: grid;
  grid-template-columns: 90px 1fr 120px;
  gap: 14px;
  padding: 12px 14px;
  height: var(--lb-row-h, 48px);
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.lb-table .lb-head {
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(0,0,0,0.45);
}

.lb-table a.lb-row {
  display: grid;
  grid-template-columns: 90px 1fr 120px;
  gap: 14px;
  padding: 12px 14px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  height: var(--lb-row-h, 48px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.lb-table a.lb-row:hover {
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.2s ease;
}

/* Custom thin scrollbar for WebKit */
.lb-table::-webkit-scrollbar {
  width: 12px;
}
.lb-table::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.25);
}
.lb-table::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border-radius: 10px;
  border: 2px solid rgba(0,0,0,0.25);
  background-clip: padding-box;
}

.lb-head {
  padding: 14px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  color: var(--text-secondary);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  height: var(--lb-head-h);
  display: grid;
  grid-template-columns: 90px 1fr 120px;
  gap: 14px;
  align-items: center;
}

.rank-pill {
  display: inline-flex;
  min-width: 44px;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 700;
  font-size: 12px;
  color: var(--white);
}

.c-player {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.lb-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  overflow: hidden;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.06);
}
.lb-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lb-avatar-fallback {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
}

.lb-name {
  min-width: 0;
}
.lb-nick {
  font-weight: 700;
  font-size: 13px;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-sid {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.c-mmr {
  text-align: right;
}
.mmr {
  font-family: 'Silkscreen', sans-serif;
  color: var(--red-bright);
  letter-spacing: 0.04em;
}

.lb-empty {
  padding: 18px 14px;
  color: var(--text-tertiary);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 900px) {
  .lb-wrap {
    padding: 18px;
  }
  .lb-row {
    grid-template-columns: 70px 1fr 90px;
  }
  .lb-head {
    grid-template-columns: 70px 1fr 90px;
  }
  .lb-table a.lb-row {
    grid-template-columns: 70px 1fr 90px;
  }
}

@media (max-width: 640px) {
  .leaderboard-stage {
    align-items: stretch;
  }
  
  .lb-wrap {
    padding: 14px;
    margin: 0;
  }

  .lb-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .lb-pager {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Rank Badge Styles */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  margin-right: 8px;
  text-transform: uppercase;
  vertical-align: middle;
  flex-shrink: 0;
  position: relative;
  top: -2px;
}

/* E Rank - Салатовый (Light Green) */
.rank-badge.rank-e {
  color: #7dff00;
}

/* D Rank - Зелёный (Green) */
.rank-badge.rank-d {
  color: #00cc00;
}

/* C Rank - Жёлтый (Yellow) */
.rank-badge.rank-c {
  color: #ffdd00;
}

/* B Rank - Оранжевый (Orange) */
.rank-badge.rank-b {
  color: #ff8c00;
}

/* A Rank - Красный (Red) - Highest */
.rank-badge.rank-a {
  color: #ff3333;
}













