/* ============ NiSa AniHub — Premium Dark UI (violet/cyan) ============ */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #07080d;
  --bg2: #0b0d14;
  --card: #12151f;
  --card2: #181c29;
  --line: rgba(255,255,255,.06);
  --line2: rgba(255,255,255,.12);
  --tx: #f3f5fa;
  --tx2: #98a1b8;
  --tx3: #646d84;
  --acc: #8b7cff;
  --acc2: #35d6ff;
  --gold: #ffb648;
  --ok: #3ddc84;
  --warn: #ff8c42;
  --grad: linear-gradient(135deg, #8b7cff, #35d6ff);
  --radius: 16px;
  --nav-h: 58px;
  --tab-h: 60px;
  --shadow: 0 12px 40px rgba(0,0,0,.55);
}

html { scroll-behavior: smooth; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--tx);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
img { -webkit-user-drag: none; }
button { font-family: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(139,124,255,.35); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #232838; border-radius: 9px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #303750; }

/* ---------- boot splash ---------- */
.boot {
  position: fixed; inset: 0; z-index: 999;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: radial-gradient(1200px 700px at 50% 30%, #10131d 0%, var(--bg) 60%);
}
.boot-logo img {
  width: 96px; height: 96px; border-radius: 26px; display: block;
  box-shadow: 0 10px 40px rgba(255,45,149,.4);
  animation: bootPulse 1.4s ease-in-out infinite;
}
@keyframes bootPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.boot-name { font-size: 22px; font-weight: 800; letter-spacing: .3px; }
.boot-name b { background: linear-gradient(135deg, #ff4fa3, #ff8a5c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.boot-bar { width: 120px; height: 4px; border-radius: 4px; background: #1c2130; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 40%; border-radius: 4px; background: var(--grad); animation: bootBar 1s ease-in-out infinite; }
@keyframes bootBar { 0% { transform: translateX(-100%);} 100% { transform: translateX(300%);} }

/* ---------- header ---------- */
.hdr {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 18px;
  background: rgba(7,8,13,.82);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 12px; display: block;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 0 16px rgba(255,45,149,.38), 0 4px 14px rgba(0,0,0,.55);
}
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: .2px; white-space: nowrap; }
.brand-name b { background: linear-gradient(135deg, #ff4fa3, #ff8a5c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hdr-nav { display: flex; gap: 4px; margin-left: 6px; }
.hdr-nav a {
  padding: 7px 13px; border-radius: 10px;
  color: var(--tx2); font-weight: 600; font-size: 14px;
  transition: color .15s, background .15s;
}
.hdr-nav a:hover { color: var(--tx); }
.hdr-nav a.on { color: var(--tx); background: rgba(139,124,255,.14); }
.hdr-search {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px 12px; width: 300px;
  transition: border .15s, box-shadow .15s;
}
.hdr-search:focus-within { border-color: rgba(139,124,255,.55); box-shadow: 0 0 0 3px rgba(139,124,255,.12); }
.hdr-search svg { width: 17px; height: 17px; color: var(--tx3); flex-shrink: 0; }
.hdr-search input { flex: 1; background: none; border: 0; outline: 0; color: var(--tx); font-size: 14px; min-width: 0; }
.hdr-search input::placeholder { color: var(--tx3); }
.hdr-btn { display: none; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 11px; color: var(--tx); background: var(--card); border: 1px solid var(--line); }
.hdr-btn svg { width: 19px; height: 19px; }

/* ---------- layout ---------- */
#app { padding-top: var(--nav-h); min-height: 100vh; }
.page { padding: 18px 18px 30px; max-width: 1280px; margin: 0 auto; }
.page-tall { padding-bottom: 90px; }

/* ---------- hero ---------- */
.hero {
  position: relative; margin: 6px 0 22px;
  border-radius: 20px; overflow: hidden;
  min-height: 340px; display: flex; align-items: flex-end;
  background: var(--card);
  box-shadow: var(--shadow);
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; transform: scale(1.04); }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7,8,13,.15) 0%, rgba(7,8,13,.72) 62%, rgba(7,8,13,.96) 100%); }
.hero-in { position: relative; z-index: 2; padding: 26px 28px; width: 100%; display: flex; align-items: flex-end; gap: 22px; }
.hero-poster { width: 132px; border-radius: 14px; overflow: hidden; flex-shrink: 0; box-shadow: 0 14px 34px rgba(0,0,0,.6); }
.hero-poster img { display: block; width: 100%; }
.hero-info { flex: 1; min-width: 0; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(139,124,255,.18); border: 1px solid rgba(139,124,255,.4);
  color: #c9c1ff; font-size: 11.5px; font-weight: 800; letter-spacing: .6px;
  padding: 4px 10px; border-radius: 20px; text-transform: uppercase;
}
.hero-title { font-size: 30px; font-weight: 900; line-height: 1.15; margin: 10px 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--tx2); font-size: 13px; font-weight: 600; }
.hero-meta .dot { width: 3px; height: 3px; border-radius: 3px; background: var(--tx3); }
.hero-lang { color: var(--acc2); }
.hero-desc { color: var(--tx2); font-size: 13.5px; margin-top: 10px; max-width: 640px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

.hero-dots { position: absolute; right: 24px; bottom: 22px; z-index: 3; display: flex; gap: 6px; }
.hero-dots i { width: 7px; height: 7px; border-radius: 7px; background: rgba(255,255,255,.25); transition: all .25s; cursor: pointer; }
.hero-dots i.on { width: 20px; background: var(--grad); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; font-weight: 800; font-size: 14px;
  padding: 12px 20px; border-radius: 12px; color: #fff;
  transition: transform .12s, filter .15s, background .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 17px; height: 17px; }
.btn-grad { background: var(--grad); color: #0b0714; box-shadow: 0 8px 26px rgba(139,124,255,.35); }
.btn-grad:hover { filter: brightness(1.08); }
.btn-ghost { background: rgba(255,255,255,.08); border: 1px solid var(--line2); color: var(--tx); backdrop-filter: blur(8px); }
.btn-ghost:hover { background: rgba(255,255,255,.13); }
.btn-sm { padding: 9px 14px; font-size: 13px; border-radius: 10px; }

/* ---------- rows ---------- */
.row { margin: 26px 0; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; padding: 0 2px; }
.row-title { font-size: 17.5px; font-weight: 800; letter-spacing: .2px; display: flex; align-items: center; gap: 9px; }
.row-title::before { content: ""; width: 4px; height: 18px; border-radius: 4px; background: var(--grad); }
.row-more { color: var(--tx3); font-size: 13px; font-weight: 700; }
.row-more:hover { color: var(--acc2); }
.row-title svg { width: 17px; height: 17px; flex-shrink: 0; }
.badge svg, .hero-badge svg { width: 13px; height: 13px; flex-shrink: 0; }
.rail { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 2px 10px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }

/* ---------- cards ---------- */
.card { position: relative; flex-shrink: 0; scroll-snap-align: start; }
.card-poster { position: relative; width: 128px; aspect-ratio: 2/3; border-radius: 13px; overflow: hidden; background: var(--card2); box-shadow: 0 8px 22px rgba(0,0,0,.45); }
.card-poster img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.card:hover .card-poster img { transform: scale(1.06); }
.card-epbadge {
  position: absolute; top: 7px; left: 7px;
  background: rgba(7,8,13,.82); backdrop-filter: blur(6px);
  color: #fff; font-size: 10.5px; font-weight: 800;
  padding: 3px 7px; border-radius: 7px; letter-spacing: .3px;
  border: 1px solid rgba(255,255,255,.14);
}
.card-lang {
  position: absolute; top: 7px; right: 7px;
  display: flex; gap: 3px;
}
.card-lang i {
  width: 16px; height: 16px; border-radius: 5px; display: grid; place-items: center;
  background: rgba(7,8,13,.8); backdrop-filter: blur(6px);
  font-size: 7.5px; font-weight: 900; font-style: normal; color: #fff;
  border: 1px solid rgba(255,255,255,.14);
}
.card-vh {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(180deg, transparent 30%, rgba(7,8,13,.85));
  opacity: 0; transition: opacity .2s;
}
.card:hover .card-vh { opacity: 1; }
.card-vh .pv {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--grad); display: grid; place-items: center;
  box-shadow: 0 8px 22px rgba(139,124,255,.5);
}
.card-vh svg { width: 17px; height: 17px; fill: #0b0714; margin-left: 2px; }
/* width:0 + min-width:100% => title card er width baday na, poster er soman theke; ellipsis poster width e kate */
.card-title { margin-top: 8px; font-size: 13px; font-weight: 700; line-height: 1.35; width: 0; min-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { margin-top: 2px; color: var(--tx3); font-size: 11.5px; font-weight: 600; width: 0; min-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.wide .card-poster { width: 220px; aspect-ratio: 16/10.5; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 14px 12px; }
.grid .card { scroll-snap-align: none; min-width: 0; }

/* ---------- chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 8px 15px; border-radius: 22px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--tx2); font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all .15s;
}
.chip:hover { color: var(--tx); border-color: var(--line2); }
.chip.on { background: rgba(139,124,255,.16); border-color: rgba(139,124,255,.55); color: #cabfff; }
.src-bar .chip { display: inline-flex; align-items: center; gap: 7px; }
.src-bar .chip svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ---------- detail ---------- */
.detail-hero { position: relative; min-height: 300px; border-radius: 20px; overflow: hidden; background: var(--card); box-shadow: var(--shadow); margin-top: 6px; }
.detail-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .38; }
.detail-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7,8,13,.3), rgba(7,8,13,.9) 70%, #07080d); }
.detail-in { position: relative; z-index: 2; padding: 30px 26px 22px; display: flex; gap: 22px; align-items: flex-end; }
.detail-poster { width: 148px; border-radius: 14px; overflow: hidden; flex-shrink: 0; box-shadow: 0 16px 38px rgba(0,0,0,.65); }
.detail-poster img { display: block; width: 100%; }
.detail-info { flex: 1; min-width: 0; }
.detail-title { font-size: 27px; font-weight: 900; line-height: 1.15; margin: 8px 0 10px; }
.badges { display: flex; flex-wrap: wrap; gap: 7px; }
.badge {
  padding: 4px 10px; border-radius: 9px; font-size: 12px; font-weight: 700;
  background: rgba(255,255,255,.07); border: 1px solid var(--line); color: var(--tx2);
}
.badge.hl { background: rgba(139,124,255,.16); border-color: rgba(139,124,255,.45); color: #cabfff; }
.badge.gold { background: rgba(255,182,72,.12); border-color: rgba(255,182,72,.4); color: var(--gold); }
.badge.cyan { background: rgba(53,214,255,.12); border-color: rgba(53,214,255,.4); color: var(--acc2); }
.detail-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.detail-desc { color: var(--tx2); font-size: 14px; line-height: 1.65; margin: 16px 2px 0; max-width: 860px; }
.detail-meta-line { color: var(--tx3); font-size: 13px; margin-top: 12px; font-weight: 600; }
.detail-meta-line b { color: var(--tx2); }

.seasons-bar { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; margin-top: 20px; }
.seasons-bar::-webkit-scrollbar { display: none; }
.season-chip {
  flex-shrink: 0; padding: 9px 16px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line); cursor: pointer;
  color: var(--tx2); font-weight: 800; font-size: 13.5px; transition: all .15s;
}
.season-chip.on { background: rgba(139,124,255,.16); border-color: rgba(139,124,255,.55); color: #cabfff; }

.ep-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 6px; }
.ep-item {
  display: flex; gap: 11px; padding: 9px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line);
  cursor: pointer; transition: border .15s, transform .12s;
}
.ep-item:hover { border-color: rgba(139,124,255,.5); transform: translateY(-2px); }
.ep-thumb { position: relative; width: 106px; aspect-ratio: 16/10; border-radius: 9px; overflow: hidden; background: var(--card2); flex-shrink: 0; }
.ep-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ep-num {
  position: absolute; left: 5px; top: 5px;
  background: rgba(7,8,13,.85); color: #fff; font-size: 10px; font-weight: 900;
  padding: 2px 6px; border-radius: 6px; border: 1px solid rgba(255,255,255,.15);
}
.ep-info { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.ep-t { font-size: 13px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ep-s { color: var(--tx3); font-size: 11.5px; margin-top: 3px; font-weight: 600; }

/* ---------- watch page ---------- */
.watch-wrap { max-width: 1180px; margin: 0 auto; padding: 14px 14px 90px; }
/* sticky player: scroll korle video header er niche dock hoye thake (mini-player UX) */
.player-shell {
  position: sticky; top: var(--nav-h); z-index: 40;
  width: 100%; aspect-ratio: 16/9; max-height: calc(100vh - var(--nav-h) - 10px);
  background: #000; border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow);
  touch-action: pan-y;
}
.player-shell video { width: 100%; height: 100%; display: block; background: #000; object-fit: contain; }
.player-shell:fullscreen { border-radius: 0; width: 100vw; height: 100vh; aspect-ratio: auto; max-width: none; }
.player-shell.cssfs { position: fixed; inset: 0; z-index: 9990; border-radius: 0; width: 100vw; height: 100vh; aspect-ratio: auto; max-width: none; }
body.fslock { overflow: hidden; }
.player-loading { position: absolute; inset: 0; display: grid; place-items: center; z-index: 5; background: rgba(0,0,0,.4); backdrop-filter: blur(2px); }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 3.5px solid rgba(255,255,255,.15); border-top-color: #ff4fa3; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.player-fallback { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: none; z-index: 6; }

/* fast mode — the source web player fills the shell; our bars step aside */
.player-shell.fastmode .vbar, .player-shell.fastmode .bbig,
.player-shell.fastmode .dz, .player-shell.fastmode .pmid, .player-shell.fastmode .player-loading { display: none !important; }
.player-shell.fastmode .p-top { opacity: 1; pointer-events: none; background: linear-gradient(180deg, rgba(8,8,14,.8), rgba(8,8,14,0)); }
.player-shell.fastmode .p-top .vbtn { pointer-events: auto; }
.src-div { width: 1px; height: 20px; background: var(--line); margin: 0 4px; flex-shrink: 0; }

/* error overlay */
.perr { position: absolute; inset: 0; z-index: 9; display: none; place-items: center; background: rgba(4,5,9,.86); backdrop-filter: blur(4px); text-align: center; padding: 18px; }
.perr.show { display: grid; }
.perr-t { font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.perr-s { color: var(--tx2); font-size: 12.5px; margin-bottom: 14px; max-width: 420px; }
.perr-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* top bar (back + title) */
.p-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 8;
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: linear-gradient(180deg, rgba(0,0,0,.72), transparent);
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.player-shell.showbar .p-top, .player-shell.paus .p-top { opacity: 1; pointer-events: auto; }
.p-top .vbtn { pointer-events: auto; }
.p-title { color: #fff; font-size: 14px; font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 6px rgba(0,0,0,.6); }

/* center burst + big play */
.pmid {
  position: absolute; left: 50%; top: 50%; z-index: 7; pointer-events: none;
  width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(10,10,16,.55); backdrop-filter: blur(6px);
  opacity: 0; transform: scale(.7);
}
.pmid svg { width: 30px; height: 30px; fill: #fff; }
.pmid.pop { animation: ppop .55s ease-out forwards; }
@keyframes ppop { 0% { opacity: .95; transform: scale(.65); } 70% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.12); } }
.bbig {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 7;
  width: 64px; height: 64px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #ff4fa3, #ff2d95); color: #fff;
  display: grid; place-items: center; box-shadow: 0 10px 34px rgba(255,45,149,.5);
  transition: transform .15s, opacity .2s; opacity: 0; pointer-events: none;
}
.bbig svg { width: 26px; height: 26px; fill: #fff; margin-left: 3px; }
.player-shell.paus .bbig { opacity: 1; pointer-events: auto; }
.bbig:active { transform: translate(-50%,-50%) scale(.92); }

/* double-tap seek zones */
.dz { position: absolute; top: 0; bottom: 0; width: 34%; z-index: 4; }
.dz-l { left: 0; } .dz-r { right: 0; }
.dz-rip {
  position: absolute; top: 50%; width: 78px; height: 78px; margin: -39px 0 0 -39px; border-radius: 50%;
  background: rgba(255,255,255,.18); backdrop-filter: blur(2px);
  display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 13.5px;
  animation: ripp .5s ease-out forwards; pointer-events: none; z-index: 7;
}
.dz-l .dz-rip { left: 62%; } .dz-r .dz-rip { left: 38%; }
@keyframes ripp { 0% { opacity: .95; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.15); } }

.watch-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin: 16px 2px 4px; }
.watch-title { font-size: 19px; font-weight: 800; line-height: 1.3; }
.watch-sub { color: var(--tx3); font-size: 13px; margin-top: 4px; font-weight: 600; }
.watch-nav { display: flex; gap: 8px; flex-shrink: 0; }

.src-bar { display: flex; gap: 8px; margin: 12px 0 0; align-items: center; flex-wrap: wrap; }
.src-label { color: var(--tx3); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.chip-dl {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; border: 0;
  padding: 10px 18px; border-radius: 22px; font-weight: 800; font-size: 13.5px; color: #fff;
  background: linear-gradient(135deg, #ff2d95, #ff7a3d); box-shadow: 0 8px 24px rgba(255,45,149,.35);
}
.chip-dl svg { width: 16px; height: 16px; }
.chip-dl:active { transform: scale(.97); }

/* custom video controls */
.vbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 8;
  padding: 30px 12px 8px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.86));
  opacity: 0; transition: opacity .2s;
}
.player-shell.showbar .vbar, .player-shell.paus .vbar { opacity: 1; }
.vprog-hit { padding: 12px 2px 10px; cursor: pointer; touch-action: none; }
.vprog { height: 4.5px; border-radius: 4px; background: rgba(255,255,255,.24); cursor: pointer; position: relative; transition: height .15s; }
.vprog.drag, .vprog-hit:hover .vprog { height: 7px; }
.vprog-buf { position: absolute; inset: 0 auto 0 0; width: 0%; border-radius: 4px; background: rgba(255,255,255,.38); }
.vprog-cur { position: absolute; inset: 0 auto 0 0; width: 0%; border-radius: 4px; background: linear-gradient(90deg, #ff2d95, #ff7a3d); }
.vprog-knob { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: #fff; transform: translate(-50%,-50%) scale(1); box-shadow: 0 1px 6px rgba(0,0,0,.6); transition: transform .15s; }
.vprog.drag .vprog-knob, .vprog-hit:hover .vprog-knob { transform: translate(-50%,-50%) scale(1.25); }
.vtt {
  position: absolute; bottom: 30px; transform: translateX(-50%);
  background: rgba(12,13,20,.95); border: 1px solid var(--line2); color: #fff;
  padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 800;
  font-variant-numeric: tabular-nums; pointer-events: none; display: none; white-space: nowrap; z-index: 10;
}
.vtt.show { display: block; }
.vctl { display: flex; align-items: center; gap: 2px; }
.vbtn {
  min-width: 40px; height: 40px; border-radius: 11px; border: 0; cursor: pointer;
  background: transparent; color: #fff; display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  transition: background .15s, transform .1s; -webkit-tap-highlight-color: transparent;
}
.vbtn:hover { background: rgba(255,255,255,.13); }
.vbtn:active { transform: scale(.92); }
.vbtn svg { width: 20px; height: 20px; }
.vbtn i { font-style: normal; font-size: 8px; font-weight: 900; line-height: 1; margin-top: 1px; letter-spacing: .4px; opacity: .95; }
.vbtn.play svg { width: 24px; height: 24px; }
.vbtn.flat { flex-direction: row; }
.vtime { color: rgba(255,255,255,.92); font-size: 12.5px; font-weight: 800; margin: 0 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vspacer { flex: 1; }
.vmenu-wrap { position: relative; }
.vmenu {
  position: absolute; bottom: 48px; right: 0; z-index: 20;
  min-width: 172px; background: rgba(16,18,28,.97); backdrop-filter: blur(14px);
  border: 1px solid var(--line2); border-radius: 13px; padding: 6px;
  box-shadow: 0 14px 40px rgba(0,0,0,.6);
  display: none; max-height: 300px; overflow-y: auto;
}
.vmenu.open { display: block; }
.vmenu-h { padding: 7px 11px 4px; color: var(--tx3); font-size: 10.5px; font-weight: 900; letter-spacing: .8px; text-transform: uppercase; }
.vmenu-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; border: 0; background: none; cursor: pointer;
  padding: 9px 11px; border-radius: 9px; color: var(--tx); font-size: 13.5px; font-weight: 700;
  text-align: left;
}
.vmenu-item:hover { background: rgba(255,255,255,.08); }
.vmenu-item.on { color: #ffb1d5; }
.vmenu-item .tick { margin-left: auto; width: 16px; height: 16px; }

/* episodes drawer on watch page */
.ep-drawer { margin-top: 18px; }
.ep-drawer .seasons-bar { margin-top: 8px; }

/* ---------- search page ---------- */
.search-wrap { max-width: 760px; margin: 0 auto; padding: 24px 18px 90px; }
.search-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line2);
  border-radius: 14px; padding: 14px 16px;
}
.search-box:focus-within { border-color: rgba(139,124,255,.55); box-shadow: 0 0 0 3px rgba(139,124,255,.12); }
.search-box svg { width: 20px; height: 20px; color: var(--tx3); }
.search-box input { flex: 1; background: none; border: 0; outline: 0; color: var(--tx); font-size: 16px; }
.search-res { margin-top: 18px; }
.sr-item {
  display: flex; gap: 12px; padding: 10px; border-radius: 14px;
  border: 1px solid transparent; cursor: pointer; transition: all .15s;
}
.sr-item:hover { background: var(--card); border-color: var(--line); }
.sr-poster { width: 58px; aspect-ratio: 2/3; border-radius: 9px; overflow: hidden; flex-shrink: 0; background: var(--card2); }
.sr-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sr-info { min-width: 0; align-self: center; }
.sr-t { font-weight: 800; font-size: 14.5px; }
.sr-s { color: var(--tx3); font-size: 12.5px; margin-top: 3px; font-weight: 600; }
.search-hint { text-align: center; color: var(--tx3); padding: 46px 0 10px; font-size: 14px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }

/* ---------- misc ---------- */
.empty { text-align: center; color: var(--tx3); padding: 60px 20px; font-size: 14.5px; }
.skel { background: linear-gradient(100deg, var(--card) 40%, var(--card2) 50%, var(--card) 60%); background-size: 200% 100%; animation: skel 1.2s infinite; border-radius: 13px; }
@keyframes skel { to { background-position: -200% 0; } }
.footer { text-align: center; color: var(--tx3); font-size: 12.5px; padding: 26px 16px 20px; border-top: 1px solid var(--line); margin-top: 34px; }
.footer b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.footer .ft-tag { max-width: 560px; margin: 0 auto 7px; line-height: 1.6; }
.footer .ft-copy { font-size: 13px; color: var(--tx2); font-weight: 700; letter-spacing: .2px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px);
  background: rgba(18,21,31,.97); border: 1px solid var(--line2);
  color: var(--tx); padding: 12px 20px; border-radius: 13px; font-size: 14px; font-weight: 700;
  box-shadow: var(--shadow); z-index: 500; opacity: 0; pointer-events: none;
  transition: all .25s; max-width: 88vw; text-align: center;
  backdrop-filter: blur(12px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: rgba(255,108,108,.5); }

/* tabbar */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: none; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: rgba(9,10,16,.92); backdrop-filter: blur(16px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--tx3); font-size: 10.5px; font-weight: 700; }
.tabbar a svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.tabbar a.on { color: #cabfff; }

/* responsive */
@media (max-width: 900px) {
  .hdr-nav { display: none; }
  .hdr-search { display: none; }
  .hdr-btn { display: flex; margin-left: auto; }
  .tabbar { display: grid; }
  .page { padding: 14px 14px 40px; }
  .hero { min-height: 300px; }
  .hero-in { padding: 20px 18px; gap: 14px; }
  .hero-poster { width: 104px; }
  .hero-title { font-size: 22px; }
  .hero-dots { right: 16px; bottom: 16px; }
  .detail-in { flex-direction: column; align-items: flex-start; padding: 20px 18px 16px; }
  .detail-poster { width: 128px; }
  .detail-title { font-size: 22px; }
  .ep-list { grid-template-columns: 1fr; }
  .brand-name { font-size: 15px; }
  .brand-logo { width: 36px; height: 36px; }
  .vbtn { min-width: 38px; height: 38px; }
}
@media (min-width: 901px) {
  .mnav-btn { display: none !important; }
  .page { padding-bottom: 40px; }
}
@media (max-width: 640px) {
  .vbtn.mm { display: none; }
  .vtime { font-size: 11.5px; margin: 0 4px; }
}

/* ============================================================
   PREMIUM POLISH LAYER
   ============================================================ */
* { -webkit-tap-highlight-color: transparent; }

/* page enter animation */
.page, .watch-wrap, .search-wrap { animation: pageIn .42s cubic-bezier(.22,.68,.32,1) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .page, .watch-wrap, .search-wrap, .hero-bg { animation: none !important; }
}

/* hero: backdrop crossfade + poster glass ring */
.hero-bg { animation: bgIn .8s ease both; }
@keyframes bgIn { from { opacity: 0; transform: scale(1.09); } to { opacity: .55; transform: scale(1.04); } }
.hero-poster { border: 1px solid rgba(255,255,255,.14); }
.hero-badge { background: rgba(20,22,34,.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

/* shimmer while images load */
.card-poster, .ep-thumb, .sr-poster, .hero-poster, .detail-poster {
  background: linear-gradient(100deg, var(--card) 35%, var(--card2) 50%, var(--card) 65%);
  background-size: 220% 100%; animation: skel 1.4s infinite;
}

/* cards: lift on hover, press on tap, glass edge */
.card { transition: transform .18s ease; }
.card:hover { transform: translateY(-4px); }
.card:hover .card-poster { box-shadow: 0 14px 34px rgba(139,124,255,.28), 0 8px 22px rgba(0,0,0,.45); }
.card:active { transform: scale(.965); }
.card-poster::after { content: ""; position: absolute; inset: 0; border-radius: 13px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); pointer-events: none; }

/* buttons & chips */
.btn-grad { box-shadow: 0 10px 30px rgba(139,124,255,.4); }
.btn-grad:hover { transform: translateY(-1px); filter: brightness(1.07); }
.btn-ghost:hover { border-color: rgba(139,124,255,.45); }
.chip:active, .season-chip:active { transform: scale(.95); }
.ep-item:active { transform: scale(.985); }

/* footer */
.footer { padding: 30px 16px 26px; background: linear-gradient(180deg, transparent, rgba(139,124,255,.05)); }
.footer .ft-copy b { background: linear-gradient(135deg, #ff4fa3, #ff8a5c); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* boot: hint + retry */
.boot-hint { color: var(--tx3); font-size: 12.5px; font-weight: 600; letter-spacing: .3px; animation: hintFade 2.2s ease-in-out infinite; }
@keyframes hintFade { 0%,100% { opacity: .45; } 50% { opacity: 1; } }
.boot-fail { text-align: center; color: var(--tx2); font-weight: 700; font-size: 15px; line-height: 1.6; }
.boot-fail small { color: var(--tx3); font-weight: 600; }
.boot .btn { margin-top: 6px; min-width: 130px; }
