/* ============================================================================
   Meshpoint Leaderboard
   Tokens reused from landing.css (--accent-radar, --bg-deep, etc.)
   ============================================================================ */

:root {
    --lb-card-bg: rgba(15, 24, 39, 0.65);
    --lb-card-border: rgba(0, 229, 160, 0.14);
    --lb-card-border-strong: rgba(0, 229, 160, 0.32);
    --lb-row-bg: rgba(11, 18, 32, 0.55);
    --lb-text: #e2e8f0;
    --lb-text-dim: #94a3b8;
    --lb-text-faint: #64748b;
    --lb-gold: #fbbf24;
    --lb-silver: #cbd5e1;
    --lb-bronze: #d97706;
    --lb-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

body {
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 229, 160, 0.08), transparent 60%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(56, 189, 248, 0.05), transparent 60%),
        var(--bg-deep, #050810);
    color: var(--lb-text);
    min-height: 100vh;
    font-family: 'Inter', system-ui, sans-serif;
}

/* =============================================================
   Top Bar
   ============================================================= */
.lb-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    background: rgba(5, 8, 16, 0.78);
    border-bottom: 1px solid rgba(0, 229, 160, 0.08);
}
.lb-topbar__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.lb-topbar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--lb-text);
    text-decoration: none;
}
.lb-topbar__logo {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(0, 229, 160, 0.08);
    border: 1px solid rgba(0, 229, 160, 0.2);
}
.lb-topbar__name {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.lb-topbar__name > span:first-child {
    font-weight: 700;
    font-size: 16px;
}
.lb-topbar__tag {
    font-size: 11px;
    color: var(--lb-text-faint);
    letter-spacing: 0.04em;
}

.lb-topbar__kpi {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 8px 18px;
    background: rgba(11, 18, 32, 0.6);
    border: 1px solid var(--lb-card-border);
    border-radius: 999px;
    margin-left: auto;
}
.lb-kpi__live {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--lb-text-dim);
}
.lb-kpi__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #00e5a0;
    box-shadow: 0 0 0 0 rgba(0, 229, 160, 0.7);
    animation: lb-pulse 2s infinite;
}
.lb-kpi__stat {
    font-size: 12px;
    color: var(--lb-text-dim);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.lb-kpi__stat strong {
    color: var(--lb-text);
    font-family: var(--lb-mono);
    font-weight: 700;
    font-size: 13px;
    margin-right: 4px;
}

.lb-topbar__actions {
    display: flex;
    align-items: center;
    gap: 14px;
}
.lb-topbar__link {
    color: var(--lb-text-dim);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.15s;
}
.lb-topbar__link:hover { color: var(--lb-text); }
.lb-topbar__btn {
    padding: 8px 16px;
    border-radius: 8px;
    background: linear-gradient(135deg, #00e5a0 0%, #00b8d4 100%);
    color: #051018;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
    border: none;
}
.lb-topbar__btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 229, 160, 0.3);
}
.lb-topbar__btn--ghost {
    background: transparent;
    color: var(--lb-text);
    border: 1px solid var(--lb-card-border-strong);
}
.lb-topbar__btn--ghost:hover {
    background: rgba(0, 229, 160, 0.08);
    box-shadow: none;
    transform: translateY(-1px);
}
.lb-topbar__user {
    font-size: 13px;
    color: var(--lb-text-dim);
    font-weight: 500;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
[hidden] { display: none !important; }

/* =============================================================
   Main Layout
   ============================================================= */
.lb {
    max-width: 1180px;
    margin: 0 auto;
    padding: 48px 28px 80px;
}

/* Hero */
.lb__hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0;
    padding-bottom: 28px;
    margin-bottom: 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.lb__hero-inner {
    max-width: 720px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.lb__eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: #00e5a0;
    text-transform: uppercase;
    margin-bottom: 14px;
}
.lb__title {
    font-size: clamp(36px, 5vw, 52px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0 0 14px 0;
    background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.lb__sub {
    font-size: 16px;
    color: var(--lb-text-dim);
    margin: 0;
    max-width: 540px;
    line-height: 1.55;
    text-align: center;
}
.lb__hero-meta {
    position: absolute;
    top: 4px;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: 12px;
    color: var(--lb-text-faint);
    font-family: var(--lb-mono);
    white-space: nowrap;
}
@media (max-width: 720px) {
    .lb__hero-meta {
        position: static;
        align-items: center;
        margin-top: 18px;
    }
}

/* =============================================================
   Pill Bar
   ============================================================= */
.lb__pillbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.lb__pillbar-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--lb-text-faint);
    text-transform: uppercase;
}
.lb__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.lb-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px 7px 11px;
    background: rgba(15, 24, 39, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    color: var(--lb-text-dim);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
    cursor: pointer;
    user-select: none;
}
.lb-pill:hover {
    color: var(--lb-text);
    border-color: rgba(0, 229, 160, 0.25);
    background: rgba(0, 229, 160, 0.04);
}
.lb-pill__icon {
    display: inline-flex;
    width: 16px;
    height: 16px;
    align-items: center;
    justify-content: center;
    color: currentColor;
    opacity: 0.8;
}
.lb-pill__icon svg { width: 16px; height: 16px; }
.lb-pill--active {
    background: rgba(0, 229, 160, 0.12);
    border-color: rgba(0, 229, 160, 0.5);
    color: #00e5a0;
}
.lb-pill--active:hover {
    background: rgba(0, 229, 160, 0.16);
    color: #00e5a0;
}

/* =============================================================
   Category Card
   ============================================================= */
.lb__category-loading,
.lb-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--lb-text-dim);
    font-size: 14px;
}

.lb-card {
    background: var(--lb-card-bg);
    border: 1px solid var(--lb-card-border);
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
}
.lb-card--error {
    border-color: rgba(239, 68, 68, 0.2);
}
.lb-card__header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 18px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.lb-card__icon {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(0, 229, 160, 0.1);
    border: 1px solid rgba(0, 229, 160, 0.2);
    color: #00e5a0;
    flex-shrink: 0;
}
.lb-card__icon svg { width: 22px; height: 22px; }
.lb-card__heading { flex: 1; min-width: 0; }
.lb-card__title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: var(--lb-text);
    letter-spacing: -0.01em;
}
.lb-card__desc {
    font-size: 13px;
    color: var(--lb-text-dim);
    margin: 0;
    line-height: 1.5;
}
.lb-card__share {
    background: transparent;
    color: var(--lb-text-dim);
    border: 1px solid var(--lb-card-border);
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.lb-card__share:hover {
    color: #00e5a0;
    border-color: rgba(0, 229, 160, 0.4);
    background: rgba(0, 229, 160, 0.06);
}

/* =============================================================
   Podium (Top 3)
   ============================================================= */
.lb-podium {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    gap: 14px;
    align-items: end;
    margin-bottom: 32px;
}
.lb-podium__card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 18px 22px;
    background: var(--lb-row-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    text-align: center;
    color: var(--lb-text);
}
.lb-podium__card:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 229, 160, 0.3);
}
.lb-podium__card--gold {
    padding-top: 32px;
    padding-bottom: 28px;
    background: linear-gradient(160deg, rgba(251, 191, 36, 0.12) 0%, rgba(11, 18, 32, 0.7) 60%);
    border-color: rgba(251, 191, 36, 0.35);
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.1), 0 16px 40px rgba(251, 191, 36, 0.08);
    transform: translateY(-12px);
}
.lb-podium__card--gold:hover {
    transform: translateY(-16px);
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.2), 0 20px 48px rgba(251, 191, 36, 0.16);
}
.lb-podium__card--silver {
    background: linear-gradient(160deg, rgba(203, 213, 225, 0.08) 0%, rgba(11, 18, 32, 0.7) 60%);
    border-color: rgba(203, 213, 225, 0.18);
}
.lb-podium__card--bronze {
    background: linear-gradient(160deg, rgba(217, 119, 6, 0.08) 0%, rgba(11, 18, 32, 0.7) 60%);
    border-color: rgba(217, 119, 6, 0.2);
}
.lb-podium__card--empty {
    cursor: default;
    opacity: 0.5;
}
.lb-podium__card--empty:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.05);
}

.lb-podium__medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 2px;
}
.lb-podium__rank {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--lb-mono);
    font-weight: 700;
    font-size: 11px;
    color: rgba(5, 8, 16, 0.85);
}
.lb-podium__card--silver .lb-podium__rank,
.lb-podium__card--bronze .lb-podium__rank { color: rgba(255, 255, 255, 0.85); }
.lb-podium__card--empty .lb-podium__rank {
    position: static;
    color: var(--lb-text-faint);
    font-size: 18px;
}

.lb-podium__name-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
}
.lb-podium__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--lb-text);
    line-height: 1.25;
    word-break: break-word;
    max-width: 100%;
}
.lb-podium__card--gold .lb-podium__name {
    font-size: 16px;
}

.lb-pill-online {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #00e5a0;
}
.lb-pill-online__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00e5a0;
    animation: lb-pulse 2s infinite;
}

.lb-podium__score {
    font-family: var(--lb-mono);
    font-size: 26px;
    font-weight: 700;
    color: var(--lb-text);
    letter-spacing: -0.02em;
    margin-top: 6px;
}
.lb-podium__card--gold .lb-podium__score {
    font-size: 32px;
    color: #fcd34d;
    text-shadow: 0 0 24px rgba(251, 191, 36, 0.25);
}
.lb-podium__unit {
    font-size: 0.55em;
    color: var(--lb-text-faint);
    font-weight: 500;
    margin-left: 3px;
}

/* =============================================================
   Two-column ranking list (rank 4+)
   ============================================================= */
.lb-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
}
.lb-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.lb-row {
    display: grid;
    grid-template-columns: 36px 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background 0.12s ease;
}
.lb-row:hover {
    background: rgba(0, 229, 160, 0.04);
}
.lb-row__rank {
    font-family: var(--lb-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--lb-text-faint);
    text-align: right;
}
.lb-row__name {
    font-size: 14px;
    font-weight: 500;
    color: var(--lb-text);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.12s;
}
.lb-row__name:hover { color: #00e5a0; }
.lb-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.35);
    flex-shrink: 0;
}
.lb-dot--online {
    background: #00e5a0;
    box-shadow: 0 0 0 0 rgba(0, 229, 160, 0.5);
    animation: lb-pulse-soft 2.4s infinite;
}
.lb-row__score {
    font-family: var(--lb-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--lb-text);
    text-align: right;
    min-width: 70px;
}
.lb-row__unit {
    font-size: 0.72em;
    color: var(--lb-text-faint);
    font-weight: 500;
    margin-left: 3px;
}

/* =============================================================
   Methodology
   ============================================================= */
.lb__methodology {
    margin-top: 28px;
}
.lb-method {
    background: rgba(11, 18, 32, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    padding: 24px 28px;
}
.lb-method__title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--lb-text-faint);
    margin: 0 0 10px 0;
}
.lb-method__body {
    font-size: 14px;
    line-height: 1.6;
    color: var(--lb-text-dim);
    margin: 0 0 14px 0;
}
.lb-method__note {
    font-size: 13px;
    color: var(--lb-text-faint);
    margin: 0;
}
.lb-method__note a {
    color: #00e5a0;
    text-decoration: none;
    font-weight: 500;
}
.lb-method__note a:hover { text-decoration: underline; }

/* =============================================================
   Footer
   ============================================================= */
.lb__footer {
    margin-top: 56px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    text-align: center;
    font-size: 13px;
    color: var(--lb-text-faint);
}
.lb__footer a {
    color: var(--lb-text-dim);
    text-decoration: none;
    transition: color 0.15s;
}
.lb__footer a:hover { color: #00e5a0; }
.lb__footer-sep {
    margin: 0 12px;
    color: rgba(148, 163, 184, 0.3);
}

/* =============================================================
   Animations
   ============================================================= */
@keyframes lb-pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 229, 160, 0.6); }
    70% { box-shadow: 0 0 0 6px rgba(0, 229, 160, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 229, 160, 0); }
}
@keyframes lb-pulse-soft {
    0% { box-shadow: 0 0 0 0 rgba(0, 229, 160, 0.45); }
    70% { box-shadow: 0 0 0 5px rgba(0, 229, 160, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 229, 160, 0); }
}

/* =============================================================
   Responsive
   ============================================================= */
@media (max-width: 900px) {
    .lb-topbar__inner { gap: 14px; flex-wrap: wrap; padding: 12px 18px; }
    .lb-topbar__kpi { order: 3; width: 100%; margin-left: 0; justify-content: center; }
    .lb-topbar__actions { gap: 10px; }
    .lb-topbar__link { display: none; }
    .lb { padding: 32px 18px 60px; }
    .lb__hero { flex-direction: column; align-items: flex-start; gap: 14px; }
    .lb__hero-meta { align-items: flex-start; flex-direction: row; gap: 8px; }
    .lb-card { padding: 20px; }
    .lb-card__header { flex-wrap: wrap; }
    .lb-card__share { margin-left: auto; }
    .lb-podium {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .lb-podium__card--gold { transform: none; padding-top: 24px; padding-bottom: 24px; order: -1; }
    .lb-podium__card--gold:hover { transform: translateY(-3px); }
    .lb-grid { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 520px) {
    .lb-topbar__btn--ghost { display: none; }
    .lb__title { font-size: 32px; }
    .lb-podium__score { font-size: 22px; }
    .lb-podium__card--gold .lb-podium__score { font-size: 28px; }
    .lb-row { grid-template-columns: 30px 1fr auto auto; gap: 8px; padding: 9px 10px; }
    .lb-row__score { min-width: 56px; font-size: 13px; }
    .lb-method { padding: 18px 20px; }
}
