:root {
  --bg: #14111a;
  --panel: #1f1a28;
  --line: #2f2840;
  --text: #ece8f2;
  --muted: #a49cb3;
  --accent: #e8547a;
  --accent-2: #f2a65a;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

.top { border-bottom: 1px solid var(--line); background: #100d15; }
.top__in { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
.logo { font-weight: 700; font-size: 18px; color: var(--text); }
.menu { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 15px; }
.menu a { color: var(--muted); }

.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 4px; }
.crumbs a { color: var(--muted); }

h1 { font-size: clamp(24px, 4vw, 34px); line-height: 1.2; margin: 14px 0 6px; }
h2 { font-size: 20px; margin: 0 0 10px; }
.meta { color: var(--muted); margin: 0 0 18px; }

.player { margin: 18px 0 8px; }
.player__frame {
  position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden;
  background: radial-gradient(circle at 30% 30%, #3a2440, #120f17 70%) center / cover no-repeat;
  display: grid; place-items: center;
}
.player__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.player__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player__play {
  position: relative; z-index: 1;
  width: 84px; height: 84px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: #fff; display: grid; place-items: center;
  box-shadow: 0 10px 40px rgba(232, 84, 122, .45); transition: transform .15s;
}
.player__play:hover { transform: scale(1.06); }
.player__caption { position: absolute; left: 16px; bottom: 14px; right: 16px; font-size: 14px; color: #fff; text-shadow: 0 1px 4px #000; }
.player__nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; }
.btn { display: inline-block; padding: 8px 14px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); color: var(--text); font-size: 14px; }

.block { display: flow-root; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin: 16px 0; }
.block p { margin: 0 0 10px; }
.block p:last-child { margin-bottom: 0; }
.links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.links a { display: inline-block; padding: 6px 12px; border-radius: 999px; background: #2a2337; color: var(--text); font-size: 14px; }
.links--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.links--grid a { display: block; border-radius: 8px; text-align: center; }
.faq details { border-top: 1px solid var(--line); padding: 10px 0; }
.faq details:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 8px 0 0; color: var(--muted); }

.foot { border-top: 1px solid var(--line); margin-top: 32px; padding: 20px 0; color: var(--muted); font-size: 14px; }
.foot p { margin: 4px 0; }

.cover { float: right; width: 180px; height: auto; margin: 0 0 12px 20px; border-radius: 10px; }
@media (max-width: 560px) { .cover { float: none; display: block; margin: 16px auto; } }
.cast { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.cast__item { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.cast__item img, .cast__ph { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 8px; background: #2a2337; margin-bottom: 6px; }
.cast__item small, .cast__item span { color: var(--muted); }
.tmdb { font-size: 12px; }

/* ---------- Фон страницы из галереи сериала ---------- */
body.has-bd { position: relative; }
body.has-bd::before {
  content: ""; position: absolute; z-index: -1; inset: 0 0 auto 0; height: 560px;
  background: linear-gradient(to bottom, rgba(20, 17, 26, .55) 0%, var(--bg) 100%), var(--bd) center 30% / cover no-repeat;
  opacity: .5;
}
body.has-bd .top { background: rgba(16, 13, 21, .7); backdrop-filter: blur(8px); }

/* ---------- Первый экран главной ---------- */
.hero {
  position: relative; min-height: 520px; display: flex; align-items: flex-end;
  background: linear-gradient(to top, var(--bg) 2%, rgba(20, 17, 26, .65) 45%, rgba(20, 17, 26, .15) 100%),
              linear-gradient(to right, rgba(20, 17, 26, .85) 0%, rgba(20, 17, 26, 0) 65%),
              var(--hero) center 25% / cover no-repeat;
}
.hero__in { padding-top: 48px; padding-bottom: 32px; width: 100%; }
.hero__logo { display: block; width: min(320px, 70vw); height: auto; margin-bottom: 14px; filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .6)); }
.hero h1 { font-size: clamp(26px, 4.5vw, 42px); margin: 0 0 8px; text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
.hero__sub { max-width: 640px; margin: 0 0 14px; color: #ddd6e8; text-shadow: 0 1px 6px rgba(0, 0, 0, .7); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn--primary:hover { text-decoration: none; filter: brightness(1.08); }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.chips li { padding: 4px 12px; border-radius: 999px; background: #2a2337; font-size: 14px; }
.chips--hero li { background: rgba(20, 17, 26, .7); border: 1px solid rgba(255, 255, 255, .15); backdrop-filter: blur(4px); }

/* ---------- Факты, карточка человека ---------- */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.person { display: flex; gap: 20px; align-items: flex-start; }
.person__photo { width: 185px; height: auto; border-radius: 10px; flex-shrink: 0; }
.person .facts { margin-bottom: 12px; }
@media (max-width: 560px) {
  .person { flex-direction: column; }
  .person__photo { width: 150px; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: 8px; }
}
.cast__item a { display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.cast__item a:hover { text-decoration: none; }
.cast__item a:hover b { color: var(--accent-2); }

/* ---------- Трейлеры и галерея ---------- */
.videos { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: #000; }
.video img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .8; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video__play { width: 64px; height: 64px; }
.video__name { position: absolute; left: 12px; right: 12px; bottom: 10px; font-size: 13px; color: #fff; text-shadow: 0 1px 4px #000; }
.gallery { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.gallery img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; transition: transform .15s; }
.gallery a:hover img { transform: scale(1.03); }

/* ---------- Карточки сезонов ---------- */
.scards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 190px)); gap: 16px; }
.scard { display: flex; flex-direction: column; color: var(--text); border-radius: 10px; overflow: hidden; background: #2a2337; transition: transform .15s; }
.scard:hover { text-decoration: none; transform: translateY(-3px); }
.scard img, .scard__ph { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; background: #1a1622; }
.scard__body { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; font-size: 14px; }
.scard__body b { font-size: 16px; }
.scard__body span { color: var(--muted); }
.scard:hover b { color: var(--accent-2); }

/* ---------- Уведомление о cookie ---------- */
.cookie {
  position: fixed; z-index: 50; left: 16px; right: 16px; bottom: 16px; max-width: 720px; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 14px 18px;
  background: rgba(31, 26, 40, .97); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5); font-size: 14px;
}
.cookie p { margin: 0; flex: 1 1 320px; color: var(--muted); }
.cookie__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cookie .btn { cursor: pointer; font: inherit; }
