::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.dark ::-webkit-scrollbar-thumb { background: #334155; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.dark ::-webkit-scrollbar-thumb:hover { background: #475569; }

body {
    -webkit-tap-highlight-color: transparent;
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.glass-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    will-change: transform;
}

.dark .glass-card {
    background: rgba(28, 28, 28, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: none;
}

.glass-card:hover {
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 1);
}

.dark .glass-card:hover {
    background: rgba(40, 40, 40, 0.95);
}

.marquee-container {
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
}

.marquee-text {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 30s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Desktop click-to-play/pause flash animation */
@keyframes player-click-flash {
    0%   { opacity: 0;   transform: translate(-50%, -50%) scale(0.65); }
    18%  { opacity: 1;   transform: translate(-50%, -50%) scale(1.12); }
    45%  { opacity: 0.9; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0;   transform: translate(-50%, -50%) scale(1); }
}

#playerFlash.flashing {
    animation: player-click-flash 0.55s ease-out forwards;
}


/* ─── Desktop Two-Column Layout ───────────────────────────────
   Ensures the top-row grid (player + sidebar) uses a true 75/25
   split with a hard minimum on the sidebar so cards are never tiny.
   The grid-template-columns inline style on the element provides
   the actual column definition; this block is a fallback safeguard.
──────────────────────────────────────────────────────────────── */
@media (min-width: 1024px) {
    /* Sidebar channel grid: 2 equal columns that fill sidebar width */
    #sidebarChannelList .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Sidebar channel item active indicator */
.sidebar-channel-item .active-dot {
    display: block;
}

/* ─── Quality Selector Button ───────────────────────────────── */
.quality-selector-btn:hover {
    box-shadow: 0 2px 12px -2px rgba(59, 130, 246, 0.18);
}
.quality-selector-btn:active {
    transform: scale(0.97);
}

/* ─── Favorite Button ───────────────────────────────────────── */
.favorite-btn:hover {
    box-shadow: 0 2px 12px -2px rgba(239, 68, 68, 0.18);
}
.favorite-btn:active {
    transform: scale(0.97);
}

/* ─── Quality Selector Dropdown ─────────────────────────────── */
.quality-menu {
    transform: translateY(6px);
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}
.quality-menu.open {
    display: block !important;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.quality-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
    user-select: none;
}
.dark .quality-option {
    color: #a3a3a3;
}
.quality-option:hover {
    background: rgba(59, 130, 246, 0.08);
    color: #3b82f6;
}
.dark .quality-option:hover {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}
.quality-option.active {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.06);
}
.dark .quality-option.active {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.12);
}
.quality-option .q-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid #cbd5e1;
    flex-shrink: 0;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.dark .quality-option .q-dot {
    border-color: #404040;
}
.quality-option.active .q-dot {
    background: #3b82f6;
    border-color: #3b82f6;
}
.dark .quality-option.active .q-dot {
    background: #60a5fa;
    border-color: #60a5fa;
}
.quality-option .q-badge {
    margin-left: auto;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}
.dark .quality-option .q-badge {
    background: rgba(96, 165, 250, 0.12);
    color: #60a5fa;
}