/* ── "Switching event" overlay (shown while an event pill navigates) ── */
.lb-switching {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: rgba(10,10,10,.72); backdrop-filter: blur(2px);
    align-items: center; justify-content: center;
}
.lb-switching.active { display: flex; }
.lb-switching-box {
    background: #fff; border-radius: 12px; padding: 18px 28px;
    font-size: .92rem; font-weight: 700; color: #0a0a0a;
    display: flex; align-items: center; gap: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,.3);
}
.lb-switching-box i { color: #be9b3f; font-size: 1.1rem; }

/* ── Leaderboard hero ────────────────────────────────────────────── */
.lb-hero {
    position: relative;
    background: url('../images/leaderboard/hero-bg.webp') center 35% / cover no-repeat;
    color: #fff; padding: 48px 0 40px; overflow: hidden;
}
/* Left-to-right scrim: keeps the title/pills/leading-3 block (left side) readable
   while letting the photo show through clearly on the right. */
.lb-hero::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(100deg, rgba(8,7,4,.88) 0%, rgba(8,7,4,.72) 35%, rgba(8,7,4,.32) 65%, rgba(8,7,4,.15) 100%);
    pointer-events: none;
}
.lb-hero .auto-container { position: relative; z-index: 1; }

.lb-eyebrow { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: #be9b3f; margin-bottom: 8px; }
.lb-hero h1 { color: #fff; font-size: clamp(1.5rem, 4.5vw, 2.2rem); font-weight: 800; margin: 0; text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.lb-hero-sub { color: rgba(255,255,255,.72); font-size: .92rem; margin-top: 8px; max-width: 560px; line-height: 1.5; }

.lb-pills { display: flex; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.lb-pills .nom-event-pill {
    border: 1px solid rgba(255,255,255,.18); color: rgba(255,255,255,.78); background: rgba(255,255,255,.05);
    border-radius: 999px; padding: 7px 15px; font-size: .8rem; font-weight: 600; cursor: pointer;
    text-decoration: none; display: inline-block;
}
.lb-pills .nom-event-pill[data-active="1"] { background: #be9b3f; border-color: #be9b3f; color: #fff; }
.lb-pills .nom-event-pill:hover { color: #fff; text-decoration: none; border-color: #be9b3f; }

/* Leading-3 widget */
.lb-leading { background: rgba(255,255,255,.06); border: 1px solid rgba(190,155,63,.3); border-radius: 12px; padding: 16px 18px; margin-top: 26px; max-width: 560px; }
.lb-leading-label { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: #be9b3f; margin-bottom: 12px; }
.lb-leading-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.lb-leading-row + .lb-leading-row { border-top: 1px solid rgba(255,255,255,.08); }
.lb-leading-info { flex: 1; min-width: 0; }
.lb-leading-info b { display: block; font-size: .84rem; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-leading-info small { display: block; font-size: .68rem; color: rgba(255,255,255,.5); margin-bottom: 4px; }
.lb-leading-info .vote-bar-container { background: rgba(255,255,255,.12); margin-bottom: 0; }
.lb-leading-votes { font-weight: 800; font-size: .86rem; color: #be9b3f; flex-shrink: 0; }

.lb-stats { display: flex; gap: 28px; margin-top: 28px; flex-wrap: wrap; }
.lb-stat b { display: block; font-size: 1.35rem; color: #be9b3f; font-weight: 800; }
.lb-stat span { font-size: .68rem; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: .08em; }

.lb-medal { font-size: 1rem; line-height: 1; flex-shrink: 0; width: 20px; text-align: center; }
.lb-av {
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: .78rem; color: #fff;
    background: linear-gradient(135deg, #be9b3f, #0a0a0a);
}
.lb-av-sm { width: 30px; height: 30px; font-size: .64rem; }
.lb-av-photo-wrap { position: relative; overflow: hidden; padding: 0; }
.lb-av-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-av-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }

/* ── Category groups body ────────────────────────────────────────── */
.lb-body { padding: 36px 0 60px; background: #faf9f6; }
.lb-group { margin-bottom: 14px; }
.lb-group-count { font-size: .64rem; color: #a89a78; font-weight: 700; text-transform: none; letter-spacing: 0; margin-left: 6px; }

.lb-cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: #eee; }
@media (max-width: 767px) { .lb-cats { grid-template-columns: 1fr; } }
.lb-cat { background: #fff; padding: 18px 20px 20px; }
.lb-cat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.lb-cat-head h3 { font-size: .86rem; font-weight: 700; line-height: 1.35; margin: 0; }
.lb-cat-head a { font-size: .74rem; font-weight: 700; color: #be9b3f; text-decoration: none; white-space: nowrap; }
.lb-cat-head a:hover { color: #8f7429; text-decoration: none; }
.lb-cat-empty { font-size: .78rem; color: #999; margin: 0; }

.lb-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.lb-row + .lb-row { border-top: 1px solid #f0f0f0; }
.lb-row-who { flex: 1; min-width: 0; }
.lb-row-who b { display: block; font-size: .82rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #0a0a0a; }
.lb-row-who small { display: block; font-size: .7rem; color: #888; }
.lb-row-who .vote-bar-container { margin-bottom: 0; margin-top: 4px; }
.lb-row-votes { font-size: .78rem; font-weight: 800; color: #0a0a0a; text-align: right; flex-shrink: 0; }

/* vote-bar-fill starts at 0 width, animated in via JS setting data-w -> width */
.vote-bar-fill { width: 0; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 991px) {
    .lb-hero { padding: 36px 0 32px; }
    .lb-stats { gap: 20px; }
}

@media (max-width: 767px) {
    .lb-hero { background-position: center 15%; padding: 30px 0 26px; }
    .lb-hero::before { background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.72) 60%, rgba(0,0,0,.85) 100%); }
    .lb-hero-sub { font-size: .85rem; }
    .lb-pills { margin-top: 18px; gap: 6px; }
    .lb-pills .nom-event-pill { font-size: .74rem; padding: 6px 12px; }
    .lb-leading { margin-top: 20px; padding: 14px; max-width: 100%; }
    .lb-leading-info b { font-size: .8rem; }
    .lb-leading-votes { font-size: .8rem; }
    .lb-stats { gap: 22px; margin-top: 22px; }
    .lb-stat b { font-size: 1.15rem; }
    .lb-body { padding: 26px 0 44px; }
    .lb-cat { padding: 16px; }
    .lb-cat-head { flex-direction: column; align-items: flex-start; gap: 4px; }
    .lb-cat-head h3 { font-size: .82rem; }
    .lb-cat-head a { align-self: flex-start; }
    .lb-row-who b { white-space: normal; }
    .cat-group-summary { font-size: .62rem; padding: 10px 12px; }
    .lb-group-count { display: block; margin-left: 0; margin-top: 2px; }
}

@media (max-width: 480px) {
    .lb-hero h1 { font-size: 1.35rem; }
    .lb-eyebrow { font-size: .64rem; }
    .lb-av { width: 34px; height: 34px; font-size: .68rem; }
    .lb-av-sm { width: 26px; height: 26px; font-size: .58rem; }
    .lb-medal { width: 16px; font-size: .88rem; }
    .lb-leading-votes, .lb-row-votes { font-size: .74rem; }
    .lb-stats { gap: 16px; }
    .lb-stat b { font-size: 1.02rem; }
    .lb-stat span { font-size: .6rem; }
}
