/*
 * Тема «ретро-кинозал»: тёплый графит, кремовый текст, кирпично-красный акцент и латунные детали.
 *
 * Подключается ПОСЛЕДНЕЙ и переопределяет оформление, унаследованное от AllohaSerial (тёмно-синее
 * «ночное» небо, оранжевое золото, пилюли, нумерация разделов). Базовые файлы css не правим:
 * их удобно обновлять из исходного проекта.
 *
 * Для отдельного сайта тему можно изменить, положив свой assets/css/theme.css в папку сайта
 * (public/assets/css/theme.css): файл сайта главнее файла движка.
 */

:root {
  /* поверхности: тёплый кофейно-коричневый (на нём постеры 40-х выглядят «плёночно») */
  --ground:      #2d241e;
  --ground-soft: #342a23;
  --surface:     #3c3029;
  --surface-2:   #463931;
  --surface-3:   #51443b;

  /* текст: кремовый, а не белый */
  --ink:   #f1e8d6;
  --ink-2: #cdbfa8;
  --ink-3: #ab9b83;

  --rule:      rgb(255 244 224 / 0.12);
  --rule-soft: rgb(255 244 224 / 0.07);

  /* акцент: приглушённое золото (пыльная латунь), без кричащей яркости; латунь — для мелких деталей */
  --accent:      #cdac63;
  --accent-dim:  #a68a47;
  --accent-ink:  #2b2010;
  --accent-soft: rgb(205 172 99 / 0.17);
  --brass:       #b8955a;
  --vote:        #8aa8cf;       /* звёзды зрителей: пыльно-голубой, чтобы не сливались с золотом IMDb и зеленью Кинопоиска */

  --font-display: Georgia, "Times New Roman", "Noto Serif", serif;

  --radius:    8px;
  --radius-sm: 4px;
  --radius-lg: 12px;

  --image-hover-scale: 1.04;

  --shadow:    0 1px 2px rgb(0 0 0 / 0.35), 0 12px 28px -18px rgb(0 0 0 / 0.7);
  --shadow-lg: 0 4px 12px rgb(0 0 0 / 0.4), 0 22px 50px -26px rgb(0 0 0 / 0.75);
}

/* Фон: ровный графит с мягким тёплым светом сверху и едва заметным зерном плёнки. */
body {
  background:
    radial-gradient(1100px 520px at 50% -180px, rgb(255 232 190 / 0.07), transparent 70%),
    var(--ground);
}
body::before { opacity: 0.07; }

h1, h2, h3 { letter-spacing: -0.015em; }
h1 { font-weight: 600; }

/* ---------- шапка ---------- */
.header {
  height: 80px;
  background: rgb(45 36 30 / 0.94);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.5), 0 12px 28px -10px rgb(0 0 0 / 0.75), 0 4px 10px -4px rgb(0 0 0 / 0.5);
}
.logo-text, .sheen {
  background-image: linear-gradient(105deg, var(--ink) 0 46%, var(--brass) 64% 100%);
}
.nav a::after { height: 2px; bottom: 2px; background: var(--accent); }
.search input { border-radius: 8px; background: var(--surface); }

/* ---------- кнопки: прямоугольные со скруглением, без пилюль ---------- */
.btn { border-radius: 6px; font-weight: 600; letter-spacing: 0.01em; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 24px -16px rgb(205 172 99 / 0.8); }
.btn-primary:hover { background: #dcbf7a; }

/* ---------- главная ---------- */
.page-home .home-lead {
  background:
    linear-gradient(90deg, rgb(45 36 30 / 0.98) 0 36%, rgb(45 36 30 / 0.7) 64%, rgb(45 36 30 / 0.92) 100%),
    linear-gradient(135deg, rgb(120 92 52 / 0.28), rgb(70 44 32 / 0.3));
}
.page-home .home-lead::before {
  background:
    linear-gradient(90deg, rgb(45 36 30 / 0.92) 0%, rgb(45 36 30 / 0.66) 38%, rgb(45 36 30 / 0.28) 70%, rgb(45 36 30 / 0.5) 100%),
    linear-gradient(0deg, rgb(45 36 30 / 0.12), transparent 55%);
}
.page-home .home-kicker, .hero-kicker { color: var(--brass); letter-spacing: 0.2em; }
.page-home .home-lead h1 em { color: var(--brass); }

/* Разделы главной: вместо номеров «01, 02» — красная метка слева. */
.home-section .section-head h2 { padding-left: 18px; }
.home-section .section-head h2::before {
  content: '';
  top: 50%;
  left: 0;
  width: 4px;
  height: 0.95em;
  transform: translateY(-50%);
  border-radius: 2px;
  background: var(--accent);
  font-size: inherit;
}
.section-head h2 a::after { color: var(--brass); }

/* ---------- карточки фильмов ---------- */
.card-poster {
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 14px 26px -20px #000;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.card:hover .card-poster, .card:focus-visible .card-poster {
  box-shadow: 0 22px 34px -22px #000;           /* карточка не поднимается: увеличивается только картинка внутри */
}
.card-rating {
  border-radius: 4px;
  border-color: rgb(184 149 90 / 0.5);
  background: rgb(45 36 30 / 0.92);
  color: var(--brass);
}
.chip-link { border-radius: 4px; border-color: var(--rule); background: rgb(255 244 224 / 0.04); }
.chip-link:hover, .chip-link:focus-visible { border-color: rgb(205 172 99 / 0.65); transform: translateY(-1px); }
.chip { border-radius: 4px; }

/* ---------- страница фильма ---------- */
/* Карточка фильма — во всю ширину экрана, без скруглений и боковых рамок; киноплёнка сверху и снизу. */
body { overflow-x: clip; }                /* 100vw включает полосу прокрутки: без этого появлялась бы горизонтальная */

.hero {
  margin: 0 calc(50% - 50vw);
  padding: clamp(40px, 5vw, 64px) max(24px, calc((100vw - var(--wrap)) / 2 + 24px));
  border: 0;
  border-block: 1px solid var(--rule);
  border-radius: 0;
  background: linear-gradient(120deg, rgb(255 244 224 / 0.05), transparent 60%), var(--surface);
  box-shadow: none;
}
.hero::before,
.hero::after {                            /* перфорация киноплёнки: верхний и нижний край */
  content: '';
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  width: auto;
  height: 14px;
  z-index: 1;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  pointer-events: none;
}
.hero::before {
  top: 0;
  right: 0;
  background: repeating-linear-gradient(90deg, transparent 0 8px, rgb(255 244 224 / 0.16) 8px 20px, transparent 20px 30px) center 4px / 100% 6px no-repeat;
}
.hero::after {
  top: auto;
  bottom: 0;
  background: repeating-linear-gradient(90deg, transparent 0 8px, rgb(255 244 224 / 0.16) 8px 20px, transparent 20px 30px) center 4px / 100% 6px no-repeat;
}
.hero-poster { border-radius: 8px; box-shadow: 0 30px 56px -30px #000; }
.rating-badge { border-radius: 6px; background: rgb(255 244 224 / 0.06); }
.notice { background: rgb(60 48 41 / 0.8); border-radius: 10px; }
.player { border-radius: 8px; }
.stars-fill { color: var(--brass); }

/* ---------- подвал ---------- */
/* Та же киноплёнка, что на карточке фильма: полосы сверху и снизу отступают от линии границы. */
.footer {
  position: relative;
  padding-block: 26px;
  background: var(--ground-soft);
  border-top: 1px solid var(--rule);
}
.footer::before,
.footer::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 14px;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 8px, rgb(255 244 224 / 0.16) 8px 20px, transparent 20px 30px) center 4px / 100% 6px no-repeat;
}
.footer::before { top: 0; }
.footer::after { bottom: 0; }

/* ---------- вертикальный ритм страницы фильма ----------
   Карточка → плеер → сведения о файле → оценка → жалобы → озвучки → описание → разделы.
   Крупные блоки разделены 40–64 px, связанные между собой (оценка и жалобы) — 12–24 px. */
.hero { margin-bottom: clamp(32px, 4vw, 52px); }                 /* плеер больше не липнет к карточке */
.player-notice { margin: 0 0 var(--gap-4); }
.player { margin-bottom: var(--gap-4); }
.own-info { margin: 0 0 var(--gap-6); }                          /* сведения о файле под плеером */
.vote { margin: var(--gap-5) 0 var(--gap-3); }                   /* оценка */
.report { margin: var(--gap-3) 0 var(--gap-6); }                 /* жалобы: отдельно от следующего блока */
.tracks { margin: 0 0 clamp(32px, 4vw, 48px); }                  /* озвучки */
.section { margin-bottom: clamp(40px, 5vw, 64px); }
.section > h2 { margin-bottom: var(--gap-4); }                   /* «О фильме»: заголовок отделён от текста */
.section .prose p:last-child { margin-bottom: 0; }

/* «смотреть онлайн» в заголовке фильма: ключевая фраза для поиска; визуально — тихая подпись справа от года, по центру строки. */
.hero-kw {
  display: inline-flex;
  align-items: center;
  gap: 0.9em;
  vertical-align: middle;
  margin: 0 0 0 0.9em;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--ink-3);
  font-family: var(--font-sans);
  font-size: 0.15em;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.22em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: default;
}
.hero-kw::before {                         /* короткая линия слева: подпись, а не кнопка */
  content: '';
  width: 2.6em;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

/* Рейтинги на карточке в списке: под названием и годом, в одну строку. */
.card-ratings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 0 0 0 4px;
}
.card-ratings .card-rating {
  position: static;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  font-size: var(--text-sm);
}
.card-rating::before { content: '★'; font-size: 0.95em; line-height: 1; }
.card-rating-imdb { color: #e2b94c; }
.card-rating-kp   { color: #86b383; }

/* Логотип: рукописный шрифт, как на старом сайте. Файл лежит в assets/fonts/logo.woff2 (или в папке сайта);
   пока его нет, браузер берёт любой рукописный шрифт системы. */
@font-face {
  font-family: "Logo Script";
  src: url("/assets/fonts/logo.woff2") format("woff2");
  font-display: optional;
}
.logo-text {
  font-family: "Logo Script", "Segoe Script", "Brush Script MT", cursive;
  font-weight: 400;
  font-style: normal;
  font-size: 1.95rem;
  letter-spacing: 0;
  line-height: 1;
  background: none;
  -webkit-text-fill-color: currentColor;
  color: #cdac63;
}

.logo-wordmark { display: block; background: none; border-radius: 0; height: 46px; width: auto; margin-left: 2px; }

.logo { align-items: center; gap: 14px; }
.logo-mascot { height: 62px; width: auto; display: block; }
.nav a[aria-current] { font-weight: inherit; }
@media (max-width: 640px) {
  .header { height: 68px; }
  .logo-mascot { height: 44px; }
  .logo-wordmark { height: 34px; }
}

/* Главная: заголовок — одной белой строкой, без золотого курсива. */
.page-home .home-lead h1 { color: var(--ink); }

/* ---------- просмотр картинки: на весь экран, стрелки по бокам, крестик справа сверху ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  min-width: 0;
  height: 100vh;
  max-height: none;
  background: transparent;
  overflow: hidden;
}
.lightbox[open] { display: block; }
.lightbox-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 88px;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  box-shadow: 0 30px 80px -20px #000;
  margin: 0;
}
.lightbox-arrow {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 1px solid rgb(255 244 224 / 0.18);
  border-radius: 50%;
  background: rgb(45 36 30 / 0.78);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.lightbox-arrow:hover:not([disabled]) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.lightbox-arrow[disabled] { opacity: 0.25; cursor: default; }
.lightbox-prev  { left: 18px;  top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 18px; top: 50%; transform: translateY(-50%); }
.lightbox-close { right: 18px; top: 18px; width: 46px; height: 46px; }
.lightbox-counter {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  padding: 3px 12px;
  border-radius: 999px;
  background: rgb(45 36 30 / 0.78);
  color: var(--ink-2);
  font-size: var(--text-sm);
}
@media (max-width: 640px) {
  .lightbox-stage { padding: 64px 8px 56px; }
  .lightbox-arrow { width: 44px; height: 44px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-close { right: 8px; top: 8px; }
}

/* Маскот: при наведении вместо наклона подменяется картинка (выпученные глаза и дурацкая улыбка). */
.logo-face { position: relative; display: block; flex: none; }
.logo-face .logo-mascot-hover { position: absolute; inset: 0; opacity: 0; transition: none; }
.logo:hover .logo-mascot:not(.logo-mascot-hover), .logo:focus-visible .logo-mascot:not(.logo-mascot-hover) { transform: none; opacity: 0; }
.logo:hover .logo-mascot.logo-mascot-hover, .logo:focus-visible .logo-mascot.logo-mascot-hover { opacity: 1; transform: none; }

/* Год и рейтинги — в одну строку: рейтинги справа от года. */
.card-sub { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }

/* Звёзды рейтингов: у IMDb и Кинопоиска свой цвет. */
.stars-fill-imdb { color: #e2b94c; }
.stars-fill-kp   { color: #86b383; }

/* Всплывающая подсказка: показывается сразу, не ждёт, как нативный title. */
[data-tip] { position: relative; cursor: help; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 30;
  left: 0;
  bottom: calc(100% + 8px);
  width: max-content;
  max-width: 260px;
  padding: 6px 10px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface-3);
  box-shadow: 0 10px 24px -8px #000;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.12s, transform 0.12s;
}
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: none; }
.card-ratings .card-rating { cursor: help; }

/* Карточка в списке: год и рейтинги на своих подложках. */
.card-sub { gap: 6px; margin-top: -2px; }   /* название и год ближе друг к другу */
.card-sub > span:first-child {
  padding: 2px 9px;
  border-radius: 5px;
  background: rgb(255 244 224 / 0.1);
  color: var(--ink-2);
  font-size: var(--text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.card-ratings { gap: 6px 12px; margin: 0 0 0 4px; }
.card-ratings .card-rating { padding: 0; background: none; box-shadow: none; }

/* Рейтинг: одна крупная звезда и число. */
.rating-star { font-size: 2.1rem; line-height: 1; transform: translateY(-1px); }
.rating-star-imdb { color: #e2b94c; }
.rating-star-kp   { color: #86b383; }
.rating-star-user { color: var(--vote, #8aa8cf); }
.rating-star-plain { color: var(--brass); }
.stars-line { gap: 10px; align-items: baseline; }           /* число, подпись и голоса стоят на одной линии */
.stars-line .rating-star { transform: none; }
.stars-line .stars-label, .stars-line .stars-votes { line-height: 1; }
.stars-value { font-size: 1.5rem; font-weight: 700; }

/* ---------- телефон ---------- */
@media (max-width: 720px) {
  /* Шапка в две строки: сверху логотип и значки меню, ниже поиск на всю ширину. Логотип больше не обрезается. */
  .header { position: relative; height: auto; padding-block: 10px; box-shadow: 0 8px 18px -10px rgb(0 0 0 / 0.7); }
  .header-inner { flex-wrap: wrap; gap: 10px 8px; }
  .logo { max-width: none; overflow: visible; order: 1; gap: 8px; }
  .logo-mascot { height: 46px; }
  .logo-wordmark { height: 34px; }
  .nav { order: 2; margin-left: auto; gap: 2px; }
  .nav a { min-width: 40px; min-height: 40px; display: grid; place-items: center; padding: 0; }
  /* Все три значка — одинаковые маски одного размера: ровно на одной высоте. */
  .nav a::before {
    content: '';
    display: block;
    width: 1.4rem;
    height: 1.4rem;
    background: var(--ink-2);
    -webkit-mask: center / contain no-repeat;
    mask: center / contain no-repeat;
  }
  .nav a[aria-current]::before { background: var(--ink); }
  .nav a[href="/"]::before { content: ""; -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6 2.4 11.2h2.9V21h5.2v-6h3v6h5.2v-9.8h2.9z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6 2.4 11.2h2.9V21h5.2v-6h3v6h5.2v-9.8h2.9z'/%3E%3C/svg%3E"); }
  .nav a[href="/film"]::before { content: ""; -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 3h8v8H3zM13 3h8v8h-8zM3 13h8v8H3zM13 13h8v8h-8z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 3h8v8H3zM13 3h8v8h-8zM3 13h8v8H3zM13 13h8v8h-8z'/%3E%3C/svg%3E"); }
  .nav a[href="/comments"]::before { content: ""; -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 3h14a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3h-7.2L6 21.5V17H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 3h14a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3h-7.2L6 21.5V17H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3z'/%3E%3C/svg%3E"); }
  .nav a[href="/actor"]::before { content: ""; -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='7.5' r='4.2'/%3E%3Cpath d='M3.5 21c0-4.7 3.8-8 8.5-8s8.5 3.3 8.5 8z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='7.5' r='4.2'/%3E%3Cpath d='M3.5 21c0-4.7 3.8-8 8.5-8s8.5 3.3 8.5 8z'/%3E%3C/svg%3E"); }
  .nav a::after { left: 8px; right: 8px; bottom: 3px; }
  .nav-count { display: none; }
  .search { order: 3; flex: 1 1 100%; width: 100%; max-width: none; }

  /* Постер на странице фильма: небольшой, а не на полэкрана. */
  .hero .hero-poster { max-width: min(40vw, 158px); margin-inline: 0; }
}

/* «Спасибо, оценка учтена»: мигает пару раз, чтобы посетитель заметил, что оценка принята. */
@keyframes note-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}
.vote-note.is-blink, .report-note.is-blink { animation: note-blink 1.3s ease-in-out 2; }
/* Мигание не отключаем при «уменьшить движение»: это обратная связь на действие, а не украшение; частота меньше 1 Гц, безопасно. */
@media (prefers-reduced-motion: reduce) {
  /* base.css обнуляет длительность всех анимаций; для этой подтверждающей надписи возвращаем её. */
  .vote-note.is-blink, .report-note.is-blink { animation-duration: 1.3s !important; animation-iteration-count: 2 !important; }
}

/* Подпись над заголовком главной: прежний шрифт (заглавные, широкий разряд), но ярче и с тенью, чтобы читалась поверх кадра. */
.page-home .home-kicker {
  color: #e3cb8a;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.9), 0 2px 14px rgb(0 0 0 / 0.85), 0 0 28px rgb(0 0 0 / 0.6);
}

/* Страница фильма: постер выровнен по верху карточки (верх постера на одной линии с подписью «Фильм»), а не по центру. */
.hero { align-items: start; }
.hero .hero-poster { align-self: start; }

/* Имя героя на карточке (страница актёра): отдельная строка под годом. */
.card-role {
  margin-top: -2px;
  color: var(--ink-3);
  font-size: var(--text-sm);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Число фильмов на главной: сплошной цвет, без градиента. */
.home-count .sheen {
  animation: none;
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: currentColor;
  color: var(--ink);
  font-weight: 700;
}

/* Возрастной знак рядом с рейтингами на странице фильма. */
.age-badge {
  display: inline-flex;
  align-items: center;
  align-self: center;
  padding: 3px 9px;
  border: 1px solid rgb(255 244 224 / 0.35);
  border-radius: 6px;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}


/* Фильтры каталога: между разделами больше воздуха, заголовки белые. */
.catalog-filter { padding: var(--gap-4) var(--gap-5); }
.catalog-filter-group { margin: 0 0 clamp(20px, 2.2vw, 28px); }
.catalog-filter-group:last-of-type { margin-bottom: var(--gap-4); }
.catalog-filter-group legend {
  margin-bottom: var(--gap-2);
  color: var(--ink);
  font-size: var(--text-md);
  font-weight: 700;
}
.catalog-filter-actions { margin-top: var(--gap-4); }

/* Имя героя в «В ролях»: целиком, без обрыва, переносится на несколько строк. */
.cast-card .cast-role { display: block; overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }

/* «Сегодня на фоне»: название фильма целиком, без обрезки многоточием; длинное переносится на вторую строку. */
.home-backdrop-info { max-width: min(100%, 640px); border-radius: 28px; }
.home-backdrop-show strong { overflow: visible; text-overflow: clip; white-space: normal; line-height: 1.25; }

/* Раздел «Страны»: быстрый переход и полки по странам. */
.country-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 clamp(36px, 5vw, 56px); }
.country-shelf { margin-bottom: clamp(48px, 6vw, 80px); }
.country-shelf-head {
  display: flex;
  align-items: baseline;
  gap: 8px 20px;
  flex-wrap: wrap;
  margin-bottom: var(--gap-5);
  padding-bottom: var(--gap-3);
  border-bottom: 1px solid var(--rule);
}
.country-shelf-head h2 { margin: 0; font-family: var(--font-display); font-size: clamp(2rem, 3.4vw, 3rem); font-weight: 600; line-height: 1.05; }
.country-shelf-head h2 a { color: var(--ink); text-decoration: none; }
.country-shelf-head h2 a:hover { color: var(--accent); }
.country-shelf-head p { margin: 0; }

/* Шесть мест в ряд; на узком экране 3 или 2 колонки, чтобы ряд не рвался «пять и одна». */
.country-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px var(--gap-4, 16px); }
@media (max-width: 1100px) { .country-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .country-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Шестая карточка: ссылка на все фильмы страны, по размеру как постер. */
.country-more {
  align-self: start;
  aspect-ratio: 2 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgb(205 172 99 / 0.14), transparent 65%),
    linear-gradient(170deg, var(--surface-2), var(--surface));
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.country-more:hover, .country-more:focus-visible { border-color: rgb(255 244 224 / 0.3); }
.country-more-count { font-family: var(--font-display); font-size: clamp(2.6rem, 4vw, 3.6rem); font-weight: 600; line-height: 1; }
.country-more-label { color: var(--ink-2); font-size: var(--text-sm); }
.country-more-go { margin-top: 12px; color: var(--accent); font-size: var(--text-sm); font-weight: 700; }
.country-more:hover .country-more-go { text-decoration: underline; }

/* Переходы по якорям (#gallery, #country-usa и т. п.): плавная прокрутка вместо рывка; шапка не закрывает заголовок.
   Плавность считает скрипт anchors.js: браузер сам отключает CSS-прокрутку, если в системе выключены анимации. */
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
@media (max-width: 720px) { html { scroll-padding-top: 16px; } }

/* Просмотр картинок: ничего не выделяется при быстрых кликах по стрелкам и двойных кликах. */
.lightbox, .lightbox * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.lightbox img { -webkit-user-drag: none; user-drag: none; }
.lightbox-arrow { touch-action: manipulation; }
.lightbox-arrow:focus { outline: none; }
.lightbox-arrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Просмотр картинок: кнопки лежат на самой картинке (стрелки по бокам, крестик справа сверху), а не по краям экрана. */
.lightbox-stage { padding: 28px; }
.lightbox-frame { position: relative; display: inline-block; max-width: 100%; max-height: 100%; line-height: 0; }
.lightbox-frame img { display: block; max-width: calc(100vw - 56px); max-height: calc(100vh - 56px); }
.lightbox-frame .lightbox-prev  { left: 14px;  top: 50%; transform: translateY(-50%); }
.lightbox-frame .lightbox-next  { right: 14px; top: 50%; transform: translateY(-50%); }
.lightbox-frame .lightbox-close { right: 14px; top: 14px; }
.lightbox-frame .lightbox-counter { bottom: 14px; }
.lightbox-frame .lightbox-arrow { background: rgb(20 20 22 / 0.62); border-color: rgb(255 244 224 / 0.22); }
@media (max-width: 640px) {
  .lightbox-stage { padding: 8px; }
  .lightbox-frame img { max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .lightbox-frame .lightbox-prev { left: 8px; }
  .lightbox-frame .lightbox-next { right: 8px; }
  .lightbox-frame .lightbox-close { right: 8px; top: 8px; }
}

.lightbox-frame img { cursor: pointer; }

/* Счётчик «2 из 10» поверх картинки: светлый текст на тёмной плашке, виден на любом кадре. */
.lightbox-frame .lightbox-counter {
  padding: 5px 14px;
  background: rgb(10 10 12 / 0.86);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  text-shadow: none;
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.5);
}

/* Короткое пояснение темы под названием полки. */
.country-shelf-desc { max-width: 760px; margin: calc(-1 * var(--gap-3) + 2px) 0 var(--gap-5); color: var(--ink-2); font-size: var(--text-md); line-height: 1.5; }

/* Метка HD рядом с «смотреть онлайн»: на одной линии по центру строки, залитая, тёмные буквы на жёлтом. */
.hero-hd {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin: 0 0 0 0.35em;
  padding: 0.3em 0.65em 0.34em;
  border: 0;
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-sans);
  font-size: 0.15em;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1;
  cursor: help;
}

/* «61 фильм» — серым текстом справа от заголовка, по его верхнему краю (а не в правом углу строки). */
.section-head:has(> .count-badge) { justify-content: flex-start; align-items: flex-start; gap: 6px 18px; flex-wrap: wrap; }
.count-badge {
  align-self: flex-start;
  margin-top: 0.85rem;
  color: var(--ink-3);
  font-size: var(--text-md);
  line-height: 1.2;
  white-space: nowrap;
}

/* Возрастная плашка после оригинального названия: ссылка на все фильмы этого возраста. */
.hero-orig .chip-age { margin-left: 12px; vertical-align: 1px; color: var(--ink); border-color: rgb(255 244 224 / 0.3); }
a.chip-age:hover { color: var(--accent); border-color: var(--accent); }

/* Основной постер открывается крупно в том же окне, что и кадры. */
.hero-poster .poster-zoom { display: block; aspect-ratio: auto; height: auto; border: 0; border-radius: 0; background: none; cursor: zoom-in; }

/* Плитка «Все кадры» / «Все афиши» последней в сетке: как «Все фильмы» в разделах с тегами. */
.gallery-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  aspect-ratio: 16 / 9;
  min-height: 0;
  overflow: hidden;
  padding: 6px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background:
    radial-gradient(120% 80% at 50% 0%, rgb(205 172 99 / 0.14), transparent 65%),
    linear-gradient(170deg, var(--surface-2), var(--surface));
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.gallery-posters .gallery-more { aspect-ratio: 2 / 3; }
.gallery-more:hover, .gallery-more:focus-visible { border-color: rgb(255 244 224 / 0.3); }
.gallery-more-count { font-family: var(--font-display); font-size: clamp(1.5rem, 2.4vw, 2.2rem); font-weight: 600; line-height: 1; }
.gallery-more-label { margin-top: 1px; color: var(--ink-2); font-size: var(--text-xs); line-height: 1.2; }
.gallery-more-go { margin-top: 6px; color: var(--accent); font-size: var(--text-xs); font-weight: 700; white-space: nowrap; }
.gallery-more:hover .gallery-more-go { text-decoration: underline; }
.back-link { margin-top: var(--gap-5); }

/* Скрытые через hidden стрелки и счётчик в окне увеличения не должны перебиваться display из стилей. */
.lightbox [hidden] { display: none !important; }

/* Кадры и афиши на странице фильма занимают всю ширину: 6 плиток (5 кадров + «Все кадры») и 8 (7 афиш + «Все афиши») в ряд. */
@media (min-width: 900px) {
  .gallery.gallery-fill { grid-template-columns: repeat(var(--gallery-cols, 6), minmax(0, 1fr)); }
}

/* Кнопка «Фильтры» — вкладка, продолжающая блок фильтров: тот же фон, общая рамка, плавное сворачивание. */
.catalog-controls.has-filter { margin-bottom: 0; align-items: flex-end; }
.catalog-controls.has-filter > :not(.catalog-filter-toggle) { margin-bottom: var(--gap-3); }
.catalog-filter, .catalog-filter-toggle { background: color-mix(in srgb, var(--surface) 76%, var(--ground)); }
.catalog-filter { margin: 0; border-top-right-radius: 0; }
.catalog-filter-toggle {
  position: relative;
  z-index: 1;
  margin: 0 0 -1px auto;
  padding: 9px 18px 8px;
  border: 1px solid var(--rule);
  border-bottom-color: transparent;
  border-radius: var(--radius) var(--radius) 0 0;
  color: var(--ink-2);
  font: inherit;
  cursor: pointer;
  transition: color .2s, border-color .2s, border-radius .35s, border-bottom-color .35s;
}
.catalog-filter-toggle::after { content: " ▴"; font-size: .8em; }
.catalog-filter-toggle.is-closed { border-bottom-color: var(--rule); border-radius: var(--radius); margin-bottom: 0; }
.catalog-filter-toggle.is-closed::after { content: " ▾"; }
.catalog-filter-toggle:hover { color: var(--accent); }

/* Сворачивание плавное: высота блока анимируется от своей до нуля. */
.catalog-filter-wrap {
  display: grid;
  grid-template-rows: 1fr;
  margin-bottom: var(--gap-6);
  transition: grid-template-rows .4s ease, margin-bottom .4s ease;
}
.catalog-filter-clip { min-height: 0; overflow: hidden; }
.catalog-filter-wrap.is-closed { grid-template-rows: 0fr; margin-bottom: var(--gap-4); }
.catalog-filter-wrap.is-closed .catalog-filter-clip { visibility: hidden; transition: visibility 0s .4s; }
/* В системе включено «уменьшить движение»: base.css обнуляет переходы, а здесь плавность — часть смысла кнопки. */
@media (prefers-reduced-motion: reduce) {
  .catalog-filter-wrap { transition-duration: .4s !important; }
  .catalog-filter-toggle { transition-duration: .35s !important; }
}

/* Слоган: русский по умолчанию, по наведению (или нажатию) плавно сменяется английским оригиналом и обратно. */
.hero-tagline.is-switchable { display: grid; cursor: pointer; }
.hero-tagline.is-switchable > span { grid-area: 1 / 1; transition: opacity .5s ease; }
.hero-tagline.is-switchable .tag-b { opacity: 0; pointer-events: none; }
.hero-tagline.is-switchable.is-alt .tag-a { opacity: 0; }
.hero-tagline.is-switchable.is-alt .tag-b { opacity: 1; }
@media (hover: hover) {
  /* Смена начинается через 0,3 с наведения: случайный пролёт курсора слоган не меняет (уход курсора возвращает сразу). */
  .hero-tagline.is-switchable:hover .tag-a { opacity: 0; transition-delay: .3s; }
  .hero-tagline.is-switchable:hover .tag-b { opacity: 1; transition-delay: .3s; }
}
.hero-tagline.is-switchable:focus-visible { outline: 1px dashed var(--ink-3); outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) {
  .hero-tagline.is-switchable > span { transition-duration: .5s !important; }
}

/* Страница человека: роль и число фильмов в одной строке. */
.person-meta { align-items: center; gap: var(--gap-3); }
.person-count { color: var(--ink); font-size: var(--text-md); }

/* Логотип: смена лица начинается через 0,1 с наведения, случайный пролёт курсора анимацию не запускает (возврат мгновенный). */
@media (hover: hover) {
  .logo:hover .logo-mascot, .logo:hover .logo-mascot.logo-mascot-hover,
  .logo:focus-visible .logo-mascot, .logo:focus-visible .logo-mascot.logo-mascot-hover { transition: opacity 0s linear .1s; }
}
span.logo { cursor: default; }

/* Страница «Все афиши / Все кадры»: между заголовком и сеткой отступ побольше. */
.movie-images-head { margin-bottom: var(--gap-7); }

/* Переключатель «Кадры / Афиши» над сеткой; отступ под заголовком теперь у него. */
.movie-images-head { margin-bottom: var(--gap-6); }
.images-switch { margin-top: 0; margin-bottom: var(--gap-6); }
.images-switch .chip b { margin-left: 4px; color: var(--ink-3); font-weight: 600; }
.images-switch .chip[aria-current="page"] b { color: inherit; opacity: .7; }
.images-switch-bottom { margin-top: var(--gap-6); }
.images-switch-bottom .images-switch { margin-bottom: 0; }

/* Группа фильтра: 15 плашек сразу, дальше особая плашка «ещё N» плавно разворачивает остальные. */
.catalog-filter-more {
  font: inherit;
  cursor: pointer;
  padding: 3px 14px;
  border: 1px dashed var(--accent);
  border-radius: 100px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: var(--text-sm);
  transition: background .2s, color .2s;
}
.catalog-filter-more:hover { background: var(--accent); color: var(--accent-ink); }
.catalog-filter-more i { font-style: normal; font-size: .8em; }
.catalog-filter-extra { display: grid; grid-template-rows: 0fr; margin-top: 0; transition: grid-template-rows .4s ease, margin-top .4s ease; }
.catalog-filter-extra.is-open { grid-template-rows: 1fr; margin-top: var(--gap-2); }
.catalog-filter-extra-inner { min-height: 0; overflow: hidden; }
.catalog-filter-extra:not(.is-open) .catalog-filter-extra-inner { visibility: hidden; transition: visibility 0s .4s; }
@media (prefers-reduced-motion: reduce) {
  .catalog-filter-extra { transition-duration: .4s !important; }
}

/* Список «Актёры / Режиссёры»: плотнее и крупнее, чем ряд актёров на странице фильма. */
.people-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--gap-5) var(--gap-4); margin-top: var(--gap-5); }
.catalog-controls > .chip-row + .catalog-controls-label { margin-left: var(--gap-4); }

/* Текущее значение в списке «Годы / Жанры…» на странице листинга: выделено и не кликается. */
.chip.chip-current { cursor: default; }
/* Число на подсвеченной плашке не должно сливаться с золотым фоном: берёт цвет текста плашки. */
.chip[aria-current] b, .chip.is-current b, .chip.chip-current b { color: inherit; opacity: .7; }

/* Сведения о человеке: плитки с крупными значениями вместо скучной таблицы. */
.person-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--gap-3); margin: var(--gap-5) 0 var(--gap-4); }
.person-tile {
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
  padding: 14px 16px 15px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent-dim);
  border-radius: 6px;
  background: linear-gradient(135deg, rgb(255 244 224 / 0.06), transparent 70%), var(--surface);
}
.person-tile.tile-wide { grid-column: span 2; }
.person-tile-label { color: var(--ink-3); font-size: var(--text-xs); letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.person-tile-value { font-family: var(--font-display); font-size: clamp(1.15rem, 1rem + .6vw, 1.55rem); font-weight: 500; line-height: 1.2; color: var(--ink); }
.person-tile-sub { color: var(--ink-2); font-size: var(--text-sm); }
.person-tile.tile-zodiac .person-tile-value { color: var(--accent); }
.person-aka { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 var(--gap-4); color: var(--ink-3); font-size: var(--text-sm); }
.person-aka em { font-style: normal; padding: 3px 10px; border: 1px dashed var(--rule); border-radius: 100px; color: var(--ink-2); }
@media (max-width: 520px) { .person-tile.tile-wide { grid-column: auto; } }

/* Плитки без переносов внутри значений: ширина колонок подбирается под самые длинные даты. */
.person-tiles { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.person-tile-value, .person-tile-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-tile.tile-wide { grid-column: span 2; }
@media (max-width: 640px) { .person-tile.tile-wide { grid-column: auto; } }
/* Две колонки плиток: «Годы жизни | Умер», «Знак | Рост», дальше широкие плитки на всю строку. */
.person-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.person-tile.tile-wide { grid-column: 1 / -1; }
@media (max-width: 480px) { .person-tiles { grid-template-columns: 1fr; } }

/* Сведения о человеке: простой список под фото, а не плитки справа. */
.person-side { display: flex; flex-direction: column; gap: var(--gap-5); min-width: 0; }
.person-list { margin: 0; padding: 0; max-width: 260px; }
.person-list > div { padding: 9px 0; border-top: 1px solid var(--rule-soft); }
.person-list > div:first-child { border-top: 0; padding-top: 0; }
.person-list dt { margin: 0 0 2px; color: var(--ink-3); font-size: var(--text-xs); letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.person-list dd { margin: 0; color: var(--ink); font-size: var(--text-md); line-height: 1.35; }
.person-list dd small { display: block; margin-top: 2px; color: var(--ink-2); font-size: var(--text-sm); }

/* Телефон: сведения стоят справа от фото, а не под ним (колонка героя там одна, под фото уходило бы много места). */
@media (max-width: 759px) {                                   /* ровно там, где колонка героя одна (с 760 px фото и сведения снова в левой колонке) */
  .person-side { flex-direction: row; align-items: flex-start; gap: var(--gap-4); }
  .person-side .person-photo { flex: 0 0 32%; max-width: 118px; }
  .person-list { flex: 1; min-width: 0; max-width: none; }
  .person-list > div { padding: 7px 0; }
  .person-list dt { font-size: .68rem; }
  .person-list dd { font-size: var(--text-sm); }
  .person-list dd small { font-size: var(--text-xs); }
}

/* На телефоне у всех плашек минимальная высота 44 px (удобно попадать пальцем), но у плашек-подписей без ссылки (роль человека и т. п.) она не нужна. */
span.chip, b.chip { min-height: 0; }

/* Факты и ляпы (оформление как на сайтах сериалов): заголовок с иконкой и пометкой о спойлерах, пронумерованный список, плашка «ниже спойлеры»,
   кнопка «Ещё N …» и быстрые ссылки под шапкой фильма. Иконки — маски из встроенных SVG, цвет задаёт --facts-ico. */
:root {
  --ico-trivia: url("/assets/img/facts/trivia.webp");
  --ico-goofs: url("/assets/img/facts/goofs.webp");
}
.facts-trivia, .quicklinks a.trivia { --facts-ico: var(--ico-trivia); }
.facts-goofs, .quicklinks a.goofs { --facts-ico: var(--ico-goofs); }

.facts-block { counter-reset: fcount; max-width: calc(var(--wrap-text) + 40px); margin-bottom: 36px; padding-bottom: 22px; border-bottom: 2px solid var(--rule); }     /* читаемая ширина строки */
.facts-h2 { display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; }
.facts-block { --facts-indent: 46px; }                         /* иконка 22 px + зазор 10 px: левый край текста пунктов совпадает с левым краем текста заголовка */
.facts-list { list-style: none; margin: 20px 0 0; padding: 0; }
.facts-list li { position: relative; max-width: var(--wrap-text); margin-bottom: 20px; padding-left: var(--facts-indent); font-size: var(--text-md); line-height: 1.7; color: var(--ink-2); counter-increment: fcount; }
.facts-list li::before { content: counter(fcount); position: absolute; left: 0; top: 0; width: 32px; text-align: left; white-space: nowrap; font-weight: 400; font-size: .85em; line-height: 2; color: var(--ink-3); opacity: .8; transition: color .3s; }
.facts-list li:hover::before { color: var(--ink-2); }
.facts-list li.spoilers { counter-increment: none; max-width: none; padding: 0; margin: 30px 0 22px; text-align: left; font-weight: 800; font-size: var(--text-sm); letter-spacing: .1em;
  text-transform: uppercase; color: #ee6a50; line-height: 1.3; }
.facts-list li.spoilers::before { content: none; }
.facts-list strong { color: var(--ink); font-weight: 700; }
.facts-list a { color: var(--accent); text-decoration: underline; text-decoration-color: rgb(230 198 60 / .4); text-underline-offset: 3px; }
.facts-list a:hover { text-decoration-color: var(--accent); }
.facts-extra { margin-top: 26px; padding-top: 26px; border-top: 2px dotted #4a433d; }                  /* линия остаётся и после раскрытия */
.facts-extra > .facts-list:first-child { margin-top: 0; }
.facts-hidden { display: none; }
.facts-more-btn { display: inline-flex; align-items: center; justify-content: center; margin-bottom: 20px; padding: 10px 22px; cursor: pointer; border: 1px solid var(--rule); border-radius: 999px;
  background: var(--bg-card, rgba(255, 255, 255, .05)); color: var(--ink); font: inherit; font-weight: 600; transition: border-color .2s, background .2s; }
.facts-more-btn::after { content: ""; width: 6px; height: 6px; margin: -3px 0 0 10px; border-bottom: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); }
.facts-more-btn:hover { border-color: var(--accent); background: rgba(255, 255, 255, .07); }

.quicklinks { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 10px; margin: 26px 0; }
.quicklinks a { display: inline-flex; align-items: center; padding: 8px 18px; border: 1px solid var(--rule); border-radius: 999px; background: var(--bg-card, rgba(255, 255, 255, .05));
  color: var(--ink); font-weight: 700; font-size: 15px; text-decoration: none; transition: border-color .2s, transform .2s; }
.quicklinks a::before { content: ""; width: 1.6em; height: 1.6em; margin: -3px 9px -3px -4px; background: var(--facts-ico) center / contain no-repeat; }
.quicklinks a:hover { border-color: var(--accent); transform: translateY(-2px); }

/* Под плеером: слева быстрые ссылки на факты и ляпы, справа плашка с оценкой и жалобы. */
.under-player { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px 24px; margin: 20px 0 8px; }
.under-player .quicklinks { margin: 0; }
.under-side { margin-left: auto; text-align: right; }
.under-side .vote { display: inline-block; margin: 0; padding: 10px 16px 8px; border: 1px solid var(--rule); border-radius: 12px; background: var(--bg-card, rgba(255, 255, 255, .05)); text-align: left; }
.under-side .vote-scale { margin-top: 2px; }
.under-side .report { margin: 8px 4px 0; }
.under-side .report form { justify-content: flex-end; }
.under-side .vote-note { margin-top: 4px; }
/* Когда плашке не хватает места в одном ряду с быстрыми ссылками, она уходит вниз и выравнивается по левому краю. */
.under-player { container-type: inline-size; }
@container (max-width: 960px) {
  .under-side { margin-left: 0; text-align: left; }
  .under-side .report { margin-left: 2px; }
  .under-side .report form { justify-content: flex-start; }
}
.under-player { margin-bottom: 0; }
.under-side .report { margin-bottom: 0; }
.under-player + .own-info { margin-top: 18px; }
.under-player + .own-info { margin-top: 0; }
.under-side .report { line-height: 1.2; }
.under-main { flex: 1 1 360px; min-width: 0; }
.under-main .own-info { margin-top: 24px; }
.under-player { margin-bottom: 28px; }
/* Узкая ширина: порядок «факты и ляпы → оценка → озвучка/время/размер». */
@container (max-width: 960px) {
  .under-main { display: contents; }
  .under-player .quicklinks { order: 1; flex: 0 0 100%; }
  .under-side { order: 2; flex: 0 0 100%; }
  .under-main .own-info { order: 3; flex: 0 0 100%; margin-top: 22px; }
  .under-side .vote { display: inline-block; }
  @container (max-width: 520px) { .under-side .vote { display: block; } }
}

/* Спойлеры раздела одной размытой группой: клик по группе (facts.js) снимает размытие со всех сразу */
.spoiler-group { position: relative; cursor: pointer; border-radius: 4px; }
.spoiler-group .facts-list { pointer-events: none; user-select: none; }
.spoiler-group .facts-list li::after { content: ""; position: absolute; top: -8px; right: -16px; bottom: -8px; left: calc(var(--facts-indent) - 14px); z-index: 1;      /* размывается только текст, номер пункта остаётся чётким; края слоя плавно сходят на нет */
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); transition: opacity .6s ease;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 14px, #000 calc(100% - 16px), transparent), linear-gradient(to bottom, transparent, #000 8px, #000 calc(100% - 8px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 14px, #000 calc(100% - 16px), transparent), linear-gradient(to bottom, transparent, #000 8px, #000 calc(100% - 8px), transparent);
    -webkit-mask-composite: source-in; mask-composite: intersect; }
.spoiler-group.revealed .facts-list li::after { opacity: 0; visibility: hidden; }
.spoiler-group::after { content: "Показать спойлеры"; position: absolute; left: 50%; top: 24px; transform: translateX(-50%); z-index: 1; padding: 10px 20px;
    background: linear-gradient(105deg, rgb(255 226 185 / 0) 40%, rgb(255 226 185 / .6) 50%, rgb(255 226 185 / 0) 60%) -150% 0 / 60% 100% no-repeat,
                linear-gradient(105deg, rgb(30 31 34 / .92) 0 42%, #ff8a1f 58% 100%) 0 0 / 260% 100% no-repeat;
    border: 1px solid #ff8a1f; color: #ff8a1f; font-weight: 800; font-size: var(--text-sm); letter-spacing: .06em;
    text-transform: uppercase; text-align: center; white-space: nowrap; pointer-events: none;
    transition-property: opacity, background-position, color; transition-timing-function: ease-out; transition-delay: 0s, 0s, 0s; }
/* При наведении оранжевая заливка «затекает» в кнопку слева направо, сквозь неё проходит блик; когда курсор уходит, всё идёт в обратную сторону.
   Размер кнопки не меняется. Переходы, а не keyframes: они сами разворачиваются назад. */
.spoiler-group:hover::after, .spoiler-group:focus-visible::after { background-position: 250% 0, 100% 0; color: #1e1f22; transition-delay: 0s, 0s, .3s; }
.spoiler-group::after { transition-duration: .8s !important; }                                          /* base.css при «уменьшить движение» обнуляет все переходы: здесь они нужны всегда */
.spoiler-group .facts-list li::after { transition-duration: .4s !important; }
.spoiler-group.revealed { cursor: auto; }
.spoiler-group.revealed .facts-list { filter: none; opacity: 1; pointer-events: auto; user-select: auto; }
.spoiler-group.revealed::after { opacity: 0; visibility: hidden; }
@media (max-width: 560px) { .spoiler-group::after { white-space: normal; width: 80%; } }

/* Постеры имеют разные пропорции: рамка следует за изображением. */
.hero-poster:has(.poster-zoom) { aspect-ratio: auto; height: auto; }
.hero-poster .poster-zoom img { display: block; width: 100%; height: auto; }

/* Сохранённое состояние фильтров применяется ещё до первого отображения блока. */
html.catalog-filter-start-closed .catalog-filter-wrap {
  grid-template-rows: 0fr;
  margin-bottom: var(--gap-4);
}
html.catalog-filter-start-closed .catalog-filter-clip { visibility: hidden; }
