/* ==========================================================================
   AnimeHub — Front-end styles (Dark / Premium / RTL / Mobile-first)
   ========================================================================== */
:root {
  --primary: #8b5cf6;
  --accent: #3b82f6;
  --bg: #07070f;
  --bg-2: #0b0b17;
  --surface: #11111e;
  --surface-2: #171729;
  --surface-3: #1f1f36;
  --border: rgba(255, 255, 255, .07);
  --border-2: rgba(255, 255, 255, .12);
  --text: #ececf8;
  --text-2: #c4c4dc;
  --muted: #8d8dab;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gold: #fbbf24;
  --grad: linear-gradient(135deg, var(--primary), var(--accent));
  --glow: 0 0 0 1px color-mix(in srgb, var(--primary) 40%, transparent), 0 8px 30px -6px color-mix(in srgb, var(--primary) 55%, transparent);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --header-h: 64px;
  --container: 1400px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; font-family: var(--font); font-size: 15px; line-height: 1.7;
  color: var(--text); background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 100% -10%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0; }
p { margin: 0; }
::selection { background: color-mix(in srgb, var(--primary) 60%, transparent); color: #fff; }
.i { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 1000; background: var(--primary); color: #fff; padding: 8px 16px; border-radius: 8px; }
.skip-link:focus { top: 10px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 16px; }
.container.narrow { max-width: 820px; }
.muted { color: var(--muted); }
.only-mobile { display: inline-flex; }
::-webkit-scrollbar { width: 10px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a44; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3a3a5c; }

/* ---------- Buttons ---------- */
.btn {
  --h: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding-inline: 18px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 700; font-size: 14px; white-space: nowrap; transition: all .25s var(--ease); user-select: none;
}
.btn .i { width: 18px; height: 18px; }
.btn-sm { --h: 36px; padding-inline: 14px; font-size: 13px; border-radius: 10px; }
.btn-lg { --h: 50px; padding-inline: 24px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 20px -8px color-mix(in srgb, var(--primary) 80%, transparent); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--glow); filter: brightness(1.08); }
.btn-glow { position: relative; }
.btn-glow::after { content: ''; position: absolute; inset: -2px; border-radius: inherit; background: var(--grad); filter: blur(14px); opacity: .45; z-index: -1; transition: opacity .3s; }
.btn-glow:hover::after { opacity: .8; }
.btn-glass { background: rgba(255, 255, 255, .07); border-color: var(--border-2); color: var(--text); backdrop-filter: blur(10px); }
.btn-glass:hover { background: rgba(255, 255, 255, .13); border-color: rgba(255, 255, 255, .22); }
.btn-glass.is-active { background: color-mix(in srgb, var(--primary) 22%, transparent); border-color: color-mix(in srgb, var(--primary) 60%, transparent); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border-2); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-icon-only { padding: 0; width: var(--h); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; position: relative;
  background: transparent; border: 1px solid transparent; color: var(--text-2); transition: all .2s;
}
.icon-btn:hover { background: var(--surface-2); color: #fff; border-color: var(--border); }
.icon-btn .i { width: 21px; height: 21px; }

/* ---------- Badges / pills ---------- */
.badge { display: inline-flex; align-items: center; height: 22px; padding-inline: 8px; border-radius: 7px; font-size: 11px; font-weight: 800; letter-spacing: .3px; line-height: 1; }
.badge-quality { background: rgba(7, 7, 15, .75); color: #fff; border: 1px solid rgba(255, 255, 255, .15); backdrop-filter: blur(6px); }
.badge-lang { background: var(--grad); color: #fff; }
.badge-draft { background: var(--warning); color: #111; position: absolute; top: 10px; inset-inline-start: 10px; }
.pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 700; background: rgba(255, 255, 255, .08); border: 1px solid var(--border-2); }
.status-ongoing { color: #4ade80; }
.pill.status-ongoing { background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .35); }
.status-completed { color: #93c5fd; }
.pill.status-completed { background: rgba(59, 130, 246, .12); border-color: rgba(59, 130, 246, .35); }
.status-upcoming { color: #fbbf24; }
.pill.status-upcoming { background: rgba(251, 191, 36, .12); border-color: rgba(251, 191, 36, .35); }
.chip { display: inline-flex; align-items: center; height: 34px; padding-inline: 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; font-weight: 700; color: var(--text-2); transition: .2s; white-space: nowrap; }
.chip:hover { color: #fff; border-color: var(--border-2); }
.chip.is-active { background: var(--grad); color: #fff; border-color: transparent; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; inset-inline: 0; z-index: 100; height: var(--header-h);
  background: linear-gradient(to bottom, rgba(7, 7, 15, .92), rgba(7, 7, 15, .6));
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid transparent; transition: background .3s, border-color .3s;
}
.site-header.is-scrolled { background: rgba(9, 9, 18, .94); border-bottom-color: var(--border); }
.page-home .site-header:not(.is-scrolled) { background: linear-gradient(to bottom, rgba(7, 7, 15, .85), transparent); backdrop-filter: none; -webkit-backdrop-filter: none; }
.header-inner { height: 100%; display: flex; align-items: center; gap: 10px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 20px; letter-spacing: -.3px; flex: none; }
.logo img { height: 38px; width: auto; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--grad); color: #fff;
  box-shadow: 0 0 20px -2px color-mix(in srgb, var(--primary) 70%, transparent); transform: rotate(-6deg);
}
.logo-mark .i { width: 17px; height: 17px; transform: rotate(6deg) translateX(-1px); }
.logo-mark-lg { width: 60px; height: 60px; border-radius: 18px; margin: 0 auto 14px; }
.logo-mark-lg .i { width: 26px; height: 26px; }
.logo-text { background: linear-gradient(90deg, #fff, #d8ccff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.main-nav { display: none; }
.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; min-width: 0; flex: 0 1 auto; }
.header-actions .search-box { display: none; }
.login-btn span { display: none; }
.login-btn { padding-inline: 10px; }
.user-btn { background: none; border: 2px solid transparent; padding: 0; border-radius: 50%; transition: .2s; }
.user-btn img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.user-btn:hover { border-color: var(--primary); }
.badge-dot { position: absolute; top: 3px; inset-inline-end: 2px; min-width: 18px; height: 18px; padding-inline: 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }

/* Search */
.search-box { position: relative; display: flex; align-items: center; }
.search-box input {
  width: 100%; height: 42px; padding-inline: 42px 14px; border-radius: 12px; border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, .05); outline: none; transition: .25s; font-size: 14px;
}
.search-box input::placeholder { color: var(--muted); }
.search-box input:focus { background: rgba(255, 255, 255, .08); border-color: color-mix(in srgb, var(--primary) 70%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.search-box .search-icon { position: absolute; inset-inline-start: 14px; color: var(--muted); width: 18px; height: 18px; pointer-events: none; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-results {
  position: absolute; top: calc(100% + 8px); inset-inline: 0; min-width: 320px; max-height: 70vh; overflow-y: auto; z-index: 50;
  background: rgba(17, 17, 30, .98); border: 1px solid var(--border-2); border-radius: var(--radius); box-shadow: 0 20px 50px -10px rgba(0, 0, 0, .8); padding: 6px;
  animation: pop .18s var(--ease);
}
.sr-item { display: flex; gap: 12px; padding: 8px; border-radius: 10px; align-items: center; transition: background .15s; }
.sr-item:hover, .sr-item.is-focus { background: var(--surface-3); }
.sr-item img { width: 46px; height: 64px; object-fit: cover; border-radius: 8px; background: var(--surface-2); flex: none; }
.sr-item strong { display: block; font-size: 14px; line-height: 1.4; }
.sr-item small { display: block; color: var(--muted); font-size: 12px; }
.sr-item mark { background: none; color: #c4b5fd; }
.sr-more { display: block; text-align: center; padding: 10px; font-size: 13px; font-weight: 700; color: #c4b5fd; border-top: 1px solid var(--border); margin-top: 4px; }
.sr-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 14px; }
.sr-loading { padding: 10px; display: grid; gap: 8px; }
.sr-loading span { height: 60px; border-radius: 10px; }

.search-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(5, 5, 12, .92); backdrop-filter: blur(10px); padding: 14px; animation: fade .2s; }
.search-overlay .search-box input { height: 52px; font-size: 16px; padding-inline-end: 52px; }
.search-overlay .search-box .icon-btn { position: absolute; inset-inline-end: 6px; }
.search-overlay .search-results { position: static; margin-top: 10px; min-width: 0; max-height: calc(100vh - 100px); }

/* Dropdowns */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0; min-width: 230px; z-index: 60;
  background: rgba(17, 17, 30, .98); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 6px;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, .8); display: none; animation: pop .18s var(--ease);
}
.dropdown.is-open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 9px; font-size: 14px; background: none; border: 0; text-align: start; color: var(--text-2); }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-3); color: #fff; }
.dropdown-menu form { margin: 0; }
.dropdown-user { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown-user strong { display: block; }
.dropdown-user small { color: var(--muted); font-size: 12px; direction: ltr; display: block; text-align: end; }
.dropdown-head { display: flex; justify-content: space-between; padding: 8px 12px; font-weight: 800; font-size: 14px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.dropdown-head a { font-size: 12px; color: #c4b5fd; padding: 0; width: auto; }
.notif-menu { width: min(340px, calc(100vw - 24px)); inset-inline-end: -50px; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item { display: block !important; }
.notif-item strong { display: block; font-size: 13.5px; color: var(--text); }
.notif-item small { display: block; font-size: 12px; color: var(--muted); }
.notif-item.is-unread { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.empty-mini { padding: 20px; text-align: center; color: var(--muted); font-size: 14px; }

/* Drawer */
.drawer { position: fixed; inset: 0; z-index: 300; visibility: hidden; }
.drawer.is-open { visibility: visible; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); opacity: 0; transition: opacity .3s; }
.drawer.is-open .drawer-backdrop { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: min(310px, 85vw); background: var(--bg-2); border-inline-end: 1px solid var(--border);
  transform: translateX(100%); transition: transform .35s var(--ease); display: flex; flex-direction: column; overflow-y: auto;
}
.drawer.is-open .drawer-panel { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.drawer-nav { padding: 10px; display: grid; gap: 2px; }
.drawer-nav a { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; font-weight: 700; color: var(--text-2); }
.drawer-nav a:hover, .drawer-nav a.is-active { background: var(--surface-2); color: #fff; }
.drawer-nav a.is-active { box-shadow: inset -3px 0 0 var(--primary); }

/* Toasts */
.toasts { position: fixed; top: calc(var(--header-h) + 12px); inset-inline-end: 12px; inset-inline-start: 12px; z-index: 500; display: grid; gap: 10px; justify-items: end; pointer-events: none; }
.toast {
  pointer-events: auto; max-width: 420px; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px;
  background: rgba(23, 23, 41, .97); border: 1px solid var(--border-2); border-inline-start: 4px solid var(--primary);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, .8); animation: toastIn .35s var(--ease);
}
.toast-success { border-inline-start-color: var(--success); }
.toast-error { border-inline-start-color: var(--danger); }
.toast-info { border-inline-start-color: var(--accent); }
.toast.is-leaving { animation: toastOut .3s forwards; }

.site-main { padding-top: var(--header-h); min-height: 70vh; }
.page-home .site-main { padding-top: 0; }

/* ---------- Hero slider ---------- */
.hero { position: relative; min-height: 560px; height: 82vh; max-height: 820px; overflow: hidden; isolation: isolate; }
.hero-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .9s var(--ease), visibility .9s; }
.hero-slide.is-active { opacity: 1; visibility: visible; z-index: 1; }
.hero-bg { position: absolute; inset: 0; z-index: -1; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: transform 8s linear; }
.hero-slide.is-active .hero-bg img { transform: scale(1); }
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--bg) 2%, rgba(7, 7, 15, .6) 40%, rgba(7, 7, 15, .35) 70%, rgba(7, 7, 15, .75)),
    linear-gradient(to left, rgba(7, 7, 15, .92) 0%, rgba(7, 7, 15, .55) 45%, transparent 75%);
}
.hero-inner { height: 100%; display: flex; align-items: flex-end; gap: 40px; padding-bottom: 90px; padding-top: calc(var(--header-h) + 20px); }
.hero-content { max-width: 640px; animation: heroIn .9s var(--ease) both; }
.hero-slide:not(.is-active) .hero-content { animation: none; }
.hero-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: #d8ccff; padding: 5px 12px; border-radius: 99px; background: color-mix(in srgb, var(--primary) 20%, transparent); border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent); margin-bottom: 14px; }
.hero-title { font-size: clamp(28px, 6vw, 56px); font-weight: 900; line-height: 1.2; text-shadow: 0 4px 30px rgba(0, 0, 0, .5); }
.hero-subtitle { color: var(--text-2); font-size: clamp(14px, 2vw, 18px); font-weight: 600; margin-top: 4px; text-align: right; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 14px; font-size: 14px; color: var(--text-2); font-weight: 600; }
.hero-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.meta-rating { color: var(--gold) !important; font-weight: 800 !important; }
.meta-rating .i { fill: currentColor; stroke: none; }
.hero-genres { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hero-genres a { font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 8px; background: rgba(255, 255, 255, .08); border: 1px solid var(--border-2); transition: .2s; }
.hero-genres a:hover { background: color-mix(in srgb, var(--primary) 30%, transparent); border-color: var(--primary); }
.hero-desc { margin-top: 14px; color: var(--text-2); font-size: 15px; line-height: 1.85; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-actions.center { justify-content: center; }
.hero-poster { display: none; }
.hero-controls { position: absolute; bottom: 26px; inset-inline: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; }
.hero-dots { display: flex; gap: 8px; }
.hero-dot { width: 34px; height: 5px; border-radius: 4px; border: 0; padding: 0; background: rgba(255, 255, 255, .22); overflow: hidden; }
.hero-dot span { display: block; height: 100%; width: 0; background: var(--grad); }
.hero-dot.is-active span { animation: dotFill var(--hero-interval, 7s) linear forwards; }
.hero-dot.is-active { background: rgba(255, 255, 255, .35); }
.hero-arrows { display: none; gap: 8px; }
.hero-empty { height: 60vh; min-height: 420px; display: flex; align-items: center; background: radial-gradient(circle at 70% 30%, color-mix(in srgb, var(--primary) 30%, transparent), transparent 60%); }
.hero-empty .hero-inner { align-items: center; padding-bottom: 0; }

/* ---------- Sections ---------- */
.section { margin-top: 38px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; }
.section-title small { color: var(--muted); font-size: 14px; font-weight: 600; }
.section-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 16%, transparent); color: #c4b5fd; border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); }
.section-icon .i { width: 18px; height: 18px; }
.section-tools { display: flex; align-items: center; gap: 6px; }
.more-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 700; color: var(--muted); transition: color .2s; margin-inline-end: 6px; }
.more-link:hover { color: #c4b5fd; }
.more-link .i { width: 16px; height: 16px; }
.scroll-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2); display: none; place-items: center; transition: .2s; }
.scroll-btn:hover { background: var(--grad); color: #fff; border-color: transparent; }
.scroll-btn .i { width: 18px; height: 18px; }
.row-scroller {
  display: grid; grid-auto-flow: column; grid-auto-columns: 42%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; padding-bottom: 6px; margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; overscroll-behavior-x: contain;
}
.row-scroller::-webkit-scrollbar { display: none; }
.row-scroller > * { scroll-snap-align: start; }
.row-scroller.row-episodes { grid-auto-columns: 78%; }

/* ---------- Cards ---------- */
.card { position: relative; min-width: 0; }
.card-link { display: block; }
.card-poster, .card-thumb { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); isolation: isolate; }
.card-poster { aspect-ratio: 7 / 10; }
.card-thumb { aspect-ratio: 16 / 9; }
.card-poster img, .card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), filter .4s; }
.card-poster::after, .card-thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(7, 7, 15, .85), transparent 45%); pointer-events: none; }
.card-badges { position: absolute; top: 8px; inset-inline-start: 8px; display: flex; gap: 4px; z-index: 2; flex-wrap: wrap; }
.card-rating { position: absolute; bottom: 8px; inset-inline-end: 8px; z-index: 2; display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 800; color: var(--gold); background: rgba(7, 7, 15, .75); padding: 2px 7px; border-radius: 7px; backdrop-filter: blur(6px); }
.card-rating .i { width: 12px; height: 12px; stroke: none; fill: currentColor; }
.card-ep { position: absolute; bottom: 8px; inset-inline-start: 8px; z-index: 2; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 7px; background: var(--grad); color: #fff; box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--primary) 80%, transparent); }
.card-hover {
  position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 12px;
  background: linear-gradient(to top, rgba(7, 7, 15, .96) 10%, rgba(12, 10, 30, .72)); opacity: 0; transition: opacity .3s var(--ease);
}
.card-hover-info { text-align: center; transform: translateY(10px); transition: transform .35s var(--ease); }
.card-hover-info p { font-size: 12px; color: var(--text-2); line-height: 1.6; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta-line { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.meta-line span + span::before { content: '•'; margin-inline-end: 8px; color: var(--muted); }
.play-circle {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 25%, transparent), 0 10px 30px -5px color-mix(in srgb, var(--primary) 80%, transparent);
  transform: scale(.7); transition: transform .35s var(--ease);
}
.play-circle .i { width: 22px; height: 22px; stroke: none; margin-inline-start: -3px; transform: scaleX(-1); }
[dir="rtl"] .play-circle .i { transform: none; margin-inline-start: 0; margin-left: 3px; }
.play-sm { position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; z-index: 3; opacity: 0; transition: all .3s var(--ease); }
.card-title { margin-top: 10px; font-size: 14.5px; font-weight: 700; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .2s; }
.card-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
@media (hover: hover) {
  .card-link:hover .card-poster img, .card-link:hover .card-thumb img { transform: scale(1.07); filter: brightness(.9); }
  .card-link:hover .card-hover { opacity: 1; }
  .card-link:hover .card-hover-info { transform: none; }
  .card-link:hover .play-circle { transform: scale(1); }
  .card-link:hover .play-sm { opacity: 1; }
  .card-link:hover .card-title { color: #c4b5fd; }
  .card-link:hover .card-poster, .card-link:hover .card-thumb { box-shadow: var(--glow); }
}
.card-poster, .card-thumb { transition: box-shadow .35s var(--ease), transform .35s var(--ease); }
.ep-number { position: absolute; bottom: 8px; inset-inline-start: 10px; z-index: 2; font-size: 22px; font-weight: 900; line-height: 1; text-shadow: 0 2px 10px rgba(0, 0, 0, .8); display: flex; align-items: baseline; gap: 6px; }
.ep-number small { font-size: 12px; font-weight: 700; color: var(--text-2); }
.ep-duration { position: absolute; bottom: 10px; inset-inline-end: 10px; z-index: 2; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: rgba(7, 7, 15, .75); direction: ltr; }
.ep-info { padding-inline: 2px; }
.progress-bar { position: absolute; bottom: 0; inset-inline: 0; height: 4px; background: rgba(255, 255, 255, .15); z-index: 3; }
.progress-bar span { display: block; height: 100%; background: var(--grad); box-shadow: 0 0 10px var(--primary); }
.continue-card .card-thumb .play-sm { opacity: .9; }
.card-remove { position: absolute; top: 8px; inset-inline-end: 8px; z-index: 5; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(7, 7, 15, .8); color: #fff; display: grid; place-items: center; opacity: .85; }
.card-remove:hover { background: var(--danger); }
.card-remove .i { width: 16px; height: 16px; }

.grid-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
.grid-episodes { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 16px; }

/* Skeleton */
.skeleton { position: relative; overflow: hidden; }
.skeleton::before, .skeleton-comment, .sr-loading span {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
.skeleton::before { content: ''; position: absolute; inset: 0; z-index: 0; }
.skeleton img { position: relative; z-index: 1; }
.skeleton-comment { height: 90px; border-radius: var(--radius); margin-bottom: 12px; }

/* Genres */
.genre-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.genre-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-weight: 700; font-size: 14px; transition: .25s var(--ease); }
.genre-chip small { font-size: 11px; color: var(--muted); background: var(--surface-3); padding: 0 7px; border-radius: 6px; }
.genre-chip:hover { border-color: color-mix(in srgb, var(--primary) 60%, transparent); background: color-mix(in srgb, var(--primary) 14%, var(--surface)); transform: translateY(-2px); }
.genre-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.genre-tile {
  position: relative; padding: 22px 18px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
  background: linear-gradient(135deg, hsl(calc(var(--h) + 250) 70% 30% / .55), hsl(calc(var(--h) + 210) 70% 20% / .35)), var(--surface);
  transition: .3s var(--ease); display: grid; gap: 2px;
}
.genre-tile::after { content: ''; position: absolute; width: 120px; height: 120px; border-radius: 50%; inset-inline-end: -40px; bottom: -50px; background: hsl(calc(var(--h) + 250) 80% 60% / .25); filter: blur(10px); }
.genre-tile strong { font-size: 18px; font-weight: 800; }
.genre-tile span { font-size: 12px; color: var(--text-2); text-align: right; }
.genre-tile small { color: var(--muted); font-size: 12px; font-weight: 700; }
.genre-tile:hover { transform: translateY(-4px); border-color: var(--border-2); box-shadow: 0 16px 30px -12px rgba(0, 0, 0, .7); }

/* ---------- Page hero / breadcrumbs ---------- */
.page-hero { padding: 30px 0 22px; position: relative; }
.page-hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: clamp(24px, 4vw, 34px); font-weight: 900; display: flex; align-items: center; gap: 10px; }
.page-subtitle { color: var(--muted); margin-top: 4px; font-weight: 600; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.breadcrumbs a:hover { color: #c4b5fd; }
.letters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; direction: ltr; justify-content: flex-end; }
.letter { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 800; color: var(--text-2); transition: .2s; }
.letter:hover, .letter.is-active { background: var(--grad); color: #fff; border-color: transparent; }

/* Filters */
.filters-toggle { margin-bottom: 12px; }
.filters { display: none; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 22px; }
.filters.is-open { display: grid; animation: pop .2s var(--ease); }
.field-select { display: grid; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
select, .field input, .field textarea, .field select, .input {
  width: 100%; height: 42px; padding-inline: 12px; border-radius: 11px; border: 1px solid var(--border-2); background: var(--bg-2); color: var(--text);
  outline: none; transition: .2s; font-size: 14px;
}
select { appearance: none; padding-inline-end: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239a9ab8' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; }
.field textarea { height: auto; padding-block: 10px; resize: vertical; line-height: 1.7; }
select:focus, .field input:focus, .field textarea:focus, .input:focus { border-color: color-mix(in srgb, var(--primary) 70%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); }
.filters-actions { display: flex; gap: 8px; align-items: flex-end; grid-column: 1 / -1; }
.results { position: relative; min-height: 200px; transition: opacity .2s; }
.results.is-loading { opacity: .45; pointer-events: none; }

/* Pagination */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 34px 0 10px; }
.page-link { min-width: 40px; height: 40px; padding-inline: 12px; display: grid; place-items: center; border-radius: 11px; background: var(--surface); border: 1px solid var(--border); font-weight: 700; font-size: 14px; transition: .2s; }
.page-link:hover { border-color: var(--border-2); background: var(--surface-2); }
.page-link.is-current { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--glow); }
.page-dots { display: grid; place-items: center; color: var(--muted); padding-inline: 4px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); display: grid; justify-items: center; gap: 8px; }
.empty-state > .i { width: 54px; height: 54px; color: color-mix(in srgb, var(--primary) 70%, #fff); opacity: .7; margin-bottom: 6px; }
.empty-state h3 { color: var(--text); font-size: 20px; }
.empty-state .btn { margin-top: 12px; }

/* ---------- Anime details ---------- */
.detail-hero { position: relative; padding: 26px 0 30px; isolation: isolate; overflow: hidden; }
.detail-backdrop { position: absolute; inset: 0; z-index: -1; }
.detail-backdrop img { width: 100%; height: 100%; object-fit: cover; filter: blur(2px) saturate(1.1); transform: scale(1.05); opacity: .55; }
.detail-backdrop::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg) 5%, rgba(7, 7, 15, .75) 50%, rgba(7, 7, 15, .6)), linear-gradient(to left, rgba(7, 7, 15, .85), transparent); }
.detail-inner { display: grid; gap: 22px; }
.detail-poster { position: relative; width: 170px; margin-inline: auto; border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 25px 50px -15px rgba(0, 0, 0, .8), 0 0 0 1px var(--border-2); }
.detail-poster img { width: 100%; height: auto; aspect-ratio: 7/10; object-fit: cover; }
.detail-title { font-size: clamp(26px, 5vw, 42px); font-weight: 900; }
.detail-original { color: var(--text-2); font-weight: 600; text-align: right; }
.detail-original span { color: var(--muted); }
.detail-desc { margin-top: 14px; color: var(--text-2); line-height: 1.9; max-width: 820px; position: relative; }
.detail-desc.is-clamped p { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.readmore-btn { background: none; border: 0; color: #c4b5fd; font-weight: 700; padding: 0; margin-top: 4px; font-size: 14px; }
.detail-layout { display: grid; gap: 20px; margin-top: 10px; }
.panel { background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-title { font-size: 16px; font-weight: 800; margin-bottom: 12px; }
.panel-head .panel-title { margin: 0; }
.info-list { margin: 0; display: grid; gap: 0; }
.info-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.info-list > div:last-child { border: 0; }
.info-list dt { color: var(--muted); font-weight: 600; }
.info-list dd { margin: 0; font-weight: 700; text-align: end; }
.rating-panel { margin-top: 16px; text-align: center; }
.rating-summary { display: flex; justify-content: center; align-items: baseline; gap: 6px; }
.rating-summary strong { font-size: 36px; font-weight: 900; background: linear-gradient(90deg, #fde68a, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rating-summary small { color: var(--muted); margin-inline-start: 8px; }
.stars { display: flex; justify-content: center; gap: 4px; direction: ltr; margin: 8px 0; }
.star { background: none; border: 0; padding: 4px; color: #3a3a58; transition: transform .15s, color .15s; }
.star .i { width: 30px; height: 30px; stroke: none; fill: currentColor; }
.star.is-on, .star.is-hover { color: var(--gold); filter: drop-shadow(0 0 6px rgba(251, 191, 36, .5)); }
.star:hover { transform: scale(1.15); }
.ep-search { position: relative; display: flex; align-items: center; flex: 1; max-width: 260px; min-width: 150px; }
.ep-search .i { position: absolute; inset-inline-start: 11px; width: 16px; height: 16px; color: var(--muted); }
.ep-search input { width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--bg-2); padding-inline: 34px 10px; outline: none; font-size: 13.5px; }
.ep-search input:focus { border-color: var(--primary); }
.ep-list { display: grid; gap: 8px; transition: opacity .2s; }
.ep-list.is-loading { opacity: .4; }
.ep-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); transition: .2s var(--ease); }
.ep-item:hover { border-color: color-mix(in srgb, var(--primary) 50%, transparent); background: color-mix(in srgb, var(--primary) 8%, var(--bg-2)); transform: translateX(-3px); }
.ep-item-num { width: 44px; height: 44px; flex: none; border-radius: 11px; display: grid; place-items: center; font-weight: 900; font-size: 16px; background: var(--surface-3); }
.ep-item:hover .ep-item-num { background: var(--grad); color: #fff; }
.ep-item-body { flex: 1; min-width: 0; }
.ep-item-body strong { display: block; font-size: 14.5px; }
.ep-item-body small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-item-meta { display: none; gap: 4px; }
.ep-item-play { color: var(--muted); }
.ep-item-play .i { width: 18px; height: 18px; stroke: none; }
.ep-item.is-watched .ep-item-num { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--success) 70%, transparent); }
.ep-item.is-watched .ep-item-body strong::after { content: ' ✓'; color: var(--success); font-size: 12px; }
.ep-item.is-draft { opacity: .55; border-style: dashed; }
.ep-pager { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .85); backdrop-filter: blur(6px); }
.modal-box { position: relative; width: min(960px, 100%); background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border-2); overflow: hidden; animation: pop .25s var(--ease); }
.modal-close { position: absolute; top: 8px; inset-inline-end: 8px; z-index: 2; background: rgba(0, 0, 0, .6); }
.ratio-16x9 { aspect-ratio: 16/9; }
.ratio-16x9 iframe { width: 100%; height: 100%; border: 0; }

/* ---------- Watch page ---------- */
.page-watch .site-main { padding-top: calc(var(--header-h) + 14px); }
.watch-layout { display: grid; gap: 20px; }
.watch-main { min-width: 0; }
.player-shell { margin-inline: -16px; }
.servers-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.servers-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; color: var(--text-2); }
.servers-list { display: flex; flex-wrap: wrap; gap: 8px; }
.server-btn { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.3; padding: 7px 16px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--border-2); font-weight: 800; font-size: 13.5px; transition: .2s; }
.server-btn small { font-size: 10.5px; color: var(--muted); font-weight: 700; }
.server-btn:hover { border-color: var(--primary); }
.server-btn.is-active { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--glow); }
.server-btn.is-active small { color: rgba(255, 255, 255, .8); }
.watch-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 14px; margin-top: 18px; }
.watch-title { font-size: clamp(20px, 3vw, 26px); font-weight: 900; }
.watch-title span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.watch-sub { color: var(--muted); font-size: 13.5px; font-weight: 600; margin-top: 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.watch-sub .i { width: 15px; height: 15px; }
.watch-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.watch-desc { margin-top: 12px; color: var(--text-2); font-size: 14.5px; }
.watch-side { display: grid; gap: 16px; align-content: start; }
.side-episodes { padding: 14px; }
.ep-search-sm { max-width: 140px; min-width: 110px; }
.side-ep-list { max-height: 420px; overflow-y: auto; display: grid; gap: 6px; padding-inline-end: 4px; margin-inline-end: -6px; }
.side-ep { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; transition: .15s; }
.side-ep:hover { background: var(--surface-2); }
.side-ep.is-current { background: color-mix(in srgb, var(--primary) 16%, transparent); border-color: color-mix(in srgb, var(--primary) 45%, transparent); }
.side-ep-num { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--surface-3); font-weight: 900; font-size: 14px; }
.side-ep.is-current .side-ep-num { background: var(--grad); color: #fff; }
.side-ep.is-watched .side-ep-num { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--success) 70%, transparent); }
.side-ep-title { flex: 1; min-width: 0; font-weight: 700; font-size: 13.5px; }
.side-ep-title small { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.now-playing { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.now-playing i { width: 3px; background: var(--primary); border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.now-playing i:nth-child(2) { animation-delay: .2s; }
.now-playing i:nth-child(3) { animation-delay: .4s; }
.side-anime { display: flex; gap: 14px; align-items: center; transition: border-color .2s; }
.side-anime:hover { border-color: color-mix(in srgb, var(--primary) 50%, transparent); }
.side-anime img { width: 70px; height: auto; aspect-ratio: 7/10; object-fit: cover; border-radius: 10px; flex: none; }
.side-anime strong { display: block; font-size: 15px; }
.side-anime small { color: var(--muted); font-size: 12.5px; }
.mini-genres { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.mini-genres span { font-size: 11px; padding: 1px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-weight: 700; }

/* Comments */
.comments { margin-top: 24px; }
.comment-form { display: flex; gap: 12px; margin-bottom: 18px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-3); }
.comment-form-body { flex: 1; min-width: 0; }
.comment-form textarea { width: 100%; min-height: 84px; padding: 12px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--bg-2); outline: none; resize: vertical; line-height: 1.7; }
.comment-form textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); }
.comment-form-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.login-prompt { padding: 14px; border-radius: 12px; background: var(--bg-2); border: 1px dashed var(--border-2); text-align: center; margin-bottom: 16px; color: var(--text-2); font-size: 14px; display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; }
.login-prompt a { color: #c4b5fd; font-weight: 800; }
.comment { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); animation: fade .3s; }
.comment:first-child { border-top: 0; }
.comment-body { flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.comment-meta strong { font-size: 14px; }
.comment-meta time { color: var(--muted); font-size: 12px; }
.role-badge { font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 6px; background: var(--grad); color: #fff; }
.pending-badge { font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 6px; background: rgba(245, 158, 11, .2); color: var(--warning); }
.comment-text { margin-top: 4px; white-space: pre-wrap; word-wrap: break-word; color: var(--text-2); font-size: 14.5px; }
.comment-actions { display: flex; gap: 4px; margin-top: 6px; }
.comment-actions button { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; color: var(--muted); font-size: 12.5px; font-weight: 700; padding: 4px 8px; border-radius: 8px; }
.comment-actions button:hover { background: var(--surface-2); color: var(--text); }
.comment-actions button.is-liked { color: #c4b5fd; }
.comment-actions .i { width: 15px; height: 15px; }
.comment-replies { margin-top: 6px; padding-inline-start: 14px; border-inline-start: 2px solid var(--border-2); }
.comment-replies .comment { padding: 10px 0; }
.comment-replies .avatar { width: 32px; height: 32px; }
.reply-form { margin-top: 10px; }
.reply-form textarea { min-height: 60px; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: calc(100vh - var(--header-h) - 200px); display: grid; place-items: center; padding: 40px 16px; }
.auth-card {
  width: min(440px, 100%); padding: 30px 22px; border-radius: 24px; background: linear-gradient(180deg, rgba(23, 23, 41, .92), rgba(17, 17, 30, .96));
  border: 1px solid var(--border-2); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), 0 0 0 1px color-mix(in srgb, var(--primary) 12%, transparent); position: relative; overflow: hidden;
}
.auth-card::before { content: ''; position: absolute; top: -120px; inset-inline-start: 50%; width: 300px; height: 200px; transform: translateX(50%); background: var(--grad); filter: blur(90px); opacity: .35; pointer-events: none; }
.auth-head { text-align: center; margin-bottom: 22px; position: relative; }
.auth-head h1 { font-size: 24px; font-weight: 900; }
.auth-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--muted); font-size: 14px; }
.auth-foot a { color: #c4b5fd; font-weight: 800; }
.form { display: grid; gap: 14px; position: relative; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 700; color: var(--text-2); }
.field input[type="file"] { padding: 8px; height: auto; }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon .i { position: absolute; inset-inline-start: 13px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.input-icon input { padding-inline-start: 42px !important; height: 46px !important; }
.form-row { display: flex; gap: 10px; align-items: center; }
.form-row.between { justify-content: space-between; font-size: 13.5px; }
.form-row.between a { color: #c4b5fd; font-weight: 700; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); }

/* Profile */
.profile-head { display: flex; align-items: center; gap: 18px; }
.profile-avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid transparent; background: var(--grad) border-box; box-shadow: var(--glow); }
.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card { padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); display: grid; gap: 2px; transition: .2s; }
.stat-card .i { width: 22px; height: 22px; color: #c4b5fd; }
.stat-card strong { font-size: 24px; font-weight: 900; }
.stat-card span { color: var(--muted); font-size: 13px; font-weight: 600; }
a.stat-card:hover { border-color: color-mix(in srgb, var(--primary) 50%, transparent); }
.profile-grid { display: grid; gap: 16px; }
.notif-page { display: grid; gap: 8px; }
.notif-row { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.notif-row.is-unread { border-color: color-mix(in srgb, var(--primary) 50%, transparent); }
.notif-row > span:nth-child(2) { flex: 1; }
.notif-row strong { display: block; }
.notif-row small { color: var(--muted); }
.notif-row time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.notif-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 18%, transparent); color: #c4b5fd; flex: none; }

/* Errors */
.error-page { min-height: 70vh; display: grid; place-content: center; text-align: center; padding: 60px 16px; gap: 10px; }
.error-code { font-size: clamp(110px, 24vw, 200px); font-weight: 900; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; position: relative; filter: drop-shadow(0 0 40px color-mix(in srgb, var(--primary) 50%, transparent)); animation: floaty 4s ease-in-out infinite; }
.error-page h1 { font-size: 26px; font-weight: 900; }
.error-page p { color: var(--muted); max-width: 460px; margin-inline: auto; }
.debug-trace { text-align: left; background: #000; color: #fca5a5; padding: 16px; border-radius: 10px; font-size: 12px; overflow: auto; max-width: 90vw; max-height: 300px; margin-top: 20px; }

/* Footer */
.site-footer { margin-top: 70px; border-top: 1px solid var(--border); background: linear-gradient(to bottom, var(--bg-2), #05050b); }
.footer-grid { display: grid; gap: 28px; padding-block: 40px 26px; }
.footer-brand p { color: var(--muted); font-size: 14px; margin-top: 12px; max-width: 360px; }
.site-footer h4 { font-size: 15px; font-weight: 800; margin-bottom: 10px; }
.footer-grid > div:not(.footer-brand) { display: grid; gap: 6px; align-content: start; }
.footer-grid > div a { color: var(--muted); font-size: 14px; transition: color .2s; }
.footer-grid > div a:hover { color: #c4b5fd; }
.socials { display: flex; gap: 8px; margin-top: 14px; }
.socials a { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2) !important; transition: .2s; }
.socials a:hover { background: var(--grad); color: #fff !important; border-color: transparent; }
.footer-bottom { border-top: 1px solid var(--border); padding-block: 16px; color: var(--muted); font-size: 13px; text-align: center; }
.to-top { position: fixed; bottom: 20px; inset-inline-end: 20px; z-index: 90; width: 44px; height: 44px; border-radius: 14px; border: 0; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: var(--glow); opacity: 0; transform: translateY(20px); pointer-events: none; transition: .3s var(--ease); }
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.page-watch .to-top { display: none; }

/* ==========================================================================
   Video player
   ========================================================================== */
.ah-player {
  position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; overflow: hidden; color: #fff; user-select: none;
  -webkit-tap-highlight-color: transparent; font-family: var(--font); direction: ltr;
}
.ah-player video, .ah-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.ah-player video::cue { background: rgba(0, 0, 0, .65); font-family: var(--font); font-size: clamp(14px, 2.4vw, 24px); line-height: 1.5; }
.player-poster { position: absolute; inset: 0; background-size: cover; background-position: center; transition: opacity .4s; }
.player-poster::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle, rgba(0, 0, 0, .15), rgba(0, 0, 0, .7)); }
.ah-player.is-started .player-poster { opacity: 0; pointer-events: none; }
.player-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; color: var(--text-2); direction: rtl; z-index: 2; }
.player-empty .i { width: 44px; height: 44px; }
.p-big-play {
  position: absolute; top: 50%; left: 50%; z-index: 6; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; border: 0;
  background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 10px color-mix(in srgb, var(--primary) 25%, transparent), 0 10px 40px color-mix(in srgb, var(--primary) 70%, transparent);
  transition: transform .25s var(--ease), opacity .25s;
}
.p-big-play .i { width: 34px; height: 34px; stroke: none; margin-left: 4px; }
.p-big-play:hover { transform: scale(1.08); }
.ah-player.is-started .p-big-play { opacity: 0; pointer-events: none; transform: scale(.6); }
.p-spinner { position: absolute; top: 50%; left: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .15); border-top-color: var(--primary); animation: spin .8s linear infinite; z-index: 5; display: none; }
.ah-player.is-loading .p-spinner { display: block; }
.p-controls {
  position: absolute; inset-inline: 0; bottom: 0; z-index: 7; padding: 30px 10px 6px;
  background: linear-gradient(to top, rgba(0, 0, 0, .9), rgba(0, 0, 0, .5) 55%, transparent);
  transition: opacity .3s, transform .3s; opacity: 0; transform: translateY(8px); pointer-events: none;
}
.ah-player.is-started.show-controls .p-controls, .ah-player.is-paused.is-started .p-controls, .ah-player.menu-open .p-controls { opacity: 1; transform: none; pointer-events: auto; }
.ah-player.is-started:not(.show-controls):not(.is-paused):not(.menu-open) { cursor: none; }
.p-progress { position: relative; height: 16px; display: flex; align-items: center; cursor: pointer; margin: 0 4px 2px; touch-action: none; }
.p-progress-track { position: relative; width: 100%; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .22); transition: height .15s; overflow: visible; }
.p-progress:hover .p-progress-track, .p-progress.is-dragging .p-progress-track { height: 6px; }
.p-buffer { position: absolute; inset-block: 0; left: 0; background: rgba(255, 255, 255, .35); border-radius: inherit; }
.p-played { position: absolute; inset-block: 0; left: 0; background: var(--grad); border-radius: inherit; }
.p-thumb { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 50%, transparent); transform: scale(0); transition: transform .15s; }
.p-progress:hover .p-thumb, .p-progress.is-dragging .p-thumb { transform: scale(1); }
.p-ad-marker { position: absolute; top: 0; bottom: 0; width: 4px; margin-left: -2px; background: var(--gold); border-radius: 2px; z-index: 1; }
.p-hover-time { position: absolute; bottom: 20px; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, .85); font-size: 12px; font-weight: 700; transform: translateX(-50%); opacity: 0; pointer-events: none; white-space: nowrap; }
.p-progress:hover .p-hover-time { opacity: 1; }
.p-bar { display: flex; align-items: center; gap: 2px; }
.p-btn { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 0; background: none; color: #fff; border-radius: 10px; transition: background .15s, transform .15s; position: relative; }
.p-btn:hover { background: rgba(255, 255, 255, .12); }
.p-btn:active { transform: scale(.92); }
.p-btn .i { width: 22px; height: 22px; }
.p-btn[disabled] { opacity: .35; pointer-events: none; }
.p-btn .p-badge { position: absolute; top: 5px; right: 3px; font-size: 8px; font-weight: 900; background: var(--primary); padding: 0 3px; border-radius: 3px; line-height: 1.4; }
.p-volume { display: flex; align-items: center; }
.p-volume input { width: 0; opacity: 0; transition: width .25s, opacity .25s; accent-color: var(--primary); height: 4px; cursor: pointer; }
.p-volume:hover input, .p-volume input:focus { width: 80px; opacity: 1; margin-inline: 4px 8px; }
.p-time { font-size: 13px; font-weight: 700; padding: 0 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.p-spacer { flex: 1; }
.p-autonext { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 0 6px; cursor: pointer; white-space: nowrap; }
.p-switch { width: 30px; height: 16px; border-radius: 10px; background: rgba(255, 255, 255, .3); position: relative; transition: background .2s; }
.p-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .2s; }
.p-autonext.is-on .p-switch { background: var(--primary); }
.p-autonext.is-on .p-switch::after { transform: translateX(14px); }
.p-menu {
  position: absolute; bottom: 62px; right: 12px; z-index: 9; min-width: 220px; max-height: calc(100% - 80px); overflow-y: auto;
  background: rgba(14, 14, 26, .96); border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; padding: 6px; backdrop-filter: blur(12px);
  direction: rtl; font-size: 14px; display: none; box-shadow: 0 20px 40px rgba(0, 0, 0, .6); animation: pop .15s var(--ease);
}
.p-menu.is-open { display: block; }
.p-menu-title { display: flex; align-items: center; gap: 6px; padding: 8px 10px; font-weight: 800; border-bottom: 1px solid rgba(255, 255, 255, .08); margin-bottom: 4px; }
.p-menu-title button { background: none; border: 0; color: #fff; padding: 0; display: grid; }
.p-menu-item { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%; padding: 9px 12px; border: 0; background: none; color: #e5e7eb; border-radius: 9px; text-align: start; font-weight: 600; }
.p-menu-item:hover { background: rgba(255, 255, 255, .08); }
.p-menu-item.is-active { color: #c4b5fd; }
.p-menu-item.is-active::before { content: '✓'; margin-inline-end: 6px; }
.p-menu-item span { color: #9ca3af; font-size: 13px; }
.p-flash { position: absolute; top: 50%; z-index: 6; width: 76px; height: 76px; margin-top: -38px; border-radius: 50%; background: rgba(0, 0, 0, .55); display: grid; place-items: center; font-size: 13px; font-weight: 800; opacity: 0; pointer-events: none; }
.p-flash.left { left: 12%; }
.p-flash.right { right: 12%; }
.p-flash.center { left: 50%; margin-left: -38px; }
.p-flash.is-show { animation: flash .6s var(--ease); }
.p-flash .i { width: 28px; height: 28px; }
.p-title { position: absolute; top: 0; inset-inline: 0; z-index: 7; padding: 14px 16px 30px; background: linear-gradient(to bottom, rgba(0, 0, 0, .75), transparent); font-weight: 800; font-size: 15px; direction: rtl; opacity: 0; transition: opacity .3s; pointer-events: none; }
.ah-player.is-started.show-controls .p-title, .ah-player.is-paused.is-started .p-title { opacity: 1; }
.ah-player.is-fullscreen .p-title { font-size: 18px; }
.p-tap-zones { position: absolute; inset: 0; z-index: 4; display: grid; grid-template-columns: 1fr 1fr 1fr; }
.p-error { position: absolute; inset: 0; z-index: 8; display: none; place-content: center; justify-items: center; text-align: center; gap: 10px; background: rgba(0, 0, 0, .85); direction: rtl; padding: 20px; }
.p-error.is-show { display: grid; }
.p-error .btn { margin-top: 6px; }

/* Auto next overlay */
.p-next {
  position: absolute; bottom: 70px; right: 16px; z-index: 9; direction: rtl; width: min(320px, calc(100% - 32px));
  background: rgba(14, 14, 26, .95); border: 1px solid rgba(255, 255, 255, .15); border-radius: 16px; padding: 14px; display: none; backdrop-filter: blur(10px);
}
.p-next.is-show { display: block; animation: pop .25s var(--ease); }
.p-next p { font-size: 13px; color: #c4c4dc; }
.p-next strong { display: block; font-size: 16px; margin: 2px 0 10px; }
.p-next-actions { display: flex; gap: 8px; }
.p-next-ring { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: conic-gradient(var(--primary) var(--p, 0%), rgba(255, 255, 255, .15) 0); font-size: 11px; font-weight: 800; margin-inline-end: 6px; }

/* ---------- Ads (inside player) ---------- */
.ah-ad-layer { position: absolute; inset: 0; z-index: 20; background: #000; display: none; direction: rtl; }
.ah-ad-layer.is-active { display: block; }
.ah-ad-media { position: absolute; inset: 0; display: grid; place-items: center; }
.ah-ad-media video, .ah-ad-media iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; object-fit: contain; }
.ah-ad-media img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ah-ad-media a { display: contents; }
.ah-ad-label { position: absolute; top: 12px; right: 12px; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 9px; background: rgba(0, 0, 0, .7); font-size: 12.5px; font-weight: 800; border: 1px solid rgba(255, 255, 255, .15); }
.ah-ad-label b { color: var(--gold); }
.ah-ad-skip {
  position: absolute; bottom: 60px; left: 0; z-index: 3; min-width: 170px; padding: 11px 18px; border: 1px solid rgba(255, 255, 255, .25); border-inline-end: 0;
  border-radius: 12px 0 0 12px; background: rgba(0, 0, 0, .78); color: #fff; font-weight: 800; font-size: 14px; text-align: center; transition: background .2s;
}
.ah-ad-skip[disabled] { color: #cfcfe0; cursor: default; font-weight: 700; font-size: 13px; }
.ah-ad-skip:not([disabled]):hover { background: var(--grad); }
.ah-ad-cta { position: absolute; bottom: 60px; right: 12px; z-index: 3; }
.ah-ad-progress { position: absolute; bottom: 0; inset-inline: 0; height: 4px; background: rgba(255, 255, 255, .15); z-index: 3; }
.ah-ad-progress span { display: block; height: 100%; width: 0; background: var(--gold); transition: width .25s linear; }
.ah-ad-unmute { position: absolute; top: 12px; left: 12px; z-index: 3; }
.ah-ad-banner {
  position: absolute; bottom: 64px; left: 50%; transform: translateX(-50%); z-index: 8; width: min(560px, calc(100% - 24px)); direction: rtl;
  display: none; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; background: rgba(14, 14, 26, .94); border: 1px solid rgba(255, 255, 255, .15); border-radius: 14px; backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.ah-ad-banner.is-show { display: flex; animation: slideUp .35s var(--ease); }
.ah-ad-banner-media { flex: none; width: 110px; height: 56px; border-radius: 9px; overflow: hidden; background: #000; }
.ah-ad-banner-media img, .ah-ad-banner-media iframe { width: 100%; height: 100%; object-fit: cover; border: 0; }
.ah-ad-banner-text { flex: 1; min-width: 0; font-size: 13px; }
.ah-ad-banner-text small { color: var(--gold); font-weight: 800; font-size: 11px; display: block; }
.ah-ad-banner-text strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ah-ad-banner-close { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .1); color: #fff; display: grid; place-items: center; align-self: flex-start; }
.ah-ad-banner-close .i { width: 14px; height: 14px; }
.ah-player.is-fullscreen .ah-ad-banner { bottom: 80px; }

/* ==========================================================================
   Responsive (mobile-first → larger screens)
   ========================================================================== */
@media (min-width: 480px) {
  .row-scroller { grid-auto-columns: 32%; }
  .row-scroller.row-episodes { grid-auto-columns: 62%; }
  .grid-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .login-btn span { display: inline; }
  .login-btn { padding-inline: 14px; }
  .genre-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 640px) {
  .grid-episodes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(3, 1fr); }
  .stat-row { grid-template-columns: repeat(4, 1fr); }
  .ep-item-meta { display: flex; }
  .auth-card { padding: 36px 32px; }
  .comment-replies { padding-inline-start: 22px; }
}
@media (min-width: 768px) {
  .container { padding-inline: 24px; }
  .row-scroller { grid-auto-columns: 23%; gap: 16px; margin-inline: 0; padding-inline: 0; }
  .row-scroller.row-episodes { grid-auto-columns: 40%; }
  .grid-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 16px; }
  .scroll-btn { display: grid; }
  .hero-arrows { display: flex; }
  .detail-inner { grid-template-columns: 220px 1fr; align-items: end; gap: 32px; }
  .detail-poster { width: 220px; margin: 0; }
  .player-shell { margin-inline: 0; }
  .ah-player { border-radius: var(--radius-lg); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .9), 0 0 0 1px var(--border); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .profile-grid { grid-template-columns: 1fr 1fr; }
  .genre-grid { grid-template-columns: repeat(4, 1fr); }
  .search-overlay .search-results { max-width: 720px; margin-inline: auto; }
}
@media (min-width: 1024px) {
  :root { --header-h: 70px; }
  .only-mobile { display: none !important; }
  .header-actions .search-box { display: flex; width: 240px; }
  .header-actions .search-box input:focus { width: 100%; }
  .row-scroller { grid-auto-columns: calc((100% - 5 * 16px) / 6); }
  .row-scroller.row-episodes { grid-auto-columns: calc((100% - 3 * 16px) / 4); }
  .grid-cards { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .grid-episodes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters { display: grid !important; grid-template-columns: repeat(5, 1fr); }
  .filters-toggle { display: none; }
  .hero-poster { display: block; flex: none; width: 260px; margin-inline-start: auto; border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 30px 60px -15px rgba(0, 0, 0, .9), 0 0 0 1px var(--border-2); transform: perspective(900px) rotateY(8deg); transition: transform .5s var(--ease); animation: heroIn 1s .15s var(--ease) both; }
  .hero-poster:hover { transform: perspective(900px) rotateY(0); }
  .hero-poster img { aspect-ratio: 7/10; object-fit: cover; width: 100%; }
  .hero-inner { align-items: center; padding-bottom: 60px; }
  .detail-layout { grid-template-columns: 1fr 320px; align-items: start; }
  .ep-list { grid-template-columns: 1fr 1fr; }
  .watch-layout { grid-template-columns: 1fr 340px; align-items: start; }
  .watch-side { position: sticky; top: calc(var(--header-h) + 16px); }
  .side-ep-list { max-height: calc(100vh - 360px); min-height: 260px; }
  .genre-grid { grid-template-columns: repeat(5, 1fr); }
  .panel { padding: 20px; }
}
@media (min-width: 1200px) {
  .main-nav { display: flex; align-items: center; gap: 0; margin-inline-start: 14px; flex: none; }
  .nav-link { position: relative; padding: 8px 8px; border-radius: 10px; font-size: 13.5px; font-weight: 700; color: var(--text-2); transition: .2s; white-space: nowrap; }
  .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
  .nav-link.is-active { color: #fff; }
  .nav-link.is-active::after { content: ''; position: absolute; bottom: 1px; inset-inline: 30%; height: 3px; border-radius: 3px; background: var(--grad); box-shadow: 0 0 10px var(--primary); }
  .header-actions .search-box { width: auto; flex: 1 1 200px; min-width: 130px; max-width: 220px; }
  .login-btn span { display: none; }
  .login-btn { padding-inline: 0; width: 38px; }
}
@media (max-width: 1199px) and (min-width: 1024px) {
  .only-mobile[data-drawer-open] { display: inline-grid !important; }
  .header-actions .search-box { width: 300px; }
}
@media (min-width: 1440px) {
  .nav-link { padding: 8px 10px; font-size: 14px; }
  .main-nav { margin-inline-start: 22px; }
  .header-actions .search-box { max-width: 240px; }
}
@media (min-width: 1600px) {
  .nav-link { padding: 8px 13px; font-size: 14.5px; }
  .header-actions .search-box { max-width: 280px; }
  .login-btn span { display: inline; }
  .login-btn { padding-inline: 14px; width: auto; }
}
@media (min-width: 1440px) {
  .grid-cards { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .row-scroller { grid-auto-columns: calc((100% - 6 * 16px) / 7); }
  .grid-episodes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero-poster { width: 300px; }
  .watch-layout { grid-template-columns: 1fr 380px; }
}
@media (min-width: 1920px) {
  :root { --container: 1720px; }
  body { font-size: 16px; }
}
@media (max-width: 767px) {
  .hero { height: auto; min-height: 600px; max-height: none; }
  .hero-slide { position: absolute; }
  .hero-inner { padding-bottom: 70px; }
  .hero-desc { -webkit-line-clamp: 2; font-size: 14px; }
  .hero-actions .btn-lg { --h: 46px; padding-inline: 18px; }
  .hero-controls { justify-content: center; bottom: 22px; }
  .p-volume input { display: none; }
  .p-btn { width: 36px; height: 36px; }
  .p-btn .i { width: 20px; height: 20px; }
  .p-hide-sm { display: none !important; }
  .p-time { font-size: 11.5px; padding: 0 4px; }
  .ah-ad-skip { bottom: 40px; min-width: 130px; padding: 9px 12px; font-size: 13px; }
  .ah-ad-cta { bottom: 40px; }
  .ah-ad-banner { bottom: 52px; }
  .ah-ad-banner-media { width: 80px; height: 44px; }
  .p-menu { right: 6px; bottom: 50px; min-width: 190px; }
  .watch-head { flex-direction: column; }
}
@media (max-width: 639px) {
  .letters { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; padding-bottom: 4px; }
  .letter { flex: none; }
}
@media (max-width: 420px) {
  .hero-actions .btn-icon-only { display: none; }
}
@media (max-width: 380px) {
  .p-autonext span:first-child { display: none; }
  .logo-text { font-size: 17px; }
}

/* ---------- Animations ---------- */
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes heroIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes dotFill { from { width: 0; } to { width: 100%; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }
@keyframes flash { 0% { opacity: 0; transform: scale(.7); } 30% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.1); } }
@keyframes slideUp { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Keep subtitles above the control bar */
.ah-player.show-controls video::-webkit-media-text-track-container { transform: translateY(-48px); transition: transform .3s; }
/* Player: embed + ad state helpers */
.p-embed { position: absolute; inset: 0; z-index: 1; }
.p-embed:empty { display: none; }
.ah-player.is-embed.is-started .p-tap-zones, .ah-player.is-embed.is-started .p-title, .ah-player.is-embed.is-started .player-poster { display: none; }
.ah-player.is-ad .p-controls, .ah-player.is-ad .p-big-play, .ah-player.is-ad .p-title, .ah-player.is-ad .ah-ad-banner, .ah-player.is-ad .p-menu { display: none !important; }
.p-btn.is-on { color: #c4b5fd; }
