@charset "UTF-8";
/* ==========================================================================
   FilmPlus Mini App — design system
   Dark-first, OLED-capable, RTL-native. Tokens in hex (WebView-safe),
   derived from an OKLCH ramp so the lightness steps read as even.
   ========================================================================== */

@font-face {
  font-family: "Vazirmatn";
  src: url("./fonts/vazirmatn-var.woff2") format("woff2-variations"),
       url("./fonts/vazirmatn-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  color-scheme: dark;

  /* surfaces — elevation goes lighter, not shadowier */
  --bg: #0c090f;
  --surface-1: #17131a;
  --surface-2: #221d26;
  --surface-3: #2e2933;
  --surface-4: #3d3642;

  /* text */
  --text: #f5f2f6;
  --text-2: #bdb8c0;
  --text-3: #8c8790;
  --text-4: #666169;

  /* brand + status */
  --accent: #d871de;
  --accent-hi: #e794ec;
  --accent-lo: #a344b8;
  --violet: #8968f4;
  --gold: #f4c43a;
  --green: #38d080;
  --red: #f84b4b;
  --blue: #26a9f1;

  --on-accent: #1a0a1c;

  /* lines and veils */
  --border: rgba(245, 242, 246, 0.10);
  --border-strong: rgba(245, 242, 246, 0.18);
  --veil: rgba(245, 242, 246, 0.06);
  --veil-2: rgba(245, 242, 246, 0.12);
  --scrim: rgba(8, 6, 10, 0.72);

  /* هر دو سرِ گرادیان طوری تیره شده‌اند که متن سفید رویشان ۴٫۵:۱ رد شود */
  --grad-brand: linear-gradient(135deg, #6d47e0 0%, #b03fb8 100%);
  --grad-gold: linear-gradient(135deg, #f4c43a 0%, #ec8c3c 100%);

  /* radii */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-full: 999px;

  /* spacing scale — 4px base */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;

  /* type */
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-md: 0.9375rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;

  /* motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-ios: cubic-bezier(0.32, 0.72, 0, 1);
  --d-fast: 140ms;
  --d-mid: 240ms;
  --d-slow: 340ms;

  /* chrome heights */
  --topbar-h: 52px;
  --tabbar-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  /* در حالت افقی، ناحیه‌ی امن کنارها هم باید رعایت شود */
  --gutter: max(16px, var(--safe-l), var(--safe-r));
}

/* OLED variant — page goes true black, cards stay lifted so depth survives */
:root[data-theme="oled"] {
  --bg: #000000;
  --surface-1: #101014;
  --surface-2: #1b1a20;
  --surface-3: #26242c;
  --surface-4: #35323b;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fbf9fc;
  --surface-1: #ffffff;
  --surface-2: #f5f2f6;
  --surface-3: #edeaef;
  --surface-4: #e2dee5;
  --text: #1f1923;
  --text-2: #534d57;
  --text-3: #736e77;
  --text-4: #8a848e;
  --accent: #ab3db3;
  --accent-hi: #c257c9;
  --accent-lo: #8a2f96;
  --on-accent: #ffffff;
  --border: rgba(31, 25, 35, 0.10);
  --border-strong: rgba(31, 25, 35, 0.18);
  --veil: rgba(31, 25, 35, 0.05);
  --veil-2: rgba(31, 25, 35, 0.10);
  --scrim: rgba(255, 255, 255, 0.72);
}

/* --------------------------------------------------------------------------
   2. Reset + base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body, h1, h2, h3, h4, p, figure, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: "Vazirmatn", "Segoe UI", "Tahoma", system-ui, sans-serif;
  font-size: var(--text-md);
  line-height: 1.8;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

/* Persian is cursive — tracking severs the joins. Never track it. */
:lang(fa), :lang(ar) { letter-spacing: 0 !important; }

img, svg, video { display: block; max-width: 100%; }
img { background: var(--surface-2); }

button, input, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
}
button { cursor: pointer; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.4;
  text-wrap: balance;
}

p { text-wrap: pretty; }

::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible {
  outline: 2px solid var(--accent-hi);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* داخل کارت‌هایی که overflow پنهان دارند، حلقه باید تو بیفتد وگرنه بریده می‌شود */
.list__row:focus-visible,
.season > summary:focus-visible,
.dl:focus-visible,
.tile:focus-visible,
.poster:focus-visible .poster__frame {
  outline-offset: -3px;
}

/* Latin/numeric fragments inside RTL text */
.u-ltr {
  direction: ltr;
  unicode-bidi: isolate;
}
.u-tnum { font-variant-numeric: tabular-nums; }
.u-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.u-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.u-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.u-break { overflow-wrap: anywhere; }
.u-hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   3. App frame
   -------------------------------------------------------------------------- */
.app {
  position: relative;
  min-height: 100dvh;
  isolation: isolate;
}

/* ambient wash behind everything — subtle, and it never scrolls */
.ambient {
  position: fixed;
  inset-inline: 0;
  inset-block-start: 0;
  height: 62vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background:
    radial-gradient(120% 70% at 78% -10%, rgba(137, 104, 244, 0.32), transparent 62%),
    radial-gradient(110% 65% at 12% -6%, rgba(216, 113, 222, 0.26), transparent 60%);
  transition: opacity var(--d-slow) var(--ease-out);
}
:root[data-theme="oled"] .ambient { opacity: 0.34; }
:root[data-theme="light"] .ambient { opacity: 0.18; }

.screen {
  position: relative;
  z-index: 1;
  padding-block-start: calc(var(--topbar-h) + var(--safe-t));
  padding-block-end: calc(var(--tabbar-h) + var(--safe-b) + var(--s-5));
  min-height: 100dvh;
  animation: screen-in var(--d-mid) var(--ease-out) both;
}
.screen--flush { padding-block-start: 0; }
.screen--nonav { padding-block-end: calc(var(--safe-b) + var(--s-6)); }

@keyframes screen-in {
  from { opacity: 0; transform: translate3d(0, 8px, 0); }
  to   { opacity: 1; transform: none; }
}

.pad { padding-inline: var(--gutter); }

/* --------------------------------------------------------------------------
   4. Top bar
   -------------------------------------------------------------------------- */
.topbar {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 40;
  height: calc(var(--topbar-h) + var(--safe-t));
  padding-block-start: var(--safe-t);
  padding-inline: max(var(--s-3), var(--safe-l)) max(var(--s-3), var(--safe-r));
  display: flex;
  align-items: center;
  gap: var(--s-2);
  background: transparent;
  transition: background var(--d-mid) var(--ease-out),
              box-shadow var(--d-mid) var(--ease-out);
}
.topbar.is-stuck {
  background: rgba(12, 9, 15, 0.92);
  box-shadow: 0 1px 0 var(--border);
}
@supports (backdrop-filter: blur(1px)) {
  .topbar.is-stuck {
    background: rgba(12, 9, 15, 0.62);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
  }
}
:root[data-theme="light"] .topbar.is-stuck { background: rgba(251, 249, 252, 0.72); }

.topbar__title {
  font-size: var(--text-base);
  font-weight: 700;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--d-mid) var(--ease-out), transform var(--d-mid) var(--ease-out);
}
.topbar.is-stuck .topbar__title { opacity: 1; transform: none; }

/* وقتی نوار بالا روی تصویر شناور است، متنش در هر پوسته‌ای سفید می‌ماند.
   کلاس را جاوااسکریپت می‌گذارد؛ قاعده‌ی has() همان را روی موتورهای جدید تضمین می‌کند */
:root:has(.screen--flush) .topbar:not(.is-stuck) .topbar__brand,
:root:has(.screen--flush) .topbar:not(.is-stuck) .topbar__title,
.topbar--over:not(.is-stuck) .topbar__brand,
.topbar--over:not(.is-stuck) .topbar__title {
  color: #fff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
}
:root:has(.screen--flush) .topbar:not(.is-stuck) .btn--icon,
.topbar--over:not(.is-stuck) .btn--icon {
  background: rgba(0, 0, 0, 0.38);
  color: #fff;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex: 1;
  min-width: 0;
  font-weight: 800;
  font-size: var(--text-lg);
}
.topbar__brand .logo {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--grad-brand);
  display: grid;
  place-items: center;
  color: #fff;
  flex: none;
  box-shadow: 0 4px 14px rgba(169, 84, 226, 0.4);
}
.topbar__brand .logo svg { width: 18px; height: 18px; }

/* --------------------------------------------------------------------------
   5. Bottom tab bar
   -------------------------------------------------------------------------- */
.tabbar {
  position: fixed;
  inset-block-end: -3px;
  inset-inline: 0;
  z-index: 45;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: stretch;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-block-end: var(--safe-b);
  padding-inline: var(--safe-l) var(--safe-r);
  background: rgba(12, 9, 15, 0.94);
  border-block-start: 1px solid var(--border);
}
@supports (backdrop-filter: blur(1px)) {
  .tabbar {
    background: rgba(12, 9, 15, 0.66);
    backdrop-filter: blur(26px) saturate(180%);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
  }
}
:root[data-theme="light"] .tabbar { background: rgba(251, 249, 252, 0.8); }

.tabbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-3);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
  position: relative;
  min-height: 48px;
  transition: color var(--d-fast) var(--ease-out);
}
.tabbar__item svg {
  width: 23px;
  height: 23px;
  transition: transform var(--d-mid) var(--ease-out);
}
.tabbar__item.is-active { color: var(--accent); }
.tabbar__item.is-active svg { transform: translateY(-1px) scale(1.06); }
.tabbar__item.is-active::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inline-size: 26px;
  block-size: 2px;
  border-radius: 0 0 3px 3px;
  background: var(--accent);
  animation: tab-mark var(--d-mid) var(--ease-out) both;
}
@keyframes tab-mark {
  from { transform: scaleX(0.2); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.tabbar__item:active svg { transform: scale(0.9); }

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 44px;
  padding-inline: var(--s-4);
  border-radius: var(--r-md);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--text-md);
  font-weight: 600;
  position: relative;
  overflow: hidden;
  transition: transform var(--d-fast) var(--ease-out),
              background-color var(--d-fast) var(--ease-out),
              opacity var(--d-fast) var(--ease-out);
}
.btn svg { width: 19px; height: 19px; flex: none; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(0.97); }
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.btn--primary {
  --btn-fg: #fff;
  background: var(--grad-brand);
  box-shadow: 0 6px 20px rgba(169, 84, 226, 0.32);
}
.btn--primary:hover { background: var(--grad-brand); filter: brightness(1.07); }

.btn--gold {
  --btn-fg: #241a02;
  background: var(--grad-gold);
}

.btn--ghost {
  --btn-bg: transparent;
  border: 1px solid var(--border-strong);
}
.btn--ghost:hover { background: var(--veil); }

.btn--glass {
  --btn-bg: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
@supports (backdrop-filter: blur(1px)) {
  .btn--glass {
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
  }
}

.btn--block { width: 100%; }
.btn--sm { min-height: 36px; padding-inline: var(--s-3); font-size: var(--text-sm); border-radius: var(--r-sm); }
.btn--lg { min-height: 52px; font-size: var(--text-base); border-radius: var(--r-lg); }

.btn--icon {
  min-height: 44px;
  inline-size: 44px;
  padding: 0;
  border-radius: var(--r-full);
  background: var(--veil);
  color: var(--text);
  flex: none;
}
.btn--icon:hover { background: var(--veil-2); }
.btn--icon.is-on { background: var(--accent); color: var(--on-accent); }

.btn__spin {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: inherit;
}

/* --------------------------------------------------------------------------
   7. Chips, pills, badges
   -------------------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  min-height: 38px;
  padding-inline: var(--s-3);
  border-radius: var(--r-full);
  background: var(--veil);
  border: 1px solid transparent;
  color: var(--text-2);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: background-color var(--d-fast) var(--ease-out),
              color var(--d-fast) var(--ease-out),
              transform var(--d-fast) var(--ease-out);
}
.chip:hover { background: var(--veil-2); color: var(--text); }
.chip:active { transform: scale(0.96); }
.chip.is-active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
}
.chip svg { width: 15px; height: 15px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-full);
  background: var(--veil);
  color: var(--text-2);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.7;
  white-space: nowrap;
}
.pill svg { width: 13px; height: 13px; flex: none; }
.pill--gold { background: rgba(244, 196, 58, 0.16); color: var(--gold); }
.pill--accent { background: rgba(216, 113, 222, 0.18); color: var(--accent-hi); }
.pill--green { background: rgba(56, 208, 128, 0.16); color: var(--green); }
.pill--solid { background: rgba(8, 6, 10, 0.62); color: var(--text); }

.badge {
  position: absolute;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  z-index: 2;
  padding: 2px 7px;
  border-radius: var(--r-sm);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.7;
  background: rgba(8, 6, 10, 0.7);
  color: var(--text);
}
@supports (backdrop-filter: blur(1px)) {
  .badge { backdrop-filter: blur(10px) saturate(160%); -webkit-backdrop-filter: blur(10px) saturate(160%); }
}
.badge--imdb { color: var(--gold); }
.badge--type { inset-inline-start: auto; inset-inline-end: 8px; background: #8b2f96; color: #fff; }

/* --------------------------------------------------------------------------
   8. Cards / sections
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.card + .card { margin-block-start: var(--s-3); }

.card__title {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--text-md);
  font-weight: 700;
  margin-block-end: var(--s-3);
  color: var(--text);
}
.card__title svg { width: 18px; height: 18px; color: var(--accent); flex: none; }

.section { margin-block-start: var(--s-5); }
.section__head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding-inline: var(--gutter);
  margin-block-end: var(--s-3);
}
.section__title {
  font-size: var(--text-lg);
  font-weight: 800;
  flex: 1;
  min-width: 0;
}
.section__more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: 700;
  flex: none;
  min-height: 44px;
  padding-inline-start: var(--s-2);
}
.section__more svg { width: 16px; height: 16px; }

/* --------------------------------------------------------------------------
   9. Poster card + rails + grid
   -------------------------------------------------------------------------- */
.poster {
  display: block;
  inline-size: 100%;
  text-align: start;
  transition: transform var(--d-mid) var(--ease-out);
}
.poster:active { transform: scale(0.96); }

.poster__frame {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.36);
}
.poster__img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--d-slow) var(--ease-out);
}
.poster__img.is-loaded { opacity: 1; }
.poster__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  pointer-events: none;
}

.poster__title {
  margin-block-start: var(--s-2);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.55;
  color: var(--text);
}
.poster__meta {
  font-size: var(--text-xs);
  color: var(--text-3);
  line-height: 1.7;
}

.rail__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 118px;
  gap: var(--s-3);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  padding-inline: var(--gutter);
  padding-block-end: var(--s-1);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.rail__track::-webkit-scrollbar { display: none; }
.rail__track > * { scroll-snap-align: start; }
.rail__track--wide { grid-auto-columns: 168px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: var(--s-4) var(--s-3);
  padding-inline: var(--gutter);
}
@media (min-width: 480px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
}

/* --------------------------------------------------------------------------
   10. Hero carousel
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  margin-block-end: var(--s-2);
}
.hero__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.hero__track::-webkit-scrollbar { display: none; }

.hero__slide {
  position: relative;
  scroll-snap-align: center;
  block-size: 68vw;
  max-block-size: 380px;
  min-block-size: 260px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--s-4);
  padding-block-start: calc(var(--topbar-h) + var(--safe-t));
  overflow: hidden;
}
.hero__art {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  transform: scale(1.04);
}
/* پرده همیشه تیره می‌ماند — متن هیرو در هر پوسته‌ای سفید است و پوستر هم
   می‌تواند هر رنگی باشد؛ فقط چند درصد آخر به رنگ زمینه محو می‌شود */
.hero__scrim {
  position: absolute;
  inset-inline-start: -30px;
  inset-inline-end: 0;
  inset-block-start: 0;
  inset-block-end: -30px;
  z-index: -1;
  background:
    linear-gradient(to top,
      var(--bg) 0%,
      rgba(12, 9, 15, 0.88) 11%,
      rgba(12, 9, 15, 0.74) 46%,
      rgba(12, 9, 15, 0.20) 82%),
    linear-gradient(to left, rgba(12, 9, 15, 0.6), transparent 62%);
}
/* پرده‌ی هیرو در هر پوسته‌ای تیره است، پس متن رویش همیشه روشن می‌ماند —
   بدون این، در پوسته‌ی روشن متنِ تیره روی پرده‌ی تیره می‌نشیند */
.hero__slide { color: #fff; }
.hero__slide .pill {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.hero__slide .pill--gold {
  background: rgba(244, 196, 58, 0.22);
  color: var(--gold);
}
.hero__slide .btn--glass { color: #fff; }

.hero__title {
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1.3;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-block-start: var(--s-2);
}
.hero__actions {
  display: flex;
  gap: var(--s-2);
  margin-block-start: var(--s-3);
}
.hero__dots {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin-block-start: var(--s-2);
}
/* نقطه ۶ پیکسلی است ولی ناحیه‌ی لمس ۴۴ پیکسل — padding شفاف، نه اندازه‌ی دیده‌شده */
.hero__dot {
  inline-size: 6px;
  block-size: 6px;
  padding: 0;
  border: 19px solid transparent;
  background-clip: content-box;
  box-sizing: content-box;
  border-radius: var(--r-full);
  background-color: var(--veil-2);
  transition: inline-size var(--d-mid) var(--ease-out),
              background-color var(--d-mid) var(--ease-out);
}
.hero__dot.is-active { inline-size: 20px; background-color: var(--accent); }

/* --------------------------------------------------------------------------
   11. Detail screen
   -------------------------------------------------------------------------- */
.detail__top {
  position: relative;
  padding-inline: var(--gutter);
  padding-block-end: var(--s-4);
}
.detail__art {
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: 320px;
  z-index: -1;
  background-size: cover;
  background-position: center 22%;
}
.detail__art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg) 6%, rgba(12, 9, 15, 0.80) 40%, rgba(12, 9, 15, 0.35) 100%);
}
/* همان دلیل هیرو: سربرگ روی پرده‌ی تیره می‌نشیند */
.detail__title, .detail__top .detail__sub { color: #fff; }
.detail__top .detail__sub { color: rgba(255, 255, 255, 0.72); }
.detail__pills .pill { background: rgba(255, 255, 255, 0.16); color: #fff; }
.detail__pills .pill--gold { background: rgba(244, 196, 58, 0.22); color: var(--gold); }
.detail__head {
  display: flex;
  gap: var(--s-4);
  align-items: flex-end;
  padding-block-start: calc(var(--topbar-h) + var(--safe-t) + 120px);
}
.detail__poster {
  inline-size: 116px;
  flex: none;
  aspect-ratio: 2 / 3;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.detail__poster img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.detail__headtext { min-width: 0; padding-block-end: var(--s-1); }
.detail__title {
  font-size: var(--text-xl);
  font-weight: 800;
  line-height: 1.35;
}
.detail__sub {
  color: var(--text-3);
  font-size: var(--text-sm);
  margin-block-start: 2px;
}
.detail__pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-block-start: var(--s-3);
}
.detail__actions {
  display: flex;
  gap: var(--s-2);
  margin-block-start: var(--s-4);
}
.detail__actions .btn--primary { flex: 1; }

.detail__body { padding-inline: var(--gutter); margin-block-start: var(--s-4); }

.summary {
  color: var(--text-2);
  font-size: var(--text-md);
  line-height: 1.95;
  white-space: pre-line;
}
.summary--collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.summary__toggle {
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: 700;
  margin-block-start: var(--s-1);
  min-height: 44px;
  padding-inline-end: var(--s-3);
}

.info {
  display: grid;
  gap: var(--s-1);
}
.info__row {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding-block: var(--s-2);
  border-block-end: 1px solid var(--border);
}
.info__row:last-child { border-block-end: 0; }
.info__row svg { width: 17px; height: 17px; color: var(--text-4); flex: none; }
.info__k { color: var(--text-3); font-size: var(--text-sm); }
.info__v {
  margin-inline-start: auto;
  font-weight: 600;
  font-size: var(--text-sm);
  text-align: end;
  min-width: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

/* segmented control */
.seg {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  padding: 4px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  margin-block: var(--s-4) var(--s-4);
}
.seg__thumb {
  position: absolute;
  inset-block: 4px;
  inset-inline-start: 4px;
  inline-size: calc((100% - 8px) / var(--seg-count, 2));
  border-radius: calc(var(--r-md) - 4px);
  background: var(--surface-4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transform: translateX(calc(var(--seg-i, 0) * -100%));
  transition: transform var(--d-mid) var(--ease-ios);
}
[dir="ltr"] .seg__thumb { transform: translateX(calc(var(--seg-i, 0) * 100%)); }
.seg__btn {
  position: relative;
  z-index: 1;
  min-height: 40px;
  border-radius: calc(var(--r-md) - 4px);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-3);
  transition: color var(--d-fast) var(--ease-out);
}
.seg__btn[aria-selected="true"] { color: var(--text); }

/* --------------------------------------------------------------------------
   12. Download list / seasons
   -------------------------------------------------------------------------- */
.dl {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  inline-size: 100%;
  text-align: start;
  padding: var(--s-3);
  border-radius: var(--r-md);
  background: var(--surface-2);
  transition: background-color var(--d-fast) var(--ease-out),
              transform var(--d-fast) var(--ease-out);
}
.dl + .dl { margin-block-start: var(--s-2); }
.dl:hover { background: var(--surface-3); }
.dl:active { transform: scale(0.985); }
.dl__ic {
  inline-size: 38px;
  block-size: 38px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  background: rgba(216, 113, 222, 0.16);
  color: var(--accent);
  flex: none;
}
.dl__ic svg { width: 19px; height: 19px; }
.dl__t { min-width: 0; flex: 1; line-height: 1.6; }
.dl__t b { display: block; font-size: var(--text-md); font-weight: 700; }
.dl__t span { display: block; font-size: var(--text-xs); color: var(--text-3); }
.dl__arrow { color: var(--text-4); flex: none; }
/* آیکون chevron خودش به چپ اشاره می‌کند — یعنی «جلو» در RTL. آینه کردنش اشتباه است. */
.dl__arrow svg { width: 18px; height: 18px; }

.season {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-1);
  overflow: hidden;
}
.season + .season { margin-block-start: var(--s-2); }
.season > summary {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  font-size: var(--text-md);
  min-height: 52px;
}
.season > summary::-webkit-details-marker { display: none; }
.season__chev {
  margin-inline-start: auto;
  color: var(--text-4);
  transition: transform var(--d-mid) var(--ease-out);
  flex: none;
}
.season__chev svg { width: 18px; height: 18px; }
/* بسته: به چپ (شروعِ خط در RTL) — باز: چرخش ۹۰ درجه به پایین */
.season[open] .season__chev { transform: rotate(-90deg); }
.season__body {
  padding: 0 var(--s-3) var(--s-3);
  animation: fade-in var(--d-mid) var(--ease-out) both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.ep {
  padding-block: var(--s-3);
  border-block-start: 1px solid var(--border);
}
.ep__head {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-2);
  margin-block-end: var(--s-2);
}
.ep__head .dot {
  inline-size: 6px;
  block-size: 6px;
  border-radius: var(--r-full);
  background: var(--accent);
  flex: none;
}
.ep__qs { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* --------------------------------------------------------------------------
   13. Search
   -------------------------------------------------------------------------- */
.searchbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding-inline: var(--s-3);
  min-height: 46px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid transparent;
  transition: border-color var(--d-fast) var(--ease-out),
              background-color var(--d-fast) var(--ease-out);
}
.searchbar:focus-within {
  border-color: var(--accent);
  background: var(--surface-1);
}
.searchbar svg { width: 19px; height: 19px; color: var(--text-3); flex: none; }
.searchbar input {
  flex: 1;
  min-width: 0;
  font-size: 1rem; /* keep at 16px — iOS zooms below this */
  min-height: 44px;
  outline: none;
}
.searchbar input::placeholder { color: var(--text-3); }
.searchbar__clear {
  inline-size: 28px;
  block-size: 28px;
  border-radius: var(--r-full);
  display: grid;
  place-items: center;
  background: var(--veil-2);
  color: var(--text-2);
  flex: none;
}
.searchbar__clear svg { width: 14px; height: 14px; }

.rowlist { display: grid; gap: var(--s-2); }
.row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  inline-size: 100%;
  text-align: start;
  padding: var(--s-2);
  border-radius: var(--r-md);
  transition: background-color var(--d-fast) var(--ease-out),
              transform var(--d-fast) var(--ease-out);
}
.row:hover { background: var(--veil); }
.row:active { transform: scale(0.985); }
.row__thumb {
  inline-size: 54px;
  flex: none;
  aspect-ratio: 2 / 3;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-2);
}
.row__thumb img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.row__t { min-width: 0; flex: 1; line-height: 1.6; }
.row__t b { display: block; font-size: var(--text-md); font-weight: 600; }
.row__t span { display: block; font-size: var(--text-xs); color: var(--text-3); }
.row__end { flex: none; color: var(--text-4); }

/* --------------------------------------------------------------------------
   14. Explore tiles
   -------------------------------------------------------------------------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: var(--s-3);
  padding-inline: var(--gutter);
}
.tile {
  position: relative;
  min-height: 84px;
  border-radius: var(--r-md);
  padding: var(--s-3);
  display: flex;
  align-items: flex-end;
  font-weight: 700;
  font-size: var(--text-md);
  color: #fff;
  overflow: hidden;
  text-align: start;
  background: var(--grad-brand);
  transition: transform var(--d-fast) var(--ease-out);
}
.tile:active { transform: scale(0.97); }
.tile::before {
  content: "";
  position: absolute;
  inset-block-start: -30%;
  inset-inline-end: -18%;
  inline-size: 96px;
  block-size: 96px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.14);
}
.tile span { position: relative; z-index: 1; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.28); }

/* --------------------------------------------------------------------------
   15. States: skeleton, empty, error, toast, spinner
   -------------------------------------------------------------------------- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: var(--r-sm);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-poster { aspect-ratio: 2 / 3; border-radius: var(--r-md); }
.sk-line { block-size: 11px; border-radius: var(--r-full); margin-block-start: var(--s-2); }
.sk-line--60 { inline-size: 60%; }
.sk-line--40 { inline-size: 40%; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--s-3);
  padding: var(--s-7) var(--s-5);
  color: var(--text-3);
}
.empty__ic {
  inline-size: 66px;
  block-size: 66px;
  border-radius: var(--r-full);
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--text-4);
}
.empty__ic svg { width: 28px; height: 28px; }
.empty h3 { font-size: var(--text-base); color: var(--text); }
.empty p { font-size: var(--text-sm); max-width: 30ch; }

.spinner {
  inline-size: 22px;
  block-size: 22px;
  border-radius: var(--r-full);
  border: 2px solid var(--veil-2);
  border-block-start-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader { display: grid; place-items: center; padding: var(--s-5); }

.toast {
  position: fixed;
  inset-inline: var(--gutter);
  inset-block-end: calc(var(--tabbar-h) + var(--safe-b) + var(--s-3));
  z-index: 60;
  margin-inline: auto;
  max-inline-size: 420px;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.44);
  font-size: var(--text-sm);
  font-weight: 600;
  animation: toast-in var(--d-mid) var(--ease-out) both;
}
.toast svg { width: 18px; height: 18px; flex: none; }
.toast--ok svg { color: var(--green); }
.toast--err svg { color: var(--red); }
.toast.is-out { animation: toast-out 180ms var(--ease-in) both; }
@keyframes toast-in {
  from { opacity: 0; transform: translate3d(0, 16px, 0) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translate3d(0, 10px, 0) scale(0.98); }
}

/* --------------------------------------------------------------------------
   16. Bottom sheet
   -------------------------------------------------------------------------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 3, 6, 0.6);
  animation: fade-in var(--d-mid) var(--ease-out) both;
}
.sheet__panel {
  position: relative;
  inline-size: 100%;
  max-inline-size: 520px;
  max-block-size: 86dvh;
  overflow-y: auto;
  background: var(--surface-1);
  border-start-start-radius: var(--r-xl);
  border-start-end-radius: var(--r-xl);
  border-block-start: 1px solid var(--border-strong);
  padding: var(--s-3) var(--s-4) calc(var(--safe-b) + var(--s-5));
  animation: sheet-in var(--d-slow) var(--ease-ios) both;
}
@keyframes sheet-in {
  from { transform: translate3d(0, 100%, 0); }
  to   { transform: none; }
}
.sheet__grab {
  inline-size: 38px;
  block-size: 4px;
  border-radius: var(--r-full);
  background: var(--surface-4);
  margin: 0 auto var(--s-3);
}
.sheet__title {
  font-size: var(--text-base);
  font-weight: 800;
  margin-block-end: var(--s-3);
}

/* --------------------------------------------------------------------------
   17. Settings rows
   -------------------------------------------------------------------------- */
.profile {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4);
  border-radius: var(--r-lg);
  background: var(--surface-1);
  border: 1px solid var(--border);
}
.profile__avatar {
  inline-size: 56px;
  block-size: 56px;
  border-radius: var(--r-full);
  background: var(--grad-brand);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: var(--text-lg);
  color: #fff;
  flex: none;
  overflow: hidden;
}
.profile__avatar img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.profile__name { font-weight: 700; font-size: var(--text-base); }
.profile__id { color: var(--text-3); font-size: var(--text-xs); }

.list {
  border-radius: var(--r-lg);
  background: var(--surface-1);
  border: 1px solid var(--border);
  overflow: hidden;
}
.list__row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  inline-size: 100%;
  text-align: start;
  min-height: 52px;
  padding: var(--s-2) var(--s-4);
  transition: background-color var(--d-fast) var(--ease-out);
}
.list__row + .list__row { border-block-start: 1px solid var(--border); }
.list__row:hover { background: var(--veil); }
.list__row > svg:first-child { width: 19px; height: 19px; color: var(--accent); flex: none; }
.list__label { flex: 1; min-width: 0; font-size: var(--text-md); font-weight: 600; }
.list__value { color: var(--text-3); font-size: var(--text-sm); flex: none; }
.list__row .chev { color: var(--text-3); width: 17px; height: 17px; flex: none; }

/* --------------------------------------------------------------------------
   18. Player
   -------------------------------------------------------------------------- */
.pl {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: #000;
  display: flex;
  flex-direction: column;
  animation: fade-in var(--d-mid) var(--ease-out) both;
}
.pl__bar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  padding-block-start: calc(var(--safe-t) + var(--s-2));
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent);
  flex: none;
}
.pl__close { background: rgba(255, 255, 255, 0.12); color: #fff; }
.pl__meta { min-width: 0; flex: 1; }
.pl__title { font-size: var(--text-md); font-weight: 700; color: #fff; }
.pl__sub { font-size: var(--text-xs); color: rgba(255, 255, 255, 0.62); }

.pl__stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.pl__video {
  inline-size: 100%;
  block-size: 100%;
  max-block-size: 100%;
  object-fit: contain;
  background: #000;
}
.pl__spin {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.pl__spin.is-on { display: flex; }

.pl__hint {
  display: none;
  padding: var(--s-3) var(--s-4);
  padding-block-end: calc(var(--safe-b) + var(--s-3));
  flex: none;
}
.pl__hint.is-on { display: block; }
.pl__resume {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  font-size: var(--text-sm);
}
.pl__resume > span { flex: 1; min-width: 0; }

.pl__next {
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  display: none;
  justify-content: center;
  padding: var(--s-4);
  padding-block-end: calc(var(--safe-b) + var(--s-6));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92), transparent);
}
.pl__next.is-on { display: flex; animation: toast-in var(--d-mid) var(--ease-out) both; }
.pl__nextcard {
  inline-size: 100%;
  max-inline-size: 380px;
  padding: var(--s-4);
  border-radius: var(--r-lg);
  background: rgba(24, 20, 28, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
}
@supports (backdrop-filter: blur(1px)) {
  .pl__nextcard {
    background: rgba(24, 20, 28, 0.62);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
  }
}
.pl__nextlabel { font-size: var(--text-xs); color: var(--accent-hi); font-weight: 700; }
.pl__nexttitle { font-size: var(--text-md); font-weight: 700; margin-block: 2px var(--s-2); }
.pl__nextcount { font-size: var(--text-sm); color: rgba(255, 255, 255, 0.7); }
.pl__nextcount b { color: #fff; font-variant-numeric: tabular-nums; }
.pl__nextbtns { display: flex; gap: var(--s-2); margin-block-start: var(--s-3); }
.pl__nextbtns .btn { flex: 1; }

/* landscape phone: give the video the whole screen */
@media (orientation: landscape) and (max-height: 500px) {
  .pl__bar {
    position: absolute;
    inset-block-start: 0;
    inset-inline: 0;
    z-index: 2;
  }
  .pl__hint { position: absolute; inset-block-end: 0; inset-inline: 0; z-index: 2; }
}

/* --------------------------------------------------------------------------
   19. Episode rows: watched marks and resume bars
   -------------------------------------------------------------------------- */
.ep.is-done .ep__head { color: var(--text-3); }
.ep__mark {
  inline-size: 18px;
  block-size: 18px;
  border-radius: var(--r-full);
  display: grid;
  place-items: center;
  background: var(--green);
  color: #06301a;
  flex: none;
}
.ep__mark svg { width: 12px; height: 12px; }

.ep__bar {
  block-size: 3px;
  border-radius: var(--r-full);
  background: var(--veil-2);
  overflow: hidden;
  margin-block: 6px var(--s-2);
}
.ep__bar > i {
  display: block;
  block-size: 100%;
  border-radius: inherit;
  background: var(--accent);
  transform-origin: right center;
}
[dir="ltr"] .ep__bar > i { transform-origin: left center; }

.ep__left {
  font-size: var(--text-xs);
  color: var(--text-3);
  margin-inline-start: auto;
  flex: none;
  font-variant-numeric: tabular-nums;
}

.season__count { margin-inline-start: auto; flex: none; }

/* progress ribbon on a poster card (used by the "ادامه تماشا" rail) */
.poster__bar {
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  block-size: 3px;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2;
}
.poster__bar > i {
  display: block;
  block-size: 100%;
  background: var(--accent);
  transform-origin: right center;
}
[dir="ltr"] .poster__bar > i { transform-origin: left center; }

/* --------------------------------------------------------------------------
   20. Reduced motion — keep fades, drop travel
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  .screen { animation: fade-in 120ms both; }
  .sheet__panel { animation: fade-in 120ms both; }
  .toast { animation: fade-in 120ms both; }
  .skeleton::after { animation: none; }
  .btn:active, .chip:active, .poster:active, .row:active, .tile:active { transform: none; }
}
