/**
 * Meetgle Weekly Leaderboard — flat Stage-themed design.
 * Champion (#1) featured card + flat ranked list (#2+).
 * Modal renders OUTSIDE the Stage shell, so colours are hardcoded (no var()).
 */

@keyframes lbSpin { to { transform: rotate(360deg); } }
@keyframes lbRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* hide the modal-content's own scrollbar (the body scrolls instead) */
.leaderboard-modal-content { scrollbar-width: none; -ms-overflow-style: none; }
.leaderboard-modal-content::-webkit-scrollbar { display: none; }

/* ── header ── */
.lb-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 24px 14px; flex: none; }
.lb-head .lb-titles { margin-right: auto; }
.lb-head .lb-sub { margin-top: 6px; font-size: 12.5px; font-weight: 500; color: rgba(255,255,255,0.4); letter-spacing: 0.1px; }

/* ── scrollable body ── */
.lb-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 18px 22px; scrollbar-width: none; -ms-overflow-style: none; }
.lb-body::-webkit-scrollbar { display: none; }

/* ── champion (#1) — flat gold-tinted card ── */
.lb-champ {
    position: relative; display: flex; align-items: center; gap: 20px;
    padding: 24px; border-radius: 24px; cursor: pointer; overflow: hidden; margin-bottom: 18px;
    animation: lbRise 0.45s ease both;
    background: rgba(255,200,61,0.09);
    border: 1px solid rgba(255,200,61,0.30);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.lb-champ:hover { transform: translateY(-3px); background: rgba(255,200,61,0.13); border-color: rgba(255,200,61,0.42); }
.lb-champ-bignum {
    position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
    font-size: 170px; font-weight: 800; line-height: 1; color: rgba(255,200,61,0.06);
    pointer-events: none; letter-spacing: -0.05em;
}
.lb-champ-avwrap { position: relative; flex: none; z-index: 1; }
.lb-champ-crown {
    position: absolute; top: -19px; left: 50%; transform: translateX(-50%) rotate(-8deg);
    color: #ffc83d; filter: drop-shadow(0 4px 7px rgba(0,0,0,0.45));
}
.lb-champ-crown svg { width: 32px; height: 32px; display: block; }
.lb-champ-av { width: 86px; height: 86px; border-radius: 50%; padding: 3px; background: #ffc83d; }
.lb-champ-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid #1a1813; display: block; }
.lb-champ-info { position: relative; z-index: 1; min-width: 0; }
.lb-champ-tag { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #ffc83d; margin-bottom: 5px; opacity: 0.9; }
.lb-champ-nm { font-weight: 800; font-size: 23px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; line-height: 1.05; color: #fff; min-width: 0; }
.lb-champ-nmtxt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-champ-spk { margin-top: 10px; font-weight: 800; font-size: 28px; color: #ffc83d; display: flex; align-items: baseline; gap: 7px; text-shadow: 0 2px 14px rgba(255,200,61,0.3); }
.lb-champ-spk .lt { font-size: 22px; }
.lb-champ-lead { margin-top: 4px; font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.58); }
.lb-champ-lead b { color: rgba(255,255,255,0.82); }

/* ── ranked list (#2+) — flat ── */
.lb-list { display: flex; flex-direction: column; gap: 8px; }
.lb-row {
    display: flex; align-items: center; gap: 14px; padding: 11px 14px; cursor: pointer;
    border-radius: 16px; border: 1px solid rgba(255,255,255,0.07); background: rgba(255,255,255,0.04);
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
    animation: lbRise 0.4s ease both;
}
.lb-row:hover { border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.07); transform: translateY(-2px); }
/* flat rank badge — solid medal colour for the top, neutral otherwise */
.lb-rk {
    width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 10px;
    font-weight: 800; font-size: 14px; color: rgba(255,255,255,0.58); background: rgba(255,255,255,0.06);
    font-variant-numeric: tabular-nums;
}
.lb-row.r2 .lb-rk { color: #10141a; background: #d6dee8; }
.lb-row.r3 .lb-rk { color: #1d1207; background: #e0a36a; }
.lb-av { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid rgba(255,255,255,0.10); transition: border-color 0.16s; }
.lb-row:hover .lb-av { border-color: rgba(255,255,255,0.22); }
.lb-nm { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 6px; margin-right: auto; min-width: 0; color: #fff; }
.lb-nmtxt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-spk { font-weight: 800; font-size: 15px; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lb-spk .lt { color: #ffc83d; font-size: 13px; margin-left: 3px; }
/* current user — flat accent */
.lb-row.you { border-color: rgba(255,46,104,0.5); background: rgba(255,46,104,0.08); }
.lb-row.you .lb-rk { color: #fff; background: #ff2e68; }
.lb-youchip { font-size: 10px; font-weight: 800; letter-spacing: 0.5px; color: #fff; background: #ff2e68; padding: 2px 7px; border-radius: 6px; box-shadow: 0 2px 8px -2px rgba(255,46,104,0.6); }

/* verification badge (gold / blue) */
.lb-badge { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; font-size: 9px; color: #fff; font-weight: bold; flex: none; vertical-align: middle; }

/* empty state — no earners yet (no podium, just a friendly message) */
.lb-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 52px 24px 44px; gap: 16px; animation: lbRise 0.4s ease both; }
.lb-empty-ic { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,200,61,0.10); border: 1px solid rgba(255,200,61,0.22); color: #ffc83d; }
.lb-empty-ic svg { width: 30px; height: 30px; }
.lb-empty-msg { font-size: 15.5px; font-weight: 700; color: rgba(255,255,255,0.72); max-width: 260px; line-height: 1.4; }

/* ── Mobile fullscreen (PRESERVED — do not change the sizing) ── */
@media (max-width: 900px) {
    #leaderboardModal { padding: 0 !important; }
    #leaderboardModal > .leaderboard-modal-content {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        height: 100svh !important;
        max-height: 100vh !important;
        max-height: 100svh !important;
        border-radius: 0 !important;
        border: 0 !important;
    }
}
@media (max-width: 560px) {
    .lb-head { padding: 18px 16px 12px; }
    .lb-body { padding: 2px 14px 18px; }
    .lb-champ { padding: 20px 18px; gap: 16px; }
    .lb-champ-av { width: 72px; height: 72px; }
    .lb-champ-nm { font-size: 20px; }
    .lb-champ-spk { font-size: 24px; }
    .lb-champ-bignum { font-size: 130px; right: 6px; }
}
