    /* Theme Selector in Navigation */
    .theme-selector-nav {
        position: relative;
        display: inline-block;
    }
    
    .theme-btn-nav {
        background: transparent;
        border: 2px solid var(--accent-primary, #9C27B0);
        color: var(--accent-primary, #9C27B0);
        padding: 10px 20px;
        min-height: 44px;
        min-width: 44px;
        border-radius: 25px;
        cursor: pointer;
        font-weight: 600;
        transition: all 0.3s ease;
        font-size: 14px;
    }

    .theme-btn-nav:hover {
        background: var(--accent-primary, #9C27B0);
        color: #ffffff;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(156, 39, 176, 0.3);
    }

    /* Light theme override - force dark text on light backgrounds */
    body[class*="path-bossmode"] .theme-btn-nav:hover,
    body[class*="path-achiever"] .theme-btn-nav:hover,
    body[class*="path-minimal"] .theme-btn-nav:hover,
    body[class*="path-diploma"] .theme-btn-nav:hover,
    body[class*="path-sunshine"] .theme-btn-nav:hover,
    body[class*="path-golden"] .theme-btn-nav:hover {
        color: #1a1a1a;
    }
    
    /* Theme dropdown - base styles for both desktop and mobile */
    #themeDropdownNav,
    #mobileThemeDropdown,
    .theme-dropdown-nav {
        display: none !important;
        background: #1a1a2e !important;
        border: 1px solid #2a2a4e !important;
        border-radius: 12px !important;
        padding: 12px !important;
        min-width: 200px !important;
        max-width: 300px !important;
        max-height: 400px !important;
        overflow-y: auto !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    }

    /* Desktop dropdown - floats above content with fixed positioning */
    #themeDropdownNav {
        position: fixed;
        /* Do NOT use !important on positioning - JS needs to set these */
        top: auto;
        left: auto;
        right: auto;
        z-index: var(--z-theme-dropdown);
    }

    /* Mobile dropdown - positioned statically within mobile menu */
    #mobileThemeDropdown {
        position: static !important;
        margin-top: 12px !important;
        z-index: var(--z-above) !important;
    }

    #themeDropdownNav.active,
    #mobileThemeDropdown:not(.mobile-hidden),
    .theme-dropdown-nav.active {
        display: block !important;
    }

    /* Theme option items - immune to all theme overrides */
    #themeDropdownNav .theme-option-nav,
    #mobileThemeDropdown .theme-option-nav,
    .theme-dropdown-nav .theme-option-nav,
    body #themeDropdownNav .theme-option-nav,
    body #mobileThemeDropdown .theme-option-nav,
    body .theme-dropdown-nav .theme-option-nav {
        padding: 10px 12px !important;
        margin: 4px 0 !important;
        border-radius: 8px !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        color: #e0e0e0 !important;
        background: transparent !important;
        font-size: 14px !important;
        line-height: 1.4 !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        user-select: none !important;
        border: none !important;
        text-decoration: none !important;
        font-weight: 400 !important;
        box-shadow: none !important;
    }

    #themeDropdownNav .theme-option-nav:hover,
    #mobileThemeDropdown .theme-option-nav:hover,
    .theme-dropdown-nav .theme-option-nav:hover {
        background: rgba(255, 255, 255, 0.1) !important;
        transform: translateX(4px) !important;
    }

    #themeDropdownNav .theme-option-nav.active,
    #mobileThemeDropdown .theme-option-nav.active,
    .theme-dropdown-nav .theme-option-nav.active {
        background: rgba(100, 100, 255, 0.3) !important;
        color: #ffffff !important;
        font-weight: 600 !important;
    }

    /* Remove old light theme overrides - no longer needed with fixed colors */

    /* ============================================
       NAVIGATION BAR STYLES
       ============================================ */

    /* Navigation - must override theme's body > * rules */
    body > nav.main-nav,
    nav.main-nav {
        background: var(--bg-secondary) !important;
        border-bottom: 1px solid var(--border-color) !important;
        padding: 1rem 0 !important;
        position: sticky !important;
        top: 0 !important;
        z-index: var(--z-nav-primary) !important;
        /* Ensure navigation creates its own stacking context */
        transform: translateZ(0);
        will-change: transform;
    }

    .nav-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 1.5rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .nav-left {
        display: flex;
        align-items: center;
        gap: 2rem;
    }

    .nav-logo {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--accent-primary);
        text-decoration: none;
    }

    .desktop-nav-links {
        display: flex;
        gap: 1.5rem;
    }

    .desktop-nav-links a {
        color: var(--text-primary);
        text-decoration: none;
        font-weight: 500;
        transition: color 0.2s;
        padding: 12px 16px;
        display: inline-block;
        min-height: 44px;
        line-height: 1.4;
    }

    .desktop-nav-links a:hover {
        color: var(--accent-primary);
    }

    .nav-right {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .desktop-right-items {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .path-badge-link {
        text-decoration: none;
    }

    .win-stats-badge {
        font-size: 0.9rem;
        color: var(--text-secondary);
    }

    /* ============================================
       MOBILE HEADER FIXES
       ============================================ */

    /* Mobile Menu Toggle Button */
    .mobile-menu-toggle {
        display: none;
        background: transparent;
        border: none;
        color: var(--text-primary);
        font-size: 28px;
        cursor: pointer;
        padding: 10px;
        min-width: 48px;
        min-height: 48px;
        line-height: 1;
        transition: transform 0.3s ease;
    }

    .mobile-menu-toggle:hover {
        transform: scale(1.1);
    }

    /* Mobile Slide-in Menu - use child selector to override theme rules */
    body > .mobile-menu {
        position: fixed;
        top: 0;
        right: 0;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--bg-secondary);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
        z-index: var(--z-mobile-menu);
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        overflow-x: hidden;
        padding: 20px;
    }

    body > .mobile-menu.active {
        transform: translateX(0);
    }

    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.7);
        z-index: var(--z-mobile-menu-backdrop);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .mobile-menu-overlay.active {
        opacity: 1;
        pointer-events: all;
    }

    .mobile-menu-close {
        position: absolute;
        top: 15px;
        right: 15px;
        background: transparent;
        border: none;
        color: var(--text-primary);
        font-size: 32px;
        cursor: pointer;
        line-height: 1;
        padding: 5px;
    }

    .mobile-menu-header {
        font-size: 1.2rem;
        font-weight: 700;
        color: var(--accent-primary);
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 2px solid var(--border-color);
    }

    .mobile-menu-section {
        margin: 20px 0;
    }

    .mobile-menu-section-title {
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 1px;
        margin-bottom: 10px;
    }

    .mobile-menu-links {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .mobile-menu-link {
        color: var(--text-primary);
        text-decoration: none;
        font-weight: 500;
        padding: 14px 15px;
        min-height: 48px;
        border-radius: 8px;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
    }

    .mobile-menu-link:hover {
        background: var(--bg-tertiary);
        transform: translateX(5px);
    }

    .mobile-menu-badge-container {
        padding: 15px;
        background: var(--bg-tertiary);
        border-radius: 12px;
        margin: 15px 0;
    }

    .mobile-theme-btn {
        width: 100%;
        background: transparent;
        border: 2px solid var(--accent-primary);
        color: var(--accent-primary);
        padding: 12px;
        border-radius: 8px;
        cursor: pointer;
        font-weight: 600;
        font-size: 14px;
        margin: 10px 0;
    }

    .mobile-logout-btn {
        width: 100%;
        background: var(--accent-primary);
        color: white;
        padding: 12px;
        border-radius: 8px;
        text-decoration: none;
        font-weight: 600;
        text-align: center;
        display: block;
        margin-top: 20px;
    }

    /* Responsive Breakpoints */
    @media (max-width: 767.99px) {
        /* Compact header on mobile - use child selector to override themes */
        body > nav.main-nav {
            padding: 0.25rem 0;
        }

        body > nav.main-nav .nav-container {
            padding: 0 0.75rem;
        }

        /* Ensure no unexpected spacing on body or main content */
        body {
            margin: 0;
            padding-top: 0;
        }

        .nav-left {
            gap: 0.5rem;
        }

        .nav-right {
            gap: 0;
        }

        /* Hide desktop navigation items completely */
        .desktop-nav-links,
        .desktop-right-items {
            display: none;
        }

        /* Show mobile menu toggle */
        .mobile-menu-toggle {
            display: block;
        }

        /* Make logo smaller and tighter */
        .nav-logo {
            font-size: 1rem;
            padding: 0;
        }

        /* Adjust theme dropdown for mobile */
        .theme-dropdown-nav {
            max-height: 60vh;
            max-width: 90vw;
        }

        .theme-dropdown-nav.mobile-hidden {
            display: none;
        }
    }

    @media (min-width: 768px) {
        /* Hide mobile menu elements on desktop */
        body .mobile-menu-toggle {
            display: none;
        }

        body .mobile-menu {
            display: none;
        }

        body .mobile-menu-overlay {
            display: none;
        }

        /* Show desktop navigation */
        body .desktop-nav-links,
        body .desktop-right-items {
            display: flex;
        }
    }

    /* Theme-specific fixes for metamorphosis and similar complex themes */
    /* These themes use body > * selectors that can interfere with layout */

    body.path-metamorphosis,
    body.path-electric-violet,
    body.path-abstract-mind,
    body.path-capitol-hill,
    body.path-diploma-glow,
    body.path-pawprint-haven,
    body.path-neon-crossroads,
    body.path-wild-heart,
    body.path-viral-wave,
    body.path-sunshine-soul,
    body.path-paper-trail,
    body.path-palette-dreams,
    body.path-ocean-depths {
        margin: 0;
        padding: 0;
    }

    @media (max-width: 767.99px) {
        /* Mobile fixes - removed !important, trying to debug */
        body.path-metamorphosis > nav.main-nav,
        body.path-electric-violet > nav.main-nav,
        body.path-ocean-depths > nav.main-nav {
            padding: 0.25rem 0;
            margin: 0;
        }
    }

    /* Mobile fixes are now handled by mobile-consolidated.css */
    /* This section intentionally left minimal to avoid conflicts */
