/* ===== Leaderboard ===== */

.lb-page {
  position: relative;
  min-height: calc(100vh - 2.5rem - 58px);
  overflow: auto;
  color: var(--ink);
}

.lb-page__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.35;
  filter: saturate(0.85) contrast(1.05) brightness(0.7);
}

.lb-page__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(7, 7, 8, 0.94) 0%, rgba(7, 7, 8, 0.82) 45%, rgba(7, 7, 8, 0.7) 100%),
    radial-gradient(700px 360px at 20% 0%, rgba(124, 58, 237, 0.12), transparent 55%);
}

.lb-page__inner {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 1.1rem;
  padding: clamp(1rem, 2.5vw, 1.75rem);
  max-width: 820px;
  margin: 0 auto;
}

.lb-head {
  display: grid;
  gap: 0.35rem;
}

.lb-tabs,
.lb-subs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.lb-tabs__btn,
.lb-subs__btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.lb-tabs__btn.is-on,
.lb-subs__btn.is-on {
  border-color: rgba(124, 58, 237, 0.55);
  background: rgba(124, 58, 237, 0.14);
}

.lb-subs__btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.92rem;
}

.lb-notice {
  margin: 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.95rem;
}

.lb-table-wrap {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
}

.lb-table th,
.lb-table td {
  padding: 0.75rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.lb-table th {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.03);
}

.lb-table tr:last-child td {
  border-bottom: 0;
}

.lb-rank {
  width: 3rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
}

.lb-score {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lb-empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  padding: 1.5rem !important;
}

.lb-row--top1 .lb-rank {
  color: #e8c76a;
}
.lb-row--top2 .lb-rank {
  color: #c8d0dc;
}
.lb-row--top3 .lb-rank {
  color: #c9956a;
}

.lb-row--me {
  background: rgba(124, 58, 237, 0.1);
}

.lb-you {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e8c76a;
}

.lb-me-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(124, 58, 237, 0.35);
  background: rgba(124, 58, 237, 0.08);
}

.lb-actions {
  display: flex;
  gap: 0.5rem;
}

@media (max-width: 640px) {
  .lb-table th:nth-child(3),
  .lb-table td:nth-child(3) {
    text-align: right;
  }

  .lb-me-card {
    flex-direction: column;
    align-items: flex-start;
  }
}
