/* ============================================================
   ToonReel — global styles (dark, neon, mobile-first friendly)
   ============================================================ */

:root {
  --brand-rgb: 229, 9, 20;
  --bg: #0a0a14;
  --bg-soft: #12121f;
  --card: #17172a;
  --card-hover: #1f1f38;
  --line: rgba(255, 255, 255, .08);
  --text: #f2f2f8;
  --text-dim: #9a9ab0;
  --text-faint: #63637a;
  --nav-bg: rgba(12, 12, 20, .85);
  --footer-bg: #08080f;
  --track: rgba(255, 255, 255, .1);
  --accent-soft: #f1a1a5;
  --brand: #e50914;
  --brand-2: #ff4d4d;
  --brand-grad: linear-gradient(135deg, #e50914, #ff4d4d);
  --gold: #fbbf24;
  --danger: #f87171;
  --radius: 14px;
  --nav-h: 64px;
  font-size: 16px;
}

/* ---------- light theme ---------- */
html[data-theme='light'] {
  --bg: #f4f5f7;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --card-hover: #f0f1f5;
  --line: rgba(0, 0, 0, .1);
  --text: #17181d;
  --text-dim: #565860;
  --text-faint: #8e9099;
  --nav-bg: rgba(255, 255, 255, .92);
  --footer-bg: #ffffff;
  --track: rgba(0, 0, 0, .08);
  --accent-soft: #b3121d;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
/* keep the hidden attribute authoritative even over display overrides */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }

::selection { background: rgba(var(--brand-rgb), .45); }

/* ---------- scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2c2c48; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #3d3d63; }

/* ---------- top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 20px;
  padding: 0 32px;
  background: rgba(10, 10, 20, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.35rem; font-weight: 800; letter-spacing: .5px;
  white-space: nowrap;
}
.logo .mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--brand-grad);
  display: grid; place-items: center;
  font-size: 1.05rem;
  box-shadow: 0 4px 18px rgba(var(--brand-rgb), .45);
}
.logo .grad {
  background: var(--brand-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.nav-links { display: flex; gap: 4px; }
.nav-links a {
  padding: 8px 14px; border-radius: 10px;
  color: var(--text-dim); font-weight: 600; font-size: .92rem;
  transition: color .15s, background .15s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(255, 255, 255, .07); }

.nav-spacer { flex: 1; }

.search-wrap { position: relative; width: 300px; max-width: 34vw; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; opacity: .55; }
#searchInput {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  font-size: .9rem;
  outline: none;
  transition: border-color .15s, background .15s;
}
#searchInput::placeholder { color: var(--text-faint); }
#searchInput:focus { border-color: var(--brand); background: #14142a; }

.search-drop {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
  display: none;
}
.search-drop.open { display: block; }
.search-drop a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  transition: background .12s;
}
.search-drop a:hover { background: var(--card-hover); }
.search-drop img { width: 38px; height: 57px; border-radius: 6px; object-fit: cover; }
.search-drop .st { font-weight: 600; font-size: .88rem; }
.search-drop .sg { font-size: .74rem; color: var(--text-dim); }
.search-drop .none { padding: 14px; color: var(--text-dim); font-size: .85rem; text-align: center; }

.coins-chip {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, .35);
  background: rgba(251, 191, 36, .08);
  color: var(--gold); font-weight: 700; font-size: .88rem;
  white-space: nowrap;
}

.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #22d3ee, #8b5cf6);
  display: grid; place-items: center; font-weight: 800; font-size: .85rem;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  height: min(78vh, 640px);
  min-height: 480px;
  overflow: hidden;
}
.hero-slides { position: absolute; inset: 0; }
.hero-slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity .9s ease;
  display: flex; align-items: center;
}
.hero-slide.on { opacity: 1; z-index: 1; }
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center 22%;
  transform: scale(1.06);
  filter: saturate(1.1);
}
.hero-slide::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(8, 8, 12, .96) 0%, rgba(8, 8, 12, .8) 42%, rgba(8, 8, 12, .25) 100%),
              linear-gradient(0deg, var(--bg) 2%, transparent 30%);
}
.hero-inner {
  position: relative; z-index: 2;
  max-width: 1280px; margin: 0 auto; width: 100%;
  padding: 0 32px;
  display: flex; align-items: center; gap: 48px;
}
.hero-slide .hero-text { max-width: 560px; }
.hero-art { margin-left: auto; flex: 0 0 auto; position: relative; }
.hero-art img {
  width: 288px;
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .1);
  transform: rotate(2.5deg);
}
.badge-line { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.pill {
  font-size: .68rem; font-weight: 800; letter-spacing: 1.5px;
  padding: 5px 11px; border-radius: 999px;
  background: var(--brand); color: #fff;
}
.pill.ghost {
  background: rgba(255, 255, 255, .1);
  border: 1px solid var(--line); color: var(--text-dim);
}
.hero h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1.08; font-weight: 850; letter-spacing: -.5px;
  margin-bottom: 14px;
  text-shadow: 0 4px 30px rgba(0, 0, 0, .6);
}
.hero .tagline {
  font-size: clamp(.95rem, 1.6vw, 1.15rem);
  color: #e3c9ff; font-weight: 600; margin-bottom: 12px;
}
.hero .desc {
  color: var(--text-dim); font-size: .95rem; line-height: 1.6;
  margin-bottom: 24px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 26px; border-radius: 999px;
  font-weight: 700; font-size: .95rem;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--brand); color: #fff;
  box-shadow: 0 6px 24px rgba(var(--brand-rgb), .5);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(var(--brand-rgb), .65); }
.btn-ghost {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .18);
  color: var(--text);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover { background: rgba(255, 255, 255, .18); }

.hero-dots {
  position: absolute; bottom: 26px; left: 50%; translate: -50% 0;
  display: flex; gap: 8px; z-index: 3;
}
.hero-dots button {
  width: 26px; height: 5px; border-radius: 999px;
  background: rgba(255, 255, 255, .25);
  transition: background .2s, width .2s;
}
.hero-dots button.on { background: var(--brand-grad); width: 40px; }

/* ---------- sections & rails ---------- */
main { max-width: 1280px; margin: 0 auto; padding: 0 32px 60px; }

section.row-section { margin-top: 44px; }
.row-head {
  display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px;
}
.row-head h2 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.3px; }
.row-head .more { margin-left: auto; color: var(--brand-2); font-size: .88rem; font-weight: 600; }
.row-head .more:hover { text-decoration: underline; }

.rail {
  display: grid; grid-auto-flow: column;
  grid-auto-columns: 158px;
  gap: 14px;
  overflow-x: auto; overflow-y: hidden;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }

/* ---------- card ---------- */
.card { position: relative; display: block; }
.card .poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .45);
  transition: transform .22s ease, box-shadow .22s ease;
}
.card:hover .poster { transform: translateY(-5px) scale(1.02); box-shadow: 0 16px 40px rgba(var(--brand-rgb), .3); }
.card .poster img { width: 100%; height: 100%; object-fit: cover; }
.card .poster::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, .45), transparent 40%);
}
.card .play-ov {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center;
  opacity: 0; transition: opacity .2s;
  background: rgba(8, 8, 16, .35);
}
.card:hover .play-ov { opacity: 1; }
.play-ov .circle {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  display: grid; place-items: center;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
}
.card .card-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-size: .6rem; font-weight: 800; letter-spacing: 1.2px;
  padding: 4px 9px; border-radius: 7px;
  background: var(--brand); color: #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .4);
}
.card .card-badge.plain { background: rgba(10, 10, 20, .72); border: 1px solid var(--line); }
.card .ep-chip {
  position: absolute; bottom: 10px; right: 10px; z-index: 2;
  font-size: .68rem; font-weight: 700;
  padding: 4px 9px; border-radius: 7px;
  background: rgba(10, 10, 20, .78); color: #fff;
  border: 1px solid var(--line);
}
.card .fav {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(10, 10, 20, .66);
  color: #fff; transition: transform .15s, color .15s, background .15s;
}
.card .fav:hover { transform: scale(1.15); background: rgba(10, 10, 20, .9); }
.card .fav.on { color: #fb5c8d; }

.card .meta { padding: 10px 4px 0; }
.card .t {
  font-weight: 700; font-size: .9rem; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card .g {
  margin-top: 3px; font-size: .74rem; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card .stars { color: var(--gold); font-size: .74rem; font-weight: 700; margin-top: 3px; display: inline-flex; align-items: center; gap: 4px; }

.card.continue { grid-auto-columns: 260px; }
.card.continue .poster { aspect-ratio: 16 / 9; }
.card.continue .resume-bar {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
  height: 4px; background: rgba(255, 255, 255, .2);
}
.card.continue .resume-bar i { display: block; height: 100%; background: var(--brand-grad); }

/* ---------- genre chips + grid ---------- */
.chips {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin: 44px 0 20px;
}
.chip {
  padding: 9px 18px; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--text-dim);
  font-weight: 600; font-size: .87rem;
  transition: all .15s;
}
.chip:hover { color: var(--text); border-color: rgba(255, 255, 255, .25); }
.chip.on {
  background: var(--brand); color: #fff; border-color: transparent;
  box-shadow: 0 4px 18px rgba(var(--brand-rgb), .4);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 18px 14px;
}
.grid .card { display: none; }
.grid .card.show { display: block; }

.empty-note {
  padding: 50px 0; text-align: center; color: var(--text-dim);
  display: none;
}
.empty-note.show { display: block; }

/* ---------- views (hash-routed) ---------- */
.view-pad { padding-top: 8px; }
.view-title { font-size: 1.7rem; font-weight: 850; letter-spacing: -.4px; margin: 26px 0 6px; }
.view[hidden] { display: none; }

/* ---------- language switcher ---------- */
.lang-wrap { position: relative; }
.lang-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--text-dim);
  font-weight: 700; font-size: .82rem;
  transition: color .15s, border-color .15s;
}
.lang-btn:hover { color: var(--text); border-color: rgba(255, 255, 255, .25); }
.lang-menu {
  position: absolute; top: calc(100% + 10px); right: 0;
  min-width: 200px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
  padding: 8px;
  display: none; z-index: 150;
}
.lang-menu.open { display: block; animation: pop .18s ease; }
.lang-head {
  font-size: .7rem; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-faint); padding: 8px 12px 6px;
}
.lang-opt {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 10px 12px; border-radius: 10px;
  font-size: .9rem; font-weight: 600; color: var(--text-dim);
  text-align: left;
}
.lang-opt:hover { background: var(--card-hover); color: var(--text); }
.lang-opt.on { color: var(--text); }
.lang-opt .check { color: var(--brand-2); font-weight: 800; }

/* ---------- top-10 rail ranking numbers ---------- */
.card .rank-num {
  position: absolute; left: 8px; bottom: 6px; z-index: 2;
  font-size: 2.4rem; font-weight: 900; font-style: italic;
  line-height: 1;
  color: #fff;
  text-shadow: 0 4px 18px rgba(0, 0, 0, .8), 0 0 2px rgba(0,0,0,.9);
  -webkit-text-stroke: 1px rgba(0, 0, 0, .35);
}
.card .rank-num.top { color: var(--gold); }

/* ---------- ranking page ---------- */
.rank-list { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.rank-row {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 18px 12px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: transform .16s, border-color .16s, background .16s;
}
.rank-row:hover { transform: translateX(4px); border-color: rgba(var(--brand-rgb), .5); background: var(--card-hover); }
.rank-no {
  width: 44px; flex: 0 0 44px;
  text-align: center;
  font-size: 1.5rem; font-weight: 900; font-style: italic;
  color: var(--text-faint);
}
.rank-no.top { color: var(--gold); font-size: 1.8rem; }
.rank-row img {
  width: 58px; height: 87px; flex: 0 0 58px;
  object-fit: cover; border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
}
.rank-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rank-title { font-weight: 800; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-genres { font-size: .8rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-meta { display: flex; align-items: center; gap: 14px; font-size: .76rem; color: var(--text-dim); flex-wrap: wrap; }
.rank-meta .stars { color: var(--gold); font-weight: 800; }
.pill.sm { font-size: .6rem; padding: 3px 8px; }
.rank-badge { top: 10px; }
.play-mini {
  margin-left: auto; flex: 0 0 auto;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  box-shadow: 0 6px 18px rgba(var(--brand-rgb), .45);
}

/* ---------- mobile bottom tab bar ---------- */
.tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
  background: rgba(12, 12, 22, .95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tabbar .tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0 7px;
  color: var(--text-faint); font-size: .66rem; font-weight: 600;
}
.tabbar .tab svg { width: 22px; height: 22px; }
.tabbar .tab.active { color: var(--accent-soft); }
.tabbar .tab.active svg { color: var(--brand); }

/* ---------- top-up modal ---------- */
.modal.topup { width: min(430px, 100%); }
.modal .m-icon.gold {
  background: rgba(251, 191, 36, .14);
  border-color: rgba(251, 191, 36, .4);
  font-size: 1.5rem;
}
.pkg-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.pkg-card {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 15px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  transition: border-color .15s, transform .15s, background .15s;
}
.pkg-card:hover { border-color: var(--gold); transform: translateY(-2px); background: #161628; }
.pkg-card.busy { opacity: .6; pointer-events: none; }
.pkg-card .pkg-coins { font-weight: 800; font-size: 1.05rem; }
.pkg-card .pkg-buy {
  font-weight: 700; font-size: .88rem;
  padding: 8px 16px; border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #201200;
}
.pkg-tag {
  position: absolute; top: -9px; right: 14px;
  font-size: .58rem; font-weight: 800; letter-spacing: 1.2px;
  padding: 3px 9px; border-radius: 999px;
  background: var(--brand); color: #fff;
}

/* ---------- admin ---------- */
body.admin-page { background: var(--bg); }
.admin-tag {
  font-size: .7rem; font-weight: 800; letter-spacing: 2px;
  padding: 5px 10px; border-radius: 8px;
  background: rgba(var(--brand-rgb), .18); color: var(--accent-soft);
  border: 1px solid rgba(var(--brand-rgb), .35);
}
.api-badge { font-size: .78rem; color: var(--text-dim); white-space: nowrap; }
.api-badge.on { color: #4ade80; }
.api-badge.off { color: var(--text-faint); }
.sm-btn { padding: 9px 18px; font-size: .85rem; }
.sm-btn.danger:hover { border-color: var(--danger); color: var(--danger); }

.admin-main { max-width: 980px; margin: 0 auto; padding: 26px 32px 80px; }
.draft-banner[hidden] { display: none; }
.draft-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: rgba(251, 191, 36, .1);
  border: 1px solid rgba(251, 191, 36, .35);
  color: #fde68a;
  padding: 12px 18px; border-radius: 12px;
  font-size: .88rem; margin-bottom: 22px;
}
.draft-banner button {
  margin-left: auto; color: #fde68a; font-weight: 700; font-size: .82rem;
  text-decoration: underline;
}
.admin-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.admin-head h1 { font-size: 1.6rem; font-weight: 850; }
.admin-head h1 span { color: var(--text-dim); font-size: 1rem; font-weight: 600; }
.admin-head .btn { margin-left: auto; }

.admin-list { display: flex; flex-direction: column; gap: 12px; }
.admin-row {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px 12px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
}
.admin-row img { width: 52px; height: 78px; object-fit: cover; border-radius: 9px; }
.admin-row-info { min-width: 0; }
.admin-row-title { font-weight: 800; font-size: .98rem; }
.admin-row-sub { font-size: .8rem; color: var(--text-dim); margin-top: 3px; }
.admin-row .btn { flex: 0 0 auto; }
.admin-row .admin-row-info { margin-right: auto; }

/* editor modal */
.modal.editor {
  width: min(760px, 100%);
  max-height: 88vh; overflow-y: auto;
}
.modal.editor h3 { margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: .82rem; color: var(--text-dim); font-weight: 600; }
.form-grid .span2 { grid-column: span 2; }
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--text);
  font-size: .9rem; outline: none;
  font-family: inherit;
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: var(--brand); }
.form-grid .hint { color: var(--text-faint); font-weight: 500; }
.form-chips { margin: 4px 0 8px; }
.form-chips .chip { padding: 6px 13px; font-size: .78rem; margin: 0 6px 6px 0; display: inline-block; }
.vid-head { font-size: .82rem; color: var(--text-dim); font-weight: 600; margin-bottom: 8px; }
.vid-list { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; padding-right: 4px; }
.vid-row { display: flex; align-items: center; gap: 8px; }
.vid-row .vid-ep { flex: 0 0 46px; font-size: .78rem; font-weight: 800; color: var(--text-faint); }
.vid-row input { flex: 1; min-width: 0; }
.vid-row .vid-upload { flex: 0 0 auto; }
.poster-box { display: flex; gap: 18px; }
.poster-preview img {
  width: 130px; aspect-ratio: 2/3; object-fit: cover;
  border-radius: 12px; border: 1px solid var(--line);
}
.poster-fields { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.color-row { display: flex; gap: 12px; }
.color-row label { flex: 1; }
.color-row input[type="color"] { width: 100%; height: 40px; padding: 4px; cursor: pointer; }
.editor-actions { display: flex; gap: 14px; margin-top: 22px; align-items: center; }
.editor-actions .btn-text { margin-left: auto; }

/* ---------- get-app nav button + smart banner ---------- */
.getapp-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--brand); color: #fff;
  font-weight: 700; font-size: .84rem; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(var(--brand-rgb), .4);
  transition: transform .15s, box-shadow .15s;
}
.getapp-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(var(--brand-rgb), .55); }

.app-banner {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 180;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: rgba(20, 20, 36, .96);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
  backdrop-filter: blur(12px);
  transform: translateY(120px);
  opacity: 0;
  transition: transform .35s ease, opacity .35s ease;
  max-width: 560px; margin: 0 auto;
}
.app-banner.show { transform: translateY(0); opacity: 1; }
.app-banner img { width: 44px; height: 44px; border-radius: 11px; }
.app-banner .ab-text { min-width: 0; display: flex; flex-direction: column; }
.app-banner .ab-text b { font-size: .9rem; }
.app-banner .ab-text span { font-size: .74rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-banner .ab-install {
  margin-left: auto; flex: 0 0 auto;
  padding: 9px 16px; border-radius: 999px;
  background: var(--brand); color: #fff; font-weight: 700; font-size: .82rem;
}
.app-banner .ab-close { color: var(--text-faint); font-size: .85rem; padding: 6px; }

/* ---------- download page ---------- */
.dl-main { max-width: 900px; margin: 0 auto; padding: 40px 24px 90px; }
.dl-hero { display: flex; align-items: center; gap: 26px; margin-bottom: 40px; }
.dl-hero .dl-icon {
  width: 108px; height: 108px; border-radius: 26px;
  box-shadow: 0 20px 50px rgba(var(--brand-rgb), .45);
}
.dl-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 850; letter-spacing: -.5px; }
.dl-hero p { color: var(--text-dim); margin-top: 8px; max-width: 460px; line-height: 1.5; }

.dl-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.dl-card {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 20px; padding: 22px;
}
.dl-card-head { display: flex; align-items: center; gap: 12px; color: var(--text); }
.dl-card-head h3 { font-size: 1.1rem; font-weight: 800; }
.dl-card-head .dl-sub { font-size: .76rem; color: var(--text-faint); }
.dl-btn { justify-content: center; }
.dl-btn.disabled {
  opacity: .55; pointer-events: none;
  background: var(--bg-soft); color: var(--text-dim); box-shadow: none;
}
.dl-note { font-size: .78rem; color: var(--text-faint); line-height: 1.5; }
.ios-steps { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.ios-steps li { display: flex; align-items: center; gap: 12px; font-size: .88rem; color: var(--text-dim); }
.ios-steps li b {
  width: 26px; height: 26px; flex: 0 0 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(var(--brand-rgb), .18); color: var(--accent-soft);
  font-size: .8rem;
}
.ios-steps li span { display: inline-flex; align-items: center; gap: 5px; }
.dl-card .qr {
  align-self: center;
  width: 200px; height: 200px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #0a0a14;
}
.dl-platforms { margin-top: 10px; font-weight: 800; letter-spacing: 1px; font-size: .85rem; color: var(--accent-soft); }
.small-dl { padding: 10px 18px; font-size: .82rem; }
.qr-strip {
  display: flex; align-items: center; gap: 22px;
  margin-top: 26px; padding: 18px 24px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
}
.qr-strip img {
  width: 120px; height: 120px; border-radius: 12px;
  border: 1px solid var(--line); background: #0a0a14;
}
.qr-strip b { display: block; font-size: 1rem; margin-bottom: 6px; }
.qr-strip span { color: var(--text-dim); font-size: .85rem; line-height: 1.5; }
.dl-feats {
  display: flex; gap: 26px; flex-wrap: wrap;
  justify-content: center;
  margin-top: 44px;
}
.dl-feats div { display: flex; align-items: center; gap: 10px; color: var(--text-dim); font-size: .9rem; }
.dl-feats span { font-size: 1.3rem; }
.dl-feats b { font-weight: 600; }

/* ---------- ad slots (see js/ads.js) ---------- */
.ad-layer {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  background: linear-gradient(135deg, #17172f, #0a0a14);
  animation: pop .2s ease;
}
.ad-layer .ad-tag,
.ad-banner-slot .ad-tag {
  position: absolute; top: 10px; left: 10px;
  font-size: .58rem; font-weight: 800; letter-spacing: 1.5px;
  padding: 3px 8px; border-radius: 6px;
  background: rgba(255, 255, 255, .14); color: #fff;
  border: 1px solid rgba(255, 255, 255, .25);
}
.ad-layer .ad-creative { text-align: center; padding: 0 24px; }
.ad-layer .ad-brand {
  font-size: 1.4rem; font-weight: 900; letter-spacing: -.3px;
  background: var(--brand-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.ad-layer .ad-sub { font-size: .78rem; color: var(--text-dim); margin-top: 8px; }
.ad-layer .ad-skip {
  padding: 9px 18px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .3);
  color: #fff; font-weight: 700; font-size: .8rem;
  transition: opacity .2s;
}
.ad-layer .ad-skip:disabled { opacity: .45; }
.ad-layer .ad-skip:not(:disabled):hover { background: rgba(255, 255, 255, .14); }

.ad-banner-slot {
  position: relative;
  min-height: 90px;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed rgba(255, 255, 255, .18);
  border-radius: 14px;
  background: rgba(255, 255, 255, .03);
}
.ad-banner-slot .ad-banner-note { font-size: .78rem; color: var(--text-faint); padding: 0 40px; text-align: center; }

/* ---------- admin login gate ---------- */
.login-back { display: none; }
.login-back.open { display: grid; }
.modal.login { width: min(360px, 100%); }
.modal.login input {
  width: 100%;
  padding: 12px 14px; margin-bottom: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--text);
  font-size: .95rem; outline: none;
}
.modal.login input:focus { border-color: var(--brand); }
.modal.login .btn { width: 100%; }
.login-error { color: var(--danger); font-size: .82rem; margin: -4px 0 10px; text-align: center; }

/* ---------- installation guide ---------- */
.tutorial { margin-top: 40px; }
.tutorial h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 16px; }
.tut {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 0 20px;
  margin-bottom: 12px;
}
.tut summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: 10px;
  padding: 16px 0; font-weight: 800; font-size: 1rem;
}
.tut summary::-webkit-details-marker { display: none; }
.tut summary::after { content: '›'; margin-left: auto; font-size: 1.3rem; color: var(--text-faint); transition: rotate .2s; }
.tut[open] summary::after { rotate: 90deg; }
.tut-steps { display: flex; flex-direction: column; gap: 10px; padding: 2px 0 12px; }
.tut-steps li { display: flex; align-items: baseline; gap: 12px; color: var(--text-dim); font-size: .9rem; line-height: 1.5; }
.tut-steps li::before {
  content: counter(tut-counter, decimal-leading-zero);
  counter-increment: tut-counter;
  color: var(--brand-2); font-weight: 800; font-size: .8rem; flex: 0 0 auto;
}
.tut ol { counter-reset: tut-counter; }
.tut-faq {
  font-size: .8rem; color: var(--text-faint); line-height: 1.6;
  border-top: 1px dashed var(--line);
  padding: 10px 0 16px; margin-top: 2px;
}

/* ---------- business contact ---------- */
.biz-card {
  margin-top: 26px; padding: 24px;
  background: linear-gradient(135deg, rgba(139,92,246,.12), rgba(34,211,238,.08));
  border: 1px solid rgba(var(--brand-rgb), .35);
  border-radius: 20px;
}
.biz-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.biz-head h2 { font-size: 1.15rem; font-weight: 800; }
.biz-dot { width: 9px; height: 9px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 10px #4ade80; animation: biz-pulse 2s infinite; }
@keyframes biz-pulse { 50% { opacity: .35; } }
.biz-note { color: var(--text-dim); font-size: .85rem; margin-bottom: 16px; }
.biz-rows { display: flex; flex-direction: column; gap: 10px; }
.biz-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; border-radius: 14px;
  background: var(--bg-soft); border: 1px solid var(--line);
  color: var(--text); text-align: left; width: 100%;
  transition: border-color .15s, transform .15s;
}
a.biz-row:hover { border-color: var(--brand); transform: translateX(3px); }
.biz-app { font-size: 1.2rem; }
.biz-appname { font-weight: 700; font-size: .9rem; min-width: 70px; }
.biz-id { font-weight: 800; font-size: 1rem; letter-spacing: .5px; color: var(--accent-soft); user-select: all; }
.biz-copy {
  margin-left: auto; flex: 0 0 auto;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text-dim);
  font-size: .78rem; font-weight: 600;
  transition: color .15s, border-color .15s;
}
.biz-copy:hover { color: var(--text); border-color: var(--brand); }

.contact-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 26px; padding: 13px 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  font-size: .85rem; color: var(--text-dim);
}
.contact-bar a { color: var(--text); }
.contact-bar a:hover { color: var(--accent-soft); }
.contact-bar b { color: var(--accent-soft); }
.cb-sep { color: var(--text-faint); }
.admin-contact { margin-top: 26px; color: var(--text-faint); font-size: .85rem; }
.admin-contact b { color: var(--text-dim); }

/* ---------- legal pages ---------- */
.legal-main { max-width: 780px; margin: 0 auto; padding: 40px 24px 90px; }
.legal-main h1 { font-size: 2rem; font-weight: 850; margin-bottom: 4px; }
.legal-updated { color: var(--text-faint); font-size: .82rem; margin-bottom: 28px; }
.legal-main h2 { font-size: 1.1rem; font-weight: 800; margin: 28px 0 10px; }
.legal-main p, .legal-main li { color: var(--text-dim); font-size: .93rem; line-height: 1.75; }
.legal-main ul { padding-left: 22px; margin: 8px 0; }
.legal-main a { color: var(--brand-2); }
.legal-main b { color: var(--text); }

/* ---------- admin stats dashboard ---------- */
.stats-dash { margin-bottom: 26px; }
.stats-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 4px;
}
.stat-card b { font-size: 1.7rem; font-weight: 900; color: var(--accent-soft); }
.stat-card span { font-size: .78rem; color: var(--text-faint); }
.stats-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.stats-col { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; }
.stats-col h4 { font-size: .8rem; letter-spacing: 1px; text-transform: uppercase; color: var(--text-faint); margin-bottom: 12px; }
.st-top { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.st-top li { display: flex; align-items: center; gap: 10px; font-size: .85rem; padding: 4px 0; }
.st-top .st-no { width: 22px; color: var(--text-faint); font-weight: 800; font-style: italic; }
.st-top .st-no.top { color: var(--gold); }
.st-top b { margin-left: auto; color: var(--accent-soft); }
.st-top .st-empty { color: var(--text-faint); }
.st-trend { display: flex; flex-direction: column; gap: 8px; }
.st-bar-row { display: flex; align-items: center; gap: 10px; font-size: .78rem; color: var(--text-dim); }
.st-bar { flex: 1; height: 14px; border-radius: 7px; background: var(--track); overflow: hidden; }
.st-bar i { display: block; height: 100%; background: var(--brand-grad); border-radius: 7px; }
.st-bar-row b { min-width: 30px; text-align: right; color: var(--text); }

/* ---------- share ---------- */
.share-nav-btn {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--text-dim);
  transition: color .15s, border-color .15s;
}
.share-nav-btn:hover { color: var(--text); border-color: rgba(255,255,255,.25); }
.modal.share { width: min(400px, 100%); }
.share-link { display: flex; gap: 8px; margin-bottom: 16px; }
.share-link input {
  flex: 1; min-width: 0;
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--text);
  font-size: .8rem; outline: none;
}
.share-link .btn { padding: 10px 16px; font-size: .82rem; white-space: nowrap; }
.share-channels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.share-ch {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 4px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-soft);
  color: var(--text); font-size: .72rem; font-weight: 600;
  transition: border-color .15s, transform .15s;
}
.share-ch:hover { border-color: var(--brand); transform: translateY(-2px); }
.share-ch .sc-icon { font-size: 1.3rem; }
.modal.share .btn { width: 100%; }

/* ---------- tap-to-play overlay ---------- */
.tap-to-play {
  position: absolute; inset: 0; z-index: 25;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
  background: rgba(0, 0, 0, .45);
  border: none; color: #fff; cursor: pointer; width: 100%;
}
.ttp-circle {
  width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(229, 9, 20, .92);
  font-size: 2rem; padding-left: 6px;
  box-shadow: 0 10px 40px rgba(229, 9, 20, .5);
  transition: transform .15s;
}
.tap-to-play:hover .ttp-circle, .tap-to-play:active .ttp-circle { transform: scale(1.08); }
.ttp-label { font-size: .9rem; font-weight: 600; text-shadow: 0 2px 8px rgba(0,0,0,.6); }

/* ---------- fullscreen swipe transition ---------- */
.swipe-veil {
  position: absolute; inset: 0; z-index: 30;
  background: #000; opacity: 0;
  transition: opacity .16s ease;
  pointer-events: none;
}
.swipe-veil.show { opacity: 1; }
.swipe-veil.fade { opacity: 0; transition: opacity .24s ease; }
.ad-video-el { width: 100%; height: 100%; object-fit: contain; background: #000; }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line);
  background: var(--footer-bg);
  padding: 44px 32px 30px;
}
.foot-inner { max-width: 1280px; margin: 0 auto; }
.foot-top { display: flex; gap: 40px; flex-wrap: wrap; margin-bottom: 34px; }
.foot-brand { max-width: 320px; }
.foot-brand .logo { margin-bottom: 12px; }
.foot-brand p { color: var(--text-dim); font-size: .86rem; line-height: 1.6; }
.foot-cols { display: flex; gap: 60px; flex-wrap: wrap; margin-left: auto; }
.foot-col h4 { font-size: .8rem; letter-spacing: 1.5px; color: var(--text-faint); margin-bottom: 14px; text-transform: uppercase; }
.foot-col a { display: block; color: var(--text-dim); font-size: .88rem; padding: 5px 0; }
.foot-col a:hover { color: var(--text); }
.foot-bottom {
  border-top: 1px solid var(--line); padding-top: 22px;
  display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
  color: var(--text-faint); font-size: .8rem;
}
.foot-bottom .right { margin-left: auto; display: flex; gap: 16px; }

/* ============================================================
   WATCH PAGE
   ============================================================ */
.watch-page { min-height: 100vh; }
.watch-layout {
  max-width: 1200px; margin: 0 auto;
  padding: 24px 32px 70px;
  display: grid; grid-template-columns: minmax(320px, 460px) 1fr;
  gap: 40px; align-items: start;
}

.player-col { position: sticky; top: 84px; }

.player {
  position: relative;
  width: 100%; max-width: 460px; margin: 0 auto;
  aspect-ratio: 9 / 16;
  border-radius: 20px; overflow: hidden;
  background: #000;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .65), 0 0 0 1px var(--line);
}
.player video { width: 100%; height: 100%; object-fit: cover; display: block; }

.player .tap-zone { position: absolute; inset: 0 0 64px 0; }

.player .top-grad {
  position: absolute; top: 0; left: 0; right: 0; height: 90px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .6), transparent);
  pointer-events: none; opacity: 0; transition: opacity .25s;
}
.player .bot-grad {
  position: absolute; bottom: 0; left: 0; right: 0; height: 110px;
  background: linear-gradient(0deg, rgba(0, 0, 0, .78), transparent);
  pointer-events: none;
}
.player .center-flash {
  position: absolute; inset: 0; display: grid; place-items: center;
  pointer-events: none;
}
.player .center-flash .disc {
  width: 74px; height: 74px; border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  display: grid; place-items: center;
  opacity: 0; transform: scale(.7); transition: all .2s;
}
.player .center-flash.show .disc { opacity: 1; transform: scale(1); }

.player-hud { position: absolute; inset: 0; pointer-events: none; }
.player-hud .top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  opacity: 0; transition: opacity .25s;
}
.player:hover .player-hud .top, .player.playing-pause .player-hud .top { opacity: 1; }
.player-hud .top .ep-num { font-weight: 800; font-size: .92rem; text-shadow: 0 2px 8px rgba(0,0,0,.8); }
.player-hud .top .fav-btn { margin-left: auto; pointer-events: auto; }

.player-hud .bottom {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 0 14px 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.hud-row { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, .0);
  transition: background .15s, transform .15s;
  pointer-events: auto;
}
.icon-btn:hover { background: rgba(255, 255, 255, .16); transform: scale(1.08); }
.icon-btn:disabled { opacity: .35; }
.hud-row .time { font-size: .74rem; font-variant-numeric: tabular-nums; color: rgba(255,255,255,.9); }

.progress {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 5px; border-radius: 999px;
  background: rgba(255, 255, 255, .25);
  outline: none; pointer-events: auto;
  cursor: pointer;
}
.progress::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.progress::-moz-range-thumb { width: 14px; height: 14px; border: none; border-radius: 50%; background: #fff; }

.ep-nav-btns { display: flex; gap: 10px; margin-top: 14px; max-width: 460px; margin-left: auto; margin-right: auto; }
.ep-nav-btns .btn { flex: 1; justify-content: center; padding: 11px 0; font-size: .88rem; }
.ep-nav-btns .btn:disabled { opacity: .4; cursor: default; }

/* info column */
.info-col .badge-line { margin-bottom: 12px; }
.info-col h1 { font-size: 1.9rem; font-weight: 850; letter-spacing: -.4px; line-height: 1.15; }
.info-col .tagline { color: #e3c9ff; font-weight: 600; margin: 8px 0 12px; }
.info-col .stats { display: flex; gap: 18px; flex-wrap: wrap; color: var(--text-dim); font-size: .88rem; margin-bottom: 16px; }
.info-col .stats b { color: var(--gold); }
.info-col .desc { color: var(--text-dim); line-height: 1.7; font-size: .95rem; margin-bottom: 20px; }
.info-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; }

.ep-list h3 {
  font-size: 1.05rem; font-weight: 800; margin-bottom: 4px;
  display: flex; align-items: center; gap: 10px;
}
.ep-list .free-hint { font-size: .8rem; color: var(--text-dim); font-weight: 500; margin-bottom: 14px; }
.episodes {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.ep-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  text-align: left;
  transition: border-color .15s, background .15s, transform .15s;
  min-width: 0;
}
.ep-item:hover { background: var(--card-hover); transform: translateY(-2px); }
.ep-item.current { border-color: var(--brand); background: rgba(var(--brand-rgb), .14); }
.ep-item .num {
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-weight: 800; font-size: .82rem;
  background: rgba(255, 255, 255, .07); color: var(--text-dim);
}
.ep-item.current .num { background: var(--brand); color: #fff; }
.ep-item .et { min-width: 0; }
.ep-item .et .name {
  font-size: .82rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ep-item .et .sub { font-size: .68rem; color: var(--text-faint); margin-top: 2px; }
.ep-item.locked .et .sub { color: var(--gold); }
.ep-item .lock { margin-left: auto; color: var(--gold); flex: 0 0 auto; }
.ep-item .watching-dot {
  position: absolute; top: 8px; right: 8px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--brand-2);
  box-shadow: 0 0 8px var(--brand-2);
}

/* ---------- unlock modal ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5, 5, 12, .78);
  backdrop-filter: blur(6px);
  display: none; place-items: center;
  padding: 20px;
}
.modal-back.open { display: grid; }
.modal {
  width: min(400px, 100%);
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 22px;
  padding: 28px 26px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .7);
  animation: pop .22s ease;
}
@keyframes pop { from { transform: scale(.92) translateY(12px); opacity: 0; } }
.modal .m-icon {
  width: 62px; height: 62px; margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(251, 191, 36, .12);
  border: 1px solid rgba(251, 191, 36, .35);
  display: grid; place-items: center;
}
.modal h3 { text-align: center; font-size: 1.25rem; font-weight: 800; margin-bottom: 8px; }
.modal .m-desc { text-align: center; color: var(--text-dim); font-size: .9rem; line-height: 1.6; margin-bottom: 18px; }
.modal .balance {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 16px; border-radius: 12px;
  background: var(--bg-soft); border: 1px solid var(--line);
  font-size: .9rem; margin-bottom: 18px;
}
.modal .balance .val { color: var(--gold); font-weight: 800; }
.modal .m-actions { display: flex; flex-direction: column; gap: 10px; }
.modal .m-actions .btn { justify-content: center; }
.modal .btn-gold { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #201200; }
.modal .btn-gold:hover { transform: translateY(-2px); }
.modal .btn-text { color: var(--text-dim); font-size: .85rem; padding: 6px; }
.modal .btn-text:hover { color: var(--text); }
.modal .demo-note {
  margin-top: 14px; text-align: center;
  font-size: .72rem; color: var(--text-faint);
}

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 30px; left: 50%; translate: -50% 20px;
  background: #1c1c34; color: var(--text);
  border: 1px solid rgba(255, 255, 255, .14);
  padding: 12px 22px; border-radius: 999px;
  font-size: .88rem; font-weight: 600;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .6);
  opacity: 0; pointer-events: none;
  transition: opacity .25s, translate .25s;
  z-index: 300;
}
.toast.show { opacity: 1; translate: -50% 0; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .nav { padding: 0 16px; gap: 12px; }
  .nav-links { display: none; }
  .nav-spacer { display: none; }
  .search-wrap { width: auto; flex: 1; max-width: none; }
  .coins-chip .label { display: none; }
  .lang-btn { padding: 8px 10px; }
  .lang-btn #langCode { display: none; }
  .hero { min-height: 440px; height: 66vh; }
  .hero-art { display: none; }
  main { padding: 0 16px 50px; }
  body { padding-bottom: 62px; }
  body.watch-page { padding-bottom: 0; }
  .tabbar { display: flex; }
  footer { padding-bottom: 80px; }
  .rank-row { gap: 12px; padding: 10px 14px 10px 10px; }
  .rank-row img { width: 50px; height: 75px; flex-basis: 50px; }
  .rank-no { font-size: 1.15rem; width: 28px; flex-basis: 28px; }
  .rank-no.top { font-size: 1.35rem; }
  .rank-title { font-size: .9rem; }
  .play-mini { width: 36px; height: 36px; }
  .admin-main { padding: 20px 16px 80px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: span 1; }
  .poster-box { flex-direction: column; }
  .admin-row .admin-row-sub { display: none; }
  .stats-cols { grid-template-columns: 1fr; }
  .getapp-btn span { display: none; }
  .getapp-btn { padding: 8px 10px; }
  .app-banner { left: 10px; right: 10px; bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
  body.watch-page .app-banner { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .dl-hero { flex-direction: column; text-align: center; }
  .dl-cards { grid-template-columns: 1fr; }
  .qr-strip { flex-direction: column; text-align: center; gap: 12px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 16px 10px; }

  .watch-layout {
    grid-template-columns: 1fr;
    padding: 16px 16px 60px;
    gap: 26px;
  }
  .player-col { position: static; }
  .player { max-width: 100%; border-radius: 16px; }
  .episodes { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .info-col h1 { font-size: 1.5rem; }
  .foot-cols { gap: 34px; }
}

@media (max-width: 520px) {
  .hero-inner { padding: 0 20px; }
  .hero .desc { -webkit-line-clamp: 2; }
  .rail { grid-auto-columns: 132px; }
  .logo .wordmark { display: none; }
  .avatar { display: none; }
  .ep-item .et .sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
