        * {
            box-sizing: border-box;
        }
        body {
            display: flex;
            margin: 0;
            padding: 0;
            height: 100vh;
            width: 100vw;
            overflow: hidden;
            background-color: #0d0d0d; /* Hitam pekat */
            color: #e0e0e0;
            font-family: 'Segoe UI', Roboto, sans-serif;
            -webkit-user-select: none; /* Safari */
            -ms-user-select: none;     /* IE 10 dan 11 */
            user-select: none;         /* Standar */
        }

        input, textarea {
            -webkit-user-select: text;
            user-select: text;
        }
        
        /* SISI KIRI: PLAYER & EPG (Kunci di 65% Lebar) */
        #main-player {
            width: 65vw; 
            height: 100vh;
            display: flex;
            flex-direction: column;
            background-color: #1a1a1a;
            position: relative;
        }
        
        /* SISI KANAN: SIDEBAR (Kunci di 35% Lebar)
        }*/
        #sidebar {
            width: 35vw;
            height: 100vh !important; /* Kunci tinggi sidebar tepat setinggi layar */
            background: #141414;
            display: flex !important;
            flex-direction: column !important; /* Paksa susunan vertikal */
            border-left: 1px solid #444;
            overflow: hidden !important; /* Sidebar-nya sendiri tidak boleh scroll */
            position: relative;
        }
        
        .sidebar-header {
            padding: 10px 20px;
            background-color: #333;
            flex-shrink: 0 !important; /* JANGAN biarkan bagian ini mengecil atau ikut tergulung */
            z-index: 10;
        }

        #search-channel {
            width: 100%;
            box-sizing: border-box;
            padding: 10px;
            font-size: 14px;
        }
        #search-channel::placeholder {
            color: #888;
        }
        #search-channel:focus, #league-select:focus {
            border-color: #ff0000;
            box-shadow: 0 0 8px rgba(255, 0, 0, 0.3);
            outline: none;
        }

        .channel-item:hover { 
            background: #444; 
        }

        /* Video Container*/
        .video-container {
            position: relative;
            width: 100%;
            height: 100%;
            background: #000;
        }
        
        #main-iframe {
            width: 100%;
            height: 100%;
            border: none;
            display: block;
        }
        .video-container:fullscreen {
            width: 100vw;
            height: 100vh;
            background: #000;
        }
        
        /* Pastikan Iframe tetap memenuhi container saat fullscreen */
        .video-container:fullscreen iframe {
            width: 100%;
            height: 100%;
        }
        /* Video.js: Paksa mengikuti lebar kontainer tanpa sisa hitam */
        .video-js {
            width: 100% !important;
            height: auto !important;
            aspect-ratio: 16 / 9;
        }
        .channel-item { 
            display: flex; 
            align-items: center; 
            padding: 10px 15px; 
            cursor: pointer; 
            border-bottom: 1px solid #444; 
        }
        .channel-logo {
            width: 50px;
            height: 50px;
            object-fit: contain; /* Menjaga logo tetap proporsional */
            background: #fff;
            border-radius: 4px;
            margin-right: 12px;
        }
        /* AREA EPG: Sisa ruang bawah (Sangat Luas) */
        #epg-container {
            flex-grow: 1; 
            padding: 10px;
            background: #1a1a1a;
            border-top: 2px solid #333;
            overflow-y: auto;
            overflow-x: hidden;
            color: #fff;
            min-height: 0; 
            display: flex;
            flex-direction: column;
        }
        /* Style saat EPG Kosong */
        #epg-container:empty::before {
            content: "Tidak ada jadwal program saat ini.";
            color: #666;
            font-size: 14px;
            font-style: italic;
            text-align: center;
            margin-top: 20px;
        }
        /* Merapikan scrollbar khusus EPG agar tidak merusak pemandangan */
        #epg-container::-webkit-scrollbar {
            width: 2px;
        }

        #epg-container::-webkit-scrollbar-track {
            background: #1a1a1a;
        }

        #epg-container::-webkit-scrollbar-thumb {
            background: #444;
            border-radius: 5px;
        }

        /* Memastikan elemen di dalam EPG tidak meluber */
        .epg-item {
            padding: 10px;
            border-bottom: 1px solid #333;
            flex-shrink: 0; /* Mencegah item EPG gepeng */
        }

        #current-channel-name {
            font-size: 1.5em;
            color: #007bff;
            margin: 0;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
        }

        #current-epg {
            margin-top: 2px;
            font-size: 1em;
            line-height: 1.6;
            color: #aaa;
            max-width: 800px; /* Menjaga teks tidak terlalu melar ke kanan */
        }

        /* List Channel di dalam Sidebar*/
        #channel-list {
            flex-grow: 1 !important; /* Paksa ambil semua sisa ruang yang tersedia */
            flex-basis: 0;
            overflow-y: auto !important; /* AKTIFKAN SCROLL DI SINI */
            overflow-x: hidden;
            margin: 0;
            padding: 0;
            list-style: none;
            display: block !important; /* Pastikan dia bukan flex agar scroll lebih stabil */
            
            /* Tambahan agar scrollbar muncul di browser berbasis Chrome */
            -webkit-overflow-scrolling: touch;
        }

        #channel-list li:hover {
            background: #252525;
            border-color: #ff0000;
            transform: translateX(5px); /* Geser sedikit saat di-hover */
        }
        /* Glow Effect pada Channel yang SEDANG DIPUTAR */
        #channel-list li.playing {
            background: #1a1a1a;
            border-left: 5px solid #ff0000;
            box-shadow: 0 0 10px rgba(255, 0, 0, 0.2);
        }
        #category-filter {
            display: flex;
            gap: 8px;
            overflow-x: auto; /* Biar bisa digeser ke samping kalau kategorinya banyak */
            padding-bottom: 0;
            scrollbar-width: none; /* Sembunyikan scrollbar di Firefox */
        }
        #category-filter::-webkit-scrollbar {
            display: none; /* Sembunyikan scrollbar di Chrome/Safari */
        }
        .cat-btn {
            padding: 6px 12px;
            border-radius: 15px;
            border: 1px solid #444;
            background: #222;
            color: #888;
            cursor: pointer;
            white-space: nowrap;
            font-size: 12px;
            transition: all 0.3s;
        }
        
        .cat-btn.active {
            background: #007bff; /* Warna biru khas */
            color: white;
            border-color: #007bff;
        }
        .cat-btn:hover:not(.active) {
            background: #333;
            color: #fff;
        }
       
       /* --- RESPONSIVE HP: FIX SCROLL TERPOTONG --- */
        @media (max-width: 992px) {
            body {
                position: fixed; /* Kunci body agar tidak bisa goyang/scroll sama sekali */
                top: 0; left: 0; right: 0; bottom: 0;
                display: flex;
                flex-direction: column;
                height: 100dvh;
                overflow: hidden;
            }
            #epg-container, .marquee-container {
                display: none !important;
            }

            #main-player {
                flex-shrink: 0;
                width: 100vw;
                height: auto;
            }

            .video-container {
                width: 100%;
                aspect-ratio: 16 / 9;
            }

            #sidebar {
                flex: 1; /* Ambil sisa ruang */
                position: relative; /* Penting untuk koordinat anak */
                display: flex;
                flex-direction: column;
                overflow: hidden; 
                width: 100vw;
            }

            .sidebar-header {
                flex-shrink: 0;
                /* Jika ada banyak tab/filter, pastikan tidak meluber */
            }

            /* SOLUSI TOTAL: Gunakan Flex-Basis & Min-Height */
            #channel-list {
                flex: 1 1 0; /* Paksa ambil sisa ruang dan boleh menyusut */
                min-height: 0; /* Kunci agar flexbox tidak meluap keluar */
                overflow-y: auto !important;
                -webkit-overflow-scrolling: touch;
                
                /* Tambahkan padding agar item terakhir tidak mepet bawah */
                padding-bottom: 50px !important; 
            }
        }

        /* --- FIX MODE LANDSCAPE (HP MIRING) --- */
        @media (max-width: 992px) and (orientation: landscape) {
            body {
                flex-direction: row !important; /* Player kiri, Sidebar kanan */
                display: flex !important;
            }

            #main-player {
                /* Kita kunci player agar tidak terlalu mendominasi */
                flex: 0 0 60% !important; 
                width: 60% !important;
                height: 100dvh !important;
                background: #000;
            }

            .video-container {
                height: 100%;
                display: flex;
                align-items: center; /* Video tetap di tengah secara vertikal */
                justify-content: center;
                background: #000;
            }

            #main-iframe {
                width: 100%;
                /* Gunakan aspect-ratio agar video tidak gepeng saat sidebar mengecil */
                aspect-ratio: 16 / 9; 
            }

            #sidebar {
                /* Sisa 40% untuk sidebar agar lebih rapi dan lega */
                flex: 0 0 40% !important;
                width: 40% !important;
                height: 100dvh !important;
                border-left: 1px solid #333;
                border-top: none; /* Hapus border top dari mode portrait */
            }

            #channel-list {
                padding-bottom: 40px !important; /* Padding lebih kecil karena mode landscape pendek */
            }

            .sidebar-header {
                padding: 5px 15px; /* Perkecil padding header agar list lebih luas */
            }
            #channel-list::-webkit-scrollbar {
                width: 2px; /* Sangat tipis */
            }
            #channel-list::-webkit-scrollbar-thumb {
                background: #444; 
                border-radius: 10px;
            }
        }

        /* Indikator Channel Aktif */
        .channel-item.active {
            border-left: 4px solid #ff0000;
            background: #252525;
            box-shadow: inset 10px 0 20px -10px rgba(255, 0, 0, 0.5);
        }

        #video-loading {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            z-index: 10;
            display: none; /* Sembunyi secara default */
            background: rgba(0, 0, 0, 0.7); /* Latar belakang hitam transparan agar tulisan jelas */
            padding: 15px 30px;
            border-radius: 5px;
            backdrop-filter: blur(5px); /* Efek blur kaca di belakang tulisan */
        }

        .pulse-text {
            color: #fff;
            font-size: 1.5em;
            font-weight: bold;
            letter-spacing: 2px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        /* Tambahkan ikon kecil jika ingin lebih estetik (opsional, pakai emoji/simbol) */
        .pulse-text::before {
            content: "📡"; /* Ikon Satelit/Sinyal */
            font-size: 1.2em;
        }

        /* Animasi Pulsa */
        @keyframes pulse {
            0% { opacity: 0.5; }
            50% { opacity: 1; }
            100% { opacity: 0.5; }
        }

        #video-loading .pulse-text {
            animation: pulse 1.5s infinite ease-in-out;
        }

        #custom-fs-btn {
            background: #007bff;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 5px;
            cursor: pointer;
            font-weight: bold;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: background 0.3s, transform 0.2s;
        }

        #custom-fs-btn:hover {
            background: #0056b3;
            transform: scale(1.05);
        }

        #custom-fs-btn:active {
            transform: scale(0.95);
        }
        #countdown-overlay {
            display: none; /* Akan jadi 'flex' melalui JS */
            position: absolute !important;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #000;
            z-index: 9999 !important;
            color: white;
            
            /* Tambahkan ini untuk merapikan isi */
            flex-direction: column;
            justify-content: center;
            align-items: center;
            text-align: center;
            padding: 20px;
        }
        
        /* Container untuk Logo VS */
        .match-vs-container {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 30px;
            margin: 25px 0;
            width: 100%;
        }
        
        .team-box {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        
        .team-box img {
            width: clamp(80px, 15vw, 120px); /* Ukuran responsif */
            height: auto;
            filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));
        }
        
        #timer-display {
            backdrop-filter: blur(10px); /* Efek blur kaca */
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            font-size: clamp(1.5rem, 5vw, 3rem); /* Ukuran teks responsif */
            font-weight: 800;
            letter-spacing: 2px;
            color: #007bff;
            text-shadow: 0 0 15px rgba(0, 123, 255, 0.5);
            background: rgba(255, 255, 255, 0.05);
            padding: 10px 25px;
            border-radius: 12px;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }
        
        #timer-match-name {
            text-transform: uppercase;
            color: #aaa;
            font-size: 1.2rem;
        }
        
        .match-vs-container img {
            filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));
            transition: transform 0.3s ease;
        }
        
        .match-vs-container img:hover {
            transform: scale(1.1);
        }

        /* Media Query Khusus Mobile (di bawah 600px) */
        @media screen and (max-width: 600px) {
            
            /* 1. Kurangi gap antar elemen agar tidak melebar */
            .match-vs-container {
                gap: 10px; /* Dari 30px ke 10px */
                margin: 15px 0; /* Kurangi margin atas bawah */
            }

            /* 2. Paksa ukuran Logo Team lebih kecil */
            .team-box img {
                width: 60px !important; /* Fix size untuk mobile agar konsisten */
            }

            /* 3. Sesuaikan Timer agar tidak 'gemuk' */
            #timer-display {
                font-size: 1.4rem !important; /* Override clamp() yang kebesaran */
                padding: 5px 15px; /* Kurangi padding dalam */
                letter-spacing: 1px;
                border-radius: 8px;
            }

            /* 4. Nama Match/Tim diperkecil agar tidak menumpuk */
            #timer-match-name {
                font-size: 0.8rem !important;
                margin-bottom: 5px;
            }

            /* 5. Pastikan team-box tidak memakan space berlebih */
            .team-box {
                flex: none; /* Matikan flex:1 agar logo tidak dipaksa lebar */
                width: 70px; 
            }
        }

        .current-show {
            display: block;
            font-size: 11px;
            color: #aaaaaa;
            white-space: nowrap; /* Biar teks tidak turun ke bawah */
            overflow: hidden;
            text-overflow: ellipsis; /* Biar kalau kepanjangan jadi titik-titik (...) */
            max-width: 180px; /* Sesuaikan dengan lebar sidebar kamu */
            margin-top: 2px;
        }
        
        .channel-info {
            display: flex;
            flex-direction: column;
            justify-content: center;
            overflow: hidden;
            gap: 2px;
        }

        .menu-tabs {
            display: flex;
            gap: 10px;
            margin-bottom: 0;
            padding: 10px 10px 10px 0px;
        }
        
        .tab-btn {
            background: #222;
            color: #fff;
            border: 1px solid #444;
            padding: 8px 15px;
            cursor: pointer;
            border-radius: 5px;
            font-size: 14px;
            transition: 0.3s;
        }

        .tab-btn-tele {
            background: #417dc7;
            color: #fff;
            border: 1px solid #444;
            padding: 8px 15px;
            cursor: pointer;
            border-radius: 5px;
            font-size: 14px;
            transition: 0.3s;
        }
        
        .tab-btn.active {
            background: linear-gradient(45deg, #ff0000, #b30000);
            border: none;
            box-shadow: 0 0 15px rgba(255, 0, 0, 0.4); /* Efek Pendar Merah */
            text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
            transition: 0.3s ease-in-out;
        }
        
        #tab-schedule {
            width: 100%;
            background: #111;
            border-radius: 10px;
            overflow: hidden;
        }
        
        /* Memastikan iframe responsif */
        #tour_schedule iframe {
            border-radius: 10px;
            filter: invert(1) hue-rotate(180deg); /* Opsional: Bikin iframe jadi dark mode jika aslinya putih */
        }

        .league-selector {
            padding: 10px;
            background: #1a1a1a;
            border-bottom: 1px solid #333;
            margin-bottom: 5px;
        }
        
        #league-select {
            width: 100%;
            padding: 10px;
            background: #222;
            color: #fff;
            border: 1px solid #444;
            border-radius: 5px;
            outline: none;
            font-size: 14px;
            cursor: pointer;
        }
        
        #league-select option {
            background: #222;
            color: #fff;
        }

        /* Scrollbar Style agar tetap Dark */
        ::-webkit-scrollbar {
            width: 2px;
        }
        ::-webkit-scrollbar-track {
            background: #0d0d0d;
        }
        ::-webkit-scrollbar-thumb {
            background: #333;
            border-radius: 10px;
        }
        ::-webkit-scrollbar-thumb:hover {
            background: #ff0000;
        }

        .tab-content {
            height: 100%;
            display: flex;
            flex-direction: column;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        /* Glow tambahan untuk Logo Tim di Sidebar */
        .channel-logo {
            filter: drop-shadow(0 0 2px rgba(255,255,255,0.1));
        }

        .marquee-container {
            display: flex;
            background: #1a1a1a;
            border-top: 1px solid #333;
            border-bottom: 1px solid #333;
            height: 35px;
            align-items: center;
            overflow: hidden;
            margin-bottom: 10px;
        }
        
        .marquee-label {
            background: #ff0000;
            color: white;
            padding: 0 15px;
            height: 100%;
            display: flex;
            align-items: center;
            font-weight: bold;
            font-size: 12px;
            z-index: 2;
            box-shadow: 5px 0 10px rgba(0,0,0,0.5);
        }
        
        .marquee-text {
            flex: 1;
            overflow: hidden;
            white-space: nowrap;
            position: relative;
        }
        
        .marquee-text span {
            display: inline-block;
            padding-left: 100%;
            animation: marquee 25s linear infinite;
            font-size: 14px;
            color: #e0e0e0;
            text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
            will-change: transform;
            transform: translateZ(0); /* Memicu Hardware Acceleration */
            backface-visibility: hidden;
        }
        
        @keyframes marquee {
            0% { transform: translate(0, 0); }
            100% { transform: translate(-100%, 0); }
        }
        
        /* Biar teks berhenti kalau di-hover (opsional) */
        .marquee-text:hover span {
            animation-play-state: paused;
        }

        /* Efek saat tombol disorot menggunakan kursor remote TV */
        .tab-btn:focus, .cat-btn:focus {
            outline: 3px solid #ff0000;
            background: #333;
            transform: scale(1.05); /* Sedikit membesar agar terlihat menonjol */
        }
        /* Highlight sangat jelas untuk navigasi remote TV */
        :focus {
            outline: 1px solid #ff0000 !important;
            outline-offset: 2px;
            background-color: rgba(255, 0, 0, 0.1) !important;
            transition: all 0.2s ease;
        }

        /* Khusus list channel agar membesar saat dipilih pakai remote */
        .channel-item:focus {
            transform: scale(1.03);
            z-index: 10;
        }

        /* Container info di sidebar */

        .event-time {
            font-size: 11px;
            color: #aaa;
            font-weight: normal;
        }

        /* Animasi Blink untuk Tanda LIVE */
        .live-indicator {
            color: #ff0000;
            font-weight: bold;
            font-size: 12px;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            animation: blink 1s infinite;
        }

        @keyframes blink {
            0% { opacity: 1; }
            50% { opacity: 0.3; }
            100% { opacity: 1; }
        }

        /* Indikator dot merah */
        .dot {
            height: 8px;
            width: 8px;
            background-color: #ff0000;
            border-radius: 50%;
            display: inline-block;
        }

        .server-status-container {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px;
            background: #141414;
            border-radius: 5px;
            margin-bottom: 10px;
            font-size: 12px;
        }
        
        .status-dot {
            height: 10px;
            width: 10px;
            background-color: #555; /* Default abu-abu */
            border-radius: 50%;
            display: inline-block;
            box-shadow: 0 0 5px rgba(0,0,0,0.5);
        }
        
        .status-dot.online {
            background-color: #00ff00;
            box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
        }
        
        .status-dot.slow {
            background-color: #ffff00;
            box-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
        }
        
        .status-dot.offline {
            background-color: #ff0000;
            box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
        }
        
        .ping-ms {
            color: #888;
            font-style: italic;
        }

        @media screen and (max-width: 768px) {
            .sidebar {
                width: 100%;
                height: auto;
            }
            .channel-item {
                padding: 12px; /* Lebih besar agar mudah di-tap jari */
            }
            .marquee-text span {
                font-size: 12px; /* Teks berita diperkecil sedikit agar pas di layar HP */
            }
        }