:root {
  --bg: #0a0a0f; --surface: #12121a; --surface-2: #1a1a25; --border: #25252f;
  --text: #fff; --text-muted: #9ca3af; --accent: #e50914; --accent-2: #ff3d5a;
  --success: #22c55e; --gold: #f5b301; --nav-h: 68px; --top-h: 56px;
}
[data-theme="light"] {
  --bg: #f5f5f7; --surface: #fff; --surface-2: #f0f0f3;
  --border: #e0e0e5; --text: #111; --text-muted: #666;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden; overscroll-behavior-y: none; -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--text-muted); font-size: 13px; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Ambient mode */
#app.ambient { transition: background 0.8s; }

/* Topbar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; z-index: 50;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: background 0.25s;
}
.topbar.solid { background: rgba(10,10,15,0.98); border-bottom: 1px solid var(--border); }
[data-theme="light"] .topbar { background: rgba(245,245,247,0.85); }
[data-theme="light"] .topbar.solid { background: rgba(245,245,247,0.98); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-weight: 900; font-size: 16px; color: white;
  box-shadow: 0 4px 14px rgba(229,9,20,0.4);
}
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -0.3px; }
.brand-name span { color: var(--accent); }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; position: relative; display: grid; place-items: center; background: rgba(255,255,255,0.06); border: 1px solid var(--border); transition: transform 0.15s; }
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 18px; height: 18px; }
.notif-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }

#app { min-height: 100vh; padding-top: var(--top-h); padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); }
.page { display: none; animation: pageIn 0.28s ease-out; }
.page.active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.page-header { padding: 20px 16px 8px; }
.page-header h1 { margin: 0; font-size: 26px; font-weight: 800; }
.page-header .muted { margin: 4px 0 0; }

/* Bottom Nav */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex; justify-content: space-around; align-items: center;
  background: #0a0a0f; border-top: 1px solid var(--border); z-index: 60;
}
[data-theme="light"] .bottom-nav { background: #fff; }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 8px 0; color: var(--text-muted); font-size: 10px; font-weight: 500; transition: color 0.2s; position: relative; }
.nav-item svg { width: 22px; height: 22px; transition: transform 0.2s; }
.nav-item.active { color: var(--accent); }
.nav-item.active svg { transform: scale(1.08); }
.nav-item.active::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 28px; height: 2px; border-radius: 2px; background: var(--accent); }

/* Hero */
.hero { position: relative; height: 62vh; min-height: 380px; max-height: 620px; overflow: hidden; margin-bottom: 8px; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.8s; background-size: cover; background-position: center; }
.hero-slide.active { opacity: 1; }
.hero-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg) 0%, rgba(10,10,15,0.7) 30%, rgba(10,10,15,0.2) 60%, rgba(10,10,15,0.5) 100%); }
.hero-content { position: absolute; bottom: 24px; left: 0; right: 0; padding: 0 20px; z-index: 2; }
.hero-title { font-size: 30px; font-weight: 900; line-height: 1.05; margin: 0 0 8px; letter-spacing: -0.5px; text-shadow: 0 2px 20px rgba(0,0,0,0.6); }
.hero-meta { display: flex; gap: 10px; align-items: center; font-size: 12px; color: #ddd; margin-bottom: 12px; flex-wrap: wrap; }
.hero-meta .rating { color: #ffd60a; font-weight: 700; }
.hero-actions { display: flex; gap: 10px; }
.hero-btn { flex: 1; max-width: 200px; padding: 12px 20px; border-radius: 12px; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.hero-btn:active { transform: scale(0.96); }
.hero-btn.primary { background: white; color: black; }
.hero-btn.secondary { background: rgba(255,255,255,0.16); color: white; border: 1px solid rgba(255,255,255,0.18); }
.hero-btn svg { width: 18px; height: 18px; }
.hero-dots { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 3; }
.hero-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.35); transition: all 0.3s; }
.hero-dot.active { width: 20px; border-radius: 4px; background: var(--accent); }

/* Rows */
.rows-container { padding-bottom: 20px; }
.row-section { margin: 22px 0; }
.row-header { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 12px; }
.row-title { font-size: 17px; font-weight: 800; margin: 0; }
.row-scroll { display: flex; gap: 12px; overflow-x: auto; padding: 4px 16px 8px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }

/* Cards */
.movie-card { flex: 0 0 130px; scroll-snap-align: start; transition: transform 0.15s; cursor: pointer; }
.movie-card:active { transform: scale(0.95); }
.movie-card .poster { position: relative; width: 100%; aspect-ratio: 2/3; border-radius: 12px; overflow: hidden; background: var(--surface-2); box-shadow: 0 4px 14px rgba(0,0,0,0.35); }
.movie-card .poster img { width: 100%; height: 100%; object-fit: cover; }
.movie-card .rating-badge { position: absolute; top: 6px; right: 6px; padding: 3px 7px; background: rgba(0,0,0,0.75); border-radius: 6px; font-size: 10px; font-weight: 700; color: #ffd60a; }
.movie-card .rating-badge::before { content: "★ "; font-size: 9px; }
.movie-card .kids-badge { position: absolute; top: 6px; left: 6px; padding: 3px 7px; background: var(--success); border-radius: 6px; font-size: 9px; font-weight: 800; color: #000; }
.movie-card .card-title { margin: 8px 2px 2px; font-size: 12px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.movie-card .card-sub { font-size: 10px; color: var(--text-muted); margin: 0 2px; }
.movie-card.wide { flex: 0 0 240px; }
.movie-card.wide .poster { aspect-ratio: 16/9; }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.6s infinite; border-radius: 12px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel-card { flex: 0 0 130px; }
.skel-card .skel-poster { width: 100%; aspect-ratio: 2/3; }
.skel-card .skel-line { height: 10px; margin-top: 8px; border-radius: 4px; }
.skel-hero { width: 100%; height: 62vh; border-radius: 0; }

/* Search */
.search-header { padding: 12px 16px 8px; }
.search-box { position: relative; display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 0 12px; }
.search-box:focus-within { border-color: var(--accent); }
.search-icon { width: 18px; height: 18px; color: var(--text-muted); }
.search-box input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 15px; padding: 13px 10px; }
.search-box input::placeholder { color: var(--text-muted); }
.mic-btn { width: 30px; height: 30px; border-radius: 50%; background: rgba(128,128,128,0.15); font-size: 14px; display: grid; place-items: center; margin-right: 4px; }
.mic-btn.listening { background: var(--accent); color: white; animation: pulse 1s infinite; }
.clear-btn { width: 24px; height: 24px; border-radius: 50%; background: rgba(128,128,128,0.2); font-size: 16px; display: none; place-items: center; }
.clear-btn.show { display: grid; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
.search-tabs { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.search-tabs::-webkit-scrollbar { display: none; }
.stab { flex-shrink: 0; padding: 7px 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); font-size: 12px; font-weight: 600; }
.stab.active { background: var(--accent); border-color: var(--accent); color: white; }
.filter-btn { flex-shrink: 0; padding: 7px 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 12px; font-weight: 600; margin-left: auto; }
.active-filters { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.chip-filter { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 12px; background: rgba(229,9,20,0.15); border: 1px solid var(--accent); color: var(--accent); font-size: 11px; font-weight: 600; }

/* Search history */
.search-history { padding: 12px 16px; }
.search-history h4 { font-size: 12px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px; margin: 0 0 10px; font-weight: 700; display: flex; justify-content: space-between; }
.search-history h4 button { color: var(--accent); font-weight: 700; font-size: 11px; }
.history-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.history-chip { padding: 7px 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; display: flex; gap: 6px; align-items: center; }

.search-results { padding: 8px 16px 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-2 .movie-card { flex: initial; }
.search-hint { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.search-hint h3 { color: var(--text); margin: 16px 0 6px; }

/* Library tabs */
.lib-tabs { display: flex; gap: 6px; padding: 0 16px 12px; overflow-x: auto; scrollbar-width: none; }
.lib-tabs::-webkit-scrollbar { display: none; }
.lib-tab { flex-shrink: 0; padding: 8px 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); font-size: 13px; font-weight: 600; }
.lib-tab.active { background: var(--accent); border-color: var(--accent); color: white; }

/* Profile */
.profile-hero { text-align: center; padding: 30px 20px 20px; }
.avatar { width: 96px; height: 96px; margin: 0 auto 14px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; font-size: 38px; font-weight: 900; color: white; box-shadow: 0 8px 32px rgba(229,9,20,0.4); position: relative; }
.avatar.premium::after { content: "👑"; position: absolute; bottom: -4px; right: -4px; font-size: 24px; }
.profile-hero h2 { margin: 0 0 4px; font-size: 22px; font-weight: 800; }
.profile-hero .muted { margin: 0 0 12px; }
.profile-badge-row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.profile-badge { padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.profile-badge.role-admin { background: var(--accent); color: white; }
.profile-badge.role-mod { background: #3b82f6; color: white; }
.profile-badge.premium { background: linear-gradient(135deg, var(--gold), #ff8f00); color: #000; }
.profile-badge.member { background: var(--surface-2); color: var(--text-muted); }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 16px; margin-bottom: 20px; }
.profile-stat { padding: 12px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; text-align: center; }
.profile-stat .ps-val { font-size: 20px; font-weight: 900; }
.profile-stat .ps-lbl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; margin-top: 2px; }

.btn-primary { padding: 12px 32px; border-radius: 12px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: white; font-weight: 700; font-size: 14px; box-shadow: 0 6px 20px rgba(229,9,20,0.35); }
.btn-primary:active { transform: scale(0.96); }
.btn-primary:disabled { opacity: 0.5; }
.btn-secondary { padding: 12px 24px; border-radius: 12px; background: rgba(128,128,128,0.12); border: 1px solid var(--border); color: var(--text); font-weight: 700; font-size: 14px; }
.btn-secondary:active { transform: scale(0.96); }
.btn-google { width: 100%; padding: 12px; border-radius: 12px; background: white; color: #111; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 14px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 11px; margin: 14px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-row { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; font-size: 12px; }
.auth-row button { color: var(--accent); font-weight: 700; font-size: 12px; }

.profile-menu { padding: 8px 16px 20px; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px 14px; border-bottom: 1px solid var(--border); font-size: 15px; text-align: left; }
.menu-item span:first-child { font-size: 18px; }

/* Premium */
.premium-hero { text-align: center; padding: 30px 20px 20px; }
.premium-hero h2 { font-size: 26px; font-weight: 900; margin: 0 0 6px; background: linear-gradient(135deg, var(--gold), #ff8f00); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.plan-card { padding: 22px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; margin-bottom: 14px; position: relative; }
.plan-card.featured { border: 2px solid var(--gold); box-shadow: 0 8px 32px rgba(245,179,1,0.2); }
.plan-card.current { border-color: var(--success); }
.plan-badge { position: absolute; top: -10px; right: 16px; padding: 4px 12px; background: linear-gradient(135deg, var(--gold), #ff8f00); color: #000; font-size: 10px; font-weight: 900; border-radius: 20px; text-transform: uppercase; }
.plan-badge.current-badge { background: var(--success); color: white; }
.plan-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.plan-head .plan-name { font-size: 20px; font-weight: 900; }
.plan-head .plan-price { font-size: 26px; font-weight: 900; }
.plan-head .plan-price small { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.plan-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.plan-features { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.plan-feature { display: flex; gap: 10px; font-size: 13px; align-items: center; }
.plan-feature::before { content: "✓"; color: var(--success); font-weight: 900; }
.plan-cta { width: 100%; padding: 14px; border-radius: 12px; font-weight: 800; font-size: 14px; }
.plan-cta.primary { background: linear-gradient(135deg, var(--gold), #ff8f00); color: #000; }
.plan-cta.secondary { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }

/* Checkout */
.checkout-plan { display: flex; justify-content: space-between; align-items: center; padding: 14px; background: var(--surface-2); border-radius: 12px; margin-bottom: 16px; }
.checkout-plan .plan-price { font-size: 22px; font-weight: 900; color: var(--gold); }
.pay-step { margin-bottom: 16px; }
.pay-label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-bottom: 8px; }
.upi-box { display: flex; gap: 12px; padding: 14px; background: var(--surface-2); border-radius: 12px; align-items: center; }
.upi-qr { width: 100px; height: 100px; border-radius: 8px; background: white; padding: 6px; flex-shrink: 0; }
.upi-qr img { width: 100%; height: 100%; }
.upi-info .upi-id { font-size: 13px; font-weight: 800; word-break: break-all; margin-bottom: 8px; padding: 8px; background: var(--bg); border-radius: 8px; text-align: center; }

/* Empty */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.35; }
.empty-state h3 { margin: 8px 0 4px; }

/* Modals */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.22s; }
.modal.open { opacity: 1; pointer-events: auto; }
.modal-content { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto; background: var(--bg); border-radius: 24px 24px 0 0; transform: translateY(100%); transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); padding-bottom: env(safe-area-inset-bottom, 0px); }
.modal.open .modal-content { transform: translateY(0); }
.modal-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; background: rgba(0,0,0,0.7); display: grid; place-items: center; font-size: 22px; color: white; z-index: 5; }
.modal.popup-dialog { display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal.popup-dialog .modal-content { position: relative; left: auto; right: auto; bottom: auto; max-width: 420px; width: 100%; max-height: 88vh; border-radius: 22px; padding: 24px; transform: scale(0.85); opacity: 0; transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s; }
.modal.popup-dialog.open .modal-content { transform: scale(1); opacity: 1; }
.dialog-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; background: rgba(128,128,128,0.2); display: grid; place-items: center; font-size: 18px; }
.dialog-badge { display: inline-block; padding: 3px 10px; background: rgba(245,179,1,0.15); border: 1px solid var(--gold); color: var(--gold); font-size: 10px; font-weight: 800; text-transform: uppercase; border-radius: 20px; margin-bottom: 12px; }

/* Detail */
.detail-backdrop { position: relative; width: 100%; aspect-ratio: 16/9; background-size: cover; background-position: center; }
.detail-backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg), rgba(10,10,15,0.2) 60%, rgba(10,10,15,0.4)); }
.detail-body { padding: 0 20px 30px; margin-top: -40px; position: relative; z-index: 2; }
.detail-title { font-size: 24px; font-weight: 900; margin: 0 0 8px; }
.detail-meta { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--text-muted); margin-bottom: 14px; flex-wrap: wrap; }
.detail-meta .chip { padding: 3px 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; font-size: 11px; }
.detail-meta .rating { color: #ffd60a; font-weight: 800; }
.detail-actions { display: flex; gap: 8px; margin-bottom: 18px; }
.detail-actions button { padding: 12px; border-radius: 12px; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.detail-actions .play { flex: 1; background: white; color: black; }
.detail-actions .icon-action { width: 44px; padding: 0; background: rgba(128,128,128,0.12); border: 1px solid var(--border); color: var(--text); }
.detail-actions .icon-action.active { background: var(--accent); border-color: var(--accent); color: white; }
.detail-actions .icon-action svg { width: 20px; height: 20px; }
.detail-overview { font-size: 14px; line-height: 1.65; color: var(--text-muted); margin: 0 0 18px; }
.detail-section-title { font-size: 15px; font-weight: 800; margin: 22px 0 12px; }

/* TV */
.tv-picker { margin-bottom: 18px; }
.season-select { width: 100%; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-size: 14px; margin-bottom: 12px; }
.episode-grid { display: flex; flex-direction: column; gap: 8px; }
.ep-card { display: flex; gap: 10px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.ep-card.current { border-color: var(--accent); background: rgba(229,9,20,0.08); }
.ep-card .ep-thumb { width: 100px; height: 56px; border-radius: 6px; background: var(--surface-2); object-fit: cover; flex-shrink: 0; }
.ep-card .ep-info { flex: 1; min-width: 0; }
.ep-card .ep-info b { display: block; font-size: 12px; margin-bottom: 3px; }
.ep-card .ep-info small { font-size: 11px; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Servers */
.server-pick { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.server-pick .srv-icon { width: 36px; height: 36px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; flex-shrink: 0; font-size: 16px; color: white; }
.server-pick.auto .srv-icon { background: linear-gradient(135deg, #3b82f6, #8b5cf6); }
.server-pick.premium .srv-icon { background: linear-gradient(135deg, var(--gold), #ff8f00); color: #000; }
.server-pick .srv-meta { flex: 1; }
.server-pick .srv-meta b { display: block; font-size: 13px; }
.server-pick .srv-meta small { color: var(--text-muted); font-size: 11px; }
.srv-lock { padding: 2px 6px; background: var(--gold); color: #000; font-size: 9px; font-weight: 800; border-radius: 4px; margin-left: 6px; }

/* Comments */
.comment-card { padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; }
.comment-card.reply { margin-left: 24px; background: var(--surface-2); }
.comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.comment-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; font-weight: 800; font-size: 13px; color: white; }
.comment-name { font-size: 13px; font-weight: 700; }
.comment-time { font-size: 10px; color: var(--text-muted); margin-left: auto; }
.comment-text { font-size: 13px; line-height: 1.55; color: var(--text); margin-bottom: 6px; }
.comment-actions { display: flex; gap: 12px; font-size: 11px; }
.comment-actions button { color: var(--text-muted); font-weight: 600; }
.comment-actions button.liked { color: var(--accent); }

/* Feed */
.feed-item { display: flex; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; }
.feed-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; font-weight: 800; color: white; flex-shrink: 0; }
.feed-body { flex: 1; min-width: 0; }
.feed-text { font-size: 13px; margin-bottom: 4px; }
.feed-text b { font-weight: 700; }
.feed-time { font-size: 10px; color: var(--text-muted); }
.feed-poster { width: 50px; height: 75px; border-radius: 8px; object-fit: cover; margin-top: 8px; cursor: pointer; }

/* Reviews */
.review-card { padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; }
.review-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.review-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; font-weight: 800; font-size: 14px; color: white; }
.review-name { font-size: 13px; font-weight: 700; }
.review-stars { font-size: 11px; color: #ffd60a; }
.review-text { font-size: 13px; line-height: 1.55; color: var(--text-muted); }
.star-row { display: flex; gap: 6px; justify-content: center; margin: 10px 0; flex-wrap: wrap; }
.star-row .star { font-size: 30px; cursor: pointer; color: #444; }
.star-row .star.on { color: #ffd60a; }

/* Person */
.person-head { display: flex; gap: 14px; padding: 20px; align-items: center; }
.person-head img { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; }
.person-head .info h2 { margin: 0 0 4px; font-size: 20px; }
.person-head .info p { margin: 0; font-size: 12px; color: var(--text-muted); }
.person-bio { padding: 0 20px 20px; font-size: 13px; line-height: 1.6; color: var(--text-muted); }
.person-card { flex: 0 0 110px; text-align: center; cursor: pointer; }
.person-card .pc-avatar { width: 110px; height: 110px; border-radius: 50%; overflow: hidden; background: var(--surface-2); margin-bottom: 8px; display: grid; place-items: center; font-size: 30px; }
.person-card .pc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.person-card .pc-name { font-size: 12px; font-weight: 600; }
.person-card .pc-role { font-size: 10px; color: var(--text-muted); }

/* Filter sheet */
.filter-sheet { max-height: 90vh; display: flex; flex-direction: column; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 12px; }
.sheet-head h2 { margin: 0; font-size: 20px; font-weight: 800; }
.sheet-head .modal-close { position: static; }
.filter-body { padding: 0 20px; overflow-y: auto; flex: 1; }
.sheet-foot { display: flex; gap: 10px; padding: 16px 20px 24px; border-top: 1px solid var(--border); }
.sheet-foot button { flex: 1; }
.genre-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.genre-chip { padding: 7px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; font-weight: 600; }
.genre-chip.on { background: var(--accent); border-color: var(--accent); color: white; }

/* Player */
.player-modal { background: rgba(0,0,0,0.98); display: flex; align-items: center; justify-content: center; }
.player-wrap { width: 100%; aspect-ratio: 16/9; background: black; position: relative; }
.player-wrap iframe { width: 100%; height: 100%; border: 0; }
.player-close { position: absolute; top: 20px; right: 20px; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,0.15); color: white; font-size: 24px; z-index: 10; }
.player-controls { position: absolute; bottom: 20px; left: 20px; right: 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; z-index: 10; }
.pc-title { color: white; font-size: 13px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-buttons { display: flex; gap: 6px; }
.pc-btn { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.15); color: white; font-size: 16px; display: grid; place-items: center; }
.player-server-list { position: absolute; bottom: 70px; right: 20px; background: rgba(20,20,30,0.98); border: 1px solid var(--border); border-radius: 12px; padding: 8px; max-width: 280px; z-index: 11; }
.player-server-list button { display: block; width: 100%; padding: 8px 12px; text-align: left; font-size: 12px; color: white; border-radius: 6px; white-space: nowrap; }
.player-server-list button.active { background: var(--accent); }
.sleep-timer-panel { position: absolute; bottom: 70px; right: 20px; background: rgba(20,20,30,0.98); border: 1px solid var(--border); border-radius: 12px; padding: 8px; display: flex; gap: 6px; z-index: 11; }
.sleep-timer-panel button { padding: 8px 12px; font-size: 12px; color: white; border-radius: 6px; background: rgba(255,255,255,0.1); }
.preroll { position: absolute; inset: 0; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 5; }
.preroll #prerollContent { flex: 1; display: grid; place-items: center; width: 100%; padding: 20px; }
.preroll-info { position: absolute; bottom: 16px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: center; }
.preroll-skip { padding: 8px 16px; background: white; color: black; border-radius: 20px; font-size: 12px; font-weight: 700; }

#videoAdModal { background: rgba(0,0,0,0.98); }
.player-modal-inner { position: absolute; inset: 0; display: flex; flex-direction: column; }
.video-ad-wrap { flex: 1; display: grid; place-items: center; padding: 20px; }
.video-ad-info { padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; }

/* Share */
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 20px 0; }
.share-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 11px; }
.share-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: white; font-weight: 900; font-size: 18px; }

/* Notifications */
.notif-content { max-height: 80vh; display: flex; flex-direction: column; }
.notif-list { flex: 1; overflow-y: auto; padding: 0 16px; }
.notif-item { padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
.notif-item.unread { border-color: var(--accent); }
.notif-item .n-title { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.notif-item .n-msg { font-size: 12px; color: var(--text-muted); }
.notif-item .n-time { font-size: 10px; color: var(--text-muted); margin-top: 4px; }

/* Auth */
.auth-modal-content { max-width: 480px; margin: 0 auto; border-radius: 24px 24px 0 0; }
.auth-box { padding: 40px 28px 32px; text-align: center; }
.auth-box h2 { margin: 0 0 6px; font-size: 22px; }
.auth-box .muted { margin-bottom: 22px; }
.form-group { text-align: left; margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 13px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-size: 14px; outline: none; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--accent); }
.auth-submit { width: 100%; margin-top: 8px; padding: 14px; font-size: 15px; }
.auth-logo { width: 56px; height: 56px; font-size: 26px; margin: 0 auto 16px; }

/* Admin */
.admin-tabs { display: flex; gap: 6px; padding: 0 16px 12px; overflow-x: auto; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab { flex-shrink: 0; padding: 8px 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); font-size: 13px; font-weight: 600; }
.admin-tab.active { background: var(--accent); border-color: var(--accent); color: white; }
.admin-content { padding: 0 16px 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card { padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.stat-card .stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.stat-card .stat-value { font-size: 26px; font-weight: 900; }
.admin-form-card { padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 16px; }
.admin-form-card h3 { margin: 0 0 14px; font-size: 15px; font-weight: 800; }
.admin-form-card .form-group { margin-bottom: 10px; }
.admin-form-card .form-group label { display: block; font-size: 11px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; text-transform: uppercase; }
.admin-form-card .form-group input, .admin-form-card .form-group select, .admin-form-card .form-group textarea { width: 100%; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 13px; outline: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.srv-preview { display: flex; gap: 10px; padding: 10px; background: var(--surface-2); border-radius: 10px; margin: 8px 0; }
.srv-preview img { width: 44px; height: 66px; border-radius: 6px; object-fit: cover; }
.srv-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; }
.srv-item .srv-info { flex: 1; min-width: 0; }
.srv-item .srv-info b { display: block; font-size: 13px; margin-bottom: 3px; }
.srv-item .srv-info small { color: var(--text-muted); font-size: 11px; }
.srv-item .srv-tags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.srv-item .srv-del { width: 30px; height: 30px; border-radius: 8px; background: rgba(229,9,20,0.15); border: 1px solid var(--accent); color: #ff6b74; font-size: 16px; flex-shrink: 0; }
.admin-item { padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; }
.admin-item .item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 10px; }
.admin-item .item-title { font-weight: 700; font-size: 14px; }
.admin-item .item-meta { font-size: 12px; color: var(--text-muted); }
.admin-item .item-body { font-size: 13px; color: var(--text-muted); margin-top: 6px; word-break: break-word; }
.admin-item .item-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.chip-badge { display: inline-block; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.chip-badge.admin { background: var(--accent); color: white; }
.chip-badge.mod { background: #3b82f6; color: white; }
.chip-badge.pending { background: #f59e0b; color: black; }
.chip-badge.resolved { background: var(--success); color: black; }
.chip-badge.approved { background: var(--success); color: black; }
.chip-badge.rejected { background: #ef4444; color: white; }
.chip-badge.premium { background: var(--gold); color: black; }
.chip-badge.dead { background: #ef4444; color: white; }
.btn-sm { padding: 7px 14px; border-radius: 8px; font-size: 12px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.btn-sm.danger { background: rgba(229,9,20,0.15); border-color: var(--accent); color: #ff6b74; }
.btn-sm.success { background: rgba(34,197,94,0.15); border-color: var(--success); color: var(--success); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; }
.toggle-row .toggle-label { font-size: 14px; font-weight: 600; }
.toggle-row .toggle-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.toggle { position: relative; width: 46px; height: 26px; flex-shrink: 0; background: var(--surface-2); border-radius: 13px; border: 1px solid var(--border); cursor: pointer; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #666; transition: all 0.25s; }
.toggle.on { background: var(--accent); border-color: var(--accent); }
.toggle.on::after { left: 22px; background: white; }

/* Chart */
.chart-wrap { padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 16px; }
.chart-wrap h4 { margin: 0 0 12px; font-size: 14px; font-weight: 800; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.bar { flex: 1; background: linear-gradient(180deg, var(--accent), var(--accent-2)); border-radius: 4px 4px 0 0; min-height: 4px; position: relative; }
.bar:hover::after { content: attr(data-v); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--surface-2); padding: 2px 6px; border-radius: 4px; font-size: 10px; white-space: nowrap; }

/* Library */
.lib-card { display: flex; align-items: center; justify-content: space-between; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; cursor: pointer; }
.lib-card .lc-info { flex: 1; }
.lib-card .lc-info b { display: block; font-size: 14px; margin-bottom: 3px; }
.lib-card .lc-info small { font-size: 11px; color: var(--text-muted); }
.at-list { max-height: 300px; overflow-y: auto; margin-bottom: 10px; }
.at-list .at-item { padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 6px; cursor: pointer; }

/* Downloads */
.dl-item { display: flex; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; }
.dl-item .dl-poster { width: 60px; height: 90px; border-radius: 8px; object-fit: cover; background: var(--surface-2); flex-shrink: 0; }
.dl-item .dl-info { flex: 1; }
.dl-item .dl-info b { display: block; font-size: 13px; margin-bottom: 4px; }
.dl-item .dl-info small { font-size: 11px; color: var(--text-muted); }
.dl-item .dl-actions { display: flex; gap: 6px; margin-top: 8px; }

/* Profile grid */
.profile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.profile-tile { text-align: center; cursor: pointer; padding: 8px; border-radius: 12px; transition: transform 0.15s; }
.profile-tile:active { transform: scale(0.94); }
.profile-tile .tile-avatar { width: 72px; height: 72px; margin: 0 auto 8px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; font-weight: 900; color: white; }
.profile-tile .tile-name { font-size: 12px; font-weight: 600; }
.profile-tile .tile-edit { position: absolute; bottom: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,0.7); color: white; font-size: 12px; display: grid; place-items: center; }

.color-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-dot { width: 32px; height: 32px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; }
.color-dot.on { border-color: white; box-shadow: 0 0 0 2px var(--accent); }

/* Toast */
.toast { position: fixed; bottom: calc(var(--nav-h) + 20px); left: 50%; transform: translateX(-50%) translateY(20px); background: rgba(30,30,45,0.98); color: white; padding: 12px 20px; border-radius: 12px; font-size: 13px; font-weight: 600; border: 1px solid var(--border); box-shadow: 0 8px 30px rgba(0,0,0,0.5); opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s; z-index: 200; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
[data-theme="light"] .toast { background: rgba(255,255,255,0.98); color: black; border-color: #ddd; }

/* Banner ad */
.banner-ad { margin: 12px 16px; border-radius: 14px; overflow: hidden; position: relative; }
.banner-ad img { width: 100%; display: block; }
.banner-ad .ad-label { position: absolute; top: 8px; left: 8px; padding: 2px 8px; background: rgba(0,0,0,0.7); color: white; font-size: 9px; font-weight: 700; text-transform: uppercase; border-radius: 4px; }
.banner-ad .ad-close { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,0.7); color: white; font-size: 14px; display: grid; place-items: center; }

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

/* Confetti canvas */
#confetti-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 999; }

/* 3D tilt on detail poster */
.tilt { transition: transform 0.2s; }

@media (min-width: 768px) {
  .bottom-nav { max-width: 640px; left: 50%; transform: translateX(-50%); border-radius: 16px 16px 0 0; }
  #app, .topbar { max-width: 640px; left: 50%; transform: translateX(-50%); }
  .topbar { width: 100%; }
  .grid-2 { grid-template-columns: repeat(3, 1fr); }
}