        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            --primary: #00d2ff;
            --primary-dark: #0099cc;
            --secondary: #3a7bd5;
            --bg: #0a0f1f;
            --card-bg: #121826;
            --card-hover: #1f2a3e;
            --text: #f0f3fa;
            --text-muted: #a0aec0;
            --border-glow: rgba(0, 210, 255, 0.3);
            --error-bg: #1e1a2f;
        }

        body {
            background-color: var(--bg);
            color: var(--text);
            font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, 'Roboto', sans-serif;
            overflow-x: hidden;
            width: 100%;
            height: 100vh;
            display: flex;
            flex-direction: column;
        }

        .app-container {
            display: flex;
            flex-direction: column;
            height: 100vh;
            width: 100%;
            max-width: 100%;
            overflow: hidden;
        }

        /* TOP HEADER - fixed style, never scrolls */
        .main-header {
            background: rgba(10, 15, 31, 0.98);
            backdrop-filter: blur(12px);
            padding: 12px 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 2px solid var(--primary);
            z-index: 1100;
            position: relative;
            flex-shrink: 0;
            width: 100%;
        }

        .logo-area h2 {
            font-size: 1.6rem;
            font-weight: 800;
            letter-spacing: 1px;
            margin: 0;
        }

        .logo-area span {
            color: var(--primary);
        }

        /* ডেস্কটপ মেনু */
        .desktop-menu {
            display: flex;
            gap: 28px;
            background: transparent;
        }

        .desktop-menu a {
            color: var(--text);
            font-size: 1rem;
            font-weight: 500;
            text-decoration: none;
            transition: 0.2s;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            border-radius: 40px;
        }

        .desktop-menu a i {
            font-size: 1.2rem;
            color: var(--primary);
        }

        .desktop-menu a:hover {
            background: rgba(0, 210, 255, 0.15);
            color: white;
        }

        /* মোবাইল হামবার্গার */
        .mobile-menu-btn {
            display: none;
            background: none;
            border: none;
            color: var(--primary);
            font-size: 28px;
            cursor: pointer;
            padding: 8px;
        }

        /* মোবাইল ড্রয়ার */
        .mobile-drawer {
            position: fixed;
            top: 0;
            left: -280px;
            width: 280px;
            height: 100%;
            background: rgba(10, 15, 31, 0.98);
            backdrop-filter: blur(20px);
            z-index: 2000;
            transition: left 0.3s ease;
            padding: 70px 20px 30px;
            box-shadow: 2px 0 20px rgba(0,0,0,0.6);
            border-right: 1px solid var(--primary);
        }

        .mobile-drawer.open {
            left: 0;
        }

        .drawer-close {
            position: absolute;
            top: 18px;
            right: 20px;
            background: none;
            border: none;
            color: var(--primary);
            font-size: 28px;
            cursor: pointer;
        }

        .mobile-drawer a {
            display: flex;
            align-items: center;
            gap: 15px;
            padding: 14px 0;
            font-size: 1.2rem;
            color: var(--text);
            text-decoration: none;
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }

        .mobile-drawer a i {
            width: 30px;
            color: var(--primary);
        }

        .drawer-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.6);
            z-index: 1999;
            display: none;
        }

        /* MAIN CONTENT - takes remaining height, ensures only channels scroll */
        .main-content {
            display: flex;
            flex: 1;
            overflow: hidden;
            padding: 16px 20px 20px 20px;
            gap: 24px;
            width: 100%;
            max-width: 100%;
            min-height: 0;
        }

        /* ভিডিও সেকশন - fixed, never scrolls */
        .video-section {
            flex: 2.2;
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 12px;
            overflow: visible;
        }

        .player-card {
            background: #000000;
            border-radius: 24px;
            overflow: hidden;
            box-shadow: 0 15px 35px rgba(0,0,0,0.5);
            position: relative;
            width: 100%;
            aspect-ratio: 16 / 9;
        }

        #player-container {
            width: 100%;
            height: 100%;
            position: relative;
            background: black;
        }

        #video-placeholder {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: url('https://sky-livetv.pages.dev/sky_live_tv_banner.png') no-repeat center center;
            background-size: cover;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 5;
            transition: opacity 0.2s;
        }

        #video-placeholder.fallback-mode {
            background: linear-gradient(135deg, #0f172a 0%, #1e1a3a 100%);
            background-size: cover;
        }

        .fallback-content {
            text-align: center;
            color: var(--primary);
        }
        .fallback-content i {
            font-size: 48px;
            margin-bottom: 12px;
            display: block;
        }
        .fallback-content p {
            font-size: 14px;
            background: rgba(0,0,0,0.6);
            padding: 6px 12px;
            border-radius: 30px;
        }

        .loading-spinner {
            width: 60px;
            height: 60px;
            border: 5px solid rgba(255,255,255,0.3);
            border-top: 5px solid var(--primary);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

        /* চ্যানেল সাইডবার - only this section scrolls internally */
        .channels-sidebar {
            flex: 1.2;
            background: rgba(18, 24, 38, 0.9);
            backdrop-filter: blur(4px);
            border-radius: 28px;
            border: 1px solid rgba(0,210,255,0.2);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            min-width: 0;
            height: 100%;
        }

        .channels-header {
            padding: 18px 16px;
            border-bottom: 1px solid rgba(0,210,255,0.3);
            font-weight: bold;
            font-size: 1.2rem;
            background: rgba(0,0,0,0.3);
            flex-shrink: 0;
        }

        /* THIS IS THE KEY: only channel grid scrolls, header stays fixed */
        .channel-grid-scroll {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 16px;
            display: grid;
            gap: 14px;
            min-width: 0;
            /* smooth scrolling on mobile */
            -webkit-overflow-scrolling: touch;
        }

        /* চ্যানেল কার্ড */
        .channel-card {
            background: #1a1f2e;
            border-radius: 20px;
            padding: 12px 6px;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s ease;
            border: 1px solid rgba(255,255,255,0.05);
            min-width: 0;
        }

        .channel-card:hover {
            background: var(--primary-dark);
            transform: translateY(-3px);
            border-color: var(--primary);
        }

        .channel-card img {
            width: 52px;
            height: 52px;
            object-fit: contain;
            background: #fff;
            border-radius: 50%;
            margin-bottom: 8px;
            padding: 4px;
            display: block;
            margin-left: auto;
            margin-right: auto;
        }

        .channel-name {
            font-size: 11px;
            font-weight: 600;
            display: block;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            width: 100%;
            padding: 0 2px;
        }

        /* ========== ডেস্কটপ ভিউ গ্রিড ========== */
        @media (min-width: 781px) {
            .channel-grid-scroll {
                grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
            }
        }

        /* ========== মোবাইল ভিউ: প্রতি লাইনে ৪টি করে, শুধু চ্যানেল স্ক্রোল, মেনু ফিক্সড ========== */
        @media (max-width: 780px) {
            .app-container {
                overflow: hidden;
                height: 100vh;
            }
            
            .main-content {
                flex-direction: column;
                padding: 12px;
                gap: 18px;
                overflow-y: auto;  /* allows vertical scroll if needed but header is fixed, actually main-content can scroll but we need only channels to scroll? Better: make channels sidebar take remaining space and scroll inside */
                overflow-x: hidden;
            }
            
            /* Make video section auto and channels take remaining height with internal scroll */
            .video-section {
                flex: none;
                width: 100%;
                min-width: 0;
            }
            
            .channels-sidebar {
                width: 100%;
                flex: 1;
                min-height: 0;    /* crucial for flex child scrolling */
                border-radius: 28px;
                overflow: hidden;
                display: flex;
                flex-direction: column;
            }
            
            .channel-grid-scroll {
                flex: 1;
                overflow-y: auto;
                overflow-x: hidden;
                display: grid;
                grid-template-columns: repeat(4, minmax(0, 1fr));
                gap: 10px;
                padding: 14px 10px;
                -webkit-overflow-scrolling: touch;
            }
            
            .channel-card {
                padding: 10px 4px;
                min-width: 0;
                width: 100%;
            }
            
            .channel-card img {
                width: 45px;
                height: 45px;
            }
            
            .channel-name {
                font-size: 10px;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }
            
            .desktop-menu {
                display: none;
            }
            
            .mobile-menu-btn {
                display: block;
            }
            
            .logo-area h2 {
                font-size: 1.3rem;
            }
        }

        /* খুব ছোট ডিভাইসেও ৪টি রাখা হবে, সাইজ আরও অপ্টিমাইজ */
        @media (max-width: 480px) {
            .channel-grid-scroll {
                grid-template-columns: repeat(4, minmax(0, 1fr));
                gap: 8px;
                padding: 12px 8px;
            }
            
            .channel-card {
                padding: 8px 4px;
            }
            
            .channel-card img {
                width: 42px;
                height: 42px;
            }
            
            .channel-name {
                font-size: 9px;
            }
        }

        /* 320px পর্যন্তও ঠিক থাকবে */
        @media (max-width: 360px) {
            .channel-grid-scroll {
                gap: 6px;
                padding: 10px 6px;
            }
            
            .channel-card img {
                width: 38px;
                height: 38px;
            }
            
            .channel-name {
                font-size: 8.5px;
            }
        }

        /* Plyr customization */
        .plyr--video .plyr__controls .plyr__time {
            display: none !important;
        }

        /* Custom scrollbar for channel grid only */
        .channel-grid-scroll::-webkit-scrollbar {
            width: 4px;
        }
        
        .channel-grid-scroll::-webkit-scrollbar-track {
            background: #1e293b;
            border-radius: 10px;
        }
        
        .channel-grid-scroll::-webkit-scrollbar-thumb {
            background: var(--primary);
            border-radius: 10px;
        }
        
        /* For Firefox */
        .channel-grid-scroll {
            scrollbar-width: thin;
            scrollbar-color: var(--primary) #1e293b;
        }

        .loading-text-mini {
            text-align: center;
            padding: 30px;
            color: var(--primary);
        }
        
        /* error toast */
        .error-toast {
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: #dc2626;
            color: white;
            padding: 8px 18px;
            border-radius: 40px;
            font-size: 13px;
            z-index: 3000;
            animation: fadeInOut 2.5s ease forwards;
            pointer-events: none;
            white-space: nowrap;
        }
        
        @keyframes fadeInOut {
            0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
            15% { opacity: 1; transform: translateX(-50%) translateY(0); }
            85% { opacity: 1; transform: translateX(-50%) translateY(0); }
            100% { opacity: 0; transform: translateX(-50%) translateY(20px); }
        }
        
        /* Ensure header is always on top and doesn't scroll */
        .main-header {
            position: relative;
            top: 0;
            left: 0;
            right: 0;
        }
