/* WSPRO — Leaderboard page, its own "trophy room" look (scoped to .lbg, this page only; every other page keeps the
   regular app look or the ticket skin). Deliberately breaks from the ticket palette because this page celebrates a
   real result (who delivered the most), not a settings/data screen. The medal avatars read as a coin/medallion
   (ball + a separated glowing ring, not one plain circle) so the edge carries the "aura" rather than the shape
   just being round; the champion's ring also pulses — the one continuous motion on this page. Pedestal blocks are
   lit top-to-bottom like a physical riser: a podium is a 3D object by metaphor, so the shading serves that.
   Light is the adapted companion so the app's theme toggle keeps working here too; dark matches the supplied
   reference. Numbers reuse the DM Mono already loaded for the ticket skin, so no extra font is loaded for this page. */
.lbg {
  --lbg-bg: #FBF4E4; --lbg-card: #FFFFFF; --lbg-ink: #241B08; --lbg-ink-2: #7A6A4A; --lbg-line: #E9DCBD;
  --lbg-gold: #D99A06; --lbg-gold-hi: #FFEBB0; --lbg-gold-deep: #8A5C05; --lbg-gold-ink: #FFFFFF; --lbg-gold-soft: #F6E3B8; --lbg-gold-aura: rgba(217,154,6,.4);
  --lbg-silver: #7C8BA3; --lbg-silver-hi: #F1F5F9; --lbg-silver-deep: #566178; --lbg-silver-bg: #F1F3F6; --lbg-silver-aura: rgba(124,139,163,.32);
  --lbg-bronze: #B2560F; --lbg-bronze-hi: #F2B37E; --lbg-bronze-deep: #6B2E08; --lbg-bronze-bg: #FBE4D2; --lbg-bronze-aura: rgba(178,86,15,.32);
  --lbg-good: #14804A; --lbg-shadow: rgba(120,75,15,.22);
  font-family: inherit; color: var(--lbg-ink);
}
html[data-theme="dark"] .lbg {
  --lbg-bg: #0B0F19; --lbg-card: #151A27; --lbg-ink: #F1F3F9; --lbg-ink-2: #92A0BD; --lbg-line: rgba(255,255,255,.09);
  --lbg-gold: #F5C518; --lbg-gold-hi: #FFEFAE; --lbg-gold-deep: #8A6A05; --lbg-gold-ink: #1A1500; --lbg-gold-soft: rgba(245,197,24,.16); --lbg-gold-aura: rgba(245,197,24,.45);
  --lbg-silver: #CBD5E1; --lbg-silver-hi: #EEF2F7; --lbg-silver-deep: #5C6B82; --lbg-silver-bg: rgba(203,213,225,.08); --lbg-silver-aura: rgba(203,213,225,.3);
  --lbg-bronze: #E08A3E; --lbg-bronze-hi: #F8C389; --lbg-bronze-deep: #6B3A0A; --lbg-bronze-bg: rgba(224,138,62,.12); --lbg-bronze-aura: rgba(224,138,62,.4);
  --lbg-good: #4CC38A; --lbg-shadow: rgba(0,0,0,.55);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .lbg {
    --lbg-bg: #0B0F19; --lbg-card: #151A27; --lbg-ink: #F1F3F9; --lbg-ink-2: #92A0BD; --lbg-line: rgba(255,255,255,.09);
    --lbg-gold: #F5C518; --lbg-gold-hi: #FFEFAE; --lbg-gold-deep: #8A6A05; --lbg-gold-ink: #1A1500; --lbg-gold-soft: rgba(245,197,24,.16); --lbg-gold-aura: rgba(245,197,24,.45);
    --lbg-silver: #CBD5E1; --lbg-silver-hi: #EEF2F7; --lbg-silver-deep: #5C6B82; --lbg-silver-bg: rgba(203,213,225,.08); --lbg-silver-aura: rgba(203,213,225,.3);
    --lbg-bronze: #E08A3E; --lbg-bronze-hi: #F8C389; --lbg-bronze-deep: #6B3A0A; --lbg-bronze-bg: rgba(224,138,62,.12); --lbg-bronze-aura: rgba(224,138,62,.4);
    --lbg-good: #4CC38A; --lbg-shadow: rgba(0,0,0,.55);
  }
}

.lbg { background: var(--lbg-bg); border-radius: 26px; padding: 22px; }
.lbg .hint { color: var(--lbg-ink-2); }

.lbg-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.lbg-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-family: var(--st-f-mono, ui-monospace, monospace); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--lbg-gold); margin-bottom: 6px; }
.lbg-eyebrow svg { width: 13px; height: 13px; }
.lbg-title { margin: 0; font-size: clamp(26px, 3.6vw, 36px); font-weight: 800; letter-spacing: -0.02em; color: var(--lbg-ink); }
.lbg-sub { margin: 4px 0 0; font-size: 13.5px; color: var(--lbg-ink-2); }
.lbg-tabs { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--lbg-card); border: 1px solid var(--lbg-line); }
.lbg-tabs button { border: 0; background: none; border-radius: 999px; padding: 6px 15px; font-weight: 700; font-size: 12.5px; color: var(--lbg-ink-2); cursor: pointer; }
.lbg-tabs button[aria-pressed="true"] { background: var(--lbg-gold); color: var(--lbg-gold-ink); }

/* The card itself is the thing that should read as a real 3D object: a visible solid "lip" close to the edge
   (like the side face of a thick slab) plus a soft ambient shadow further out, so it looks like a raised plate
   sitting on the page, not a flat rectangle with a drop shadow. Plus a soft ambient glow behind the champion
   column — the page's one deliberate background aura. */
.lbg-hero {
  position: relative; background: var(--lbg-card); border: 1px solid var(--lbg-line); border-radius: 22px;
  padding: 36px 18px 18px; overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.14),
    0 1px 0 0 var(--lbg-line), 0 7px 0 -2px color-mix(in srgb, var(--lbg-gold) 22%, var(--lbg-line)),
    0 10px 18px -8px var(--lbg-shadow), 0 34px 60px -24px var(--lbg-shadow);
}
.lbg-hero::before {
  content: ""; position: absolute; top: -18%; left: 50%; width: 66%; height: 78%; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, var(--lbg-gold-aura) 0%, transparent 70%);
  filter: blur(8px); pointer-events: none; z-index: 0;
}
.lbg-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }

.lbg-podium { display: grid; grid-template-columns: 1fr 1.12fr 1fr; gap: 14px; align-items: end; position: relative; z-index: 1; }
.lbg-pod { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; opacity: 0; animation: lbgEnter .7s cubic-bezier(.16,1,.3,1) forwards; }
.lbg-pod.r2 { animation-delay: .05s; } .lbg-pod.r1 { animation-delay: .15s; } .lbg-pod.r3 { animation-delay: .25s; }
@keyframes lbgEnter { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .lbg-pod { opacity: 1; animation: none; } }

/* The crown bounces once into place, then floats gently — two spark dots ping next to it. Decorative, so the
   bounce/ping loops stay out of a screen reader's way (the spans are aria-hidden); turned off for reduced motion. */
.lbg-crown-wrap { position: relative; margin-bottom: 2px; }
.lbg-crown { color: var(--lbg-gold); display: block; filter: drop-shadow(0 2px 6px var(--lbg-gold-aura)); animation: lbgFloat 2.4s ease-in-out infinite; }
.lbg-spark { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #FFE9A8; box-shadow: 0 0 6px 1px var(--lbg-gold-aura); animation: lbgPing 1.8s cubic-bezier(0,0,.2,1) infinite; }
.lbg-spark.s1 { top: -3px; right: -6px; } .lbg-spark.s2 { top: 6px; left: -8px; animation-delay: .5s; }
@keyframes lbgFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes lbgPing { 0% { transform: scale(1); opacity: .9; } 75%, 100% { transform: scale(2.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .lbg-crown { animation: none; } .lbg-spark { animation: none; opacity: .5; } }

/* Medal avatars stay a plain, flat circle on purpose — the 3D depth on this page belongs to the card behind
   them (.lbg-hero), not to the avatar. A gradient ring (gold/silver/bronze) frames each one, with a couple of
   small embers glinting at the rim. Only the champion's ring keeps pulsing — the one continuous motion here;
   2nd/3rd and the embers play their entrance once and hold still. */
.lbg-av-wrap { position: relative; width: 58px; height: 58px; margin-bottom: 10px; }
.lbg-pod.r1 .lbg-av-wrap { width: 82px; height: 82px; }
.lbg-ring {
  position: absolute; inset: 0; border-radius: 50%; z-index: 1; padding: 3px;
  background: linear-gradient(145deg, var(--lbg-silver-hi) 0%, var(--lbg-silver) 55%, var(--lbg-silver-deep) 100%);
}
.lbg-pod.r1 .lbg-ring { padding: 4px; background: linear-gradient(145deg, var(--lbg-gold-hi) 0%, var(--lbg-gold) 55%, #B45309 100%); }
.lbg-pod.r3 .lbg-ring { background: linear-gradient(145deg, var(--lbg-bronze-hi) 0%, var(--lbg-bronze) 55%, #7C2D12 100%); }
.lbg-av {
  position: absolute; inset: 3px; z-index: 2; display: grid; place-items: center; border-radius: 50%; overflow: hidden;
  font-weight: 800; color: var(--lbg-ink);
  background: radial-gradient(ellipse 65% 45% at 30% 24%, rgba(255,255,255,.5) 0%, rgba(255,255,255,0) 62%),
    linear-gradient(165deg, var(--lbg-silver) 0%, var(--lbg-silver-deep) 100%);
  font-size: 20px;
}
.lbg-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lbg-pod.r1 .lbg-av {
  inset: 4px; font-size: 28px; color: var(--lbg-gold-ink);
  background: radial-gradient(ellipse 65% 45% at 30% 24%, rgba(255,255,255,.6) 0%, rgba(255,255,255,0) 62%),
    linear-gradient(165deg, var(--lbg-gold-hi) 0%, var(--lbg-gold) 55%, var(--lbg-gold-deep) 100%);
}
.lbg-pod.r3 .lbg-av {
  background: radial-gradient(ellipse 65% 45% at 30% 24%, rgba(255,255,255,.45) 0%, rgba(255,255,255,0) 62%),
    linear-gradient(165deg, var(--lbg-bronze-hi) 0%, var(--lbg-bronze) 60%, var(--lbg-bronze-deep) 100%);
}
/* A ring that keeps pulsing outside the champion's own frame, marking whoever is genuinely #1 right now. */
.lbg-pulsering {
  position: absolute; inset: -10px; border-radius: 50%; border: 2px solid var(--lbg-gold); z-index: 1;
  animation: lbgPulse 2.6s ease-in-out infinite;
}
@keyframes lbgPulse {
  0%, 100% { box-shadow: 0 0 14px 2px var(--lbg-gold-aura); transform: scale(1); opacity: .55; }
  50% { box-shadow: 0 0 26px 7px var(--lbg-gold-aura); transform: scale(1.04); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .lbg-pulsering { animation: none; opacity: .7; } }

/* Embers: tiny glinting dots at the rim, each on its own short ping/pulse loop, colour-matched to the tier
   (warm gold/amber/rose for the champion, cool blue-silver for 2nd, copper-amber for 3rd). */
.lbg-ember { position: absolute; width: 6px; height: 6px; border-radius: 50%; z-index: 3; pointer-events: none; }
.lbg-pod.r2 .lbg-ember.e1 { top: -3px; left: -4px; background: #67E8F9; box-shadow: 0 0 6px #67E8F9; animation: lbgPing 2.2s cubic-bezier(0,0,.2,1) infinite; }
.lbg-pod.r2 .lbg-ember.e2 { bottom: 4px; right: -5px; width: 5px; height: 5px; background: #38BDF8; box-shadow: 0 0 6px #38BDF8; animation: lbgGlow 2.4s ease-in-out infinite; animation-delay: .4s; }
.lbg-pod.r3 .lbg-ember.e1 { top: -3px; left: -4px; background: #FB923C; box-shadow: 0 0 6px #FB923C; animation: lbgPing 2.2s cubic-bezier(0,0,.2,1) infinite; }
.lbg-pod.r3 .lbg-ember.e2 { bottom: 4px; right: -5px; width: 5px; height: 5px; background: #F59E0B; box-shadow: 0 0 6px #F59E0B; animation: lbgGlow 2.4s ease-in-out infinite; animation-delay: .4s; }
.lbg-pod.r1 .lbg-ember.e1 { top: -4px; left: -5px; width: 7px; height: 7px; background: #FDE047; box-shadow: 0 0 8px #FDE047; animation: lbgPing 2s cubic-bezier(0,0,.2,1) infinite; }
.lbg-pod.r1 .lbg-ember.e2 { top: -6px; right: 4px; background: #FBBF24; box-shadow: 0 0 8px #FBBF24; animation: lbgGlow 2.2s ease-in-out infinite; animation-delay: .3s; }
.lbg-pod.r1 .lbg-ember.e3 { bottom: 6px; right: -6px; background: #F97316; box-shadow: 0 0 6px #F97316; animation: lbgPing 2.3s cubic-bezier(0,0,.2,1) infinite; animation-delay: .8s; }
.lbg-pod.r1 .lbg-ember.e4 { bottom: 10px; left: -6px; width: 5px; height: 5px; background: #FB7185; box-shadow: 0 0 6px #FB7185; animation: lbgGlow 2.1s ease-in-out infinite; animation-delay: .5s; }
@keyframes lbgGlow { 0%, 100% { opacity: .55; transform: scale(1); } 50% { opacity: 1; transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .lbg-ember { animation: none !important; opacity: .6; } }

.lbg-you { display: inline-block; margin-bottom: 4px; padding: 1px 9px; border-radius: 999px; background: var(--lbg-gold); color: var(--lbg-gold-ink); font-size: 10.5px; font-weight: 800; letter-spacing: 0.04em; }
.lbg-name { font-weight: 700; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbg-amt { font-family: var(--st-f-mono, ui-monospace, monospace); font-size: 13px; color: var(--lbg-ink-2); font-variant-numeric: tabular-nums; margin-top: 1px; }
.lbg-amt-gold {
  font-size: 16px; font-weight: 800; background: linear-gradient(180deg, var(--lbg-ink) 0%, var(--lbg-gold) 60%, var(--lbg-gold-deep) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 3px var(--lbg-gold-aura));
}

/* Pedestal blocks: lit from above like a real podium riser, not a flat tile; the champion's riser also gets a
   single diagonal shimmer sweep (one pass every few seconds), echoing the embers above it. */
.lbg-step {
  position: relative; width: 100%; margin-top: 14px; border-radius: 14px 14px 0 0; border: 1px solid var(--lbg-line); border-bottom: 0;
  display: grid; place-items: center; font-weight: 800; font-size: 30px; color: var(--lbg-silver-deep); overflow: hidden;
  background: linear-gradient(180deg, var(--lbg-silver-bg) 0%, color-mix(in srgb, var(--lbg-silver-bg) 35%, var(--lbg-silver)) 100%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 14px 26px -12px rgba(0,0,0,.28);
}
.lbg-pod.r3 .lbg-step {
  height: 50px; color: var(--lbg-bronze-deep); border-color: color-mix(in srgb, var(--lbg-bronze) 40%, var(--lbg-line));
  background: linear-gradient(180deg, var(--lbg-bronze-bg) 0%, color-mix(in srgb, var(--lbg-bronze-bg) 30%, var(--lbg-bronze)) 100%);
}
.lbg-pod.r2 .lbg-step { height: 64px; border-color: color-mix(in srgb, var(--lbg-silver) 40%, var(--lbg-line)); }
.lbg-pod.r1 .lbg-step {
  height: 92px; font-size: 48px; color: var(--lbg-gold-deep); border-color: var(--lbg-gold);
  background: linear-gradient(180deg, var(--lbg-gold-soft) 0%, color-mix(in srgb, var(--lbg-gold-soft) 25%, var(--lbg-gold)) 100%);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.6), 0 0 50px -4px var(--lbg-gold-aura), 0 20px 36px -14px rgba(0,0,0,.35);
}
.lbg-pod.r1 .lbg-step::after {
  content: ""; position: absolute; top: -50%; left: -60%; width: 60%; height: 200%;
  background: linear-gradient(60deg, transparent 40%, rgba(255,255,255,.35) 50%, transparent 60%);
  transform: skewX(-20deg); animation: lbgShimmer 4.5s ease-in-out infinite;
}
@keyframes lbgShimmer { 0% { transform: translateX(-20%) skewX(-20deg); } 100% { transform: translateX(280%) skewX(-20deg); } }
@media (prefers-reduced-motion: reduce) { .lbg-pod.r1 .lbg-step::after { animation: none; display: none; } }
.lbg-pod.empty .lbg-step { opacity: .55; box-shadow: none; background: var(--lbg-card); }
.lbg-pod.empty .lbg-name { color: var(--lbg-ink-2); }
.lbg-pod.empty .lbg-ember, .lbg-pod.empty .lbg-pulsering { display: none; }
.lbg-pod.r1.empty .lbg-av, .lbg-pod.r2.empty .lbg-av, .lbg-pod.r3.empty .lbg-av { background: var(--lbg-card); box-shadow: none; }
.lbg-pod.empty .lbg-ring { background: none; padding: 0; }
.lbg-pod.r1.empty .lbg-av { border: 3px dashed var(--lbg-gold); }
.lbg-pod.r2.empty .lbg-av { border: 3px dashed var(--lbg-silver); }
.lbg-pod.r3.empty .lbg-av { border: 3px dashed var(--lbg-bronze); }

.lbg-list { margin-top: 16px; background: var(--lbg-card); border: 1px solid var(--lbg-line); border-radius: 18px; padding: 6px 16px; box-shadow: 0 16px 32px -24px var(--lbg-shadow); }
.lbg-row { display: grid; grid-template-columns: 28px 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--lbg-line); }
.lbg-row:last-child { border-bottom: 0; }
.lbg-row .rk { font-weight: 800; font-size: 14px; color: var(--lbg-ink-2); text-align: center; }
/* List rows (rank 4+) keep a simpler glowing ring, no fiery aura/embers — those stay a podium-only treatment. */
.lbg-row .lbg-av {
  position: relative; inset: auto; width: 34px; height: 34px; font-size: 13px; margin: 0;
  box-shadow: inset 0 -3px 5px rgba(0,0,0,.18), inset 0 1px 2px rgba(255,255,255,.35),
    0 0 0 2px var(--lbg-card), 0 0 0 4px var(--lbg-silver), 0 0 8px 1px var(--lbg-silver-aura);
}
.lbg-row .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbg-row .am { font-family: var(--st-f-mono, ui-monospace, monospace); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }

.lbg-me-row { margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: var(--lbg-gold-soft); border: 1px solid var(--lbg-gold); }
.lbg-me-row .lbg-row { border-bottom: 0; padding: 0; }
.lbg-me-row .lbg-av { box-shadow: inset 0 -3px 5px rgba(0,0,0,.18), inset 0 1px 2px rgba(255,255,255,.35), 0 0 0 2px var(--lbg-gold-soft), 0 0 0 4px var(--lbg-gold), 0 0 10px 1px var(--lbg-gold-aura); }
.lbg-me-row .tip { margin: 6px 0 0; font-size: 12.5px; color: var(--lbg-ink-2); }

.lbg-empty, .lbg-loading { padding: 34px 0; text-align: center; color: var(--lbg-ink-2); font-size: 13.5px; }

@media (max-width: 640px) {
  .lbg { padding: 16px; border-radius: 20px; }
  .lbg-hero { padding: 26px 14px 14px; }
  .lbg-podium { grid-template-columns: 1fr; gap: 14px; }
  .lbg-pod { flex-direction: row; justify-content: flex-start; text-align: left; gap: 12px; }
  .lbg-av-wrap { margin-bottom: 0; }
  .lbg-pod .lbg-step { display: none; }
  .lbg-crown-wrap { margin-bottom: 0; }
  .lbg-pod { order: initial !important; }
  .lbg-pod.r1 { order: 1 !important; } .lbg-pod.r2 { order: 2 !important; } .lbg-pod.r3 { order: 3 !important; }
  .lbg-pod > div { min-width: 0; }
}
