:root {
  --bg: #17151c;
  --bg-deep: #0f0e13;
  --bg-elev: #211e2a;
  --bg-card: #26222f;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f6f3fb;
  --muted: #a89fbd;
  --primary: #8251ec;
  --primary-hover: #7140db;
  --accent: #7a6fff;
  --pink: #ff4d9d;
  --white: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --gutter: 16px;
  --header-h: 60px;
  --card-w: 124px;
  --hero-w: min(66vw, 300px);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.door-open { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.01em; }
svg { display: inline-block; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; font-size: 14px; line-height: 1; white-space: nowrap;
  transition: background-color 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: rgba(255, 255, 255, 0.22); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
.btn-white { background: var(--white); color: #16121f; }
.btn-white:hover { background: #ece7f7; }
.btn-lg { padding: 14px 26px; font-size: 16px; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--accent); font-weight: 600; font-size: 14px; }

.site-header { position: relative; z-index: 5; }
.promo-strip {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 8px var(--gutter); font-size: 13px; font-weight: 600;
  background: linear-gradient(90deg, #5c2bd6, #ff4d9d);
  color: var(--white);
}
.promo-link { padding: 3px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.28); font-weight: 700; }
.header-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: var(--header-h); padding: 0 var(--gutter);
  background: linear-gradient(180deg, rgba(58, 19, 96, 0.92), rgba(58, 19, 96, 0.55));
}
body[data-view="home"] .header-row { position: absolute; left: 0; right: 0; background: linear-gradient(180deg, rgba(20, 8, 40, 0.75), rgba(20, 8, 40, 0)); }
body[data-view="home"] .view { padding-top: 0; }
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; position: relative; flex: none;
  background: linear-gradient(135deg, var(--pink), var(--primary));
}
.brand-mark::after {
  content: ''; position: absolute; left: 11px; top: 8px;
  border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent #fff;
}
.brand-name { font-weight: 800; font-size: 19px; letter-spacing: 0.02em; text-transform: uppercase; }
.header-actions { display: flex; gap: 8px; }
.header-actions .btn { padding: 9px 14px; font-size: 13px; }

.view { min-height: 100vh; }
.loading { padding: 80px var(--gutter); text-align: center; color: var(--muted); }

.hero { position: relative; padding: calc(var(--header-h) + 8px) 0 8px; overflow: hidden; isolation: isolate; }
.hero-bg {
  position: absolute; inset: -40px; z-index: -2; background-size: cover; background-position: center 20%;
  filter: blur(42px) saturate(1.2) brightness(0.5); transform: scale(1.15); opacity: 0.9;
  transition: background-image 0.4s ease;
}
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(58, 19, 96, 0.55) 0%, rgba(23, 21, 28, 0.35) 55%, var(--bg) 100%);
}
.hero-track {
  position: relative; display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 10px calc(50% - var(--hero-w) / 2) 6px;
}
.hero-track::-webkit-scrollbar { display: none; }
.hero-slide { flex: 0 0 var(--hero-w); scroll-snap-align: center; transition: transform 0.3s ease, opacity 0.3s ease; transform: scale(0.92); opacity: 0.62; }
.hero-slide.is-active { transform: scale(1); opacity: 1; }
.hero-poster { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: 14px; overflow: hidden; background: var(--bg-card); box-shadow: var(--shadow); }
.hero-poster img { width: 100%; height: 100%; object-fit: cover; }
.hero-arrow {
  position: absolute; top: 42%; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, 0.55); color: #fff; display: none; align-items: center; justify-content: center;
}
.hero-arrow svg { width: 22px; height: 22px; }
.hero-arrow-prev { left: 10px; }
.hero-arrow-next { right: 10px; }
.hero-caption { text-align: center; padding: 8px var(--gutter) 0; }
.hero-title { font-size: 21px; font-weight: 800; min-height: 1.15em; }
.hero-sub { margin: 6px 0 12px; color: var(--muted); font-size: 13px; font-weight: 500; }
.hero-cta { min-width: 220px; }
.hero-dots { display: flex; justify-content: center; gap: 7px; margin-top: 14px; }
.dot { width: 7px; height: 7px; border-radius: 50%; border: 0; padding: 0; background: rgba(255, 255, 255, 0.28); }
.dot.is-active { background: #fff; width: 18px; border-radius: 999px; }

.pill {
  position: absolute; left: 8px; top: 8px; padding: 3px 7px; border-radius: 6px;
  background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: 0.02em;
}
.views {
  position: absolute; right: 8px; top: 8px; display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 7px; border-radius: 6px; background: rgba(0, 0, 0, 0.62); color: #fff; font-size: 10.5px; font-weight: 700;
}
.views svg { width: 11px; height: 11px; }

.rails { display: flex; flex-direction: column; gap: 26px; padding: 22px 0 40px; }
.rail-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 var(--gutter); margin-bottom: 12px; }
.rail-head h2 { font-size: 18px; font-weight: 800; }
.rail-track {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
  padding: 0 var(--gutter) 6px;
}
.rail-track::-webkit-scrollbar { display: none; }
.card { flex: 0 0 var(--card-w); scroll-snap-align: start; display: block; }
.card-poster { position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-card); }
.card-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s ease; }
.card:hover .card-poster img { transform: scale(1.04); }
.card-title {
  margin-top: 8px; font-size: 13px; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.show { padding: 12px var(--gutter) 40px; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; margin-bottom: 12px; white-space: nowrap; overflow: hidden; }
.crumbs a { color: var(--accent); font-weight: 600; }
.crumb-title { overflow: hidden; text-overflow: ellipsis; }
.show-layout { display: flex; flex-direction: column; gap: 18px; }
.player-frame {
  position: relative; width: 100%; aspect-ratio: 9 / 16; max-height: 72vh; margin: 0 auto;
  border-radius: 14px; overflow: hidden; background: #000; box-shadow: var(--shadow);
}
.player { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-bug {
  position: absolute; left: 2.5%; top: 1%; width: 25%; height: 13%; z-index: 2; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6%;
  border-radius: 14px; background: rgba(12, 9, 20, 0.88); backdrop-filter: blur(8px); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
.player-bug .brand-mark { width: 34%; height: auto; aspect-ratio: 1; border-radius: 28%; }
.player-bug .brand-mark::after { left: 38%; top: 28%; border-width: 22% 0 22% 36%; }
.player-bug .brand-name { font-size: clamp(8px, 2.6cqw, 12px); letter-spacing: 0.04em; }
.player-frame { container-type: inline-size; }
.big-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 76px; height: 76px; border-radius: 50%; border: 0;
  background: rgba(130, 81, 236, 0.92); color: #fff; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
}
.big-play svg { width: 40px; height: 40px; }
.ep-nav {
  position: absolute; right: 10px; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, 0.55); color: #fff; display: flex; align-items: center; justify-content: center; z-index: 2;
}
.ep-nav svg { width: 24px; height: 24px; }
.ep-nav:disabled { opacity: 0.3; cursor: default; }
.ep-nav-prev { top: 12px; }
.ep-nav-next { top: 60px; }
.player-locked { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.player-locked-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(14px) brightness(0.35); transform: scale(1.08); }
.player-locked-card {
  position: relative; z-index: 1; margin: 16px; padding: 26px 20px; border-radius: 16px; text-align: center;
  background: rgba(23, 21, 28, 0.82); border: 1px solid var(--line); backdrop-filter: blur(6px);
  display: flex; flex-direction: column; gap: 10px; align-items: center; max-width: 320px;
}
.player-locked-card h2 { font-size: 20px; font-weight: 800; }
.player-locked-card p { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.lock-badge { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--pink), var(--primary)); color: #fff; }
.lock-badge svg { width: 26px; height: 26px; }
.player-meta { display: flex; gap: 14px; justify-content: center; margin-top: 10px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.age { padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; font-size: 11px; }

.show-title { font-size: 22px; font-weight: 800; }
.show-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 16px; color: var(--muted); font-size: 13px; font-weight: 600; }
.score { display: inline-flex; align-items: center; gap: 4px; color: #ffcf5c; }
.score svg { width: 13px; height: 13px; }

.episode-rail { position: relative; display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 8px; margin: 0 -2px 14px; }
.episode-rail::-webkit-scrollbar { display: none; }
.ep-thumb {
  flex: 0 0 74px; border: 0; padding: 0; background: none; text-align: left; position: relative;
  display: flex; flex-direction: column; gap: 6px;
}
.ep-thumb-img {
  display: block; width: 74px; aspect-ratio: 2 / 3; border-radius: 8px; background-size: cover; background-position: center;
  border: 2px solid transparent; transition: border-color 0.15s ease, opacity 0.15s ease;
}
.ep-thumb.is-active .ep-thumb-img { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(122, 111, 255, 0.35); }
.ep-thumb.is-locked .ep-thumb-img { opacity: 0.55; filter: saturate(0.6); }
.ep-lock {
  position: absolute; left: 50%; top: 46px; transform: translateX(-50%); width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.7); color: #fff; display: flex; align-items: center; justify-content: center;
}
.ep-lock svg { width: 14px; height: 14px; }
.ep-label { font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.ep-thumb.is-active .ep-label { color: var(--text); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tag { padding: 4px 10px; border-radius: 999px; background: var(--bg-elev); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); }
.synopsis {
  margin: 0; color: #d9d3e6; font-size: 14px;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.synopsis.is-open { display: block; }
.show .rail { margin: 30px calc(-1 * var(--gutter)) 0; }

.site-footer { border-top: 1px solid var(--line); background: var(--bg-deep); padding: 30px var(--gutter) 34px; }
.footer-inner { display: flex; flex-direction: column; gap: 22px; max-width: 1200px; margin: 0 auto; }
.footer-tagline { margin: 10px 0 14px; color: var(--muted); font-size: 14px; }
.store-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-store { flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 16px; border-radius: 10px; background: #fff; color: #16121f; }
.store-small { font-size: 10px; font-weight: 600; opacity: 0.7; }
.store-big { font-size: 15px; font-weight: 800; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 13px; font-weight: 600; color: var(--muted); }
.footer-copy { margin: 0; color: var(--muted); font-size: 12px; }

.legal { padding: 32px var(--gutter) 64px; }
.legal-body { max-width: 720px; margin: 0 auto; font-size: 16px; line-height: 1.6; }
.legal-body h1 { margin-bottom: 24px; font-size: 32px; }
.legal-body h2 { margin: 32px 0 12px; font-size: 20px; }
.legal-body p, .legal-body ul, .legal-body ol { margin: 0 0 16px; color: var(--muted); }
.legal-body a { color: var(--accent); text-decoration: underline; }

.door { position: fixed; inset: 0; z-index: 50; }
.door[hidden] { display: none; }
.door-backdrop { position: absolute; inset: 0; background: rgba(8, 6, 14, 0.7); opacity: 0; transition: opacity 0.25s ease; }
.door-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto;
  padding: 18px 20px calc(24px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #2a1550 0%, #1c1726 40%, #17151c 100%);
  border-radius: 22px 22px 0 0; border-top: 1px solid rgba(255, 255, 255, 0.12);
  transform: translateY(24px); opacity: 0; transition: transform 0.28s ease, opacity 0.28s ease;
}
.door.is-visible .door-backdrop { opacity: 1; }
.door.is-visible .door-sheet { transform: translateY(0); opacity: 1; }
.door-close { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.1); color: #fff; display: flex; align-items: center; justify-content: center; }
.door-art { display: flex; justify-content: center; margin: 6px 0 14px; }
.door-phone {
  display: block; width: 74px; height: 128px; border-radius: 16px; padding: 6px;
  background: linear-gradient(135deg, var(--pink), var(--primary)); box-shadow: var(--shadow);
}
.door-phone-screen {
  display: block; width: 100%; height: 100%; border-radius: 11px;
  background: linear-gradient(180deg, #2d1b55, #120e1c);
  position: relative;
}
.door-phone-screen::after {
  content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-40%, -50%);
  border-style: solid; border-width: 10px 0 10px 16px; border-color: transparent transparent transparent #fff;
}
.door-title { font-size: 21px; font-weight: 800; text-align: center; }
.door-body { margin: 10px 0 16px; color: #d9d3e6; font-size: 14.5px; text-align: center; }
.door-form { display: flex; flex-direction: column; gap: 10px; }
.door-input {
  width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06); color: #fff; font: inherit; font-size: 16px;
}
.door-input::placeholder { color: rgba(255, 255, 255, 0.45); }
.door-input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.door-input.is-invalid { border-color: var(--pink); }
.door-error { margin: 0; color: var(--pink); font-size: 13px; font-weight: 600; }
.door-fine { margin: 12px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.door-success-state { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.door-success-state .btn { margin-top: 10px; }

.debug {
  position: fixed; left: 8px; bottom: 8px; z-index: 60; max-width: min(92vw, 620px); max-height: 40vh; overflow: auto;
  padding: 8px 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.82); color: #9ef29e;
  font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; pointer-events: none;
}
.debug div { white-space: pre-wrap; word-break: break-all; }

@media (min-width: 900px) {
  :root { --gutter: 40px; --card-w: 168px; --hero-w: 300px; --header-h: 72px; }
  body { font-size: 16px; }
  .promo-strip { font-size: 14px; }
  .header-row { padding: 0 var(--gutter); }
  .header-actions .btn { padding: 11px 20px; font-size: 14px; }
  .hero { padding-top: calc(var(--header-h) + 24px); padding-bottom: 20px; }
  .hero-track { gap: 22px; padding-bottom: 12px; }
  .hero-arrow { display: flex; }
  .hero-arrow:hover { background: rgba(0, 0, 0, 0.8); }
  .hero-title { font-size: 34px; }
  .hero-sub { font-size: 15px; }
  .rails { gap: 34px; max-width: 1280px; margin: 0 auto; }
  .rail-head h2 { font-size: 22px; }
  .rail-track { gap: 14px; }
  .card-title { font-size: 14px; }
  .show { max-width: 1200px; margin: 0 auto; padding-top: 22px; }
  .show-layout { flex-direction: row; align-items: flex-start; gap: 36px; }
  .player-col { flex: 0 0 400px; position: sticky; top: 16px; }
  .player-frame { max-height: none; }
  .info-col { flex: 1; min-width: 0; }
  .show-title { font-size: 30px; }
  .ep-thumb { flex-basis: 84px; }
  .ep-thumb-img { width: 84px; }
  .ep-lock { top: 52px; }
  .synopsis { -webkit-line-clamp: 6; font-size: 15px; }
  .show .rail { margin: 40px 0 0; }
  .footer-inner { flex-direction: row; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
  .footer-links { flex-direction: column; gap: 10px; }
  .footer-copy { width: 100%; }
  .door-sheet {
    left: 50%; right: auto; top: 50%; bottom: auto; width: 460px; max-height: 88vh;
    transform: translate(-50%, -46%); border-radius: 22px; border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 26px 30px 28px;
  }
  .door.is-visible .door-sheet { transform: translate(-50%, -50%); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-slide, .door-sheet, .door-backdrop, .card-poster img { transition: none; }
}
