/* ============================================================
   KARTOONS — 9anime-style dark theme
   ============================================================ */

:root {
    --bg-body: #0a0a0f;
    --bg-surface: #16161d;
    --bg-elevated: #1e1e2a;
    --bg-input: #252531;
    --primary: #6058e0;
    --primary-hover: #7b73ff;
    --secondary: #22d3ee;
    --accent: #f43f5e;
    --success: #10b981;
    --warning: #f59e0b;
    --text: #ffffff;
    --text-muted: #a1a1aa;
    --text-dim: #71717a;
    --border: rgba(255,255,255,.06);
    --shadow-card: 0 4px 20px rgba(0,0,0,.4);
    --shadow-glow: 0 4px 20px rgba(96,88,224,.25);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    --header-h: 60px;
    --container: 1280px;
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset & Global Dark Scrollbars ────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.45) #0e0e15;
}
html { scroll-behavior: smooth; font-size: 16px; overflow-x: hidden; max-width: 100vw; }
body { font-family: var(--font); background: var(--bg-body); color: var(--text); line-height: 1.6; overflow-x: hidden; max-width: 100vw; position: relative; width: 100%; }

/* Universal WebKit Scrollbar (No white bars anywhere) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #0e0e15;
}
::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.45);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}
::-webkit-scrollbar-corner {
    background: transparent;
}
a { text-decoration: none; color: inherit; transition: color .2s; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }
input { font-family: inherit; }

/* ── Utilities ──────────────────────────────────────────────── */
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.section { padding: 40px 0; }
.section-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.section-title i { color: var(--primary); }

/* ── Header ─────────────────────────────────────────────────── */
header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    height: var(--header-h);
    background: rgba(10,10,15,.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    transition: background .3s;
    width: 100%;
    max-width: 100vw;
}
header.scrolled { background: rgba(10,10,15,.98); box-shadow: 0 4px 24px rgba(0,0,0,.6); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; gap: 12px; }
.logo { font-size: 1.35rem; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 10px; letter-spacing: -0.02em; text-decoration: none; flex-shrink: 0; min-width: 0; }
.logo i { font-size: 1.5rem; color: var(--primary); }
.logo img, .logo-img { height: 38px; width: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; box-shadow: 0 0 12px rgba(96,88,224,0.45); border: 1.5px solid rgba(255,255,255,0.15); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a, .nav button { padding: 8px 14px; border-radius: var(--radius); font-size: .9rem; font-weight: 500; color: var(--text-muted); transition: all .2s; }
.nav a:hover, .nav button:hover, .nav a.active { color: var(--text); background: var(--bg-elevated); }
.nav-9anime {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 700 !important;
    color: #e0e7ff !important;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(168, 85, 247, 0.25));
    border: 1px solid rgba(168, 85, 247, 0.45) !important;
    border-radius: var(--radius);
    padding: 6px 14px !important;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.18);
}
.nav-9anime:hover {
    color: #ffffff !important;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.45), rgba(168, 85, 247, 0.45)) !important;
    border-color: rgba(168, 85, 247, 0.75) !important;
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.45);
    transform: translateY(-1px);
}
.header-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; min-width: 0; }

/* Search */
.search-box { position: relative; }
.search-box input {
    width: 240px; padding: 9px 38px 9px 16px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-full); color: var(--text); font-size: .875rem;
    transition: all .25s ease;
}
.search-box input:focus { outline: none; width: 300px; border-color: var(--primary); box-shadow: 0 0 14px rgba(96, 88, 224, 0.25); }
.search-box input::placeholder { color: var(--text-dim); }
.search-box .search-icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; transition: color .2s; }
.search-box input:focus ~ .search-icon { color: var(--primary); }
.search-results {
    position: absolute; top: calc(100% + 10px); right: 0;
    width: 380px; max-width: min(380px, 92vw);
    background: rgba(18, 18, 28, 0.98); border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75);
    max-height: 480px; overflow-y: auto; display: none; z-index: 9999;
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.search-results.active { display: block; animation: searchFadeIn 0.18s ease-out; }
@keyframes searchFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.search-result-item, .search-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer;
    transition: background .15s ease; border-bottom: 1px solid rgba(255, 255, 255, 0.05); text-decoration: none;
}
.search-result-item:last-child, .search-item:last-child { border-bottom: none; }
.search-result-item:hover, .search-item:hover { background: var(--bg-elevated); }
.search-result-img, .search-item img {
    width: 46px !important; height: 64px !important; object-fit: cover !important; border-radius: 6px !important; flex-shrink: 0 !important; background: #161622;
}
.search-result-info, .search-item-info { flex: 1; min-width: 0; }
.search-result-title, .search-item-title {
    font-size: .88rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px;
}
.search-result-meta, .search-item-meta {
    font-size: .74rem; color: var(--text-dim); display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.type-badge {
    display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: .68rem; font-weight: 700;
    text-transform: uppercase; background: rgba(96, 88, 224, 0.25); color: #818cf8;
}

/* Mobile toggle */
.mobile-toggle { display: none; font-size: 1.3rem; color: var(--text-muted); padding: 8px; }

/* ── Hero ───────────────────────────────────────────────────── */
.hero { position: relative; height: 500px; margin-top: var(--header-h); overflow: hidden; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1s; background-size: cover; background-position: center top; }
.hero-slide.active { opacity: 1; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to top, var(--bg-body) 0%, rgba(10,10,15,.6) 50%, rgba(10,10,15,.2) 100%); }
.hero-content { position: relative; z-index: 2; height: 100%; display: flex; align-items: flex-end; padding-bottom: 50px; }
.hero-content .container { width: 100%; }
.hero-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--primary); margin-bottom: 8px; }
.hero-title { font-size: 2.5rem; font-weight: 800; margin-bottom: 10px; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: .85rem; color: var(--text-muted); margin-bottom: 12px; }
.hero-meta span { display: flex; align-items: center; gap: 5px; }
.hero-meta .fa-star { color: var(--warning); }
.hero-desc { max-width: 600px; font-size: .9rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 20px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-btns { display: flex; gap: 12px; position: relative; z-index: 5; flex-wrap: wrap; }
.hero-nav {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
}
.hero-nav button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(12, 14, 24, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
    pointer-events: auto;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0,0,0,0.5);
}
.hero-nav button:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.6);
}
.hero-nav button#heroPrev {
    left: 20px;
}
.hero-nav button#heroNext {
    right: 20px;
}
@media (max-width: 768px) {
    .hero-nav {
        display: none !important;
    }
    .hero-btns {
        gap: 8px;
    }
    .hero-btns .btn {
        padding: 8px 16px;
        font-size: 0.82rem;
    }
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 22px; border-radius: var(--radius-full); font-weight: 600; font-size: .9rem; transition: all .2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-glow); transform: translateY(-1px); }
.btn-outline { border: 1px solid var(--border); color: var(--text-muted); }
.btn-outline:hover { border-color: var(--primary); color: var(--text); }

/* ── Card Grid ──────────────────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 22px; }
.card {
    --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%;
    position: relative; border-radius: var(--radius-lg); overflow: hidden;
    background: var(--bg-surface); border: 1px solid var(--border); cursor: pointer;
    transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
    will-change: transform;
    transition: transform .18s ease-out, box-shadow .3s, border-color .3s;
}
.card.tilting { box-shadow: 0 18px 40px rgba(0,0,0,.55), var(--shadow-glow); border-color: rgba(96,88,224,.5); z-index: 3; }
.card:hover { box-shadow: 0 20px 45px rgba(0,0,0,.6), var(--shadow-glow); border-color: rgba(96,88,224,.5); }
/* Glare overlay that follows the cursor */
.card::after {
    content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none;
    background: radial-gradient(circle at var(--mx) var(--my), rgba(255,255,255,.22), transparent 45%);
    opacity: 0; transition: opacity .3s;
}
.card.tilting::after { opacity: 1; }
.card-poster { position: relative; aspect-ratio: 2 / 3; overflow: hidden; }
.card-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-poster img { transform: scale(1.09); }
.card-badge { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 4px; font-size: .65rem; font-weight: 700; text-transform: uppercase; z-index: 5; }
.card-badge.hd { background: var(--primary); color: #fff; }
.card-badge.movie { background: var(--secondary); color: #000; }
.card-badge.ep { background: var(--bg-elevated); color: var(--text-muted); }
.card-rating { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.8); padding: 2px 7px; border-radius: 4px; font-size: .75rem; font-weight: 700; display: flex; align-items: center; gap: 3px; z-index: 5; transition: transform .25s; }
.card:hover .card-rating { transform: scale(1.08); }
.card-rating i { color: var(--warning); font-size: .65rem; }
.card-body { padding: 10px 12px; }
.card-title { font-size: .85rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 4px; transition: color .25s; }
.card:hover .card-title { color: var(--primary-hover); }
.card-info { font-size: .75rem; color: var(--text-dim); display: flex; justify-content: space-between; }
/* Hover play glyph */
.card-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 4; opacity: 0; transition: opacity .3s; }
.card-play i { width: 52px; height: 52px; border-radius: 50%; background: rgba(96,88,224,.9); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; transform: scale(.7); transition: transform .3s; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.card:hover .card-play { opacity: 1; }
.card:hover .card-play i { transform: scale(1); }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .card, .card-poster img, .card-rating, .card-play i { transition: none; transform: none; }
}

/* ── Trending horizontal scroll ─────────────────────────────── */
.trending-row { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.trending-row::-webkit-scrollbar { height: 4px; }
.trending-row::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 4px; }
.trending-row .card { min-width: 150px; scroll-snap-align: start; }

/* ── Genre Tags ─────────────────────────────────────────────── */
.genre-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-block; padding: 6px 14px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-full); font-size: .8rem; color: var(--text-muted); transition: all .2s; cursor: pointer; }
.tag:hover { border-color: var(--primary); color: var(--primary); background: rgba(96,88,224,.08); }

/* ── Detail Page (show/movie) ───────────────────────────────── */
.detail-banner { position: relative; padding: 100px 0 40px; margin-top: var(--header-h); background-size: cover; background-position: center top; min-height: 420px; display: flex; align-items: flex-end; }
.detail-banner::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg-body), rgba(10,10,15,.4) 60%, rgba(10,10,15,.2)); }
.detail-header { position: relative; z-index: 2; display: flex; gap: 28px; align-items: flex-end; }
.detail-poster { width: 200px; flex-shrink: 0; position: relative; border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,.6); }
.detail-poster img { width: 100%; display: block; }
.detail-info { flex: 1; }
.detail-category { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--primary); margin-bottom: 6px; }
.detail-title { font-size: 2rem; font-weight: 800; margin-bottom: 10px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: .85rem; color: var(--text-muted); margin-bottom: 12px; }
.detail-meta span { display: flex; align-items: center; gap: 5px; }
.detail-meta .fa-star { color: var(--warning); }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.detail-desc { color: var(--text-muted); font-size: .9rem; line-height: 1.7; max-width: 700px; margin-bottom: 18px; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Two-column layout */
.detail-body { display: grid; grid-template-columns: 1fr 320px; gap: 30px; padding: 30px 0 60px; }
.main-col { min-width: 0; }
.sidebar { display: flex; flex-direction: column; gap: 20px; }

/* ── Video Player ───────────────────────────────────────────── */
.player-section { margin-bottom: 30px; border-radius: var(--radius-lg); overflow: hidden; background: #000; position: relative; }
.player-section video { width: 100%; display: block; aspect-ratio: 16/9; }
.player-epbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px; }
.player-epbar .ep-label { font-size: .95rem; font-weight: 600; }
.player-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.6); z-index: 5; }
.player-overlay.hidden { display: none; }
.player-overlay i { font-size: 4rem; color: var(--primary); opacity: .8; }
.player-controls { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--bg-surface); border-top: 1px solid var(--border); }
.player-controls .ep-label { font-size: .85rem; font-weight: 600; }
.player-controls .btn { padding: 6px 14px; font-size: .8rem; }
.quality-select { background: var(--bg-input); border: 1px solid var(--border); color: var(--text); padding: 4px 10px; border-radius: var(--radius); font-size: .8rem; }

/* ── Episode List ───────────────────────────────────────────── */
.season-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.season-tab { padding: 6px 16px; border-radius: var(--radius-full); font-size: .8rem; font-weight: 600; background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-muted); cursor: pointer; transition: all .2s; }
.season-tab:hover { border-color: var(--primary); color: var(--text); }
.season-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.episodes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.ep-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: all .2s; }
.ep-item:hover { border-color: var(--primary); background: var(--bg-elevated); }
.ep-item.active { border-color: var(--primary); background: rgba(96,88,224,.1); }
.ep-item .ep-num { font-size: .75rem; font-weight: 700; color: var(--primary); min-width: 32px; }
.ep-item .ep-title { font-size: .8rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-item .ep-dur { font-size: .7rem; color: var(--text-dim); }
.ep-item .ep-hd { font-size: .6rem; font-weight: 700; color: #fff; background: var(--primary); padding: 1px 6px; border-radius: 4px; }

/* ── Sidebar ────────────────────────────────────────────────── */
.info-box { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.info-box h3 { font-size: 1rem; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--primary); }
.info-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: .85rem; border-bottom: 1px solid var(--border); }
.info-row:last-child { border: none; }
.info-row .label { color: var(--text-dim); }

/* ── Browse Page ────────────────────────────────────────────── */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 20px 0; margin-top: var(--header-h); border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.filter-bar select, .filter-bar input { background: var(--bg-input); border: 1px solid var(--border); color: var(--text); padding: 8px 12px; border-radius: var(--radius); font-size: .85rem; }
.filter-bar select:focus, .filter-bar input:focus { outline: none; border-color: var(--primary); }
.load-more { display: block; margin: 30px auto; padding: 12px 40px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-full); color: var(--text-muted); font-weight: 600; transition: all .2s; }
.load-more:hover { border-color: var(--primary); color: var(--primary); }

/* ── Footer ─────────────────────────────────────────────────── */
footer { margin-top: 60px; padding: 30px 0; border-top: 1px solid var(--border); text-align: center; color: var(--text-dim); font-size: .85rem; }

/* ── Loading ────────────────────────────────────────────────── */
.loading { position: fixed; inset: 0; background: rgba(10,10,15,.92); display: none; align-items: center; justify-content: center; z-index: 9999; }
.loading.active { display: flex; }
.spinner { width: 48px; height: 48px; border: 3px solid var(--bg-elevated); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Universal Toast Notifications (Desktop & Mobile Optimized) ─ */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 11px 18px;
    border-radius: 12px;
    background: #0f1322;
    background: linear-gradient(135deg, #181d33 0%, #0d101d 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    z-index: 9999999;
    box-shadow: 0 12px 35px -5px rgba(0, 0, 0, 0.85), 0 0 20px rgba(99, 102, 241, 0.2);
    animation: toastPopIn 0.26s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.22s ease, transform 0.22s ease;
    pointer-events: none;
    max-width: 90vw;
    box-sizing: border-box;
}

.toast i {
    font-size: 0.95rem;
    flex-shrink: 0;
}

.toast.toast-hide {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
}

.toast.success, .toast.toast-success {
    border-color: rgba(34, 197, 94, 0.45);
    box-shadow: 0 12px 35px -5px rgba(0, 0, 0, 0.85), 0 0 20px rgba(34, 197, 94, 0.25);
}
.toast.success i, .toast.toast-success i { color: #4ade80; }

.toast.info, .toast.toast-info {
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 0 12px 35px -5px rgba(0, 0, 0, 0.85), 0 0 20px rgba(99, 102, 241, 0.25);
}
.toast.info i, .toast.toast-info i { color: #818cf8; }

.toast.error, .toast.toast-error {
    border-color: rgba(239, 68, 68, 0.45);
    box-shadow: 0 12px 35px -5px rgba(0, 0, 0, 0.85), 0 0 20px rgba(239, 68, 68, 0.25);
}
.toast.error i, .toast.toast-error i { color: #f87171; }

@keyframes toastPopIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(14px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* Mobile-Specific: Sits 24px safely ABOVE the bottom navigation dock (60px high) */
@media (max-width: 768px) {
    .toast {
        bottom: 84px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        padding: 10px 16px;
        font-size: 0.8rem;
        border-radius: 10px;
        max-width: calc(100vw - 32px);
        text-align: center;
        justify-content: center;
    }
    .toast.toast-hide {
        transform: translateX(-50%) translateY(6px) !important;
    }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .detail-body { grid-template-columns: 1fr; }
    .sidebar { flex-direction: row; flex-wrap: wrap; }
    .info-box { flex: 1; min-width: 280px; }
}
@media (max-width: 768px) {
    .nav {
        display: none;
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        width: 100%;
        background: rgba(12, 14, 22, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 16px 20px 24px;
        flex-direction: column;
        gap: 8px;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
        z-index: 9999;
    }
    .nav.show, .nav.active {
        display: flex !important;
        animation: navSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }
    @keyframes navSlideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }
    .nav a, .nav button {
        width: 100%;
        padding: 12px 16px;
        font-size: 1rem;
        font-weight: 600;
        border-radius: 8px;
        color: #e2e8f0;
        display: flex;
        align-items: center;
        gap: 12px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.06);
        transition: all 0.2s;
    }
    .nav a:hover, .nav a.active {
        background: rgba(99, 102, 241, 0.2);
        border-color: var(--primary);
        color: #38bdf8;
    }
    
    .nav a.nav-9anime {
        width: 100%;
        margin-top: 6px;
        padding: 13px 18px !important;
        font-size: 1.02rem !important;
        font-weight: 700 !important;
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(168, 85, 247, 0.35)) !important;
        border: 1px solid rgba(168, 85, 247, 0.5) !important;
        box-shadow: 0 4px 16px rgba(168, 85, 247, 0.25) !important;
        color: #ffffff !important;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .nav a.nav-9anime:hover, .nav a.nav-9anime:active {
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.45), rgba(168, 85, 247, 0.5)) !important;
        border-color: rgba(168, 85, 247, 0.8) !important;
    }
    .nav a.nav-9anime::after {
        content: "↗";
        font-size: 1.15rem;
        opacity: 0.85;
    }
    .mobile-toggle { display: block; cursor: pointer; }
    .header-inner { padding: 0 12px; gap: 8px; }
    .logo { font-size: 1.12rem; gap: 7px; }
    .logo img, .logo-img { width: 32px; height: 32px; }
    .header-right { gap: 8px; }
    .search-box input {
        width: clamp(100px, 26vw, 150px);
        padding: 7px 30px 7px 12px;
        font-size: 0.8rem;
    }
    /* When search is focused on mobile: clean full-header takeover, 0 collisions */
    .search-box:focus-within {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: var(--header-h);
        background: #0b0c14;
        display: flex;
        align-items: center;
        padding: 0 12px;
        z-index: 1050;
        box-shadow: 0 4px 20px rgba(0,0,0,0.7);
    }
    .search-box:focus-within input {
        width: 100% !important;
        max-width: 100% !important;
        height: 40px;
        padding: 8px 38px 8px 14px;
        font-size: 0.9rem;
        border-color: var(--primary);
        box-shadow: 0 0 14px rgba(99, 102, 241, 0.35);
        background: #181926;
    }
    .search-box:focus-within .search-icon {
        right: 24px;
        color: var(--primary);
    }
    /* Mobile search results: fixed centered inside viewport with 8px margin */
    .search-results {
        position: fixed !important;
        top: var(--header-h) !important;
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        max-width: calc(100vw - 16px) !important;
        max-height: calc(82vh - var(--header-h)) !important;
        border-radius: var(--radius-lg) !important;
        box-shadow: 0 20px 48px rgba(0, 0, 0, 0.9) !important;
        z-index: 99999 !important;
    }
    .hero { height: 400px; }
    .hero-title { font-size: 1.6rem; }
    .card-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
    .detail-banner { min-height: auto; padding: 80px 0 24px; }
    .detail-header { flex-direction: column; align-items: center; text-align: center; }
    .detail-poster { width: 140px; }
    .detail-title { font-size: 1.4rem; }
    .detail-meta { justify-content: center; }
    .detail-actions { justify-content: center; }
    .episodes-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .hero { height: 340px; }
    .hero-title { font-size: 1.3rem; }
    .logo { font-size: 1.02rem; gap: 6px; }
    .logo img, .logo-img { width: 28px; height: 28px; }
    .search-box input { width: clamp(88px, 22vw, 120px); font-size: 0.76rem; padding: 6px 26px 6px 10px; }
}

/* ============================================================
   Custom Video Player (vp)
   ============================================================ */
.vp { position: relative; background: #000; width: 100%; aspect-ratio: 16/9; overflow: hidden; border-radius: var(--radius-lg); box-shadow: 0 16px 48px rgba(0,0,0,0.8); }
.vp video { width: 100%; height: 100%; display: block; background: #000; object-fit: contain; will-change: transform; transform: translateZ(0); backface-visibility: hidden; }
.vp-captions { position: absolute; inset: 0; pointer-events: none; }
.vp video::cue { background: rgba(0,0,0,.75); color: #fff; font-size: 1.1rem; border-radius: 4px; }

/* ── Modern Topbar Overlay ── */
.vp-topbar { position: absolute; top: 0; left: 0; right: 0; padding: 14px 18px; display: flex; align-items: center; justify-content: flex-start; background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 65%, transparent 100%); opacity: 0; transform: translateY(-8px); transition: opacity .3s ease, transform .3s ease; z-index: 10; pointer-events: none; }
.vp.vp-active .vp-topbar { opacity: 1; transform: translateY(0); pointer-events: auto; }
.vp-topbar > * { pointer-events: auto; }
.vp-top-title { color: #fff; font-size: 0.9rem; font-weight: 700; display: flex; align-items: center; text-shadow: 0 2px 8px rgba(0,0,0,0.9); max-width: 90%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0.2px; }

/* ── Animated Double-Tap Skip Feedback ── */
.vp-ripple-box { position: absolute; inset: 0; pointer-events: none; z-index: 8; overflow: hidden; }
.vp-ripple { position: absolute; top: 50%; transform: translateY(-50%); width: 44%; height: 75%; display: flex; align-items: center; justify-content: center; }
.vp-ripple.left { left: 0; border-top-right-radius: 50%; border-bottom-right-radius: 50%; background: radial-gradient(circle at left center, rgba(99,102,241,0.25) 0%, transparent 70%); }
.vp-ripple.right { right: 0; border-top-left-radius: 50%; border-bottom-left-radius: 50%; background: radial-gradient(circle at right center, rgba(168,85,247,0.25) 0%, transparent 70%); }
.vp-ripple-circle { width: 78px; height: 78px; border-radius: 50%; background: rgba(15, 23, 42, 0.85); border: 2px solid rgba(168, 85, 247, 0.65); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; gap: 4px; box-shadow: 0 0 30px rgba(99,102,241,0.6); animation: vpRipplePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.vp-ripple-circle i { font-size: 1.35rem; color: #a855f7; }
.vp-ripple-circle span { font-size: 0.76rem; font-weight: 800; letter-spacing: 0.5px; }
@keyframes vpRipplePop { 0% { transform: scale(0.6); opacity: 0; } 50% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }

/* ── High-Tech Buffering Percentage Screen (Lag-Free, Hardware Accelerated) ── */
.vp-buffering { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; pointer-events: none; z-index: 9; background: rgba(0, 0, 0, 0.55); opacity: 0; transition: opacity 0.18s ease; }
.vp-buffering.show:not([hidden]) { display: flex !important; opacity: 1; }
.vp-buffering[hidden] { display: none !important; }
.vp-buffering-card { display: flex; align-items: center; justify-content: center; background: rgba(15, 23, 42, 0.95); border: 2px solid rgba(168, 85, 247, 0.45); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.85), 0 0 24px rgba(99, 102, 241, 0.4); border-radius: 50%; width: 84px; height: 84px; animation: vpBufferingPop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes vpBufferingPop { 0% { transform: scale(0.85); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.vp-buffering-spinner { position: relative; width: 62px; height: 62px; display: flex; align-items: center; justify-content: center; }
.vp-buffering-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.vp-svg-bg { fill: none; stroke: rgba(255, 255, 255, 0.12); stroke-width: 4.5; }
.vp-svg-bar { fill: none; stroke: #a855f7; stroke-width: 4.5; stroke-linecap: round; stroke-dasharray: 144.51px; stroke-dashoffset: 144.51px; transition: stroke-dashoffset 0.18s ease; filter: drop-shadow(0 0 6px rgba(168,85,247,0.8)); }
.vp-buffering-num { position: absolute; font-size: 0.86rem; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -0.5px; }

/* ── Center Big Play Button ── */
.vp-bigplay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; background: rgba(0,0,0,.35); transition: opacity .2s; z-index: 5; }
.vp-bigplay i { width: 72px; height: 72px; border-radius: 50%; background: rgba(15, 23, 42, 0.82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 2px solid rgba(255, 255, 255, 0.25); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; box-shadow: 0 10px 36px rgba(0,0,0,0.7), 0 0 24px rgba(99, 102, 241, 0.4); transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s; padding-left: 4px; }
.vp-bigplay:hover i { transform: scale(1.1); background: rgba(99, 102, 241, 0.9); }
.vp-bigplay.hidden { opacity: 0; pointer-events: none; }

/* ── Floating Tap to Unmute Banner ── */
.vp-unmute-pill { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 9px; background: rgba(15, 23, 42, 0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: #fff; padding: 10px 20px; border-radius: 9999px; border: 1px solid rgba(255, 255, 255, 0.25); font-size: 0.88rem; font-weight: 700; cursor: pointer; z-index: 15; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(99, 102, 241, 0.45); animation: vpPulseUnmute 2s infinite ease-in-out; transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s; pointer-events: auto; }
.vp-unmute-pill:hover { transform: translateX(-50%) scale(1.06); background: rgba(99, 102, 241, 0.95); border-color: rgba(255, 255, 255, 0.4); }
.vp-unmute-pill i { font-size: 1rem; color: #a855f7; }
.vp-unmute-pill:hover i { color: #fff; }
@keyframes vpPulseUnmute { 0%, 100% { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 16px rgba(99, 102, 241, 0.35); } 50% { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 30px rgba(99, 102, 241, 0.75); } }

.vp-loading { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; pointer-events: none; z-index: 4; }
.vp-loading.show { display: flex; }
.vp-spin { width: 48px; height: 48px; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
.vp-error { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(10,10,15,.94); z-index: 12; text-align: center; padding: 20px; }
.vp-error.show { display: flex; }
.vp-error-inner i { font-size: 2.4rem; color: var(--err); margin-bottom: 12px; }
.vp-error-inner p { color: var(--text); font-size: .95rem; max-width: 420px; line-height: 1.6; }

.vp-skip { position: absolute; right: 20px; bottom: 84px; background: rgba(20,24,38,.92); color: #fff; padding: 9px 18px; border-radius: var(--radius); font-size: .85rem; font-weight: 600; cursor: pointer; border: 1px solid rgba(255,255,255,.18); transition: background .2s, transform .15s; z-index: 6; backdrop-filter: blur(8px); }
.vp-skip:hover { background: var(--primary); transform: translateY(-2px); }

/* ── High-Performance Responsive Controls HUD (Smooth Auto-Hide & Auto-Show) ── */
.vp-controls { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 14px 12px; background: linear-gradient(to top, rgba(0,0,0,.92) 0%, rgba(0,0,0,.35) 65%, transparent 100%); opacity: 0; transform: translateY(8px); transition: opacity .3s cubic-bezier(0.4, 0, 0.2, 1), transform .3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 10; pointer-events: none; }
.vp.vp-active .vp-controls { opacity: 1; transform: translateY(0); pointer-events: auto; }
.vp:not(.vp-active) { cursor: none; }
.vp:not(.vp-active) .vp-controls { opacity: 0 !important; pointer-events: none !important; transform: translateY(8px) !important; }
.vp:not(.vp-active) .vp-topbar { opacity: 0 !important; pointer-events: none !important; transform: translateY(-8px) !important; }
.vp.vp-buffering-active:not(.vp-active) .vp-controls { opacity: 0 !important; pointer-events: none !important; transform: translateY(8px) !important; }
.vp.vp-buffering-active:not(.vp-active) .vp-topbar { opacity: 0 !important; pointer-events: none !important; transform: translateY(-8px) !important; }
.vp-controls-glass { background: rgba(13, 17, 28, 0.94); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 14px; padding: 8px 12px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6); pointer-events: auto; }

/* ── Glowing Gradient Seekbar ── */
.vp-seek { position: relative; height: 5px; margin: 0 0 6px; background: rgba(255,255,255,.2); border-radius: 3px; cursor: pointer; touch-action: none; transition: height .15s; }
.vp-seek::before { content: ''; position: absolute; top: -12px; bottom: -12px; left: 0; right: 0; }
.vp-seek:hover { height: 7px; }
.vp-buffered { position: absolute; top: 0; bottom: 0; left: 0; background: rgba(255,255,255,.3); border-radius: 3px; }
.vp-played { position: absolute; top: 0; bottom: 0; left: 0; background: linear-gradient(90deg, #6366f1 0%, #a855f7 60%, #ec4899 100%); border-radius: 3px; box-shadow: 0 0 10px rgba(168, 85, 247, 0.55); }
.vp-knob { position: absolute; right: -7px; top: 50%; transform: translateY(-50%) scale(0); width: 14px; height: 14px; background: #fff; border-radius: 50%; box-shadow: 0 0 10px rgba(236,72,153,0.9); transition: transform .15s; }
.vp-seek:hover .vp-knob, .vp.vp-active .vp-knob { transform: translateY(-50%) scale(1); }
.vp-seek:hover .vp-knob, .vp.vp-active .vp-knob { transform: translateY(-50%) scale(1); }
.vp-chapters { position: absolute; inset: 0; }
.vp-chap-dot { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.7); transform: translateX(-1px); }

.vp-bar { display: flex; align-items: center; gap: 4px; height: 40px; }
.vp-btn { color: #fff; background: none; border: none; cursor: pointer; padding: 8px; font-size: .95rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; min-width: 36px; min-height: 36px; user-select: none; -webkit-tap-highlight-color: transparent; transition: background .15s, color .15s, transform .12s; }
.vp-btn:hover { background: rgba(255,255,255,.15); color: #818cf8; }
.vp-btn:active { transform: scale(0.92); }
.vp-spacer { flex: 1; }
.vp-time { font-size: .8rem; color: #e2e8f0; padding: 0 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vp-time .vp-cur { color: #fff; font-weight: 700; }

.vp-menu { position: relative; }
.vp-pop { position: absolute; bottom: 130%; right: 0; background: rgba(15, 23, 42, 0.98); border: 1px solid rgba(255,255,255,0.18); border-radius: 10px; padding: 6px; display: none; min-width: 120px; max-height: 260px; overflow-y: auto; z-index: 15; box-shadow: 0 10px 30px rgba(0,0,0,0.85); }
.vp-pop.open { display: block; }
.vp-pop button { display: block; width: 100%; text-align: left; padding: 7px 12px; color: #d1d5db; background: none; border: none; border-radius: 6px; font-size: .82rem; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.vp-pop button:hover { background: var(--primary); color: #fff; }
.vp-pop button span { color: var(--secondary); margin-right: 6px; font-variant-numeric: tabular-nums; }

.vp-resume-toast { position: absolute; left: 16px; bottom: 84px; background: rgba(15, 23, 42, 0.95); border: 1px solid rgba(255,255,255,0.15); border-radius: 10px; padding: 10px 14px; font-size: .82rem; display: flex; align-items: center; gap: 10px; z-index: 7; box-shadow: 0 8px 24px rgba(0,0,0,0.6); }
.vp-resume-toast button { background: var(--primary); color: #fff; padding: 5px 12px; border-radius: 6px; font-size: .78rem; font-weight: 600; border: none; cursor: pointer; }
.vp-resume-toast button.x { background: rgba(255,255,255,0.1); color: var(--muted); }

/* Theater mode: player spans full width, hide sidebar */
.vp-theater { border-radius: 0; }
body.theater .detail-body { grid-template-columns: 1fr; }
body.theater .sidebar { display: none; }
body.theater .container { max-width: 100%; }
body.theater .detail-banner { display: none; }

@media (max-width: 768px) {
    .vp-controls { padding: 0 8px 8px; }
    .vp-controls-glass { padding: 6px 10px; border-radius: 12px; background: rgba(10, 14, 26, 0.96); }
    .vp-topbar { padding: 10px 14px; }
    .vp-top-title { font-size: 0.84rem; max-width: 85%; }
    .vp-btn[data-act="theater"],
    .vp-btn[data-act="pip"],
    .vp-btn[data-act="mute"] {
        display: none !important;
    }
    .vp-bar {
        height: 40px;
        gap: 3px;
    }
    .vp-btn {
        padding: 6px 8px;
        font-size: 1rem;
        min-width: 36px;
        min-height: 36px;
    }
    .vp-btn[data-act="quality"] span {
        display: none !important;
    }
    .vp-time {
        font-size: 0.74rem;
        padding: 0 4px;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .vp-controls { padding: 0 6px 6px; }
    .vp-controls-glass { padding: 5px 8px; border-radius: 10px; }
    .vp-btn[data-act="back"],
    .vp-btn[data-act="fwd"] {
        display: none !important;
    }
    .vp-bar {
        height: 38px;
        gap: 2px;
    }
    .vp-btn {
        min-width: 34px;
        min-height: 34px;
        padding: 5px;
        font-size: 0.95rem;
    }
    .vp-time {
        font-size: 0.72rem;
        padding: 0 2px;
    }
    .vp-skip { bottom: 74px; right: 10px; padding: 7px 12px; font-size: .78rem; }
}

/* ── Pro Player & Episode Navigation Bar ── */
.vp-embed-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    border-radius: var(--radius-lg);
    background: #000;
    display: block;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85);
}

#playerSection:fullscreen,
#playerSection:-webkit-full-screen,
.player-cinema-wrapper:fullscreen,
.player-cinema-wrapper:-webkit-full-screen,
.vp:fullscreen,
.vp:-webkit-full-screen,
.vp-embed-frame:fullscreen,
.vp-embed-frame:-webkit-full-screen {
    width: 100% !important;
    height: 100% !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    aspect-ratio: auto !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: #000 !important;
    display: flex !important;
    flex-direction: column !important;
}

#playerSection:fullscreen .vp,
.player-cinema-wrapper:fullscreen .vp {
    flex: 1 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
    position: relative !important;
}

#playerSection:fullscreen .vp-embed-frame,
.player-cinema-wrapper:fullscreen .vp-embed-frame {
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
}

.player-epbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-top: 14px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.player-epbar .ep-info-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 220px;
}

.player-epbar .ep-now-badge {
    background: linear-gradient(135deg, #6058e0, #8858e0);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.player-epbar .ep-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-epbar .ep-controls-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.vp-ep-select {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 7px 12px;
    border-radius: var(--radius);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    max-width: 190px;
    transition: border-color 0.2s;
}

.vp-ep-select:focus {
    border-color: var(--primary);
}

.btn-ep-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--radius);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ep-nav:hover:not(:disabled) {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-1px);
}

.btn-ep-nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-autoplay {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: var(--radius);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-autoplay.active {
    background: rgba(96,88,224,0.18);
    border-color: var(--primary);
    color: var(--primary);
}

.ep-item.active {
    border-color: var(--primary);
    background: rgba(96,88,224,0.18);
    box-shadow: 0 0 14px rgba(96,88,224,0.3);
    position: relative;
}

.ep-item.active .ep-num {
    color: #fff;
    background: var(--primary);
    border-radius: 4px;
    padding: 2px 6px;
}

/* ── UX/UI Meta Badges & Detail Typography ─────────────────── */
.detail-meta-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text);
}
.badge-pill.rating {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}
.badge-pill.status.ongoing {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: #34d399;
}
.badge-pill.status.completed {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.35);
    color: #818cf8;
}
.badge-pill.status.released {
    background: rgba(6, 182, 212, 0.12);
    border-color: rgba(6, 182, 212, 0.35);
    color: #22d3ee;
}
.badge-pill.quality {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #0b0f19;
    font-weight: 800;
    border: none;
}
.badge-pill.audio {
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.35);
    color: #fb7185;
}
.badge-pill.episodes {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.35);
    color: #a78bfa;
}
.badge-pill.year {
    color: var(--text-muted);
}
.badge-pill.duration {
    color: var(--text-muted);
}

/* ── Pro Cinema Player Frame & Controls ───────────────────── */
.player-cinema-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    background: #000;
    box-shadow: 0 16px 50px rgba(0,0,0,0.85), 0 0 40px rgba(96, 88, 224, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-bottom: 16px;
    transition: box-shadow 0.3s ease;
}

.player-cinema-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(15, 18, 28, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    gap: 12px;
}

.player-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.player-topbar-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    animation: livePulse 2s infinite;
    flex-shrink: 0;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.player-topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.player-ctrl-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.player-ctrl-btn:hover {
    color: var(--text);
    border-color: var(--primary);
    background: rgba(96, 88, 224, 0.15);
}

.player-ctrl-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Cinema Action Toolbar (below player) */
.cinema-action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.cinema-action-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-skip-jump {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-skip-jump:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-1px);
}

.btn-skip-jump.intro {
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.35);
    color: #fb7185;
}

.btn-skip-jump.intro:hover {
    background: #f43f5e;
    color: #fff;
}

/* Focus Mode (Lights Off) */
body.focus-mode header,
body.focus-mode .detail-banner,
body.focus-mode .sidebar,
body.focus-mode footer,
body.focus-mode .section,
body.focus-mode .detail-actions,
body.focus-mode .season-tabs,
body.focus-mode .episodes-grid,
body.focus-mode .episode-synopsis-card {
    opacity: 0.05 !important;
    filter: blur(3px);
    pointer-events: none;
    transition: opacity 0.4s ease, filter 0.4s ease;
}

body.focus-mode .player-cinema-wrapper,
body.focus-mode .cinema-action-bar,
body.focus-mode .player-epbar,
body.focus-mode #playerSection {
    opacity: 1 !important;
    filter: none !important;
    position: relative;
    z-index: 9999;
}

/* Episode Synopsis Card */
.episode-synopsis-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.episode-synopsis-card .ep-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.episode-synopsis-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.episode-synopsis-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* Hotkey Hints Tooltip */
.hotkey-hints {
    font-size: 0.72rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 6px 12px;
    background: rgba(0,0,0,0.25);
    border-radius: var(--radius);
}

.hotkey-hints kbd {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1px 5px;
    font-family: inherit;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ── Cinema Poster Stage (Pre-Play Hero State) ─────────────── */
.cinema-poster-stage {
    position: absolute;
    inset: 0;
    z-index: 18;
    background-size: cover;
    background-position: center top;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: opacity 0.3s ease;
    overflow: hidden;
}

.cinema-poster-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(10, 12, 20, 0.7) 0%, rgba(7, 9, 14, 0.94) 85%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    text-align: center;
}

.cinema-stage-badge {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.45);
    color: #a5b4fc;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.25);
}

.cinema-stage-play {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    padding: 14px 32px;
    border-radius: var(--radius-full);
    font-size: 1.05rem;
    font-weight: 800;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.5);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
}

.cinema-stage-play:hover {
    transform: scale(1.06) translateY(-2px);
    box-shadow: 0 14px 44px rgba(99, 102, 241, 0.7);
    background: linear-gradient(135deg, #7175f5, #6366f1);
}

.cinema-stage-play i {
    font-size: 1.25rem;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.6));
}

.cinema-stage-hints {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ── Animated Audio Equalizer Wave for Active Episode ─────── */
.ep-item.active {
    border-color: var(--primary) !important;
    background: rgba(99, 102, 241, 0.16) !important;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.28) !important;
}

.ep-item.active .ep-title {
    color: #fff !important;
    font-weight: 700;
}

.ep-item.active::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 12px;
    margin-left: auto;
    background: repeating-linear-gradient(90deg, #6366f1 0 2px, transparent 2px 4px);
    animation: eqBars 0.9s infinite alternate ease-in-out;
}

@keyframes eqBars {
    0% { height: 4px; }
    50% { height: 13px; }
    100% { height: 7px; }
}

/* ── Mobile-Optimized Video Player & Episode Cards ─────────────── */

/* ── Animated Smooth Professional Episode Cards ─────────────── */
.ep-card-rich, .app-ep-card {
    display: flex !important;
    align-items: center;
    gap: 14px;
    padding: 10px 14px !important;
    background: rgba(18, 20, 32, 0.65) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px !important;
    text-decoration: none !important;
    color: var(--text) !important;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    transform: translateZ(0);
}

.ep-card-rich:hover, .app-ep-card:hover {
    border-color: rgba(99, 102, 241, 0.5) !important;
    background: rgba(28, 30, 48, 0.85) !important;
    transform: translateY(-2px) scale(1.006) !important;
    box-shadow: 0 10px 28px -6px rgba(0, 0, 0, 0.55), 0 0 20px -4px rgba(99, 102, 241, 0.25) !important;
}

/* Currently Playing Active State with Soundwave Glow */
.ep-card-rich.active, .app-ep-card.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.22) 0%, rgba(18, 20, 32, 0.85) 100%) !important;
    border-color: #6366f1 !important;
    box-shadow: inset 4px 0 0 #6366f1, 0 8px 24px rgba(99, 102, 241, 0.3) !important;
}

.ep-card-rich.active .ep-title, .app-ep-card.active .ep-title {
    color: #fff !important;
    font-weight: 700 !important;
}

/* Animated Equalizer soundwave indicator for active playing episode */
.ep-equalizer {
    display: inline-flex;
    align-items: flex-end;
    gap: 2.5px;
    height: 12px;
    margin-right: 6px;
    vertical-align: middle;
}
.ep-equalizer span {
    width: 2.5px;
    background: #38bdf8;
    border-radius: 1px;
    animation: eqBounce 0.9s ease-in-out infinite alternate;
}
.ep-equalizer span:nth-child(1) { height: 40%; animation-delay: 0.1s; }
.ep-equalizer span:nth-child(2) { height: 100%; animation-delay: 0.3s; }
.ep-equalizer span:nth-child(3) { height: 60%; animation-delay: 0.2s; }

@keyframes eqBounce {
    0% { height: 25%; }
    100% { height: 100%; }
}

.ep-thumb-box, .app-ep-thumb-box {
    position: relative;
    width: 105px;
    height: 64px;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #0c0e17;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ep-thumb-box img, .app-ep-thumb-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ep-card-rich:hover .ep-thumb-box img,
.app-ep-card:hover .app-ep-thumb-box img {
    transform: scale(1.09);
}

.ep-play-icon, .app-ep-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ep-play-icon i, .app-ep-play-overlay i {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.92);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.6);
    padding-left: 2px;
}

.ep-card-rich:hover .ep-play-icon,
.app-ep-card:hover .app-ep-play-overlay {
    opacity: 1;
    transform: scale(1);
}

.ep-badge-pill, .app-ep-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(4px);
    color: #38bdf8;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    letter-spacing: 0.02em;
}

.ep-details, .app-ep-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.ep-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ep-num-label, .ep-num-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
}

.ep-hd-badge { display: none !important; 
    font-size: 0.62rem;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 1px 5px;
    border-radius: 3px;
}

.ep-details .ep-title, .app-ep-info .ep-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ep-dur-row, .app-ep-info .ep-sub {
    font-size: 0.72rem;
    color: var(--text-dim);
}

/* 2-column responsive grid on Anime Detail page */
.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}

/* 2. Sidebar Episode Items in Watch Page */
.sidebar-ep-thumb-wrap {
    position: relative;
    width: 68px;
    height: 44px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #111420;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-ep-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-ep-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(15, 23, 42, 0.9);
    color: #38bdf8;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 3px;
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.sidebar-ep-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.sidebar-ep-meta .sidebar-ep-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-ep-meta .sidebar-ep-dur {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.sidebar-ep-item.active .sidebar-ep-meta .sidebar-ep-title {
    color: #fff;
    font-weight: 700;
}

/* 3. Mobile Episode Quick Strip */
.mobile-ep-strip {
    display: none;
    margin-bottom: 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
}

.mobile-strip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}

.mobile-strip-hint {
    font-size: 0.72rem;
    color: var(--text-dim);
    font-weight: 500;
}

.mobile-strip-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.mobile-ep-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    min-height: 48px;
    padding: 6px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.mobile-ep-chip:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.12);
}

.mobile-ep-chip.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(79, 70, 229, 0.4));
    border-color: var(--primary);
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.35);
}

.mobile-ep-chip .chip-num {
    font-size: 0.82rem;
    font-weight: 800;
    color: #38bdf8;
}

.mobile-ep-chip.active .chip-num {
    color: #fff;
}

.mobile-ep-chip .chip-title {
    font-size: 0.65rem;
    color: var(--text-dim);
    max-width: 72px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 4. Responsive Viewports for Mobile Phone Screens */
@media (max-width: 768px) {
    .watch-container {
        padding: 72px 12px 40px !important;
    }

    .player-cinema-wrapper {
        border-radius: var(--radius);
        margin-bottom: 12px;
    }

    .player-cinema-topbar {
        padding: 8px 12px;
    }

    .player-topbar-title {
        font-size: 0.8rem;
    }

    .player-ctrl-btn {
        padding: 6px 8px;
        font-size: 0.72rem;
    }

    #focusModeBtn, #theaterModeBtn {
        display: none !important;
    }

    /* 48px Touch Target compliance */
    .btn-ep-nav {
        min-height: 48px !important;
        min-width: 72px !important;
        padding: 10px 16px !important;
        font-size: 0.88rem !important;
        font-weight: 700 !important;
        border-radius: var(--radius) !important;
    }

    .player-epbar {
        padding: 10px 12px !important;
        gap: 10px;
    }

    .ep-label {
        font-size: 0.8rem !important;
    }

    /* Show mobile quick strip */
    .mobile-ep-strip {
        display: flex;
        flex-direction: column;
    }

    /* Adjust sidebar height on phone */
    .sidebar-episode-selector {
        max-height: 420px !important;
    }

    .episodes-grid {
        grid-template-columns: 1fr !important;
    }

    body {
        padding-bottom: calc(64px + env(safe-area-inset-bottom)) !important;
    }
}

/* ── Mobile Native Bottom App Bar (Global) ─────────────────── */
.mobile-app-dock {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(10, 12, 20, 0.94);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 9999;
    align-items: center;
    justify-content: space-around;
    padding: 0 10px calc(6px + env(safe-area-inset-bottom));
}

.dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 600;
    min-width: 58px;
    min-height: 48px;
    border-radius: var(--radius);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dock-item i {
    font-size: 1.15rem;
    transition: transform 0.2s ease;
}

.dock-item:hover, .dock-item.active {
    color: #38bdf8;
}

.dock-item.active i {
    color: var(--primary);
    transform: translateY(-2px);
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.6));
}

@media (max-width: 768px) {
    .mobile-app-dock {
        display: flex;
    }
}

.section-view-all {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-view-all:hover {
    color: #38bdf8;
    transform: translateX(4px);
}


/* ── Rich Indexable SEO Editorial & Specs Styles ─────────────── */
.seo-detail-article {
    margin-top: 36px;
    padding: 28px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.seo-header h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 6px;
    line-height: 1.3;
}

.seo-subhead {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.seo-content-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 28px;
    margin-bottom: 28px;
}

@media (max-width: 900px) {
    .seo-content-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .seo-detail-article {
        padding: 20px 16px;
    }
}

.seo-text-col h3, .seo-specs-col h3, .seo-faq-block h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.seo-text-col p {
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.specs-table-wrapper {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.specs-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.specs-table tr:last-child {
    border-bottom: none;
}

.specs-table td {
    padding: 10px 14px;
    vertical-align: middle;
}

.specs-table td:first-child {
    color: var(--text-muted);
    font-weight: 600;
    width: 44%;
}

.specs-table td:first-child i {
    color: var(--primary);
    margin-right: 6px;
    width: 14px;
}

.specs-table td:last-child {
    color: #f1f5f9;
}

.badge-dub {
    background: rgba(244, 63, 94, 0.15);
    color: #fb7185;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.75rem;
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-kw {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.78rem;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.faq-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s;
}

.faq-item[open] {
    border-color: rgba(99, 102, 241, 0.45);
}

.faq-q {
    padding: 14px 16px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #f1f5f9;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.faq-q i {
    color: #38bdf8;
    font-size: 0.95rem;
}

.faq-q::-webkit-details-marker {
    display: none;
}

.faq-a {
    padding: 0 16px 14px 40px;
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--text-muted);
}





.search-chip:hover {
    background: rgba(99, 102, 241, 0.25) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    transform: translateY(-1px);
}

/* ── Continue Watching Compact Cards ── */
.continue-card {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s, box-shadow 0.2s;
}
.continue-card:hover {
    transform: translateY(-3px);
    border-color: rgba(99, 102, 241, 0.5) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
@media (max-width: 480px) {
    .continue-card {
        min-width: 132px !important;
        max-width: 146px !important;
    }
}


/* ── App Server Selector Bar (Server 1 / Server 2) ───────── */
.app-server-bar {
    background: var(--bg-surface, #0f1422);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-lg, 14px);
    padding: 10px 14px;
    margin-bottom: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.server-bar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.server-bar-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.server-bar-title i {
    color: var(--primary, #6366f1);
}

.server-pills {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
}

.server-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text, #e2e8f0);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
}

.server-pill:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.5);
    color: #fff;
    transform: translateY(-1px);
}

.server-pill:active {
    transform: scale(0.98);
}

.server-pill.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(56, 189, 248, 0.2) 100%);
    border-color: var(--primary, #6366f1);
    color: #fff;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.4), inset 0 0 12px rgba(99, 102, 241, 0.15);
}

.server-pill i {
    font-size: 0.85rem;
    color: #94a3b8;
    transition: color 0.2s;
}

.server-pill.active i {
    color: #38bdf8;
}

/* ── Server 2 Vidara Iframe Container ─────────────────────── */
.server2-iframe-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 25;
    border: none;
    overflow: hidden;
}

.server2-iframe-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #000;
}

.server2-loading-box {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #000;
    color: #fff;
    z-index: 26;
}

.server2-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--primary, #6366f1);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}


/* ── Google Auth & User Profile Dropdown ─────────────────── */
.header-auth-wrap {
    display: flex;
    align-items: center;
    position: relative;
    margin-left: 8px;
}

.btn-header-auth {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    user-select: none;
}

.btn-header-auth:hover {
    background: rgba(99, 102, 241, 0.18);
    border-color: var(--primary, #6366f1);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}

.google-icon-svg {
    width: 17px;
    height: 17px;
    display: inline-block;
    flex-shrink: 0;
}

/* User Avatar & Dropdown */
.user-avatar-wrap {
    position: relative;
}

.user-avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--primary, #6366f1);
    padding: 0;
    overflow: hidden;
    background: #1e293b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.user-avatar-btn:hover {
    transform: scale(1.06);
    border-color: #38bdf8;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.45);
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-dropdown-card {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 250px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(99, 102, 241, 0.15);
    z-index: 1000;
    display: none;
    flex-direction: column;
    animation: fadeInSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-dropdown-card.show {
    display: flex;
}

.user-dropdown-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 10px;
}

.user-dropdown-thumb {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--primary, #6366f1);
}

.user-dropdown-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.user-dropdown-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-email {
    font-size: 0.72rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-hr {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 6px 0;
}

.user-dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: #cbd5e1;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s;
}

.user-dropdown-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    transform: translateX(3px);
}

.user-dropdown-link.logout-btn {
    color: #f87171;
}

.user-dropdown-link.logout-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .btn-header-auth {
        padding: 5px 10px;
        font-size: 0.75rem;
        gap: 6px;
    }
    .user-avatar-btn {
        width: 32px;
        height: 32px;
    }
    .user-dropdown-card {
        right: -8px;
        width: 230px;
    }
}


/* ============================================================
   USER DASHBOARD & MOBILE BOTTOM SHEET
   ============================================================ */

.user-dashboard-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.user-dashboard-backdrop.show {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.user-dashboard-modal {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    background: #0f1322;
    background: linear-gradient(180deg, #15192c 0%, #0d101d 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.85), 0 0 35px rgba(99, 102, 241, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    box-sizing: border-box;
}

.user-dashboard-backdrop.show .user-dashboard-modal {
    transform: scale(1) translateY(0);
}

.dashboard-drag-pill {
    display: none;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.dashboard-user-info {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.dashboard-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary, #6366f1);
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.35);
    flex-shrink: 0;
}

.dashboard-user-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.dashboard-user-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-vip {
    font-size: 0.65rem;
    font-weight: 700;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.3);
    padding: 2px 8px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.3px;
}

.dashboard-user-email {
    font-size: 0.76rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.3rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-left: 12px;
    flex-shrink: 0;
}

.dashboard-close-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: rotate(90deg);
}

.dashboard-tabs-nav {
    display: flex;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.dashboard-tabs-nav::-webkit-scrollbar {
    display: none;
}

.dashboard-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s ease;
}

.dashboard-tab-btn:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.05);
}

.dashboard-tab-btn.active {
    background: var(--primary, #6366f1);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.dashboard-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    min-height: 260px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.dashboard-body::-webkit-scrollbar {
    width: 6px;
}

.dashboard-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.dashboard-items-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dash-item-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.dash-item-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
}

.dash-thumb-wrap {
    position: relative;
    width: 86px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    background: #0a0c16;
    flex-shrink: 0;
}

.dash-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dash-ep-pill {
    position: absolute;
    bottom: 3px;
    right: 3px;
    background: rgba(15, 23, 42, 0.88);
    color: #38bdf8;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.3);
    backdrop-filter: blur(4px);
}

.dash-item-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    gap: 3px;
}

.dash-item-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-item-sub {
    font-size: 0.72rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dash-play-action {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #818cf8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
    font-size: 0.8rem;
}

.dash-item-card:hover .dash-play-action {
    background: var(--primary, #6366f1);
    color: #fff;
    transform: scale(1.08);
}

.dash-remove-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
    font-size: 0.8rem;
}

.dash-remove-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #ef4444;
    transform: scale(1.08);
}

.dash-empty-state {
    text-align: center;
    padding: 40px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dash-empty-state i {
    font-size: 2.4rem;
    color: #475569;
    margin-bottom: 12px;
}

.dash-empty-state p {
    color: #94a3b8;
    font-size: 0.88rem;
    margin-bottom: 16px;
}

/* Account Settings Card */
.dashboard-settings-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    gap: 12px;
}

.settings-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.settings-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-desc {
    font-size: 0.72rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-badge {
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.settings-badge.green {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.settings-badge.purple {
    background: rgba(168, 85, 247, 0.12);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.25);
}

.settings-hr {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 8px 0;
}

.btn-block {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-danger {
    padding: 12px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #fff;
}

/* Mobile Bottom Sheet Transformation */
@media (max-width: 768px) {
    .user-dashboard-backdrop {
        padding: 0;
        align-items: flex-end;
    }

    .user-dashboard-modal {
        max-width: 100%;
        max-height: 88vh;
        border-radius: 22px 22px 0 0;
        border-bottom: none;
        border-left: none;
        border-right: none;
        transform: translateY(100%);
        transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .user-dashboard-backdrop.show .user-dashboard-modal {
        transform: translateY(0);
    }

    .dashboard-drag-pill {
        display: block;
        width: 42px;
        height: 4px;
        background: rgba(255, 255, 255, 0.25);
        border-radius: 99px;
        margin: 10px auto 4px;
        flex-shrink: 0;
    }

    .dashboard-header {
        padding: 10px 16px 12px;
    }

    .dashboard-user-avatar {
        width: 40px;
        height: 40px;
    }

    .dashboard-user-name {
        font-size: 0.88rem;
    }

    .dashboard-tabs-nav {
        padding: 8px 12px;
        gap: 6px;
    }

    .dashboard-tab-btn {
        padding: 6px 11px;
        font-size: 0.74rem;
        gap: 6px;
    }

    .dashboard-body {
        padding: 12px 14px 28px;
        min-height: 220px;
    }

    .dash-thumb-wrap {
        width: 72px;
        height: 42px;
    }

    .dash-item-title {
        font-size: 0.8rem;
    }

    .dash-item-sub {
        font-size: 0.68rem;
    }
}


/* ============================================================
   LOGIN GATE POPUP MODAL (3-EPISODE GUEST LIMIT)
   ============================================================ */

.login-gate-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 100005;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.login-gate-backdrop.show {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.login-gate-modal {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: #0f1322;
    background: linear-gradient(180deg, #161b2e 0%, #0d101d 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.9), 0 0 35px rgba(99, 102, 241, 0.2);
    display: flex;
    flex-direction: column;
    transform: scale(0.94) translateY(12px);
    transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.26s ease;
    box-sizing: border-box;
    padding: 24px 22px;
}

.login-gate-backdrop.show .login-gate-modal {
    transform: scale(1) translateY(0);
}

.login-gate-modal .dashboard-drag-pill {
    display: none;
}

.login-gate-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    font-size: 1.3rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
    z-index: 2;
}

.login-gate-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fff;
    transform: rotate(90deg);
}

.login-gate-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.login-gate-icon-badge {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.25));
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 12px;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.25);
}

.login-gate-tag {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.login-gate-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 6px;
    line-height: 1.25;
}

.login-gate-desc {
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.45;
    margin: 0 0 16px;
    max-width: 380px;
}

.login-gate-benefits {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
    box-sizing: border-box;
}

.gate-benefit-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #cbd5e1;
}

.gate-benefit-row i {
    color: #34d399;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.gate-benefit-row strong {
    color: #fff;
}

.login-gate-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-google-auth-gate {
    width: 100%;
    padding: 12px 18px;
    border-radius: 12px;
    background: #ffffff;
    color: #1f2937;
    font-size: 0.92rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
    transition: all 0.18s ease;
    box-sizing: border-box;
}

.btn-google-auth-gate:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.gate-continue-btn {
    width: 100%;
    padding: 11px 18px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #f1f5f9;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.18s ease;
    box-sizing: border-box;
}

.gate-continue-btn i {
    font-size: 0.78rem;
    color: #38bdf8;
}

.gate-continue-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
    transform: translateY(-1px);
}

.login-gate-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.74rem;
    color: #64748b;
}

.gate-browse-link {
    color: #94a3b8;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s;
}

.gate-browse-link:hover {
    color: #38bdf8;
}

.gate-secure-note {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #64748b;
}

/* Standalone Login Page Styles */
.login-page-main {
    min-height: calc(100vh - 160px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px 80px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: #0f1322;
    background: linear-gradient(180deg, #161b2e 0%, #0d101d 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.8), 0 0 35px rgba(99, 102, 241, 0.15);
    padding: 32px 28px;
    text-align: center;
    box-sizing: border-box;
}

.login-card-brand {
    margin-bottom: 20px;
}

.login-card-brand img {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.login-card-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px;
}

.login-card-desc {
    font-size: 0.88rem;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0 0 24px;
}

.btn-google-auth-page {
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    background: #ffffff;
    color: #1f2937;
    font-size: 0.96rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    transition: all 0.18s ease;
}

.btn-google-auth-page:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.45);
}

.login-perks {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px;
    margin: 24px 0 20px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-perk-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.login-perk-item i {
    color: #818cf8;
    font-size: 1rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.login-perk-item strong {
    display: block;
    font-size: 0.84rem;
    color: #fff;
    margin-bottom: 2px;
}

.login-perk-item span {
    display: block;
    font-size: 0.74rem;
    color: #94a3b8;
    line-height: 1.35;
}

.login-card-foot {
    font-size: 0.76rem;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Mobile Bottom Sheet Transformation for Login Gate */
@media (max-width: 768px) {
    .login-gate-backdrop {
        padding: 0;
        align-items: flex-end;
    }

    .login-gate-modal {
        max-width: 100%;
        width: 100%;
        max-height: 85vh;
        max-height: 85dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        border-radius: 20px 20px 0 0;
        border-bottom: none;
        border-left: none;
        border-right: none;
        transform: translateY(100%);
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
        padding: 12px 18px max(20px, env(safe-area-inset-bottom, 20px));
        box-sizing: border-box;
    }

    .login-gate-backdrop.show .login-gate-modal {
        transform: translateY(0);
    }

    .login-gate-modal .dashboard-drag-pill {
        display: block;
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.25);
        border-radius: 99px;
        margin: 0 auto 10px;
        flex-shrink: 0;
    }

    .login-gate-close {
        top: 12px;
        right: 12px;
        width: 34px;
        height: 34px;
        font-size: 1.2rem;
        background: rgba(255, 255, 255, 0.08);
    }

    .login-gate-icon-badge {
        width: 42px;
        height: 42px;
        font-size: 1.15rem;
        margin-bottom: 8px;
    }

    .login-gate-tag {
        font-size: 0.68rem;
        padding: 2px 8px;
        margin-bottom: 6px;
    }

    .login-gate-title {
        font-size: 1.15rem;
        margin-bottom: 4px;
    }

    .login-gate-desc {
        font-size: 0.8rem;
        line-height: 1.4;
        margin-bottom: 12px;
    }

    .login-gate-benefits {
        padding: 8px 10px;
        margin-bottom: 14px;
        gap: 6px;
    }

    .gate-benefit-row {
        font-size: 0.74rem;
        gap: 6px;
    }

    .gate-benefit-row i {
        font-size: 0.8rem;
    }

    .login-gate-actions {
        gap: 8px;
    }

    .btn-google-auth-gate {
        padding: 11px 16px;
        font-size: 0.88rem;
    }

    .gate-continue-btn {
        padding: 10px 16px;
        font-size: 0.84rem;
    }

    .login-gate-footer {
        margin-top: 10px;
        padding-top: 8px;
        font-size: 0.7rem;
    }
}

/* ── AdBlock Detection Modal (Glassmorphism & Anti-Bypass) ── */
body.adblock-locked, html.adblock-locked {
  overflow: hidden !important;
  touch-action: none !important;
}
body.adblock-locked .watch-layout,
body.adblock-locked .app-main,
body.adblock-locked .main-content,
body.adblock-locked header,
body.adblock-locked footer {
  filter: blur(12px) !important;
  pointer-events: none !important;
  user-select: none !important;
}

/* ── Anti-Adblock Friendly Modal (Creator / Human Design) ── */
.ab-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: abFadeIn 0.3s ease-out;
}
.ab-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 9, 18, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.ab-card {
  position: relative;
  width: 100%;
  max-width: 470px;
  background: linear-gradient(160deg, #151a30 0%, #0d1020 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(99, 102, 241, 0.2);
  border-radius: 24px;
  padding: 26px 22px 20px;
  text-align: center;
  color: #fff;
  z-index: 10;
  animation: abSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
}
.ab-mascot-box {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(99, 102, 241, 0.25));
  border: 2px solid rgba(245, 158, 11, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  font-size: 1.9rem;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.25);
  animation: abFloat 3s ease-in-out infinite;
}
@keyframes abFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.ab-badge-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  margin-bottom: 10px;
}
.ab-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
  color: #fff;
  line-height: 1.35;
}
.ab-desc {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin-bottom: 12px;
}
.ab-human-story {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 14px;
  text-align: left;
}
.ab-human-story p {
  font-size: 0.83rem;
  color: #94a3b8;
  line-height: 1.55;
  margin: 0;
}
.ab-human-story strong {
  color: #38bdf8;
}
.ab-simple-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
  text-align: left;
}
.ab-step-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 9px 12px;
  border-radius: 12px;
}
.ab-step-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  flex-shrink: 0;
}
.ab-step-label {
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.4;
}
.ab-step-label strong {
  color: #fff;
}
.ab-btn-primary {
  width: 100%;
  padding: 13px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ab-btn-primary:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.6);
}
.ab-btn-primary:active {
  transform: translateY(0);
}
.ab-footer-team {
  margin-top: 14px;
  font-size: 0.78rem;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

@keyframes abFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes abSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.ab-shake {
  animation: abShakeAnim 0.5s ease-in-out;
}
@keyframes abShakeAnim {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}
.ab-fade-out {
  opacity: 0;
  transition: opacity 0.3s ease-out;
  pointer-events: none;
}

/* ── Adsterra Responsive Banner Slot Layouts ── */
.ad-slot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 16px auto;
  text-align: center;
  max-width: 100%;
  clear: both;
}
.ad-slot-label {
  font-size: 0.65rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim, #64748b);
  margin-bottom: 4px;
  font-weight: 700;
  opacity: 0.8;
}

/* 728x90 Desktop Leaderboard */
.ad-slot-frame-728 {
  width: 728px;
  height: 90px;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
}
@media (max-width: 768px) {
  .ad-slot-728 {
    display: none !important;
  }
}

/* 320x50 Mobile Sticky/Content Banner */
.ad-slot-frame-320 {
  width: 320px;
  height: 50px;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 6px;
}
@media (min-width: 769px) {
  .ad-slot-320-mobile-only {
    display: none !important;
  }
}

/* ── Tube-Style Horizontal Multi-300x250 Ad Rows (xxnxtube style) ── */
.ad-strip-horizontal-300 {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin: 24px auto;
  width: 100%;
  max-width: 1200px;
  clear: both;
}

.ad-strip-horizontal-300 .ad-slot-wrap {
  margin: 0;
  flex: 0 0 auto;
}

@media (max-width: 991px) {
  .ad-strip-horizontal-300 .ad-slot-desktop-3rd {
    display: none !important;
  }
}

@media (max-width: 660px) {
  .ad-strip-horizontal-300 {
    gap: 12px;
    margin: 16px auto;
  }
}

/* 300x250 Medium Rectangle */
.ad-slot-frame-300 {
  width: 300px;
  height: 250px;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.ad-slot-frame-300:hover {
  border-color: rgba(99, 102, 241, 0.35);
}

/* 468x60 Horizontal Banner */
.ad-slot-frame-468 {
  width: 468px;
  height: 60px;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 6px;
}
@media (max-width: 500px) {
  .ad-slot-frame-468 {
    transform: scale(0.72);
    transform-origin: center center;
    margin: -8px 0;
  }
}
@media (max-width: 380px) {
  .ad-slot-frame-468 {
    transform: scale(0.65);
    margin: -10px 0;
  }
}

/* 160x600 Wide Skyscraper */
.ad-slot-frame-160x600 {
  width: 160px;
  height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 10px;
}
@media (max-width: 900px) {
  .ad-slot-160x600 {
    display: none !important;
  }
}

/* 160x300 Half Skyscraper */
.ad-slot-frame-160x300 {
  width: 160px;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
}
@media (max-width: 900px) {
  .ad-slot-160x300 {
    display: none !important;
  }
}

.ad-slot-frame-728 iframe,
.ad-slot-frame-320 iframe,
.ad-slot-frame-300 iframe,
.ad-slot-frame-468 iframe,
.ad-slot-frame-160x600 iframe,
.ad-slot-frame-160x300 iframe {
  max-width: 100%;
  border: none;
  display: block;
}

/* ── Mobile Sticky High-CTR Floating Ad Bar ── */
.mobile-sticky-ad-bar {
  display: none;
}
@media (max-width: 768px) {
  .mobile-sticky-ad-bar {
    display: flex;
    position: fixed;
    bottom: var(--app-nav-h, 64px);
    left: 0;
    right: 0;
    z-index: 9990;
    background: rgba(10, 12, 20, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    justify-content: center;
    align-items: center;
    padding: 6px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.6);
  }
  .mobile-sticky-ad-close {
    position: absolute;
    top: -12px;
    right: 12px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #94a3b8;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    z-index: 9991;
  }
  .mobile-sticky-ad-close:hover {
    color: #fff;
    background: #334155;
  }
}


/* ── Premium User Ad-Free Experience (palbhatts@gmail.com) ── */
html.is-premium-user .ad-strip-horizontal-300,
html.is-premium-user .ad-slot-wrap,
html.is-premium-user .mobile-sticky-ad-bar,
html.is-premium-user [class*="ad-slot"],
html.is-premium-user iframe[src*="bauval.org"],
html.is-premium-user iframe[src*="araplhn.org"],
html.is-premium-user iframe[src*="abscloud.org"],
html.is-premium-user div[id^="adsterra"],
html.is-premium-user div[id^="asg_"],
body.is-premium-user .ad-strip-horizontal-300,
body.is-premium-user .ad-slot-wrap,
body.is-premium-user .mobile-sticky-ad-bar,
body.is-premium-user [class*="ad-slot"],
body.is-premium-user iframe[src*="bauval.org"],
body.is-premium-user iframe[src*="araplhn.org"],
body.is-premium-user iframe[src*="abscloud.org"],
body.is-premium-user div[id^="adsterra"],
body.is-premium-user div[id^="asg_"] {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  width: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
}

.user-dropdown-vip-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 4px;
  width: fit-content;
}

.user-dropdown-vip-badge i {
  color: #f59e0b;
}

.badge-vip.badge-vip-premium {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #fff !important;
  font-weight: 800 !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4) !important;
}
