@import url("fonts.css");

:root {
  /* Cartoono kids — claymorphism / ABCya-inspired */
  --color-primary: #2563eb;
  --color-on-primary: #ffffff;
  --color-secondary: #f59e0b;
  --color-accent: #ec4899;
  --color-accent-hover: #db2777;
  --color-fun: #22c55e;
  --color-sky: #38bdf8;
  --color-background: #eff6ff;
  --color-foreground: #0f172a;
  --color-muted: #ffffff;
  --color-muted-2: #dbeafe;
  --color-border: #bfdbfe;
  --color-destructive: #dc2626;
  --color-text-muted: #475569;
  --ring: #2563eb;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --radius: 22px;
  --header-h: 80px;
  --poster-w: 180px;
  --poster-h: 270px;
  --shadow-lg: 0 10px 0 rgba(37, 99, 235, 0.12), 0 18px 40px rgba(37, 99, 235, 0.14);
  --shadow-clay: 0 6px 0 #93c5fd, 0 12px 28px rgba(37, 99, 235, 0.16);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  direction: rtl;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: "Vazirmatn", Tahoma, sans-serif;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #fce7f3 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 90% 0%, #fef3c7 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, #dbeafe 0%, transparent 55%),
    linear-gradient(180deg, #eff6ff 0%, #f0f9ff 40%, #fff7ed 100%);
  background-attachment: fixed;
  color: var(--color-foreground);
  min-height: 100vh;
  line-height: 1.7;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  position: relative;
  overscroll-behavior-x: none;
  direction: rtl;
  text-align: right;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, a, input, select, label, summary {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
button { font-family: inherit; }
/* Kill default browser blue focus/tap flash; keep accent ring for keyboard only */
:focus { outline: none; }
:focus:not(:focus-visible) { outline: none; box-shadow: none; }
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
a:active, button:active {
  color: inherit;
}
#main {
  overflow-x: hidden;
  max-width: 100%;
}
.sr-only, .skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.skip-link:focus {
  width: auto;
  height: auto;
  clip: auto;
  inset: 8px;
  background: var(--color-accent);
  color: white;
  padding: 8px 12px;
  z-index: 80;
  border-radius: 8px;
}
.container {
  width: min(1280px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  width: 100%;
  max-width: 100%;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 3px solid transparent;
  transition: border-color 200ms var(--ease), background 200ms var(--ease), box-shadow 200ms var(--ease);
  box-sizing: border-box;
}
.site-header.is-scrolled {
  border-bottom-color: #93c5fd;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.1);
}
.header-inner {
  width: 100%;
  max-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  min-width: 0;
  padding-inline: max(12px, env(safe-area-inset-left, 0px)) max(12px, env(safe-area-inset-right, 0px));
  box-sizing: border-box;
  overflow: hidden;
}
.brand {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-logo {
  display: block;
  height: 48px;
  width: auto;
  max-width: min(200px, 42vw);
  object-fit: contain;
}
.brand-logo-sm { height: 40px; max-width: 150px; }
.brand-logo-footer { height: 52px; max-width: 200px; }
.brand-logo-auth {
  display: block;
  height: 64px;
  width: auto;
  max-width: 240px;
  margin: 0 auto 14px;
  object-fit: contain;
}
.brand-mark { display: none; }
.brand-text { display: none; }
.brand img { display: block; }
.nav { display: flex; gap: 18px; margin-inline-end: auto; }
.nav a {
  color: var(--color-text-muted);
  font-weight: 700;
  white-space: nowrap;
  transition: color 180ms var(--ease);
}
.nav a:hover, .nav a:focus-visible { color: var(--color-primary); }
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.header-account { display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; }
.menu-btn .i-close { display: none; }
.menu-btn.is-open .i-menu { display: none; }
.menu-btn.is-open .i-close { display: block; }
.icon-btn {
  width: 44px;
  height: 44px;
  border: 3px solid #93c5fd;
  border-radius: 999px;
  background: #fff;
  color: var(--color-primary);
  display: grid;
  place-items: center;
  box-shadow: 0 3px 0 #60a5fa;
  transition: background 180ms var(--ease), transform 180ms var(--ease);
}
.icon-btn:hover { background: #dbeafe; }
.icon-btn:active { transform: scale(0.97); }
.icon-btn:focus-visible, .btn:focus-visible, .input:focus-visible, select:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 3px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  transition: background 180ms var(--ease), transform 180ms var(--ease), opacity 180ms var(--ease), box-shadow 180ms var(--ease);
}
.btn:active { transform: translateY(2px); }
.btn-primary {
  background: linear-gradient(145deg, #f472b6, #fb923c);
  color: white;
  border-color: #fda4af;
  box-shadow: 0 5px 0 #db2777;
}
.btn-primary:hover { background: linear-gradient(145deg, #ec4899, #f59e0b); }
.btn-ghost {
  background: #fff;
  color: var(--color-primary);
  border-color: #93c5fd;
  box-shadow: 0 4px 0 #60a5fa;
}
.btn-ghost:hover { background: #dbeafe; }
.btn-lg { min-height: 52px; padding: 0 24px; }
.btn-block { width: 100%; }
.btn-disabled { background: #e2e8f0; color: #94a3b8; cursor: not-allowed; box-shadow: none; border-color: #cbd5e1; }
.inline-form { display: inline; }

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--color-muted);
}
.pill-ok { background: rgba(34, 197, 94, 0.16); color: #86efac; }

.drawer[hidden] { display: none !important; }
.drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}
.drawer.is-open { pointer-events: auto; }
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  opacity: 0;
  transition: opacity 220ms var(--ease);
}
.drawer.is-open .drawer-backdrop { opacity: 1; }
.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 88vw);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-left: 3px solid #93c5fd;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(110%);
  transition: transform 280ms var(--ease);
  pointer-events: auto;
  box-shadow: -12px 0 32px rgba(37, 99, 235, 0.15);
}
.drawer.is-open .drawer-panel { transform: none; }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.drawer-head img { height: 40px; width: auto; display: block; }
.drawer-nav { display: grid; gap: 4px; }
.drawer-nav a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  color: var(--color-foreground);
  font-weight: 600;
}
.drawer-nav a:hover,
.drawer-nav a:focus-visible { background: var(--color-muted); }
.drawer-foot {
  margin-top: auto;
  display: grid;
  gap: 12px;
  padding-top: 16px;
}

.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 60;
  display: none;
  align-items: start;
  justify-content: center;
  padding-top: 12vh;
  backdrop-filter: blur(8px);
}
.search-overlay.is-open,
.search-overlay:not([hidden]) {
  display: grid;
}
.search-overlay[hidden] {
  display: none !important;
}
.search-panel {
  width: min(720px, calc(100% - 32px));
  margin-inline: auto;
  background: #fff;
  border: 3px solid #93c5fd;
  border-radius: 24px;
  box-shadow: var(--shadow-clay);
  overflow: hidden;
}
.search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 2px solid #dbeafe;
  color: var(--color-text-muted);
}
.search-input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--color-foreground);
  font: inherit;
  font-size: 18px;
  outline: none;
}
.search-close { flex-shrink: 0; }
.suggest-list { max-height: 360px; overflow: auto; }
.suggest-item {
  display: flex;
  gap: 12px;
  padding: 10px 16px;
  align-items: center;
  transition: background 160ms var(--ease);
}
.suggest-item:hover { background: var(--color-muted); }
.suggest-item img {
  width: 42px;
  height: 63px;
  object-fit: cover;
  object-position: center top;
  border-radius: 8px;
  flex-shrink: 0;
}

.hero {
  position: relative;
  height: min(78vh, 760px);
  min-height: 520px;
  overflow: hidden;
  background: #07070c;
  touch-action: pan-y;
}
.hero-track { position: relative; height: 100%; }
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
  transition: opacity 700ms var(--ease), transform 900ms var(--ease);
}
.hero-slide.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  z-index: 1;
}
.hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center 25%;
  filter: saturate(1.08) contrast(1.04);
  transform: scale(1.02);
  image-rendering: auto;
}
.hero-bg-poster { display: none; }
.hero-slide.is-active .hero-bg-img {
  animation: heroKen 10s var(--ease) forwards;
}
.hero-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.25) 0%, rgba(15, 23, 42, 0.72) 48%, rgba(15, 23, 42, 0.96) 100%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.35) 0%, transparent 28%, rgba(15, 23, 42, 0.94) 100%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 240px;
  align-items: end;
  gap: 40px;
  padding-bottom: 88px;
}
.hero-copy {
  max-width: 640px;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}
.hero-copy .kicker {
  color: #fde047;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
}
.hero-copy h1 {
  color: #fff !important;
  font-size: clamp(28px, 5vw, 56px);
  line-height: 1.25;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.7);
}
.hero-en {
  color: rgba(255, 255, 255, 0.88);
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.hero-meta span,
.hero-meta a {
  background: rgba(255, 255, 255, 0.16);
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  padding: 4px 12px;
  font-size: 13px;
  text-decoration: none;
  backdrop-filter: blur(6px);
  text-shadow: none;
}
.hero-meta a:hover {
  border-color: #fde047;
  color: #fde047;
}
.hero-copy .btn-ghost {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
}
.hero-copy .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.24);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-poster {
  width: 240px;
  height: 360px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 50px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.08);
  transform: translateY(12px);
  opacity: 0;
}
.hero-slide.is-active .hero-poster {
  animation: posterIn 600ms 180ms var(--ease) forwards;
}
.hero-poster img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center top;
}
@keyframes heroKen {
  from { transform: scale(1.02); }
  to { transform: scale(1.06); }
}
@keyframes posterIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
.kicker { color: #db2777; font-weight: 800; letter-spacing: 0.04em; }
.detail-copy h1, .page-head h1 {
  font-size: clamp(26px, 5vw, 56px);
  line-height: 1.2;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
  color: #1e3a8a;
}
.hero-nav {
  position: absolute;
  inset-inline: 0;
  bottom: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  z-index: 2;
}
.hero-arrow {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  background: rgba(12,12,18,0.72);
  color: white;
  display: grid;
  place-items: center;
  backdrop-filter: blur(10px);
  transition: background 180ms var(--ease), transform 180ms var(--ease);
}
.hero-arrow:hover { background: var(--color-accent); border-color: var(--color-accent); }
.hero-arrow:active { transform: scale(0.97); }
.hero-dots { display: flex; gap: 8px; }
.hero-dots button {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 0;
  background: rgba(255,255,255,0.35);
  transition: width 220ms var(--ease), background 220ms var(--ease);
}
.hero-dots button.is-active { width: 26px; background: var(--color-accent); }
.hero-progress {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255,255,255,0.08);
  z-index: 3;
  overflow: hidden;
}
.hero-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--color-accent);
}
.hero-progress.is-running span {
  animation: heroBar 6.5s linear forwards;
}
@keyframes heroBar {
  from { width: 0; }
  to { width: 100%; }
}

.row { padding: 32px 0 12px; max-width: 100%; overflow: hidden; }
.row-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 14px; }
.row-head h2 { margin: 0; font-size: 22px; color: #1e3a8a; font-weight: 800; }
.more { color: #db2777; font-weight: 800; }
.rail-wrap {
  position: relative;
  padding-inline: 8px;
  max-width: 100%;
  overflow: hidden;
}
.rail-wrap::before,
.rail-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 18px;
  width: 48px;
  z-index: 2;
  pointer-events: none;
}
.rail-wrap::before {
  left: 8px;
  right: auto;
  background: linear-gradient(270deg, rgba(239, 246, 255, 0), var(--color-background));
}
.rail-wrap::after {
  right: 8px;
  left: auto;
  background: linear-gradient(90deg, rgba(239, 246, 255, 0), var(--color-background));
}
.rail {
  display: flex;
  gap: 16px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding: 10px 52px 22px;
  scrollbar-width: none;
  scroll-padding-inline: 52px;
  -webkit-overflow-scrolling: touch;
}
.rail::-webkit-scrollbar { display: none; }
.rail-btn {
  position: absolute;
  top: calc(var(--poster-h) / 2 - 6px);
  z-index: 3;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: rgba(16,16,24,0.88);
  color: white;
  box-shadow: var(--shadow-lg);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease), background 180ms var(--ease);
}
.rail-wrap:hover .rail-btn,
.rail-btn:focus-visible { opacity: 1; transform: none; }
.rail-btn:hover { background: var(--color-accent); border-color: var(--color-accent); }
.rail-btn.prev { right: 14px; left: auto; }
.rail-btn.next { left: 14px; right: auto; }

.card {
  flex: 0 0 var(--poster-w);
  width: var(--poster-w);
  min-width: var(--poster-w);
  max-width: var(--poster-w);
  scroll-snap-align: start;
}
.card-link { display: block; }
.poster {
  position: relative;
  width: var(--poster-w);
  height: var(--poster-h);
  border-radius: 18px;
  overflow: hidden;
  background: #dbeafe;
  border: 3px solid #93c5fd;
  box-shadow: var(--shadow-clay);
}
.poster img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center top;
  transition: transform 280ms var(--ease);
}
.card:hover .poster img { transform: scale(1.06); }
.imdb {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #fef08a;
  color: #854d0e;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 8px;
  border: 2px solid #facc15;
}
.card-hover {
  position: absolute;
  inset: auto 0 0;
  padding: 28px 10px 10px;
  background: linear-gradient(transparent, rgba(30, 58, 138, 0.92));
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
  color: #fff;
}
.card:hover .card-hover { opacity: 1; transform: none; }
.play-mini {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #f472b6, #fb923c);
  margin-bottom: 6px;
}
.card-title {
  font-size: 14px;
  margin: 10px 0 0;
  height: 22px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 800;
  color: #1e3a8a;
}
.card-meta {
  margin: 0;
  height: 18px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge-series {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  background: linear-gradient(135deg, #a78bfa, #ec4899);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 3px 0 #7c3aed;
}
.episodes {
  padding: 8px 0 40px;
}
.episodes-heading {
  margin: 0 0 16px;
  font-size: 22px;
  color: #1e3a8a;
  font-weight: 800;
}
.season-block {
  margin-bottom: 28px;
}
.season-title {
  margin: 0 0 12px;
  font-size: 17px;
  color: #6366f1;
  font-weight: 800;
}
.episode-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.episode-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: #fff;
  border: 3px solid #bfdbfe;
  box-shadow: 0 4px 0 #93c5fd;
  text-decoration: none;
  color: inherit;
  transition: transform 160ms var(--ease), background 160ms var(--ease);
}
.episode-link:hover {
  background: #eff6ff;
  transform: translateY(-2px);
}
.episode-link.has-thumb {
  padding: 8px 12px 8px 8px;
}
.episode-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 54px;
  aspect-ratio: 2 / 3;
  height: auto;
  border-radius: 12px;
  overflow: hidden;
  background: #dbeafe;
  border: 2px solid #93c5fd;
  box-shadow: 0 2px 0 #60a5fa;
}
.episode-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center center;
  display: block;
}
.episode-thumb-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  color: #1e3a8a;
  background: linear-gradient(135deg, #dbeafe, #fce7f3);
}
.episode-thumb-badge {
  position: absolute;
  left: 4px;
  bottom: 4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(30, 58, 138, 0.92);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  line-height: 1;
}
.episode-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.episode-no {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  color: #db2777;
}
.episode-name {
  font-size: 15px;
  font-weight: 700;
  color: #1e3a8a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.episode-play {
  opacity: 0.7;
  font-size: 12px;
  color: #2563eb;
  flex: 0 0 auto;
}
@media (max-width: 560px) {
  .episode-thumb {
    width: 48px;
  }
  .episode-name {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}
.poster-fallback { height: 100%; display: grid; place-items: center; padding: 12px; text-align: center; }

.page-head { padding: 32px 0 8px; }
.page-lead {
  margin: 8px 0 0;
  color: var(--color-text-muted);
  font-size: 15px;
}
.nav-link-btn,
.drawer-link-btn {
  appearance: none;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-align: inherit;
}
.nav-link-btn {
  color: var(--color-text-muted);
  font-weight: 600;
  transition: color 160ms var(--ease);
}
.nav-link-btn:hover { color: var(--color-primary); }
.drawer-link-btn {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 600;
  color: var(--color-foreground);
}
.drawer-link-btn:hover { background: var(--color-muted); }
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}
.category-grid-modal {
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}
.categories-panel {
  width: min(640px, 100%);
}
.categories-lead {
  margin: 0 0 16px;
  color: #475569;
  font-size: 14px;
  font-weight: 600;
}
.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 118px;
  padding: 14px 12px;
  border-radius: 22px;
  border: 3px solid #93c5fd;
  background: linear-gradient(165deg, #ffffff 0%, #dbeafe 100%);
  color: #1e3a8a;
  font-weight: 800;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 5px 0 #60a5fa;
  transition: border-color 180ms var(--ease), transform 180ms var(--ease), background 180ms var(--ease), box-shadow 180ms var(--ease);
}
.category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 0 #60a5fa;
}
.category-card:active { transform: scale(0.98); }
.category-emoji {
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 2px 0 rgba(30, 58, 138, 0.12));
}
.category-name {
  font-size: 15px;
  font-weight: 800;
  color: #1e3a8a;
}
.category-hint {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.3;
}
.category-card.tone-blue { border-color: #93c5fd; background: linear-gradient(165deg, #fff, #dbeafe); box-shadow: 0 5px 0 #60a5fa; }
.category-card.tone-sky { border-color: #7dd3fc; background: linear-gradient(165deg, #fff, #e0f2fe); box-shadow: 0 5px 0 #38bdf8; }
.category-card.tone-violet { border-color: #c4b5fd; background: linear-gradient(165deg, #fff, #ede9fe); box-shadow: 0 5px 0 #8b5cf6; }
.category-card.tone-amber { border-color: #fcd34d; background: linear-gradient(165deg, #fff, #fef3c7); box-shadow: 0 5px 0 #f59e0b; }
.category-card.tone-rose { border-color: #fda4af; background: linear-gradient(165deg, #fff, #ffe4e6); box-shadow: 0 5px 0 #fb7185; }
.category-card.tone-red { border-color: #fca5a5; background: linear-gradient(165deg, #fff, #fee2e2); box-shadow: 0 5px 0 #f87171; }
.category-card.tone-pink { border-color: #f9a8d4; background: linear-gradient(165deg, #fff, #fce7f3); box-shadow: 0 5px 0 #ec4899; }
.category-card.tone-green { border-color: #86efac; background: linear-gradient(165deg, #fff, #dcfce7); box-shadow: 0 5px 0 #22c55e; }
.category-card.tone-cyan { border-color: #67e8f9; background: linear-gradient(165deg, #fff, #cffafe); box-shadow: 0 5px 0 #06b6d4; }
.category-card.tone-teal { border-color: #5eead4; background: linear-gradient(165deg, #fff, #ccfbf1); box-shadow: 0 5px 0 #14b8a6; }
.category-card.tone-yellow { border-color: #fde047; background: linear-gradient(165deg, #fff, #fef9c3); box-shadow: 0 5px 0 #eab308; }
.category-card.tone-indigo { border-color: #a5b4fc; background: linear-gradient(165deg, #fff, #e0e7ff); box-shadow: 0 5px 0 #6366f1; }
.category-card.tone-blue:hover,
.category-card.tone-sky:hover,
.category-card.tone-violet:hover,
.category-card.tone-amber:hover,
.category-card.tone-rose:hover,
.category-card.tone-red:hover,
.category-card.tone-pink:hover,
.category-card.tone-green:hover,
.category-card.tone-cyan:hover,
.category-card.tone-teal:hover,
.category-card.tone-yellow:hover,
.category-card.tone-indigo:hover {
  filter: brightness(1.03);
}
.browse-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.browse-toolbar h1 { margin: 0; }
.browse-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 280px;
  justify-content: flex-end;
  min-width: 0;
}
.browse-search {
  flex: 1 1 auto;
  max-width: 420px;
  min-width: 0;
}
.filter-btn.is-on {
  background: rgba(233, 30, 99, 0.22);
  color: var(--color-accent-hover);
  box-shadow: inset 0 0 0 1px rgba(233, 30, 99, 0.45);
}
.filter-modal[hidden] { display: none !important; }
.filter-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 16px;
}
.filter-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 58, 138, 0.28);
  backdrop-filter: blur(4px);
}
.filter-panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-height: min(86vh, 720px);
  overflow: auto;
  background: #ffffff;
  border: 3px solid #93c5fd;
  border-radius: 24px;
  padding: 18px 18px 20px;
  box-shadow: var(--shadow-clay);
  color: #0f172a;
}
.filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.filter-head h2 {
  margin: 0;
  font-size: 18px;
  color: #1e3a8a;
  font-weight: 800;
}
.filters {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr) auto;
  gap: 10px;
  margin-top: 16px;
}
.filters-modal {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 0;
}
.filters-modal .field {
  display: grid;
  gap: 6px;
}
.filters-modal .field > span {
  font-size: 13px;
  color: var(--color-text-muted);
}
.filter-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}
.filter-actions .btn { min-width: 120px; }
.input, select.input {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  border: 3px solid #93c5fd;
  background: #fff;
  color: var(--color-foreground);
  font-weight: 600;
  padding: 0 14px;
  font: inherit;
}
.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--poster-w), 1fr));
  gap: 18px;
  padding: 20px 0 64px;
  justify-content: start;
}
.poster-grid .card {
  flex: none;
  width: 100%;
  min-width: 0;
  max-width: none;
}
.poster-grid .poster {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
}
.empty { text-align: center; padding: 64px 16px; }

.detail {
  position: relative;
  padding: 48px 0 24px;
  overflow: hidden;
  isolation: isolate;
}
.detail-bg {
  position: absolute;
  inset: -24px;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.88) 0%, rgba(240, 249, 255, 0.94) 55%, #fff7ed 100%),
    var(--poster) center / cover no-repeat;
  filter: blur(14px);
  opacity: 0.55;
  /* no transform — avoids a separate scrolling compositor layer on mobile */
}
.detail-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.detail-main { min-width: 0; }
.detail-copy {
  padding: 20px 22px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  border: 3px solid #93c5fd;
  box-shadow: var(--shadow-clay);
}
.detail-copy .kicker {
  margin: 0 0 6px;
  color: #db2777;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.detail-copy .hero-meta span,
.detail-copy .hero-meta a {
  background: #eff6ff;
  border: 2px solid #93c5fd;
  color: #1e3a8a;
  backdrop-filter: none;
  text-shadow: none;
}
.detail-copy .hero-meta a:hover {
  border-color: #2563eb;
  color: #1d4ed8;
  background: #dbeafe;
}
.detail-copy .hint { color: #475569; }
.detail-poster {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  width: 260px;
  height: 390px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--color-muted);
  align-self: start;
  border: 3px solid #93c5fd;
}
.detail-poster img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center top;
}
.movie-desc {
  margin-top: 18px;
  padding: 18px 22px 22px;
  max-width: 920px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  border: 3px solid #f9a8d4;
  box-shadow: 0 6px 0 #f9a8d4, 0 12px 28px rgba(236, 72, 153, 0.12);
}
.movie-desc h2 {
  margin: 0 0 12px;
  font-size: 22px;
  color: #1e3a8a;
}
.movie-desc-body {
  color: #334155;
  font-size: 15px;
  line-height: 2;
  text-align: justify;
}
.movie-desc-body p { margin: 0 0 14px; }
.watch-desc {
  margin-top: 14px;
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1.9;
  text-align: justify;
  max-width: 880px;
}
.watch-desc p { margin: 0 0 10px; }
.readmore { max-width: 920px; direction: rtl; }
.readmore-text {
  direction: rtl;
  text-align: justify;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 2;
}
.readmore-text p {
  display: block;
  margin: 0 0 14px;
  direction: rtl;
  text-align: justify;
}
.readmore-text p:last-child { margin-bottom: 0; }
.readmore.is-open .readmore-text {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.readmore-btn {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.readmore-btn:hover { color: var(--color-accent-hover); }
.hint { color: var(--color-text-muted); }

.auth-page {
  min-height: calc(100vh - 180px);
  display: grid;
  place-items: center;
  padding: 40px 16px;
  background:
    radial-gradient(circle at 20% 20%, rgba(233,30,99,0.18), transparent 32%),
    var(--color-background);
}
.auth-card {
  width: min(440px, 100%);
  background: #fff;
  border: 3px solid #93c5fd;
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow-clay);
}
.auth-logo { display: none; }
.auth-brand { display: none; }
.field { display: grid; gap: 6px; margin-bottom: 14px; font-size: 14px; font-weight: 700; color: #1e3a8a; }
.field .input { width: 100%; }
.form-error { color: #dc2626; }
.auth-switch, .muted { color: var(--color-text-muted); }
.auth-switch a { color: #db2777; font-weight: 800; }

.pricing {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding-bottom: 64px;
}
.price-card {
  position: relative;
  background: #fff;
  border: 3px solid #bfdbfe;
  border-radius: 28px;
  padding: 24px;
  box-shadow: var(--shadow-clay);
}
.price-card.is-featured {
  border-color: #f9a8d4;
  box-shadow: 0 6px 0 #f472b6, 0 14px 32px rgba(236, 72, 153, 0.2);
}
.price { font-size: 32px; font-weight: 800; margin: 8px 0 16px; }
.price small { font-size: 14px; color: var(--color-text-muted); }
.badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--color-accent);
  color: white;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: right; padding: 10px 8px; border-bottom: 1px solid var(--color-border); }
.account-box { padding-bottom: 64px; }
.flash-wrap { padding-top: 16px; }
.flash {
  background: rgba(233,30,99,0.16);
  border: 1px solid rgba(233,30,99,0.35);
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 10px;
}

.site-footer {
  border-top: 3px solid #93c5fd;
  padding: 32px 0 40px;
  color: var(--color-text-muted);
  max-width: 100%;
  overflow-x: hidden;
  background: rgba(255, 255, 255, 0.65);
}
.footer-inner {
  max-width: 100%;
}
.footer-brand { margin-bottom: 16px; }
.footer-brand img { display: block; height: 52px; width: auto; }
.footer-slogan {
  font-weight: 600;
  color: #334155;
  line-height: 1.85;
}
.footer-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  max-width: 100%;
}
.footer-copy {
  flex: 0 0 33.333%;
  max-width: 33.333%;
  min-width: 0;
}
.footer-slogan {
  margin: 0;
  text-align: justify;
  line-height: 1.9;
  font-size: 14px;
  color: var(--color-text-muted);
}
.trust-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: 0;
  margin-inline-start: auto;
  max-width: 100%;
}
.trust-badge,
.trust-badge-btn {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  padding: 4px;
  border: 0;
  border-radius: 8px;
  background: #cccccc;
  cursor: pointer;
}
.trust-badge img,
.trust-badge-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  margin: 0;
}

.dash-body { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.dash-side {
  background: #100e18;
  border-left: 1px solid var(--color-border);
  padding: 20px;
}
.dash-side nav { display: grid; gap: 8px; margin-top: 24px; }
.dash-side a { padding: 10px 12px; border-radius: 12px; color: var(--color-text-muted); }
.dash-side a:hover { background: var(--color-muted); color: white; }
.dash-main { padding: 28px; }
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.stat {
  background: var(--color-muted);
  border-radius: 16px;
  padding: 16px;
}
.stat strong { display: block; font-size: 28px; }
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 28px; }
.dash-head { display: flex; justify-content: space-between; align-items: center; }
.plain { list-style: none; padding: 0; }
.plain li { padding: 8px 0; border-bottom: 1px solid var(--color-border); }
.dash-form { max-width: 520px; }

@media (max-width: 1024px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .pricing, .stat-grid, .dash-cols { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 200px 1fr; }
  .hero-inner { grid-template-columns: 1fr 180px; gap: 24px; }
  .hero-poster { width: 180px; height: 270px; }
}
@media (max-width: 768px) {
  :root {
    --poster-w: 124px;
    --poster-h: 186px;
    --header-h: 64px;
  }
  .container { width: min(1280px, calc(100% - 24px)); max-width: 100%; }
  .nav, .header-account, .header-pill { display: none; }
  .menu-btn { display: grid; }
  .header-actions { margin-inline-start: auto; gap: 6px; flex-shrink: 0; }
  .brand { min-width: 0; }
  .brand img { height: 34px; max-width: min(120px, 42vw); }
  .site-header {
    height: var(--header-h);
    width: 100%;
    max-width: 100%;
  }
  .header-inner {
    padding-inline: max(12px, env(safe-area-inset-left, 0px)) max(12px, env(safe-area-inset-right, 0px));
  }

  .search-overlay { padding-top: 10vh; align-items: start; }
  .search-panel { width: calc(100% - 20px); max-width: 100%; border-radius: 16px; }
  .search-input { font-size: 16px; }

  .hero {
    height: min(72vh, 560px);
    min-height: 420px;
    max-width: 100%;
    overflow: hidden;
  }
  .hero-inner {
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 14px;
    padding-bottom: 64px;
    max-width: 100%;
  }
  .hero-bg-banner { display: none; }
  .hero-bg-poster {
    display: block;
    object-fit: cover;
    object-position: center 18%;
    filter: saturate(1.1) contrast(1.05);
  }
  .hero-poster {
    display: block;
    width: 112px;
    height: 168px;
    border-radius: 12px;
    opacity: 1;
    transform: none;
    flex-shrink: 0;
    margin-bottom: 4px;
  }
  .hero-slide.is-active .hero-poster {
    animation: none;
  }
  .hero-veil {
    background:
      linear-gradient(180deg, rgba(11,11,16,0.18) 0%, rgba(11,11,16,0.2) 42%, rgba(11,11,16,0.88) 78%, rgba(11,11,16,0.98) 100%);
  }
  .hero-copy { max-width: none; min-width: 0; }
  .hero-copy h1 {
    font-size: clamp(22px, 7vw, 32px);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .hero-en {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
  }
  .hero-meta { margin-bottom: 12px; }
  .hero-meta span:nth-child(n+4) { display: none; }
  .hero-actions { gap: 8px; max-width: 100%; }
  .hero-actions .btn-lg { min-height: 44px; padding: 0 16px; }
  .hero-arrow { display: none; }
  .hero-nav { bottom: 12px; }

  .row { padding: 22px 0 4px; }
  .row-head { margin-bottom: 10px; }
  .row-head h2 { font-size: 18px; }
  .rail-wrap { padding-inline: 0; overflow: hidden; }
  .rail-wrap::before,
  .rail-wrap::after,
  .rail-btn { display: none; }
  .rail {
    gap: 10px;
    padding: 4px 12px 16px;
    scroll-padding-inline: 12px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .card-hover { display: none; }
  .poster { border-radius: 12px; }

  .filters { grid-template-columns: 1fr; }
  .browse-toolbar { align-items: stretch; max-width: 100%; }
  .browse-actions { flex: 1 1 100%; min-width: 0; }
  .browse-search { max-width: none; min-width: 0; }
  .footer-row {
    flex-direction: column;
    gap: 20px;
  }
  .footer-copy {
    flex: none;
    max-width: 100%;
    width: 100%;
  }
  .trust-badges {
    width: 100%;
    justify-content: flex-end;
    margin-inline-start: 0;
    gap: 8px;
  }
  .trust-badge,
  .trust-badge-btn {
    width: 64px;
    height: 64px;
  }
  .poster-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 16px 0 48px;
  }

  .pricing, .stat-grid, .dash-cols, .detail-grid, .dash-body { grid-template-columns: 1fr; }
  .detail { padding: 24px 0 12px; max-width: 100%; overflow: hidden; }
  .detail-grid { justify-items: center; text-align: center; }
  .detail-poster {
    position: relative;
    top: auto;
    width: min(180px, 46vw);
    height: auto;
    aspect-ratio: 2 / 3;
  }
  .detail-main { width: 100%; }
  .detail-copy .hero-actions { justify-content: center; }
  .movie-desc { text-align: justify; }
  .dash-side {
    display: flex;
    gap: 12px;
    align-items: center;
    border-left: 0;
    border-bottom: 1px solid var(--color-border);
  }
  .dash-side nav { display: flex; margin: 0; flex-wrap: wrap; }
  .dash-main { padding: 16px; }
  .dash-head { flex-wrap: wrap; gap: 12px; }
  .table { display: block; overflow-x: auto; max-width: 100%; }
  .auth-page { padding: 32px 12px 48px; max-width: 100%; }
  .auth-card { width: 100%; max-width: 100%; }

  .site-footer { padding: 24px 0 32px; }
  .footer-slogan { font-size: 13px; }
}
@media (max-width: 420px) {
  :root { --poster-w: 108px; --poster-h: 162px; }
  .hero {
    min-height: 400px;
    height: min(70vh, 520px);
  }
  .hero-inner {
    grid-template-columns: 1fr 96px;
    gap: 10px;
    padding-bottom: 56px;
  }
  .hero-poster {
    width: 96px;
    height: 144px;
  }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
}
.pwa-install {
  position: fixed;
  inset-inline: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 20px;
  background: #fff;
  border: 3px solid #93c5fd;
  box-shadow: var(--shadow-clay);
  color: #1e3a8a;
}
.pwa-install[hidden] { display: none !important; }
.pwa-install p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.pwa-install-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pwa-install .btn {
  min-height: 40px;
  padding: 0 14px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .hero-slide.is-active .hero-bg-img,
  .hero-slide.is-active .hero-poster,
  .hero-progress.is-running span { animation: none !important; }
  .hero-poster { opacity: 1; transform: none; }
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}
.auth-page { padding: 48px 0 72px; }
.detail-copy h1, .page-head h1, .watch-meta h1 { color: #1e3a8a; }
.watch-meta { color: #334155; }
.watch-meta .hero-meta span,
.watch-meta .hero-meta a {
  background: #eff6ff;
  border: 2px solid #93c5fd;
  color: #1e3a8a;
  backdrop-filter: none;
  text-shadow: none;
}
.watch-meta .hero-meta a:hover {
  border-color: #2563eb;
  color: #1d4ed8;
  background: #dbeafe;
}
.movie-desc h2, .episodes-heading { color: #1e3a8a; }
