/* ================= Levels & ranks ================= */
.tier-rookie { --tier: #a3b1a8; }
.tier-amateur { --tier: #60a5fa; }
.tier-semipro { --tier: #34d399; }
.tier-pro { --tier: #a78bfa; }
.tier-elite { --tier: #fb7185; }
.tier-legend { --tier: #fbbf24; }

/* header badge */
.lvl-badge {
  display: inline-flex; align-items: center; gap: .4rem; height: 32px; padding: 0 .65rem 0 .25rem;
  border-radius: 9px; text-decoration: none; color: var(--text);
  background: color-mix(in srgb, var(--tier) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--tier) 40%, transparent);
  font-size: .8rem; font-weight: 600; white-space: nowrap;
}
.lvl-badge b {
  min-width: 24px; height: 24px; padding: 0 4px; border-radius: 6px; display: grid; place-items: center;
  background: var(--tier); color: #0b120e; font-size: .78rem; font-variant-numeric: tabular-nums;
}
.lvl-badge span { color: var(--tier); }
.lvl-badge:hover { border-color: var(--tier); }

/* rank card */
.rank-card {
  display: flex; align-items: center; gap: 1rem; text-decoration: none; color: var(--text);
  border-left: 3px solid var(--tier) !important;
}
.rank-card:hover { border-color: color-mix(in srgb, var(--tier) 60%, transparent); }
.rank-emblem {
  width: 64px; height: 64px; flex: none; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--tier) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--tier) 45%, transparent);
}
.rank-emblem b { font-size: 1.6rem; line-height: 1; color: var(--tier); font-variant-numeric: tabular-nums; }
.rank-emblem small { font-size: .6rem; font-weight: 700; letter-spacing: .12em; color: var(--muted); margin-top: 3px; }
.rank-main { flex: 1; min-width: 0; }
.rank-top { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.rank-name { font-size: 1.15rem; color: var(--tier); }
.rank-top b:not(.rank-name) { color: var(--text); }
.rank-sub { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-top: .35rem; }
.rank-sub b { color: var(--text); }

.xp-bar { height: 8px; margin-top: .5rem; border-radius: 4px; overflow: hidden; background: rgba(255, 255, 255, .08); }
.xp-bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--tier); transition: width .6s ease; }

/* leaderboard & tables */
.lvl-pill {
  display: inline-grid; place-items: center; min-width: 28px; height: 22px; padding: 0 6px; border-radius: 6px;
  font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--tier); background: color-mix(in srgb, var(--tier) 14%, transparent);
}
.tier-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--tier); margin-right: .35rem; vertical-align: middle; }
.xp-rules { margin: 0; padding-left: 1.1rem; line-height: 1.8; }
.xp-rules b { color: var(--text); }

@media (max-width: 520px) {
  .lvl-badge span { display: none; }
  .lvl-badge { padding-right: .25rem; }
  .rank-emblem { width: 52px; height: 52px; }
  .rank-emblem b { font-size: 1.3rem; }
}
