/* ======================================================
   StreamTV — Monochrome Edition
   Dark / Light theme via [data-theme] on <html>
   ====================================================== */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap");

:root {
    /* ---- DARK (default) ---- */
    --bg: #0a0a0b;
    --bg-elev-1: #121214;
    --bg-elev-2: #19191c;
    --bg-elev-3: #222226;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #f4f4f5;
    --text-dim: #a1a1a8;
    --text-faint: #6b6b72;
    --accent: #ffffff;
    --accent-text: #0a0a0b;
    --danger: #ff5d5d;
    --overlay-bg: rgba(6, 6, 7, 0.78);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 0 1px rgba(255, 255, 255, 0.06);
    --grain-opacity: 0.025;
    --scrollbar-thumb: #3a3a3e;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --font-display: "Space Grotesk", "Inter", sans-serif;
    --font-body: "Inter", sans-serif;

    color-scheme: dark;
}

html[data-theme="light"] {
    --bg: #ffffff;
    --bg-elev-1: #f8f8f9;
    --bg-elev-2: #f8f8f9;
    --bg-elev-3: #ececee;
    --border: rgba(10, 10, 11, 0.08);
    --border-strong: rgba(10, 10, 11, 0.16);
    --text: #111113;
    --text-dim: #5b5b62;
    --text-faint: #8c8c92;
    --accent: #111113;
    --accent-text: #ffffff;
    --danger: #d23b3b;
    --overlay-bg: rgba(240, 240, 241, 0.86);
    --shadow-1: 0 1px 2px rgba(20, 20, 20, 0.06);
    --shadow-2: 0 12px 28px rgba(20, 20, 20, 0.1);
    --shadow-glow: 0 0 0 1px rgba(10, 10, 11, 0.04);
    --grain-opacity: 0.015;
    --scrollbar-thumb: #c7c7cb;

    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition:
        background-color 0.35s ease,
        color 0.35s ease;
}

/* subtle grain texture overlay for "expensive" feel */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: var(--grain-opacity);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 8px;
}

a {
    color: inherit;
}

.hidden {
    display: none !important;
}

#app {
    min-height: 100vh;
    padding-bottom: 84px;
}

/* ===================== TOPBAR ===================== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
}

.brand-mark {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--accent);
    color: var(--accent-text);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    box-shadow: var(--shadow-1);
}

.brand-mark-img {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

[data-theme="light"] .brand-mark-img {
    filter: invert(0.85);
}

.brand-name {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 17px;
    letter-spacing: -0.02em;
    color: var(--text);
}
.brand-name b {
    font-weight: 700;
}

.search-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    max-width: 560px;
}

.search-icon {
    position: absolute;
    left: 13px;
    width: 17px;
    height: 17px;
    color: var(--text-faint);
    pointer-events: none;
}

#searchInput {
    width: 100%;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-elev-2);
    color: var(--text);
    font-size: 14px;
    font-family: var(--font-body);
    padding: 0 14px 0 38px;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}
#searchInput::placeholder {
    color: var(--text-faint);
}
#searchInput:focus {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 10%, transparent);
}

.icon-btn {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-elev-2);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.18s ease;
}
.icon-btn svg {
    width: 18px;
    height: 18px;
}
.icon-btn:hover {
    color: var(--text);
    border-color: var(--border-strong);
    background: var(--bg-elev-3);
}
.icon-btn:active {
    transform: scale(0.94);
}
.icon-btn.active {
    background: var(--accent);
    color: var(--accent-text);
    border-color: var(--accent);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    /* margin-left: auto menyerap sisa ruang kosong di topbar,
       jadi grup ikon ini selalu nempel di ujung kanan —
       bukan numpuk di sebelah search bar lalu nyisain gap kosong. */
    margin-left: auto;
}

/* theme toggle */
#themeToggleBtn .icon-moon,
#themeToggleBtn .icon-sun {
    width: 18px;
    height: 18px;
}
#themeToggleBtn .icon-sun {
    display: none;
}
html[data-theme="light"] #themeToggleBtn .icon-moon {
    display: none;
}
html[data-theme="light"] #themeToggleBtn .icon-sun {
    display: block;
}

/* ===================== FILTER STRIPS ===================== */
.filter-strip {
    position: sticky;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

/* fade hint kanan/kiri menandakan strip bisa digeser */
.filter-strip::before,
.filter-strip::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    /* Lebaran fade diperbesar dari 20px → 40px agar sinyal visual lebih jelas
       dan chip terakhir tidak tampak "terpotong" di tepi. */
    width: 40px;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
.filter-strip::before {
    left: 0;
    background: linear-gradient(to right, var(--bg) 0%, transparent 100%);
    opacity: 0;
}
.filter-strip::after {
    right: 0;
    background: linear-gradient(to left, var(--bg) 0%, transparent 100%);
    opacity: 1;
}
.filter-strip.at-start::before {
    opacity: 0;
}
.filter-strip.at-end::after {
    opacity: 0;
}
.filter-strip:not(.at-start)::before {
    opacity: 1;
}
/* strip "sub" (Negara/Grup) sedikit lebih ramping dari strip Kategori
   agar ada hierarki visual yang jelas antar baris filter */
.filter-strip.sub {
    border-bottom: 1px solid var(--border);
}
.filter-strip.sub .filter-group {
    padding-top: 8px;
    padding-bottom: 8px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    /* padding-right besar supaya chip terakhir tidak tertutup fade overlay kanan.
       Sebelumnya 64px tapi tidak cukup karena chip bisa masih berada di bawah
       pseudo-element ::after. Nilai 80px memberi ruang visual yang memadai. */
    padding: 10px 80px 10px 16px;
    overflow-x: auto;
    scrollbar-width: none;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}
.filter-group:active {
    cursor: grabbing;
    scroll-behavior: auto;
}
.filter-group::-webkit-scrollbar {
    display: none;
}

.filter-label {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    margin-right: 4px;
    padding: 6px 0;
}

.chip {
    flex-shrink: 0;
    padding: 7px 15px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: var(--bg-elev-2);
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
.chip:hover {
    border-color: var(--border-strong);
    color: var(--text);
    transform: scale(1.04);
}
.chip:active {
    transform: scale(0.96);
}
.chip.active {
    background: var(--accent);
    color: var(--accent-text);
    border-color: var(--accent);
    font-weight: 600;
    transform: scale(1);
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent),
        0 2px 8px color-mix(in srgb, var(--accent) 25%, transparent);
    animation: chipPop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes chipPop {
    from {
        transform: scale(0.88);
    }
    to {
        transform: scale(1);
    }
}

/* ===================== MAIN / GRID ===================== */
main {
    padding: 18px 16px 40px;
}

.result-meta {
    font-size: 12px;
    color: var(--text-faint);
    margin-bottom: 16px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* ── Grid: 3 breakpoint — mobile / tablet / desktop ── */
.channel-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (min-width: 480px) {
    .channel-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 11px;
    }
}

@media (min-width: 700px) {
    main {
        padding: 20px 24px 48px;
    }
    .channel-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 13px;
    }
}

@media (min-width: 1100px) {
    .channel-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
}

/* ── Channel Card ── */
.channel-card {
    position: relative;
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Animasi masuk stagger via JS-injected delay */
    animation: cardIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
    transition:
        transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.2s ease,
        box-shadow 0.22s ease;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.channel-card:hover {
    transform: translateY(-4px) scale(1.015);
    border-color: var(--border-strong);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.35),
        0 0 0 1px var(--border-strong);
    z-index: 2;
}

.channel-card:active {
    transform: translateY(-1px) scale(0.99);
    transition-duration: 0.08s;
}

/* ── Logo area — kotak di atas card ── */
.channel-logo {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--bg-elev-2);
    border-bottom: 1px solid var(--border);
    display: grid;
    place-items: center;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

/* Scan-line shimmer saat logo belum load */
.channel-logo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255, 255, 255, 0.04) 50%,
        transparent 60%
    );
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
    pointer-events: none;
}
/* Sembunyikan shimmer kalau ada logo/img yang sudah loaded */
.channel-logo:has(img)::after {
    display: none;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.channel-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
    display: block;
    /* Fade-in saat gambar loaded (diatur via JS onload) */
    animation: imgFadeIn 0.3s ease both;
}

@keyframes imgFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fallback {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    color: var(--text-dim);
    letter-spacing: -0.02em;
    opacity: 0.7;
}

/* ── Teks info di bawah logo ── */
.channel-info-row {
    padding: 9px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.channel-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.01em;
}

.channel-sub {
    font-size: 11px;
    color: var(--text-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ── Fav star ── */
.fav-star {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: scale(0.8);
    transition:
        opacity 0.18s ease,
        transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
        color 0.15s ease,
        background 0.15s ease;
}
.fav-star svg {
    width: 13px;
    height: 13px;
}
.channel-card:hover .fav-star,
.fav-star.is-fav {
    opacity: 1;
    transform: scale(1);
}
.fav-star.is-fav {
    color: #fff;
    background: rgba(229, 87, 95, 0.85);
    border-color: rgba(229, 87, 95, 0.4);
}
/* Device tanpa hover sungguhan (HP/tablet) — tombol fav harus selalu
   terlihat, karena tidak ada cara lain untuk "hover" sebelum tap. */
@media (hover: none) {
    .fav-star {
        opacity: 1;
        transform: scale(1);
    }
}

/* ── Badge Custom / Recent ── */
.channel-source-badge,
.channel-recent-badge {
    position: absolute;
    top: 7px;
    left: 7px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 7px;
    border-radius: 100px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.75);
    line-height: 1;
}
.channel-recent-badge {
    left: auto;
    right: 7px;
    top: auto;
    bottom: 42px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(229, 87, 95, 0.7);
    border-color: rgba(229, 87, 95, 0.3);
}

/* ── Badge channel yang beberapa kali gagal diputar ── */
.channel-card.is-dead {
    opacity: 0.45;
}
.channel-card.is-dead:hover,
.channel-card.is-dead:active {
    opacity: 0.75;
}
/* is-blocked: lebih redup dari is-dead karena kondisinya permanen di browser */
.channel-card.is-blocked {
    opacity: 0.3;
    filter: grayscale(0.4);
}
.channel-card.is-blocked:hover,
.channel-card.is-blocked:active {
    opacity: 0.6;
    filter: grayscale(0);
}
.channel-dead-badge {
    position: absolute;
    top: 7px;
    right: 7px;
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 100px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    line-height: 1;
}
.channel-blocked-badge {
    position: absolute;
    top: 7px;
    right: 7px;
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 100px;
    background: rgba(40, 10, 10, 0.7);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 80, 80, 0.25);
    line-height: 1;
}
.badge-sample {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 100px;
    background: var(--bg-elev-3);
    border: 1px solid var(--border);
    color: var(--text-dim);
    vertical-align: middle;
}

/* ===================== EMPTY / LOADING ===================== */
.empty-state,
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 80px 20px;
    color: var(--text-faint);
    text-align: center;
}
.empty-state svg {
    color: var(--text-faint);
}
.empty-state p {
    font-size: 13.5px;
    line-height: 1.6;
    margin: 0;
}

.spinner {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2.5px solid var(--border);
    border-top-color: var(--text);
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.loading-state p {
    font-size: 13px;
    margin: 0;
}

/* ===================== BOTTOM NAV ===================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 70;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border-top: 1px solid var(--border);
    gap: 4px;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--text-faint);
    font-size: 10px;
    font-weight: 500;
    font-family: var(--font-body);
    padding: 7px 4px;
    border-radius: 12px;
    cursor: pointer;
    transition:
        color 0.18s ease,
        background 0.18s ease;
    position: relative;
}
.nav-item svg {
    width: 20px;
    height: 20px;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-item.active {
    color: var(--text);
    background: color-mix(in srgb, var(--text) 8%, transparent);
}
.nav-item.active svg {
    transform: scale(1.12);
    filter: drop-shadow(
        0 0 5px color-mix(in srgb, var(--text) 40%, transparent)
    );
}
.nav-item:active svg {
    transform: scale(0.9);
}

/* ===================== MODAL ===================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--overlay-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    animation: overlayIn 0.22s ease both;
}

@media (min-width: 600px) {
    .modal-overlay {
        align-items: center;
        padding: 20px;
    }
}

@keyframes overlayIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-box {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-elev-1);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.4);
    animation: sheetUp 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (min-width: 600px) {
    .modal-box {
        border-radius: var(--radius-lg);
        padding: 22px;
        box-shadow: var(--shadow-2);
        animation: popIn 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
    }
}

@keyframes sheetUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.modal-header h3 {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.01em;
}

.modal-desc {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.6;
    margin: 10px 0 16px;
}

.modal-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.modal-input-row input {
    flex: 1;
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-elev-2);
    color: var(--text);
    padding: 0 13px;
    font-size: 13.5px;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.18s ease;
}
.modal-input-row input:focus {
    border-color: var(--border-strong);
}

.primary-btn {
    height: 42px;
    padding: 0 18px;
    border-radius: 10px;
    border: none;
    background: var(--accent);
    color: var(--accent-text);
    font-weight: 600;
    font-size: 13.5px;
    font-family: var(--font-body);
    cursor: pointer;
    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
}
.primary-btn:hover {
    opacity: 0.88;
}
.primary-btn:active {
    transform: scale(0.97);
}
.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal-error {
    font-size: 12.5px;
    color: var(--danger);
    margin: 4px 0 10px;
}

.modal-list-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    margin: 18px 0 10px;
}

.playlist-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.playlist-empty {
    font-size: 13px;
    color: var(--text-faint);
    text-align: center;
    padding: 16px 0;
    margin: 0;
}

.playlist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 11px;
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
}
.pl-info {
    min-width: 0;
}
.pl-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pl-meta {
    font-size: 11px;
    color: var(--text-faint);
    margin-top: 2px;
}
.pl-remove {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-faint);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all 0.15s ease;
}
.pl-remove:hover {
    color: var(--danger);
    border-color: var(--danger);
}

/* ===================== PLAYER ===================== */
.player-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: #000;
    display: flex;
    flex-direction: column;
    /* Mobile: slide up dari bawah */
    animation: playerSlideUp 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes playerSlideUp {
    from {
        opacity: 0;
        transform: translateY(4%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 900px) {
    .player-overlay {
        animation: fadeIn 0.2s ease both;
    }
}

.player-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #050505;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.player-top .icon-btn {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #eaeaea;
}
.player-top .icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}
.player-top .icon-btn.active {
    background: #fff;
    color: #000;
}

.player-title {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
#playerChannelName {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-display);
}
#playerChannelMeta {
    font-size: 11.5px;
    color: #9a9a9e;
}

.quality-wrap {
    position: relative;
}
.quality-menu {
    position: absolute;
    top: 46px;
    right: 0;
    background: #161618;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 6px;
    min-width: 110px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    z-index: 10;
}
.quality-option {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: #c9c9cd;
    font-size: 13px;
    font-family: var(--font-body);
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
}
.quality-option:hover {
    background: rgba(255, 255, 255, 0.07);
}
.quality-option.active {
    background: #fff;
    color: #000;
    font-weight: 600;
}

.video-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}
#videoPlayer {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
    background: #000;
    display: block;
}

.player-status {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(0, 0, 0, 0.65);
    color: #d8d8da;
}
.player-status .spinner {
    border-color: rgba(255, 255, 255, 0.15);
    border-top-color: #fff;
}
.player-status p {
    font-size: 13px;
    max-width: 320px;
}

.player-hint {
    text-align: center;
    font-size: 11px;
    color: #6f6f74;
    padding: 9px 16px calc(9px + env(safe-area-inset-bottom));
    background: #050505;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    line-height: 1.6;
    margin: 0;
}

/* ===================== EPG PANEL ===================== */
.player-epg {
    display: flex;
    gap: 14px;
    padding: 12px 16px;
    background: #0c0c0d;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.epg-tag {
    display: inline-block;
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8d8d92;
    margin-bottom: 4px;
}
.epg-now,
.epg-next {
    flex: 1;
    min-width: 0;
}
.epg-now {
    flex: 1.4;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding-right: 14px;
}
.epg-now-title,
.epg-next-title {
    font-size: 13px;
    font-weight: 600;
    color: #f2f2f3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-display);
}
.epg-now-time,
.epg-next-time {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}
.epg-progress {
    margin-top: 7px;
    height: 3px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 100px;
    overflow: hidden;
}
.epg-progress-bar {
    height: 100%;
    background: #fff;
    border-radius: 100px;
    transition: width 1s linear;
}
.epg-next {
    opacity: 0.75;
}

@media (max-width: 480px) {
    .player-epg {
        flex-direction: column;
        gap: 8px;
    }
    .epg-now {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        padding-right: 0;
        padding-bottom: 8px;
    }
}

/* ===================== TOPBAR DEDUPE — MOBILE ===================== */
/* Di mobile, bottom-nav sudah punya "Favorit" & "Cari" sendiri,
   jadi sembunyikan duplikatnya di topbar supaya tidak dobel.
   Search bar tetap fungsional: cuma dimunculkan saat view = "search"
   (di-trigger dari tombol "Cari" di bottom-nav). */
@media (max-width: 899px) {
    .search-wrap {
        display: none;
    }
    body.view-search .search-wrap {
        display: flex;
    }
    #favToggleBtn,
    #recentToggleBtn {
        display: none;
    }
}

/* ===================== RESPONSIVE / DESKTOP ===================== */
@media (min-width: 900px) {
    .topbar {
        padding: 16px 32px;
    }
    main {
        padding: 24px 32px 50px;
    }
    /* padding-right 80px: sama dengan mobile, agar fade hint kanan selalu
       punya ruang dan chip terakhir tidak melebihi batas visual strip. */
    .filter-group {
        padding: 11px 80px 11px 32px;
    }
    .bottom-nav {
        display: none;
    }
    #app {
        padding-bottom: 0;
    }
    .player-hint {
        font-size: 12px;
    }
}

@media (min-width: 1400px) {
    .topbar {
        padding: 16px 48px;
    }
    main {
        padding: 28px 48px 60px;
        max-width: 1800px;
        margin: 0 auto;
    }
    /* padding kiri ikut 48px, kanan tetap 80px untuk fade hint */
    .filter-group {
        padding: 11px 80px 11px 48px;
    }
}

/* ===== CUSTOM VIDEO CONTROLS ===== */
.video-wrap {
    position: relative;
    background: #000;
}

/* video-inner: wrapper tepat seukuran frame video aktual.
   position:relative wajib ada agar .vc-center-play absolute
   mengacu ke sini, bukan ke .video-wrap yang lebih besar. */
.video-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    flex: 1;
}

/* ===== CENTER BIG PLAY BUTTON ===== */
.vc-center-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: rgba(18, 18, 22, 0.68);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    border: 1.5px solid rgba(255, 255, 255, 0.16);
    box-shadow:
        0 0 0 1px rgba(180, 40, 40, 0.4),
        0 8px 32px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: all;
    z-index: 5;
    color: #fff;
    transition:
        transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.22s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}
.vc-center-play svg {
    margin-left: 4px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}
.vc-center-play:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(160, 25, 25, 0.75);
    box-shadow:
        0 0 0 1px rgba(220, 60, 60, 0.55),
        0 12px 40px rgba(0, 0, 0, 0.65),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.vc-center-play:active {
    transform: translate(-50%, -50%) scale(0.95);
}
.video-wrap.is-playing .vc-center-play {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.82);
}
.video-wrap.is-playing.show-controls .vc-center-play {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
}
/* Sembunyikan saat loading/error (playerStatus visible) */
.video-wrap:has(#playerStatus:not(:empty)) .vc-center-play {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ======================================================
   CHANNEL INFO OVERLAY
   ====================================================== */
.ch-info-overlay {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(10, 10, 12, 0.78);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    max-width: 420px;
}
.ch-info-overlay.ch-info-show {
    animation: chInfoIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.ch-info-overlay.ch-info-hide {
    animation: chInfoOut 0.4s ease forwards;
}
@keyframes chInfoIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
@keyframes chInfoOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-8px) scale(0.97);
    }
}
.ch-info-logo {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}
.ch-info-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.ch-info-text {
    min-width: 0;
    flex: 1;
}
.ch-info-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    font-family: var(--font-display);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}
.ch-info-epg {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vc-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    padding: 32px 12px 10px;
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
}
/* SESUDAH */
.video-wrap.show-controls .vc-wrap {
    opacity: 1;
    pointer-events: all;
}
.vc-progress {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    margin-bottom: 8px;
    cursor: pointer;
}
.vc-progress:hover {
    height: 6px;
}
.vc-bar {
    height: 100%;
    background: #e5575f;
    border-radius: 2px;
    width: 0%;
    pointer-events: none;
}
.vc-thumb {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    left: 0%;
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
}
.vc-progress:hover .vc-thumb {
    opacity: 1;
}
.vc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}
.vc-left,
.vc-right {
    display: flex;
    align-items: center;
    gap: 4px;
}
.vc-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition:
        opacity 0.15s,
        background 0.15s;
}
.vc-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}
.vc-volume {
    -webkit-appearance: none;
    appearance: none;
    width: 72px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
.vc-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
}
.vc-time {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 7px;
    background: #e5575f;
    border-radius: 4px;
    letter-spacing: 0.5px;
    margin-left: 4px;
}
.vc-time.is-vod {
    background: transparent;
    font-weight: 400;
}

/* Fix: pastikan video + controls selalu pas di dalam viewport, tidak overflow */
.player-overlay {
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.video-wrap {
    flex: 1;
    min-height: 0;
    max-height: calc(100vh - 60px); /* sisakan ruang untuk player-top */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative; /* pastikan ch-info-overlay dan vc-wrap absolute ke sini */
}
.video-wrap video {
    max-height: 100%;
    max-width: 100%;
    width: 100%;
    height: 100%;
}

/* ===== PLAYER SIDEBAR (daftar channel) ===== */
.player-overlay.sidebar-open {
    display: grid;
    grid-template-columns: 1fr 300px;
    grid-template-rows: auto 1fr auto;
}
.player-overlay.sidebar-open .player-top {
    grid-column: 1 / -1;
}
.player-overlay.sidebar-open .video-wrap {
    grid-column: 1;
    grid-row: 2;
}
.player-overlay.sidebar-open #playerEpg {
    grid-column: 1;
    grid-row: 3;
}
.player-overlay.sidebar-open .player-hint {
    grid-column: 1;
    grid-row: 4;
}
.player-overlay.sidebar-open .player-sidebar {
    grid-column: 2;
    grid-row: 2 / 5;
}

.player-sidebar {
    background: #0d0d10;
    border-left: 1px solid var(--border);
    overflow-y: auto;
    padding: 8px;
}
.player-sidebar.hidden {
    display: none;
}

.ps-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.ps-item:hover {
    background: var(--bg-card-hover);
}
.ps-item.active {
    background: var(--danger);
}
.ps-item.active .ps-name,
.ps-item.active .ps-sub {
    color: #fff;
}

.ps-logo {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: #1b1b20;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.ps-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.ps-logo .ps-fallback {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
}

.ps-info {
    flex: 1;
    overflow: hidden;
}
.ps-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ps-sub {
    font-size: 11px;
    color: var(--text-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 720px) {
    /* Di mobile, jangan pakai grid + overlay absolute (itu yang bikin
       list channel nutupin video). Susun jadi kolom vertikal:
       video di atas, sidebar channel scroll di bawahnya. */
    .player-overlay.sidebar-open {
        display: flex;
        flex-direction: column;
        grid-template-columns: unset;
        height: 100vh;
        max-height: 100vh;
        overflow-y: auto;
    }
    .player-overlay.sidebar-open .player-top {
        flex-shrink: 0;
    }
    .player-overlay.sidebar-open .video-wrap {
        flex-shrink: 0;
        width: 100%;
        aspect-ratio: 16 / 9;
        max-height: 42vh;
    }
    .player-overlay.sidebar-open #playerEpg {
        flex-shrink: 0;
    }
    .player-overlay.sidebar-open .player-hint {
        flex-shrink: 0;
    }
    .player-overlay.sidebar-open .player-sidebar {
        position: static;
        inset: auto;
        z-index: auto;
        flex: 1;
        min-height: 280px;
        border-left: none;
        border-top: 1px solid var(--border);
    }
}

/* Quality button di vc-row */
.vc-right {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
}
.vc-quality {
    position: relative;
}

/* Quality dropdown — versi final, dropup, override rule lama */
.vc-quality .quality-menu {
    position: absolute !important;
    top: auto !important;
    bottom: 44px !important;
    right: 0 !important;
    left: auto !important;
    background: #1b1b20;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 4px;
    min-width: 90px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
    z-index: 20;
}

/* ======================================================
   SPLASH SCREEN — PrestigeSync
   ====================================================== */

.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        opacity 0.6s ease,
        transform 0.6s ease;
}

.splash-screen.splash-hide {
    opacity: 0;
    transform: scale(1.04);
    pointer-events: none;
}

.splash-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 50px;
    animation: splashFadeIn 0.5s ease both;
}

@keyframes splashFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.splash-logo {
    width: clamp(80px, 40vmin, 180px);
    height: clamp(80px, 40vmin, 180px);
    object-fit: contain;
}

.splash-brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.02em;
    color: var(--text-dim);
}

/* ======================================================
   FOOTER — PrestigeSync
   ====================================================== */

.app-footer {
    text-align: center;
    padding: 24px 16px 32px;
    font-size: 12px;
    color: var(--text-faint);
    letter-spacing: 0.01em;
    border-top: 1px solid var(--border);
    margin-top: 24px;
}

.app-footer strong {
    color: var(--text-dim);
    font-weight: 600;
}

/* ===== SIDEBAR SEARCH — CLEAN ===== */
.player-sidebar {
    padding: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.ps-search-wrap {
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 12px !important;
    margin: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background: #0d0d10 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}

.ps-search-icon {
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.ps-search {
    flex: 1 !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 999px !important;
    padding: 7px 14px !important;
    color: #fff !important;
    font-size: 13px !important;
    outline: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
.ps-search::placeholder {
    color: rgba(255, 255, 255, 0.35);
}
.ps-search:focus {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
}

/* ===== SLEEP TIMER ===== */
.sleep-wrap {
    position: relative;
}
.sleep-menu {
    position: absolute;
    top: 46px;
    right: 0;
    background: #161618;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 14px;
    min-width: 220px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    z-index: 100;
}
.sleep-menu-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 10px;
}
.sleep-presets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 10px;
}
.sleep-preset {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e0e0e2;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 6px;
    cursor: pointer;
    transition: background 0.15s;
    font-family: var(--font-body);
}
.sleep-preset:hover {
    background: rgba(255, 255, 255, 0.14);
}
.sleep-custom-row {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}
.sleep-custom-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    padding: 7px 10px;
    outline: none;
    font-family: var(--font-body);
}
.sleep-custom-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}
.sleep-custom-input:focus {
    border-color: rgba(255, 255, 255, 0.3);
}
.sleep-custom-set {
    background: #fff;
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 12px;
    cursor: pointer;
    font-family: var(--font-body);
}
.sleep-cancel {
    width: 100%;
    background: rgba(229, 87, 95, 0.15);
    border: 1px solid rgba(229, 87, 95, 0.3);
    border-radius: 8px;
    color: #e5575f;
    font-size: 13px;
    font-weight: 600;
    padding: 8px;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background 0.15s;
}
.sleep-cancel:hover {
    background: rgba(229, 87, 95, 0.25);
}
.sleep-badge {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: rgba(229, 87, 95, 0.8);
    border-radius: 6px;
    padding: 3px 8px;
    margin-left: 4px;
    letter-spacing: 0.3px;
}

/* ===== SHARE CHANNEL TOAST ===== */
.share-toast {
    position: fixed;
    top: 64px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e1e22;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 18px;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    animation: fadeIn 0.18s ease;
}

/* ── AdSense Banner ── */
.adsense-banner {
    width: 100%;
    max-width: 100%;
    padding: 8px 16px;
    box-sizing: border-box;
    background: transparent;
    /* Sembunyikan kalau kosong (belum diisi AdSense / mode dev) */
    min-height: 0;
}
.adsense-banner:empty,
.adsense-banner ins:empty {
    display: none;
}
/* Di dalam player overlay — jangan tampil */
#playerOverlay .adsense-banner {
    display: none;
}
