/* =============================================================
   Daricheh CINEMA UI — full redesign
   ui-ux-pro-max: Modern Dark (Cinema) + Immersive Experience
   Brand aperture indigo + rose play accent · Vazirmatn
   Replaces app/aperture/netflix/vod skins on public pages
   ============================================================= */
@import url("fonts.css");

:root {
  /* Daricheh org palette — design-system/MASTER.md */
  --cx-bg: #0b0b16;
  --cx-bg-elev: #12122a;
  --cx-surface: #161632;
  --cx-surface-2: #1c1c3d;
  --cx-fg: #f4f4ff;
  --cx-muted: #9b9bc2;
  --cx-line: rgba(99, 102, 241, 0.28);
  --cx-brand: #6366f1;
  --cx-brand-2: #818cf8;
  --cx-play: #f43f5e;
  --cx-play-hover: #fb7185;
  --cx-kids: #a78bfa;
  --cx-gold: #fbbf24;
  --cx-glass: rgba(11, 11, 22, 0.78);
  --cx-radius: 14px;
  --cx-radius-sm: 8px;
  --cx-radius-pill: 999px;
  --cx-header: 72px;
  --cx-poster-w: 188px;
  --cx-poster-h: 282px;
  --cx-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --cx-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --cx-max: 1280px;

  /* legacy aliases so leftover markup still themes */
  --color-background: var(--cx-bg);
  --color-foreground: var(--cx-fg);
  --color-muted: var(--cx-surface);
  --color-muted-2: var(--cx-surface-2);
  --color-border: var(--cx-line);
  --color-accent: var(--cx-brand);
  --color-accent-hover: var(--cx-brand-2);
  --color-text-muted: var(--cx-muted);
  --color-kids: var(--cx-kids);
  --ring: var(--cx-brand);
  --radius: var(--cx-radius);
  --header-h: var(--cx-header);
  --poster-w: var(--cx-poster-w);
  --poster-h: var(--cx-poster-h);
  --ease: var(--cx-ease);
  --shadow-lg: var(--cx-shadow);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  direction: rtl;
  -webkit-text-size-adjust: 100%;
}
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--cx-bg);
  color: var(--cx-fg);
  font-family: "Vazirmatn", Tahoma, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
}
body {
  background:
    radial-gradient(900px 420px at 90% -8%, rgba(99, 102, 241, 0.28), transparent 55%),
    radial-gradient(700px 380px at 0% 28%, rgba(14, 165, 233, 0.1), transparent 50%),
    var(--cx-bg);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; cursor: pointer; }
button, input, select, label, summary { cursor: pointer; font-family: inherit; }
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--cx-brand-2);
  outline-offset: 3px;
}

.container {
  width: min(var(--cx-max), calc(100% - 2rem));
  margin-inline: auto;
}
.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: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--cx-radius-sm);
  background: var(--cx-brand);
  color: #fff;
}

/* —— Ambient blobs —— */
.cx-ambient {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.cx-ambient span {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: cxFloat 18s var(--cx-ease) infinite alternate;
}
.cx-ambient span:nth-child(1) {
  width: 420px; height: 420px; top: -80px; left: -60px;
  background: rgba(99, 102, 241, 0.35);
}
.cx-ambient span:nth-child(2) {
  width: 360px; height: 360px; bottom: 10%; right: -80px;
  background: rgba(244, 63, 94, 0.22);
  animation-delay: -6s;
}
@keyframes cxFloat {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(40px, 30px) scale(1.08); }
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 1.25rem;
  border: 0;
  border-radius: var(--cx-radius-pill);
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 160ms var(--cx-ease), background 180ms var(--cx-ease), box-shadow 180ms var(--cx-ease);
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--cx-brand), #4f46e5);
  color: #fff;
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.4);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--cx-brand-2), var(--cx-brand));
}
.btn-play {
  background: linear-gradient(135deg, var(--cx-brand), #4f46e5);
  color: #fff;
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.4);
}
.btn-play:hover {
  background: linear-gradient(135deg, var(--cx-brand-2), var(--cx-brand));
  color: #fff;
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.18); }
.btn-lg { min-height: 52px; padding: 0 1.6rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-play-icon { display: inline-grid; place-items: center; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--cx-line);
  border-radius: var(--cx-radius-pill);
  background: var(--cx-glass);
  color: var(--cx-fg);
  backdrop-filter: blur(12px);
}
.icon-btn:hover { border-color: var(--cx-brand-2); background: rgba(99, 102, 241, 0.2); }
.input, select.input, .search-input {
  width: 100%;
  min-height: 48px;
  padding: 0 1rem;
  border-radius: var(--cx-radius-pill);
  border: 1px solid var(--cx-line);
  background: var(--cx-surface);
  color: var(--cx-fg);
}
.input:focus, select.input:focus, .search-input:focus {
  border-color: var(--cx-brand);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

/* —— Header glass —— */
.site-header {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 40;
  height: var(--cx-header);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 220ms var(--cx-ease), border-color 220ms var(--cx-ease), backdrop-filter 220ms var(--cx-ease);
}
#main {
  position: relative;
  z-index: 1;
  min-height: 60vh;
  padding-top: 0;
}
body:not(:has(.hero)) #main {
  padding-top: var(--cx-header);
}
.site-header.is-scrolled {
  background: var(--cx-glass);
  border-bottom-color: var(--cx-line);
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}
.site-header::after { display: none; }
.header-inner {
  height: 100%;
  width: min(var(--cx-max), calc(100% - 2rem));
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.brand { display: flex; align-items: center; flex-shrink: 0; }
.site-logo {
  display: block;
  width: auto;
  height: auto;
  max-height: 44px;
  max-width: min(168px, 46vw);
  object-fit: contain;
  object-position: center;
}
.brand .site-logo {
  max-height: 44px;
  max-width: min(168px, 46vw);
}
.nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
  margin-inline-end: auto;
}
.nav a, .nav-link-btn {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--cx-muted);
  font: inherit;
  font-weight: 600;
  padding: 0.55rem 0.9rem;
  border-radius: var(--cx-radius-pill);
  transition: color 160ms var(--cx-ease), background 160ms var(--cx-ease);
}
.nav a:hover, .nav-link-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-inline-start: auto;
}
.header-account { display: none; gap: 0.4rem; align-items: center; }
.inline-form { display: inline; margin: 0; }
.menu-btn .i-close { display: none; }
.menu-btn.is-open .i-menu { display: none; }
.menu-btn.is-open .i-close { display: block; }

@media (min-width: 960px) {
  .nav { display: flex; }
  .header-account { display: flex; }
  .menu-btn { display: none; }
}

/* —— Drawer —— */
.drawer[hidden] { display: none !important; }
.drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
}
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 16, 0.7);
  backdrop-filter: blur(4px);
}
.drawer-panel {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: min(340px, 88vw);
  background: linear-gradient(180deg, #151530, #0d0d1c);
  border-inline-end: 1px solid var(--cx-line);
  transform: translate3d(110%, 0, 0);
  transition: transform 280ms var(--cx-ease);
  display: flex;
  flex-direction: column;
  padding: 1rem;
  z-index: 1;
}
[dir="rtl"] .drawer-panel { transform: translate3d(-110%, 0, 0); }
.drawer.is-open .drawer-panel,
[dir="rtl"] .drawer.is-open .drawer-panel { transform: none; }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.drawer-nav {
  display: grid;
  gap: 0.35rem;
  flex: 1;
}
.drawer-nav a, .drawer-link-btn {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: right;
  color: var(--cx-fg);
  font: inherit;
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-radius: var(--cx-radius-sm);
}
.drawer-nav a:hover, .drawer-link-btn:hover {
  background: rgba(99, 102, 241, 0.16);
}
.drawer-foot { margin-top: auto; padding-top: 1rem; }

/* —— Search —— */
.search-overlay[hidden] { display: none !important; }
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(6, 6, 18, 0.78);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: start center;
  padding: 12vh 1rem 2rem;
}
.search-panel {
  width: min(720px, 100%);
  background: var(--cx-bg-elev);
  border: 1px solid var(--cx-line);
  border-radius: 20px;
  box-shadow: var(--cx-shadow);
  overflow: hidden;
}
.search-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--cx-line);
}
.search-form svg { opacity: 0.7; flex-shrink: 0; }
.search-input {
  border: 0;
  background: transparent;
  border-radius: 0;
  min-height: 40px;
  box-shadow: none !important;
}
.suggest-list { max-height: 360px; overflow: auto; }
.suggest-item {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.suggest-item:hover { background: rgba(99, 102, 241, 0.12); }
.suggest-item img {
  width: 42px;
  height: 63px;
  object-fit: cover;
  border-radius: 6px;
}

/* —— Filter / categories modal —— */
.filter-modal[hidden] { display: none !important; }
.filter-modal {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.filter-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 16, 0.72);
  backdrop-filter: blur(6px);
}
.filter-panel {
  position: relative;
  width: min(720px, 100%);
  max-height: min(84vh, 900px);
  overflow: auto;
  background: linear-gradient(180deg, #171732, #101024);
  border: 1px solid var(--cx-line);
  border-radius: 20px;
  box-shadow: var(--cx-shadow);
  padding: 1.25rem;
}
.filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.filter-head h2 { margin: 0; font-size: 1.25rem; }
.filters, .filters-modal {
  display: grid;
  gap: 0.9rem;
}
.field { display: grid; gap: 0.4rem; font-size: 0.9rem; color: var(--cx-muted); }
.filter-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}
.category-sections { display: grid; gap: 1.5rem; }
.category-section-title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--cx-brand-2);
}
.category-grid, .category-grid-modal {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6rem;
}
.category-card {
  display: grid;
  place-items: center;
  min-height: 64px;
  padding: 0.75rem;
  border-radius: var(--cx-radius-sm);
  background: var(--cx-surface);
  border: 1px solid var(--cx-line);
  text-align: center;
  font-weight: 700;
  transition: border-color 160ms var(--cx-ease), transform 160ms var(--cx-ease);
}
.category-card:hover {
  border-color: var(--cx-brand-2);
  transform: translateY(-2px);
}
.category-card.kids { border-color: rgba(167, 139, 250, 0.35); }
.category-name { font-size: 0.9rem; }

/* —— HERO (cinematic 16:9 billboard) —— */
.hero {
  position: relative;
  aspect-ratio: 2 / 1;
  width: 100%;
  height: auto;
  max-height: min(78vh, 560px);
  min-height: 420px;
  margin-top: 0;
  padding-top: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 60% at 20% 40%, rgba(99, 102, 241, 0.22), transparent 60%),
    #0b0b16;
}
.hero-track { position: absolute; inset: 0; }
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 650ms var(--cx-ease);
}
.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}
.hero-bg-img,
.hero-bg-cinema {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transform: scale(1.03);
}
.hero-slide.is-active .hero-bg-img {
  animation: cxKen 14s var(--cx-ease) both;
}
@keyframes cxKen {
  from { transform: scale(1.06); }
  to { transform: scale(1.01); }
}
.hero-bg-poster { display: none; }
.hero-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0%, rgba(5, 10, 20, 0.25) 45%, rgba(5, 10, 20, 0.72) 72%, rgba(5, 10, 20, 0.92) 100%),
    linear-gradient(0deg, #070b16 0%, transparent 42%, rgba(5, 12, 28, 0.35) 100%),
    linear-gradient(180deg, rgba(5, 10, 20, 0.45) 0%, transparent 30%);
  pointer-events: none;
}
.hero-glow {
  position: absolute;
  inset: auto 0 0 0;
  height: 42%;
  background: linear-gradient(0deg, #070b16 0%, transparent 100%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  box-sizing: border-box;
  padding-top: calc(var(--cx-header) + 1rem);
  padding-bottom: 5.25rem;
}
.hero-copy {
  max-width: min(540px, 92%);
  margin-inline-start: 0;
  flex: 1 1 auto;
  min-width: 0;
  align-self: flex-end;
}
.hero-poster-plate {
  flex: 0 0 auto;
  align-self: flex-end;
  width: clamp(140px, 18vw, 240px);
  aspect-ratio: 2 / 3;
  border-radius: 16px;
  overflow: hidden;
  margin: 0 0 0.65rem;
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(99, 102, 241, 0.28);
  transform: none;
}
.hero-poster-plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-slide.has-banner .hero-bg-cinema {
  object-position: center center;
  filter: saturate(1.05) contrast(1.04);
}
.hero-lead {
  margin: 0 0 1rem;
  color: #c5d0ea;
  font-size: clamp(0.9rem, 1.6vw, 1.05rem);
  line-height: 1.7;
  max-width: 36rem;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a5b4fc;
}
.kicker::before {
  content: "";
  width: 1.4rem;
  height: 2px;
  background: linear-gradient(90deg, var(--cx-play), var(--cx-brand));
  border-radius: 2px;
}
.hero-copy h1 {
  margin: 0.55rem 0 0.75rem;
  font-size: clamp(1.75rem, 4.6vw, 3.4rem);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -0.02em;
  text-shadow: 0 10px 42px rgba(0, 0, 0, 0.75);
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1.25rem;
}
.hero-meta span,
.hero-meta a {
  padding: 0.3rem 0.7rem;
  border-radius: var(--cx-radius-sm);
  background: rgba(15, 30, 60, 0.55);
  border: 1px solid rgba(99, 102, 241, 0.22);
  font-size: 0.82rem;
  font-weight: 600;
  color: #dbe7ff;
  backdrop-filter: blur(8px);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.hero-nav {
  position: absolute;
  z-index: 3;
  inset-inline: 0;
  bottom: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.hero-arrow {
  width: 42px;
  height: 42px;
  border-radius: var(--cx-radius-pill);
  border: 1px solid var(--cx-line);
  background: var(--cx-glass);
  color: #fff;
  display: grid;
  place-items: center;
  backdrop-filter: blur(10px);
}
.hero-arrow:hover { background: var(--cx-brand); border-color: transparent; }
.hero-dots { display: flex; gap: 0.4rem; }
.hero-dots button {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.28);
  padding: 0;
}
.hero-dots button.is-active {
  width: 22px;
  background: var(--cx-brand-2);
}
.hero-progress {
  position: absolute;
  z-index: 3;
  inset-inline: 12%;
  bottom: 0.55rem;
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
}
.hero-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--cx-play), var(--cx-brand));
}
.hero-progress.is-running span {
  animation: cxBar 6.5s linear both;
}
@keyframes cxBar {
  from { width: 0; }
  to { width: 100%; }
}

/* —— Audience —— */
.audience-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 1.25rem 0 0.5rem;
}
.audience-switch.compact { padding: 0.75rem 0 0; }
.audience-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1rem;
  border-radius: var(--cx-radius-pill);
  border: 1px solid var(--cx-line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--cx-muted);
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 160ms var(--cx-ease);
}
.audience-chip:hover {
  color: #fff;
  border-color: rgba(129, 140, 248, 0.5);
}
.audience-chip.is-on {
  background: linear-gradient(135deg, var(--cx-brand), #4f46e5);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}
.audience-chip.kids.is-on,
.audience-chip.kids:hover {
  background: linear-gradient(135deg, var(--cx-kids), #7c3aed);
  color: #fff;
  border-color: transparent;
}

/* —— Rows / rails —— */
.row {
  padding: 1.1rem 0 0.25rem;
  content-visibility: auto;
  contain-intrinsic-size: 420px;
  overflow: visible;
}
.row-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}
.row-head h2,
.section-label h2 {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.row-head h2::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 1.05em;
  margin-inline-end: 0.55rem;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--cx-brand-2), var(--cx-play));
  vertical-align: -0.15em;
}
.more {
  color: var(--cx-brand-2);
  font-weight: 700;
  font-size: 0.9rem;
}
.more:hover { color: #fff; }
.section-label {
  margin: 1.5rem 0 0;
  padding-top: 0.5rem;
}
.rail-wrap { position: relative; overflow: visible; }
.rail-wrap::before,
.rail-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 2rem;
  width: 4rem;
  z-index: 4;
  pointer-events: none;
}
.rail-wrap::before {
  right: 0;
  background: linear-gradient(90deg, transparent, var(--cx-bg));
}
.rail-wrap::after {
  left: 0;
  background: linear-gradient(270deg, transparent, var(--cx-bg));
}
.rail {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  overflow-y: visible;
  padding: 1.4rem 3.4rem 2.6rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail-btn {
  position: absolute;
  top: calc(var(--cx-poster-h) / 2 - 0.2rem);
  z-index: 5;
  width: 46px;
  height: 46px;
  border: 1px solid var(--cx-line);
  border-radius: var(--cx-radius-pill);
  background: var(--cx-glass);
  color: #fff;
  display: grid;
  place-items: center;
  backdrop-filter: blur(12px);
  opacity: 1;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}
.rail-btn:hover {
  background: var(--cx-brand);
  border-color: transparent;
}
.rail-btn.prev { left: 0.5rem; right: auto; }
.rail-btn.next { right: 0.5rem; left: auto; }

/* —— Cards —— */
.card {
  flex: 0 0 var(--cx-poster-w);
  width: var(--cx-poster-w);
  scroll-snap-align: start;
  position: relative;
}
.card-link { display: block; }
.poster {
  position: relative;
  width: var(--cx-poster-w);
  height: var(--cx-poster-h);
  border-radius: 12px;
  overflow: hidden;
  background: var(--cx-surface);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 240ms var(--cx-ease), border-color 180ms var(--cx-ease), box-shadow 240ms var(--cx-ease);
}
.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.card:hover .poster {
  transform: translateY(-10px) scale(1.06);
  border-color: rgba(129, 140, 248, 0.7);
  box-shadow: 0 28px 50px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(99, 102, 241, 0.35);
  z-index: 3;
}
.card-hover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.45rem;
  padding: 1rem;
  background: linear-gradient(180deg, transparent 30%, rgba(8, 8, 24, 0.92));
  opacity: 0;
  transition: opacity 180ms var(--cx-ease);
}
.card:hover .card-hover { opacity: 1; }
.play-mini {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff;
  color: #111;
}
.card-hover strong { font-size: 0.92rem; }
.imdb {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: var(--cx-gold);
  font-size: 0.75rem;
  font-weight: 800;
}
.badge-kids {
  position: absolute;
  bottom: 0.55rem;
  left: 0.55rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.95);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
}
.poster-fallback {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 1rem;
  text-align: center;
  color: var(--cx-muted);
  font-weight: 700;
}
.card-title {
  margin: 0.65rem 0 0.15rem;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta {
  margin: 0;
  color: var(--cx-muted);
  font-size: 0.78rem;
}

.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem 0.75rem;
}
.poster-grid .card {
  width: auto;
  flex: none;
  max-width: none;
}
.poster-grid .poster {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
}

/* —— Kids zone —— */
.kids-zone {
  margin-top: 2rem;
  padding: 1.75rem 0 1rem;
  background:
    radial-gradient(600px 220px at 20% 0%, rgba(167, 139, 250, 0.18), transparent 60%),
    linear-gradient(180deg, rgba(167, 139, 250, 0.08), transparent 50%);
  border-top: 1px solid rgba(167, 139, 250, 0.25);
}
.kids-zone-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.kids-zone-head h2 { margin: 0.25rem 0 0; font-size: 1.5rem; }

/* —— Detail —— */
.detail { position: relative; padding: 2rem 0 3rem; }
.detail-bg {
  position: absolute;
  inset: 0 0 auto 0;
  height: min(70vh, 620px);
  background:
    linear-gradient(100deg, var(--cx-bg) 10%, rgba(11, 11, 22, 0.82) 45%, transparent 78%),
    linear-gradient(var(--cx-bg), transparent 40%, var(--cx-bg)),
    var(--poster) right center / cover no-repeat;
}
.detail-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 860px) {
  .detail-grid { grid-template-columns: 260px 1fr; align-items: start; }
}
.detail-poster {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--cx-shadow);
  border: 1px solid var(--cx-line);
}
.detail-poster img { width: 100%; height: auto; }
.detail-copy h1 {
  margin: 0.4rem 0 0.8rem;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 900;
}
.content-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.tag {
  display: inline-flex;
  padding: 0.35rem 0.75rem;
  border-radius: var(--cx-radius-sm);
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid var(--cx-line);
  font-size: 0.82rem;
  font-weight: 600;
}
.tag:hover, .tag.is-on {
  background: var(--cx-brand);
  border-color: transparent;
  color: #fff;
}
.movie-desc { margin-top: 1.5rem; }
.movie-desc h2 { margin: 0 0 0.6rem; font-size: 1.15rem; }
.hint, .muted { color: var(--cx-muted); }
.readmore-text {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.readmore.is-open .readmore-text {
  display: block;
  -webkit-line-clamp: unset;
}
.readmore-btn {
  margin-top: 0.5rem;
  background: transparent;
  border: 0;
  color: var(--cx-brand-2);
  font-weight: 700;
}

/* —— Browse —— */
.page-head { padding: 1.5rem 0 0.5rem; }
.browse-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  justify-content: space-between;
}
.browse-toolbar h1 { margin: 0; font-size: 1.75rem; font-weight: 900; }
.browse-count { display: none !important; }
.browse-actions { display: flex; gap: 0.5rem; align-items: center; }
.browse-search .input { min-width: min(260px, 70vw); }
.active-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.9rem; }
.grid-page { padding: 1rem 0 3rem; }
.endless-status {
  text-align: center;
  color: var(--cx-muted);
  padding: 1rem;
}
.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--cx-muted);
}
.empty h2 { color: var(--cx-fg); }

/* —— Auth / subscribe —— */
.auth,
.auth-page {
  min-height: calc(100vh - var(--cx-header));
  display: grid;
  place-items: center;
  padding: 2rem 1rem 3rem;
}
.auth-card {
  width: min(440px, 100%);
  padding: 1.75rem;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(22, 22, 50, 0.95), rgba(12, 12, 28, 0.95));
  border: 1px solid var(--cx-line);
  box-shadow: var(--cx-shadow);
  display: grid;
  gap: 0.85rem;
}
.auth-card h1 { margin: 0; font-size: 1.5rem; }
.auth-card .muted { margin: 0; }
.auth-card form { display: grid; gap: 0.85rem; }
.auth-logo.site-logo,
img.auth-logo {
  width: auto !important;
  height: auto !important;
  max-width: min(220px, 72%);
  max-height: 72px;
  margin-inline: auto;
  object-fit: contain;
  object-position: center;
}
.auth-switch { margin: 0; color: var(--cx-muted); text-align: center; }
.auth-switch a { color: var(--cx-brand-2); font-weight: 700; }
.subscribe-hero {
  padding: 3rem 0 1.5rem;
  text-align: center;
  background:
    radial-gradient(700px 260px at 50% 0%, rgba(99, 102, 241, 0.28), transparent 60%);
}
.subscribe-hero h1 {
  margin: 0.5rem auto 0.75rem;
  max-width: 18ch;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 900;
}
.subscribe-lead {
  margin: 0 auto;
  max-width: 36rem;
  color: var(--cx-muted);
}
.subscribe-plans { padding: 1rem 0 4rem; }
.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.6rem 1.25rem 1.25rem;
  border-radius: 18px;
  background: var(--cx-surface);
  border: 1px solid var(--cx-line);
  transition: transform 180ms var(--cx-ease), border-color 180ms var(--cx-ease);
}
.plan-card:hover {
  transform: translateY(-4px);
  border-color: rgba(129, 140, 248, 0.55);
}
.plan-card.is-featured {
  border-color: var(--cx-brand);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.2), var(--cx-surface) 45%);
  transform: scale(1.03);
  z-index: 1;
}
.plan-badge {
  position: absolute;
  top: -0.7rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: var(--cx-brand);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
}
.plan-card h2 { margin: 0.4rem 0 0; text-align: center; font-size: 1.25rem; }
.plan-card .price {
  margin: 0;
  text-align: center;
  font-size: 2rem;
  font-weight: 900;
}
.plan-card .price small {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cx-muted);
}
.price-month { margin: 0; text-align: center; color: var(--cx-muted); font-size: 0.85rem; }
.plan-features {
  list-style: none;
  margin: 0.75rem 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  flex: 1;
}
.plan-features li {
  position: relative;
  padding-inline-start: 1.2rem;
  color: #d4d4f0;
  font-size: 0.9rem;
}
.plan-features li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.45em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--cx-brand-2);
}
.plan-card .btn { margin-top: auto; }
.subscribe-note { text-align: center; margin-top: 1.5rem; font-size: 0.85rem; }

/* —— Footer —— */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 2rem;
  padding: 2.5rem 0 2rem;
  border-top: 1px solid var(--cx-line);
  background: rgba(8, 8, 20, 0.85);
}
.footer-inner { display: grid; gap: 1.25rem; }
.footer-slogan { margin: 0; color: var(--cx-muted); max-width: 40rem; }
.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: space-between;
  align-items: center;
}
.trust-badges { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.trust-badge, .trust-badge-btn {
  appearance: none;
  border: 1px solid var(--cx-line);
  background: var(--cx-surface);
  border-radius: 12px;
  padding: 0.35rem;
}
.trust-badge img, .trust-badge-btn img { width: 64px; height: 64px; object-fit: contain; }

.flash-wrap { padding-top: 1rem; }
.flash {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.16);
  border: 1px solid var(--cx-line);
  margin-bottom: 0.5rem;
}

.pwa-install[hidden] { display: none !important; }
.pwa-install {
  position: fixed;
  z-index: 80;
  inset-inline: 1rem;
  bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: var(--cx-glass);
  border: 1px solid var(--cx-line);
  backdrop-filter: blur(16px);
  box-shadow: var(--cx-shadow);
}
.pwa-install p { margin: 0; font-weight: 700; }
.pwa-install-actions { display: flex; gap: 0.45rem; }

.watch-page { padding-bottom: 2rem; }
.watch-meta { padding-top: 1rem; }
.watch-meta h1 { margin: 0 0 0.5rem; font-size: 1.5rem; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 450ms var(--cx-ease), transform 450ms var(--cx-ease); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cx-ambient span,
  .hero-slide.is-active .hero-bg-img,
  .hero-progress.is-running span { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card:hover .poster,
  .plan-card:hover,
  .plan-card.is-featured { transform: none; }
}

@media (max-width: 1024px) {
  .plans-grid { grid-template-columns: 1fr; max-width: 420px; margin-inline: auto; }
  .plan-card.is-featured { transform: none; }
  :root {
    --cx-poster-w: 160px;
    --cx-poster-h: 240px;
  }
}

@media (max-width: 768px) {
  .hero {
    aspect-ratio: 2 / 3;
    max-height: min(78vh, 640px);
    min-height: 420px;
    height: auto;
  }
  .hero-inner {
    padding-bottom: 3.75rem;
    align-items: flex-end;
  }
  .hero-copy { max-width: 100%; }
  .hero-poster-plate {
    display: none;
  }
  .hero-bg-img,
  .hero-bg-cinema {
    object-fit: cover;
    object-position: center 18%;
    filter: saturate(1.08) contrast(1.05);
  }
  .hero-lead { -webkit-line-clamp: 2; font-size: 0.88rem; }
  .hero-copy h1 { font-size: clamp(1.45rem, 7vw, 2rem); }
  .hero-veil {
    background:
      linear-gradient(180deg, rgba(5, 10, 20, 0.2) 0%, rgba(5, 10, 20, 0.15) 38%, rgba(5, 10, 20, 0.78) 72%, rgba(5, 10, 20, 0.96) 100%),
      linear-gradient(90deg, rgba(5, 10, 20, 0.15) 0%, transparent 40%, rgba(5, 10, 20, 0.35) 100%);
  }
  .hero-arrow { display: none; }
  .card:hover .poster { transform: none; }
  .rail { padding: 0.9rem 2.6rem 1.8rem; }
  .rail-btn { width: 40px; height: 40px; }
  .dash-body { grid-template-columns: 1fr; }
  .dash-side {
    position: sticky;
    top: 0;
    z-index: 5;
    border-inline-end: 0;
    border-bottom: 1px solid var(--cx-line);
  }
  .dash-nav { display: flex; flex-wrap: wrap; }
  :root {
    --cx-poster-w: 132px;
    --cx-poster-h: 198px;
  }
}

/* —— Account / tables / pills / dashboard —— */
.account-page {
  padding: 0.5rem 0 3rem;
  display: grid;
  gap: 1rem;
}
.account-page h2 {
  margin: 1rem 0 0.35rem;
  font-size: 1.15rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--cx-line);
}
.pill-ok {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--cx-line);
  background: var(--cx-surface);
}
.data-table th,
.data-table td {
  padding: 0.75rem 0.9rem;
  text-align: right;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.data-table th {
  background: rgba(99, 102, 241, 0.12);
  font-size: 0.85rem;
  color: var(--cx-brand-2);
}
.data-table tr:last-child td { border-bottom: 0; }
.filter-btn.is-on {
  border-color: var(--cx-brand-2);
  background: rgba(99, 102, 241, 0.22);
}
.dash-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  background: var(--cx-bg);
}
.dash-side {
  padding: 1.25rem;
  background: #101024;
  border-inline-end: 1px solid var(--cx-line);
}
.dash-nav {
  display: grid;
  gap: 0.35rem;
  margin-top: 1.5rem;
}
.dash-nav a {
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  color: var(--cx-muted);
  font-weight: 600;
}
.dash-nav a:hover {
  background: rgba(99, 102, 241, 0.16);
  color: #fff;
}
.dash-main { padding: 1.5rem; }
.offline-page { padding: 4rem 1rem; }

/* Ensure buttons aren't unstyled if a reset sneaks in */
button.btn, a.btn { text-decoration: none; }
