/* Niemandsland — Rangliste (/leaderboard).
   Handcrafted Obsidian / brass UI in the spirit of profile.css, wiki.css and
   faq.css: hex values throughout, because Tailwind 4 strips unused @theme
   tokens from app.css. Every value the page shows is counted server-side in
   StatsService::leaderboard(); the stylesheet only dresses it. */

.lb-page {
  --lb-gold: #d9b65c;
  --lb-gold-soft: #e6cd8a;
  --lb-gold-dim: #82662c;
  --lb-brass: #c8a24a;
  --lb-ink: #0e0e12;
  --lb-panel: #131318;
  --lb-panel-2: #1a1a21;
  --lb-line: #24242d;
  --lb-line-soft: #c8a24a2e;
  --lb-muted: #a29d94;
  --lb-faint: #6d6862;
  --lb-tint: #c8a24a;
  --lb-win: #8a9a6a;
  --lb-draw: #a29d94;
  --lb-loss: #cd7d4c;
  min-width: 0;
  padding: 12px 0 34px;
  color-scheme: dark;
}

.lb-page *,
.lb-page *::before,
.lb-page *::after {
  box-sizing: border-box;
}

.lb-page [hidden] {
  display: none !important;
}

.lb-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── Icons ────────────────────────────────────────────────────────────── */

.lb-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
}

.lb-icon svg {
  width: 100%;
  height: 100%;
}

.lb-icon--xs { width: 13px; height: 13px; }
.lb-icon--sm { width: 16px; height: 16px; }
.lb-icon--md { width: 19px; height: 19px; }
.lb-icon--lg { width: 24px; height: 24px; }
.lb-icon--xl { width: 34px; height: 34px; }

/* ── Page head ────────────────────────────────────────────────────────── */

.lb-crest-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 18px;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--lb-faint);
}

.lb-crest-line::after {
  content: "";
  height: 1px;
  flex: 1 1 60px;
  max-width: 220px;
  background: linear-gradient(90deg, #c8a24a3d, #0000);
}

.lb-crest-line-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lb-crest-line-item .lb-icon {
  color: #8d877e;
}

.lb-crest-line a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--lb-muted);
  transition: color .2s ease;
}

.lb-crest-line a:hover {
  color: var(--lb-gold-soft);
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.lb-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 40px;
  padding: 32px 36px;
  border: 1px solid var(--lb-line-soft);
  border-radius: 20px;
  background:
    radial-gradient(120% 170% at 0% 0%, #c8a24a12, #0000 56%),
    radial-gradient(90% 170% at 100% 120%, #c8a24a0a, #0000 62%),
    linear-gradient(140deg, #1a191d, #0c0c10 62%);
  box-shadow: 0 28px 74px -48px #000, inset 0 1px #ffffff08;
}

.lb-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(#ffffff05 1px, #0000 1px) 0 0 / 34px 34px,
    linear-gradient(90deg, #ffffff04 1px, #0000 1px) 0 0 / 34px 34px;
  -webkit-mask-image: radial-gradient(90% 130% at 12% 18%, #000, #0000 72%);
  mask-image: radial-gradient(90% 130% at 12% 18%, #000, #0000 72%);
}

.lb-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(#c8a24a06 1px, #0000 1px) 0 0 / 100% 32px;
  -webkit-mask-image: linear-gradient(#000, #0000 62%);
  mask-image: linear-gradient(#000, #0000 62%);
}

.lb-hero-art {
  position: absolute;
  inset: 0 0 0 auto;
  width: 58%;
  z-index: 0;
  pointer-events: none;
  /* Rebuild with tools/build-hero-art.php; a changed image needs a new -vN name (immutable cache). */
  background: url("../img/leaderboard-hero-command-map-v1-1024.webp") center right / cover no-repeat;
  opacity: .64;
  -webkit-mask-image:
    linear-gradient(90deg, #0000, #000 42%),
    linear-gradient(180deg, #0000, #000 12%, #000 88%, #0000);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(90deg, #0000, #000 42%),
    linear-gradient(180deg, #0000, #000 12%, #000 88%, #0000);
  mask-composite: intersect;
}

.lb-hero-rail {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
}

.lb-hero-rail::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 -30%;
  width: 26%;
  background: linear-gradient(90deg, #0000, #e6cd8ad9, #0000);
  animation: lb-rail-sweep 9s ease-in-out infinite;
}

@keyframes lb-rail-sweep {
  0%, 100% { transform: translateX(-40%); opacity: 0; }
  8% { opacity: 1; }
  55% { transform: translateX(480%); opacity: 1; }
  70% { transform: translateX(520%); opacity: 0; }
}

/* ── Emblem (animated rank insignia) ──────────────────────────────────── */

.lb-emblem {
  position: relative;
  order: 1;
  justify-self: start;
  width: 196px;
  height: 196px;
  flex: none;
  z-index: 1;
}

.lb-emblem-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.lb-ring-outer,
.lb-ring-inner,
.lb-tick-ring,
.lb-sweep,
.lb-orbit-dot {
  transform-origin: 100px 100px;
}

.lb-ring-outer {
  fill: #c8a24a08;
  stroke: #c8a24a8c;
  stroke-width: 1;
  stroke-dasharray: 3 7;
  animation: lb-spin 46s linear infinite;
}

.lb-ring-inner {
  fill: none;
  stroke: #c8a24a52;
  stroke-width: 1;
  stroke-dasharray: 14 6 4 6;
  animation: lb-spin-rev 32s linear infinite;
}

.lb-tick-ring line {
  stroke: #c8a24a9e;
  stroke-width: 1.4;
}

.lb-tick-ring line:nth-child(4n + 1) {
  stroke: #e6cd8a;
  stroke-width: 1.9;
}

.lb-tick-ring {
  animation: lb-spin 90s linear infinite;
}

.lb-sweep {
  animation: lb-spin 7.5s linear infinite;
}

.lb-sweep path {
  fill: url(#lb-sweep-grad);
}

.lb-orbit-dot {
  animation: lb-spin 11s linear infinite;
}

.lb-orbit-dot circle {
  fill: var(--lb-gold-soft);
  filter: drop-shadow(0 0 5px #d9b65c99);
}

.lb-shield {
  fill: #131318;
  stroke: url(#lb-brass-grad);
  stroke-width: 1.9;
  stroke-linejoin: round;
}

.lb-shield-rim {
  fill: none;
  stroke: #c8a24a47;
  stroke-width: .9;
  stroke-linejoin: round;
}

.lb-shield-bar {
  stroke: #c8a24a2e;
  stroke-width: 1;
}

.lb-podium-mark {
  fill: none;
  stroke: url(#lb-brass-grad);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: lb-bars-rise 4.4s ease-in-out infinite;
}

.lb-podium-mark--mid {
  animation-delay: .55s;
}

.lb-podium-mark--low {
  animation-delay: 1.1s;
}

@keyframes lb-bars-rise {
  0%, 100% { opacity: .82; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2.5px); }
}

.lb-laurel {
  fill: none;
  stroke: #c8a24ac7;
  stroke-width: 2;
  stroke-linecap: round;
}

.lb-laurel-leaf {
  fill: #c8a24a33;
  stroke: #c8a24a9e;
  stroke-width: 1;
}

.lb-laurel-l,
.lb-laurel-r {
  animation: lb-laurel-breathe 5.2s ease-in-out infinite;
}

.lb-laurel-r { animation-delay: 2.6s; }

@keyframes lb-laurel-breathe {
  0%, 100% { opacity: .72; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

.lb-crown {
  fill: #c8a24a2b;
  stroke: url(#lb-brass-grad);
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.lb-crown-gem {
  fill: #e6cd8a;
  filter: drop-shadow(0 0 4px #d9b65ccc);
  animation: lb-star-twinkle 3.2s ease-in-out infinite;
}

@keyframes lb-star-twinkle {
  0%, 100% { opacity: .45; transform: scale(.82); }
  50% { opacity: 1; transform: scale(1.14); }
}

.lb-chevron {
  fill: none;
  stroke: #c8a24ad9;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: lb-chevron-rise 3.2s ease-in-out infinite;
}

.lb-chevron--2 { animation-delay: .6s; }

@keyframes lb-chevron-rise {
  0%, 100% { opacity: 0; transform: translateY(5px); }
  45% { opacity: .95; transform: translateY(0); }
}

/* ── Identity column ──────────────────────────────────────────────────── */

.lb-identity {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.lb-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--lb-faint);
  margin-bottom: 8px;
}

.lb-kicker::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, #c8a24a3d, #0000);
}

.lb-title {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin: 0;
  color: #f0e9dc;
  text-shadow: 0 1px 0 #000, 0 12px 34px #00000059;
}

.lb-title-gold {
  display: inline-block;
  background: linear-gradient(100deg, #9d7933 0%, #e9d494 22%, #fdf3cf 34%, #c8a24a 52%, #a58337 78%, #cfa94f 100%);
  background-size: 160% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 1px #0000001a;
  filter: drop-shadow(0 1px 0 #000) drop-shadow(0 8px 14px #00000059);
  animation: lb-metal 9s ease-in-out infinite;
}

@keyframes lb-metal {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.lb-lede {
  margin: 12px 0 0;
  max-width: 62ch;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--lb-muted);
}

.lb-lede b {
  color: #d8d2c6;
  font-weight: 600;
}

.lb-tideline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--lb-muted);
}

.lb-tideline-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.lb-tideline-item .lb-icon {
  color: #8d877e;
}

.lb-tideline strong {
  color: #d8d2c6;
  font-weight: 600;
}

.lb-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.lb-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #c8a24a3d;
  border-radius: 8px;
  background: linear-gradient(180deg, #1b1b22, #121218);
  padding: 8px 15px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #ddd6c9;
  cursor: pointer;
  transition: border-color .22s ease, color .22s ease, transform .22s ease, box-shadow .22s ease;
}

.lb-action .lb-icon {
  color: #b79a52;
  transition: color .22s ease;
}

.lb-action:hover {
  border-color: #c8a24a99;
  color: #f3ece0;
  transform: translateY(-1px);
  box-shadow: 0 12px 26px -18px #c8a24acc;
}

.lb-action:hover .lb-icon {
  color: var(--lb-gold-soft);
}

.lb-action--primary {
  color: #0e0e12;
  border-color: #a8843a;
  background: linear-gradient(180deg, #e9d494, #c8a24a);
}

.lb-action--primary .lb-icon {
  color: #0e0e12;
}

.lb-action--primary:hover {
  color: #0e0e12;
}

.lb-action[disabled] {
  opacity: .38;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Sections & cards ─────────────────────────────────────────────────── */

.lb-section {
  position: relative;
  margin-top: 26px;
}

.lb-card {
  position: relative;
  border: 1px solid #ffffff12;
  border-radius: 16px;
  background: linear-gradient(170deg, #101015, #0a0a0e);
  box-shadow: 0 20px 52px -40px #000, inset 0 1px #ffffff06;
}

.lb-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid #ffffff0f;
}

.lb-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #e6cd8a;
}

.lb-card-title .lb-icon {
  color: var(--lb-brass);
}

.lb-card-note {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--lb-faint);
}

.lb-card-note b {
  color: var(--lb-gold-soft);
  font-weight: 600;
}

.lb-card-body {
  padding: 20px;
}

.lb-duo {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
  align-items: start;
}

/* ── Overview tiles ───────────────────────────────────────────────────── */

.lb-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(184px, 1fr));
  gap: 14px;
}

.lb-tile {
  position: relative;
  overflow: hidden;
  border: 1px solid #ffffff12;
  border-radius: 14px;
  background:
    radial-gradient(120% 130% at 100% 0%, #c8a24a0f, #0000 62%),
    linear-gradient(170deg, #111116, #0a0a0e);
  padding: 16px 16px 14px;
  transition: border-color .3s ease, transform .3s ease, box-shadow .3s ease;
}

.lb-tile::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(180deg, #0000, #c8a24a99, #0000);
}

.lb-tile:hover {
  border-color: #c8a24a4d;
  transform: translateY(-2px);
  box-shadow: 0 22px 44px -32px #c8a24a80;
}

.lb-tile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.lb-tile-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--lb-faint);
}

.lb-tile-icon {
  color: #6f6a63;
  transition: color .3s ease, filter .3s ease;
}

.lb-tile:hover .lb-tile-icon {
  color: var(--lb-gold-soft);
  filter: drop-shadow(0 0 7px #c8a24a70);
}

.lb-tile-value {
  margin: 12px 0 0;
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
  font-weight: 700;
  color: #f0e9dc;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 #000;
}

.lb-tile-value--gold {
  background: linear-gradient(100deg, #8f6c2b 0%, #e9d494 24%, #fdf3cf 38%, #c8a24a 58%, #99782f 82%, #cfa94f 100%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: lb-metal 9s ease-in-out infinite;
}

.lb-tile-sub {
  margin: 9px 0 0;
  font-size: 11.5px;
  color: var(--lb-faint);
}

.lb-tile-sub b {
  color: #cfc8bb;
  font-weight: 600;
}

.lb-tile-spark {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 96px;
  height: 34px;
  opacity: .5;
  pointer-events: none;
}

.lb-tile-spark path {
  fill: none;
  stroke: #c8a24a70;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-dasharray: 200;
  animation: lb-draw 3.6s ease-in-out infinite;
}

.lb-tile-spark--win path { stroke: #8a9a6a85; animation-delay: .5s; }
.lb-tile-spark--live path { stroke: #d9b65c85; animation-delay: 1.1s; }

/* ── Podium ───────────────────────────────────────────────────────────── */

.lb-podium {
  display: grid;
  grid-template-columns: 1fr 1.06fr 1fr;
  gap: 16px;
  align-items: end;
  padding: 4px 4px 0;
}

.lb-step {
  position: relative;
  border: 1px solid #ffffff12;
  border-radius: 16px;
  background: linear-gradient(170deg, #101015, #0a0a0e);
  padding: 18px 14px 16px;
  text-align: center;
  overflow: hidden;
  animation: lb-rise .8s cubic-bezier(.2, .7, .3, 1) backwards;
}

.lb-step--1 { animation-delay: .08s; padding-bottom: 30px; }
.lb-step--2 { animation-delay: .24s; padding-bottom: 22px; }
.lb-step--3 { animation-delay: .4s; padding-bottom: 16px; }

.lb-step--1 {
  border-color: #c8a24a52;
  background:
    radial-gradient(110% 90% at 50% -10%, #c8a24a1f, #0000 66%),
    linear-gradient(170deg, #131318, #0a0a0e);
  box-shadow: 0 30px 70px -46px #c8a24a, inset 0 1px #ffffff0a;
}

.lb-step--1::before {
  content: "";
  position: absolute;
  inset: -40% -60% auto;
  height: 90%;
  background: linear-gradient(90deg, #0000, #e6cd8a24, #0000);
  transform: rotate(-18deg);
  animation: lb-glint 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes lb-glint {
  0%, 68%, 100% { opacity: 0; transform: translate(-30%, 0) rotate(-18deg); }
  82% { opacity: 1; transform: translate(30%, 0) rotate(-18deg); }
}

.lb-step::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, #0000, #c8a24a59, #0000);
}

.lb-medal {
  position: relative;
  width: 78px;
  height: 78px;
  margin: 0 auto 10px;
}

.lb-medal-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.lb-medal-disc {
  fill: #141418;
  stroke-width: 1.8;
}

.lb-step--1 .lb-medal-disc { stroke: url(#lb-gold-grad); }
.lb-step--2 .lb-medal-disc { stroke: url(#lb-silver-grad); }
.lb-step--3 .lb-medal-disc { stroke: url(#lb-bronze-grad); }

.lb-medal-inner {
  fill: none;
  stroke: #ffffff1f;
  stroke-width: 1;
}

.lb-medal-star {
  fill: #c8a24a2e;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linejoin: round;
  animation: lb-medal-pop 3.4s ease-in-out infinite;
}

.lb-step--2 .lb-medal-star { stroke: #cfd3d8; animation-delay: .4s; }
.lb-step--3 .lb-medal-star { stroke: #cd8f52; animation-delay: .8s; }

.lb-step--1 .lb-medal-star { stroke: #e6cd8a; }

@keyframes lb-medal-pop {
  0%, 100% { opacity: .8; transform: scale(.96); }
  50% { opacity: 1; transform: scale(1.05); }
}

.lb-medal-ribbon {
  position: absolute;
  top: -6px;
  left: 50%;
  width: 26px;
  height: 12px;
  margin-left: -13px;
  border-radius: 3px;
  background: linear-gradient(180deg, #b3602f, #71381c);
  box-shadow: 0 4px 10px -6px #000;
}

.lb-step--1 .lb-medal-ribbon { background: linear-gradient(180deg, #d9b65c, #82662c); }
.lb-step--2 .lb-medal-ribbon { background: linear-gradient(180deg, #b9bec6, #6e737b); }
.lb-step--3 .lb-medal-ribbon { background: linear-gradient(180deg, #cd8f52, #7a4a20); }

.lb-step-rank {
  position: absolute;
  top: 10px;
  left: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--lb-faint);
}

.lb-step-avatar {
  position: relative;
  width: 46px;
  height: 46px;
  margin: 0 auto 10px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #17161a, #0c0c0f);
  box-shadow:
    0 0 0 1px #c8a24a3d,
    0 0 0 4px #c8a24a12;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--lb-gold-soft);
}

.lb-step-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lb-step-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #f0e9dc;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color .2s ease;
}

.lb-step-name:hover {
  color: var(--lb-gold-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lb-step-faction {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--lb-step-tint) 78%, #8d877e);
}

.lb-step-elo {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 7px;
  margin-top: 10px;
}

.lb-step-elo-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: #f0e9dc;
  font-variant-numeric: tabular-nums;
}

.lb-step-elo-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--lb-faint);
}

.lb-step-bar {
  position: relative;
  height: 4px;
  margin: 13px 4px 0;
  border-radius: 999px;
  background: #ffffff0f;
  overflow: hidden;
}

.lb-step-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #82662c, #e6cd8a);
  transform-origin: left center;
  animation: lb-grow-x 1.1s cubic-bezier(.2, .7, .3, 1) backwards;
}

.lb-step-bar--silver i { background: linear-gradient(90deg, #6e737b, #d5d9de); }
.lb-step-bar--bronze i { background: linear-gradient(90deg, #7a4a20, #d69a5d); }

.lb-step-foot {
  margin: 11px 0 0;
  font-size: 11px;
  color: var(--lb-faint);
  font-variant-numeric: tabular-nums;
}

.lb-step-foot b {
  color: #cfc8bb;
  font-weight: 600;
}

.lb-step-you {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid #a8843a;
  background: linear-gradient(180deg, #e9d494, #c8a24a);
  color: #0e0e12;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

/* ── Force balance ────────────────────────────────────────────────────── */

.lb-forces {
  display: grid;
  gap: 14px;
}

.lb-force {
  --lb-force-tint: #c8a24a;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 12px;
}

.lb-force-crest {
  color: var(--lb-force-tint);
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--lb-force-tint) 34%, transparent));
  transition: filter .35s ease, transform .45s ease;
}

.lb-force:hover .lb-force-crest {
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--lb-force-tint) 52%, transparent));
  transform: translateY(-2px);
}

.lb-force-main {
  min-width: 0;
}

.lb-force-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.lb-force-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #ddd6c9;
}

.lb-force-meta {
  font-size: 11px;
  color: var(--lb-faint);
  font-variant-numeric: tabular-nums;
}

.lb-force-meta b {
  color: #cfc8bb;
  font-weight: 600;
}

.lb-force-track {
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: #ffffff0d;
  overflow: hidden;
}

.lb-force-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--lb-force-tint) 40%, transparent), var(--lb-force-tint));
  transform-origin: left center;
  animation: lb-grow-x 1.2s cubic-bezier(.2, .7, .3, 1) backwards;
}

.lb-force-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #0000, #ffffff5c, #0000);
  transform: translateX(-100%);
  animation: lb-shimmer 3.4s ease-in-out infinite;
}

.lb-force-count {
  min-width: 46px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 13px;
  color: color-mix(in srgb, var(--lb-force-tint) 60%, #e6cd8a);
}

.lb-forces-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid #ffffff0f;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--lb-faint);
}

.lb-forces-total b {
  color: var(--lb-gold-soft);
  font-weight: 600;
}

/* ── Controls ─────────────────────────────────────────────────────────── */

.lb-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 16px 20px;
  border: 1px solid #ffffff12;
  border-radius: 16px;
  background: linear-gradient(170deg, #101015, #0a0a0e);
  box-shadow: 0 20px 52px -40px #000, inset 0 1px #ffffff06;
}

.lb-search {
  position: relative;
  display: flex;
  align-items: center;
}

.lb-search .lb-icon {
  position: absolute;
  left: 13px;
  color: var(--lb-faint);
  pointer-events: none;
  transition: color .22s ease;
}

.lb-search:focus-within .lb-icon {
  color: var(--lb-gold-soft);
}

.lb-search input {
  width: 100%;
  border: 1px solid #ffffff17;
  border-radius: 9px;
  background: #0a0a0e;
  padding: 9px 13px 9px 40px;
  font-size: 13px;
  color: #e7e5e4;
  outline: none;
  transition: border-color .22s ease, box-shadow .22s ease;
}

.lb-search input::placeholder {
  color: var(--lb-faint);
}

.lb-search input:focus {
  border-color: #c8a24a80;
  box-shadow: 0 0 0 3px #c8a24a1a;
}

.lb-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.lb-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #ffffff17;
  border-radius: 999px;
  background: #ffffff08;
  padding: 7px 13px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--lb-muted);
  cursor: pointer;
  transition: border-color .22s ease, color .22s ease, background-color .22s ease, box-shadow .22s ease;
}

.lb-chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6f6a63;
  box-shadow: 0 0 0 3px #ffffff0d;
  transition: background-color .22s ease, box-shadow .22s ease;
}

.lb-chip:hover {
  border-color: #c8a24a4d;
  color: #e6dccb;
}

.lb-chip.is-active {
  border-color: color-mix(in srgb, var(--lb-chip-tint) 62%, transparent);
  background: color-mix(in srgb, var(--lb-chip-tint) 14%, #ffffff08);
  color: #f0e9dc;
  box-shadow: 0 10px 24px -18px var(--lb-chip-tint);
}

.lb-chip.is-active i {
  background: var(--lb-chip-tint);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--lb-chip-tint) 22%, transparent);
}

.lb-sorts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.lb-sort {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #ffffff17;
  border-radius: 8px;
  background: #ffffff08;
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--lb-muted);
  cursor: pointer;
  transition: border-color .22s ease, color .22s ease, background-color .22s ease;
}

.lb-sort:hover {
  border-color: #c8a24a4d;
  color: #e6dccb;
}

.lb-sort.is-active {
  border-color: #c8a24a80;
  background: #c8a24a1f;
  color: #f3ece0;
}

.lb-sort .lb-icon {
  opacity: .5;
  transition: opacity .22s ease, transform .22s ease;
}

.lb-sort.is-active .lb-icon {
  opacity: 1;
  color: var(--lb-gold-soft);
}

.lb-sort.is-active.is-desc .lb-icon {
  transform: rotate(180deg);
}

/* ── Table ────────────────────────────────────────────────────────────── */

.lb-table-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #ffffff12;
  border-radius: 18px;
  background: linear-gradient(180deg, #0f0f14, #0a0a0e);
  box-shadow: 0 26px 62px -46px #000, inset 0 1px #ffffff06;
}

.lb-table-scroll {
  overflow-x: auto;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.lb-table thead th {
  position: relative;
  padding: 13px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #8d877e;
  background: linear-gradient(180deg, #131318, #0e0e13);
  border-bottom: 1px solid #c8a24a26;
  white-space: nowrap;
}

.lb-table thead th::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, #c8a24a66, #0000);
}

.lb-th-sortable {
  cursor: pointer;
  user-select: none;
  transition: color .2s ease;
}

.lb-th-sortable:hover {
  color: var(--lb-gold-soft);
}

.lb-th-sortable.is-active {
  color: var(--lb-gold-soft);
}

.lb-th-sortable .lb-sort-mark {
  display: inline-flex;
  vertical-align: -2px;
  margin-left: 5px;
  opacity: 0;
  color: var(--lb-brass);
  transition: opacity .2s ease, transform .2s ease;
}

.lb-th-sortable:hover .lb-sort-mark {
  opacity: .5;
}

.lb-th-sortable.is-active .lb-sort-mark {
  opacity: 1;
}

.lb-th-sortable.is-active.is-desc .lb-sort-mark {
  transform: rotate(180deg);
}

.lb-table tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid #ffffff0a;
  font-size: 13px;
  color: #cbc5b8;
  vertical-align: middle;
}

.lb-table tbody tr {
  position: relative;
  transition: background-color .25s ease;
}

.lb-table tbody tr:hover {
  background: linear-gradient(90deg, #c8a24a0f, #c8a24a05 40%, #0000);
}

.lb-table tbody tr.is-me {
  background: linear-gradient(90deg, #c8a24a1c, #c8a24a08 45%, #0000);
  box-shadow: inset 2px 0 #c8a24a;
}

.lb-table tbody tr:last-child td {
  border-bottom: 0;
}

.lb-td-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Progressive disclosure: visible by default, dropped by the breakpoints below. */
.lb-td-hide-md,
.lb-td-hide-sm {
  display: table-cell;
}

/* Rank cell with medal coloring */
.lb-rank {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--lb-faint);
}

.lb-rank-num {
  min-width: 34px;
  text-align: right;
  font-weight: 600;
  letter-spacing: .04em;
}

.lb-row--1 .lb-rank-num { color: #e6cd8a; }
.lb-row--2 .lb-rank-num { color: #cfd3d8; }
.lb-row--3 .lb-rank-num { color: #d69a5d; }

.lb-rank-medal {
  width: 22px;
  height: 22px;
  flex: none;
  color: #c8a24a;
  animation: lb-medal-pop 3.6s ease-in-out infinite;
}

.lb-row--2 .lb-rank-medal { color: #cfd3d8; animation-delay: .5s; }
.lb-row--3 .lb-rank-medal { color: #d69a5d; animation-delay: 1s; }

/* Commander cell */
.lb-cell-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.lb-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #17161a, #0c0c0f);
  box-shadow:
    inset 0 0 0 1px #ffffff12,
    0 0 0 1px color-mix(in srgb, var(--lb-row-tint) 26%, transparent);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  color: color-mix(in srgb, var(--lb-row-tint) 55%, var(--lb-gold-soft));
}

.lb-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lb-avatar-flag {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 13px;
  height: 13px;
  border-radius: 5px 0 8px 0;
  background: #0a0a0e;
  display: grid;
  place-items: center;
  color: var(--lb-row-tint);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lb-row-tint) 34%, transparent);
}

.lb-avatar-flag svg {
  width: 9px;
  height: 9px;
}

.lb-user-main {
  min-width: 0;
}

.lb-user-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #e7e5e4;
  text-decoration: none;
  transition: color .2s ease;
}

.lb-user-name > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-user-name:hover {
  color: var(--lb-gold-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lb-you {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #a8843a;
  background: linear-gradient(180deg, #e9d494, #c8a24a);
  color: #0e0e12;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.lb-user-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--lb-faint);
}

.lb-tier {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: color-mix(in srgb, var(--lb-row-tint) 40%, #b7b0a4);
}

.lb-pips {
  display: inline-flex;
  gap: 2px;
  align-items: center;
}

.lb-pips svg {
  width: 7px;
  height: 7px;
  color: #46414a;
  transition: color .3s ease;
}

.lb-pips svg.is-lit {
  color: var(--lb-row-tint);
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--lb-row-tint) 60%, transparent));
}

/* Faction chip */
.lb-faction {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.lb-faction-crest {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--lb-row-tint);
  opacity: .85;
  transition: opacity .3s ease, filter .3s ease, transform .4s ease;
}

tr:hover .lb-faction-crest {
  opacity: 1;
  filter: drop-shadow(0 0 7px color-mix(in srgb, var(--lb-row-tint) 46%, transparent));
  transform: translateY(-1px);
}

.lb-faction-name {
  font-size: 12px;
  color: color-mix(in srgb, var(--lb-row-tint) 55%, #b7b0a4);
}

/* Rating cell: bar + value + delta */
.lb-rating {
  display: grid;
  gap: 6px;
  min-width: 168px;
}

.lb-rating-top {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 8px;
}

.lb-rating-value {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: #f0e9dc;
  font-variant-numeric: tabular-nums;
}

.lb-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid #ffffff17;
  background: #ffffff08;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
}

.lb-delta .lb-icon {
  width: 10px;
  height: 10px;
}

.lb-delta--up {
  color: #a8bd84;
  border-color: #8a9a6a4d;
  background: #8a9a6a1a;
}

.lb-delta--down {
  color: #e0996f;
  border-color: #cd7d4c4d;
  background: #cd7d4c1a;
}

.lb-delta--flat {
  color: var(--lb-faint);
}

.lb-bar {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: #ffffff0d;
  overflow: visible;
}

.lb-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--lb-row-tint) 35%, transparent), var(--lb-row-tint));
  transform-origin: left center;
  animation: lb-grow-x 1s cubic-bezier(.2, .7, .3, 1) backwards;
}

.lb-bar-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #0000, #ffffff40, #0000);
  transform: translateX(-100%);
  animation: lb-shimmer 4.2s ease-in-out infinite;
}

.lb-bar-peak {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  border-radius: 1px;
  background: #e6cd8a;
  box-shadow: 0 0 7px #d9b65c99;
  opacity: .85;
}

.lb-bar-peak::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -2px;
  width: 6px;
  height: 3px;
  background: #e6cd8a;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
}

/* W / D / L cell */
.lb-record {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.lb-record span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lb-record i {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  transform: rotate(45deg);
}

.lb-record .w { color: #a8bd84; }
.lb-record .w i { background: #8a9a6a; }
.lb-record .d { color: var(--lb-faint); }
.lb-record .d i { background: #6d6862; }
.lb-record .l { color: #e0996f; }
.lb-record .l i { background: #cd7d4c; }

/* Win rate cell with micro donut */
.lb-rate {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.lb-rate-donut {
  width: 30px;
  height: 30px;
  flex: none;
  transform: rotate(-90deg);
}

.lb-rate-track {
  fill: none;
  stroke: #ffffff12;
  stroke-width: 3.4;
}

.lb-rate-seg {
  fill: none;
  stroke: var(--lb-rate-color, #c8a24a);
  stroke-width: 3.4;
  stroke-linecap: round;
  transition: stroke-dashoffset .9s cubic-bezier(.2, .7, .3, 1);
}

.lb-rate-value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #d8d2c6;
  font-variant-numeric: tabular-nums;
}

.lb-rate-value small {
  font-size: 10px;
  color: var(--lb-faint);
}

/* Matches cell */
.lb-matches {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #d8d2c6;
  font-variant-numeric: tabular-nums;
}

.lb-matches small {
  display: block;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--lb-faint);
}

/* Link arrow */
.lb-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #ffffff17;
  color: var(--lb-faint);
  text-decoration: none;
  opacity: .35;
  transition: opacity .22s ease, color .22s ease, border-color .22s ease, transform .22s ease, background-color .22s ease;
}

tr:hover .lb-go {
  opacity: 1;
  color: var(--lb-gold-soft);
  border-color: #c8a24a59;
  background: #c8a24a17;
  transform: translateX(2px);
}

/* ── Pagination ───────────────────────────────────────────────────────── */

.lb-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
}

.lb-pager-info {
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--lb-faint);
}

.lb-pager-info b {
  color: var(--lb-gold-soft);
  font-weight: 600;
}

.lb-pager-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lb-page-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #ffffff17;
  border-radius: 8px;
  background: #ffffff08;
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--lb-muted);
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease, opacity .2s ease;
}

.lb-page-btn:hover:not([disabled]) {
  border-color: #c8a24a59;
  color: var(--lb-gold-soft);
  background: #c8a24a14;
}

.lb-page-btn[disabled] {
  opacity: .3;
  cursor: not-allowed;
}

.lb-page-nums {
  display: flex;
  align-items: center;
  gap: 5px;
}

.lb-page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #ffffff08;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--lb-muted);
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}

.lb-page-num:hover {
  border-color: #c8a24a4d;
  color: #e6dccb;
}

.lb-page-num.is-current {
  border-color: #c8a24a99;
  background: #c8a24a26;
  color: #f3ece0;
  box-shadow: 0 0 0 1px #c8a24a33;
}

.lb-page-gap {
  color: var(--lb-faint);
  padding: 0 2px;
  font-family: var(--font-mono);
}

/* ── Viewer panel ─────────────────────────────────────────────────────── */

.lb-mine {
  position: sticky;
  top: 84px;
  overflow: hidden;
  border: 1px solid #c8a24a3d;
  border-radius: 16px;
  background:
    radial-gradient(120% 120% at 100% 0%, #c8a24a1a, #0000 60%),
    linear-gradient(170deg, #131318, #0a0a0e);
  box-shadow: 0 26px 62px -44px #c8a24a, inset 0 1px #ffffff08;
}

.lb-mine::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(180deg, #0000, #e6cd8a, #0000);
}

.lb-mine-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 18px 13px;
  border-bottom: 1px solid #ffffff0f;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--lb-gold-soft);
}

.lb-mine-head .lb-icon {
  color: var(--lb-brass);
}

.lb-mine-body {
  padding: 18px;
}

.lb-mine-rank {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.lb-mine-hash {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: .9;
  font-weight: 700;
  color: #f0e9dc;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 #000, 0 10px 26px #00000059;
}

.lb-mine-of {
  padding-bottom: 5px;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--lb-faint);
}

.lb-mine-elo {
  margin: 16px 0 0;
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1;
  font-weight: 700;
  background: linear-gradient(100deg, #8f6c2b 0%, #e9d494 22%, #fdf3cf 34%, #c8a24a 52%, #99782f 78%, #cfa94f 100%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: lb-metal 9s ease-in-out infinite;
  font-variant-numeric: tabular-nums;
}

.lb-mine-ladder {
  margin-top: 16px;
}

/* Rank ladder progress (viewer panel + legend) */
.lb-ladder-track {
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: #ffffff0f;
  overflow: hidden;
}

.lb-ladder-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #82662c, #e6cd8a);
  transform-origin: left center;
  animation: lb-grow-x 1s cubic-bezier(.2, .7, .3, 1) backwards;
  transition: width .9s cubic-bezier(.2, .7, .3, 1);
}

.lb-mine-ladder-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--lb-faint);
}

.lb-mine-ladder-head b {
  color: #d8d2c6;
  font-weight: 600;
}

.lb-mine-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.lb-mine-stat {
  border: 1px solid #ffffff0f;
  border-radius: 10px;
  background: #ffffff06;
  padding: 10px 12px;
}

.lb-mine-stat-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--lb-faint);
}

.lb-mine-stat-value {
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 16px;
  color: #e7e5e4;
  font-variant-numeric: tabular-nums;
}

.lb-mine-gap {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 16px;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px dashed #c8a24a40;
  background: #c8a24a0a;
  font-size: 11.5px;
  color: var(--lb-muted);
}

.lb-mine-gap .lb-icon {
  color: var(--lb-brass);
}

.lb-mine-gap b {
  color: var(--lb-gold-soft);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.lb-mine-actions {
  display: flex;
  gap: 9px;
  margin-top: 16px;
}

.lb-mine-actions .lb-action {
  flex: 1;
  justify-content: center;
}

/* ── Legend ───────────────────────────────────────────────────────────── */

.lb-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px 26px;
}

.lb-legend-block h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--lb-faint);
}

.lb-legend-block h3 .lb-icon {
  color: #7d776f;
}

.lb-legend-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lb-legend-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--lb-muted);
}

.lb-legend-list b {
  color: #ddd6c9;
  font-weight: 600;
}

.lb-legend-ladder {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lb-legend-ladder li {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--lb-faint);
  padding: 4px 0;
  border-bottom: 1px solid #ffffff08;
}

.lb-legend-ladder li:last-child {
  border-bottom: 0;
}

.lb-legend-ladder .lb-ladder-min {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #8d877e;
}

.lb-legend-ladder .lb-ladder-name {
  color: #cfc8bb;
  font-weight: 600;
}

.lb-ladder-pips {
  display: inline-flex;
  gap: 2px;
}

.lb-ladder-pips svg {
  width: 8px;
  height: 8px;
  color: #c8a24a;
  filter: drop-shadow(0 0 3px #c8a24a59);
}

/* ── Footer note ──────────────────────────────────────────────────────── */

.lb-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 22px;
  padding: 15px 18px;
  border: 1px solid #ffffff12;
  border-radius: 14px;
  background: #ffffff06;
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--lb-faint);
}

.lb-note .lb-icon {
  color: #7d776f;
  margin-top: 2px;
}

.lb-note b {
  color: #cfc8bb;
  font-weight: 600;
}

.lb-note code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--lb-gold-soft);
}

/* ── States: skeleton, empty, error ───────────────────────────────────── */

.lb-skel {
  display: grid;
  gap: 16px;
}

.lb-skeleton {
  position: relative;
  overflow: hidden;
  border: 1px solid #ffffff0f;
  border-radius: 14px;
  background: #ffffff06;
}

.lb-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, #0000, #ffffff0f, #0000);
  animation: lb-shimmer 1.7s ease-in-out infinite;
}

.lb-empty {
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 52px 24px;
  text-align: center;
}

.lb-empty-mark {
  position: relative;
  width: 92px;
  height: 92px;
  color: #4a453e;
}

.lb-empty-mark svg {
  width: 100%;
  height: 100%;
}

.lb-empty-mark circle.lb-empty-sweep-arc {
  transform-origin: 46px 46px;
  animation: lb-spin 3.4s linear infinite;
}

.lb-empty-mark circle.lb-empty-ring {
  transform-origin: 46px 46px;
  animation: lb-spin-rev 6s linear infinite;
}

.lb-empty-text {
  max-width: 44ch;
  font-size: 13px;
  line-height: 1.75;
  color: var(--lb-faint);
}

.lb-empty-text b {
  color: #cfc8bb;
  font-weight: 600;
}

.lb-error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid #b3602f4d;
  border-radius: 14px;
  background: #b3602f14;
  font-size: 13px;
  color: #e0996f;
}

.lb-error-actions {
  display: flex;
  gap: 9px;
}

.lb-noscript {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid #c8a24a3d;
  border-radius: 14px;
  background: #c8a24a0a;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--lb-muted);
}

.lb-noscript b {
  color: var(--lb-gold-soft);
}

.lb-noscript a {
  color: var(--lb-gold-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Shared animations ────────────────────────────────────────────────── */

@keyframes lb-spin { to { transform: rotate(1turn); } }
@keyframes lb-spin-rev { to { transform: rotate(-1turn); } }

@keyframes lb-grow-x {
  from { transform: scaleX(0); }
}

@keyframes lb-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes lb-draw {
  0% { stroke-dashoffset: 200; opacity: 0; }
  40% { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 1; }
}

@keyframes lb-shimmer {
  0% { transform: translateX(-100%); }
  55%, 100% { transform: translateX(100%); }
}

.lb-rise {
  animation: lb-rise .7s cubic-bezier(.2, .7, .3, 1) backwards;
}

.lb-rise--1 { animation-delay: .1s; }
.lb-rise--2 { animation-delay: .2s; }
.lb-rise--3 { animation-delay: .3s; }
.lb-rise--4 { animation-delay: .4s; }

.lb-pop {
  animation: lb-medal-pop .5s cubic-bezier(.2, .8, .3, 1) backwards;
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (min-width: 901px) {
  .lb-title {
    font-size: clamp(26px, 2.5vw, 36px);
  }
}

@media (max-width: 1180px) {
  .lb-hero {
    gap: 30px;
  }

  .lb-emblem {
    width: 164px;
    height: 164px;
  }

  .lb-duo {
    grid-template-columns: 1fr;
  }

  .lb-mine {
    position: static;
  }
}

@media (max-width: 900px) {
  .lb-hero {
    grid-template-columns: 1fr;
    padding: 26px 24px;
    text-align: left;
  }

  .lb-hero-art {
    top: auto;
    width: 72%;
    height: 240px;
    opacity: .48;
    background-image: url("../img/leaderboard-hero-command-map-v1-640.webp");
  }

  .lb-emblem {
    width: 132px;
    height: 132px;
    justify-self: center;
    margin: 0 auto;
  }

  .lb-title {
    font-size: 30px;
  }

  .lb-controls {
    grid-template-columns: 1fr;
  }

  .lb-td-hide-md {
    display: none;
  }
}

@media (max-width: 640px) {
  .lb-hero {
    padding: 22px 18px;
  }

  .lb-title {
    font-size: 25px;
  }

  .lb-card-body {
    padding: 16px;
  }

  .lb-td-hide-sm {
    display: none;
  }

  /* Keep the essential three columns (Platz, Kommandeur, Wertung) on screen by
     dropping the dossier link column and tightening the cells. */
  .lb-table {
    min-width: 0;
    table-layout: fixed;
  }

  .lb-table thead th,
  .lb-table tbody td {
    padding: 11px 9px;
  }

  .lb-table thead th:last-child,
  .lb-table tbody td:last-child {
    display: none;
  }

  .lb-table thead th:first-child,
  .lb-table tbody td:first-child {
    width: 46px;
  }

  /* The inline width on the Wertung header would win over the stylesheet. */
  .lb-table thead th[style],
  .lb-table tbody td:nth-child(4) {
    width: 118px !important;
  }

  /* The avatar is decorative; dropping it buys room for the name. */
  .lb-avatar {
    display: none;
  }

  .lb-cell-user {
    gap: 9px;
  }

  .lb-rating {
    min-width: 0;
    gap: 5px;
  }

  .lb-rating-value {
    font-size: 15px;
  }

  .lb-user-sub {
    font-size: 9px;
    letter-spacing: .04em;
  }

  .lb-pips {
    display: none;
  }

  .lb-user-name > span:first-child {
    max-width: none;
  }

  .lb-user-sub {
    font-size: 9.5px;
  }

  .lb-rank {
    gap: 6px;
  }

  .lb-rank-medal {
    width: 17px;
    height: 17px;
  }

  .lb-rank-num {
    min-width: 26px;
    font-size: 12px;
  }

  .lb-podium {
    grid-template-columns: 1fr;
  }

  .lb-step {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: center;
    text-align: left;
  }

  .lb-medal {
    grid-row: span 2;
    margin: 0;
  }

  .lb-step-avatar {
    margin: 0 0 8px;
  }

  .lb-step-elo {
    justify-content: flex-start;
  }

  .lb-mine-stats {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lb-page *,
  .lb-page *::before,
  .lb-page *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
