@font-face { font-family: Yantramanav; src: url(/fonts/yantramanav_regular.ttf); font-weight: 400; font-display: swap; }
@font-face { font-family: Yantramanav; src: url(/fonts/yantramanav_medium.ttf); font-weight: 500; font-display: swap; }
@font-face { font-family: Yantramanav; src: url(/fonts/yantramanav_bold.ttf); font-weight: 700; font-display: swap; }

:root {
  --bg: #000; --surface: #0f0f0f; --surface2: #1a1a1a; --surface3: #262626; --line: rgba(255,255,255,.08);
  --text: #fff; --dim: rgba(255,255,255,.6); --faint: rgba(255,255,255,.4);
  --accent: #a500ff; --accent-soft: #c86bff; --featured: #ff9000; --star: #ffc107;
  --top: env(safe-area-inset-top, 0px); --bottom: env(safe-area-inset-bottom, 0px);
  --tabs: calc(58px + var(--bottom));
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); color-scheme: dark; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 14px/20px Yantramanav, -apple-system, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; }
svg.i { width: 22px; height: 22px; flex: none; }
#app { min-height: 100vh; padding-bottom: calc(var(--tabs) + 24px); }

/* ---------- bottom tabs */
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex;
  background: rgba(10,10,10,.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 2px 0 var(--bottom); border-top: 1px solid var(--line);
}
#tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px 0 6px; color: var(--faint); }
#tabs a svg { width: 22px; height: 22px; }
#tabs a span { font-size: 10.5px; font-weight: 700; letter-spacing: .5px; margin-top: 3px; white-space: nowrap; }
#tabs a i { width: 16px; height: 2px; margin-top: 3px; background: transparent; }
#tabs a.on { color: #fff; }
#tabs a.on i { background: var(--accent); }
body.playing #tabs { display: none; }

/* ---------- common */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px;
  padding: calc(var(--top) + 6px) 6px 6px; background: rgba(0,0,0,.92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.topbar h1 { flex: 1; margin: 0 6px; font-size: 20px; line-height: 24px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .pad { width: 10px; }
.ib { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 50%; flex: none; }
.ib:active { background: rgba(255,255,255,.1); }
.logo { height: 26px; width: auto; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: 6px; background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 700; line-height: 20px; white-space: nowrap;
}
.btn.alt { background: var(--surface3); }
.btn svg { width: 18px; height: 18px; }
.btn:active { opacity: .8; }
.btn.block { width: 100%; }
.meta { display: flex; align-items: center; flex-wrap: wrap; font-size: 14px; font-weight: 500; color: var(--dim); line-height: 18px; }
.meta .dot { color: var(--faint); margin: 0 6px; }
.meta .rate { color: #fff; display: inline-flex; align-items: center; gap: 4px; }
.meta .rate svg { width: 15px; height: 15px; color: var(--star); }
.sh { display: flex; align-items: center; padding: 20px 8px 8px 16px; }
.sh h2 { flex: 1; margin: 0; font-size: 17px; line-height: 21px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh a { color: var(--accent-soft); font-size: 14px; font-weight: 500; padding: 4px 8px; }
.row { display: flex; gap: 8px; overflow-x: auto; padding: 6px 24px 6px 16px; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.row::-webkit-scrollbar { display: none; }
.row > * { scroll-snap-align: start; flex: none; }
.poster { position: relative; background: var(--surface2); border-radius: 6px; overflow: hidden; }
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster .seen { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--accent); }
.badge {
  position: absolute; top: 5px; left: 5px; background: var(--accent); color: #fff; border-radius: 3px;
  padding: 2px 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .5px; line-height: 14px;
}
.card { display: block; width: 120px; }
.card .poster { aspect-ratio: 2/3; }
.card.wide { width: 220px; }
.card.wide .poster { aspect-ratio: 16/9; }
.card b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 400; font-size: 14px; line-height: 20px; margin-top: 8px; }
.card.wide b { -webkit-line-clamp: 1; margin-top: 6px; }
.card small { display: block; color: var(--faint); font-size: 12.5px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card:active .poster { opacity: .75; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px 8px; padding: 8px 12px; }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.grid .card { width: auto; }
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px 24px; min-height: 50vh; color: var(--dim); font-size: 16px; line-height: 23px; gap: 14px; }
.spin { width: 36px; height: 36px; border-radius: 50%; border: 3px solid rgba(165,0,255,.25); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.spin.small { width: 24px; height: 24px; margin: 18px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; padding: 4px 0 0; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 50px;
  background: var(--surface2); border: 1px solid var(--line); color: var(--dim); font-size: 14px; font-weight: 500; white-space: nowrap;
}
.chip svg { width: 14px; height: 14px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- home */
.hero { position: relative; height: 480px; overflow: hidden; background: var(--surface); }
.hero-pages { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hero-pages::-webkit-scrollbar { display: none; }
.hero-page { flex: none; width: 100%; height: 100%; scroll-snap-align: start; position: relative; }
.hero-page img { width: 100%; height: 100%; object-fit: cover; }
.hero-page::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 0%, rgba(0,0,0,.13) 45%, #000 100%); }
.hero-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 24px 12px; display: flex; flex-direction: column; align-items: center; text-align: center; pointer-events: none; }
.hero-info > * { pointer-events: auto; }
.hero-info h2 { margin: 0; font-size: 26px; line-height: 30px; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-info .meta { justify-content: center; margin-top: 6px; }
.hero-btns { display: flex; gap: 10px; margin-top: 14px; }
.hero-btns .btn { width: 150px; }
.dots { display: flex; gap: 6px; margin-top: 12px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.33); }
.dots i.on { background: #fff; }
.home-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center;
  padding: calc(var(--top) + 8px) 4px 16px 16px; background: linear-gradient(rgba(0,0,0,.67), transparent);
}
.home-top .logo { margin-right: auto; }
.explore { display: flex; justify-content: space-evenly; padding: 0 8px; }
.ia { display: flex; flex-direction: column; align-items: center; padding: 6px 10px; border-radius: 8px; color: #fff; }
.ia span { margin-top: 4px; font-size: 12px; font-weight: 700; letter-spacing: .3px; color: var(--dim); }
.ia:active { background: rgba(255,255,255,.08); }

/* ---------- support box */
.support { margin: 12px 16px 0; padding: 12px 14px; background: #15121a; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; }
.support .head { display: flex; align-items: center; gap: 7px; }
.support .head svg { width: 14px; height: 14px; color: var(--accent-soft); }
.support .head b { flex: 1; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.support .head small { font-size: 10.5px; font-weight: 700; color: var(--faint); letter-spacing: .5px; }
.support .head strong { font-size: 14px; color: var(--accent-soft); }
.support .bar { height: 4px; border-radius: 4px; background: rgba(255,255,255,.15); margin-top: 8px; overflow: hidden; }
.support .bar i { display: block; height: 100%; background: var(--accent-soft); }
.support p { margin: 8px 0 0; color: var(--dim); font-size: 12.5px; line-height: 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.support p.open { -webkit-line-clamp: unset; display: block; }
.support .foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.support .foot small { flex: 1; color: var(--faint); font-size: 10.5px; font-weight: 700; letter-spacing: .3px; }
.support .give { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 6px; background: rgba(255,255,255,.2); font-weight: 700; font-size: 14px; }
.support .give svg { width: 15px; height: 15px; }

/* ---------- detail */
.backdrop { position: relative; aspect-ratio: 16/11; background: var(--surface); }
.backdrop img { width: 100%; height: 100%; object-fit: cover; }
.backdrop::after { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.53) 0%, transparent 30%, #000 100%); }
.backdrop .ib { position: absolute; z-index: 2; top: calc(var(--top) + 4px); left: 4px; }
.info { padding: 0 16px; }
.info h1 { margin: 0; font-size: 22px; line-height: 26px; font-weight: 700; }
.info .meta { margin-top: 6px; }
.info .btn.block { margin-top: 14px; }
.syn { margin-top: 8px; color: var(--dim); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.syn.open { -webkit-line-clamp: unset; display: block; }
.genres { margin-top: 6px; color: var(--faint); font-size: 12.5px; line-height: 16px; }
.notice { color: var(--featured); margin-top: 8px; }
.actions { display: flex; margin-top: 10px; }
.hr { height: 1px; background: var(--line); margin-top: 12px; }
.tabsrow { display: flex; overflow-x: auto; padding: 8px; scrollbar-width: none; }
.tabsrow::-webkit-scrollbar { display: none; }
.tab { flex: none; display: flex; flex-direction: column; align-items: center; padding: 6px 12px; font-size: 14px; font-weight: 500; color: var(--faint); white-space: nowrap; }
.tab i { width: 24px; height: 3px; border-radius: 2px; margin-top: 4px; }
.tab.on { color: #fff; }
.tab.on i { background: var(--accent); }
.ep { display: flex; align-items: center; gap: 12px; padding: 8px 16px; }
.ep .poster { width: 132px; aspect-ratio: 16/9; border-radius: 4px; flex: none; }
.ep .poster svg { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; color: #fff; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }
.ep b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; font-weight: 500; line-height: 18px; }
.ep small { display: block; color: var(--faint); font-size: 12.5px; line-height: 16px; }
.ep small.ac { color: var(--accent-soft); font-size: 12px; font-weight: 700; letter-spacing: .3px; }
.ep.now { background: rgba(165,0,255,.1); }
.ep:active { background: rgba(255,255,255,.05); }
.cast { width: 72px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.cast .poster { width: 60px; height: 60px; border-radius: 50%; }
.cast span { font-size: 12.5px; line-height: 16px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.comments { padding: 0 16px; }
.cm { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cm.reply { padding-left: 28px; }
.cm img { width: 34px; height: 34px; border-radius: 50%; background: var(--surface2); flex: none; }
.cm b { font-size: 14px; font-weight: 700; }
.cm time { color: var(--faint); font-size: 12px; margin-left: 6px; }
.cm p { margin: 2px 0 0; color: var(--dim); white-space: pre-line; word-break: break-word; }
.more-cm { display: block; margin: 12px auto 0; }

/* ---------- watch */
.player { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player .msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px; text-align: center; }
.player .msg small { color: var(--dim); }
.watch-top { position: sticky; top: 0; z-index: 20; background: #000; padding-top: var(--top); }
.watch-hero { position: relative; aspect-ratio: 16/10; background: var(--surface); }
.watch-hero img { width: 100%; height: 100%; object-fit: cover; }
.watch-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.5), rgba(0,0,0,.25) 40%, #000); }
.watch-hero .ib { position: absolute; z-index: 2; top: calc(var(--top) + 4px); left: 4px; }
.watch-hero .go { position: absolute; z-index: 2; left: 50%; top: 52%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.watch-hero .go i { width: 68px; height: 68px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 24px rgba(165,0,255,.5); }
.watch-hero .go i svg { width: 32px; height: 32px; margin-left: 4px; }
.watch-hero .go b { font-size: 14px; font-weight: 700; text-shadow: 0 1px 4px #000; }
.winfo { padding: 12px 16px 0; }
.winfo h1 { margin: 0; font-size: 20px; line-height: 24px; font-weight: 700; }
.winfo .sub { color: var(--accent-soft); margin-top: 2px; }
.winfo h3 { margin: 14px 0 6px; font-size: 14px; font-weight: 500; color: var(--dim); }
.nav-eps { display: flex; gap: 10px; padding: 14px 16px 0; }
.nav-eps .btn { flex: 1; }

/* ---------- search */
.search { padding: 4px 16px 8px; }
.search form { display: flex; align-items: center; gap: 8px; background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 0 6px 0 12px; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: #fff; font: 16px Yantramanav, system-ui; padding: 12px 0; }
.search input::placeholder { color: var(--faint); }
.genre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 8px 16px; }
.genre { padding: 18px 14px; border-radius: 8px; background: linear-gradient(135deg, #2a0a44, var(--surface2)); }
.genre b { display: block; font-size: 15px; font-weight: 700; }
.genre small { color: var(--faint); font-size: 12px; }

/* ---------- install hint (Safari) */
.install {
  position: fixed; left: 10px; right: 10px; bottom: calc(var(--tabs) + 10px); z-index: 60;
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px;
  background: rgba(21,18,26,.98); border: 1px solid rgba(255,255,255,.12); box-shadow: 0 10px 30px rgba(0,0,0,.6);
}
.install img { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.install div { flex: 1; font-size: 14px; line-height: 19px; }
.install div span { display: block; color: var(--dim); margin-top: 2px; }
.install div svg { width: 17px; height: 17px; vertical-align: -3px; color: #3d9bff; }
.install .x { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; flex: none; }
.install .x svg { width: 16px; height: 16px; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs) + 16px); transform: translateX(-50%); z-index: 70;
  background: #262626; color: #fff; padding: 10px 16px; border-radius: 20px; font-size: 14px; max-width: 90vw; text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.5);
}

[data-fav-icon] { display: flex; }

/* ---------- instalar */
.pillbtn { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px; margin-right: 4px; border-radius: 16px;
  background: rgba(165,0,255,.9); color: #fff; font-size: 13px; font-weight: 700; }
.pillbtn svg { width: 16px; height: 16px; }
.btn.small { padding: 7px 14px; font-size: 14px; flex: none; }
.guide { position: fixed; inset: 0; z-index: 80; }
.guide-bg { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.guide-sheet { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 18px calc(18px + var(--bottom)); background: #15121a;
  border-radius: 18px 18px 0 0; border-top: 1px solid rgba(255,255,255,.12); animation: up .25s ease-out; }
@keyframes up { from { transform: translateY(100%); } }
.guide-head { display: flex; align-items: center; gap: 12px; }
.guide-head img { width: 48px; height: 48px; border-radius: 11px; }
.guide-head div { flex: 1; }
.guide-head b { display: block; font-size: 18px; font-weight: 700; }
.guide-head span { color: var(--dim); }
.guide-head .x { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; }
.guide-head .x svg { width: 16px; height: 16px; }
.guide ol { list-style: none; margin: 16px 0 6px; padding: 0; }
.guide li { display: flex; gap: 12px; padding: 10px 0; font-size: 15px; line-height: 21px; }
.guide li > i { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 700; }
.guide li small { display: block; color: var(--faint); font-size: 13px; margin-top: 2px; }
.guide .key { display: inline-flex; vertical-align: -5px; padding: 2px; border-radius: 6px; background: rgba(255,255,255,.1); color: #3d9bff; }
.guide .key svg { width: 18px; height: 18px; }
.guide .apk { display: block; text-align: center; color: var(--dim); font-size: 14px; margin: 6px 0 14px; }
.guide .apk b { color: var(--accent-soft); }
