/* ============================================
   CINEVIO v12.0 — zflixco.net DooPlay Theme
   Navy Blue Cinematic Theme
   - 5-column float-based card grid (DooPlay style)
   - Frosted glass header (70px)
   - Red quality badges (#cd2026)
   - Bottom-right translucent rating badges
   - Blue left-border section headers
   - No desktop sidebar, no telegram banner
   - No edge blending pseudo-elements
   - Cinevio player-wrap system
   - Cinevio two-column watch layout
   - Cinevio server dropdown
   - Cinevio episode grid
   - Cinevio smooth animation system
   - Cinevio scroll-reveal sections
   - Cinevio mobile bottom nav
   - Cinevio premium hover effects (desktop only)
   - Cinevio low-end device optimizations
   - Cinevio custom scrollbar styling
   - Cinevio prefers-reduced-motion support
   - Cinevio font (Roboto)
   ============================================ */

/* ── CSS Variables ── */
:root {
    --bg-primary: #000116;
    --bg-secondary: #050d24;
    --bg-card: #0a1628;
    --bg-card-hover: #0f1f3a;
    --bg-elevated: #0c1a30;
    --bg-input: #0f1f3a;
    --border-color: rgba(255,255,255,0.08);
    --border-hover: rgba(64,139,234,0.25);
    --text-primary: #ffffff;
    --text-secondary: rgba(255,255,255,0.6);
    --text-tertiary: rgba(255,255,255,0.5);
    --accent: #408BEA;
    --accent-dim: rgba(64,139,234,0.12);
    --accent-hover: rgba(64,139,234,0.2);
    --quality-red: #cd2026;
    --font-body: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    --max-width: 1500px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Viewport Protection ── */
html {
    scroll-behavior: smooth;
    max-width: 100vw;
    overflow-x: hidden;
}
body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    max-width: 100vw;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    outline: none;
    background: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
img { display: block; max-width: 100%; }
input { touch-action: manipulation; }

/* ── Custom Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(64,139,234,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(64,139,234,0.35); }

/* ============================================
   ANIMATION SYSTEM
   ============================================ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { 0% { opacity: 0; transform: translateY(20px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes fadeInScale { 0% { opacity: 0; transform: scale(.95); } 100% { opacity: 1; transform: scale(1); } }
@keyframes scaleIn { 0% { opacity: 0; transform: scale(.92); } 100% { opacity: 1; transform: scale(1); } }
@keyframes scaleOut { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(.92); } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.85) translateY(6px); } 60% { transform: scale(1.02) translateY(-2px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes popOut { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(.85) translateY(6px); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes loaderFill { to { width: 100%; } }
@keyframes loaderFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes badgeSlide { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes heroTitleIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes heroMetaIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes heroOverviewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes heroActionsIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity: .7; } 50% { opacity: 1; } }

/* ── Scroll Reveal ── */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .5s cubic-bezier(.4,0,.2,1), transform .5s cubic-bezier(.4,0,.2,1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Prefers Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================
   LOADER
   ============================================ */
.loader {
    position: fixed; inset: 0; z-index: 9999;
    background: var(--bg-primary);
    display: flex; align-items: center; justify-content: center;
    transition: opacity .5s, visibility .5s;
}
.loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { text-align: center; animation: loaderFadeIn .6s ease-out; }
.loader-logo-img {
    width: 64px; height: 64px; object-fit: contain; border-radius: 14px;
    margin-bottom: 12px;
}
.loader-logo {
    font-family: var(--font-heading);
    font-size: 2.5rem; font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 24px;
}
.loader-logo-accent { color: var(--accent); }
.loader-bar {
    width: 180px; height: 2px;
    background: var(--accent-dim);
    border-radius: 2px; overflow: hidden;
    margin: 0 auto;
}
.loader-bar-fill {
    width: 0; height: 100%;
    background: var(--accent);
    border-radius: 2px;
    animation: loaderFill 1.2s ease-in-out forwards;
}

/* ============================================
   NAVBAR — zflixco Frosted Glass Header
   ============================================ */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    height: 70px; padding: 0 40px;
    background: rgba(15,15,15,0.9);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid #000;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
    transition: background .3s ease, backdrop-filter .3s ease;
    will-change: background, backdrop-filter;
}
.nav-inner {
    max-width: var(--max-width); margin: 0 auto;
    display: flex; align-items: center; height: 100%; gap: 24px;
}
.nav-logo {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--font-heading); font-weight: 800;
    font-size: 1.2rem; letter-spacing: -0.02em;
    color: var(--text-primary);
    transition: opacity .2s ease;
    touch-action: manipulation;
}
.nav-logo:hover { opacity: 0.8; }
.nav-logo-img { width: 30px; height: 30px; object-fit: contain; border-radius: 6px; }
.logo-accent { color: var(--accent); }

/* Nav links with icons + text, 14px */
.nav-links { display: flex; gap: 6px; flex-shrink: 1; min-width: 0; }
.nav-link {
    display: flex; align-items: center; gap: 5px;
    padding: 8px 14px; border-radius: 3px;
    font-size: 14px; font-weight: 500;
    color: var(--text-secondary);
    transition: color .2s ease, background .2s ease;
    touch-action: manipulation;
    position: relative;
}
.nav-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-link:hover, .nav-link.active { color: #408BEA; }

.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-toggle {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 3px;
    color: var(--text-secondary);
    transition: color .2s ease;
    touch-action: manipulation;
}
.search-toggle:hover { color: #408BEA; }
.hamburger { display: none; width: 38px; height: 38px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.hamburger span { display: block; width: 18px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: all .3s; }
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* ============================================
   SEARCH OVERLAY
   ============================================ */
.search-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0,1,22,0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 70px;
    opacity: 0; visibility: hidden;
    transition: all .3s;
}
.search-overlay.active { opacity: 1; visibility: visible; }
.search-container { width: 100%; max-width: 640px; padding: 0 16px; }
.search-header {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 28px;
}
.search-header svg { color: var(--text-secondary); flex-shrink: 0; }
.search-header input {
    flex: 1; border: none; background: none;
    color: var(--text-primary); font-size: 0.95rem;
    outline: none; font-family: var(--font-body);
}
.search-header input::placeholder { color: var(--text-tertiary); }
.search-close {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: var(--text-secondary);
    border-radius: 3px;
    transition: color .2s ease;
    touch-action: manipulation;
}
.search-close:hover { color: var(--text-primary); }
.search-results {
    margin-top: 10px; max-height: 60vh;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.search-placeholder { text-align: center; padding: 40px 20px; color: var(--text-tertiary); font-size: 0.85rem; }
.search-result-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 6px;
    cursor: pointer; transition: background .2s ease;
    touch-action: manipulation;
}
.search-result-item:hover { background: var(--accent-dim); }
.search-result-poster {
    width: 40px; height: 60px; border-radius: 3px;
    object-fit: cover; background: var(--bg-card); flex-shrink: 0;
}
.search-result-info h4 { font-size: 0.85rem; font-weight: 600; margin-bottom: 3px; }
.search-result-info p { font-size: 0.75rem; color: var(--text-secondary); }
.search-result-type {
    margin-left: auto; padding: 3px 7px;
    background: var(--accent-dim); border-radius: 3px;
    font-size: 0.65rem; font-weight: 600; color: var(--text-secondary);
}

/* ============================================
   MOBILE BOTTOM NAV
   ============================================ */
.mobile-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
    background: rgba(15,15,15,0.95);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: .4rem 0;
    display: none;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.mobile-nav-items { display: flex; justify-content: space-around; }
.mobile-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: .2rem;
    font-size: .6rem; font-weight: 600;
    color: var(--text-tertiary);
    padding: .35rem .5rem;
    text-decoration: none;
    transition: color .2s ease;
    touch-action: manipulation;
}
.mobile-nav-item:hover, .mobile-nav-item.active { color: #408BEA; }
.mobile-nav-icon { font-size: 1.15rem; display: flex; }
.mobile-spacer { display: none; }

/* ============================================
   MAIN CONTENT
   ============================================ */
.app-content { min-height: 100vh; padding-top: 70px; }
.page-enter { animation: pageIn .3s ease-out; }

/* ── Content-visibility for Offscreen Sections ── */
.section { content-visibility: auto; contain-intrinsic-size: 0 200px; }

/* ============================================
   HERO
   ============================================ */
.hero {
    position: relative; width: 100%; min-height: 55vh;
    display: flex; align-items: flex-end; overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.35); }
.hero-bg::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to top, #000116 0%, rgba(0,1,22,0.7) 40%, transparent 100%);
}
.hero-content {
    position: relative; z-index: 2;
    max-width: var(--max-width); margin: 0 auto;
    padding: 0 40px 40px; width: 100%;
}
.hero-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; background: #408BEA; color: #fff;
    border-radius: 3px;
    font-size: 0.65rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    margin-bottom: 10px;
    animation: badgeSlide .5s ease-out;
}
.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 5vw, 3.5rem);
    font-weight: 800; line-height: 1.1;
    letter-spacing: -0.03em; margin-bottom: 8px;
    animation: heroTitleIn .6s ease-out;
}
.hero-meta {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.8rem; color: var(--text-secondary);
    margin-bottom: 10px; flex-wrap: wrap;
    animation: heroMetaIn .7s ease-out;
}
.hero-meta-item { display: flex; align-items: center; gap: 3px; }
.hero-rating { color: #fbbf24; font-weight: 600; }
.hero-overview {
    max-width: 600px; font-size: 0.82rem; line-height: 1.5;
    color: var(--text-secondary); margin-bottom: 16px;
    display: -webkit-box; -webkit-line-clamp: 3;
    -webkit-box-orient: vertical; overflow: hidden;
    animation: heroOverviewIn .8s ease-out;
}
.hero-actions {
    display: flex; gap: 8px; flex-wrap: wrap;
    animation: heroActionsIn .9s ease-out;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; border-radius: 3px;
    font-size: 0.8rem; font-weight: 600;
    transition: all .2s ease;
    will-change: transform;
    touch-action: manipulation;
    position: relative; overflow: hidden;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: rgba(64,139,234,0.85); transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary { background: var(--accent-dim); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--accent-hover); border-color: var(--border-hover); }
.btn-secondary:active { transform: scale(0.97); }

/* ============================================
   SECTIONS — zflixco DooPlay Style
   ============================================ */
.section {
    max-width: var(--max-width); margin: 0 auto;
    padding: 0 20px; margin-bottom: 28px;
}
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}
.section-title {
    font-family: var(--font-heading);
    font-size: 20px; font-weight: 500;
    letter-spacing: -0.01em;
    border-left: 3px solid #408BEA;
    padding-left: 10px;
    line-height: 1.2;
}
.section-more {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: #fff;
    background: #408BEA;
    border-radius: 3px;
    padding: 3px 8px;
    transition: opacity .2s ease;
    touch-action: manipulation;
}
.section-more:hover { opacity: 0.85; }

/* ============================================
   CARDS — zflixco DooPlay 5-Column Grid
   ============================================ */

/* ── Float-based 5-column grid ── */
.card-grid {
    display: block;
    overflow: hidden;
    margin: 0 -10px;
}
.card-grid::after {
    content: '';
    display: table;
    clear: both;
}

.card {
    float: left;
    width: calc(100% / 5);
    padding: 0 10px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: transform .25s ease;
    will-change: transform;
    touch-action: manipulation;
}
.card:hover { transform: translateY(-3px); }
.card:active { transform: scale(0.97); }

/* ── Poster with padding-top: 140% ── */
.card-poster {
    position: relative;
    padding-top: 140%;
    border-radius: 3px; overflow: hidden;
    background: var(--bg-card);
}
.card-poster img {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: filter .3s, transform .3s;
}
.card:hover .card-poster img { filter: brightness(0.5); transform: scale(1.05); }

.card-poster-placeholder {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-card);
}

/* ── Play button on hover — SVG centered, scale animation ── */
.card-play {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transform: scale(0.75);
    transition: opacity 0.65s ease, transform 0.65s ease;
    z-index: 3;
}
.card:hover .card-play { opacity: 1; transform: scale(1); }
.card-play-icon {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
}
.card-play-icon svg { width: 40px; height: 40px; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5)); }

/* ── Rating badge — bottom-right, translucent white, slides up on hover ── */
.card-rating {
    position: absolute; bottom: 8px; right: 8px;
    display: flex; align-items: center; gap: 2px;
    padding: 3px 6px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 3px;
    font-size: 12px; font-weight: 600;
    color: #fff;
    margin-bottom: -40px;
    transition: margin-bottom 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    z-index: 4;
}
.card:hover .card-rating {
    margin-bottom: 0;
    opacity: 1;
}

/* ── Quality badge — top-left, red #cd2026 ── */
.card-quality {
    position: absolute; top: 8px; left: 8px;
    padding: 5px 8px;
    background: #cd2026;
    border-radius: 3px;
    font-size: 12px; font-weight: 600;
    color: #fff;
    z-index: 4;
    letter-spacing: 0.02em;
}

/* ── Card info section ── */
.card-data {
    margin: 15px 0 10px;
}
.card-title {
    font-size: 14px; font-weight: 500;
    color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: 2px;
    transition: color .2s ease;
}
.card:hover .card-title { color: #408BEA; }
.card-year {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}

/* ── Content Grid (for browse/filter pages) ── */
.content-grid {
    display: block;
    overflow: hidden;
    margin: 0 -10px;
}
.content-grid::after {
    content: '';
    display: table;
    clear: both;
}
.content-grid .card {
    float: left;
    width: calc(100% / 5);
    padding: 0 10px;
    margin-bottom: 20px;
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header { max-width: var(--max-width); margin: 0 auto; padding: 24px 20px 0; }
.page-header-title { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 4px; }
.page-header-sub { color: var(--text-secondary); font-size: 0.82rem; }

/* ============================================
   GENRE PILLS
   ============================================ */
.genre-pills { display: flex; flex-wrap: wrap; gap: 5px; max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.genre-pill {
    padding: 5px 12px; border-radius: 3px;
    font-size: 0.72rem; font-weight: 500;
    color: var(--text-secondary); background: var(--bg-card);
    border: 1px solid transparent;
    transition: all .2s ease;
    touch-action: manipulation;
}
.genre-pill:hover { color: var(--text-primary); border-color: var(--border-hover); }
.genre-pill.active { color: #fff; background: #408BEA; border-color: #408BEA; }

/* ============================================
   DETAIL PAGE
   ============================================ */
.detail-hero { position: relative; width: 100%; min-height: 38vh; overflow: hidden; }
.detail-hero-bg { position: absolute; inset: 0; }
.detail-hero-bg img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.3); }
.detail-hero::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 60%;
    background: linear-gradient(to top, #000116, transparent);
}
.detail-back {
    position: absolute; top: 10px; left: 10px; z-index: 10;
    width: 36px; height: 36px; background: rgba(0,0,0,0.6);
    backdrop-filter: blur(10px); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-primary); transition: all .2s ease;
    touch-action: manipulation;
}
.detail-back:hover { background: rgba(64,139,234,0.25); }
.detail-content {
    max-width: var(--max-width); margin: 0 auto;
    padding: 0 20px; display: flex; gap: 20px;
    margin-top: -70px; position: relative; z-index: 5;
}
.detail-poster { flex-shrink: 0; width: 160px; }
.detail-poster img { width: 100%; border-radius: 3px; box-shadow: 0 8px 48px rgba(0,0,0,0.8); }
.detail-info { flex: 1; padding-top: 8px; }
.detail-title {
    font-family: var(--font-heading);
    font-size: clamp(1.3rem, 3.5vw, 2.5rem);
    font-weight: 800; letter-spacing: -0.03em; margin-bottom: 8px;
}
.detail-meta {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.78rem; color: var(--text-secondary);
    margin-bottom: 10px; flex-wrap: wrap;
}
.detail-rating-box { padding: 2px 7px; background: rgba(251,191,36,0.15); color: #fbbf24; border-radius: 3px; font-weight: 700; font-size: 0.72rem; }
.detail-meta-sep { color: var(--text-tertiary); }
.detail-genres { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.detail-genre { padding: 3px 8px; background: var(--accent-dim); border: 1px solid var(--border-color); border-radius: 3px; font-size: 0.68rem; font-weight: 500; color: var(--text-secondary); transition: .2s ease; }
.detail-overview { font-size: 0.82rem; line-height: 1.6; color: var(--text-secondary); margin-bottom: 16px; max-width: 680px; }
.detail-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.detail-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; margin-bottom: 16px; }
.detail-fact { padding: 8px; background: var(--bg-card); border-radius: 3px; border: 1px solid var(--border-color); }
.detail-fact-label { font-size: 0.62rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2px; }
.detail-fact-value { font-size: 0.76rem; font-weight: 600; }

/* ── Cast ── */
.cast-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.cast-row::-webkit-scrollbar { display: none; }
.cast-item { flex: 0 0 auto; text-align: center; width: 64px; }
.cast-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; margin: 0 auto 3px; background: var(--bg-card); }
.cast-name { font-size: 0.62rem; font-weight: 500; margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cast-char { font-size: 0.56rem; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Season selector ── */
.season-selector { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.season-btn { padding: 5px 12px; border-radius: 3px; font-size: 0.72rem; font-weight: 500; color: var(--text-secondary); background: var(--bg-card); border: 1px solid var(--border-color); transition: all .2s ease; touch-action: manipulation; }
.season-btn:hover { color: var(--text-primary); border-color: var(--border-hover); }
.season-btn.active { color: #fff; background: #408BEA; border-color: #408BEA; }

/* ── Episode list ── */
.episode-list { display: flex; flex-direction: column; gap: 4px; }
.episode-item {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 10px; background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer; transition: all .2s ease;
    touch-action: manipulation;
}
.episode-item:hover { background: var(--bg-card-hover); border-color: var(--border-hover); }
.episode-item:active { transform: scale(0.99); }
.episode-still { width: 80px; height: 44px; border-radius: 3px; overflow: hidden; flex-shrink: 0; background: var(--bg-elevated); }
.episode-still img { width: 100%; height: 100%; object-fit: cover; }
.episode-title { font-size: 0.72rem; font-weight: 600; margin-bottom: 1px; }
.episode-runtime { font-size: 0.64rem; color: var(--text-tertiary); line-height: 1.3; }

/* ============================================
   PLAYER MODAL — Cinevio Two-Column Architecture
   ============================================ */
.player-modal {
    position: fixed; inset: 0; z-index: 3000;
    background: var(--bg-primary);
    display: flex; align-items: stretch; justify-content: stretch;
    opacity: 0; visibility: hidden;
    transition: opacity .2s, visibility .2s;
}
.player-modal.active { opacity: 1; visibility: visible; }
.player-container {
    width: 100%; display: flex; flex-direction: column; overflow: hidden;
    max-width: 100vw;
}

/* ── Player Header ── */
.player-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 5px 12px; background: rgba(5,13,36,0.98);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(64,139,234,0.08);
    flex-shrink: 0; min-height: 44px;
}
.player-header-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.player-back {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px; background: rgba(64,139,234,0.08);
    color: var(--text-secondary);
    transition: all .2s ease;
    flex-shrink: 0; touch-action: manipulation;
}
.player-back:hover { color: var(--text-primary); background: var(--accent-dim); }
.player-back svg { width: 18px; height: 18px; }
.player-title {
    font-size: 0.82rem; font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.player-close {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px; background: rgba(64,139,234,0.08);
    font-size: 1.2rem; color: var(--text-secondary);
    transition: all .2s ease;
    flex-shrink: 0; touch-action: manipulation;
}
.player-close:hover { color: var(--text-primary); background: var(--accent-dim); }

.player-body { flex: 1; display: flex; flex-direction: column; overflow: hidden; max-width: 100vw; }

/* ── Two-column layout wrapper ── */
.player-layout {
    display: block; flex: 1; min-height: 0;
    overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: env(safe-area-inset-bottom, 0);
    max-width: 100vw;
}
.player-left-col { display: block; max-width: 100vw; overflow-x: hidden; }
.player-right-col { display: block; max-width: 100vw; overflow-x: hidden; }

/* ── Player iframe (Cinevio player-wrap system) ── */
.player-iframe-wrap {
    position: relative; width: 100%;
    background: #000116;
    aspect-ratio: 16/9;
    max-height: 80vh;
    overflow: hidden;
    will-change: opacity;
    transition: opacity .2s ease;
}
/* Stream loading overlay */
.player-iframe-wrap .stream-loader {
    position: absolute; inset: 0; z-index: 10;
    background: rgba(0,0,0,0.85);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 12px; opacity: 0; visibility: hidden;
    transition: opacity .3s, visibility .3s;
}
.player-iframe-wrap .stream-loader.active { opacity: 1; visibility: visible; }
.player-iframe-wrap .stream-loader-spinner {
    width: 36px; height: 36px;
    border: 3px solid rgba(64,139,234,0.15);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
.player-iframe-wrap .stream-loader-text {
    font-size: 0.75rem; color: var(--text-secondary);
    font-weight: 500;
}
/* Stream error overlay */
.player-iframe-wrap .stream-error {
    position: absolute; inset: 0; z-index: 10;
    background: rgba(0,0,0,0.9);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 12px; opacity: 0; visibility: hidden;
    transition: opacity .3s, visibility .3s;
}
.player-iframe-wrap .stream-error.active { opacity: 1; visibility: visible; }
.player-iframe-wrap .stream-error-icon {
    width: 48px; height: 48px;
    background: rgba(64,139,234,0.08);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
}
.player-iframe-wrap .stream-error-text {
    font-size: 0.8rem; color: var(--text-secondary);
    text-align: center; max-width: 240px;
}
.player-iframe-wrap .stream-error-btn {
    padding: 8px 20px; border-radius: 3px;
    font-size: 0.78rem; font-weight: 600;
    background: var(--accent); color: #fff;
    cursor: pointer; touch-action: manipulation;
    transition: transform .15s ease;
}
.player-iframe-wrap .stream-error-btn:active { transform: scale(0.95); }

.player-iframe-wrap.transitioning { opacity: 0.6; }
.player-iframe-wrap iframe {
    position: absolute; inset: 0; width: 100%; height: 100%;
    border: none; will-change: transform;
    max-width: 100%;
}

/* ── Player Episodes Section ── */
.player-episodes {
    padding: 14px 16px; background: var(--bg-primary);
    max-width: 100vw; overflow-x: hidden;
    border-bottom: 1px solid var(--border-color);
}

/* ── Player Info Section ── */
.player-info-section {
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border-color);
}
.player-info-title {
    font-family: var(--font-heading);
    font-size: 1.05rem; font-weight: 700;
    letter-spacing: -0.02em; color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
}
.player-info-meta {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.75rem; color: var(--text-secondary);
    flex-wrap: wrap;
}
.player-info-meta .meta-sep { color: var(--text-tertiary); }

/* ── Server Section ── */
.server-section {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}
.server-section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
}
.server-section-label {
    font-family: var(--font-heading);
    font-size: 0.82rem; font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.server-dropdown-btn {
    display: flex; align-items: center; gap: .4rem;
    padding: .5rem .9rem; border-radius: 3px;
    font-size: .8rem; font-weight: 600;
    color: var(--text-secondary); background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    transition: all .25s cubic-bezier(.4,0,.2,1);
    cursor: pointer; touch-action: manipulation;
    white-space: nowrap;
}
.server-dropdown-btn:hover { background: var(--accent-hover); color: #fff; border-color: var(--border-hover); }
.server-dropdown-btn:active { transform: scale(0.98); }
.server-dropdown-btn svg { flex-shrink: 0; }
.server-dropdown-btn.menu-open { background: var(--accent-hover); color: #fff; border-color: var(--border-hover); }

/* Backdrop overlay */
.server-backdrop {
    position: fixed; inset: 0; z-index: 10999;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
}
.server-backdrop.active { display: block; }

/* Server menu */
.server-menu {
    position: fixed; z-index: 11000;
    background: #0a1628;
    border: 1px solid rgba(64,139,234,0.15);
    border-radius: 6px;
    padding: .5rem;
    min-width: 260px; max-width: calc(100vw - 2rem);
    max-height: min(400px, 70vh);
    overflow-y: auto; overflow-x: hidden;
    box-shadow: 0 20px 80px rgba(0,0,0,0.9), 0 8px 24px rgba(0,0,0,0.6);
    scrollbar-width: thin;
    display: none;
    opacity: 0;
    will-change: opacity, transform;
}
/* Desktop: dropdown anchored below button */
@media (min-width: 769px) {
    .server-menu {
        transform: translateY(-8px);
        transition: opacity .2s cubic-bezier(.4,0,.2,1), transform .25s cubic-bezier(.34,1.56,.64,1);
    }
    .server-menu.open {
        display: block;
        opacity: 1;
        transform: translateY(0);
    }
    .server-menu.closing {
        display: block;
        opacity: 0;
        transform: translateY(-8px);
        transition: opacity .12s ease, transform .12s ease;
    }
}
/* Mobile: bottom-sheet that slides up */
@media (max-width: 768px) {
    .server-menu {
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: 100% !important;
        min-width: 0;
        max-width: none;
        max-height: 60vh;
        border-radius: 14px 14px 0 0;
        padding: 0;
        transform: translateY(100%);
        transition: transform .3s cubic-bezier(.32,.72,.24,1.02);
    }
    .server-menu.open {
        display: block;
        opacity: 1;
        transform: translateY(0);
    }
    .server-menu.closing {
        display: block;
        opacity: 1;
        transform: translateY(100%);
        transition: transform .25s cubic-bezier(.4,0,1,1);
    }
}
.server-menu::-webkit-scrollbar { width: 4px; }
.server-menu::-webkit-scrollbar-track { background: transparent; }
.server-menu::-webkit-scrollbar-thumb { background: rgba(64,139,234,0.2); border-radius: 2px; }

/* Bottom-sheet handle (mobile) */
.server-menu-handle { display: none; }
@media (max-width: 768px) {
    .server-menu-handle {
        display: flex; justify-content: center; padding: 10px 0 6px;
    }
    .server-menu-handle::after {
        content: '';
        width: 36px; height: 4px;
        background: rgba(64,139,234,0.25);
        border-radius: 2px;
    }
    .server-menu-title {
        display: block;
        text-align: center;
        font-size: 0.85rem;
        font-weight: 700;
        color: var(--text-primary);
        padding: 0 16px 10px;
        border-bottom: 1px solid var(--border-color);
    }
}
@media (min-width: 769px) {
    .server-menu-title { display: none; }
}

.server-option {
    padding: .7rem .85rem; border-radius: 3px;
    font-size: .82rem; font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer; transition: all .2s ease;
    display: flex; align-items: center; gap: .5rem;
    touch-action: manipulation;
}
@media (max-width: 768px) {
    .server-option {
        padding: .85rem 1.1rem;
        font-size: .88rem;
        border-radius: 6px;
    }
}
.server-option:hover { background: var(--accent-hover); color: #fff; }
.server-option:active { transform: scale(0.98); }
.server-option.active { background: rgba(64,139,234,0.15); color: #fff; }

/* ── Episode Navigation ── */
.ep-nav {
    display: flex; align-items: center; justify-content: space-between;
    gap: .75rem; padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    animation: fadeIn .4s ease both; animation-delay: .12s;
}
.ep-nav-btn {
    display: flex; align-items: center; gap: .4rem;
    padding: .45rem .8rem; border-radius: 3px;
    font-size: .8rem; font-weight: 600;
    color: var(--text-secondary); background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all .25s cubic-bezier(.4,0,.2,1);
    cursor: pointer; touch-action: manipulation;
    position: relative; overflow: hidden;
}
.ep-nav-btn:hover:not(:disabled) { background: var(--accent-hover); color: #fff; border-color: var(--border-hover); }
.ep-nav-btn:active:not(:disabled) { transform: translateY(0); }
.ep-nav-btn:disabled { opacity: .3; cursor: not-allowed; }
.ep-nav-btn svg { flex-shrink: 0; }
.ep-nav-current { font-size: .82rem; font-weight: 600; color: var(--text-primary); }

/* ── Player Episodes Section ── */
.player-episodes {
    padding: 14px 16px; background: var(--bg-primary);
    max-width: 100vw; overflow-x: hidden;
    border-top: 1px solid var(--border-color);
}
.player-ep-header { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.pe-label { font-size: 0.72rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; }
.player-season-select { display: flex; gap: 5px; flex-wrap: wrap; }
.player-season-btn {
    padding: 7px 14px; border-radius: 3px; font-size: 0.7rem; font-weight: 600;
    color: var(--text-secondary); background: rgba(64,139,234,0.08);
    border: 1px solid rgba(64,139,234,0.12); white-space: nowrap;
    transition: all .25s cubic-bezier(.4,0,.2,1);
    touch-action: manipulation;
}
.player-season-btn.active { color: #fff; background: #408BEA; border-color: #408BEA; }

/* ── Episode Grid ── */
.player-ep-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 6px; max-height: 200px; overflow-y: auto; padding: 4px 2px;
}
.player-ep-btn {
    padding: 10px 4px; border-radius: 3px;
    font-size: 0.72rem; font-weight: 600;
    color: var(--text-secondary); background: rgba(64,139,234,0.08);
    border: 1px solid rgba(64,139,234,0.12);
    min-width: 0; text-align: center;
    transition: all .25s cubic-bezier(.4,0,.2,1);
    touch-action: manipulation;
    position: relative; overflow: hidden;
    opacity: 0; animation: fadeInUp .4s ease forwards;
}
.player-ep-btn:nth-child(1) { animation-delay: .02s; }
.player-ep-btn:nth-child(2) { animation-delay: .04s; }
.player-ep-btn:nth-child(3) { animation-delay: .06s; }
.player-ep-btn:nth-child(4) { animation-delay: .08s; }
.player-ep-btn:nth-child(5) { animation-delay: .1s; }
.player-ep-btn:nth-child(6) { animation-delay: .12s; }
.player-ep-btn:nth-child(7) { animation-delay: .14s; }
.player-ep-btn:nth-child(8) { animation-delay: .16s; }
.player-ep-btn:nth-child(9) { animation-delay: .18s; }
.player-ep-btn:nth-child(10) { animation-delay: .2s; }
.player-ep-btn:nth-child(n+11) { animation-delay: .22s; }
.player-ep-btn:hover { color: var(--text-primary); background: rgba(64,139,234,0.12); }
.player-ep-btn:active { transform: scale(0.95); }
.player-ep-btn.active {
    color: #fff; background: #408BEA; border-color: #408BEA;
    box-shadow: 0 2px 10px rgba(64,139,234,0.25);
}

/* ============================================
   STREAM NOTICE
   ============================================ */
.stream-notice {
    display: none;
    padding: 10px 16px;
    background: rgba(64,139,234,0.05);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    margin: 0 0 0;
    animation: fadeInUp .4s ease-out both;
    animation-delay: .2s;
}
.stream-notice.visible { display: flex; }
.stream-notice-icon {
    width: 32px; height: 32px;
    border-radius: 3px;
    background: rgba(64,139,234,0.08);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: var(--text-secondary);
}
.stream-notice-icon svg { width: 16px; height: 16px; }
.stream-notice-content { flex: 1; margin-left: 10px; }
.stream-notice-title {
    font-family: var(--font-heading);
    font-size: 0.78rem; font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}
.stream-notice-text {
    font-size: 0.72rem; line-height: 1.5;
    color: var(--text-secondary);
}
@media (max-width: 768px) {
    .stream-notice { padding: 8px 12px; margin: 0; border-radius: 0; border-left: none; border-right: none; }
    .stream-notice-icon { width: 28px; height: 28px; }
    .stream-notice-title { font-size: 0.72rem; }
    .stream-notice-text { font-size: 0.66rem; }
}

/* ============================================
   YOU MIGHT LIKE
   ============================================ */
.player-you-might-like {
    padding: 12px 16px 24px; background: var(--bg-primary);
    max-width: 100vw; overflow-x: hidden;
    border-top: 1px solid var(--border-color);
    content-visibility: auto; contain-intrinsic-size: 0 200px;
}
.yml-title {
    font-family: var(--font-heading); font-size: 0.82rem; font-weight: 700;
    margin-bottom: 10px; letter-spacing: -0.01em;
    color: var(--text-primary);
    display: flex; align-items: center; gap: 5px;
}
.yml-title svg { opacity: 0.4; width: 14px; height: 14px; }
.yml-grid {
    display: flex; gap: 10px; overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px; scrollbar-width: none;
}
.yml-grid::-webkit-scrollbar { display: none; }
.yml-card {
    flex: 0 0 auto; width: 100px;
    scroll-snap-align: start;
    cursor: pointer; transition: transform .2s ease;
    will-change: transform; touch-action: manipulation;
}
.yml-card:active { transform: scale(0.96); }
.yml-card-poster {
    position: relative; aspect-ratio: 2/3;
    border-radius: 3px; overflow: hidden;
    background: var(--bg-card);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.yml-card-poster img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
.yml-card-poster img[src=""] { opacity: 0; }
.yml-card-rating {
    position: absolute; top: 3px; left: 3px;
    padding: 2px 5px; background: rgba(0,0,0,0.75);
    border-radius: 2px; font-size: 0.5rem; font-weight: 600;
    display: flex; align-items: center; gap: 1px;
}
.yml-card-title {
    font-size: 0.62rem; font-weight: 500; margin-top: 5px;
    white-space: normal; overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; color: var(--text-secondary);
    line-height: 1.3;
}
.yml-skeleton { min-width: 0; }
.yml-skeleton-poster {
    width: 100%; aspect-ratio: 2/3; border-radius: 3px;
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%; animation: shimmer 1.5s infinite;
}
.yml-skeleton-text {
    width: 70%; height: 6px; margin-top: 3px; border-radius: 2px;
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%; animation: shimmer 1.5s infinite;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination { display: flex; justify-content: center; gap: 4px; padding: 16px 0 10px; }
.page-btn {
    padding: 5px 10px; border-radius: 3px;
    font-size: 0.72rem; font-weight: 500;
    color: var(--text-secondary); background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all .2s ease;
    touch-action: manipulation;
}
.page-btn:hover { color: var(--text-primary); }
.page-btn.active { color: #fff; background: #408BEA; border-color: #408BEA; }

/* ============================================
   FOOTER — zflixco Simple Style
   ============================================ */
.footer {
    margin-top: 36px;
    padding: 40px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.footer-inner {
    max-width: var(--max-width); margin: 0 auto;
}
.footer-brand {
    font-family: var(--font-heading); font-size: 1.1rem;
    font-weight: 800; letter-spacing: -0.02em;
    margin-bottom: 6px;
}
.footer-brand span { color: var(--accent); }
.footer-text {
    font-size: 13px; color: rgba(255,255,255,0.6);
    line-height: 1.5;
}
.footer-links { display: flex; gap: 16px; margin-top: 10px; }
.footer-links a { font-size: 13px; color: rgba(255,255,255,0.6); transition: color .2s ease; }
.footer-links a:hover { color: var(--text-primary); }

/* ============================================
   SKELETON
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%; animation: shimmer 1.5s infinite;
    border-radius: 3px;
}
.skeleton-card {
    float: left;
    width: calc(100% / 5);
    padding: 0 10px;
    margin-bottom: 20px;
}
.content-grid .skeleton-card { width: calc(100% / 5); }
.skeleton-poster { width: 100%; padding-top: 140%; border-radius: 3px; }
.skeleton-text { width: 75%; height: 9px; margin-top: 5px; }
.skeleton-text-short { width: 45%; height: 7px; margin-top: 3px; }

/* ============================================
   NO RESULTS
   ============================================ */
.no-results { text-align: center; padding: 56px 20px; color: var(--text-tertiary); }
.no-results-icon { font-size: 2.5rem; margin-bottom: 10px; }
.no-results h3 { font-size: 1rem; margin-bottom: 4px; color: var(--text-secondary); }

/* ============================================
   TOAST
   ============================================ */
.toast {
    position: fixed; bottom: 16px; left: 50%;
    transform: translateX(-50%) translateY(70px);
    padding: 7px 14px; background: var(--text-primary);
    color: var(--bg-primary); border-radius: 3px;
    font-size: 0.72rem; font-weight: 600; z-index: 5000;
    opacity: 0; transition: all .3s; pointer-events: none;
    white-space: nowrap; max-width: 88vw; overflow: hidden; text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================
   BACK TO TOP
   ============================================ */
.back-to-top {
    position: fixed; bottom: 16px; right: 12px;
    width: 36px; height: 36px;
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 3px; display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary); z-index: 50;
    opacity: 0; visibility: hidden;
    transition: all .2s ease;
    touch-action: manipulation;
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { color: var(--text-primary); background: var(--accent-hover); border-color: var(--border-hover); }

.fade-in { animation: fadeIn .3s ease-out; }

/* ============================================
   ANIME BANNER
   ============================================ */
.anime-banner {
    background: linear-gradient(135deg, rgba(64,139,234,0.06) 0%, rgba(64,139,234,0.02) 100%);
    border: 1px solid rgba(64,139,234,0.15);
    border-radius: 6px;
    padding: 28px 24px;
    text-align: center;
    max-width: 560px;
    margin: 0 auto;
    animation: fadeInUp .5s ease-out;
}
.anime-banner-icon {
    width: 56px; height: 56px;
    margin: 0 auto 14px;
    background: rgba(64,139,234,0.08);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
}
.anime-banner-icon svg { width: 28px; height: 28px; }
.anime-banner-title {
    font-family: var(--font-heading);
    font-size: 1.15rem; font-weight: 700;
    margin-bottom: 6px; color: var(--text-primary);
}
.anime-banner-text {
    font-size: 0.85rem; line-height: 1.6;
    color: var(--text-secondary); margin-bottom: 18px;
}
.anime-banner-highlight {
    color: var(--text-primary); font-weight: 600;
}
.anime-banner-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 28px; border-radius: 3px;
    font-size: 0.88rem; font-weight: 700;
    background: #408BEA; color: #fff;
    text-decoration: none; transition: all .2s ease;
    touch-action: manipulation;
}
.anime-banner-btn:hover { background: rgba(64,139,234,0.85); transform: translateY(-1px); }
.anime-banner-btn:active { transform: scale(0.97); }
.anime-banner-btn svg { width: 16px; height: 16px; }

/* Anime banner in search results */
.anime-search-banner {
    background: rgba(64,139,234,0.06);
    border: 1px solid rgba(64,139,234,0.12);
    border-radius: 3px;
    padding: 12px 14px;
    display: flex; align-items: center; gap: 10px;
    margin-top: 6px;
}
.anime-search-banner-icon { flex-shrink: 0; color: var(--text-secondary); }
.anime-search-banner-icon svg { width: 16px; height: 16px; }
.anime-search-banner-text { font-size: 0.72rem; color: var(--text-secondary); line-height: 1.4; }
.anime-search-banner-text strong { color: var(--text-primary); }
.anime-search-banner-link {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 3px;
    font-size: 0.68rem; font-weight: 600;
    background: #408BEA; color: #fff;
    text-decoration: none; margin-top: 4px;
    transition: all .2s ease;
    touch-action: manipulation;
}
.anime-search-banner-link:hover { opacity: 0.9; }

/* ============================================
   CREATOR PAGE
   ============================================ */
.creator-page {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px 16px 40px;
}

.creator-profile-section {
    text-align: center;
    margin-bottom: 24px;
    animation: fadeInUp .5s ease-out;
}

.creator-avatar-wrap {
    display: inline-block;
    margin-bottom: 16px;
}

.creator-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(64,139,234,0.15);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.creator-name {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.creator-role {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 6px;
}

.creator-tagline {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    font-style: italic;
}

.creator-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 18px;
    margin-bottom: 14px;
    animation: fadeInUp .5s ease-out both;
}

.creator-card:nth-child(2) { animation-delay: .1s; }
.creator-card:nth-child(3) { animation-delay: .2s; }

.creator-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.creator-card-header svg {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.creator-about-text {
    font-size: 0.82rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

.creator-social-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.creator-social-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all .25s cubic-bezier(.4,0,.2,1);
    text-decoration: none;
    color: inherit;
    touch-action: manipulation;
}

.creator-social-item:hover {
    background: var(--accent-hover);
    border-color: var(--border-hover);
    transform: translateX(4px);
}

.creator-social-item:active {
    transform: scale(0.98);
}

.creator-social-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

.gmail-icon { background: #D44638; }
.facebook-icon { background: #1877F2; }
.instagram-icon { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }

.creator-social-info { min-width: 0; }

.creator-social-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.creator-social-detail {
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.creator-footer {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-tertiary);
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   MOBILE RESPONSIVE — zflixco Breakpoints
   ============================================ */

/* ── ≤ 1130px: 4 cards per row ── */
@media (max-width: 1130px) {
    .card { width: calc(100% / 4); }
    .content-grid .card { width: calc(100% / 4); }
    .skeleton-card { width: calc(100% / 4); }
    .content-grid .skeleton-card { width: calc(100% / 4); }
}

/* ── ≤ 1024px: Tablet / Mobile — show bottom nav ── */
@media (max-width: 1024px) {
    .nav-links { display: none !important; visibility: hidden; height: 0; overflow: hidden; position: absolute; pointer-events: none; }
    .hamburger { display: flex; }
    .mobile-nav { display: block; }
    .mobile-spacer { display: block; height: 110px; }
    .player-modal { z-index: 10000; }

    /* Player iframe — mobile constraint */
    .player-iframe-wrap {
        aspect-ratio: 16/9;
        max-height: 56vw;
    }

    /* Detail page mobile */
    .detail-content { flex-direction: column; align-items: center; text-align: center; }
    .detail-poster { width: 140px; }
    .detail-info { padding-top: 0; }
    .detail-meta { justify-content: center; }
    .detail-genres { justify-content: center; }
    .detail-overview { max-width: 100%; }
    .detail-actions { justify-content: center; }
    .detail-facts { max-width: 360px; margin-left: auto; margin-right: auto; }
    .hero { min-height: 45vh; }
    .hero-title { font-size: clamp(1.3rem, 6vw, 2rem); }
    .hero-content { padding: 0 20px 40px; }

    /* Server section on mobile */
    .server-section { padding: 10px 12px; }
    .player-info-section { padding: 12px 12px 8px; }

    /* Navbar mobile adjustments */
    .navbar { height: 56px; padding: 0 12px; }
    .nav-logo { font-size: 1rem; }
    .nav-logo-img { width: 24px; height: 24px; }
}

/* ── ≤ 768px: Phone — 3 cards per row ── */
@media (max-width: 768px) {
    .card { width: calc(100% / 3); }
    .content-grid .card { width: calc(100% / 3); }
    .skeleton-card { width: calc(100% / 3); }
    .content-grid .skeleton-card { width: calc(100% / 3); }

    .player-iframe-wrap { aspect-ratio: 16/9; max-height: 56vw; }
    .navbar { height: 48px; padding: 0 8px; }
    .nav-logo-img { width: 22px; height: 22px; }
    .nav-logo span { font-size: 0.95rem; }
    .hero { min-height: 40vh; }
    .hero-content { padding: 0 10px 28px; }
    .section { padding: 0 12px; margin-bottom: 20px; }
    .section-title { font-size: 16px; }
    .btn { padding: 8px 14px; font-size: 0.75rem; gap: 5px; }
    .mobile-spacer { display: block; height: 115px; }
    .container, .section, .player-you-might-like { padding-left: 1rem; padding-right: 1rem; }

    /* Low-end mobile: reduce animation complexity */
    .player-ep-btn { animation: none; opacity: 1; }
    .episodes-section, .player-you-might-like, .related-section { content-visibility: auto; contain-intrinsic-size: 0 200px; }

    /* Server section compact on mobile */
    .server-section { padding: 10px 12px; }
    .server-dropdown-btn { padding: .45rem .75rem; font-size: .75rem; }
    .player-info-title { font-size: 0.92rem; }
}

/* ── ≤ 540px: Smaller padding ── */
@media (max-width: 540px) {
    .section { padding: 0 10px; }
    .hero-content { padding: 0 10px 28px; }
    .card-grid { margin: 0 -5px; }
    .card { padding: 0 5px; }
    .content-grid .card { padding: 0 5px; }
    .skeleton-card { padding: 0 5px; }
    .content-grid .skeleton-card { padding: 0 5px; }
    .genre-pills { padding: 0 10px; }
    .page-header { padding: 24px 10px 0; }
    .detail-content { padding: 0 10px; }
}

/* ── ≤ 480px: Small phone — 2 cards per row ── */
@media (max-width: 480px) {
    .card { width: calc(100% / 2); }
    .content-grid .card { width: calc(100% / 2); }
    .skeleton-card { width: calc(100% / 2); }
    .content-grid .skeleton-card { width: calc(100% / 2); }

    .detail-poster { width: 120px; }
    .hero-content { padding: 0 12px 32px; }
    .section { padding: 0 10px; margin-bottom: 20px; }
    .player-header { min-height: 40px; padding: 0 10px; }
    .player-back { width: 32px; height: 32px; border-radius: 8px; }
    .player-title { font-size: 0.76rem; }
    .player-close { width: 32px; height: 32px; border-radius: 8px; }
    .player-ep-btn { padding: 9px 2px; font-size: 0.68rem; }
    .yml-card { width: 90px; }
    .yml-card-title { font-size: 0.56rem; }
}

/* ============================================
   DESKTOP RESPONSIVE (zflixco Architecture)
   No sidebar — full-width header nav
   ============================================ */

/* ── 1025px+ Desktop ── */
@media (min-width: 1025px) {
    /* ── Show navbar, hide mobile nav ── */
    .navbar { display: flex; height: 70px; }
    .mobile-nav { display: none; }
    .mobile-spacer { display: none; }
    .hamburger { display: none; }

    /* ── No sidebar offset ── */
    .app-content {
        margin-left: 0;
        padding-top: 70px;
    }

    /* Hero — larger, more cinematic */
    .hero { min-height: 75vh; }
    .hero-content { padding: 0 40px 48px; max-width: 700px; }
    .hero-title { font-size: 3rem; text-shadow: 0 2px 20px rgba(0,0,0,0.8), 0 0 40px rgba(0,0,0,0.4); }
    .hero-overview { max-width: 580px; font-size: 0.92rem; -webkit-line-clamp: 4; }
    .hero-badge, .hero-meta, .hero-overview { text-shadow: 0 1px 8px rgba(0,0,0,0.6); }

    /* Sections — wider spacing */
    .section { max-width: var(--max-width); margin: 0 auto; padding: 0 40px; margin-bottom: 2.5rem; }
    .section-header { padding: 15px 10px; margin-bottom: 1rem; }
    .section-title { font-size: 20px; }
    .section-more { font-size: 10px; }

    /* Content rows — 5-column float grid stays */
    .card-grid { margin: 0 -10px; }
    .card { width: calc(100% / 5); padding: 0 10px; }
    .content-grid .card { width: calc(100% / 5); padding: 0 10px; }
    .skeleton-card { width: calc(100% / 5); padding: 0 10px; }
    .content-grid .skeleton-card { width: calc(100% / 5); padding: 0 10px; }

    /* Card details — bigger text */
    .card-title { font-size: 14px; }
    .card-year { font-size: 12px; }
    .card-rating { font-size: 12px; padding: 3px 6px; }
    .card-quality { font-size: 12px; padding: 5px 8px; }
    .card-play-icon svg { width: 44px; height: 44px; }

    /* Page headers — larger */
    .page-header { padding: 28px 40px 0; }
    .page-header-title { font-size: 1.8rem; }
    .page-header-sub { font-size: 0.9rem; }

    /* Genre pills — more spacing */
    .genre-pills { padding: 0 40px; gap: 8px; }
    .genre-pill { padding: 7px 16px; font-size: 0.78rem; }

    /* Detail page — wider, two-column ready */
    .detail-content { padding: 0 40px; gap: 28px; margin-top: -80px; }
    .detail-poster { width: 200px; }
    .detail-title { font-size: 2.2rem; }
    .detail-meta { font-size: 0.85rem; }
    .detail-overview { font-size: 0.9rem; line-height: 1.7; max-width: 720px; }
    .detail-genre { padding: 5px 12px; font-size: 0.75rem; }
    .detail-facts { grid-template-columns: repeat(4, 1fr); gap: 10px; }
    .detail-fact { padding: 10px; }
    .detail-fact-label { font-size: 0.68rem; }
    .detail-fact-value { font-size: 0.82rem; }

    /* Cast row — wider items */
    .cast-item { width: 80px; }
    .cast-avatar { width: 56px; height: 56px; }
    .cast-name { font-size: 0.68rem; }

    /* Episode list — wider */
    .episode-item { padding: 10px 14px; }
    .episode-still { width: 120px; height: 66px; }
    .episode-title { font-size: 0.8rem; }
    .episode-runtime { font-size: 0.7rem; }

    /* Season selector — wider */
    .season-btn { padding: 7px 16px; font-size: 0.8rem; }

    /* Pagination — wider */
    .page-btn { padding: 7px 14px; font-size: 0.78rem; }

    /* Footer — wider */
    .footer { padding: 40px 40px; }
    .footer-inner { max-width: var(--max-width); }
    .footer-brand { font-size: 1.3rem; }
    .footer-text { font-size: 13px; max-width: 600px; }
    .footer-links { gap: 24px; }
    .footer-links a { font-size: 13px; }

    /* Creator page — wider */
    .creator-page { max-width: 700px; padding: 36px 40px 48px; }
    .creator-card { padding: 22px; }

    /* ── Player layout becomes two-column flex ── */
    .player-layout {
        display: flex;
        gap: 0;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    /* Left column: Player iframe + title + description + ep nav takes ~60% */
    .player-left-col {
        flex: 0 0 60%;
        min-width: 0; max-width: 60%;
        display: flex; flex-direction: column;
        overflow-y: auto;
    }
    .player-left-col .player-iframe-wrap {
        flex-shrink: 0;
        aspect-ratio: 16/9;
        max-height: calc(100vh - 46px);
    }

    /* Stream notice on desktop — inside left column below player */
    .player-left-col .stream-notice { margin: 0; border-radius: 0; border-left: none; border-right: none; }

    /* Right column: Server + Info + Episodes — 40%, scrollable */
    .player-right-col {
        flex: 0 0 40%;
        min-width: 0; max-width: 40%;
        overflow-y: auto; overflow-x: hidden;
        border-left: 1px solid var(--border-color);
        scrollbar-width: thin;
    }
    .player-right-col::-webkit-scrollbar { width: 4px; }
    .player-right-col::-webkit-scrollbar-track { background: transparent; }
    .player-right-col::-webkit-scrollbar-thumb { background: rgba(64,139,234,0.15); border-radius: 2px; }

    /* Right column — Reorder for desktop: Server first, then Info, then Episodes */
    .player-right-col {
        display: flex;
        flex-direction: column;
    }
    .player-right-col .server-section { order: 1; }
    .player-right-col .player-info-section { order: 2; }
    .player-right-col .ep-nav { order: 3; }
    .player-right-col .player-episodes { order: 4; }
    .player-right-col .player-you-might-like { order: 5; }

    /* Right column server section */
    .player-right-col .server-section { padding: 14px 16px; }
    .player-right-col .server-dropdown-btn { padding: .5rem 1rem; font-size: .85rem; }
    .player-right-col .server-option { font-size: .85rem; padding: .65rem .85rem; }

    /* Right column info section */
    .player-right-col .player-info-section { padding: 14px 16px; }
    .player-right-col .player-info-title { font-size: 1.1rem; }

    /* Right column ep nav */
    .player-right-col .ep-nav { padding: 8px 16px; }

    /* Right column episodes */
    .player-right-col .player-episodes { padding: 12px 16px; }
    .player-right-col .pe-label { font-size: 0.75rem; }
    .player-right-col .player-season-btn { padding: 5px 10px; font-size: 0.7rem; }
    .player-right-col .player-ep-btn { padding: 5px 9px; font-size: 0.66rem; min-width: 32px; }
    .player-right-col .player-ep-list { max-height: 250px; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); -webkit-mask-image: none; mask-image: none; }

    /* Right column You Might Like */
    .player-right-col .player-you-might-like { padding: 12px 16px; }
    .player-right-col .yml-title { font-size: 0.82rem; margin-bottom: 8px; }
    .player-right-col .yml-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }
    .player-right-col .yml-card { width: 100%; }
    .player-right-col .yml-card-poster { border-radius: 3px; box-shadow: none; }

    /* Content-visibility for offscreen sections (desktop perf boost) */
    .section { content-visibility: auto; contain-intrinsic-size: 0 300px; }
}

/* ── 1131px–1025px: Transition — 4 cards per row ── */
@media (min-width: 1025px) and (max-width: 1130px) {
    .card { width: calc(100% / 4); }
    .content-grid .card { width: calc(100% / 4); }
    .skeleton-card { width: calc(100% / 4); }
    .content-grid .skeleton-card { width: calc(100% / 4); }
}

/* ── 1440px+ Large Desktop ── */
@media (min-width: 1440px) {
    :root { --max-width: 1500px; }

    /* Hero */
    .hero-content { padding: 0 40px 56px; max-width: 750px; }
    .hero-title { font-size: 3.5rem; }

    /* Sections */
    .section { padding: 0 40px; margin-bottom: 3rem; }
    .section-header { margin-bottom: 1.25rem; }

    /* Cards — still 5 per row but bigger */
    .card-title { font-size: 14px; }
    .card-year { font-size: 12px; }

    /* Detail page */
    .detail-content { padding: 0 40px; gap: 32px; }
    .detail-poster { width: 220px; }
    .detail-title { font-size: 2.5rem; }
    .detail-overview { max-width: 780px; }

    /* Page header & genre pills */
    .page-header { padding: 32px 40px 0; }
    .genre-pills { padding: 0 40px; }

    /* Footer */
    .footer { padding: 40px 40px; }

    /* Creator */
    .creator-page { max-width: 780px; }
}

/* ── 1920px+ Ultra-Wide ── */
@media (min-width: 1920px) {
    :root { --max-width: 1800px; }

    /* Hero */
    .hero { min-height: 85vh; }
    .hero-content { padding: 0 40px 64px; max-width: 850px; }
    .hero-title { font-size: 4rem; }
    .hero-overview { font-size: 1rem; max-width: 850px; }

    /* Sections */
    .section { padding: 0 40px; margin-bottom: 3.5rem; }
    .section-title { font-size: 22px; }

    /* Cards still 5 per row on ultra-wide */
    .card-title { font-size: 15px; }
    .card-year { font-size: 13px; }

    /* Detail page */
    .detail-content { padding: 0 40px; gap: 36px; }
    .detail-poster { width: 240px; }
    .detail-title { font-size: 2.8rem; }
    .detail-overview { max-width: 900px; font-size: 0.95rem; }
    .detail-facts { grid-template-columns: repeat(5, 1fr); }

    /* Page header & genre pills */
    .page-header { padding: 36px 40px 0; }
    .page-header-title { font-size: 2rem; }
    .genre-pills { padding: 0 40px; gap: 10px; }
    .genre-pill { padding: 8px 18px; font-size: 0.82rem; }

    /* Footer */
    .footer { padding: 40px 40px; }
    .footer-brand { font-size: 1.45rem; }

    /* Creator */
    .creator-page { max-width: 860px; }

    /* Navbar */
    .nav-logo span { font-size: 1.45rem; }
    .nav-links { gap: 10px; }
    .nav-link { padding: 8px 16px; font-size: 15px; }
}

/* ============================================
   PREMIUM HOVER EFFECTS (Desktop Only)
   ============================================ */
@media (hover: hover) and (pointer: fine) {
    .card:hover {
        transform: translateY(-4px) scale(1.02);
        box-shadow: 0 10px 30px rgba(0,0,0,0.4), 0 0 12px rgba(64,139,234,0.08);
    }
    .card:active {
        transform: translateY(-2px) scale(1.01);
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }
    .yml-card:hover {
        transform: translateY(-3px) scale(1.03);
        box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    }
    .server-option:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }
    .server-option:active { transform: translateY(0); }
    .ep-nav-btn:hover:not(:disabled) { box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
    .player-ep-btn:hover {
        box-shadow: 0 4px 16px rgba(0,0,0,0.3), 0 0 8px rgba(64,139,234,0.06);
    }
    .genre-pill:hover {
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }
    .detail-genre:hover {
        background: rgba(64,139,234,0.2); border-color: rgba(64,139,234,0.3);
    }
}

/* ============================================
   PERFORMANCE TIERS (data-perf)
   ============================================ */
[data-perf="low"] .navbar.scrolled,
[data-perf="medium"] .navbar.scrolled {
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
[data-perf="low"] .mobile-nav,
[data-perf="medium"] .mobile-nav {
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
[data-perf="low"] .search-overlay,
[data-perf="medium"] .search-overlay {
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
[data-perf="low"] .player-header {
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
[data-perf="medium"] .player-header {
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
[data-perf="low"] .player-ep-btn {
    animation: none !important; opacity: 1 !important;
}
[data-perf="low"] .server-option {
    animation: none !important;
}
[data-perf="low"] .hero-badge,
[data-perf="low"] .hero-title,
[data-perf="low"] .hero-overview,
[data-perf="low"] .hero-actions {
    animation: none !important;
}
