/* ==========================================================================
   🌌 NEXTEDU NEXUS — ELITE COMPETITIVE LEADERBOARD (v2.0.0)
   Obsidian + Glass + Aqua/Blue EdTech Design System
   Hardware-accelerated 60FPS • Zero Jank • Mobile-First Responsive
   ========================================================================== */

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

/* ==========================================================================
   1. NEXUS DESIGN TOKENS (Chocolaty Dark & Frosted White/Purple Light)
   ========================================================================== */
:root, [data-theme="dark"] {
    --nexus-bg: #140e0c;
    --nexus-bg-alt: #1a120f;
    --nexus-bg-gradient: radial-gradient(circle at 50% 0%, #2a1813 0%, #140e0c 70%);
    --nexus-surface: #1d1512;
    --nexus-surface-card: #201714;
    --nexus-surface-hover: #261c18;
    --nexus-surface-solid: #1d1512;
    --nexus-glass: rgba(29, 21, 18, 0.94);
    --nexus-glass-border: rgba(255, 255, 255, 0.08);
    --nexus-glass-border-hover: rgba(16, 185, 129, 0.45);
    --nexus-text: #f8fafc;
    --nexus-text-muted: #cbd5e1;
    --nexus-text-dim: #94a3b8;
    --nexus-primary: #10b981;
    --nexus-primary-hover: #059669;
    --nexus-primary-light: rgba(16, 185, 129, 0.12);
    --nexus-cyan: #10b981;
    --nexus-blue: #3b82f6;
    --nexus-purple: #10b981;
    --nexus-amber: #f59e0b;
    --nexus-emerald: #10b981;
    --nexus-rose: #ef4444;
    
    /* Podium Rank Tones */
    --nexus-gold: #fbbf24;
    --nexus-gold-glow: rgba(251, 191, 36, 0.28);
    --nexus-gold-border: rgba(251, 191, 36, 0.5);
    --nexus-silver: #94a3b8;
    --nexus-silver-glow: rgba(148, 163, 184, 0.2);
    --nexus-silver-border: rgba(148, 163, 184, 0.4);
    --nexus-bronze: #d97706;
    --nexus-bronze-glow: rgba(217, 119, 6, 0.22);
    --nexus-bronze-border: rgba(217, 119, 6, 0.45);
    
    --card-border: rgba(16, 185, 129, 0.2);
    --card-bg: rgba(29, 21, 18, 0.94);
    --input-bg: #241a16;
    
    --nexus-shadow: 0 16px 44px rgba(0, 0, 0, 0.6);
    --nexus-glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    --nexus-glow-cyan: 0 0 25px rgba(16, 185, 129, 0.25);
    --nexus-font: 'Poppins', sans-serif;
    --nexus-font-heading: 'Outfit', sans-serif;
    --nexus-font-mono: 'Orbitron', monospace;
    --nexus-header-height: 72px;
    --nexus-bottom-nav-height: 68px;
    --nexus-max-width: 860px;
    --nexus-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
    --nexus-bg: #fbf9fe;
    --nexus-bg-alt: #f3eefc;
    --nexus-bg-gradient: radial-gradient(circle at 50% 0%, #ede8f5 0%, #fbf9fe 85%);
    --nexus-surface: #ffffff;
    --nexus-surface-card: #ffffff;
    --nexus-surface-hover: #faf7ff;
    --nexus-surface-solid: #ffffff;
    --nexus-glass: rgba(255, 255, 255, 0.94);
    --nexus-glass-border: rgba(124, 58, 237, 0.12);
    --nexus-glass-border-hover: rgba(124, 58, 237, 0.4);
    --nexus-text: #1e1b4b;
    --nexus-text-muted: #5b5570;
    --nexus-text-dim: #8b859e;
    --nexus-primary: #7c3aed;
    --nexus-primary-hover: #6d28d9;
    --nexus-primary-light: rgba(124, 58, 237, 0.08);
    --nexus-cyan: #7c3aed;
    --nexus-blue: #6366f1;
    --nexus-purple: #7c3aed;
    --nexus-amber: #d97706;
    --nexus-emerald: #059669;
    --nexus-rose: #dc2626;
    
    --nexus-gold: #d97706;
    --nexus-gold-glow: rgba(217, 119, 6, 0.18);
    --nexus-gold-border: rgba(217, 119, 6, 0.45);
    --nexus-silver: #64748b;
    --nexus-silver-glow: rgba(100, 116, 139, 0.15);
    --nexus-silver-border: rgba(100, 116, 139, 0.35);
    --nexus-bronze: #b45309;
    --nexus-bronze-glow: rgba(180, 83, 9, 0.16);
    --nexus-bronze-border: rgba(180, 83, 9, 0.35);
    
    --card-border: rgba(124, 58, 237, 0.12);
    --card-bg: #ffffff;
    --input-bg: #f5f2fa;
    
    --nexus-shadow: 0 16px 40px rgba(124, 58, 237, 0.08);
    --nexus-glass-shadow: 0 8px 30px 0 rgba(124, 58, 237, 0.06);
    --nexus-glow-cyan: 0 4px 18px rgba(124, 58, 237, 0.15);
}

/* ==========================================================================
   2. RESET & BASE ARCHITECTURE
   ========================================================================== */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body.dashboard-body {
    background-color: var(--nexus-bg) !important;
    background-image: var(--nexus-bg-gradient) !important;
    color: var(--nexus-text) !important;
    font-family: var(--nexus-font) !important;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    padding-bottom: calc(var(--nexus-bottom-nav-height) + 110px) !important;
    overflow-x: hidden;
    position: relative;
    transition: background-color 0.35s ease, color 0.35s ease;
    user-select: none;
    -webkit-user-select: none;
}

input, textarea {
    user-select: text;
    -webkit-user-select: text;
}

/* 🌌 60FPS Ambient Blur Canvas */
.ambient-bg-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.32;
    transform: translate3d(0, 0, 0);
    animation: ambientFloat 20s infinite alternate ease-in-out;
    will-change: transform;
}

[data-theme="light"] .ambient-orb {
    opacity: 0.18;
    filter: blur(120px);
}

.ambient-orb-1 {
    width: 460px;
    height: 460px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.28) 0%, transparent 70%);
    top: -80px;
    left: 5%;
}

.ambient-orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.22) 0%, transparent 70%);
    top: 35%;
    right: -80px;
    animation-delay: -7s;
}

.ambient-orb-3 {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.18) 0%, transparent 70%);
    bottom: 8%;
    left: 15%;
    animation-delay: -14s;
}

@keyframes ambientFloat {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(24px, 30px, 0) scale(1.06); }
    100% { transform: translate3d(-20px, -24px, 0) scale(0.96); }
}

.ambient-glass-tint {
    position: absolute;
    inset: 0;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

/* Container */
.main-content {
    max-width: var(--nexus-max-width);
    margin: 0 auto;
    padding: 16px 18px;
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   3. APP HEADER (TOP BAR)
   ========================================================================== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    margin: 12px auto 20px;
    max-width: var(--nexus-max-width);
    background: var(--nexus-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--nexus-glass-border);
    border-radius: 24px;
    box-shadow: var(--nexus-glass-shadow);
    transition: all 0.3s var(--nexus-ease);
}

.header-greeting-box {
    display: flex;
    align-items: center;
    gap: 14px;
}

.btn-top-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 9999px;
    background: var(--nexus-surface);
    border: 1px solid var(--nexus-glass-border);
    color: var(--nexus-text);
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-top-back:hover {
    background: var(--nexus-surface-hover);
    border-color: var(--nexus-primary);
    color: var(--nexus-primary);
    transform: translateX(-2px);
}

.btn-top-back i {
    font-size: 0.82rem;
    transition: transform 0.2s ease;
}

.btn-top-back:hover i {
    transform: translateX(-3px);
}

.brand-text-block {
    display: flex;
    align-items: center;
}

.header-trophy-badge {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(251, 191, 36, 0.08));
    border: 1px solid rgba(251, 191, 36, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nexus-amber);
    font-size: 1.25rem;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.2);
    flex-shrink: 0;
}

.header-titles {
    display: flex;
    flex-direction: column;
}

.header-greeting {
    font-family: var(--nexus-font-heading);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--nexus-text);
    letter-spacing: -0.2px;
    line-height: 1.2;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-subtext {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--nexus-cyan);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Wallet Pill */
.wallet-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.28);
    color: var(--nexus-emerald);
    padding: 8px 14px;
    border-radius: 999px;
    font-family: var(--nexus-font-mono);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.25s var(--nexus-ease);
}

.wallet-pill:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.wallet-pill i {
    font-size: 0.95rem;
}

/* Glossy Action Buttons */
.glossy-btn {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: var(--nexus-surface-card);
    border: 1px solid var(--nexus-glass-border);
    color: var(--nexus-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.25s var(--nexus-ease);
}

.glossy-btn:hover {
    color: var(--nexus-cyan);
    border-color: var(--nexus-glass-border-hover);
    background: var(--nexus-surface-hover);
    transform: translateY(-2px);
    box-shadow: var(--nexus-glow-cyan);
}

/* Header Avatar */
.header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(59, 130, 246, 0.15));
    border: 2px solid var(--nexus-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.25s var(--nexus-ease);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.header-avatar:hover {
    transform: scale(1.08);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.4);
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   4. LEADERBOARD CONTROL CENTER (Heading + Timeframe Switcher + Reset Info)
   ========================================================================== */
.leaderboard-hero-strip {
    text-align: center;
    margin-bottom: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.leaderboard-title {
    font-family: var(--nexus-font-heading);
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    margin: 0;
    color: var(--nexus-text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.mock-leaderboard-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 6px;
    padding: 8px 20px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(99, 102, 241, 0.16));
    border: 1.5px solid rgba(56, 189, 248, 0.38);
    color: var(--nexus-cyan, #38bdf8);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.16);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.25s var(--nexus-ease);
}

.mock-leaderboard-btn:hover {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.28), rgba(99, 102, 241, 0.28));
    border-color: var(--nexus-cyan, #38bdf8);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(56, 189, 248, 0.32);
}

[data-theme="light"] .mock-leaderboard-btn {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.1), rgba(99, 102, 241, 0.1));
    border-color: rgba(2, 132, 199, 0.32);
    color: #0284c7;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.12);
}

[data-theme="light"] .mock-leaderboard-btn:hover {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.18), rgba(99, 102, 241, 0.18));
    color: #0369a1;
}

.leaderboard-subtitle {
    font-size: 0.86rem;
    color: var(--nexus-text-muted);
    margin: 4px 0 16px;
    font-weight: 500;
}

/* Timeframe Segmented Control */
.rank-toggle-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.rank-toggle-pill {
    display: flex;
    background: var(--nexus-surface-solid);
    border: 1px solid var(--nexus-glass-border);
    border-radius: 999px;
    padding: 5px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    width: 100%;
    max-width: 380px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25);
    position: relative;
}

.toggle-btn {
    flex: 1;
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: var(--nexus-text-muted);
    font-weight: 700;
    font-size: 0.88rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.3s var(--nexus-ease);
    font-family: var(--nexus-font-heading);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    z-index: 1;
}

.toggle-btn:hover {
    color: var(--nexus-text);
}

.toggle-btn.active {
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    color: #ffffff !important;
    box-shadow: 0 4px 18px rgba(56, 189, 248, 0.35);
    font-weight: 800;
}

/* Status Strip */
.leaderboard-meta-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
}

.refresh-text {
    font-size: 0.74rem;
    color: var(--nexus-emerald);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.22);
    padding: 4px 12px;
    border-radius: 999px;
    margin: 0;
}

.refresh-text i.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--nexus-emerald);
    box-shadow: 0 0 10px var(--nexus-emerald);
    display: inline-block;
    animation: livePulse 2s infinite ease-in-out;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.3); }
}

.reset-text {
    font-size: 0.74rem;
    color: var(--nexus-text-muted);
    font-weight: 600;
    background: var(--nexus-surface);
    border: 1px solid var(--nexus-glass-border);
    padding: 4px 14px;
    border-radius: 999px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================================================
   5. 3D HERO PODIUM (Top 3 Scholars)
   ========================================================================== */
.leaderboard-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

.podium-section {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 14px;
    margin: 15px 0 10px;
    padding: 24px 8px 10px;
    position: relative;
}

/* Podium Items */
.podium-item {
    flex: 1;
    max-width: 240px;
    padding: 24px 14px 20px;
    border-radius: 28px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    background: var(--nexus-surface-card);
    border: 1px solid var(--nexus-glass-border);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: var(--nexus-glass-shadow);
    transition: transform 0.35s var(--nexus-ease), box-shadow 0.35s var(--nexus-ease), border-color 0.35s ease;
    will-change: transform;
}

.podium-item:hover {
    transform: translateY(-8px);
}

/* Pedestal Visual Ranks */
.podium-item.gold.main {
    transform: translateY(-16px);
    z-index: 5;
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.12) 0%, var(--nexus-surface-card) 60%);
    border: 1.5px solid var(--nexus-gold-border);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5), 0 0 35px var(--nexus-gold-glow);
}

.podium-item.gold.main:hover {
    transform: translateY(-22px) scale(1.02);
    box-shadow: 0 24px 54px rgba(0, 0, 0, 0.6), 0 0 45px rgba(251, 191, 36, 0.38);
}

.podium-item.silver {
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.08) 0%, var(--nexus-surface-card) 60%);
    border: 1px solid var(--nexus-silver-border);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 22px var(--nexus-silver-glow);
}

.podium-item.bronze {
    background: linear-gradient(180deg, rgba(217, 119, 6, 0.08) 0%, var(--nexus-surface-card) 60%);
    border: 1px solid var(--nexus-bronze-border);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 22px var(--nexus-bronze-glow);
}

/* Podium Avatars */
.podium-avatar {
    position: relative;
    width: 72px;
    height: 72px;
    margin-bottom: 14px;
}

.podium-item.gold.main .podium-avatar {
    width: 88px;
    height: 88px;
    margin-bottom: 16px;
}

.podium-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: var(--nexus-surface-solid);
    border: 3px solid transparent;
    transition: all 0.3s var(--nexus-ease);
}

.podium-item.gold.main .podium-avatar img {
    border-color: var(--nexus-gold);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

.podium-item.silver .podium-avatar img {
    border-color: var(--nexus-silver);
    box-shadow: 0 0 14px rgba(148, 163, 184, 0.25);
}

.podium-item.bronze .podium-avatar img {
    border-color: var(--nexus-bronze);
    box-shadow: 0 0 14px rgba(217, 119, 6, 0.25);
}

/* Medals / Badges */
.rank-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 900;
    font-size: 0.85rem;
    border: 2px solid var(--nexus-surface-solid);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
    font-family: var(--nexus-font-mono);
    z-index: 4;
}

.badge-gold {
    background: linear-gradient(135deg, #fbbf24, #d97706);
}

.badge-silver {
    background: linear-gradient(135deg, #cbd5e1, #64748b);
}

.badge-bronze {
    background: linear-gradient(135deg, #d97706, #92400e);
}

/* 👑 Animated Floating Crown for #1 */
.crown {
    position: absolute;
    top: -26px;
    left: 50%;
    transform: translate3d(-50%, 0, 0) rotate(-8deg);
    font-size: 1.9rem;
    color: #ffd700;
    z-index: 10;
    filter: drop-shadow(0 4px 12px rgba(255, 215, 0, 0.6));
    animation: crownFloat 3s infinite ease-in-out alternate;
    pointer-events: none;
}

@keyframes crownFloat {
    0% { transform: translate3d(-50%, 0, 0) rotate(-8deg); }
    100% { transform: translate3d(-50%, -8px, 0) rotate(4deg); }
}

/* Podium Typography & XP */
.podium-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.podium-info h4 {
    margin: 0 0 6px;
    font-size: 0.96rem;
    font-weight: 800;
    color: var(--nexus-text);
    font-family: var(--nexus-font-heading);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.podium-info p {
    margin: 0 0 10px;
    font-weight: 900;
    font-size: 1.15rem;
    font-family: var(--nexus-font-mono);
    letter-spacing: 0.5px;
}

.podium-item.gold p {
    color: var(--nexus-gold);
    text-shadow: 0 0 14px rgba(251, 191, 36, 0.35);
}

.podium-item.silver p {
    color: #cbd5e1;
}

.podium-item.bronze p {
    color: #f59e0b;
}

/* Podium Extra Stats */
.podium-stats {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.25);
    padding: 6px 12px;
    border-radius: 999px;
    color: var(--nexus-text-muted);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .podium-stats {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.06);
}

.podium-stats span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* =========================================
   6. TOP 50 RANK LIST (Ranks 4 - 50)
   ========================================= */
.rank-list-wrapper {
    background: var(--nexus-surface-card);
    border: 1px solid var(--nexus-glass-border);
    border-radius: 28px;
    box-shadow: var(--nexus-glass-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    padding: 0;
}

/* List Table Header */
.list-header {
    display: grid;
    grid-template-columns: 60px 1fr 100px 100px 120px;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.16);
    border-bottom: 1px solid var(--nexus-glass-border);
    color: var(--nexus-text-muted);
    font-weight: 800;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-family: var(--nexus-font-heading);
}

[data-theme="light"] .list-header {
    background: rgba(0, 0, 0, 0.04);
}

.rank-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
}

/* Individual Rank Row */
.rank-row {
    display: grid;
    grid-template-columns: 60px 1fr 100px 100px 120px;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--nexus-glass-border);
    transition: transform 0.28s var(--nexus-ease), background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    will-change: transform;
}

[data-theme="light"] .rank-row {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(15, 23, 42, 0.07);
}

.rank-row:hover {
    background: var(--nexus-surface-hover);
    border-color: var(--nexus-glass-border-hover);
    transform: translate3d(6px, 0, 0);
    box-shadow: var(--nexus-glow-cyan);
}

/* Rank Row Columns */
.col-rank {
    font-weight: 900;
    color: var(--nexus-text-muted);
    font-size: 1rem;
    font-family: var(--nexus-font-mono);
}

.col-learner {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.list-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--nexus-glass-border);
    background: var(--nexus-surface-solid);
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.list-avatar:hover {
    transform: scale(1.1);
    border-color: var(--nexus-cyan);
}

.col-learner .learner-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.col-learner .name {
    font-weight: 700;
    color: var(--nexus-text);
    font-size: 0.94rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.col-learner .name:hover {
    color: var(--nexus-cyan);
}

/* Mobile Stats Inline (Only shown on mobile) */
.mobile-inline-stats {
    display: none;
    font-size: 0.74rem;
    color: var(--nexus-text-dim);
    margin-top: 2px;
    font-weight: 600;
}

.col-stats {
    text-align: center;
    color: var(--nexus-text-muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.col-score {
    text-align: right;
    color: var(--nexus-cyan);
    font-weight: 900;
    font-size: 1.05rem;
    font-family: var(--nexus-font-mono);
    letter-spacing: 0.3px;
}

/* Prime Member Row Styling */
.rank-row.prime-row {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.09), transparent) !important;
    border-left: 4px solid var(--nexus-amber) !important;
    border-color: rgba(245, 158, 11, 0.28);
}

[data-theme="light"] .rank-row.prime-row {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.12), rgba(255, 255, 255, 0.9)) !important;
}

/* ==========================================================================
   7. BADGES SYSTEM
   ========================================================================== */
.badges-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.premium-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    font-size: 0.68rem;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
    cursor: default;
    transition: transform 0.2s ease;
}

.premium-badge:hover {
    transform: scale(1.15);
}

.badge-quiz-master {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.45);
}

.badge-prime {
    background: linear-gradient(135deg, #f59e0b, #ec4899);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.badge-standard {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.badge-overflow-count {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--nexus-text-muted);
    border: 1px solid var(--nexus-glass-border);
}

/* ==========================================================================
   8. FLOATING PERSONAL RANK HUD (#my-rank-bar)
   Dynamic Island Glass Capsule above bottom nav
   ========================================================================== */
.user-rank-sticky {
    position: fixed;
    bottom: max(16px, env(safe-area-inset-bottom, 16px));
    left: 50% !important;
    right: auto !important;
    transform: translate3d(-50%, 0, 0) !important;
    width: min(640px, calc(100vw - 32px)) !important;
    max-width: 640px;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    padding: 12px 20px;
    border-radius: 24px;
    background: rgba(25, 18, 16, 0.96) !important;
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1.5px solid rgba(16, 185, 129, 0.45) !important;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65), 0 0 24px rgba(16, 185, 129, 0.25) !important;
    z-index: 999;
    will-change: transform;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    color: #f8fafc !important;
}

body:has(.nexus-bottom-nav) .user-rank-sticky {
    bottom: calc(var(--nexus-bottom-nav-height, 70px) + env(safe-area-inset-bottom, 0px) + 14px) !important;
}

/* Dedicated keyframe ensuring -50% horizontal center is strictly preserved during animation */
.user-rank-sticky.fade-in-up {
    animation: stickyRankFadeInUp 0.45s var(--nexus-ease) forwards !important;
}

@keyframes stickyRankFadeInUp {
    from {
        opacity: 0;
        transform: translate3d(-50%, 20px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(-50%, 0, 0);
    }
}

[data-theme="light"] .user-rank-sticky {
    background: rgba(25, 18, 16, 0.96) !important;
    border: 1.5px solid rgba(16, 185, 129, 0.45) !important;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(16, 185, 129, 0.25) !important;
}

.user-rank-sticky .p-name,
.user-rank-sticky .rank-num {
    color: #f8fafc !important;
}

.user-rank-sticky .rank-status {
    color: #cbd5e1 !important;
}

.user-rank-content {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.rank-badge-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 52px;
}

.rank-label-tiny {
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--nexus-cyan);
    letter-spacing: 0.5px;
    font-family: var(--nexus-font-heading);
}

.rank-num {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--nexus-text);
    line-height: 1;
    font-family: var(--nexus-font-mono);
}

.player-info {
    flex-grow: 1;
    min-width: 0;
}

.p-name {
    font-weight: 800;
    font-size: 1.02rem;
    color: var(--nexus-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rank-status {
    font-size: 0.78rem;
    color: var(--nexus-text-muted);
    margin-top: 2px;
    font-weight: 600;
}

.p-score {
    font-weight: 900;
    color: var(--nexus-gold);
    font-size: 1.25rem;
    font-family: var(--nexus-font-mono);
    text-shadow: 0 0 12px var(--nexus-gold-glow);
    white-space: nowrap;
}

/* ==========================================================================
   9. MOBILE BOTTOM NAVIGATION
   ========================================================================== */
.bottom-nav {
    position: fixed;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translate3d(-50%, 0, 0);
    width: calc(100% - 24px);
    max-width: 480px;
    height: var(--nexus-bottom-nav-height);
    background: rgba(13, 19, 36, 0.88);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border: 1px solid var(--nexus-glass-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    border-radius: 999px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
    padding: 0 6px;
}

[data-theme="light"] .bottom-nav {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--nexus-text-dim);
    text-decoration: none;
    transition: all 0.25s var(--nexus-ease);
    padding: 6px 12px;
    border-radius: 18px;
}

.bottom-nav-item i {
    font-size: 1.28rem;
    transition: transform 0.25s var(--nexus-ease);
}

.bottom-nav-item span {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.bottom-nav-item:hover {
    color: var(--nexus-text);
}

.bottom-nav-item.active {
    color: var(--nexus-cyan) !important;
    background: rgba(56, 189, 248, 0.12);
}

.bottom-nav-item.active i {
    transform: translateY(-2px) scale(1.12);
}

/* ==========================================================================
   10. SKELETON SHIMMER & LOADING STATES
   ========================================================================== */
.skeleton-shimmer {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.04) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: 8px;
}

[data-theme="light"] .skeleton-shimmer {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.04) 25%, rgba(0, 0, 0, 0.08) 50%, rgba(0, 0, 0, 0.04) 75%);
    background-size: 200% 100%;
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.loading-state {
    text-align: center;
    padding: 42px 20px;
    color: var(--nexus-text-muted);
}

.loading-state i {
    font-size: 2.2rem;
    color: var(--nexus-cyan);
    margin-bottom: 12px;
}

.loading-state p {
    font-weight: 700;
    font-size: 0.92rem;
    margin: 0;
}

/* Staggered Animations */
.fade-in-up {
    animation: fadeInUp 0.45s var(--nexus-ease) forwards;
    opacity: 0;
    transform: translate3d(0, 16px, 0);
}

.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }
.delay-4 { animation-delay: 0.32s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* ==========================================================================
   11. RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Tablet (max-width: 820px) */
@media (max-width: 820px) {
    .main-content {
        padding: 12px 14px;
    }
    
    .list-header, .rank-row {
        grid-template-columns: 50px 1fr 80px 80px 100px;
        gap: 10px;
    }
}

/* Mobile (max-width: 680px) */
@media (max-width: 680px) {
    .app-header {
        padding: 10px 14px;
        border-radius: 18px;
        margin-bottom: 16px;
    }

    .header-greeting {
        font-size: 1rem;
    }

    .header-subtext {
        font-size: 0.68rem;
    }

    .wallet-pill {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .glossy-btn {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }

    .header-avatar {
        width: 36px;
        height: 36px;
    }

    .leaderboard-title {
        font-size: 1.45rem;
    }

    /* Podium Mobile Stack */
    .podium-section {
        gap: 8px;
        padding: 16px 2px 6px;
    }

    .podium-item {
        padding: 16px 6px 14px;
        border-radius: 20px;
    }

    .podium-item.gold.main {
        transform: translateY(-10px);
    }

    .podium-item.gold.main:hover {
        transform: translateY(-14px);
    }

    .podium-avatar {
        width: 54px;
        height: 54px;
        margin-bottom: 10px;
    }

    .podium-item.gold.main .podium-avatar {
        width: 68px;
        height: 68px;
        margin-bottom: 12px;
    }

    .crown {
        font-size: 1.4rem;
        top: -20px;
    }

    .rank-badge {
        width: 22px;
        height: 22px;
        font-size: 0.72rem;
        bottom: -2px;
        right: -2px;
    }

    .podium-info h4 {
        font-size: 0.82rem;
        margin-bottom: 4px;
    }

    .podium-info p {
        font-size: 0.98rem;
        margin-bottom: 6px;
    }

    .podium-stats {
        flex-direction: column;
        gap: 3px;
        padding: 4px 8px;
        font-size: 0.66rem;
    }

    /* Mobile Top 50 Responsive Grid */
    .list-header {
        grid-template-columns: 44px 1fr 88px;
        padding: 12px 16px;
    }

    .hide-on-mobile {
        display: none !important;
    }

    .rank-row {
        grid-template-columns: 44px 1fr 88px;
        padding: 12px 14px;
        gap: 8px;
    }

    .col-rank {
        font-size: 0.9rem;
    }

    .col-learner .name {
        font-size: 0.88rem;
    }

    .list-avatar {
        width: 34px;
        height: 34px;
    }

    .mobile-inline-stats {
        display: block;
    }

    .col-score {
        font-size: 0.92rem;
    }

    /* Sticky Personal HUD Mobile */
    .user-rank-sticky {
        width: min(640px, calc(100vw - 20px)) !important;
        max-width: calc(100vw - 20px) !important;
        padding: 10px 14px !important;
        border-radius: 20px !important;
        left: 50% !important;
        right: auto !important;
        transform: translate3d(-50%, 0, 0) !important;
        bottom: max(12px, env(safe-area-inset-bottom, 12px)) !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }

    body:has(.nexus-bottom-nav) .user-rank-sticky {
        bottom: calc(var(--nexus-bottom-nav-height, 70px) + env(safe-area-inset-bottom, 0px) + 8px) !important;
    }

    .rank-num {
        font-size: 1.35rem;
    }

    .p-name {
        font-size: 0.92rem;
    }

    .rank-status {
        font-size: 0.72rem;
    }

    .p-score {
        font-size: 1.1rem;
    }
}

/* Micro Screens (max-width: 360px) */
@media (max-width: 360px) {
    .podium-avatar { width: 44px; height: 44px; }
    .podium-item.gold.main .podium-avatar { width: 56px; height: 56px; }
    .crown { font-size: 1.1rem; top: -16px; }
    .podium-info h4 { font-size: 0.74rem; }
    .podium-info p { font-size: 0.88rem; }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
