/* === GLOBAL CSS VARIABLES === */
        :root {
            --primary: #E60026;
            --primary-light: #FFD6DD;
            --secondary: #720000;
            --secondary-dark: #4A0008;
            --text-dark: var(--secondary-dark);
            --bg-color: #FEF2F4;
            --nav-height: 70px;
            /* Safe area variables for iPhone notches and home bars */
            --safe-top: env(safe-area-inset-top, 0px);
            --safe-bottom: env(safe-area-inset-bottom, 0px);
            --safe-left: env(safe-area-inset-left, 0px);
            --safe-right: env(safe-area-inset-right, 0px);
        }

        * { box-sizing: border-box; margin: 0; padding: 0; min-width: 0; }

        /* ONE-FINGER SCROLL FIX & ZOOM PREVENTION */
        html, body {
            -webkit-tap-highlight-color: transparent; 
            -webkit-text-size-adjust: 100%; 
            touch-action: manipulation; 
        }

        body { 
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; 
            background-color: var(--bg-color);
            color: var(--text-dark);
            display: flex;
            flex-direction: column;
            min-height: 100vh; 
            min-height: 100dvh; 
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            overflow-x: hidden; 
            overflow-y: auto; 
            -webkit-overflow-scrolling: touch; 
        }

        /* PREMIUM APP SCROLLBARS */
        ::-webkit-scrollbar { width: 6px; height: 6px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: rgba(114, 0, 0, 0.2); border-radius: 10px; }
        ::-webkit-scrollbar-thumb:hover { background: rgba(114, 0, 0, 0.4); }

        /* Prevents iOS from auto-zooming on inputs */
        input, select, textarea { font-size: 16px !important; font-family: inherit; }

        /* === 🎬 SKIPPABLE AD SYSTEM === */
        .ad-overlay {
            position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
            background: rgba(11, 17, 32, 0.98); z-index: 999999;
            display: none; justify-content: center; align-items: center;
            backdrop-filter: blur(15px); padding: 20px;
        }
        .ad-content {
            position: relative; width: 100%; max-width: 500px; text-align: center;
            animation: adPopIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }
        #ad-media-container {
            width: 100%; border-radius: 24px; overflow: hidden;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
            background: #1e293b; border: 1px solid rgba(255,255,255,0.1);
        }
        #ad-media-container img, #ad-media-container video {
            width: 100%; height: auto; max-height: 70vh; display: block; object-fit: contain;
        }
        .ad-learn-more {
            display: inline-block; margin-top: 20px; padding: 14px 28px;
            background: #38bdf8; color: #0f172a; text-decoration: none;
            font-weight: 900; border-radius: 14px; font-size: 16px;
            transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            box-shadow: 0 10px 20px rgba(56, 189, 248, 0.3);
        }
        .ad-learn-more:hover { transform: scale(1.05); background: #7dd3fc; }
        .skip-btn {
            position: absolute; bottom: -80px; right: 0;
            background: rgba(255, 255, 255, 0.05); color: rgba(255,255,255,0.6);
            border: 1px solid rgba(255, 255, 255, 0.1); padding: 12px 24px;
            border-radius: 16px; font-weight: 700; cursor: not-allowed;
            transition: all 0.3s ease;
        }
        .skip-btn.active {
            background: #ef4444; color: white; border-color: #ef4444;
            cursor: pointer; box-shadow: 0 5px 15px rgba(239, 68, 68, 0.4);
        }
        @keyframes adPopIn { 
            0% { opacity: 0; transform: scale(0.9) translateY(20px); } 
            100% { opacity: 1; transform: scale(1) translateY(0); } 
        }

        /* === 🚨 BULLETPROOF NAVBAR FIX 🚨 === */
        header {
            position: relative;
            z-index: 99990; 
        }

        .navbar {
            position: fixed !important; 
            top: 0; left: 0; right: 0;
            height: calc(var(--nav-height) + var(--safe-top));
            padding-top: var(--safe-top);
            background: linear-gradient(135deg, rgba(114, 0, 0, 0.95) 0%, rgba(230, 0, 38, 0.95) 100%);
            backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
            display: flex; justify-content: space-between; align-items: center;
            /* Fluid padding to prevent crushing on small screens */
            padding-left: max(clamp(10px, 4vw, 30px), var(--safe-left)); 
            padding-right: max(clamp(10px, 4vw, 30px), var(--safe-right));
            z-index: 100000 !important; 
            box-shadow: 0 4px 25px rgba(114, 0, 0, 0.35); 
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            pointer-events: auto !important;
        }
        
        .nav-left-group { display: flex; align-items: center; gap: clamp(10px, 2vw, 30px); }
        
        .logo {
            font-weight: 900; font-size: clamp(14px, 3.5vw, 20px); 
            color: white; text-decoration: none; letter-spacing: -0.5px;
            display: flex; align-items: center; gap: clamp(4px, 1vw, 8px);
            text-shadow: 0 2px 4px rgba(74, 0, 8, 0.4); 
            z-index: 100000; white-space: nowrap;
        }
        
        .nav-links { display: flex; align-items: center; gap: clamp(15px, 2vw, 25px); z-index: 100000; height: 100%; }
        .nav-links > a {
            text-decoration: none; color: rgba(255, 255, 255, 0.9);
            font-weight: 600; font-size: 15px; transition: all 0.2s;
            padding: 10px 0; 
            display: flex; align-items: center;
        }
        .nav-links > a:hover { color: white; transform: translateY(-1px); }
        
        /* === UPGRADED DROPDOWN MENUS (DESKTOP) === */
        .dropdown { 
            position: relative; display: flex; align-items: center; 
            z-index: 100000; height: 100%; 
        }
        
        /* The Invisible Bridge to fix the Hover Dead Zone */
        .dropdown::after {
            content: ''; position: absolute; top: 100%; left: 0; width: 100%; height: 20px;
        }

        .dropbtn {
            background: none; border: none; cursor: pointer;
            color: rgba(255, 255, 255, 0.9); font-weight: 600; font-size: 15px; font-family: 'Inter', sans-serif;
            display: flex; align-items: center; gap: 5px; transition: 0.2s; padding: 25px 0; height: 100%;
        }
        
        .dropdown-content {
            display: none; position: absolute; top: calc(100% - 5px); left: 0;
            background-color: white; min-width: 240px;
            box-shadow: 0 15px 35px rgba(114, 0, 0, 0.15);
            border-radius: 16px; z-index: 100001; 
            border: 1px solid var(--primary-light); 
            animation: fadeIn 0.2s ease-out; padding: 10px 0;
        }
        
        /* Desktop trigger: both hover OR click will open it */
        @media (hover: hover) {
            .dropbtn:hover { color: white; }
            .dropdown:hover .dropdown-content { display: block; }
        }
        .dropdown.active .dropdown-content { display: block; } /* Click support */
        
        .dropdown-content a {
            color: var(--text-dark) !important; padding: 12px 20px;
            text-decoration: none; display: block; 
            font-size: 14px; font-weight: 600; position: relative; z-index: 100002;
            transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }
        .dropdown-content a:hover {
            background-color: #FEF2F4; color: var(--primary) !important;
            padding-left: 28px;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(-10px) scale(0.98); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }

        /* === CTA BUTTONS === */
        .nav-right-actions { display: flex; align-items: center; gap: 15px; z-index: 100000; }
        .btn-nav {
            background: white; color: var(--secondary) !important;
            padding: 10px 20px; border-radius: 30px; font-weight: 800 !important;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); text-decoration: none;
            box-shadow: 0 4px 10px rgba(114, 0, 0, 0.15); white-space: nowrap;
        }
        .btn-nav:hover {
            transform: translateY(-2px); box-shadow: 0 8px 20px rgba(230, 0, 38, 0.25);
            color: var(--primary) !important;
        }

        /* === MOBILE MENU TOGGLE & OVERLAY === */
        .mobile-menu-btn {
            display: none; font-size: 26px; background: rgba(255,255,255,0.15); border: 1.5px solid rgba(255,255,255,0.3); 
            color: white !important; cursor: pointer !important; z-index: 1000010 !important; 
            transition: 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); width: 44px; height: 44px; 
            align-items: center; justify-content: center; border-radius: 12px;
            pointer-events: auto !important;
        }
        .mobile-menu-btn:active { transform: scale(0.9) rotate(5deg); background: rgba(255,255,255,0.25); }
        
        .mobile-overlay {
            position: fixed; inset: 0; background: rgba(0,0,0,0.6);
            backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
            z-index: 99995; 
            opacity: 0; visibility: hidden; transition: 0.3s;
        }
        .mobile-overlay.active { opacity: 1; visibility: visible; }

        /* === MOBILE MENU STYLES === */
        @media (max-width: 900px) {
            .mobile-menu-btn { display: flex; }
            .nav-left-group { width: 100%; justify-content: space-between; }
            .nav-right-actions { display: none; }
            
            .nav-links {
                position: fixed; top: calc(var(--nav-height) + var(--safe-top)); left: 0; right: 0;
                background: white; flex-direction: column; 
                padding: 10px 25px max(40px, var(--safe-bottom)); 
                box-shadow: 0 15px 30px rgba(114, 0, 0, 0.2);
                transform: translateY(-150%);
                transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
                z-index: 99998; align-items: flex-start; height: auto;
                overflow-y: auto; max-height: calc(100dvh - var(--nav-height) - var(--safe-top));
                border-bottom-left-radius: 24px; border-bottom-right-radius: 24px;
            }
            .nav-links.active { transform: translateY(0); }
            
            .nav-links > a, .dropdown { width: 100%; border-bottom: 1px solid #f0f0f0; height: auto;}
            
            .nav-links > a, .dropbtn {
                color: var(--text-dark) !important; text-align: left; 
                padding: 18px 0; font-size: 17px; display: flex; 
                justify-content: space-between; width: 100%;
            }
            
            .dropdown-content {
                position: static; box-shadow: none; border: none; padding: 0 0 10px 15px;
                display: none; border-radius: 0; background: transparent; 
                margin-top: 0; width: 100%; animation: none;
            }
            .dropdown-content a { padding: 14px 15px; font-size: 15px; border-bottom: 1px solid rgba(0,0,0,0.05); }
            .dropdown-content a:last-child { border-bottom: none; }
            .dropdown.active .dropdown-content { display: block; }
            
            .mobile-auth-btn { 
                background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%) !important; 
                color: white !important; text-align: center !important; border-radius: 14px; 
                margin-top: 25px; border: none !important; justify-content: center !important;
                padding: 16px !important; font-weight: 800; font-size: 16px;
                box-shadow: 0 8px 20px rgba(230, 0, 38, 0.2); display: none; width: 100%;
            }
            .mobile-only-link { border-bottom: none !important; color: var(--primary) !important; font-weight: 800 !important; padding-bottom: 0 !important; display: none; width: 100%; justify-content: center;}
        }

        /* === WORLD-CLASS GLASSMORPHISM BOTTOM NAV === */
        .mobile-bottom-nav {
            display: none;
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: calc(70px + var(--safe-bottom));
            background: rgba(114, 0, 0, 0.45);
            backdrop-filter: blur(25px);
            -webkit-backdrop-filter: blur(25px);
            border-top: 1px solid rgba(255, 255, 255, 0.15);
            z-index: 99999;
            justify-content: space-around;
            align-items: center;
            padding-bottom: var(--safe-bottom);
            box-shadow: 0 -8px 32px 0 rgba(0, 0, 0, 0.35);
        }

        @media (max-width: 900px) {
            .mobile-bottom-nav { display: flex; }
            footer { padding-bottom: calc(90px + var(--safe-bottom)) !important; }
            .support-trigger-btn { bottom: calc(85px + var(--safe-bottom)) !important; }
        }

        .mobile-nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-decoration: none;
            color: rgba(255, 255, 255, 0.6);
            font-size: 10px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            transition: 0.3s;
        }

        .mobile-nav-item span { font-size: 24px; margin-bottom: 2px; }
        .mobile-nav-item:hover, .mobile-nav-item.active { color: white; transform: translateY(-3px); }

        /* === FLOATING TOAST NOTIFICATIONS === */
        .toast-container { 
            position: fixed; top: calc(var(--nav-height) + var(--safe-top) + 15px); right: 15px; left: 15px; 
            z-index: 100010; 
            display: flex; flex-direction: column; gap: 10px; pointer-events: none; 
        }
        @media (min-width: 600px) { .toast-container { left: auto; max-width: 400px; right: 20px; } }
        
        .alert {
            padding: 16px 20px; border-radius: 12px; font-weight: 600; font-size: 14px;
            box-shadow: 0 10px 30px rgba(74, 0, 8, 0.25); animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
            display: flex; align-items: center; justify-content: space-between; pointer-events: auto; line-height: 1.4;
        }
        .alert-success { background: white; color: #155724; border-left: 6px solid #28a745; }
        .alert-error, .alert-danger { background: white; color: #721c24; border-left: 6px solid var(--primary); }
        .alert-warning { background: white; color: #856404; border-left: 6px solid #ffc107; }
        .alert-info { background: white; color: #0c5460; border-left: 6px solid #17a2b8; }
        
        .close-toast { background: none; border: none; font-size: 22px; cursor: pointer; color: inherit; opacity: 0.4; margin-left: 15px; padding: 0 5px; min-width: 30px; min-height: 30px; display: flex; align-items: center; justify-content: center;}
        .close-toast:hover { opacity: 1; }

        @keyframes slideIn { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
        @keyframes slideOut { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

        /* === MAIN CONTENT === */
        .container { 
            flex: 1; width: 100%; max-width: 1200px; 
            margin: calc(var(--nav-height) + var(--safe-top)) auto 0; 
            padding: 0 max(15px, var(--safe-left)) 0 max(15px, var(--safe-right)); 
            position: relative; z-index: 10; 
        }

        /* === 📲 PROFESSIONAL PWA INSTALL OVERLAY === */
        .pwa-install-overlay {
            position: fixed; inset: 0; background: rgba(15, 23, 42, 0.85); 
            backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
            z-index: 200000; display: none; align-items: center; justify-content: center;
            padding: 20px; animation: fadeInModal 0.4s ease;
        }
        .pwa-install-card {
            background: white; width: 100%; max-width: 400px; border-radius: 32px;
            padding: 40px 30px; text-align: center; position: relative;
            box-shadow: 0 30px 60px rgba(0,0,0,0.5); border: 1px solid #FFD6DD;
            animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }
        .pwa-close {
            position: absolute; top: 20px; right: 20px; background: #f1f5f9;
            border: none; width: 36px; height: 36px; border-radius: 50%;
            font-size: 20px; font-weight: bold; color: #64748b; cursor: pointer;
            display: flex; align-items: center; justify-content: center; transition: 0.2s;
        }
        .pwa-close:hover { background: #fee2e2; color: #ef4444; }
        
        .pwa-icon-wrap {
            width: 80px; height: 80px; margin: 0 auto 25px; border-radius: 20px;
            overflow: hidden; box-shadow: 0 10px 25px rgba(230,0,38,0.2);
            border: 2px solid #FEF2F4;
        }
        .pwa-icon-wrap img { width: 100%; height: 100%; object-fit: cover; }
        
        .pwa-install-card h3 { font-size: 24px; font-weight: 900; color: #720000; margin-bottom: 12px; letter-spacing: -0.5px; }
        .pwa-install-card p { color: #666; font-size: 15px; line-height: 1.6; margin-bottom: 30px; }
        
        .pwa-actions { display: flex; flex-direction: column; gap: 12px; }
        .btn-pwa-install {
            background: linear-gradient(135deg, #720000 0%, #E60026 100%);
            color: white; border: none; padding: 16px; border-radius: 14px;
            font-size: 16px; font-weight: 900; cursor: pointer;
            box-shadow: 0 8px 20px rgba(230,0,38,0.25); transition: transform 0.2s;
        }
        .btn-pwa-install:active { transform: scale(0.97); }
        .btn-pwa-later {
            background: transparent; color: #64748b; border: 1px solid #e2e8f0;
            padding: 12px; border-radius: 14px; font-weight: 700; font-size: 14px; cursor: pointer;
        }
        .btn-pwa-later:hover { background: #f8fafc; color: #1e293b; }

        /* === SUPPORT BUTTON === */
        .support-trigger-btn {
            position: fixed; bottom: max(20px, var(--safe-bottom)); right: max(20px, var(--safe-right)); 
            background: #E60026; color: white; border: none; border-radius: 50px; 
            padding: 8px 16px; cursor: pointer; box-shadow: 0 4px 15px rgba(230,0,38,0.4); 
            z-index: 99990; font-weight: 800; font-size: 13px; transition: all 0.2s ease;
            display: flex; align-items: center; gap: 6px;
        }
        .support-trigger-btn:hover { transform: scale(1.05); background: #720000; }

        /* === FOOTER === */
        footer { 
            background: var(--secondary-dark); color: white; text-align: center; 
            padding: 40px 20px calc(40px + var(--safe-bottom)); 
            margin-top: auto; position: relative; z-index: 10;
        }
        footer p { font-size: 14px; opacity: 0.9; margin: 0; }
        
        .footer-partner-link {
            display: inline-block; color: var(--primary-light); text-decoration: none;
            font-weight: 800; font-size: 13px; border: 1.5px solid rgba(255, 214, 221, 0.4);
            padding: 12px 25px; border-radius: 30px; margin-top: 25px; transition: all 0.3s;
        }
        .footer-partner-link:hover { background: white; border-color: white; color: var(--secondary); transform: translateY(-2px); }

        /* ========================================== */
        /* MOBILE PERFORMANCE MASTER PATCH */
        /* ========================================== */
        .card, .btn-action, .crush-modal-content, .referral-card, .bell-popover {
            will-change: transform, opacity;
            transform: translateZ(0); -webkit-transform: translateZ(0);
            backface-visibility: hidden; -webkit-backface-visibility: hidden;
            perspective: 1000px;
        }

        @media (max-width: 768px) {
            #match-overlay, .crush-modal, #supportModalOverlay {
                backdrop-filter: blur(5px);
                -webkit-backdrop-filter: blur(5px);
                background: rgba(0, 0, 0, 0.8) !important;
            }
            .card * { box-shadow: none !important; }
        }

        #shimmer, .img-gradient { pointer-events: none; }
        
        /* === SUPPORT MODAL STYLES === */
        .support-modal-overlay {
            display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
            backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
            z-index: 100020; align-items: center; justify-content: center;
            padding: 15px; /* Ensures modal doesn't touch screen edges */
            animation: fadeInModal 0.3s ease;
        }
        .support-modal-card {
            background: white; padding: clamp(25px, 6vw, 40px) clamp(20px, 5vw, 30px); 
            border-radius: 20px;
            /* Fluid width ensures it perfectly fits small phones without scrolling */
            width: min(100%, 420px); position: relative;
            box-shadow: 0 20px 50px rgba(0,0,0,0.3);
            animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            border-top: 6px solid var(--primary);
            max-height: calc(100dvh - 30px);
            overflow-y: auto;
        }
        .close-modal-btn {
            position: absolute; right: 15px; top: 15px; background: #f1f5f9;
            border: none; width: 36px; height: 36px; border-radius: 50%;
            font-size: 22px; font-weight: bold; color: #475569; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            transition: all 0.2s ease;
        }
        @media (hover: hover) { .close-modal-btn:hover { background: #fee2e2; color: #ef4444; transform: rotate(90deg); } }
        .close-modal-btn:active { transform: scale(0.9); }
        
        .support-input {
            width: 100%; padding: 14px; border-radius: 12px; 
            border: 2px solid #f0f0f0; background: #fafafa; 
            font-family: inherit; font-size: 16px !important; /* NO ZOOM */
            outline: none; transition: border-color 0.2s; font-weight: 600;
        }
        .support-input:focus { border-color: var(--primary); background: #fff; }

        @keyframes fadeInModal { from { opacity: 0; } to { opacity: 1; } }
        @keyframes popIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }