/* DramaCina - Premium Gold Dark Theme */
:root {
    --bg: #0a0a0f;
    --bg-secondary: #12121a;
    --surface: #1a1a24;
    --surface-hover: #22222e;
    --border: rgba(212, 175, 55, 0.15);
    --gold: #d4af37;
    --gold-light: #f5c842;
    --gold-dark: #b8960c;
    --gold-glow: rgba(212, 175, 55, 0.3);
    --text: #f0f0f5;
    --text-muted: #8888a0;
    --text-dim: #55556a;
    --accent: #ffd700;
    --danger: #ef4444;
    --success: #22c55e;
    --radius: 12px;
    --radius-lg: 16px;
    --header-h: 56px;
    --nav-h: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ─── Splash ─── */
.splash {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: var(--bg);
    transition: opacity 0.5s, visibility 0.5s;
}
.splash.fade-out { opacity: 0; visibility: hidden; }
.splash-logo { width: 80px; height: 80px; object-fit: contain; animation: pulse 2s infinite; }
.splash-title {
    font-size: 28px; font-weight: 700; margin-top: 16px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.splash-loader {
    width: 48px; height: 48px; margin-top: 24px;
}
.loading-lottie,
.splash-loader.loading-lottie,
.yt-spinner-lottie {
    width: 48px; height: 48px; margin: 0 auto;
}
.loading-lottie--sm { width: 28px; height: 28px; }
.loading-lottie--lg { width: 56px; height: 56px; }
.loading-lottie--xl { width: 72px; height: 72px; }
.loading .loading-lottie { margin-bottom: 12px; }
.loading--compact {
    padding: 20px 12px;
}
.loading--compact .loading-lottie { margin-bottom: 8px; }
.loading--compact span { font-size: 12px; }
.loading-block {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    width: 100%;
}
.loading-block .loading { padding: 24px 16px; }
.home-hero-slot--loading {
    min-height: clamp(240px, 52vw, 420px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── Header stack (detail / search / dll.) ─── */
.header-inner { gap: 8px; }
.header-stack {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}
.header-stack__back {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: -8px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}
.header-stack__back:active { background: rgba(255,255,255,.08); }
.header-stack__text {
    flex: 1;
    min-width: 0;
}
.header-stack__title {
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}
.header-stack__sub {
    font-size: 12px;
    color: var(--gold);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.app.has-stack-header .detail-back { display: none !important; }

/* ─── App Layout ─── */
.app { min-height: 100dvh; display: flex; flex-direction: column; }

.header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding-top: env(safe-area-inset-top, 0px);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: var(--header-h); padding: 0 16px;
}
.header-brand { display: flex; align-items: center; gap: 8px; }
.brand-icon { width: 28px; height: 28px; object-fit: contain; }
.brand-name {
    font-size: 18px; font-weight: 700;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.header-actions { display: flex; gap: 4px; }

.source-picker {
    display: flex; gap: 8px; padding: 8px 16px 12px;
    overflow-x: auto; scrollbar-width: none;
}
.source-picker::-webkit-scrollbar { display: none; }
.source-chip {
    flex-shrink: 0; padding: 6px 14px; border-radius: 20px;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text-muted); font-size: 13px; cursor: pointer;
    transition: var(--transition);
}
.source-chip.active, .source-chip:hover {
    border-color: var(--gold); color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
}

/* ─── Home source bar ─── */
.home-source-bar {
    padding: 12px 16px 4px;
}
.home-source-bar-head {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 10px; font-size: 12px;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em;
}
.home-source-label.muted { opacity: 0.55; }
.home-source-sep { opacity: 0.35; }
.home-source-chips {
    display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
    padding-bottom: 4px;
}
.home-source-chips::-webkit-scrollbar { display: none; }
.home-source-chip {
    flex-shrink: 0; padding: 8px 16px; border-radius: 22px;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text-muted); font-size: 13px; font-weight: 500;
    cursor: pointer; transition: var(--transition);
}
.home-source-chip.active, .home-source-chip:hover {
    border-color: var(--gold); color: var(--gold);
    background: rgba(212, 175, 55, 0.12);
}
.home-all-hint {
    padding: 0 16px 8px; margin: 0;
    font-size: 13px; color: var(--text-dim);
}
.section-source-badge {
    flex-shrink: 0; font-size: 11px; padding: 4px 10px;
    border-radius: 12px; border: 1px solid var(--border);
    background: rgba(212, 175, 55, 0.08); color: var(--gold-light);
}
.section-source-badge[data-source="flextv"] {
    color: #7ecbff; border-color: rgba(126, 203, 255, 0.3);
    background: rgba(126, 203, 255, 0.08);
}
.section-source-badge[data-source="netshort"] {
    color: #b388ff; border-color: rgba(179, 136, 255, 0.3);
    background: rgba(179, 136, 255, 0.08);
}

.main-content {
    flex: 1; padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 8px);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.tab-views {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.tab-shell {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}
.tab-shell.hidden { display: none !important; }
.tab-views.hidden { display: none !important; }
.stack-view {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}
.stack-view.hidden { display: none !important; }

/* ─── Bottom Nav (Android-style) ─── */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    display: flex; align-items: stretch;
    height: calc(var(--nav-h) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: rgba(18, 18, 26, 0.95);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
}
.nav-item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 2px;
    background: none; border: none; color: var(--text-dim);
    cursor: pointer; transition: var(--transition);
    position: relative; padding: 8px 0;
}
.nav-item.active { color: var(--gold); }
.nav-item.active::before {
    content: ''; position: absolute; top: 0;
    width: 32px; height: 3px; border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
}
.nav-icon { width: 24px; height: 24px; object-fit: contain; }
.nav-icon-img { pointer-events: none; transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-icon-pop { animation: nav-icon-pop 0.35s ease; }
@keyframes nav-icon-pop {
    0% { transform: scale(0.82); opacity: 0.65; }
    55% { transform: scale(1.14); }
    100% { transform: scale(1); opacity: 1; }
}
.nav-item--vip { margin-top: -6px; }
.nav-item--vip .nav-icon--vip { width: 36px; height: 36px; }
.nav-item--vip-active .nav-icon--vip { animation: vip-nav-pulse 2s ease-in-out infinite; }
@keyframes vip-nav-pulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 transparent); }
    50% { transform: scale(1.06); filter: drop-shadow(0 0 6px rgba(212,175,55,0.45)); }
}
.nav-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.15;
}
.nav-item { min-width: 0; padding: 8px 2px; }
.app.foryou-active .nav-label { color: rgba(255, 255, 255, 0.88); }
.app.foryou-active .nav-item.active .nav-label { color: var(--pink); font-weight: 600; }

/* Untuk Anda — immersive bottom nav (parity DramaMax) */
.app.foryou-active .bottom-nav {
    background: linear-gradient(to top, rgba(0,0,0,.72) 0%, transparent 72%);
    border-top: 1px solid rgba(255,255,255,.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.app.foryou-active .header { display: none; }
.app.foryou-active .nav-item.active { color: var(--pink); }
.app.foryou-active .nav-item.active::before {
    background: linear-gradient(90deg, var(--pink), #e91e8c);
}
body.foryou-sheet-open .bottom-nav { z-index: 90; }

/* ─── Buttons ─── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; border-radius: var(--radius);
    font-size: 14px; font-weight: 600; cursor: pointer;
    border: none; transition: transform .12s ease, box-shadow .2s ease, filter .15s, background .15s;
    user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:active:not(:disabled) { transform: scale(0.96); }
.btn-gold:active:not(:disabled) { transform: scale(0.96) translateY(0); }
.btn-gold {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
    color: #0a0a0f; box-shadow: 0 4px 15px var(--gold-glow);
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--gold-glow); }
.btn-outline {
    background: transparent; border: 1px solid var(--gold); color: var(--gold);
}
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-icon { width: 18px; height: 18px; object-fit: contain; vertical-align: -3px; margin-right: 4px; }
.inline-coin { width: 16px; height: 16px; object-fit: contain; vertical-align: -2px; margin-left: 4px; }
.menu-icon { display: inline-flex; align-items: center; margin-right: 8px; }
.menu-icon__img { width: 20px; height: 20px; object-fit: contain; }
.profile-vip-badge { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; }
.profile-vip-badge__img { width: 18px; height: 18px; object-fit: contain; }
.page-head { display: flex; align-items: center; gap: 12px; }
.page-head h2 { font-size: 18px; font-weight: 600; }

.icon-btn {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text-muted); cursor: pointer;
    transition: transform .12s ease, color var(--transition), border-color var(--transition);
    user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.icon-btn:hover { color: var(--gold); border-color: var(--gold); }
.icon-btn:active:not(:disabled) { transform: scale(0.92); background: var(--surface-hover); }
.icon-btn--img { padding: 0; overflow: hidden; }
.icon-btn__img { width: 20px; height: 20px; object-fit: contain; pointer-events: none; }
.vip-badge { border-color: rgba(212,175,55,0.3); overflow: visible; }
.vip-badge .icon-btn__img { width: 22px; height: 22px; }

/* VIP animated icons (DramaBox-style shimmer + pulse) */
.vip-anim {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.vip-anim--header { width: 22px; height: 22px; border-radius: 6px; }
.vip-anim--lg { width: 72px; height: 72px; border-radius: 16px; }
.vip-anim--md { width: 40px; height: 40px; border-radius: 10px; }
.vip-anim--sm { width: 18px; height: 18px; border-radius: 4px; }
.vip-shimmer-lottie {
    position: absolute;
    inset: -40%;
    pointer-events: none;
    opacity: 0.85;
    mix-blend-mode: screen;
}
.vip-anim .icon-btn__img,
.vip-anim img {
    position: relative;
    z-index: 1;
}
.vip-anim .icon-btn__img,
.vip-anim--header img { animation: vip-pulse 2s ease-in-out infinite; }
.vip-anim--lg img { animation: vip-pulse 2.4s ease-in-out infinite; }
@keyframes vip-pulse {
    0%, 100% { transform: scale(1); }
    35% { transform: scale(1.1); }
    55% { transform: scale(0.95); }
}

/* ─── Hero Banner ─── */
.hero-banner {
    position: relative; margin: 16px; border-radius: var(--radius-lg);
    overflow: hidden; aspect-ratio: 16/7;
    background: var(--surface);
}
.hero-banner img {
    width: 100%; height: 100%; object-fit: cover;
}
.hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(transparent 40%, rgba(10,10,15,0.95));
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 20px;
}
.hero-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.hero-sub { font-size: 13px; color: var(--text-muted); }

/* ─── Section ─── */
.section { padding: 0 16px; margin-bottom: 24px; }
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.section-title {
    font-size: 16px; font-weight: 600;
    display: flex; align-items: center; gap: 8px;
}
.section-title::before {
    content: ''; width: 3px; height: 16px; border-radius: 2px;
    background: linear-gradient(var(--gold-dark), var(--gold-light));
}
.section-more {
    font-size: 13px; color: var(--gold); cursor: pointer;
    background: none; border: none;
}

/* ─── Drama Grid ─── */
.drama-scroll {
    display: flex; gap: 12px; overflow-x: auto;
    scroll-snap-type: x mandatory; scrollbar-width: none;
    padding-bottom: 4px;
}
.drama-scroll::-webkit-scrollbar { display: none; }

.drama-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
@media (min-width: 640px) { .drama-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
@media (min-width: 1024px) { .drama-grid { grid-template-columns: repeat(6, 1fr); } }

.drama-card {
    flex-shrink: 0; width: 120px; cursor: pointer;
    scroll-snap-align: start; transition: var(--transition);
}
.drama-grid .drama-card { width: auto; }
.drama-card:hover { transform: translateY(-2px); }
.drama-cover {
    position: relative; border-radius: var(--radius);
    overflow: hidden; aspect-ratio: 3/4;
    background: var(--surface);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.drama-cover img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.3s;
}
.drama-card:hover .drama-cover img { transform: scale(1.05); }
.drama-ep-badge {
    position: absolute; bottom: 6px; right: 6px;
    background: rgba(0,0,0,0.75); color: var(--gold-light);
    font-size: 10px; padding: 2px 6px; border-radius: 4px;
    backdrop-filter: blur(4px);
}
.drama-vip-tag {
    position: absolute; top: 6px; left: 6px;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    color: #0a0a0f; font-size: 9px; font-weight: 700;
    padding: 2px 6px; border-radius: 4px;
}
.drama-title {
    font-size: 12px; font-weight: 500; margin-top: 6px;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
    line-height: 1.3;
}

.drama-tags {
    display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px;
}
.drama-tags .tag {
    font-size: 9px; padding: 2px 6px;
}
.drama-cover-tag {
    position: absolute; top: 6px; left: 6px;
    background: rgba(212, 175, 55, 0.9); color: #0a0a0f;
    font-size: 9px; font-weight: 600; padding: 2px 6px;
    border-radius: 4px; max-width: 90%; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}
.detail-tags-label {
    font-size: 12px; color: var(--text-muted); margin-bottom: 6px;
}
.tag-clickable { cursor: pointer; transition: var(--transition); }
.tag-clickable:hover {
    background: rgba(212,175,55,0.25); border-color: var(--gold);
}

/* ─── Detail Page ─── */
.detail-hero {
    position: relative; padding: 16px;
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
}
.detail-back {
    position: absolute; top: 16px; left: 16px; z-index: 10;
}
.detail-info { display: flex; gap: 16px; margin-top: 40px; }
.detail-poster {
    width: 120px; flex-shrink: 0; border-radius: var(--radius);
    overflow: hidden; aspect-ratio: 3/4;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-meta { flex: 1; }
.detail-name { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.detail-desc {
    font-size: 13px; color: var(--text-muted); margin-bottom: 12px;
    display: -webkit-box; -webkit-line-clamp: 3;
    -webkit-box-orient: vertical; overflow: hidden;
}
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag {
    font-size: 11px; padding: 3px 8px; border-radius: 12px;
    background: rgba(212,175,55,0.1); color: var(--gold); border: 1px solid var(--border);
}
.detail-actions { display: flex; gap: 8px; margin-top: 16px; }

/* ─── Episodes ─── */
.episode-grid {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
    padding: 0 16px 16px;
}
@media (min-width: 640px) { .episode-grid { grid-template-columns: repeat(8, 1fr); } }
.episode-btn {
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
    border-radius: 8px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); font-size: 13px;
    cursor: pointer; transition: var(--transition);
}
.episode-btn:hover, .episode-btn.active {
    border-color: var(--gold); color: var(--gold);
    background: rgba(212,175,55,0.1);
}
.episode-btn.watched { opacity: 0.5; }

.main-content.player-mode {
    padding-top: env(safe-area-inset-top, 0px);
}

/* ─── YouTube-style Flexible Player ─── */
.player-page { background: #000; min-height: 100dvh; padding-bottom: env(safe-area-inset-bottom); }

/* Stage wrapper — ukuran fleksibel */
.player-stage {
    position: relative;
    width: 100%;
    margin: 0 auto;
    transition: max-width 0.35s ease, box-shadow 0.3s;
}
.player-stage--theater {
    max-width: 100%;
}
.player-stage--theater .player-wrap {
    max-height: min(85vh, calc(100vw / var(--video-ar-num, 1.777)));
}

/* Mini player — floating, draggable */
.player-stage--mini {
    position: fixed;
    bottom: calc(var(--nav-h, 64px) + 20px);
    right: 16px;
    width: min(360px, calc(100vw - 32px));
    z-index: 300;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.65);
    border: 1px solid rgba(255,255,255,0.08);
}
.player-stage--mini .player-wrap {
    max-height: 220px;
}
.player-stage--mini .yt-stage-resize { display: none; }
.player-stage--mini .yt-mini-drag { display: flex; }
body.has-mini-player .bottom-nav { z-index: 250; }

/* Wrap — aspect ratio otomatis dari video */
.player-wrap {
    position: relative;
    width: 100%;
    margin: 0 auto;
    background: #000;
    aspect-ratio: var(--video-ar, 16 / 9);
    max-height: min(56vh, calc(100vw / (9/16)));
    min-height: 180px;
    transition: aspect-ratio 0.35s ease, max-height 0.25s, max-width 0.35s;
}
.player-wrap.is-manual-height {
    aspect-ratio: unset !important;
    height: var(--player-manual-h, 56vh);
    max-height: none;
}
/* Vertical 9:16 — player lebih sempit & tinggi (seperti YouTube Shorts) */
.player-wrap--vertical {
    max-width: min(420px, 100%);
    max-height: min(85vh, calc(100vw * 16 / 9));
}
/* Horizontal 16:9 */
.player-wrap--horizontal {
    max-width: 100%;
    max-height: min(70vh, calc(100vw * 9 / 16));
}
/* Square 1:1 / 4:3 */
.player-wrap--square {
    max-width: min(640px, 100%);
    max-height: min(75vh, 100vw);
}
@media (min-width: 768px) {
    .player-wrap--horizontal { max-height: min(75vh, calc(100vw * 9 / 16)); }
}

.yt-stage-resize {
    height: 10px;
    cursor: ns-resize;
    background: linear-gradient(to bottom, transparent, rgba(212,175,55,0.15));
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.yt-stage-resize::after {
    content: '';
    width: 40px; height: 4px; border-radius: 2px;
    background: rgba(255,255,255,0.25);
}
.yt-stage-resize:hover,
.yt-stage-resize.is-dragging {
    background: rgba(212,175,55,0.25);
}
.yt-stage-resize:hover::after,
.yt-stage-resize.is-dragging::after {
    background: var(--gold);
}
.player-stage--mini .yt-stage-resize { display: none; }

.yt-stage-ratio {
    position: absolute; top: 8px; right: 8px; z-index: 6;
    font-size: 11px; font-weight: 600; padding: 3px 8px;
    border-radius: 4px; background: rgba(0,0,0,0.65);
    color: rgba(255,255,255,0.85); pointer-events: none;
    opacity: 0; transition: opacity 0.25s;
}
.player-stage:hover .yt-stage-ratio,
.player-stage--mini .yt-stage-ratio { opacity: 1; }
.yt-stage-ratio[data-shape="vertical"] { color: #b388ff; }
.yt-stage-ratio[data-shape="horizontal"] { color: var(--gold-light); }

.player-loading {
    position: absolute; inset: 0; background: #000; z-index: 5;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--text-muted);
}
.player-error {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; background: #000;
    color: #fff; text-align: center; padding: 24px;
}
.player-meta {
    padding: 12px 16px 20px;
    background: linear-gradient(#0a0a0f, #000);
}
.player-meta__back {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-muted); font-size: 14px; margin-bottom: 8px;
    background: none; border: none; cursor: pointer; padding: 4px 0;
}
.player-meta__back:hover { color: var(--gold); }
.player-meta__title { font-size: 16px; font-weight: 600; line-height: 1.4; }
.player-meta__nav {
    display: flex; gap: 8px; margin: 8px 0;
    flex-wrap: wrap;
}
.player-meta__nav .btn:disabled { opacity: 0.4; pointer-events: none; }

/* Captions / CC */
.yt-captions {
    position: absolute; left: 50%; bottom: 72px; transform: translateX(-50%);
    max-width: 85%; text-align: center; z-index: 6; pointer-events: none;
    font-size: 18px; line-height: 1.35; color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.9), 0 0 8px rgba(0,0,0,0.8);
    padding: 4px 12px; border-radius: 4px;
    background: rgba(0,0,0,0.55);
    white-space: pre-wrap;
}
.yt-captions--sm { font-size: 14px; }
.yt-captions--lg { font-size: 24px; }
.player-stage--mini .yt-captions { font-size: 12px; bottom: 48px; }

/* Ambient cinema mode */
.yt-ambient {
    position: absolute; inset: 0; z-index: 0; overflow: hidden;
    pointer-events: none;
}
.yt-ambient.hidden { display: none !important; }
.yt-ambient__vid {
    width: 100%; height: 100%; object-fit: cover;
    filter: blur(48px) brightness(0.45) saturate(1.2);
    transform: scale(1.15);
}
.yt-player--ambient .yt-ambient { display: block !important; }
.yt-player--ambient .yt-player__media { z-index: 2; }

/* Stats for nerds */
.yt-stats {
    position: absolute; top: 12px; left: 12px; z-index: 8;
    background: rgba(0,0,0,0.75); padding: 10px 12px; border-radius: 6px;
    font-family: monospace; font-size: 11px; line-height: 1.6;
    min-width: 160px; pointer-events: none;
}
.yt-stats__row { display: flex; justify-content: space-between; gap: 16px; color: #ccc; }
.yt-stats__row span:last-child { color: #fff; }

.yt-btn--cc.active svg path { fill: var(--gold); }
.yt-btn--cc svg { width: 22px; height: 22px; fill: #fff; }
.yt-btn--settings svg { width: 22px; height: 22px; fill: #fff; }

.yt-menu__quality-list button { padding-left: 16px; }
.yt-menu__cc-tracks button { padding-left: 24px; }

/* YT Player shell */
.yt-player {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    background: #000;
    overflow: visible;
    user-select: none; -webkit-user-select: none;
    font-family: 'Inter', Roboto, Arial, sans-serif;
}
/* Video utama — layer di bawah overlay kontrol */
.yt-player__media {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    display: block;
    z-index: 1;
    background: #000;
    pointer-events: none;
}
.yt-player__shade { z-index: 2; }
.yt-player__loader { z-index: 9; }
.yt-captions { z-index: 4; }
.yt-player__big-play,
.yt-player__skip { z-index: 8; }
.yt-player__title { z-index: 7; }
.yt-player__controls { z-index: 10; }
.yt-stats { z-index: 11; }
.yt-mini-drag { z-index: 12; }
.yt-player--fit-auto .yt-player__media,
.yt-player--fit-contain .yt-player__media { object-fit: contain; }
.yt-player--fit-cover .yt-player__media { object-fit: cover; }

.yt-mini-drag {
    display: none;
    position: absolute; top: 0; left: 0; right: 0; z-index: 8;
    height: 28px; cursor: grab;
    align-items: center; justify-content: center;
    background: linear-gradient(rgba(0,0,0,0.7), transparent);
}
.yt-mini-drag:active { cursor: grabbing; }
.yt-mini-drag__dots {
    width: 36px; height: 4px; border-radius: 2px;
    background: rgba(255,255,255,0.45);
}

.yt-btn--theater.active,
.yt-btn--mini.active {
    color: var(--gold);
    background: rgba(212,175,55,0.15);
}

.yt-menu__section {
    padding: 8px 16px 4px; font-size: 11px;
    color: rgba(255,255,255,0.45); text-transform: uppercase;
    letter-spacing: 0.05em; pointer-events: none;
}

.yt-player__shade {
    position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(transparent 60%, rgba(0,0,0,0.75));
    opacity: 0; transition: opacity 0.25s;
}
.yt-player--show-controls .yt-player__shade,
.yt-player--paused .yt-player__shade { opacity: 1; }

.yt-player__loader {
    position: absolute; inset: 0; z-index: 4;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.35); pointer-events: none;
}
.yt-player__loader.hidden { display: none; }
.yt-spinner-lottie {
    width: 48px; height: 48px;
}
.yt-spinner:not(img):not(.loading-lottie) {
    width: 44px; height: 44px; border: 3px solid rgba(255,255,255,0.2);
    border-top-color: #fff; border-radius: 50%;
    animation: yt-spin 0.8s linear infinite;
}
@keyframes yt-spin { to { transform: rotate(360deg); } }

.yt-player__big-play {
    position: absolute; left: 50%; top: 50%; z-index: 3;
    transform: translate(-50%, -50%) scale(1);
    width: 68px; height: 48px; padding: 0;
    background: rgba(0,0,0,0.75); border: none; border-radius: 12px;
    cursor: pointer; transition: opacity 0.2s, transform 0.15s;
    display: flex; align-items: center; justify-content: center;
}
.yt-player__big-play svg { width: 36px; height: 36px; fill: #fff; }
.yt-player__big-play:hover { background: rgba(212,175,55,0.9); transform: translate(-50%, -50%) scale(1.06); }
.yt-player--playing:not(.yt-player--paused) .yt-player__big-play { opacity: 0; pointer-events: none; }

.yt-player__skip {
    position: absolute; top: 50%; z-index: 3;
    transform: translateY(-50%); padding: 12px 16px;
    background: rgba(0,0,0,0.55); border-radius: 50%;
    color: #fff; font-size: 14px; font-weight: 700;
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.yt-player__skip--back { left: 18%; }
.yt-player__skip--fwd { right: 18%; }
.yt-player__skip.visible { opacity: 1; }

.yt-player__title {
    position: absolute; top: 0; left: 0; right: 0; z-index: 2;
    padding: 12px 16px; font-size: 14px; font-weight: 500; color: #fff;
    background: linear-gradient(rgba(0,0,0,0.65), transparent);
    opacity: 0; transition: opacity 0.25s; pointer-events: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.yt-player--show-controls .yt-player__title,
.yt-player--paused .yt-player__title { opacity: 1; }

.yt-player__controls {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 10;
    padding: 0 8px 6px;
    opacity: 0; transform: translateY(6px);
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
}
.yt-player--show-controls .yt-player__controls,
.yt-player--paused .yt-player__controls {
    opacity: 1; transform: translateY(0);
    pointer-events: auto;
}

.yt-player__progress-wrap { position: relative; padding: 10px 4px 4px; }
.yt-player__progress {
    position: relative; height: 3px; background: rgba(255,255,255,0.25);
    border-radius: 2px; cursor: pointer;
    transition: height 0.15s;
}
.yt-player__progress:hover { height: 5px; }
.yt-player__buffer, .yt-player__played {
    position: absolute; top: 0; left: 0; height: 100%; border-radius: 2px;
    pointer-events: none;
}
.yt-player__buffer { background: rgba(255,255,255,0.35); width: 0; }
.yt-player__played { background: var(--gold, #ff0000); width: 0; z-index: 1; }
.yt-player__seek {
    position: absolute; inset: -8px 0; width: 100%; height: calc(100% + 16px);
    opacity: 0; cursor: pointer; z-index: 2; margin: 0;
}
.yt-player__preview {
    position: absolute; bottom: 14px; transform: translateX(-50%);
    padding: 4px 8px; background: rgba(0,0,0,0.85); color: #fff;
    font-size: 12px; border-radius: 4px; pointer-events: none;
    opacity: 0; transition: opacity 0.15s;
}
.yt-player__preview.visible { opacity: 1; }

.yt-player__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 0 4px;
    min-height: 40px;
}
.yt-player__bar-left,
.yt-player__bar-right {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
}
.yt-player__bar-right { flex-shrink: 0; }
@media (max-width: 480px) {
    .yt-btn { width: 36px; height: 36px; padding: 6px; }
    .yt-btn svg { width: 20px; height: 20px; }
    .yt-time { font-size: 11px; }
}
.yt-btn {
    flex-shrink: 0; width: 40px; height: 40px; padding: 8px;
    background: none; border: none; border-radius: 50%;
    cursor: pointer; color: #fff; display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.yt-btn:hover { background: rgba(255,255,255,0.12); }
.yt-btn svg { width: 24px; height: 24px; fill: currentColor; }
.yt-btn.hidden { display: none; }
.icon-play.hidden, .icon-pause.hidden, .icon-vol.hidden, .icon-muted.hidden,
.icon-fs-in.hidden, .icon-fs-out.hidden { display: none; }

.yt-volume { display: flex; align-items: center; gap: 0; }
.yt-volume__range {
    width: 0; opacity: 0; transition: width 0.2s, opacity 0.2s;
    accent-color: var(--gold, #ff0000); cursor: pointer;
}
.yt-volume:hover .yt-volume__range,
.yt-player--show-controls .yt-volume:focus-within .yt-volume__range {
    width: 72px; opacity: 1; margin-left: 4px;
}
@media (max-width: 640px) {
    .yt-volume__range { display: none; }
}

.yt-time {
    font-size: 12px; color: #fff; white-space: nowrap;
    font-variant-numeric: tabular-nums; margin-left: 4px;
}
.yt-spacer { flex: 1; }

.yt-btn--speed, .yt-btn--quality {
    width: auto; min-width: 36px; padding: 0 10px;
    font-size: 12px; font-weight: 600; border-radius: 4px;
}

.yt-menu { position: relative; }
.yt-menu__panel {
    position: absolute; bottom: calc(100% + 4px); right: 0;
    min-width: 100px; max-height: min(70vh, 420px);
    overflow-y: auto;
    background: rgba(28,28,28,0.98);
    border-radius: 8px; padding: 6px 0;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
    z-index: 30;
}
.yt-menu__panel--wide { min-width: 220px; max-width: 280px; }
.yt-menu__panel.hidden { display: none; }
.yt-menu__panel button {
    display: block; width: 100%; text-align: left;
    padding: 8px 16px; background: none; border: none;
    color: #fff; font-size: 13px; cursor: pointer;
}
.yt-menu__panel button:hover,
.yt-menu__panel button.active { background: rgba(255,255,255,0.1); color: var(--gold); }

.yt-player--fullscreen,
.yt-player:fullscreen {
    width: 100vw; height: 100vh;
}
.player-stage:fullscreen {
    width: 100vw; height: 100vh;
    max-width: none;
    background: #000;
}
.player-stage:fullscreen .player-wrap {
    width: 100%; height: 100%;
    max-height: none;
    aspect-ratio: unset;
}
.player-stage:fullscreen .player-wrap.is-manual-height {
    height: 100%;
}
.player-stage:fullscreen .yt-stage-resize { display: none; }
.player-stage:fullscreen video { object-fit: contain; }

/* Pre-roll Ad */
.preroll-overlay {
    position: absolute; inset: 0; z-index: 20;
    background: rgba(0,0,0,0.95);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.preroll-countdown {
    font-size: 48px; font-weight: 700; color: var(--gold);
    margin-bottom: 16px;
}
.preroll-skip {
    margin-top: 16px; padding: 8px 20px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 20px; color: var(--text-muted); font-size: 13px;
    cursor: not-allowed;
}
.preroll-skip.ready {
    cursor: pointer; border-color: var(--gold); color: var(--gold);
}

/* Ad Banner */
.ad-banner {
    margin: 12px 16px; padding: 12px;
    background: var(--surface); border: 1px dashed var(--border);
    border-radius: var(--radius); text-align: center;
    color: var(--text-dim); font-size: 12px; min-height: 60px;
    display: flex; align-items: center; justify-content: center;
}

/* ─── Search ─── */
.search-bar {
    display: flex; gap: 8px; padding: 12px 16px;
    position: sticky; top: var(--header-h); z-index: 50;
    background: var(--bg);
}
.search-hints {
    margin: 0 16px 8px; border: 1px solid var(--border);
    border-radius: var(--radius); background: var(--surface);
    overflow: hidden;
}
.search-hints.hidden { display: none; }
.search-hint-item {
    display: block; width: 100%; text-align: left; padding: 10px 14px;
    border: none; border-bottom: 1px solid var(--border);
    background: none; color: var(--text); font-size: 14px; cursor: pointer;
}
.search-hint-item:last-child { border-bottom: none; }
.search-hint-item:hover { background: var(--surface-hover); color: var(--gold); }

.search-input {
    flex: 1; padding: 12px 16px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text); font-size: 14px; outline: none;
    transition: var(--transition);
}
.search-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); }
.search-input::placeholder { color: var(--text-dim); }

/* ─── Profile ─── */
.profile-header {
    text-align: center; padding: 32px 16px;
    background: linear-gradient(180deg, var(--surface), var(--bg));
}
.profile-avatar {
    width: 80px; height: 80px; border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; margin: 0 auto 12px;
    box-shadow: 0 4px 20px var(--gold-glow);
}
.profile-name { font-size: 20px; font-weight: 700; }
.profile-vip-badge {
    display: inline-flex; align-items: center; gap: 4px;
    margin-top: 8px; padding: 4px 12px; border-radius: 12px;
    background: linear-gradient(135deg, rgba(212,175,55,0.2), rgba(245,200,66,0.1));
    border: 1px solid var(--gold); color: var(--gold); font-size: 12px; font-weight: 600;
}

.profile-menu { padding: 0 16px; }
.menu-item {
    display: flex; align-items: center; gap: 12px;
    padding: 16px; border-bottom: 1px solid var(--border);
    cursor: pointer; transition: var(--transition);
    background: none; border-left: none; border-right: none; border-top: none;
    color: var(--text); width: 100%; text-align: left; font-size: 14px;
}
.menu-item:hover { background: var(--surface); }
.menu-icon { font-size: 20px; width: 28px; text-align: center; }

/* ─── VIP Page ─── */
.vip-hero {
    text-align: center; padding: 40px 16px;
    background: linear-gradient(180deg, rgba(212,175,55,0.15), var(--bg));
}
.vip-crown { width: 72px; height: 72px; margin: 0 auto 16px; }
.vip-crown .vip-anim--lg img { width: 100%; height: 100%; object-fit: contain; }
.vip-price {
    font-size: 32px; font-weight: 700;
    background: linear-gradient(135deg, var(--gold), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.vip-benefits { padding: 24px 16px; }
.vip-benefit {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.vip-benefit-icon { color: var(--gold); font-size: 18px; }

.vip-code-form { padding: 16px; }
.vip-code-form input {
    width: 100%; padding: 14px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text); font-size: 16px; text-align: center;
    letter-spacing: 4px; text-transform: uppercase; margin-bottom: 12px;
}

/* ─── Auth Forms ─── */
.auth-form { padding: 24px 16px; max-width: 400px; margin: 0 auto; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-muted); }
.form-group input {
    width: 100%; padding: 12px 16px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text); font-size: 14px; outline: none;
}
.form-group input:focus { border-color: var(--gold); }

/* ─── Modal ─── */
.modal-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    display: flex; align-items: flex-end; justify-content: center;
}
.modal-overlay.center { align-items: center; }
.modal {
    background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%; max-width: 480px; max-height: 80dvh;
    overflow-y: auto; padding: 24px;
    animation: slideUp 0.3s ease;
}
.modal-overlay.center .modal { border-radius: var(--radius-lg); }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }

/* ─── PWA Banner ─── */
.pwa-banner {
    position: fixed; bottom: calc(var(--nav-h) + var(--safe-bottom) + 8px);
    left: 16px; right: 16px; z-index: 90;
}
.pwa-banner-content {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--gold);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    font-size: 13px;
}

/* ─── Toast ─── */
.toast {
    position: fixed; bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
    left: 50%; transform: translateX(-50%); z-index: 300;
    padding: 12px 24px; border-radius: 24px;
    background: var(--surface); border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    font-size: 14px; animation: slideUp 0.3s ease;
}

/* ─── Loading & Empty ─── */
.loading {
    display: flex; flex-direction: column; align-items: center;
    padding: 48px 16px; color: var(--text-muted);
}
.loading-img {
    width: 48px; height: 48px; object-fit: contain;
    margin-bottom: 12px;
}
.detail-meta-loading .loading { padding: 8px 0; }
.detail-meta-loading .loading-lottie { margin-bottom: 4px; }
.empty-state {
    text-align: center; padding: 48px 16px; color: var(--text-muted);
}
.empty-icon { margin-bottom: 12px; opacity: 0.85; }
.empty-icon__img { width: 64px; height: 64px; object-fit: contain; }
.ui-icon { display: inline-block; vertical-align: middle; object-fit: contain; }

/* ─── Category Chips ─── */
.category-scroll {
    display: flex; gap: 8px; padding: 0 16px 16px;
    overflow-x: auto; scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar { display: none; }
.category-chip {
    flex-shrink: 0; padding: 8px 16px; border-radius: 20px;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text-muted); font-size: 13px; cursor: pointer;
    transition: var(--transition); white-space: nowrap;
}
.category-chip.active {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    color: #0a0a0f; border-color: transparent; font-weight: 600;
}

/* ─── Animations ─── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

/* ─── Desktop Enhancements ─── */
@media (min-width: 768px) {
    .main-content { max-width: 1200px; margin: 0 auto; width: 100%; }
    .bottom-nav { max-width: 480px; left: 50%; transform: translateX(-50%); border-radius: 16px 16px 0 0; }
    .header { max-width: 100%; }
}
