/* Styles de la page classement.
   Ils etaient en ligne dans leaderboard.php : pres de 800 lignes
   retelechargees a chaque visite, sans mise en cache possible. */

    /* =============================================
       LEADERBOARD - REDESIGN PREMIUM
       Premium Deluxe Motorsport
    ============================================= */

    ::-webkit-scrollbar { display: none; }
    html { scrollbar-width: none; -ms-overflow-style: none; }

    @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

    :root {
        --red: #e63946;
        --red-light: #ff6b6b;
        --gold: #ffd700;
        --silver: #c0c0c0;
        --bronze: #cd7f32;
        --bg: #0d0d0f;
        --bg2: #111113;
        --bg3: #18181b;
        --card: rgba(255,255,255,0.04);
        --card-border: rgba(255,255,255,0.08);
        --text: #ffffff;
        --text-2: rgba(255,255,255,0.65);
        --text-3: rgba(255,255,255,0.35);
        --accent: #e63946;
    }

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

    body {
        margin: 0; padding: 0;
        background: var(--bg);
        color: var(--text);
        font-family: 'Inter', sans-serif;
        overflow-x: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.no-scroll {
        overflow: hidden;
        touch-action: none;
        height: 100vh;
    }

    /* ---- NAVBAR ---- */
    .navbar {
        position: fixed;
        top: 0; left: 0;
        width: 100vw;
        z-index: 4000;
    }

    .user-dropdown { position: relative; display: inline-block; }
    .user-dropdown-toggle {
        cursor: pointer;
        display: flex;
        align-items: center;
        min-width: 140px;
        justify-content: center;
    }
    .user-dropdown-menu {
        display: none;
        position: absolute;
        top: 100%; right: 0; left: 0;
        background: #1a1a1a;
        min-width: 100px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.4);
        border-radius: 10px;
        z-index: 2000;
        padding: 0.5rem 0;
        margin-top: 0;
    }
    .user-dropdown.open .user-dropdown-menu { display: block; }
    .user-dropdown-menu a {
        display: block;
        padding: 0.7rem 1.5rem;
        color: #fff;
        text-decoration: none;
        font-size: 1rem;
        transition: background 0.2s;
    }
    .user-dropdown-menu a:hover { background: var(--red); color: #fff; }
    .user-dropdown-menu hr { border: none; border-top: 1px solid #444; margin: 0.3rem 0; }
    .user-dropdown-menu a.logout-link { white-space: nowrap; }

    /* Notification Bell */
    .notification-bell-container {
        position: relative; display: inline-flex; align-items: center;
        margin-left: 1rem; vertical-align: middle; margin-top: -4px;
    }
    .notification-bell-wrapper {
        position: relative; cursor: pointer; padding: 0.5rem;
        border-radius: 8px; transition: all 0.3s ease;
        display: flex; align-items: center; justify-content: center;
        width: 40px; height: 40px; box-sizing: border-box;
        transform: translateY(-4px);
    }
    .notification-bell-wrapper:hover { background: rgba(255, 107, 107, 0.1); }
    .notification-bell-wrapper i { font-size: 1.2rem; color: #fff; transition: transform 0.3s ease; }
    .notification-bell-wrapper:hover i { transform: scale(1.1); }
    .notification-badge-client {
        position: absolute; top: 0; right: 0;
        background: #ff6b6b; color: white; border-radius: 50%;
        width: 18px; height: 18px; display: flex; align-items: center;
        justify-content: center; font-size: 0.7rem; font-weight: 700;
        border: 2px solid #1a1a1a; transform: translate(25%, -25%);
        animation: pulse-notification 2s infinite;
    }
    .notification-badge-client.hidden { display: none !important; }
    @keyframes pulse-notification {
        0%, 100% { transform: translate(25%, -25%) scale(1); box-shadow: 0 0 0 0 rgba(255,107,107,0.7); }
        50% { transform: translate(25%, -25%) scale(1.1); box-shadow: 0 0 0 4px rgba(255,107,107,0); }
    }
    .notification-dropdown {
        display: none; position: absolute;
        top: calc(100% + 10px); right: 0;
        width: 350px; max-width: 90vw;
        background: #1a1a1a;
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 12px;
        box-shadow: 0 8px 32px rgba(0,0,0,0.4);
        z-index: 3000; overflow: hidden;
    }
    .notification-dropdown.open { display: block; animation: slideDown 0.3s ease-out; }
    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }
    .notification-dropdown-header {
        display: flex; justify-content: space-between; align-items: center;
        padding: 1rem 1.25rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        background: rgba(255,107,107,0.05);
    }
    .notification-dropdown-header h3 { margin: 0; color: #fff; font-size: 1.1rem; font-weight: 600; }
    .notification-close { background: none; border: none; color: #888; cursor: pointer; font-size: 1.1rem; padding: 0.25rem; transition: color 0.2s; }
    .notification-close:hover { color: #fff; }
    .notification-dropdown-content {
        max-height: 400px; overflow-y: auto;
        scrollbar-width: thin; scrollbar-color: rgba(255,107,107,0.3) transparent;
    }
    .notification-dropdown-content::-webkit-scrollbar { width: 6px; }
    .notification-dropdown-content::-webkit-scrollbar-track { background: transparent; }
    .notification-dropdown-content::-webkit-scrollbar-thumb { background: rgba(255,107,107,0.3); border-radius: 3px; }
    .notification-loading, .notification-empty { padding: 2rem; text-align: center; color: #888; }
    .notification-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; }
    .notification-loading i, .notification-empty i { font-size: 2rem; margin-bottom: 0.5rem; display: block; }
    .notification-list { padding: 0.5rem 0; }
    .notification-item {
        padding: 1rem 1.25rem;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        cursor: pointer; transition: background 0.2s;
        display: flex; align-items: flex-start; gap: 0.75rem;
    }
    .notification-item:hover { background: rgba(255,107,107,0.1); }
    .notification-item.unread { background: rgba(255,107,107,0.05); border-left: 3px solid #ff6b6b; }
    .notification-icon {
        width: 32px; height: 32px;
        background: linear-gradient(135deg, #ff6b6b, #e63946);
        border-radius: 8px; display: flex; align-items: center;
        justify-content: center; color: white; font-size: 0.9rem; flex-shrink: 0;
    }
    .notification-content { flex: 1; min-width: 0; }
    .notification-title { font-weight: 600; color: #fff; font-size: 0.9rem; margin-bottom: 0.25rem; }
    .notification-message { color: #aaa; font-size: 0.85rem; line-height: 1.4; word-wrap: break-word; }
    .notification-time { color: #666; font-size: 0.75rem; margin-top: 0.25rem; }
    .notification-dropdown-footer {
        padding: 0.75rem 1.25rem;
        border-top: 1px solid rgba(255,255,255,0.1);
        background: rgba(0,0,0,0.2);
        display: flex; flex-direction: column; gap: 0.5rem;
    }
    .notification-mark-all-read {
        display: flex; align-items: center; justify-content: center; gap: 0.5rem;
        background: rgba(255,107,107,0.1); border: 1px solid rgba(255,107,107,0.3);
        color: #ff6b6b; text-decoration: none; font-size: 0.9rem; font-weight: 500;
        padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer;
        transition: all 0.2s; width: 100%;
    }
    .notification-mark-all-read:hover { background: rgba(255,107,107,0.2); border-color: rgba(255,107,107,0.5); color: #fff; }
    .notification-mark-all-read:disabled { opacity: 0.5; cursor: not-allowed; }
    .notification-view-all {
        display: flex; align-items: center; justify-content: center; gap: 0.5rem;
        color: #ff6b6b; text-decoration: none; font-size: 0.9rem;
        font-weight: 500; transition: color 0.2s;
    }
    .notification-view-all:hover { color: #fff; }

    /* Podium Logo Link */
    .podium-logo-link {
        display: inline-flex; align-items: center;
        margin-left: -1rem; text-decoration: none;
        vertical-align: middle; margin-top: -4px;
    }
    .podium-logo-wrapper {
        position: relative; cursor: pointer; padding: 0.5rem;
        border-radius: 8px; transition: all 0.3s ease;
        display: flex; align-items: center; justify-content: center;
        background: linear-gradient(135deg, rgba(255,215,0,0.1), rgba(255,215,0,0.05));
        border: 1px solid rgba(255,215,0,0.2);
        width: 40px; height: 40px; box-sizing: border-box;
    }
    .podium-logo-wrapper:hover {
        background: linear-gradient(135deg, rgba(255,215,0,0.2), rgba(255,215,0,0.1));
        border-color: rgba(255,215,0,0.4);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(255,215,0,0.3);
    }
    .podium-logo-wrapper i { font-size: 1.2rem; color: #ffd700; transition: transform 0.3s ease; }
    .podium-logo-wrapper:hover i { transform: scale(1.15) rotate(-5deg); color: #ffed4e; }

    /* --- MAIN LAYOUT --- */
    .main-content {
        margin-top: 72px;
        min-height: calc(100vh - 72px);
        background: var(--bg);
    }

    /* ---- HERO HEADER ---- */
    .lb-hero {
        position: relative;
        overflow: hidden;
        padding: 3.5rem 2rem 2rem;
        text-align: center;
        background: linear-gradient(180deg, rgba(230,57,70,0.08) 0%, transparent 100%);
    }
    .lb-hero::before {
        content: '';
        position: absolute;
        top: -120px; left: 50%; transform: translateX(-50%);
        width: 700px; height: 350px;
        background: radial-gradient(ellipse at center, rgba(230,57,70,0.18) 0%, transparent 70%);
        pointer-events: none;
    }
    .lb-hero-badge {
        display: inline-flex; align-items: center; gap: 0.5rem;
        background: rgba(230,57,70,0.12);
        border: 1px solid rgba(230,57,70,0.25);
        color: var(--red-light);
        font-size: 0.8rem; font-weight: 600;
        padding: 0.35rem 1rem; border-radius: 100px;
        text-transform: uppercase; letter-spacing: 1.5px;
        margin-bottom: 1rem;
    }
    .lb-hero-title {
        font-size: clamp(2rem, 5vw, 3.5rem);
        font-weight: 900;
        line-height: 1.1;
        margin: 0 0 0.75rem;
        background: linear-gradient(135deg, #fff 30%, rgba(255,255,255,0.55) 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    .lb-hero-subtitle {
        color: var(--text-2);
        font-size: 1rem;
        max-width: 500px;
        margin: 0 auto;
        line-height: 1.6;
    }

    /* ---- LEADERBOARD WRAPPER ---- */
    .leaderboard-wrapper {
        max-width: 1100px;
        margin: 0 auto;
        padding: 0 1.5rem 4rem;
    }

    /* ---- FILTER BAR ---- */
    .lb-filters {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 2rem;
    }

    .lb-filter-row {
        display: flex;
        justify-content: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .lb-filter-label {
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        color: var(--text-3);
        text-align: center;
        margin-bottom: 0.25rem;
    }

    /* Pill-style tabs */
    .lb-pill-group {
        display: flex;
        background: rgba(255,255,255,0.04);
        border: 1px solid rgba(255,255,255,0.07);
        border-radius: 100px;
        padding: 4px;
        gap: 2px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .lb-pill {
        padding: 0.5rem 1.1rem;
        border-radius: 100px;
        border: none;
        background: transparent;
        color: var(--text-2);
        font-size: 0.85rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.25s ease;
        white-space: nowrap;
        font-family: 'Inter', sans-serif;
        display: flex; align-items: center; gap: 0.4rem;
    }
    .lb-pill:hover { color: var(--text); background: rgba(255,255,255,0.06); }
    .lb-pill.active {
        background: var(--red);
        color: #fff;
        font-weight: 600;
        box-shadow: 0 2px 12px rgba(230,57,70,0.4);
    }
    .lb-pill i { font-size: 0.8em; }

    /* Sub-category pills — smaller variant */
    .lb-sub-pill-group {
        display: flex;
        justify-content: center;
        gap: 0.4rem;
        flex-wrap: wrap;
    }
    .lb-sub-pill {
        padding: 0.4rem 1rem;
        border-radius: 100px;
        border: 1.5px solid rgba(255,255,255,0.08);
        background: transparent;
        color: var(--text-3);
        font-size: 0.8rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.25s ease;
        white-space: nowrap;
        font-family: 'Inter', sans-serif;
    }
    .lb-sub-pill:hover { border-color: rgba(230,57,70,0.4); color: var(--text); }
    .lb-sub-pill.active {
        border-color: rgba(230,57,70,0.6);
        background: rgba(230,57,70,0.12);
        color: var(--red-light);
        font-weight: 600;
    }

    /* ---- PODIUM ---- */
    .podium-section {
        margin-bottom: 2.5rem;
    }
    .podium-section-title {
        text-align: center;
        font-size: 0.72rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 2px;
        color: var(--text-3);
        margin-bottom: 1.5rem;
    }

    .podium-stage {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        align-items: flex-end;
        gap: 0.75rem;
        max-width: 720px;
        margin: 0 auto;
    }

    .podium-card {
        position: relative;
        border-radius: 20px;
        padding: 1.5rem 1.25rem;
        text-align: center;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        cursor: default;
        display: flex;
        flex-direction: column;
        align-items: center;
        background: var(--card);
        border: 1px solid var(--card-border);
        backdrop-filter: blur(20px);
    }
    .podium-card:hover { transform: translateY(-4px); }

    /* 1st place — tallest and most prominent */
    .podium-card.pos-1 {
        order: 2;
        background: linear-gradient(160deg, rgba(255,215,0,0.08), rgba(255,215,0,0.02));
        border-color: rgba(255,215,0,0.22);
        box-shadow: 0 0 40px rgba(255,215,0,0.08), 0 8px 32px rgba(0,0,0,0.4);
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    .podium-card.pos-2 {
        order: 1;
        background: linear-gradient(160deg, rgba(192,192,192,0.06), rgba(192,192,192,0.01));
        border-color: rgba(192,192,192,0.15);
        box-shadow: 0 4px 24px rgba(0,0,0,0.3);
    }
    .podium-card.pos-3 {
        order: 3;
        background: linear-gradient(160deg, rgba(205,127,50,0.06), rgba(205,127,50,0.01));
        border-color: rgba(205,127,50,0.15);
        box-shadow: 0 4px 24px rgba(0,0,0,0.3);
    }

    /* Crown / medal badge */
    .podium-medal {
        position: absolute;
        top: -18px;
        left: 50%; transform: translateX(-50%);
        font-size: 2rem;
        line-height: 1;
        filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
    }
    .podium-card.pos-1 .podium-medal { font-size: 2.4rem; top: -22px; }

    /* Avatar */
    .podium-avatar {
        width: 72px; height: 72px;
        border-radius: 50%;
        object-fit: cover;
        margin: 0.75rem auto 0.75rem;
        border: 3px solid;
        display: block;
        flex-shrink: 0;
    }
    .podium-card.pos-1 .podium-avatar { width: 88px; height: 88px; border-color: var(--gold); border-width: 4px; }
    .podium-card.pos-2 .podium-avatar { border-color: var(--silver); }
    .podium-card.pos-3 .podium-avatar { border-color: var(--bronze); }

    .podium-avatar-placeholder {
        border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
        font-weight: 800;
        color: #fff;
        flex-shrink: 0;
        margin: 0.75rem auto 0.75rem;
        background: linear-gradient(135deg, #e63946, #ff6b6b);
        border: 3px solid;
    }
    .podium-card.pos-1 .podium-avatar-placeholder { width: 88px; height: 88px; font-size: 2.2rem; border-color: var(--gold); border-width: 4px; }
    .podium-card.pos-2 .podium-avatar-placeholder { width: 72px; height: 72px; font-size: 1.8rem; border-color: var(--silver); }
    .podium-card.pos-3 .podium-avatar-placeholder { width: 72px; height: 72px; font-size: 1.8rem; border-color: var(--bronze); }

    .podium-name {
        font-weight: 700;
        font-size: 0.95rem;
        color: var(--text);
        margin: 0 0 0.35rem;
        line-height: 1.3;
        word-break: break-word;
    }
    .podium-card.pos-1 .podium-name { font-size: 1.05rem; }

    .podium-value-pill {
        display: inline-flex;
        align-items: center;
        gap: 0.3rem;
        padding: 0.3rem 0.75rem;
        border-radius: 100px;
        font-size: 0.85rem;
        font-weight: 700;
        margin-top: 0.25rem;
    }
    .podium-card.pos-1 .podium-value-pill {
        background: rgba(255,215,0,0.12);
        color: var(--gold);
        border: 1px solid rgba(255,215,0,0.25);
        font-size: 0.95rem;
    }
    .podium-card.pos-2 .podium-value-pill {
        background: rgba(192,192,192,0.08);
        color: var(--silver);
        border: 1px solid rgba(192,192,192,0.18);
    }
    .podium-card.pos-3 .podium-value-pill {
        background: rgba(205,127,50,0.08);
        color: var(--bronze);
        border: 1px solid rgba(205,127,50,0.18);
    }

    .podium-label {
        font-size: 0.68rem;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        color: var(--text-3);
        margin-top: 0.35rem;
    }

    /* Podium pedestals (visual steps) */
    .podium-pedestal {
        height: 8px;
        border-radius: 0 0 12px 12px;
        margin: 0.75rem -1.25rem -1.5rem;
        opacity: 0.5;
    }
    .podium-card.pos-1 .podium-pedestal { background: var(--gold); height: 14px; opacity: 0.6; }
    .podium-card.pos-2 .podium-pedestal { background: var(--silver); }
    .podium-card.pos-3 .podium-pedestal { background: var(--bronze); }

    /* Empty podium state */
    .podium-empty {
        text-align: center;
        padding: 3rem;
        color: var(--text-3);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    .podium-empty i { font-size: 2.5rem; color: rgba(230,57,70,0.4); }

    /* ---- PROGRESS BANNER (user position) ---- */
    .lb-user-banner {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 1rem 1.5rem;
        background: linear-gradient(135deg, rgba(230,57,70,0.1), rgba(230,57,70,0.04));
        border: 1px solid rgba(230,57,70,0.2);
        border-radius: 14px;
        margin-bottom: 1.75rem;
        flex-wrap: wrap;
    }
    .lb-user-banner i {
        font-size: 1.2rem;
        color: var(--red-light);
        flex-shrink: 0;
    }
    .lb-user-banner-text {
        flex: 1;
        color: var(--text-2);
        font-size: 0.92rem;
        line-height: 1.6;
    }
    .lb-user-banner-text .highlight {
        color: var(--red-light);
        font-weight: 700;
        cursor: pointer;
    }
    .lb-user-banner-text .highlight:hover { text-decoration: underline; }

    /* ---- RANKING LIST ---- */
    .lb-list {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .lb-list-header {
        display: grid;
        grid-template-columns: 56px 1fr 160px;
        padding: 0 1rem 0.5rem;
        align-items: center;
    }
    .lb-list-header-cell {
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1.2px;
        color: var(--text-3);
    }
    .lb-list-header-cell.right { text-align: right; }

    .lb-row {
        display: grid;
        grid-template-columns: 56px 1fr 160px;
        align-items: center;
        padding: 0.9rem 1rem;
        background: var(--card);
        border: 1px solid var(--card-border);
        border-radius: 14px;
        transition: all 0.2s ease;
        cursor: default;
    }
    .lb-row:hover {
        background: rgba(255,255,255,0.06);
        border-color: rgba(255,255,255,0.12);
        transform: translateX(3px);
    }
    .lb-row.rank-1 { border-color: rgba(255,215,0,0.2); background: rgba(255,215,0,0.04); }
    .lb-row.rank-2 { border-color: rgba(192,192,192,0.18); background: rgba(192,192,192,0.03); }
    .lb-row.rank-3 { border-color: rgba(205,127,50,0.18); background: rgba(205,127,50,0.03); }
    .lb-row.current-user {
        border-color: rgba(230,57,70,0.3) !important;
        background: rgba(230,57,70,0.06) !important;
        box-shadow: 0 0 0 1px rgba(230,57,70,0.15);
    }

    /* Rank cell */
    .lb-rank {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px; height: 36px;
        border-radius: 10px;
        font-size: 0.95rem;
        font-weight: 800;
        color: var(--text-2);
        background: rgba(255,255,255,0.04);
    }
    .lb-row.rank-1 .lb-rank { background: rgba(255,215,0,0.12); color: var(--gold); }
    .lb-row.rank-2 .lb-rank { background: rgba(192,192,192,0.1); color: var(--silver); }
    .lb-row.rank-3 .lb-rank { background: rgba(205,127,50,0.1); color: var(--bronze); }

    /* User cell */
    .lb-user {
        display: flex;
        align-items: center;
        gap: 0.85rem;
        min-width: 0;
    }
    .lb-avatar {
        width: 42px; height: 42px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid rgba(255,255,255,0.1);
        flex-shrink: 0;
    }
    .lb-avatar-placeholder {
        width: 42px; height: 42px;
        border-radius: 50%;
        background: linear-gradient(135deg, #e63946, #ff6b6b);
        color: #fff;
        font-weight: 700;
        font-size: 1.1rem;
        display: flex; align-items: center; justify-content: center;
        flex-shrink: 0;
        border: 2px solid rgba(255,255,255,0.1);
    }
    .lb-user-info { min-width: 0; }
    .lb-user-name {
        font-weight: 600;
        font-size: 0.92rem;
        color: var(--text);
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .lb-user-id {
        font-size: 0.76rem;
        color: var(--text-3);
        margin-top: 1px;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }

    /* Stat cell */
    .lb-stat {
        text-align: right;
        font-weight: 600;
        font-size: 0.9rem;
        color: var(--text);
    }
    .lb-stat-sub {
        font-size: 0.72rem;
        color: var(--text-3);
        margin-top: 1px;
    }

    /* Loading / empty states */
    .lb-state {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        padding: 4rem 2rem;
        color: var(--text-3);
        text-align: center;
    }
    .lb-state i { font-size: 2.5rem; color: rgba(230,57,70,0.5); }
    .lb-state p { margin: 0; font-size: 0.95rem; }

    /* ---- SCROLL TO TOP ---- */
    .scroll-to-top {
        position: fixed;
        bottom: 28px; right: 28px;
        width: 46px; height: 46px;
        background: linear-gradient(135deg, var(--red), var(--red-light));
        border: none; border-radius: 50%;
        color: #fff; font-size: 1rem;
        cursor: pointer;
        display: none; align-items: center; justify-content: center;
        box-shadow: 0 4px 20px rgba(230,57,70,0.45);
        transition: all 0.3s ease;
        z-index: 1000;
        opacity: 0; transform: translateY(20px);
    }
    .scroll-to-top.show { display: flex; opacity: 1; transform: translateY(0); }
    .scroll-to-top:hover { transform: translateY(-4px); box-shadow: 0 6px 28px rgba(230,57,70,0.65); }

    /* ---- FOOTER ---- */
    .lb-footer {
        background: rgba(255,255,255,0.02);
        border-top: 1px solid rgba(255,255,255,0.06);
        padding: 1.5rem;
        text-align: center;
        color: var(--text-3);
        font-size: 0.85rem;
        margin-top: 2rem;
    }
    .lb-footer a { color: var(--red-light); text-decoration: none; }
    .lb-footer a:hover { text-decoration: underline; }

    /* ---- RESPONSIVE ---- */
    @media (max-width: 768px) {
        .main-content { margin-top: 60px; }
        .lb-hero { padding: 2.5rem 1rem 1.5rem; }
        .leaderboard-wrapper { padding: 0 0.75rem 3rem; }

        .lb-pill-group {
            overflow-x: auto;
            flex-wrap: nowrap;
            justify-content: flex-start;
            border-radius: 14px;
            scrollbar-width: none;
        }
        .lb-pill-group::-webkit-scrollbar { display: none; }
        .lb-pill { flex-shrink: 0; }

        .lb-sub-pill-group {
            overflow-x: auto;
            flex-wrap: nowrap;
            justify-content: flex-start;
            scrollbar-width: none;
        }
        .lb-sub-pill-group::-webkit-scrollbar { display: none; }
        .lb-sub-pill { flex-shrink: 0; }

        .podium-stage {
            gap: 0.5rem;
        }
        .podium-card { padding: 1.25rem 0.75rem; border-radius: 14px; }
        .podium-card.pos-1 { padding-top: 1.75rem; padding-bottom: 1.75rem; }
        .podium-card.pos-1 .podium-avatar,
        .podium-card.pos-1 .podium-avatar-placeholder { width: 70px; height: 70px; }
        .podium-card.pos-2 .podium-avatar,
        .podium-card.pos-2 .podium-avatar-placeholder,
        .podium-card.pos-3 .podium-avatar,
        .podium-card.pos-3 .podium-avatar-placeholder { width: 58px; height: 58px; }
        .podium-avatar-placeholder.pos-1-av { font-size: 1.7rem; }
        .podium-name { font-size: 0.8rem; }
        .podium-value-pill { font-size: 0.75rem; padding: 0.25rem 0.6rem; }
        .podium-label { font-size: 0.6rem; }
        .podium-medal { font-size: 1.6rem; top: -14px; }
        .podium-card.pos-1 .podium-medal { font-size: 2rem; top: -18px; }

        .lb-list-header { display: none; }
        .lb-row { grid-template-columns: 44px 1fr auto; gap: 0.5rem; padding: 0.8rem 0.75rem; }
        .lb-stat { font-size: 0.85rem; }
        .lb-user-name { font-size: 0.85rem; }
        .lb-avatar, .lb-avatar-placeholder { width: 36px; height: 36px; font-size: 0.95rem; }
        .lb-rank { width: 30px; height: 30px; font-size: 0.8rem; }
    }

    @media (max-width: 480px) {
        .lb-hero-title { font-size: 1.8rem; }
        .lb-user-banner { padding: 0.9rem 1rem; }
        .lb-user-banner-text { font-size: 0.85rem; }
        .scroll-to-top { bottom: 16px; right: 16px; width: 40px; height: 40px; font-size: 0.9rem; }
    }

    /* Mobile notification adjustments */
    @media (max-width: 768px) {
        .notification-bell-container { position: relative; z-index: 3001; }
        .notification-dropdown { right: -4rem !important; left: auto !important; width: calc(100vw - 2rem); max-width: 350px; }
        .notification-dropdown.open { right: -4rem !important; left: auto !important; }
        #nav-menu, #user-menu { overflow: visible !important; }
    }
    @media (max-width: 480px) {
        .notification-dropdown { width: calc(100vw - 1rem) !important; max-width: calc(100vw - 1rem) !important; right: -3rem !important; }
        .notification-dropdown.open { right: -3rem !important; left: auto !important; }
    }
    @media (max-width: 900px) {
        .user-dropdown-menu a.logout-link { white-space: nowrap; }
    }
