        html {
            background-color: #0a0a0a !important;
        }
        :root {
            --brand-crimson: #64748b; /* Neutral dark grey */
            --brand-blue: #94a3b8; /* Neutral grey */
            --brand-yellow: #ffffff; /* Pure white */
            --brand-light-yellow: #f8fafc; /* Near white */
            --brand-sage: #e2e8f0; /* Neutral light grey */
            --bg-deep: #0a0a0a;
        }

        html {
            background-color: #0a0a0a;
        }

        body {
            font-family: 'Outfit', sans-serif;
            background: radial-gradient(circle at top, #1a1a1a 0%, #0a0a0a 100%);
            background-color: #0a0a0a;
            color: #f8fafc;
            min-height: 100vh;
            position: relative;
            overflow-x: hidden;
        }

        /* Ambient Glow Behind Content */
        body::before {
            content: '';
            position: absolute;
            top: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 100%;
            max-width: 1200px;
            height: 350px;
            background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
            z-index: -1;
            pointer-events: none;
        }

        /* Custom Scrollbar */
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }
        ::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.6);
        }
        ::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.15);
            border-radius: 4px;
        }
        ::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        a {
            color: var(--brand-yellow);
            text-decoration: none;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        }
        a:hover {
            color: var(--brand-light-yellow);
            text-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
        }

        .text-muted, .text-secondary {
            color: #94a3b8 !important;
        }

        .card, .glass-card {
            color: #f8fafc !important;
        }

        /* custom styling buttons & badges */
        .btn-brand-yellow, .btn-warning {
            background: #ffffff !important;
            color: #000000 !important;
            font-weight: 700 !important;
            border: 1.5px solid #ffffff !important;
            letter-spacing: 0.5px;
            border-radius: 10px !important;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
            box-shadow: 0 4px 14px rgba(255, 255, 255, 0.1);
        }
        .btn-brand-yellow:hover, .btn-warning:hover {
            background: #e2e8f0 !important;
            border-color: #e2e8f0 !important;
            color: #000000 !important;
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15);
        }
        .btn-brand-yellow:active, .btn-warning:active {
            transform: translateY(0);
        }
        
        .btn-header-ranks,
        .btn-header-ranks:focus,
        .btn-header-ranks:active {
            color: #ffffff !important;
            border: 1.5px solid #ffffff !important;
            border-radius: 8px !important;
            font-weight: 600 !important;
            background: rgba(255, 255, 255, 0.03) !important;
            display: inline-flex !important;
            align-items: center !important;
            gap: 0.5rem !important;
            height: 36px !important;
            padding: 0.35rem 0.85rem !important;
            font-size: 0.85rem !important;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
            box-shadow: none !important;
        }
        .btn-header-ranks:hover {
            background: #ffffff !important;
            color: #000000 !important;
            transform: translateY(-1px) !important;
            box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1) !important;
        }

        .btn-header-action,
        .btn-header-action:focus,
        .btn-header-action:active {
            color: #cbd5e1 !important;
            border: 1.5px solid rgba(255, 255, 255, 0.1) !important;
            background: rgba(255, 255, 255, 0.03) !important;
            font-weight: 600 !important;
            display: inline-flex !important;
            align-items: center !important;
            gap: 0.5rem !important;
            height: 36px !important;
            padding: 0.35rem 0.85rem !important;
            font-size: 0.85rem !important;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
            border-radius: 8px !important;
            box-shadow: none !important;
        }
        .btn-header-action:hover {
            color: #ffffff !important;
            background: rgba(255, 255, 255, 0.08) !important;
            border-color: rgba(255, 255, 255, 0.2) !important;
            transform: translateY(-1px) !important;
            box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
        }

        .btn-header-leave,
        .btn-header-leave:focus,
        .btn-header-leave:active {
            color: #94a3b8 !important;
            background: rgba(255, 255, 255, 0.03) !important;
            border: 1.5px solid rgba(255, 255, 255, 0.1) !important;
            font-weight: 600 !important;
            display: inline-flex !important;
            align-items: center !important;
            gap: 0.5rem !important;
            height: 36px !important;
            padding: 0.35rem 0.85rem !important;
            font-size: 0.85rem !important;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
            border-radius: 8px !important;
            box-shadow: none !important;
        }
        .btn-header-leave:hover {
            color: #ffffff !important;
            background: #334155 !important;
            border-color: #334155 !important;
            transform: translateY(-1px) !important;
            box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1) !important;
        }

        .btn-danger {
            background: #334155 !important;
            color: #ffffff !important;
            border: 1.5px solid #334155 !important;
            border-radius: 10px !important;
            font-weight: 600 !important;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
            box-shadow: 0 4px 14px rgba(255, 255, 255, 0.05);
        }
        .btn-danger:hover {
            background: #475569 !important;
            border-color: #475569 !important;
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(255, 255, 255, 0.1);
        }

        /* Complete Grayscale/Monochrome Resets for Bootstrap Utility Classes */
        .text-success, .text-warning, .text-danger, .text-info, .text-primary, .text-secondary {
            color: #cbd5e1 !important;
            text-shadow: none !important;
        }
        .bg-success, .bg-warning, .bg-danger, .bg-info, .bg-primary, .bg-secondary {
            background-color: rgba(255, 255, 255, 0.05) !important;
            color: #ffffff !important;
        }
        .border-success, .border-warning, .border-danger, .border-info, .border-primary, .border-secondary {
            border-color: rgba(255, 255, 255, 0.1) !important;
        }
        .badge {
            background-color: rgba(255, 255, 255, 0.05) !important;
            color: #cbd5e1 !important;
            border: 1px solid rgba(255, 255, 255, 0.1) !important;
        }
        
        .alert-success, .alert-warning, .alert-danger, .alert-info {
            background-color: rgba(255, 255, 255, 0.03) !important;
            border-color: rgba(255, 255, 255, 0.1) !important;
            color: #cbd5e1 !important;
        }

        .badge-difficulty-hard {
            background-color: rgba(255, 255, 255, 0.05);
            color: #cbd5e1;
            border: 1px solid rgba(255, 255, 255, 0.15);
            font-weight: 600;
            border-radius: 6px;
        }
        
        .badge-difficulty-standard {
            background-color: rgba(255, 255, 255, 0.05);
            color: #cbd5e1;
            border: 1px solid rgba(255, 255, 255, 0.15);
            font-weight: 600;
            border-radius: 6px;
        }

        /* Glassmorphic Cards */
        .glass-card {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.08);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border-radius: 20px;
            color: #ffffff;
            box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.1);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .glass-card:hover {
            border-color: rgba(255, 255, 255, 0.15);
            box-shadow: 0 16px 48px 0 rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 255, 255, 0.05);
        }

        /* Hover Lift Animations */
        .hover-lift {
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        }
        .hover-lift:hover {
            transform: translateY(-6px) scale(1.01) !important;
            border-color: rgba(255, 255, 255, 0.25) !important;
            box-shadow: 0 15px 30px rgba(0, 0, 0, 0.35), 0 0 20px rgba(255, 255, 255, 0.05) !important;
        }
        
        .header-hud-pill {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            background: rgba(255, 255, 255, 0.03) !important;
            border: 1.5px solid rgba(255, 255, 255, 0.1) !important;
            color: #cbd5e1 !important;
            padding: 0.35rem 0.85rem;
            border-radius: 8px;
            font-size: 0.85rem;
            height: 36px !important;
        }
        .header-hud-pill i {
            color: #94a3b8 !important;
        }

        /* Shared Gameplay Button Options */
        .btn-option {
            border: 1.5px solid rgba(255, 255, 255, 0.08);
            color: #cbd5e1;
            padding: 1.1rem 1.4rem;
            border-radius: 14px;
            cursor: pointer;
            display: flex;
            align-items: center;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            background: rgba(255, 255, 255, 0.01);
            box-shadow: 0 4px 10px rgba(0,0,0,0.15);
        }
        .btn-option:hover {
            background: rgba(255, 255, 255, 0.04);
            border-color: rgba(255, 255, 255, 0.25);
            color: #ffffff;
            transform: translateY(-1px);
            box-shadow: 0 6px 15px rgba(0,0,0,0.25);
        }
        .btn-option.selected {
            background: rgba(255, 255, 255, 0.08) !important;
            border-color: var(--brand-yellow) !important;
            color: #ffffff !important;
            box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
        }
        .btn-option input[type="radio"]:checked + .option-text {
            color: #ffffff;
        }

        /* Shared Navigation Pills for Leaderboard / History */
        .nav-pills .nav-link {
            color: #94a3b8;
            background: rgba(15, 23, 42, 0.45);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 12px;
            padding: 0.6rem 1.25rem;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            font-weight: 600;
        }
        .nav-pills .nav-link:hover {
            color: #ffffff;
            background: rgba(255, 255, 255, 0.05);
            border-color: rgba(255, 255, 255, 0.15);
        }
        .nav-pills .nav-link.active {
            background: linear-gradient(135deg, var(--brand-yellow) 0%, var(--brand-light-yellow) 100%) !important;
            color: #090d16 !important;
            border-color: transparent !important;
            box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
        }

        /* Ensure all main interactive elements are at least 48px high for accessibility */
        .btn-brand-yellow, 
        .btn-warning, 
        .btn-danger, 
        .btn-outline-warning,
        .btn-secondary,
        .btn-outline-light,
        .btn-option {
            min-height: 48px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        /* Specific buttons that should behave as blocks or flex rows */
        .btn-option {
            display: flex;
            min-height: 52px; /* Extra height to accommodate long options */
            word-break: break-word;
        }

        /* Ensure HUD Header buttons are larger on touchscreens */
        @media (max-width: 576px) {
            .btn-header-ranks,
            .btn-header-action,
            .btn-header-leave,
            .header-hud-pill {
                height: 44px !important; /* Larger interactive size on mobile */
                font-size: 0.9rem !important;
                padding: 0.5rem 1rem !important;
            }
            
            .nav-pills .nav-link {
                min-height: 44px;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                width: auto; /* Allow natural size and wrapping */
            }
        }

        /* Prevent Math LaTeX and Code syntax highlighting from overflowing layouts */
        .katex-display, 
        .katex, 
        pre, 
        code {
            max-width: 100%;
            overflow-x: auto !important;
            white-space: pre-wrap; /* Fallback wrapping */
        }

        /* Standard word break utility */
        .text-break-word {
            word-break: break-word;
            overflow-wrap: break-word;
        }

        /* Mobile Menu Toggler Styles */
        .mobile-menu-btn {
            background: rgba(255, 255, 255, 0.03) !important;
            border: 1.5px solid rgba(255, 255, 255, 0.1) !important;
            border-radius: 8px !important;
            padding: 6px 10px !important;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
            display: inline-flex !important;
            align-items: center;
            justify-content: center;
            min-height: 36px !important;
            box-shadow: none !important;
        }
        .mobile-menu-btn svg path {
            transition: stroke 0.3s ease;
        }
        .mobile-menu-btn:hover {
            background: rgba(255, 255, 255, 0.08) !important;
            border-color: rgba(255, 255, 255, 0.25) !important;
        }
        .mobile-menu-btn:hover svg path {
            stroke: var(--brand-yellow) !important;
        }

        /* Glassmorphic Dropdown Menu styling */
        .mobile-glass-dropdown {
            background: rgba(18, 18, 18, 0.85) !important;
            border: 1.5px solid rgba(255, 255, 255, 0.1) !important;
            backdrop-filter: blur(20px) !important;
            -webkit-backdrop-filter: blur(20px) !important;
            border-radius: 12px !important;
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.05) !important;
            padding: 0.75rem !important;
            min-width: 230px !important;
            margin-top: 8px !important;
        }
        .mobile-glass-dropdown .dropdown-header {
            font-size: 0.75rem !important;
            font-weight: 700 !important;
            letter-spacing: 0.05em;
            padding: 0.35rem 0.75rem !important;
            color: #94a3b8 !important;
        }
        .mobile-glass-dropdown .dropdown-item {
            color: #cbd5e1 !important;
            border-radius: 6px !important;
            padding: 0.5rem 0.75rem !important;
            font-size: 0.9rem !important;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
            font-weight: 500;
        }
        .mobile-glass-dropdown .dropdown-item:hover {
            background: rgba(255, 255, 255, 0.06) !important;
            color: #ffffff !important;
            transform: translateX(4px);
        }
        .mobile-glass-dropdown .dropdown-item-text {
            color: #cbd5e1 !important;
            font-size: 0.9rem !important;
            padding: 0.35rem 0.75rem !important;
        }
        .mobile-glass-dropdown .dropdown-divider {
            margin: 0.5rem 0 !important;
            border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        }

        /* Layout Wrapper */
        .app-layout {
            display: flex;
            flex-direction: row;
            min-height: 100vh;
            width: 100%;
            position: relative;
        }

        .main-content-wrapper {
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            min-width: 0;
            min-height: 100vh;
        }

        /* Glassmorphic Sliding Sidebar Drawer */
        .games-sidebar {
            width: 300px;
            background: rgba(10, 10, 10, 0.65);
            backdrop-filter: blur(25px) saturate(180%);
            -webkit-backdrop-filter: blur(25px) saturate(180%);
            border-right: 1px solid rgba(255, 255, 255, 0.08);
            box-shadow: 10px 0 40px rgba(0, 0, 0, 0.7), inset 1px 0 0 rgba(255, 255, 255, 0.05);
            transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            flex-direction: column;
        }

        .sidebar-header {
            padding: 1.5rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .sidebar-body {
            flex-grow: 1;
            overflow-y: auto;
            padding: 1.5rem;
            display: flex;
            flex-direction: column;
        }
        .sidebar-profile {
            padding-bottom: 1.5rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
            margin-bottom: 1.5rem;
            display: flex;
            align-items: center;
            transition: all 0.3s ease;
        }
        .sidebar-profile-avatar {
            width: 50px;
            height: 50px;
            border-radius: 12px;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.1);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            color: var(--brand-yellow);
            margin-right: 12px;
            flex-shrink: 0;
        }
        .sidebar-close-btn {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.08);
            color: #cbd5e1;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.25s ease;
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            border-radius: 8px;
            font-family: monospace;
            font-weight: bold;
        }
        .sidebar-close-btn:hover {
            color: #ffffff;
            background: rgba(255, 255, 255, 0.08);
            border-color: rgba(255, 255, 255, 0.15);
        }
        .sidebar-link {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem 1rem;
            color: #cbd5e1;
            border-radius: 10px;
            transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
            margin-bottom: 0.5rem;
            border: 1px solid transparent;
            text-align: left;
            width: 100%;
            background: transparent;
        }
        .sidebar-link:hover {
            background: rgba(255, 255, 255, 0.06);
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.08);
            transform: translateX(4px);
        }
        .sidebar-link.active {
            background: rgba(255, 255, 255, 0.08);
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.15);
            font-weight: 600;
        }
        .sidebar-link.text-danger:hover {
            background: rgba(239, 68, 68, 0.1) !important;
            color: #ef4444 !important;
            border-color: rgba(239, 68, 68, 0.2) !important;
        }

        /* Subnavigation expandable styles */
        .subnav-wrapper {
            margin-bottom: 0.5rem;
        }
        .subnav-container {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
            padding-left: 1rem;
        }
        .subnav-container.open {
            max-height: 250px;
        }
        .subnav-arrow {
            transition: transform 0.3s ease;
        }
        .subnav-toggle[aria-expanded="true"] .subnav-arrow {
            transform: rotate(90deg);
        }
        .subnav-link {
            font-size: 0.9rem;
            padding: 0.6rem 0.85rem;
            margin-bottom: 0.25rem;
        }

        /* Sidebar Responsive Configuration */
        @media (min-width: 992px) {
            .games-sidebar {
                position: sticky;
                top: 0;
                height: 100vh;
                flex-shrink: 0;
                z-index: 1050;
            }
            .sidebar-close-btn {
                display: none !important;
            }
            /* Minimized state on desktop */
            .games-sidebar.minimized {
                width: 80px;
            }
            .games-sidebar.minimized .sidebar-header span,
            .games-sidebar.minimized .sidebar-profile-info,
            .games-sidebar.minimized .sidebar-stats-section,
            .games-sidebar.minimized .sidebar-section-title,
            .games-sidebar.minimized .sidebar-link span,
            .games-sidebar.minimized .sidebar-link .subnav-arrow,
            .games-sidebar.minimized .sidebar-body hr {
                display: none !important;
            }
            .games-sidebar.minimized .sidebar-profile {
                padding-bottom: 0;
                margin-bottom: 1rem;
                justify-content: center;
                border-bottom: none;
            }
            .games-sidebar.minimized .sidebar-profile-avatar {
                margin-right: 0;
            }
            .games-sidebar.minimized .sidebar-link {
                justify-content: center;
                padding: 0.75rem;
            }
            .games-sidebar.minimized .sidebar-link:hover {
                transform: none;
            }
            .games-sidebar.minimized .subnav-container {
                display: none !important;
            }
        }

        @media (max-width: 991.98px) {
            .games-sidebar {
                position: fixed;
                top: 0;
                left: 0;
                height: 100vh;
                z-index: 1100;
                transform: translateX(-100%);
            }
            .games-sidebar.open {
                transform: translateX(0);
            }
        }

        /* Global dark-theme glass table styling overrides */
        .table {
            --bs-table-bg: transparent !important;
            --bs-table-hover-bg: rgba(255, 255, 255, 0.02) !important;
            --bs-table-color: #cbd5e1 !important;
            --bs-table-hover-color: #ffffff !important;
            border-color: rgba(255, 255, 255, 0.08) !important;
        }
        .table th, .table td {
            background-color: transparent !important;
            color: inherit !important;
            border-bottom-color: rgba(255, 255, 255, 0.05) !important;
        }
        .table-hover tbody tr:hover {
            background-color: rgba(255, 255, 255, 0.02) !important;
        }

        /* Floating Action Button — Start Challenge */
        .fab-challenge {
            position: fixed;
            top: 1.25rem;
            right: 1.5rem;
            z-index: 1080;
            width: 44px;
            height: 44px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.08);
            backdrop-filter: blur(15px);
            -webkit-backdrop-filter: blur(15px);
            border: 1px solid rgba(255, 255, 255, 0.12);
            color: #cbd5e1;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.1rem;
            text-decoration: none;
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .fab-challenge:hover {
            transform: scale(1.1);
            background: rgba(255, 255, 255, 0.12);
            border-color: rgba(255, 255, 255, 0.2);
            color: #ffffff;
        }
        .fab-challenge:active {
            transform: scale(0.95);
        }
        @media (max-width: 767.98px) {
            .fab-challenge {
                top: 1rem;
                right: 1rem;
                width: 40px;
                height: 40px;
                font-size: 1.1rem;
            }
        }
