/* === lf-palette.css === */
/**
 * Light Family — каноническая палитра (примитивы).
 * Источник: /mnt/data/design-tokens/lf-palette.css
 */
:root {
  --lf-neutral-950: #0D1014;
  --lf-neutral-900: #121212;
  --lf-neutral-800: #1a1a1a;
  --lf-neutral-700: #2a2a2a;
  --lf-neutral-600: #3a3a3a;
  --lf-neutral-muted: #e0e0e0;
  --lf-neutral-100: #F5F5F5;
  --lf-neutral-400: #68727C;
  --lf-neutral-500: #a0a0a0;
  --lf-purple-500: #9747FF;
  --lf-purple-700: #7349AB;
  --lf-purple-600: #7a3acc;
  --lf-success: #49ab5a;
  --lf-error: #ab4949;
  --lf-warning: #d4a017;
  --lf-on-accent: #e0e0e0;
}

/* === variables.css === */
/* CSS переменные для темной темы (по умолчанию) */
/* lf-palette.css подключается перед этим файлом в main.css и build.php */

:root {
  color-scheme: dark;
  --lf-content-max-width: 1200px;
  --lf-content-gutter: 1rem;
  --bg: var(--lf-neutral-950);
  --bg-second: var(--lf-neutral-900);
  --bg-third: var(--lf-neutral-800);
  --bg-hover: rgba(151, 71, 255, 0.1);
  --text: var(--lf-neutral-100);
  --text-second: var(--lf-neutral-400);
  --link: var(--lf-purple-500);
  --link-2: var(--lf-purple-700);
  --red: var(--lf-error);
  --green: var(--lf-success);
  --on-accent: var(--lf-on-accent);
  --border-15: 15px;
  --border-24: 24px;
  --border-color: rgba(255, 255, 255, 0.1);
  --transition: 0.2s ease-in-out;
  --background-image: url('/assets/images/Background.webp');
}

/* Светлая тема */
:root.light {
  color-scheme: light;
  --text: var(--lf-neutral-950);
  --bg: #f5f5f5;
  --bg-second: #f0f0f0;
  --bg-third: #e5e5e5;
  --bg-hover: rgba(151, 71, 255, 0.12);
  --border-color: rgba(0, 0, 0, 0.1);
  --background-image: url('/assets/images/panda.svg');
}

/* === base.css === */
/* Базовые стили */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Exo 2', sans-serif;
  scroll-behavior: smooth;
}

body {
  font-family: 'Exo 2', sans-serif;
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.6;
  max-width: 1440px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* Скроллбар */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background-color: var(--link-2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--link);
}

/* Типография */
h1 {
  color: var(--text);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: .5rem;
}

h2 {
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

h3 {
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

h4 {
  color: var(--text);
  font-size: 1rem;
  font-weight: 400;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

p {
  color: var(--text-second);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

a {
  color: var(--text-second);
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition);
}

a:hover,
a:focus {
  color: var(--text);
}

button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}

/* Чекбоксы-переключатели (глобально для публичного сайта) */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.2);
  position: relative;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  vertical-align: middle;
}

input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--transition);
}

input[type="checkbox"]:checked {
  background: var(--link);
  border-color: var(--link);
}

input[type="checkbox"]:checked::after {
  transform: translateX(20px);
}

ul {
  list-style: none;
}

/*
 * Яндекс.Браузер: панель «Поиск по картинке» / OCR цепляется к наведению на <img>.
 * pointer-events: none на картинке передаёт указатель родителю (ссылка, карточка).
 * Админка не трогаем. Тело темы форума: клик по картинке — на обёртке .forum-img-hit (forum-topic-gallery.js).
 */
body:not(.admin-body) main img,
body:not(.admin-body) header img,
body:not(.admin-body) footer img {
  pointer-events: none;
}

.forum-img-hit {
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  vertical-align: top;
}

/* === layout.css === */
/* layout.css: контейнеры, шапка, подвал, хлебные крошки */
/* Контейнер */
.body-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 2rem;
  box-sizing: border-box;
}

/* Контент в main — ограничение ширины как на главной и в каталоге */
main {
  margin-bottom: 2rem;
}

main .container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  box-sizing: border-box;
}

/* Обертка для панели пользователя и header с бэкграундом */
.top-section-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 2em;
  padding-top: env(safe-area-inset-top);
}

.background-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  background-image: var(--background-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-image var(--transition);
  border-radius: 0 0 var(--border-24) var(--border-24);
}

.user-panel-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1em 2em;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

/* Когда панель уведомлений открыта — поднимаем над шапкой */
.user-panel-container:has(.notifications-dropdown-open) {
  z-index: 100;
}

/* Панель пользователя */
.login {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.btn-log {
  display: flex;
  align-items: center;
}

.userbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: var(--bg-second);
  border-radius: var(--border-24);
  box-shadow: 0 4px 8px 0px var(--link-2);
  margin-right: 1rem;
}

/* Только иконки в userbar — круглый фон (не ссылки внутри выпадающей панели уведомлений) */
.userbar > a,
.userbar .notifications-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  transition: all var(--transition);
  border-radius: 50%;
  background: var(--link-2);
  padding: 0.3rem;
}

.userbar > a:hover,
.userbar .notifications-trigger:hover {
  background: var(--link);
  transform: scale(1.1);
}

.userbar .bookmark,
.userbar .notifications-icon,
.userbar .exit,
.userbar .admin-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.userbar .bookmark svg,
.userbar .notifications-icon svg,
.userbar .exit svg,
.userbar .admin-icon svg {
  width: 100%;
  height: 100%;
}

.userbar .exit svg path {
  fill: var(--text);
}

.userbar .bookmark svg path,
.userbar .notifications-icon svg path {
  stroke: var(--text);
  fill: none;
}

.userbar .admin-icon svg path {
  stroke: var(--text);
  fill: none;
}

.userbar .admin-icon svg circle {
  fill: var(--text);
}

.login-button svg path,
.register-button svg path {
  fill: var(--text);
  stroke: var(--text);
}

.login-button svg path[stroke],
.register-button svg path[stroke] {
  fill: none;
}

.userbar .us-ic {
  color: var(--text);
  background-color: var(--link-2);
  line-height: 1rem;
  border-radius: var(--border-15);
  padding: 0.5rem;
  font-size: 1.2rem;
  font-weight: 500;
  white-space: nowrap;
  text-transform: uppercase;
}

/* Обёртка уведомлений: иконка + бейдж + выпадающая панель */
.notifications-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.notifications-wrap .notifications-trigger {
  position: relative;
}

.notifications-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
  color: #fff;
  background: var(--red);
  border-radius: 8px;
  border: 2px solid var(--bg-second);
  box-sizing: border-box;
}

/* Выпадающая панель уведомлений — привязана к правому краю контентной зоны (max-width 1440px как у body) */
.notifications-dropdown {
  position: fixed;
  top: 56px;
  right: max(1rem, calc((100vw - 1440px) / 2 + 1rem));
  z-index: 10000;
  width: min(380px, calc(100vw - 2rem));
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-second);
  border: 1px solid var(--border-color);
  border-radius: var(--border-24);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.04);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

:root.light .notifications-dropdown {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.notifications-dropdown.notifications-dropdown-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.notifications-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  flex-shrink: 0;
  background: transparent;
}

.notifications-dropdown-header a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--link);
  text-decoration: none;
  background: none;
  border-radius: var(--border-15);
  padding: 0.35rem 0.6rem;
  transition: color var(--transition), background var(--transition);
}

.notifications-dropdown-header a:hover {
  color: var(--text);
  background: rgba(151, 71, 255, 0.12);
  text-decoration: none;
}

.notifications-dropdown-list {
  overflow-y: auto;
  padding: 0.5rem 0;
}

.notifications-dropdown-loading,
.notifications-dropdown-empty,
.notifications-dropdown-error {
  padding: 1.75rem 1.25rem;
  text-align: center;
  color: var(--text-second);
  font-size: 0.9rem;
  line-height: 1.5;
}

.notifications-dropdown-error {
  color: var(--red);
}

.notifications-dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  margin: 0 0.5rem;
  border-radius: var(--border-15);
  transition: background-color 0.2s ease;
  box-sizing: border-box;
}

.notifications-dropdown-item:last-child {
  margin-bottom: 0.25rem;
}

.notifications-dropdown-item:hover {
  background: rgba(151, 71, 255, 0.06);
}

:root.light .notifications-dropdown-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.notifications-dropdown-item.is-read {
  opacity: 0.78;
}

.notifications-dropdown-item.is-read:hover {
  opacity: 1;
}

.notifications-dropdown-item-body {
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: color var(--transition);
  outline: none;
  border-radius: var(--border-15);
}

.notifications-dropdown-item-body:focus-visible {
  box-shadow: 0 0 0 2px var(--link);
}

.notifications-dropdown-item:hover .notifications-dropdown-item-title strong {
  color: var(--link);
}

.notifications-dropdown-item-title {
  display: block;
  font-size: 0.9rem;
  line-height: 1.45;
  font-weight: 400;
  color: var(--text);
}

.notifications-dropdown-item-title strong {
  font-weight: 600;
  color: var(--text);
  transition: color var(--transition);
}

.notifications-dropdown-item-date {
  display: block;
  font-size: 0.75rem;
  color: var(--text-second);
  margin-top: 0.25rem;
}

.notifications-dropdown-item-preview {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-second);
  margin-top: 0.35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notifications-dropdown-item-delete {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: var(--border-15);
  background: transparent;
  color: var(--text-second);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
  outline: none;
}

.notifications-dropdown-item-delete:focus-visible {
  box-shadow: 0 0 0 2px var(--red);
}

.notifications-dropdown-item-delete:hover {
  background: rgba(171, 73, 73, 0.12);
  color: var(--red);
}

.notifications-dropdown-item-delete svg {
  width: 17px;
  height: 17px;
}

/* Светлая тема: иконки и текст в userbar на фиолетовом фоне — белые */
:root.light .userbar .exit svg path {
  fill: #fff;
}
:root.light .userbar .bookmark svg path,
:root.light .userbar .notifications-icon svg path {
  stroke: #fff;
}
:root.light .userbar .admin-icon svg path {
  stroke: #fff;
}
:root.light .userbar .admin-icon svg circle {
  fill: #fff;
}
:root.light .userbar .us-ic {
  color: #fff;
}

.avatar-link {
  display: inline-block;
  line-height: 0;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
}

.avatar-link:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.avatar {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  border-radius: 20px;
  overflow: hidden;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--link);
  box-shadow: -5px 2px 20px rgba(151, 71, 255, 0.28), 0 4px 14px rgba(13, 16, 20, 0.18);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar .avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--link);
  color: var(--on-accent, #e0e0e0);
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1;
}

/* Кнопки входа и регистрации */
.login-button-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.login-button,
.register-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-second);
  border-radius: var(--border-15);
  box-shadow: 0 4px 8px 0px var(--link-2);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  border: 2px solid transparent;
}

.login-button:hover,
.register-button:hover {
  background: var(--link);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px 0px rgba(115, 73, 171, 0.3);
}

.login-button svg,
.register-button svg {
  width: 28px;
  height: 28px;
}

.login-button span,
.register-button span {
  color: var(--text);
}


/* Шапка */
header {
  width: 100%;
  position: relative;
  z-index: 1;
}

.header-menu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto 2em;
  padding: 1em 2em;
  border-radius: var(--border-24);
  box-shadow: 0 8px 12px 0px var(--link-2);
  background: var(--bg-second);
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
}

.logo a {
  display: flex;
  align-items: center;
}

.logo img {
  max-width: 60px;
  min-width: 35px;
  width: 4vw;
  height: auto;
  vertical-align: middle;
}

.nav-menu {
  display: flex;
  gap: 2vw;
  flex-wrap: wrap;
}

.nav-menu a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
  padding: 0.5rem 0;
}

.nav-menu a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--link);
  opacity: 0;
  transition: opacity var(--transition);
}

.nav-menu a:hover::after,
.nav-menu a.active::after,
.nav-menu a:focus::after {
  opacity: 1;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--text);
}

.nav-link-text {
  font-size: 0.8rem;
  font-weight: 400;
  text-transform: uppercase;
  line-height: 1rem;
}

/* Поиск */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

/* Кнопка поиска для мобильных - скрыта на десктопе */
.search-trigger-mobile {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  background: transparent;
  border: 2px solid rgba(245, 245, 245, 0.2);
  border-radius: 50%;
  color: var(--text-second);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}

.search-trigger-mobile:hover {
  border-color: var(--link);
  color: var(--link);
}

.search-trigger-mobile svg {
  width: 22px;
  height: 22px;
}

.search-input {
  padding: 0.5rem 2.5rem 0.5rem 1rem;
  border: 2px solid rgba(245, 245, 245, 0.2);
  border-radius: 20px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  width: 250px;
  transition: border-color var(--transition);
  cursor: pointer;
}

.search-input:hover {
  border-color: var(--link);
}

.search-input:focus {
  outline: none;
  border-color: var(--link);
}

.search-icon {
  position: absolute;
  right: 0.75rem;
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.search-icon path {
  transition: stroke var(--transition);
}

.search-wrapper:hover .search-icon path {
  stroke: var(--link);
}

/* Переключатель темы */
.theme-toggle {
  display: flex;
  padding: 4px;
  justify-content: center;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  background-color: var(--link-2);
  transition: all var(--transition);
  border-radius: 50%;
}

.theme-toggle:hover {
  background-color: var(--link);
  transform: scale(1.1);
}

.theme-toggle svg {
  width: 24px;
  height: 24px;
}

.theme-toggle .sun,
.theme-toggle .moon {
  fill: var(--text);
}

.theme-toggle .sun-beams {
  stroke: var(--text);
}

/* В тёмной теме показываем солнце (переключить на светлую), в светлой — луну (на тёмную) */
.theme-toggle .moon {
  display: none;
}
.theme-toggle .sun,
.theme-toggle .sun-beams {
  display: block;
}
:root.light .theme-toggle .sun,
:root.light .theme-toggle .sun-beams {
  display: none;
}
:root.light .theme-toggle .moon {
  display: block;
}

/* Светлая тема: иконки переключателя темы на фиолетовом фоне — белые */
:root.light .theme-toggle .sun,
:root.light .theme-toggle .moon {
  fill: #fff;
}
:root.light .theme-toggle .sun-beams {
  stroke: #fff;
}

/* Бургер меню для мобильных */
.burger-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 0.5rem;
}

.burger-menu span {
  width: 25px;
  height: 3px;
  background-color: var(--text);
  transition: all var(--transition);
}

.burger-menu.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.burger-menu.active span:nth-child(2) {
  opacity: 0;
}

.burger-menu.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}


/* Подвал — в стиле контейнеров с обводкой */
footer {
  margin-top: auto;
  max-width: 1200px;
  width: calc(100% - 2rem);
  margin-left: auto;
  margin-right: auto;
  padding: 2rem 2em;
  padding-bottom: calc(2rem + env(safe-area-inset-bottom));
  background: var(--bg-second);
  border: 1px solid var(--border-color);
  border-radius: var(--border-24);
  box-shadow: 0 8px 12px 0px var(--link-2);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg);
  transition: background var(--transition);
}

.social-link:hover {
  background: var(--link);
}

.social-link svg {
  width: 24px;
  height: 24px;
}

.social-link svg path {
  fill: var(--text-second);
  transition: fill var(--transition);
}

.social-link:hover svg path {
  fill: var(--text);
}

.footer-contact {
  margin-bottom: 1.5rem;
}

.footer-contact p {
  margin-bottom: 0.5rem;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--text-second);
  font-size: 0.9rem;
}

.footer-nav a:hover {
  color: var(--text);
}

.footer-copyright {
  color: var(--text-second);
  font-size: 0.85rem;
}

/* Хлебные крошки */
.breadcrumbs {
  max-width: 1200px;
  margin: 1rem auto;
  padding: 0 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.breadcrumbs a {
  color: var(--text-second);
}

.breadcrumbs a:hover {
  color: var(--link);
}

.breadcrumbs span {
  color: var(--text-second);
}

/* === components.css === */
/* components.css */
/* components.css: карточки, рейтинг, модалки, табы, формы */
/* Блок новинок */
.new-releases {
  display: flex;
  width: auto;
  height: min-content;
  flex-direction: column;
  gap: 24px;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto 2em auto;
  border-radius: 24px;
  padding: 2.2em 2em 1.2em 2em;
  box-shadow: 0 8px 12px 0px var(--link-2);
  background: var(--bg-second);
  overflow: hidden;
}

.new-releases-carousel {
  width: 100%;
}

.new-releases .swiper-container {
  width: 100%;
  padding: 10px 0 1rem;
  overflow: visible;
  margin: 0 -1rem;
  width: calc(100% + 2rem);
}

.new-releases .swiper-container::-webkit-scrollbar {
  display: none;
}

.new-releases .swiper-container {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.new-releases .swiper-wrapper {
  display: flex;
  align-items: stretch;
}

.new-releases .swiper-slide {
  width: auto;
  height: auto;
  display: flex;
}

.new-releases .swiper-slide .release-card {
  width: 100%;
  max-width: 200px;
  min-width: 0;
}

.new-releases-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 0.15rem;
  padding: 0 0.5rem;
}

.new-releases-nav {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgb(115 73 171 / 50%);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.new-releases-nav:hover {
  background: rgb(151 71 255 / 92%);
  transform: scale(1.06);
}

.new-releases-nav.swiper-button-prev,
.new-releases-nav.swiper-button-next {
  position: static;
  width: 40px;
  height: 40px;
  margin: 0;
}

.new-releases-nav::after {
  content: none !important;
  display: none !important;
}

.new-releases-nav.swiper-button-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
  transform: none;
}

.new-releases-steps {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 72px;
  max-width: 360px;
}

.new-releases-step {
  flex: 1 1 0;
  height: 4px;
  border-radius: 999px;
  background: rgb(115 73 171 / 28%);
  transition: background 0.2s ease;
}

.new-releases-step.is-passed {
  background: rgb(151 71 255 / 55%);
}

.new-releases-step.is-active {
  background: rgb(151 71 255 / 95%);
}

@media (min-width: 768px) {
  .new-releases .swiper-slide .release-card {
    width: 200px;
    min-width: 200px;
  }
}

/* «Продолжить просмотр» — только кадр и Play; сетка; время под кадром крупным */
.home-continue-watching {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 1200px;
  margin: 0 auto 2em auto;
  border-radius: 24px;
  padding: 2.2em 2em 1.75em 2em;
  box-shadow: 0 8px 12px 0px var(--link-2);
  background: var(--bg-second);
}

.home-continue-heading {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 0;
}

.home-continue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem 1.25rem;
  align-items: start;
}

.home-continue-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  border-radius: var(--border-15);
  transition: transform 0.18s ease;
}

.home-continue-card:hover {
  transform: translateY(-2px);
}

.home-continue-card:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 4px;
}

.home-continue-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--border-15);
  overflow: hidden;
  background: #0a0a0e;
  border: 1px solid rgba(151, 71, 255, 0.35);
  box-shadow: none;
}

.home-continue-stage .home-continue-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #0a0a0e;
}

.home-continue-frame.is-broken {
  display: none !important;
}

.home-continue-frame-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--link);
  background: linear-gradient(160deg, var(--bg-third), var(--bg));
}

.home-continue-stage.has-broken-frame .home-continue-frame-fallback {
  display: flex;
}

.home-continue-dim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  pointer-events: none;
  z-index: 1;
}

/* Как .lf-circle-btn.lf-play-toggle в playerlfengine.css */
.home-continue-lf-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -52%);
  z-index: 2;
  width: 65px;
  height: 65px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(115, 73, 171, 0.5);
  color: #fff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(3px);
  transform-origin: center center;
  transition: transform 0.2s ease, background 0.2s ease;
  pointer-events: none;
}

.home-continue-lf-play svg {
  width: 78%;
  height: 78%;
  display: block;
}

.home-continue-card:hover .home-continue-lf-play {
  transform: translate(-50%, -52%) scale(1.08);
  background: rgba(151, 71, 255);
}

.home-continue-meta-block {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0 2px;
}

.home-continue-time-line {
  font-size: 0.9rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: normal;
  color: var(--text);
  line-height: 1.35;
}

.home-continue-caption {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-continue-episode-inline {
  color: var(--link);
  font-weight: 600;
}

/* Блок последних новостей форума на главной (после «Новинки») */
.home-forum-news {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto 2em auto;
  border-radius: 24px;
  padding: 1.5em 2em 1.25em 2em;
  box-shadow: 0 8px 12px 0px var(--link-2);
  background: var(--bg-second);
}

.home-forum-news-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0;
}

.home-forum-news-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.home-forum-news-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.home-forum-news-item:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.home-forum-news-link {
  color: var(--link);
  text-decoration: none;
  font-weight: 600;
  line-height: 1.35;
  font-variant-emoji: text;
}

.home-forum-news-link:hover {
  text-decoration: underline;
}

.home-forum-news-meta {
  font-size: 0.85rem;
  color: var(--text-second);
}

.home-forum-news-more {
  margin: 0;
  font-size: 0.95rem;
}

.home-forum-news-more a {
  color: var(--link);
  text-decoration: none;
}

.home-forum-news-more a:hover {
  text-decoration: underline;
}

/* Карточки релизов */
.releases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 200px));
  gap: 1.5rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.catalog-layout-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-right: 0.35rem;
}

.catalog-layout-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: var(--text-second);
  background: var(--bg-second);
  box-shadow: 0 0 0 1px var(--border-color);
  text-decoration: none;
  transition: var(--transition);
}

.catalog-layout-icon:hover {
  color: var(--text);
  box-shadow: 0 0 0 1px var(--link);
}

.catalog-layout-icon.is-active {
  color: var(--link);
  box-shadow: 0 0 0 2px var(--link);
}

.catalog-releases-rows {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.catalog-release-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  background: var(--bg-second);
  border: 1px solid var(--border-color);
  border-radius: var(--border-15);
  padding: 0;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
  text-align: left;
}

.catalog-release-row:hover {
  border-color: var(--link);
  box-shadow: 0 2px 12px rgba(151, 71, 255, 0.12);
}

.catalog-release-row__media {
  align-self: start;
  width: 180px;
  flex-shrink: 0;
  border-radius: var(--border-15) 0 0 var(--border-15);
  overflow: hidden;
  line-height: 0;
  display: block;
  box-shadow: none;
}

.catalog-release-row__poster {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
}

.catalog-release-row__main {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 1rem;
  row-gap: 0.35rem;
  align-items: start;
  padding: 1rem 1.25rem;
}

.catalog-release-row__head-text {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.catalog-release-row__meta {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
}

.catalog-release-row__watch {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: start;
  flex-shrink: 0;
  white-space: nowrap;
}

.catalog-release-row__lower {
  grid-column: 1 / -1;
  grid-row: 2;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.catalog-release-row__main:has(.catalog-release-row__meta) .catalog-release-row__lower {
  grid-row: 3;
}

:root.light .catalog-release-row__lower {
  border-top-color: rgba(13, 16, 20, 0.2);
}

.catalog-release-row__desc-wrap {
  min-width: 0;
}

.catalog-release-row__desc-label {
  margin: 0 0 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
}

.catalog-release-row__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
}

.catalog-release-row__title a {
  color: var(--text);
  text-decoration: none;
}

.catalog-release-row__title a:hover {
  color: var(--link);
}

.catalog-release-row__subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.35;
}

.catalog-release-row__meta-primary,
.catalog-release-row__meta-secondary {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text);
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.catalog-release-row__meta-primary {
  margin-bottom: 0.2rem;
}

.catalog-release-row__desc {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.catalog-release-row__desc-empty {
  font-style: italic;
  color: var(--text);
  opacity: 1;
}

.release-card {
  position: relative;
  background: var(--bg-second);
  border: 1px solid transparent;
  border-radius: var(--border-15);
  overflow: hidden;
  transition: all var(--transition);
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 200px;
  align-items: stretch;
  box-shadow: 0 2px 8px 0px var(--link-2);
  padding: 0;
  text-align: center;
  min-width: 0;
  margin: 0;
}

.release-card:hover {
  transform: translateY(-5px);
  border-color: var(--link);
  background: rgba(151, 71, 255, 0.05);
}

.release-card > a {
  display: block;
  text-decoration: none;
  line-height: 0;
}

.release-card .release-title a {
  display: block;
  text-decoration: none;
  line-height: 1.3;
  color: var(--text);
}

.release-poster {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
  height: auto;
  flex-shrink: 0;
  border-radius: var(--border-15) var(--border-15) 0 0;
}

.release-title {
  padding: 1rem 0.75rem 0.75rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 400;
  text-align: center;
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.release-title h4 {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
  color: inherit;
}

.release-lf-premium-coin {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 0.2em;
  align-items: center;
}

.release-lf-premium-coin-svg {
  width: 0.95em;
  height: 0.95em;
  display: block;
  flex-shrink: 0;
}

.catalog-release-row__title .release-lf-premium-coin {
  margin-left: 0.35em;
}

/* Индикаторы статуса */
.release-status {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.7);
  color: var(--text);
}

.release-status.dubbed {
  background-color: var(--green);
}

.release-status.translated {
  background-color: var(--link-2);
}

.release-status.in-progress {
  background-color: var(--link);
}

/* Рейтинг с пандами */
.release-rating-container,
.catalog-rating-container {
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.release-rating-under-poster {
  padding: 0.75rem;
  margin-top: 0.5rem;
  background: var(--bg-second);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.release-card .release-rating-under-poster {
  margin-left: 0.75rem;
  margin-right: 0.75rem;
  margin-bottom: 0.75rem;
}

.release-rating-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.release-rating-item strong {
  margin-right: 0.5rem;
}

.rating-pandas {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 1.2rem;
  line-height: 1;
}

.panda-icon {
  display: inline-block;
  cursor: default;
  transition: all var(--transition);
  user-select: none;
  filter: grayscale(100%);
  opacity: 0.4;
}

.panda-icon.panda-filled {
  filter: grayscale(0%);
  opacity: 1;
}

.panda-icon.panda-interactive {
  cursor: pointer;
}

.panda-icon.panda-interactive:hover {
  transform: scale(1.2);
  filter: grayscale(0%);
  opacity: 1;
}

.panda-icon.panda-hover {
  filter: grayscale(0%);
  opacity: 1;
}

.panda-icon.panda-user-rating {
  filter: grayscale(0%) drop-shadow(0 0 4px var(--link));
  opacity: 1;
}

.rating-info {
  margin-left: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-second);
  white-space: nowrap;
}

/* Рейтинг: виджет «X из 10» + выпадающий список */
.rating-widget {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 1rem;
  line-height: 1.4;
}

.rating-widget .rating-display {
  font-weight: 600;
  white-space: nowrap;
}

.rating-widget .rating-select {
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-second);
  color: var(--text);
  cursor: pointer;
  min-width: 6rem;
  transition: border-color var(--transition), background-color var(--transition), box-shadow var(--transition);
}

.rating-widget .rating-select:hover,
.rating-widget .rating-select:focus {
  border-color: var(--link);
  background-color: var(--bg-hover);
  outline: none;
  box-shadow: 0 0 0 1px var(--link);
}

.rating-widget .rating-select:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.rating-widget .rating-btn-open {
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-second);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition);
}

.rating-widget .rating-btn-open:hover,
.rating-widget .rating-btn-open:focus {
  border-color: var(--link);
  background-color: var(--bg-hover);
  outline: none;
}

/* Модальное окно оценки релиза */
.rating-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.rating-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  cursor: pointer;
}

.rating-modal-content {
  position: relative;
  width: 100%;
  max-width: min(480px, calc(100vw - 2rem));
  background: var(--bg-second);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  z-index: 1;
  overflow: visible;
  box-sizing: border-box;
}

.rating-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-second);
  padding: 0.5rem;
  transition: var(--transition);
}

.rating-modal-close:hover {
  color: var(--text);
}

.rating-modal-decor {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.rating-modal-decor-img {
  position: absolute;
  width: 150px;
  height: 150px;
  opacity: 0.03;
  pointer-events: none;
}

.rating-modal-decor-top-right {
  top: 0;
  right: 0;
  transform: translate(50%, -50%);
}

.rating-modal-decor-bottom-left {
  bottom: 0;
  left: 0;
  transform: translate(-50%, 50%);
}

.rating-modal-title {
  margin: 0 2rem 1.5rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  position: relative;
  z-index: 1;
}

.rating-modal-scale {
  display: flex;
  justify-content: space-between;
  gap: 0.2rem;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
  min-width: 0;
}

.rating-modal-num {
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 1;
  max-width: 2.25rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition), color var(--transition);
}

.rating-modal-num:hover,
.rating-modal-num:focus {
  border-color: var(--link);
  background-color: var(--bg-hover);
  color: var(--link);
  outline: none;
}

.rating-modal-num.rating-modal-num-selected {
  border-color: var(--link);
  background-color: var(--link);
  color: var(--text);
}

.rating-modal-num:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.rating-modal-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-second);
  position: relative;
  z-index: 1;
  padding: 0 0.15rem;
}

.rating-modal-label-left,
.rating-modal-label-right {
  flex-shrink: 0;
}

/* Рейтинг в каталоге */
.release-card .catalog-rating-container {
  padding: 0.25rem 0.75rem 0.5rem;
  margin-top: -0.25rem;
}

.release-card .rating-pandas {
  font-size: 1rem;
  gap: 0.15rem;
}

.release-card .rating-widget {
  font-size: 0.9rem;
}

.release-card .rating-widget .rating-select {
  display: none;
}

.release-card .rating-info {
  display: none;
}

/* KinoPoisk и IMDb на карточках в «Популярное» — правый верхний угол */
.release-card:has(.catalog-card-ratings) .release-status {
  left: 0.5rem;
  right: auto;
}

.catalog-card-ratings {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
  z-index: 2;
  flex-direction: column;
}

.catalog-rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.6);
}

.catalog-rating-badge .catalog-rating-value {
  font-weight: 700;
}

.catalog-rating-badge.rating-kinopoisk {
  background-color: #ffa500;
  color: var(--text);
  text-shadow: 0 0 4px #a36900;
}

.catalog-rating-badge.rating-kinopoisk .catalog-rating-value {
  color: var(--text);
  text-shadow: 0 0 4px #a36900;
}

.catalog-rating-badge.rating-imdb {
  color: var(--text);
  background-color: #f5c518;
  text-shadow: 0 0 4px #7c640c;
}

.catalog-rating-badge.rating-imdb .catalog-rating-value {
  color: var(--text);
  text-shadow: 0 0 4px #7c640c;
}

/* Уведомления рейтинга — привязаны к правому краю контентной зоны */
.rating-notification {
  position: fixed;
  top: 20px;
  right: max(20px, calc((100vw - 1440px) / 2 + 20px));
  padding: 1rem 1.5rem;
  background: var(--bg-second);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  z-index: 10000;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.rating-notification.show {
  opacity: 1;
  transform: translateX(0);
}

.rating-notification-success {
  border-left: 4px solid var(--green);
}

.rating-notification-error {
  border-left: 4px solid var(--red);
}

/* Универсальная система уведомлений — привязана к правому краю контентной зоны */
.notifications-container {
  position: fixed;
  top: 20px;
  right: max(20px, calc((100vw - 1440px) / 2 + 20px));
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  pointer-events: none;
}

.notification {
  position: relative;
  padding: 1rem 1.5rem;
  background: var(--bg-second);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  pointer-events: auto;
  word-wrap: break-word;
}

.notification.show {
  opacity: 1;
  transform: translateX(0);
}

.notification-success {
  border-left: 4px solid var(--green, #4CAF50);
  background: var(--bg-second);
}

.notification-error {
  border-left: 4px solid var(--red, #f44336);
  background: var(--bg-second);
}

.notification-warning {
  border-left: 4px solid var(--yellow, #ff9800);
  background: var(--bg-second);
}

.notification-info {
  border-left: 4px solid var(--blue, #2196F3);
  background: var(--bg-second);
}

/* Табы */
.tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  margin-top: 1rem;
  padding-top: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.tab-button {
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: var(--text-second);
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 0.9rem;
  text-transform: uppercase;
  transition: all var(--transition);
}

.tab-button:hover,
.tab-button.active {
  color: var(--text);
  border-bottom-color: var(--link);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Модальное окно фильтров каталога — поверх всего экрана, как поиск */
.catalog-filters-modal {
  display: none;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 10000 !important;
  overflow-y: auto;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.catalog-filters-modal:not(.active) {
  display: none !important;
}

.catalog-filters-modal.active {
  display: flex !important;
  pointer-events: auto;
  opacity: 1;
}

.catalog-filters-modal[hidden] {
  display: none !important;
}

.catalog-filters-modal-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000 !important;
}

.catalog-filters-modal-content {
  position: relative;
  z-index: 10001 !important;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  margin: auto;
  background-color: var(--bg-second);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  pointer-events: auto;
}

.catalog-filters-modal-title {
  margin: 0 2.5rem 1rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.catalog-filters-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-second);
  padding: 0.5rem;
  line-height: 1;
  transition: var(--transition);
}

.catalog-filters-modal-close:hover {
  color: var(--text);
}

.catalog-filters-modal .catalog-filters-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: visible;
}

.catalog-filters-modal .filter-group {
  margin-bottom: 0;
}

/* Поля в модалке фильтров — как в админке при редактировании релиза */
.catalog-filters-modal .filter-group label {
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
}

.catalog-filters-modal .filter-group .search-input {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(151, 71, 255, 0.35);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-second);
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.catalog-filters-modal .filter-group .search-input:focus {
  outline: none;
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(151, 71, 255, 0.15);
}

.catalog-filters-modal .filter-group .search-input::placeholder {
  color: var(--text-second);
}

/* Tom Select в модалке — как в админке (жанры релиза): скругления, фиолетовая обводка */
.catalog-filters-modal .ts-wrapper.filter-select {
  background: var(--bg-second) !important;
  border: 1px solid rgba(151, 71, 255, 0.45) !important;
  border-radius: 12px !important;
  color: var(--text) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease !important;
  overflow: visible !important;
}

.catalog-filters-modal .ts-wrapper.filter-select:hover {
  border-color: rgba(151, 71, 255, 0.65) !important;
}

.catalog-filters-modal .ts-wrapper.filter-select .ts-control {
  min-height: 44px;
  padding: 0.35rem 0.65rem !important;
  background: transparent !important;
  border: none !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  outline: none !important;
  color: var(--text) !important;
}

/* Скрываем поле ввода только у multi — у single (год) нужен обычный контрол Tom Select */
.catalog-filters-modal .ts-wrapper.filter-select.multi .ts-control input {
  color: var(--text) !important;
  background: transparent !important;
  display: none !important;
}

.catalog-filters-modal .ts-wrapper.filter-select.multi .ts-control input::placeholder {
  color: var(--text-second) !important;
}

.catalog-filters-modal .ts-wrapper.filter-select.focus {
  border-color: var(--link) !important;
  box-shadow: 0 0 0 3px rgba(151, 71, 255, 0.2) !important;
}

.catalog-filters-modal .ts-wrapper.filter-select.focus .ts-control {
  box-shadow: none !important;
  border: none !important;
}

/* У multi меньше «воздуха» только у контейнера (от границы до чипов), не внутри чипов */
.catalog-filters-modal .ts-wrapper.filter-select.multi .ts-control {
  min-height: 44px !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 0.2rem !important;
  padding: 0.2rem 0.4rem !important;
}

/* Выпадающий список — как в админке */
.catalog-filters-modal .ts-wrapper.filter-select .ts-dropdown {
  background: var(--bg-third) !important;
  border: 1px solid rgba(151, 71, 255, 0.3) !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(151, 71, 255, 0.12) !important;
  margin-top: 6px !important;
  overflow: hidden !important;
}

.catalog-filters-modal .ts-wrapper.filter-select .ts-dropdown-content {
  background: var(--bg-third) !important;
  padding: 0.25rem 0 !important;
  max-height: 55vh !important;
}

.catalog-filters-modal .ts-wrapper.filter-select .ts-dropdown [data-selectable],
.catalog-filters-modal .ts-wrapper.filter-select .ts-dropdown .option {
  padding: 0.65rem 1rem !important;
  margin: 0.125rem 0.5rem !important;
  border-radius: 8px !important;
  color: var(--text) !important;
  cursor: pointer !important;
  transition: background 0.15s ease, color 0.15s ease !important;
}

.catalog-filters-modal .ts-wrapper.filter-select .ts-dropdown [data-selectable]:hover,
.catalog-filters-modal .ts-wrapper.filter-select .ts-dropdown [data-selectable].active,
.catalog-filters-modal .ts-wrapper.filter-select .ts-dropdown .option:hover,
.catalog-filters-modal .ts-wrapper.filter-select .ts-dropdown .option.active {
  background: rgba(151, 71, 255, 0.22) !important;
  color: var(--text) !important;
}

.catalog-filters-modal .ts-wrapper.filter-select .ts-dropdown [data-selectable].selected,
.catalog-filters-modal .ts-wrapper.filter-select .ts-dropdown .option.selected {
  background: linear-gradient(135deg, rgba(151, 71, 255, 0.35) 0%, rgba(151, 71, 255, 0.22) 100%) !important;
  color: var(--text) !important;
  font-weight: 500 !important;
}

:root.light .catalog-filters-modal .ts-wrapper.filter-select .ts-dropdown {
  background: #fff !important;
  border-color: rgba(151, 71, 255, 0.35) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(151, 71, 255, 0.15) !important;
}

:root.light .catalog-filters-modal .ts-wrapper.filter-select .ts-dropdown-content {
  background: #fff !important;
}

:root.light .catalog-filters-modal .ts-wrapper.filter-select .ts-dropdown [data-selectable]:hover,
:root.light .catalog-filters-modal .ts-wrapper.filter-select .ts-dropdown [data-selectable].active,
:root.light .catalog-filters-modal .ts-wrapper.filter-select .ts-dropdown .option:hover,
:root.light .catalog-filters-modal .ts-wrapper.filter-select .ts-dropdown .option.active {
  background: rgba(151, 71, 255, 0.12) !important;
  color: #0d1014 !important;
}

:root.light .catalog-filters-modal .ts-wrapper.filter-select .ts-dropdown [data-selectable].selected,
:root.light .catalog-filters-modal .ts-wrapper.filter-select .ts-dropdown .option.selected {
  color: #0d1014 !important;
}

:root.light .catalog-filters-modal .ts-wrapper.filter-select {
  border-color: rgba(151, 71, 255, 0.4) !important;
}

:root.light .catalog-filters-modal .ts-wrapper.filter-select:hover {
  border-color: rgba(151, 71, 255, 0.55) !important;
}

/* Теги (chips) — как в админке (внутренние отступы чипов не сжимаем) */
.catalog-filters-modal .ts-wrapper.filter-select.multi .ts-control [data-value] {
  background: linear-gradient(135deg, var(--link) 0%, var(--link-2) 100%) !important;
  color: #fff !important;
  border-radius: 8px !important;
  padding: 0.35rem 0.65rem !important;
  margin: 0.15rem 0.25rem 0.15rem 0 !important;
  border: none !important;
  font-size: 0.875rem !important;
  box-shadow: 0 2px 4px rgba(151, 71, 255, 0.35) !important;
  display: inline-flex !important;
  align-items: center !important;
}

.catalog-filters-modal .ts-wrapper.filter-select.multi .ts-control [data-value] .item {
  color: #fff !important;
}

.catalog-filters-modal .ts-wrapper.filter-select.multi .ts-control [data-value] .remove {
  color: #fff !important;
  border-left: 1px solid rgba(255,255,255,0.5) !important;
  padding-left: 0.5rem !important;
  margin-left: 0.25rem !important;
}

/*
 * Год в модалке: кликается вся высота поля (без «мёртвой зоны» снизу).
 * Отступ задаём только у .ts-control — padding на .ts-wrapper оставляет неинтерактивную полосу.
 * Нативный select наследует min-height из .filter-year-select и раздувает обёртку — уводим из потока.
 */
.catalog-filters-modal .filter-group-year .ts-wrapper.filter-select {
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  min-height: 0 !important;
}

.catalog-filters-modal .filter-group-year .ts-wrapper > select.filter-year-select {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border: none !important;
}

.catalog-filters-modal .filter-group-year .ts-wrapper.filter-select.single .ts-control {
  flex: 1 1 auto !important;
  min-height: 44px !important;
  width: 100% !important;
  padding: 0.35rem 0.65rem !important;
  font-size: 16px !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  box-sizing: border-box !important;
}

.catalog-filters-modal .filter-group-year .ts-wrapper.filter-select.single .ts-control > * {
  display: inline-flex !important;
  align-self: center !important;
}

.catalog-filters-modal .filter-group-year .ts-wrapper.filter-select.single .ts-control .item {
  font-size: 16px !important;
  line-height: 1.3 !important;
}

.catalog-filters-modal .filter-group-year .filter-year-error {
  margin: 0.4rem 0 0;
  font-size: 0.875rem;
  color: var(--red);
}

.catalog-filters-modal .filter-group-year--error .filter-year-inputs .ts-wrapper.filter-select {
  border-color: rgba(171, 73, 73, 0.85) !important;
  box-shadow: 0 0 0 1px rgba(171, 73, 73, 0.25) !important;
}

/* Год в модалке: тире по центру относительно полей */
.catalog-filters-modal .filter-group-year .filter-year-inputs {
  align-items: center;
}

.catalog-filters-modal .filter-group-year .filter-year-inputs > .ts-wrapper.filter-select {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
}

/* Год: выбор «от» и «до» — в стиле полей модалки */
.filter-group-year .filter-year-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-group-year .filter-year-select {
  flex: 1;
  min-width: 0;
  max-width: 120px;
  min-height: 48px;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border: 1px solid rgba(151, 71, 255, 0.35);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-second);
  box-sizing: border-box;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2368727C' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  -webkit-tap-highlight-color: transparent;
}

.filter-group-year .filter-year-select:hover {
  border-color: rgba(255,255,255,0.2);
}

.filter-group-year .filter-year-select:focus,
.filter-group-year .filter-year-select:focus-visible {
  outline: none !important;
  outline-offset: 0;
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(151, 71, 255, 0.15);
}

.filter-group-year .filter-year-select::-ms-expand {
  display: none;
}

.filter-group-year .filter-year-sep {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  line-height: 1;
  color: var(--text-second);
  font-weight: 500;
  flex-shrink: 0;
}

/* Кнопки модалки — ближе друг к другу, выше как поля фильтров */
.catalog-filters-modal .catalog-filters-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.catalog-filters-modal .catalog-filters-actions .btn-apply-filters {
  width: 100%;
  margin: 0;
  min-height: 48px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
}

.catalog-filters-modal .catalog-filters-actions .btn-reset {
  width: 100%;
  margin: 0;
  min-height: 48px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(151, 71, 255, 0.45);
}

.catalog-filters-modal .catalog-filters-actions .btn-reset:hover {
  background: rgba(151, 71, 255, 0.1);
  color: var(--text);
  border-color: var(--link);
}

:root.light .catalog-filters-modal .catalog-filters-actions .btn-reset {
  color: #0d1014;
  border-color: rgba(151, 71, 255, 0.45);
}

:root.light .catalog-filters-modal .catalog-filters-actions .btn-reset:hover {
  background: rgba(151, 71, 255, 0.08);
}

/* Переключатель «Платные» — как в загрузчике (вся строка кликабельна, ширина поля) */
.catalog-filters-modal .filter-group-lf-premium.catalog-premium-form-group {
  margin-bottom: 0.85rem;
}

.catalog-filters-modal .filter-group-lf-premium .catalog-premium-switch-outer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  margin-bottom: 0;
  padding: 0.75rem 1rem;
  background: var(--bg-second);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.catalog-filters-modal .filter-group-lf-premium .catalog-premium-switch-outer:hover {
  border-color: var(--link);
}

.catalog-filters-modal .catalog-premium-switch-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  flex: 1;
}

.catalog-filters-modal .catalog-premium-switch-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
}

.catalog-filters-modal .catalog-premium-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.catalog-filters-modal .catalog-premium-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.catalog-filters-modal .catalog-premium-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-third);
  border: 1px solid var(--border-color);
  border-radius: 26px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.catalog-filters-modal .catalog-premium-switch-slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--text);
  border-radius: 50%;
  opacity: 0.9;
  transition: transform 0.2s ease;
}

.catalog-filters-modal .catalog-premium-switch input:checked + .catalog-premium-switch-slider {
  background: rgba(151, 71, 255, 0.45);
  border-color: var(--link);
}

.catalog-filters-modal .catalog-premium-switch input:checked + .catalog-premium-switch-slider::before {
  transform: translate(22px, -50%);
}

.catalog-filters-modal .catalog-premium-switch input:focus-visible + .catalog-premium-switch-slider {
  box-shadow: 0 0 0 3px rgba(151, 71, 255, 0.25);
}

:root.light .catalog-filters-modal .filter-group-lf-premium .catalog-premium-switch-outer {
  background: var(--bg-second);
}

.filter-group {
  margin-bottom: 0.75rem;
}

.filter-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  color: var(--text);
  font-weight: 500;
}

.filter-group:first-of-type label {
  margin-top: 0;
}

.filter-group .search-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
}

.filter-group .filter-category-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.filter-select {
  width: 100%;
  padding: 0.5rem;
  background: var(--bg-second);
  color: var(--text);
  border: 1px solid var(--text-second);
  border-radius: 8px;
}

/* Select / обёртка Tom Select в модалке */
.catalog-filters-modal .filter-select {
  padding: 0.1rem 0.2rem !important;
  border: 1px solid rgba(151, 71, 255, 0.35) !important;
  border-radius: 12px !important;
}

.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  background: var(--bg-second);
  border-radius: 12px;
  font-size: 0.85rem;
}

.tag-checkbox-label .tag-count {
  color: var(--text-second);
  font-size: 0.75rem;
}

.btn-reset {
  width: 100%;
  padding: 0.6rem;
  background: var(--link);
  color: var(--text);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.btn-reset:hover {
  opacity: 0.9;
}

.catalog-results {
  /* Results area styles */
}

.catalog-sort-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 2px;
  flex-wrap: wrap;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.catalog-sort-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-left: auto;
  justify-content: flex-end;
}

.catalog-sort-label {
  color: var(--text-second);
  font-size: 0.9rem;
  margin: 0;
}

.catalog-sort-select {
  width: max-content;
  max-width: 100%;
  min-width: 0;
  padding: 0 1.75rem 0 0.65rem;
  height: 50px;
  background: var(--bg-second);
  color: var(--text);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1.02rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2368727C' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  line-height: 48px;
  box-sizing: border-box;
  accent-color: var(--link);
}

.catalog-sort-select:focus {
  outline: none;
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(151, 71, 255, 0.15);
}

/* Tom Select — сортировка каталога (как фильтры в модалке: скругления, фиолетовая обводка) */
.catalog-sort-controls .ts-wrapper {
  min-height: 0 !important;
  height: 50px !important;
  width: max-content;
  max-width: 100%;
  min-width: 22rem;
  box-sizing: border-box;
  background: var(--bg-second) !important;
  border: 1px solid rgba(151, 71, 255, 0.45) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--text) !important;
  cursor: pointer !important;
  outline: none !important;
  position: relative;
  z-index: 2;
  overflow: visible !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.catalog-sort-controls .ts-wrapper * {
  cursor: pointer !important;
}

.catalog-sort-controls .ts-wrapper:hover {
  border-color: rgba(151, 71, 255, 0.65) !important;
}

.catalog-sort-controls .ts-wrapper:focus,
.catalog-sort-controls .ts-wrapper:focus-within,
.catalog-sort-controls .ts-wrapper.focus {
  outline: none !important;
  border-color: var(--link) !important;
  box-shadow: 0 0 0 3px rgba(151, 71, 255, 0.2) !important;
}

.catalog-sort-controls .ts-wrapper .ts-control {
  display: flex;
  align-items: center;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: 50px !important;
  padding: 0 2rem 0 0.85rem !important;
  cursor: pointer;
  outline: none !important;
  box-shadow: none !important;
  line-height: 1;
  border: none !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: var(--text) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2368727C' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.85rem center !important;
}

.catalog-sort-controls .ts-wrapper .ts-control:focus {
  outline: none !important;
  box-shadow: none !important;
}

.catalog-sort-controls .ts-wrapper .ts-control > input {
  min-width: 0 !important;
  cursor: pointer !important;
}

.catalog-sort-controls .ts-wrapper .dropdown-input,
.catalog-sort-controls .ts-wrapper .ts-dropdown .dropdown-input,
.catalog-sort-controls .ts-wrapper.plugin-dropdown_input .dropdown-input {
  display: none !important;
}

.catalog-sort-controls .ts-wrapper.single .ts-control .item {
  flex: 0 1 auto;
  min-width: 0;
  width: auto;
  max-width: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  cursor: pointer !important;
  white-space: nowrap;
}

.catalog-sort-controls .ts-wrapper .ts-dropdown {
  min-width: 100% !important;
  width: 100% !important;
  max-width: none !important;
  background: var(--bg-third) !important;
  border: 1px solid rgba(151, 71, 255, 0.3) !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(151, 71, 255, 0.12) !important;
  margin-top: 6px !important;
  overflow: hidden !important;
  z-index: 50;
}

.catalog-sort-controls .ts-wrapper .ts-dropdown-content {
  background: var(--bg-third) !important;
  padding: 0.35rem 0 !important;
  max-height: 55vh !important;
}

.catalog-sort-controls .ts-wrapper .ts-dropdown-content::-webkit-scrollbar {
  width: 8px;
}

.catalog-sort-controls .ts-wrapper .ts-dropdown-content::-webkit-scrollbar-track {
  background: transparent;
}

.catalog-sort-controls .ts-wrapper .ts-dropdown-content::-webkit-scrollbar-thumb {
  background: var(--link);
  border-radius: 4px;
}

.catalog-sort-controls .ts-wrapper .ts-dropdown [data-selectable],
.catalog-sort-controls .ts-wrapper .ts-dropdown .option {
  padding: 0.65rem 1rem !important;
  margin: 0.125rem 0.5rem !important;
  border-radius: 8px !important;
  color: var(--text) !important;
  cursor: pointer !important;
  transition: background 0.15s ease, color 0.15s ease !important;
  background: transparent !important;
}

.catalog-sort-controls .ts-wrapper .ts-dropdown [data-selectable]:hover,
.catalog-sort-controls .ts-wrapper .ts-dropdown [data-selectable].active,
.catalog-sort-controls .ts-wrapper .ts-dropdown .option:hover,
.catalog-sort-controls .ts-wrapper .ts-dropdown .option.active {
  background: rgba(151, 71, 255, 0.22) !important;
  color: var(--text) !important;
}

.catalog-sort-controls .ts-wrapper .ts-dropdown [data-selectable].selected,
.catalog-sort-controls .ts-wrapper .ts-dropdown .option.selected {
  background: linear-gradient(135deg, rgba(151, 71, 255, 0.35) 0%, rgba(151, 71, 255, 0.22) 100%) !important;
  color: var(--text) !important;
  font-weight: 500 !important;
}

:root.light .catalog-sort-controls .ts-wrapper {
  border-color: rgba(151, 71, 255, 0.4) !important;
}

:root.light .catalog-sort-controls .ts-wrapper:hover {
  border-color: rgba(151, 71, 255, 0.55) !important;
}

:root.light .catalog-sort-controls .ts-wrapper .ts-dropdown,
:root.light .catalog-sort-controls .ts-wrapper .ts-dropdown-content {
  background: #fff !important;
  border-color: rgba(151, 71, 255, 0.35) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(151, 71, 255, 0.15) !important;
}

:root.light .catalog-sort-controls .ts-wrapper .ts-dropdown [data-selectable]:hover,
:root.light .catalog-sort-controls .ts-wrapper .ts-dropdown [data-selectable].active,
:root.light .catalog-sort-controls .ts-wrapper .ts-dropdown .option:hover,
:root.light .catalog-sort-controls .ts-wrapper .ts-dropdown .option.active {
  background: rgba(151, 71, 255, 0.12) !important;
  color: #0d1014 !important;
}

:root.light .catalog-sort-controls .ts-wrapper .ts-dropdown [data-selectable].selected,
:root.light .catalog-sort-controls .ts-wrapper .ts-dropdown .option.selected {
  color: #0d1014 !important;
}

.catalog-sort-controls .ts-wrapper.dropdown-active {
  z-index: 100;
}

#pagination {
  margin-top: 2rem;
  text-align: center;
}

/* Главная страница - контейнеры (оформление как .section-box) */
.section-container {
  text-align: center;
  display: flex;
  width: auto;
  height: min-content;
  flex-direction: column;
  gap: var(--border-24);
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto 2em auto;
  border-radius: var(--border-24);
  padding: 2.2em 2em 1.2em 2em;
  box-shadow: 0 8px 12px 0px var(--link-2);
  background: var(--bg-second);
  overflow: hidden;
}

/* Главная: два отдельных контейнера в один ряд — слева Популярное/ТОП, справа Последние обновления + Сейчас на сайте */
.index-two-containers {
  display: flex;
  gap: 1.5rem;
  align-items: stretch;
  max-width: 1200px;
  margin: 0 auto 2em auto;
}
.index-two-containers .section-container {
  margin: 0;
}
.index-container-popular {
  flex: 2;
  min-width: 0;
}
.index-container-right {
  flex: 1;
  min-width: 0;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Как у .section-container рядом (Последние обновления / Сейчас на сайте) */
.home-subscribe-banner {
  display: block;
  border-radius: var(--border-24);
  overflow: hidden;
  line-height: 0;
  flex-shrink: 0;
  background: var(--bg-second);
  box-shadow: 0 8px 12px 0px var(--link-2);
  transition: box-shadow var(--transition), transform var(--transition);
}
.home-subscribe-banner:hover {
  box-shadow: 0 10px 16px 0px var(--link-2);
  transform: translateY(-1px);
}
.home-subscribe-banner img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: middle;
}
.index-container-updates {
  min-width: 0;
}
@media (max-width: 900px) {
  .index-two-containers {
    flex-direction: column;
    padding: 0 1rem;
  }
  .index-container-right {
    width: 100%;
    max-width: none;
    order: 1;
  }
  .index-container-popular {
    order: 0;
  }
  .index-container-online {
    order: 0;
  }
  .index-container-updates {
    order: 1;
  }
}

/* Контейнер «Последние обновления» */
.section-container-updates {
  text-align: left;
}
.latest-updates-title {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  text-align: center;
}
.latest-updates-carousel {
  height: 320px;
  overflow: hidden;
}
.latest-updates-carousel .swiper-wrapper {
  flex-direction: column;
}
.latest-updates-carousel .swiper-slide {
  height: auto;
  width: 100%;
}
.latest-updates-item {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  background: var(--bg-third);
  transition: background var(--transition);
}
.latest-updates-item:hover {
  background: var(--bg-hover);
}
.latest-updates-episode {
  display: block;
  font-size: 0.8rem;
  color: var(--link);
  margin-bottom: 0.25rem;
}
.latest-updates-release {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
}
.latest-updates-empty {
  font-size: 0.9rem;
  color: var(--text-second);
  text-align: center;
  padding: 1rem;
}
@media (max-width: 768px) {
  .latest-updates-carousel {
    height: 240px;
  }
}

/* Блок «Сейчас на сайте» — оформление как у «Последние обновления» (section-container-updates) */
.online-now-title {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  text-align: center;
}
.online-now-content {
  font-size: 0.9rem;
  padding: 0 0.5rem;
  display: flex;
  flex-direction: column;
  min-height: 80px;
}
.online-now-avatars {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.online-now-avatar-link {
  display: inline-block;
  line-height: 0;
}
/* Квадратные аватарки как в юзер-панели (скруглённый квадрат, бордер) */
.online-now-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--border-24);
  overflow: hidden;
  border: 2px solid var(--link);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-second);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.online-now-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.online-now-avatar .avatar-placeholder {
  width: 100%;
  height: 100%;
  min-width: 40px;
  min-height: 40px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.online-now-count {
  margin: 0.75rem 0 0 auto;
  font-size: 0.8rem;
  color: var(--text-second);
  text-align: right;
}
.online-now-empty {
  margin: 0;
  color: var(--text-second);
  text-align: center;
}

/* Лайтбокс скрыт по умолчанию */
.lightbox {
  display: none;
}

.lightbox.active {
  display: flex !important;
}

/* Кнопка "Применить" в фильтрах */
.btn-apply-filters {
  width: 100%;
  padding: 0.6rem;
  background: var(--link);
  color: var(--text);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.btn-apply-filters:hover {
  opacity: 0.9;
}

/* Светлая тема: белый текст только на кнопках с тёмным (фиолетовым) фоном */
:root.light .profile-edit-btn,
:root.light .edit-profile-modal .btn-submit,
:root.light .btn-apply-filters,
:root.light .catalog-pagination button.active,
:root.light .catalog-pagination .pagination-page--current,
:root.light .btn-profile-load-more,
:root.light body:not(.admin-body) main .btn-primary {
  color: #fff;
}

/* Светлая тема: на кнопках с светлым/полупрозрачным фоном — чёрный текст */
:root.light .btn-filters-open,
:root.light .catalog-pagination a,
:root.light .catalog-pagination button:not(.active) {
  color: #0D1014;
}

/* Кнопки .btn / .btn-primary на публичном сайте (профиль и т.д.; админка — только admin.css) */
body:not(.admin-body) main .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.25rem;
  border-radius: var(--border-15, 15px);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  box-sizing: border-box;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition),
    box-shadow var(--transition), transform var(--transition), opacity var(--transition), filter var(--transition);
}

body:not(.admin-body) main .btn-primary {
  background: linear-gradient(135deg, var(--link) 0%, var(--link-2) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(151, 71, 255, 0.35);
}

body:not(.admin-body) main .btn-primary:hover {
  opacity: 0.96;
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(151, 71, 255, 0.45);
}

body:not(.admin-body) main .btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(151, 71, 255, 0.3);
}

body:not(.admin-body) main .btn-primary:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

body:not(.admin-body) main .btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: none;
}

.caps-lock-hint {
  margin: 0.35rem 0 0;
  color: #d4a017;
  font-size: 0.88rem;
}

.profile-card-modal {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.profile-card-modal.active {
  display: flex;
}

.profile-card-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.profile-card-modal__dialog {
  position: relative;
  width: min(100%, 420px);
  background: var(--bg-second);
  border: 1px solid var(--border-color);
  border-radius: var(--border-24, 24px);
  padding: 1.5rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  z-index: 1;
}

.profile-card-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-second);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.profile-card-modal__close:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.profile-card-modal__header {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.profile-card-modal__avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.profile-card-modal__avatar--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--link) 0%, var(--link-2) 100%);
  color: var(--text);
  font-weight: 700;
  font-size: 1.5rem;
}

.profile-card-modal__name {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  color: var(--text);
}

.profile-card-modal__status {
  font-size: 0.9rem;
  color: var(--text-second);
}

.profile-card-modal__status--online {
  color: var(--green);
}

.profile-card-modal__roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.profile-card-modal__role {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
  background: var(--bg-third);
  color: var(--text);
}

.profile-card-modal__registered {
  margin: 0 0 1rem;
  color: var(--text-second);
  font-size: 0.9rem;
}

.profile-card-modal__actions {
  display: flex;
  justify-content: stretch;
}

.profile-card-modal__open {
  width: 100%;
}

.profile-card-modal__loading,
.profile-card-modal__error {
  margin: 0;
  color: var(--text-second);
  text-align: center;
}

.profile-card-modal__error {
  color: var(--red);
}

.comment-username-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--link);
  cursor: pointer;
  text-align: left;
}

.comment-username-btn:hover {
  text-decoration: underline;
}

/* Код подтверждения / TV-pair — одна строка из ячеек */
.verify-code-group .verify-code-digits {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  margin: 0.75rem 0;
}

.login-form-container .verify-code-group .verify-code-digit,
.verify-code-digit {
  width: 2.75rem !important;
  min-width: 2.75rem;
  max-width: 2.75rem;
  height: 2.75rem;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-second);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  padding: 0;
}

.verify-code-digit:hover {
  border-color: var(--link-2);
}

.verify-code-digit:focus {
  outline: none;
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(151, 71, 255, 0.25);
}

.tv-pair-form {
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
}

.tv-pair-form > p {
  color: var(--text-second);
  margin-bottom: 0.5rem;
}

.tv-pair-form button[type="submit"],
.tv-pair-form .btn-primary {
  margin-top: 1rem;
}

@media (max-width: 400px) {
  .login-form-container .verify-code-group .verify-code-digit,
  .verify-code-digit {
    width: 2.35rem !important;
    min-width: 2.35rem;
    max-width: 2.35rem;
    height: 2.35rem;
    font-size: 1.1rem;
  }

  .verify-code-group .verify-code-digits {
    gap: 0.35rem;
  }
}

/* === utilities.css === */
/* Утилиты */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }

/* === extra.css === */

/* Теги (chips) для множественного выбора - как в админке */
.ts-wrapper.filter-select.multi .ts-control [data-value] {
  background: var(--link) !important;
  color: white !important;
  border-radius: 4px !important;
  padding: 0.25rem 0.5rem !important;
  margin: 0.15rem 0.15rem 0.15rem 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  font-size: 0.8rem !important;
  border: none !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  box-shadow: 0 1px 3px rgba(151, 71, 255, 0.3) !important;
  transition: all 0.2s ease !important;
  line-height: 1.2 !important;
}

.ts-wrapper.filter-select.multi .ts-control [data-value]:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 6px rgba(151, 71, 255, 0.4) !important;
}

.ts-wrapper.filter-select.multi .ts-control [data-value] .item {
  color: white !important;
}

.ts-wrapper.filter-select.multi .ts-control [data-value] .remove {
  color: white !important;
  border-left: 1px solid rgba(255, 255, 255, 0.25) !important;
  padding-left: 0.4rem !important;
  margin-left: 0.4rem !important;
  cursor: pointer !important;
  opacity: 0.9 !important;
  transition: opacity 0.2s, background-color 0.2s !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 18px !important;
  font-size: 1.1rem !important;
  line-height: 1 !important;
}

.ts-wrapper.filter-select.multi .ts-control [data-value] .remove:hover {
  opacity: 1 !important;
  background: rgba(255, 255, 255, 0.25) !important;
  border-radius: 4px !important;
}

/* Для множественного выбора - все элементы в одной строке */
.ts-wrapper.filter-select.multi .ts-control {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 0.25rem !important;
  padding: 0.3rem 0.45rem !important;
  min-height: 38px !important;
  flex-direction: row !important;
  align-content: center !important;
}

.ts-wrapper.filter-select.multi:not(.has-items) .ts-control {
  padding: 0.3rem 0.45rem !important;
}

.ts-wrapper.filter-select.multi.has-items .ts-control {
  padding: 0.3rem 0.45rem !important;
}

/* Теги не должны сжиматься */
.ts-wrapper.filter-select.multi .ts-control [data-value] {
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  vertical-align: middle !important;
}

.ts-wrapper.filter-select.multi .ts-control input,
.ts-wrapper.filter-select.multi .ts-control .ts-control-input {
  color: var(--text) !important;
  background: transparent !important;
  margin: 0 !important;
  flex: 0 1 auto !important;
  width: auto !important;
  min-width: 120px !important;
  max-width: none !important;
  display: inline-block !important;
  height: auto !important;
  line-height: 1.4 !important;
  vertical-align: middle !important;
  padding: 0.2rem 0.4rem !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  align-self: center !important;
  flex-shrink: 1 !important;
  flex-grow: 0 !important;
  flex-basis: auto !important;
  font-size: 0.85rem !important;
}

/* Убираем ограничение размера от атрибута size */
.ts-wrapper.filter-select.multi .ts-control input[size] {
  width: auto !important;
  min-width: 120px !important;
}

/* Когда есть элементы, input должен быть на том же уровне */
.ts-wrapper.filter-select.multi.has-items .ts-control input {
  flex: 0 1 auto !important;
  min-width: 120px !important;
  display: inline-block !important;
  vertical-align: middle !important;
  align-self: center !important;
}

/* Скрываем плейсхолдер если есть выбранные элементы - has-items на ts-wrapper */
.ts-wrapper.filter-select.multi.has-items .ts-control input[placeholder]::placeholder,
.ts-wrapper.filter-select.multi.has-items .ts-control input::placeholder {
  opacity: 0 !important;
  color: transparent !important;
  pointer-events: none !important;
  visibility: hidden !important;
  font-size: 0 !important;
  line-height: 0 !important;
}

/* Альтернативный способ - скрыть placeholder через атрибут */
.ts-wrapper.filter-select.multi.has-items .ts-control input[placeholder] {
  text-indent: 0 !important;
}

/* Убираем placeholder полностью когда есть элементы */
.ts-wrapper.filter-select.multi.has-items .ts-control input::placeholder {
  content: '' !important;
  display: none !important;
}

/* Светлая тема — общие переопределения для компонентов */
:root.light .ts-wrapper.filter-select .ts-control,
:root.light .ts-wrapper.filter-select .ts-dropdown {
  background: var(--bg-second);
  border-color: var(--text-second);
}

/* ========================================
   Модальное окно поиска
   ======================================== */

/* Overlay (затемнение фона) */
.search-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  z-index: 999;
}

.search-modal[aria-hidden="false"] .search-modal-overlay {
  opacity: 1;
}

/* Контейнер модального окна */
.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
}

.search-modal[aria-hidden="false"] {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

/* Контент модального окна */
.search-modal-content {
  position: relative;
  background: var(--bg);
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: calc(100% - 2rem);
  margin: 0.25rem;
  padding: 0.5rem;
  max-height: calc(100vh - 0.5rem);
  overflow-y: auto;
  transform: scale(0.95) translateY(-10px);
  transition: transform 0.2s ease-in-out;
  z-index: 1001;
  pointer-events: auto;
}



.search-modal[aria-hidden="false"] .search-modal-content {
  transform: scale(1) translateY(0);
}

/* Заголовок (скрытый для accessibility) */
.search-modal-title.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Обертка поля ввода */
.search-modal-input-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.search-modal-input-container {
  background: var(--bg-second);
  border: 1px solid rgba(245, 245, 245, 0.2);
  border-radius: 9999px;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.75rem;
  height: 3rem;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.search-modal-input-container:focus-within {
  border-color: var(--link);
  outline: none;
}

.search-modal-icon {
  width: 20px;
  height: 20px;
  margin-left: 0.5rem;
  color: var(--text-second);
  flex-shrink: 0;
}

.search-modal-input {
  width: 100%;
  padding: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
}

.search-modal-input::placeholder {
  color: var(--text-second);
}

.search-modal-clear {
  width: 20px;
  height: 20px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  color: var(--text-second);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  transition: background-color 0.2s;
}

.search-modal-clear:hover {
  background: var(--bg-second);
}

.search-modal-clear svg {
  width: 16px;
  height: 16px;
}

.search-modal-close {
  width: 3rem;
  height: 3rem;
  min-width: 44px;
  min-height: 44px;
  aspect-ratio: 1;
  background: var(--bg-second);
  border: none;
  border-radius: 9999px;
  color: var(--text-second);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.search-modal-close:hover {
  background: rgba(151, 71, 255, 0.1);
}

.search-modal-close svg {
  width: 20px;
  height: 20px;
}

/* История поиска */
.search-modal-history {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  max-width: 100%;
  overflow-x: auto;
  border-radius: 6px;
}

.search-modal-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border-radius: 9999px;
  padding: 0.5rem 0.75rem;
  min-height: 44px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s;
  width: 100%;
  max-width: 100%;
  border: none;
  text-align: left;
}

.search-modal-history-item:hover {
  background: var(--bg-second);
}

.search-modal-history-item-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.search-modal-history-item-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-second);
}

.search-modal-history-item-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-modal-history-item-delete {
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  aspect-ratio: 1;
  background: transparent;
  border: none;
  border-radius: 9999px;
  color: var(--text-second);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background-color 0.2s, color 0.2s;
  flex-shrink: 0;
}

.search-modal-history-item-delete:hover {
  background: rgba(151, 71, 255, 0.2);
  color: var(--link);
}

.search-modal-history-item-delete svg {
  width: 14px;
  height: 14px;
}

/* Рекомендации */
.search-modal-recommendations {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 6px;
}

.search-modal-recommendations-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  margin-left: 0.25rem;
  margin-bottom: 0;
}

.search-modal-recommendations-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}


.search-modal-recommendation-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid rgba(245, 245, 245, 0.2);
  background: var(--bg-second);
  padding: 0.5rem;
  transition: border-color 0.2s, background-color 0.2s;
  text-decoration: none;
}


.search-modal-recommendation-item:hover {
  border-color: var(--link);
  background: rgba(151, 71, 255, 0.05);
}

.search-modal-recommendation-item-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.search-modal-recommendation-item-poster {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  aspect-ratio: 2/3;
  overflow: hidden;
  border-radius: 4px;
  width: 3rem;
  user-select: none;
}


.search-modal-recommendation-item-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.search-modal-recommendation-item-info {
  flex: 1;
  min-width: 0;
}

.search-modal-recommendation-item-category {
  font-size: 0.75rem;
  color: var(--text-second);
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1rem;
}

.search-modal-recommendation-item-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

/* Табы */
.search-modal-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem;
  background: var(--bg-second);
  border-radius: 9999px;
  overflow-x: auto;
  margin-bottom: 0.5rem;
}

.search-modal-tabs::-webkit-scrollbar {
  display: none;
}

.search-modal-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 1rem;
  min-height: 2.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.search-modal-tab:hover {
  background: var(--bg);
}

.search-modal-tab.active {
  background: var(--link);
  color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.search-modal-tab.active:hover {
  opacity: 0.85;
}

.search-modal-tab:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Результаты поиска */
.search-modal-results-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 6px;
  min-height: 40vh;
}

.search-modal-results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}


.search-modal-result-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid rgba(245, 245, 245, 0.2);
  background: var(--bg-second);
  padding: 0.5rem;
  transition: border-color 0.2s, background-color 0.2s;
  text-decoration: none;
}


.search-modal-result-item:hover {
  border-color: var(--link);
  background: rgba(151, 71, 255, 0.05);
}

.search-modal-result-item-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.search-modal-result-item-poster {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  aspect-ratio: 2/3;
  overflow: hidden;
  border-radius: 4px;
  width: 3rem;
  user-select: none;
}

/* Круглые аватары для пользователей */
.search-modal-result-item[href*="profile.php"] .search-modal-result-item-poster {
  aspect-ratio: 1/1;
  border-radius: 50%;
}


.search-modal-result-item-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-modal-result-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--link);
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 50%;
}

.search-modal-result-item-info {
  flex: 1;
  min-width: 0;
}

.search-modal-result-item-category {
  font-size: 0.75rem;
  color: var(--text-second);
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-modal-result-item-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

/* Empty state */
.search-modal-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 2rem;
  min-height: 40vh;
  border-radius: 6px;
  grid-column: 1 / -1;
}

.search-modal-empty-icon {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-modal-empty-icon svg {
  opacity: 0.8;
}

.search-modal-empty-icon svg circle[fill="white"] {
  fill: var(--text-second);
  opacity: 0.3;
}

.search-modal-empty-icon svg circle[fill="black"],
.search-modal-empty-icon svg ellipse[fill="black"],
.search-modal-empty-icon svg path[stroke="black"] {
  fill: var(--text-second);
  stroke: var(--text-second);
  opacity: 0.7;
}

.search-modal-empty-icon svg circle[fill="white"][cx="85"],
.search-modal-empty-icon svg circle[fill="white"][cx="125"] {
  fill: var(--bg);
  opacity: 1;
}

.search-modal-empty-icon img {
  opacity: 0.5;
  filter: grayscale(0.3);
}

.search-modal-empty-text {
  font-size: 0.875rem;
  text-align: center;
  color: var(--text-second);
}

/* Кнопка "Больше" */
.search-modal-more {
  display: flex;
  justify-content: flex-end;
  padding: 0.25rem;
  margin-top: 0.25rem;
}

.search-modal-more-button {
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  min-height: 2.25rem;
  font-size: 0.875rem;
  background: var(--bg-second);
  color: var(--text-second);
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background-color 0.2s;
  margin: 0 0.5rem;
}

.search-modal-more-button:hover {
  background: rgba(151, 71, 255, 0.1);
}

/* Стили для закладок */
.release-title-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.release-title-row h1 {
  flex: 1;
  margin: 0;
}

.bookmark-container {
  position: relative;
}

.bookmark-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-second);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: 8px;
  color: var(--text-second);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.875rem;
  font-weight: 500;
}

.bookmark-btn:hover {
  background: var(--bg-hover, rgba(151, 71, 255, 0.1));
  border-color: var(--link);
  color: var(--link);
}

.bookmark-btn.bookmarked {
  background: rgba(151, 71, 255, 0.15);
  border-color: var(--link);
  color: var(--link);
}

.bookmark-btn.bookmarked.watching {
  background: rgba(75, 165, 255, 0.15);
  border-color: #4BA5FF;
  color: #4BA5FF;
}

.bookmark-btn.bookmarked.watched {
  background: rgba(76, 175, 80, 0.15);
  border-color: #4CAF50;
  color: #4CAF50;
}

.bookmark-btn.bookmarked.plan-to-watch {
  background: rgba(151, 71, 255, 0.15);
  border-color: var(--link);
  color: var(--link);
}

.bookmark-btn.bookmarked.dropped {
  background: rgba(171, 73, 73, 0.15);
  border-color: var(--red);
  color: var(--red);
}

.bookmark-btn svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.bookmark-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--bg-second);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: 8px;
  padding: 0.5rem;
  min-width: 180px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
}

.bookmark-menu.active {
  display: flex;
}

.bookmark-menu-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-second);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  font-size: 0.875rem;
}

.bookmark-menu-item:hover {
  background: var(--bg-hover, rgba(151, 71, 255, 0.1));
  color: var(--text);
}

.bookmark-menu-item.active {
  background: rgba(151, 71, 255, 0.2);
  color: var(--link);
  font-weight: 600;
}

.bookmark-menu-item.bookmark-remove {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  color: var(--red);
}

.bookmark-menu-item.bookmark-remove:hover {
  background: rgba(171, 73, 73, 0.15);
  color: var(--red);
}


/* Вкладки профиля */
.profile-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.profile-tab {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-second);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  margin-bottom: -2px;
}

.profile-tab:hover {
  color: var(--text);
  background: var(--bg-second);
}

.profile-tab.active {
  color: var(--link);
  border-bottom-color: var(--link);
  background: transparent;
}

.profile-tab-content {
  display: none;
}

.profile-tab-content.active {
  display: block;
}

/* Вкладка «Подписка» */
.profile-subscription-section {
  max-width: 960px;
  margin: 0 auto;
}
.profile-subscription-section h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: var(--text);
}
.profile-subscription-note {
  font-size: 0.95rem;
  color: var(--text-second);
  line-height: 1.55;
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--bg-second);
  border-radius: var(--border-15, 15px);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}
.profile-subscription-status {
  margin-bottom: 1.5rem;
  padding: 1rem 1.15rem;
  border-radius: var(--border-15, 15px);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  line-height: 1.5;
}
.profile-subscription-status--active {
  background: rgba(73, 171, 90, 0.12);
  border-color: rgba(73, 171, 90, 0.35);
}
.profile-subscription-status--inactive {
  background: var(--bg-second);
  color: var(--text-second);
}
.profile-subscription-muted {
  color: var(--text-second);
  margin: 0;
}

/* Карточки планов — в духе .section-container на сайте */
.profile-subscription-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 0;
  padding: 0;
}
.profile-subscription-plan-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: var(--border-24, 24px);
  background: var(--bg-second);
  box-shadow: 0 8px 12px 0px var(--link-2, #7349ab);
  overflow: hidden;
  border: none;
  transition: box-shadow var(--transition, 0.2s ease-in-out), transform var(--transition, 0.2s ease-in-out);
}
.profile-subscription-plan-card:hover {
  box-shadow: 0 10px 18px 0px var(--link-2, #7349ab);
  transform: translateY(-2px);
}
.profile-subscription-plan-card__head {
  padding: 1.35rem 1.35rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}
.profile-subscription-plan-card__title {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--link);
  letter-spacing: 0.02em;
}
.profile-subscription-plan-card__price {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.profile-subscription-plan-card__currency {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-second);
}
.profile-subscription-plan-card__term {
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
  color: var(--text-second);
}
.profile-subscription-plan-desc {
  font-size: 0.9rem;
  margin: 0;
  padding: 1rem 1.35rem;
  color: var(--text);
  line-height: 1.5;
  flex: 1;
}
.profile-subscription-plan-card__form {
  padding: 0 1.35rem 1.35rem;
  margin-top: auto;
}
.profile-subscription-plan-card__cta {
  width: 100%;
  margin: 0;
  padding: 0.65rem 1rem;
  font-weight: 600;
}

/* Стили для секции закладок в профиле */
.profile-bookmarks-section {
  margin-top: 0;
  margin-left: auto;
  margin-right: auto;
  padding-top: 0;
  border-top: none;
  max-width: 900px;
}

.profile-bookmarks-section h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.bookmarks-filters {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.bookmark-filter {
  padding: 0.5rem 1.25rem;
  background: var(--bg-second);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  text-decoration: none;
  display: inline-block;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: 8px;
  color: var(--text-second);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-block;
}

.bookmark-filter:hover {
  background: var(--bg-hover, rgba(151, 71, 255, 0.1));
  border-color: var(--link);
  color: var(--link);
}

.bookmark-filter.active {
  background: rgba(151, 71, 255, 0.2);
  border-color: var(--link);
  color: var(--link);
  font-weight: 600;
}

.bookmarks-loading {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-second);
  grid-column: 1 / -1;
  width: 100%;
}

.bookmarks-loading p {
  margin: 0;
  font-size: 1rem;
}

.bookmarks-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-second);
  grid-column: 1 / -1;
  width: 100%;
}

.bookmarks-empty p {
  margin-bottom: 1rem;
}

.bookmarks-empty a {
  color: var(--link);
  text-decoration: none;
}

.bookmarks-empty a:hover {
  text-decoration: underline;
}


/* ========================================
   Страница "О нас"
   ======================================== */

.about-section {
  padding: 2rem 0;
}

.about-content {
  margin-top: 2rem;
}

.about-description h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.about-description p {
  margin-bottom: 1rem;
  line-height: 1.6;
  color: var(--text-second);
}

.about-social {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* Профиль: соцсети выравниваем слева (как роли), а не по центру */
.about-social.profile-social-links {
  justify-content: flex-start;
}

.about-social .social-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-second);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-second);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  width: auto;
}

.about-social .social-link:hover {
  background: var(--bg-hover);
  transform: translateY(-2px);
}

.about-social .social-link svg {
  flex-shrink: 0;
}

.team-section {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border-color);
}

.team-section h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--text);
}

.team-role-group {
  margin-bottom: 2.5rem;
}

.team-role-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.team-members {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.team-member {
  padding: 1rem;
  background: var(--bg-second);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  text-align: center;
}

.team-member:hover {
  background: var(--bg-hover);
  transform: translateY(-2px);
}

.team-member-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  width: 100%;
}

.team-member-link:hover {
  color: var(--link);
}

.team-member-link svg {
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.team-member-link:hover svg {
  opacity: 1;
}

.team-member-name {
  color: var(--text);
  font-weight: 500;
}

.team-member-former {
  opacity: 0.88;
}

/* ========================================
   Уведомление об использовании cookie
   ======================================== */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 1rem 1.25rem;
  background: var(--bg-second);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
  font-family: 'Exo 2', sans-serif;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.cookie-consent-banner[aria-hidden="true"] {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.cookie-consent-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.cookie-consent-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.cookie-consent-text-wrap {
  flex: 1;
  min-width: 0;
}

.cookie-consent-title {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.cookie-consent-text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--text-second);
}

.cookie-consent-btn {
  flex-shrink: 0;
  padding: 0.625rem 1.25rem;
  min-height: 44px;
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: inherit;
  color: #fff;
  background: var(--link);
  border: none;
  border-radius: var(--border-15);
  cursor: pointer;
  transition: background-color var(--transition), transform var(--transition);
  box-shadow: 0 2px 8px rgba(151, 71, 255, 0.35);
}

.cookie-consent-btn:hover {
  background: var(--link-2);
}

.cookie-consent-btn:focus {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .cookie-consent-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .cookie-consent-btn {
    width: 100%;
  }
}

/* Счёт подписки: subscription-pay.php, subscription-return.php */
.subscription-invoice-page {
  padding: 2rem 0 3.5rem;
  min-height: 45vh;
}
.subscription-invoice-page__inner {
  max-width: 520px;
  margin: 0 auto;
}
.subscription-invoice-page__title {
  margin: 0 0 1.25rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}
.subscription-invoice-page__alert {
  margin-bottom: 1rem;
}
.subscription-invoice-card {
  background: var(--bg-second);
  border-radius: var(--border-15, 15px);
  padding: 1.75rem 1.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}
.subscription-invoice-card--success {
  border-color: rgba(46, 160, 67, 0.45);
  box-shadow: 0 8px 24px rgba(46, 160, 67, 0.15);
}
.subscription-invoice-card__label {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text-second);
}
.subscription-invoice-card__plan {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--link);
}
.subscription-invoice-card__details {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--border-15);
  background: var(--bg-third);
  border: 1px solid var(--border-color);
}
.subscription-invoice-card__details-label {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-second);
}
.subscription-invoice-card__details-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}
.subscription-invoice-card__amount {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}
.subscription-invoice-card__lead {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}
.subscription-invoice-card__hint {
  font-size: 0.9rem;
  color: var(--text-second);
  line-height: 1.45;
  margin: 0 0 1rem;
}
.subscription-invoice-card__timer {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 1.25rem;
  color: var(--text);
}
.subscription-invoice-card__actions {
  margin-bottom: 1rem;
}
.subscription-invoice-card__pay-btn {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}
.subscription-invoice-card__note {
  font-size: 0.85rem;
  color: var(--text-second);
  line-height: 1.45;
  margin: 0;
}
.subscription-invoice-page .hidden {
  display: none !important;
}

/* Публичная страница реквизитов для платёжных систем (без пункта в меню) */
.payment-requisites-page {
  padding: 2rem 0 3.5rem;
  min-height: 40vh;
}
.payment-requisites-page__inner {
  max-width: 640px;
  margin: 0 auto;
}
.payment-requisites-page__title {
  margin: 0 0 0.75rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
}
.payment-requisites-page__intro {
  margin: 0 0 1.5rem;
  color: var(--text-second);
  line-height: 1.5;
}
.payment-requisites-page__empty {
  margin-top: 0.5rem;
}
.payment-requisites-page__list {
  margin: 0;
  padding: 1.25rem 1.35rem;
  background: var(--bg-second);
  border-radius: var(--border-15, 15px);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}
.payment-requisites-page__list dt {
  margin: 1.15rem 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-second);
}
.payment-requisites-page__list dt:first-child {
  margin-top: 0;
}
.payment-requisites-page__list dd {
  margin: 0.35rem 0 0;
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
}
.payment-requisites-page__list dd a {
  color: var(--link);
}

/* Юридические страницы: оферта, правообладатели, DMCA */
.legal-page {
  padding: 2rem 0 4rem;
  min-height: 45vh;
}
.legal-page__inner {
  max-width: 820px;
  margin: 0 auto;
}
.legal-page__article {
  background: var(--bg-second);
  border-radius: var(--border-15, 15px);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  padding: 1.75rem 1.5rem 2.25rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}
.legal-page__title {
  margin: 0 0 0.75rem;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}
.legal-page__meta {
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
  color: var(--text-second);
  line-height: 1.5;
}
.legal-page__lead {
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.55;
}
.legal-page h2 {
  margin: 1.75rem 0 0.65rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}
.legal-page h2:first-of-type {
  margin-top: 0;
}
.legal-page p,
.legal-page li {
  margin: 0 0 0.75rem;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--text);
}
.legal-page ul,
.legal-page ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}
.legal-page li {
  margin-bottom: 0.4rem;
}
.legal-page a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal-page a:hover {
  color: var(--link-2);
}

/* === yandex-ads.css === */
/* Yandex.RTB — ширина как у основного контента сайта */
.yandex-rtb-block,
[id^="yandex_rtb_R-A-11731717"] {
  box-sizing: border-box;
  max-width: var(--lf-content-max-width, 1200px);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.yandex-rtb-block {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  padding-left: var(--lf-content-gutter, 1rem);
  padding-right: var(--lf-content-gutter, 1rem);
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.yandex-rtb-block > [id^="yandex_rtb_"] {
  width: 100%;
  max-width: 100%;
}

.yandex-rtb-block iframe,
[id^="yandex_rtb_R-A-11731717"] iframe,
[id^="yandex_rtb_R-A-11731717"] > div {
  max-width: 100% !important;
}

.release-full > .yandex-rtb-block {
  margin-top: 2rem;
  padding-left: 0;
  padding-right: 0;
}

/* Floor (мобильный sticky) — не шире контента */
.yandex-rtb-block--floor {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9990;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

.yandex-rtb-block--floor > * {
  pointer-events: auto;
}

body > [id^="yandex_rtb_R-A-11731717"]:not(.yandex-rtb-block) {
  max-width: var(--lf-content-max-width, 1200px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  width: 100% !important;
}

/* === responsive.css === */
/* responsive.css — все медиа-запросы */

@media (min-width: 768px) {
  .new-releases .swiper-slide .release-card {
    width: 200px;
    min-width: 200px;
  }
}

@media (min-width: 768px) {
  .search-modal-content {
    margin-top: 1rem;
  }
}

@media (min-width: 768px) {
  .search-modal-recommendations-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .search-modal-recommendation-item {
    flex-direction: row;
  }
}

@media (min-width: 768px) {
  .search-modal-recommendation-item-poster {
    width: 2.5rem;
  }
}

@media (min-width: 768px) {
  .search-modal-results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .search-modal-result-item {
    flex-direction: row;
  }
}

@media (min-width: 768px) {
  .search-modal-result-item-poster {
    width: 2.5rem;
  }
}

@media (max-width: 768px) {
  .top-section-wrapper {
    z-index: 1200;
  }

  header {
    z-index: 1201;
  }

  .user-panel-container {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
  }

  .userbar {
    gap: 1rem;
    padding: 0.6rem;
  }

  .userbar a {
    width: 38px;
    height: 38px;
  }

  .avatar img{
    width: 65px;
    height: 65px;
  }

  .login-button,
  .register-button {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .login-button span,
  .register-button span {
    display: none;
  }

  .background-layer {
    background-position: center top;
  }

  .header-menu {
    flex-wrap: wrap;
    padding: 1rem;
    gap: 0.5rem;
    position: relative;
    z-index: 1202;
  }

  .header-menu .logo {
    order: 1;
  }

  .header-menu .search-wrapper {
    order: 2;
  }

  .header-menu .theme-toggle {
    order: 3;
  }

  .header-menu .burger-menu {
    order: 4;
  }

  .search-trigger-mobile {
    display: flex;
  }

  .search-input {
    display: none;
  }

  .search-icon {
    display: none;
  }

  .nav-menu {
    display: none;
    position: static;
    width: 100%;
    flex-direction: column;
    gap: 0;
    margin-top: 0.5rem;
    margin-right: 0;
    order: 5;
    background: var(--bg-second);
    border-radius: var(--border-15);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 1300;
    overflow: hidden;
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-menu a {
    min-height: 44px;
    padding: 0.75rem 1rem;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-menu a:last-child {
    border-bottom: none;
  }

  .burger-menu {
    display: flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  .theme-toggle {
    min-width: 44px;
    min-height: 44px;
  }

  .releases-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 160px));
    gap: 1rem;
    justify-content: start;
  }

  .catalog-release-row {
    grid-template-columns: 1fr;
    justify-items: stretch;
    padding: 0;
  }

  .catalog-release-row__main {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding: 1rem 1rem 1.125rem;
    gap: 0.5rem;
  }

  .catalog-release-row__head-text,
  .catalog-release-row__watch,
  .catalog-release-row__meta,
  .catalog-release-row__lower {
    grid-column: unset !important;
    grid-row: unset !important;
    width: 100%;
    justify-self: unset !important;
    align-self: unset !important;
  }

  /* Широкие карточки: порядок — заголовок → мета → описание → «Смотреть» под текстом */
  .catalog-release-row__head-text {
    order: 1;
  }

  .catalog-release-row__meta {
    order: 2;
  }

  .catalog-release-row__lower {
    order: 3;
  }

  .catalog-release-row__media {
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--border-15) var(--border-15) 0 0;
  }

  :root.light .catalog-release-row__media {
    background: rgba(13, 16, 20, 0.05);
  }

  /* Постер без обрезки (целиком), ограничение по высоте экрана */
  .catalog-release-row__poster {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: min(76vh, 520px);
    min-height: 0;
    aspect-ratio: auto;
    object-fit: contain;
    display: block;
  }

  .catalog-release-row__lower {
    margin-top: 0.25rem;
    margin-bottom: 0;
  }

  /* «Смотреть» под описанием, на всю ширину */
  .catalog-release-row__watch {
    order: 4;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    white-space: normal;
    margin-top: 0.35rem;
    text-align: center;
  }

  .catalog-sort-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .catalog-sort-controls .ts-wrapper {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .new-releases-controls {
    display: none !important;
  }

  .new-releases .swiper-container {
    margin: 0;
    width: 100%;
  }

  .new-releases .swiper-slide {
    width: auto !important;
  }

  .new-releases .swiper-slide .release-card {
    width: 170px;
    min-width: 170px;
    max-width: 170px;
  }
  
  .release-card {
    max-width: 160px;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }
}

@media (max-width: 768px) {
  .seasons-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }
  
  .season-poster {
    height: 220px;
  }
  
  .season-info {
    padding: 0.75rem;
  }
  
  .season-title {
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {
  .release-header {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .release-poster-large {
    max-width: 250px;
    margin: 0 auto;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  
  .lightbox-prev,
  .lightbox-next {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    font-size: 24px;
  }
  
  .lightbox-prev {
    left: 10px;
  }
  
  .lightbox-next {
    right: 10px;
  }
  
  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    font-size: 28px;
  }

  .release-rating-item {
    gap: 0.25rem;
  }

  .rating-pandas {
    font-size: 1.1rem;
  }
}

@media (max-width: 768px) {
  .container.login-container {
    margin: 1.5rem auto;
    padding: 0 1rem;
  }

  .profile-avatar-img,
  .profile-avatar-placeholder {
    width: 150px;
    height: 150px;
  }

  .profile-card {
    padding: 1.5rem;
  }

  .profile-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 0.5rem;
  }

  .profile-tabs::-webkit-scrollbar {
    height: 4px;
  }

  .profile-tab {
    flex-shrink: 0;
  }

  .edit-profile-modal-content {
    margin: 1rem;
    padding: 1.5rem;
  }

  .edit-profile-modal-close {
    min-width: 44px;
    min-height: 44px;
  }

  .edit-profile-modal .btn-submit,
  .edit-profile-modal .btn-cancel {
    min-height: 44px;
  }
}

@media (max-width: 768px) {
  .catalog-filters-modal {
    padding: 1rem 0.75rem;
  }

  .catalog-filters-modal-content {
    max-height: 90vh;
    padding: 1.5rem;
  }

  .catalog-sort-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .release-title-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .bookmark-container {
    width: 100%;
  }
  
  .bookmark-btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }
  
  .bookmark-menu {
    right: auto;
    left: 0;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .bookmarks-filters {
    gap: 0.5rem;
  }
  
  .bookmark-filter {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
  }
}

@media (max-width: 768px) {
  .team-members {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  
  .about-social {
    flex-direction: column;
  }
  
  .about-social .social-link {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .user-panel-container {
    padding: 0.5rem 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem;
  }

  .userbar {
    gap: 1rem;
    padding: 0.5rem;
    min-width: 0;
    flex-shrink: 1;
  }

  .userbar a {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
  }

  .userbar .us-ic {
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.85rem;
  }

  .avatar {
    width: 52px;
    height: 52px;
    border-radius: 18px;
  }

  .login-button,
  .register-button {
    padding: 0.4rem 0.75rem;
  }

  .login-button svg,
  .register-button svg {
    width: 16px;
    height: 16px;
  }

  .header-menu {
    padding: 0.75rem;
  }

  .logo img {
    min-width: 28px;
  }

  .releases-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    justify-content: start;
  }

  .new-releases .swiper-slide .release-card {
    width: 145px;
    min-width: 145px;
    max-width: 145px;
  }
  
  .release-card {
    max-width: 100%;
  }

  .release-title {
    font-size: 0.8rem;
    padding: 0.5rem;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

@media (max-width: 480px) {
  .profile-avatar-img,
  .profile-avatar-placeholder {
    width: 120px;
    height: 120px;
  }

  .profile-avatar-placeholder {
    font-size: 2.5rem;
  }
}

@media (max-width: 400px) {
  .login-form-container .verify-code-group .verify-code-digit,
  .verify-code-digit {
    width: 2.5rem !important;
    min-width: 2.5rem;
    max-width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
  }
  .verify-code-group .verify-code-digits {
    gap: 0.35rem;
  }
}

@media (max-width: 768px) {
  .search-modal {
    z-index: 1400;
  }
}

@media (min-width: 640px) {
  .search-modal-content {
    max-width: 42rem;
    margin: 1rem;
  }
}


