/* ==========================================================================
   0) БАЗА И ПЕРЕМЕННЫЕ
   ========================================================================== */
:root {
  /* Цвета */
  --bg: #2a2a4b;
  --bg-2: #3a3a5c;
  --card: rgba(25, 25, 45, 0.6);
  --text: #e0e0e0;
  --muted: #a0a0b8;
  --accent: #d8c8a8;
  --border: #4a4a6c;

  /* Тени и скругления */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, .15);
  --shadow-md: 0 4px 15px rgba(0, 0, 0, .2);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .25);
  --radius: 12px;

  /* Размеры/шкалы */
  --container: 1280px;
  --px: 20px;
  --px-m: 16px;
  --s-0: 0;
  --s-1: 6px;
  --s-2: 10px;
  --s-3: 14px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 30px;
  --s-8: 40px;

  --ff: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Бокс‑модель */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Контейнер */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--px);
  padding-block: var(--s-6);
}

/* Утилиты */
.text-center {
  text-align: center;
}

.hidden {
  display: none !important;
}

/* Кастомный скроллбар */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #bdc3c7;
  border-radius: 10px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: #95a5a6;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #bdc3c7 var(--bg);
}

/* База */
html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--ff);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #2a2a4b;
  background-image: url('/css/sakura_top.webp');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Главный контент (glass‑контейнер) */
main.container {
  background-color: rgba(30, 30, 50, .55);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 16px;
  /*padding: 30px;*/

  margin-bottom: 40px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .3);
}

/* Sticky исправления */
body,
html,
.wrapper,
.main-container,
.page-content {
  overflow: visible !important;
}


/* ==========================================================================
   1) ХЕДЕР И НАВИГАЦИЯ (glass)
   ========================================================================== */
.header {
  background: rgba(25, 25, 45, .5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  position: sticky;
  top: 0;
  z-index: 1001;
  padding: 12px 0;
  box-shadow: none;
  margin-bottom: 25px;
}

.header .container {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-block: 0;
}

.header .logo {
  margin-top: -48px;
  margin-bottom: -48px;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  text-decoration: none;
}

/* Ищем это правило */
.header .logo img {
  height: 135px;
  /* <-- ЗАДАЕМ НУЖНЫЙ БОЛЬШОЙ РАЗМЕР */
  width: auto;
  opacity: .9;
  transition: opacity .2s;
}

.header .logo:hover img {
  opacity: 1;
}

/* Навигация (ПК) */
.main-nav {
  display: flex;
  align-items: center;
  /*gap: 10px;*/
  /*margin-left: 20px;*/
}

.main-nav a {
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 14px;
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid transparent;
  transition: all .2s;
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--accent);
  color: #292842;
  border-color: var(--accent);
}

/* Мега‑меню */
.nav-item.has-dropdown {
  position: relative;
}

.mega-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 650px;
  background: rgba(44, 48, 52, .95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid #495057;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  padding: 25px 30px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity .3s, transform .3s, visibility .3s;
}

.has-dropdown:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mega-menu.simple-dropdown {
  width: auto;
  min-width: 250px;
  grid-template-columns: 1fr;
  padding: 15px 20px;
  gap: 10px;
}

.mega-menu.simple-dropdown .mega-menu-column {
  width: 100%;
}

.mega-menu.simple-dropdown .mega-menu-list {
  gap: 5px;
}

.mega-menu-title {
  margin: 0 0 15px;
  font-size: 1.1em;
  font-weight: 700;
  color: var(--accent);
  padding-bottom: 10px;
  border-bottom: 1px solid #495057;
}

.mega-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mega-menu-list a {
  color: #ced4da;
  padding: 6px 10px;
  border-radius: 5px;
  text-decoration: none;
  transition: .2s;
}

.mega-menu-list a:hover {
  color: #fff;
  background: var(--accent);
}

/* Поиск */
.search-container {
  flex: 1 1 auto;
  max-width: 400px;
  margin-left: auto;
  position: relative;
}

.search-form {
  display: flex;
}

#live-search-input {
  width: 100%;
  height: 38px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px 45px 10px 20px;
}

#live-search-input::placeholder {
  color: var(--muted);
}

.search-form button {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  height: 30px;
  width: 30px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s;
}

.search-form button:hover {
  color: var(--accent);
}

/* Блок пользователя */
.user-auth-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-profile-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}

.user-avatar-small {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.btn-logout {
  font-size: .9em;
  color: var(--muted);
  text-decoration: none;
}

.btn-logout:hover {
  color: var(--accent);
}


/* ======================================== */
/* СТИЛИ ДЛЯ ИКОНКИ УВЕДОМЛЕНИЙ В HEADER    */
/* ======================================== */

/* Контейнер-ссылка для иконки */
.notification-badge {
  position: relative;
  /* Необходимо для позиционирования счетчика */
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  /* Цвет иконки (подберите под ваш дизайн) */
  text-decoration: none;
  padding: 8px;
  /* Увеличиваем область клика */
  margin-left: 5px;
  transition: color 0.2s ease;
}

.notification-badge:hover {
  color: var(--accent);
  /* Цвет при наведении */
}

/* Сама иконка колокольчика */
.notification-badge .fa-bell {
  font-size: 1.2rem;
  /* Размер иконки */
}

/* Красный кружок-счетчик уведомлений */
.notification-badge .badge-count {
  position: absolute;
  top: 2px;
  right: 2px;

  min-width: 18px;
  height: 18px;
  padding: 2px;
  border-radius: 50%;

  background-color: #e74c3c;
  /* Ярко-красный */
  color: white;
  font-size: 11px;
  font-weight: 700;

  /* Центрирование цифры внутри кружка */
  display: flex;
  align-items: center;
  justify-content: center;

  /* Рамка в цвет фона шапки для эффекта "вырезанности" */
  border: 2px solid #2a2a4b;
  /* <-- Укажите здесь цвет фона вашей шапки! */

  /* Изначально скрыт, JS будет его показывать */
  display: none;
}


/* --- 2. Упоминания @username в тексте комментария --- */
.comment-content .comment-mention {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  background-color: rgba(216, 200, 168, 0.1);
  padding: 2px 6px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.comment-content .comment-mention:hover {
  background-color: rgba(216, 200, 168, 0.2);
  text-decoration: none;
}

/* --- 3. Кнопка "Упомянуть" (@) под комментарием --- */
.comment-footer .mention-btn {
  color: var(--muted);
  text-decoration: none;
  font-size: 1.1em;
  font-weight: bold;
  display: inline-block;
  transition: color 0.2s ease, transform 0.2s ease;
  margin-left: 10px;
}

.comment-footer .mention-btn:hover {
  color: var(--accent);
  transform: scale(1.2);
}

/* Мобильное меню */
.mobile-menu-toggle,
.mobile-nav-panel,
.mobile-menu-overlay {
  display: none;
}

@media (max-width: 992px) {
  .header .container {
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 15px;
  }

  .main-nav {
    display: none;
  }

  /* прячем ПК‑навигацию */
  .mobile-menu-toggle,
  .mobile-nav-panel,
  .mobile-menu-overlay {
    display: block;
  }

  .mobile-menu-toggle {
    background: none;
    border: none;
    color: #ced4da;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    z-index: 1003;
    order: 3;
  }

  .mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility .3s;
  }

  .mobile-nav-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    max-width: 80%;
    height: 100%;
    background-color: #1f1f3a;
    z-index: 1002;
    padding: 20px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform .3s ease-in-out;
    box-shadow: -5px 0 20px rgba(0, 0, 0, .4);
  }

  body.mobile-menu-open .mobile-nav-panel {
    transform: translateX(0);
  }

  body.mobile-menu-open .mobile-menu-overlay {
    opacity: 1;
    visibility: visible;
  }

  body.mobile-menu-open {
    overflow: hidden;
  }

  .mobile-nav-panel .mobile-user-auth {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
  }

  .mobile-nav-panel .btn-primary,
  .mobile-nav-panel .btn-secondary {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px;
    margin-top: 10px;
  }

  .mobile-nav-panel .btn-secondary {
    background: var(--bg-2);
    color: var(--text);
  }

  .mobile-nav-panel .btn-primary {
    background: var(--accent);
    color: #2a2a4b;
  }

  .mobile-nav-panel .mobile-main-links a {
    display: block;
    color: var(--text);
    text-decoration: none;
    font-size: 1.1rem;
    padding: 15px 10px;
    border-radius: 6px;
    transition: background-color .2s;
  }

  .mobile-nav-panel .mobile-main-links a:hover {
    background-color: rgba(255, 255, 255, .05);
  }
}


/* ==========================================================================
   2) КНОПКИ
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 1em;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, background-color .2s, opacity .2s;
}

.btn-primary {
  background: var(--accent);
  color: #2a2a4b;
}

.btn-primary:hover {
  opacity: .95;
  box-shadow: 0 4px 15px rgba(0, 0, 0, .25);
}

.btn-secondary {
  background: var(--bg-2);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn.is-favorite {
  background: #27ae60;
  color: #fff;
  border-color: #27ae60;
}

.btn.is-favorite:hover {
  background: #2ecc71;
}


/* ==========================================================================
   3) КАРТОЧКИ И СПИСКИ
   ========================================================================== */
.anime-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 16px;
}

.anime-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  box-shadow: none;
}

.anime-item:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.anime-item a {
  color: inherit;
  text-decoration: none;
  display: block;
}

.anime-item .poster {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
}

.anime-item .poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
  aspect-ratio: auto;
  /* управляем соотношением на контейнере */
}

.anime-item:hover .poster img {
  transform: scale(1.05);
}

.anime-item .title {
  padding: 12px 14px;
  font-weight: 500;
  text-align: left;
  flex-grow: 1;
  color: var(--text);
}

/* Оверлеи/метки на постере */
.anime-item .info-overlay {
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.anime-item .info-overlay .info-tag {
  background-color: rgba(0, 0, 0, .75);
  color: #fff;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: .8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.anime-item .info-overlay .fa-star {
  color: #ffc107;
}

/* Дата следующей серии */
.anime-item .next-episode-info {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, .9), transparent);
  color: #fff;
  text-align: center;
  padding: 16px 5px 6px;
  font-size: .8rem;
  font-weight: 500;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, .8);
  pointer-events: none;
  box-sizing: border-box;
}


/* ==========================================================================
   4) ГЛАВНАЯ: СЕКЦИИ, ВЕРХНИЙ БЛОК, БЫСТРЫЕ ССЫЛКИ
   ========================================================================== */
.home-section {
  padding-block: var(--s-7);
  border-top: 1px solid var(--border);
}

.home-section:first-child {
  border-top: none;
  padding-top: 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 1.8em;
  margin: 0;
  color: #fff;
  font-weight: 700;
}

.view-all-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.view-all-link:hover {
  color: var(--accent);
}

/* Верхний блок: карусель + виджет */
.home-top-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
}

@media (max-width: 992px) {
  .home-top-grid {
    grid-template-columns: 1fr;
    gap: var(--s-5);
  }
}

/* Виджет расписания */
.anime-schedule-widget {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-5);
  box-shadow: var(--shadow-md);
}

.schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--border);
}

.schedule-header h3 {
  margin: 0;
  font-weight: 700;
  font-size: 1.2em;
}

.schedule-list {
  display: flex;
  flex-direction: column;
}

.schedule-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bg-2);
}

.schedule-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.schedule-item-poster {
  width: 50px;
  height: 70px;
  flex-shrink: 0;
  display: block;
}

.schedule-item-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.schedule-item-info {
  flex: 1 1 auto;
  min-width: 0;
}

.schedule-item-info .title {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.schedule-item-info .title:hover {
  color: var(--accent);
}

.schedule-item-info .time {
  font-size: .9em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Быстрые ссылки */
.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s-4);
  justify-items: center;
}

.quick-link-card {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  color: var(--accent);
  text-decoration: none;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-5);
  font-size: 1.1em;
  font-weight: 500;
  transition: .2s;
}

.quick-link-card:hover {
  background: var(--accent);
  color: #2a2a4b;
  border-color: var(--accent);
  box-shadow: 0 5px 15px rgba(0, 0, 0, .2);
  transform: translateY(-3px);
}


/* ==========================================================================
   5) КАРУСЕЛЬ Swiper («Сейчас на экранах»)
   ========================================================================== */
.home-section.ongoing-section {
  overflow: hidden;
}

.ongoing-carousel.swiper {
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  padding: 5px 0;
}

.ongoing-carousel .swiper-wrapper {
  align-items: stretch;
  justify-content: flex-start;
  margin: 0;
}

.ongoing-carousel .swiper-slide {
  width: 160px;
  flex-shrink: 0;
  padding: 0;
}

.ongoing-carousel .anime-item {
  margin: 0;
}

.ongoing-carousel .anime-item .poster {
  aspect-ratio: 2/3;
}

@media (max-width: 768px) {
  .ongoing-carousel .swiper-slide {
    width: 140px;
  }
}

@media (max-width: 390px) {
  .ongoing-carousel .swiper-slide {
    width: 132px;
  }
}


/* ==========================================================================
   6) КАТАЛОГ
   ========================================================================== */
.catalog-grid {
  display: flex;
  flex-direction: row;
  gap: 24px;
  align-items: flex-start;
}

.catalog-results {
  flex-grow: 1;
  min-width: 0;
}

.catalog-sidebar {
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: var(--s-5);
}

@media (min-width: 992px) {
  .catalog-sidebar {
    position: -webkit-sticky;
    position: sticky;
    top: 20px;
  }
}

@media (max-width: 991px) {
  .catalog-grid {
    align-items: stretch;
  }

  /* Портретный режим: фильтры снизу, все на 100% ширины */
  @media (orientation: portrait) {
    .catalog-grid {
      flex-direction: column-reverse;
    }

    .catalog-sidebar {
      width: 100%;
      position: static;
    }
  }

  /* Ландшафтный режим: фильтры сбоку, как на десктопе */
  @media (orientation: landscape) {
    .catalog-grid {
      flex-direction: row;
    }

    .catalog-sidebar {
      width: 280px;
      flex-shrink: 0;
      position: sticky;
      top: 10px;
      /* Минимальный отступ сверху */
      max-height: calc(100vh - 20px);
      overflow-y: auto;
      scrollbar-width: thin;
      padding-bottom: 20px;
    }

    .catalog-results {
      flex: 1;
    }
  }
}

.filter-block {
  margin-bottom: var(--s-5);
}

.filter-block:last-child {
  margin-bottom: 0;
}

.filter-title {
  margin: 0 0 10px;
  font-size: 1.1em;
  font-weight: 700;
}

.search-input,
.select-input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: transparent;
  color: var(--text);
}

.genre-list {
  max-height: 250px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}

.checkbox-label,
.radio-label {
  display: block;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: .95em;
}

.filter-button,
.reset-button {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 700;
  text-align: center;
  display: block;
  cursor: pointer;
}

.filter-button {
  background: var(--accent);
  color: #2a2a4b;
  border: none;
  margin-bottom: 10px;
}

.reset-button {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

/* Сворачиваемый фильтр (моб.) */
.filter-toggle-button {
  display: none;
}

@media (max-width: 991px) {
  .filter-toggle-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 500;
    background: var(--bg-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
  }

  .filter-toggle-button .fas {
    transition: transform .3s;
  }

  .filter-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s ease-out, padding .4s ease-out, margin .4s ease-out;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 0 16px;
    margin-top: -1px;
  }

  /* В ландшафтном режиме на мобилках сразу показываем фильтры и убираем кнопку развертывания */
  @media (orientation: landscape) {
    .filter-toggle-button {
      display: none !important;
    }

    .filter-content {
      max-height: none !important;
      overflow: visible !important;
      padding: 16px !important;
      border-top: 1px solid var(--border) !important;
      border-radius: 8px !important;
      margin-top: 0 !important;
    }
  }

  .catalog-sidebar.is-open .filter-content {
    max-height: 3000px;
    padding: 16px;
  }

  .catalog-sidebar.is-open .filter-toggle-button {
    border-radius: 8px 8px 0 0;
  }

  .catalog-sidebar.is-open .filter-toggle-button .fas {
    transform: rotate(180deg);
  }
}

/* Бесконечная подгрузка */
#catalog-loading,
#catalog-end {
  text-align: center;
  color: var(--muted);
  padding: var(--s-4);
}


/* ==========================================================================
   7) СТРАНИЦА ОДНОГО АНИМЕ
   ========================================================================== */
.anime-page-container {
  margin: 0;
  --s-6: 24px;
}

.anime-title-header {
  padding: var(--s-6) 0;
  margin-bottom: var(--s-6);
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.anime-title-header h1 {
  margin: 0;
  font-size: 1.8em;
  font-weight: 700;
  color: #fff;
}

.anime-original-title {
  margin: 6px 0 0;
  font-size: 1.05em;
  color: var(--muted);
}

.anime-main-info-grid {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: var(--s-7);
}

@media (max-width: 768px) {
  .anime-main-info-grid {
    grid-template-columns: 1fr;
    gap: var(--s-5);
  }
}

.anime-sidebar-left .poster-block img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
}

.action-buttons {
  margin-top: var(--s-4);
  display: grid;
  gap: 10px;
}

@media (max-width: 768px) {

  /* Здесь уже есть ваши стили для мобильных, например: */
  .anime-main-info-grid {
    grid-template-columns: 1fr;
    gap: var(--s-5);
  }

  /* ДОБАВЬТЕ ЭТОТ БЛОК ВНУТРЬ МЕДИА-ЗАПРОСА: */
  .anime-sidebar-left .poster-block img {
    display: block;
    margin-left: auto;
    margin-right: auto;

    /* 
      Вы можете использовать проценты, но фиксированная ширина 
      часто выглядит лучше на разных мобильных экранах. 
      Выберите один из вариантов ниже.
    */

    /* Вариант А: Фиксированная ширина (рекомендуется) */
    width: 300px;
    /* Например, 300px */
    max-width: 80%;
    /* Ограничитель, чтобы на очень узких экранах постер не вылезал за края */

    /* Вариант Б: Ваша ширина в процентах */
    /* width: 80%; */
  }
}

/* Мета‑инфо */
.anime-meta-block {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.meta-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.meta-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.meta-section.full-width {
  align-items: flex-start;
}

.meta-section.full-width .meta-label {
  margin-bottom: 8px;
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.meta-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .95em;
  color: var(--muted);
}

.meta-label i {
  width: 16px;
  text-align: center;
}

.meta-value {
  font-size: 1em;
  font-weight: 500;
  text-align: right;
}

.meta-value.score {
  font-weight: 700;
  font-size: 1.1em;
  color: var(--accent);
}

.status-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: .9em;
  font-weight: 600;
}

.status-tag.status-вышел {
  background: #e9ecef;
  color: #495057;
}

.status-tag.status-онгоинг {
  background: #d1ecf1;
  color: #0c5460;
  animation: pulse 2s infinite;
}

.status-tag.status-анонс {
  background: #fff3cd;
  color: #856404;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(12, 84, 96, .4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(12, 84, 96, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(12, 84, 96, 0);
  }
}

.genres-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.genre-tag {
  background: rgba(255, 255, 255, .15);
  color: #e0e0e0;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: .9em;
  font-weight: 500;
  text-decoration: none;
  transition: background-color .2s, color .2s;
  border: none;
}

.genre-tag:hover {
  background: rgba(255, 255, 255, .3);
  color: #fff;
  transform: translateY(-1px);
}

/* Описание */
.description-section {
  margin-top: var(--s-6);
}

.description-section h3 {
  margin: 0 0 12px;
  font-size: 1.5em;
  color: #fff;
}

.anime-description {
  font-size: 1.05em;
  line-height: 1.7;
  color: var(--text);
}

.anime-description a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.anime-description a:hover {
  text-decoration: underline;
}

/* Пользовательский рейтинг */
.user-rating-block .rating-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rating-btn {
  background: none;
  border: 1px solid var(--border);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--muted);
  transition: .2s;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.rating-btn:hover {
  background: var(--bg-2);
  color: var(--text);
}

.rating-btn.rating-up:hover {
  color: #27ae60;
  border-color: #27ae60;
}

.rating-btn.rating-down:hover {
  color: #e74c3c;
  border-color: #e74c3c;
}

.user-score {
  font-weight: 700;
  font-size: 1.1em;
  min-width: 25px;
  text-align: center;
}

/* Рекомендации в конце */
.recommendations-section {
  padding: var(--s-5);
  margin-top: var(--s-6);
}

@media (max-width: 767px) {
  .recommendations-section .anime-list {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}


/* ==========================================================================
   8) ПЛЕЕР
   ========================================================================== */
.player-area {
  margin: 20px 0;
}

.player-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  background: #000;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.player-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player-controls {
  margin-top: 15px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.player-controls .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.player-controls #pip-button:not(.supported) {
  display: none;
}

@media (max-width: 767px) {
  .player-controls {
    display: none;
  }

  .player-container {
    padding-bottom: 0;
    height: 320px;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .12);
  }
}


/* ==========================================================================
   9) СТРАНИЦА «РАСПИСАНИЕ»
   ========================================================================== */

.schedule-container h1 {
  text-align: center;
  margin: 0 0 var(--s-6);
  font-size: 2.1em;
  color: #fff;
}

.schedule-day {
  margin-bottom: var(--s-5);
}

.schedule-day:last-child {
  margin-bottom: 0;
}

.day-title {
  background: var(--accent);
  color: #2a2a4b;
  padding: 10px 15px;
  border-radius: 8px;
  margin: 0 0 15px;
  font-size: 1.2em;
  text-align: center;
  letter-spacing: 1px;
}

.release-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.release-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 10px;
  border-bottom: 1px solid var(--bg-2);
  transition: background .2s;
}

.release-list li:hover {
  background: var(--bg);
}

.release-list li:last-child {
  border-bottom: none;
}

.release-title {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.release-title:hover {
  color: var(--accent);
}

.release-time {
  font-weight: 600;
  color: var(--accent);
  background: var(--bg);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: .9em;
}

.no-releases {
  color: #95a5a6;
  text-align: center;
  padding: 15px;
  font-style: italic;
}


/* ==========================================================================
   10) ПРОФИЛЬ И АВТОРИЗАЦИЯ
   ========================================================================== */
.auth-container {
  max-width: 400px;
  margin: 40px auto;
  padding: 30px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.auth-container h1 {
  text-align: center;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1em;
  background: transparent;
  color: var(--text);
}

.auth-container p {
  text-align: center;
  margin-top: 20px;
  color: var(--muted);
}



.profile-grid {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 30px;
  margin-top: 20px;
}

.profile-sidebar {
  background: var(--card);
  
  border-radius: var(--radius);
  text-align: center;
}

.profile-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 20px;
  border: 4px solid var(--card);
  box-shadow: var(--shadow-md);
}

.avatar-form label {
  display: block;
  margin-bottom: 10px;
  font-weight: 500;
  cursor: pointer;
}

.avatar-form input[type="file"] {
  display: none;
}

.avatar-form .btn {
  width: 100%;
  margin-top: 10px;
}

.profile-sidebar h3 {
  margin-top: 30px;
  text-align: left;
}

.profile-sidebar form {
  text-align: left;
}

.profile-content {
  background: var(--card);

  border-radius: var(--radius);
}

.alert {
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 8px;
}

.alert.success {
  background-color: #d4edda;
  color: #155724;
}

.alert.error {
  background-color: #f8d7da;
  color: #721c24;
}

@media (max-width: 768px) {
  .profile-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .profile-avatar {
    width: 120px;
    height: 120px;
  }

  .profile-content .anime-list {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .profile-content .anime-item .title {
    font-size: 13px;
    padding: 8px;
  }
}

@media (max-width: 420px) {
  .profile-content .anime-list {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ==========================================================================
   11) КОММЕНТАРИИ
   ========================================================================== */
.comment-form-container {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  
}

#comment-form {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#comment-form textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1em;
  margin-bottom: 10px;
  resize: vertical;
  background: transparent;
  color: var(--text);
}

.comments-list {
  margin-top: 20px;
}

.comment {
  display: flex;
  gap: 15px;
  align-items: flex-start;
}

.comment-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.comment-body {
  flex-grow: 1;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}

.comment-author {
  font-weight: 700;
  /* Оставляем жирный шрифт */
  color: var(--text);
  /* ✅ ЗАДАЕМ ОСНОВНОЙ ЦВЕТ ТЕКСТА (например, белый/светло-серый) */
  text-decoration: none;
  /* ✅ УБИРАЕМ СИНЕЕ ПОДЧЕРКИВАНИЕ */
  transition: color 0.2s ease;
  /* Добавляем плавный переход для эффекта при наведении */
}

.comment-author:hover {
  color: var(--accent);
  /* ✅ ПРИ НАВЕДЕНИИ красим в акцентный цвет сайта */
  text-decoration: underline;
  /* ✅ ВОЗВРАЩАЕМ подчеркивание при наведении для понятности */
}

.comment-date {
  font-size: .85em;
  color: var(--muted);
}

.comment-content {

  color: #f0f0f0;
}

.comment-footer {
  display: flex;
  align-items: center;
}

.comment-voting {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .9em;
}

.comment-vote-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1.1em;
  padding: 5px;
}

.comment-vote-btn:hover {
  color: var(--text);
}

.comment-vote-btn.active.up {
  color: #27ae60;
}

.comment-vote-btn.active.down {
  color: #e74c3c;
}

.comment-votes-sum {
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

.reply-btn {
  font-size: .9em;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.reply-btn:hover {
  text-decoration: underline;
}

.comment-thread {
  margin-bottom: 20px;
}

.comment-replies {
  border-left: 2px solid var(--border);
  
}


/* ======================================== */
/*  СТИЛИЗАЦИЯ ВЫПАДАЮЩЕГО СПИСКА (SELECT)  */
/* ======================================== */

/* --- Стили для самого контейнера <select> --- */
select.form-control {
  /* Внешний вид */
  -webkit-appearance: none;
  /* Убираем стандартный вид в Chrome/Safari */
  -moz-appearance: none;
  /* Убираем стандартный вид в Firefox */
  appearance: none;
  /* Убираем стандартный вид в современных браузерах */

  background-color: var(--bg-2);
  /* Темный фон, как у других элементов */
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 30px 8px 12px;
  /* Добавляем место справа для своей стрелки */
  cursor: pointer;

  /* Цвет текста */
  color: var(--text);
  /* Светлый цвет текста для самого <select> */
  font-size: 14px;
  font-weight: 500;

  /* Добавляем свою стрелку */
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23a0a0b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;

  transition: border-color 0.2s ease;
}

select.form-control:hover {
  border-color: var(--accent);
  /* Подсветка при наведении */
}

/* --- Стили для опций <option> внутри списка --- */
select.form-control option {
  background-color: var(--bg-2);
  /* Темный фон для выпадающего списка */
  color: var(--text);
  /* Светлый цвет текста для опций */
  padding: 10px;
  /* Добавляем немного "воздуха" */
}



/* ======================================== */
/*    УВЕДОМЛЕНИЯ В МОБИЛЬНОМ МЕНЮ         */
/* ======================================== */

.mobile-user-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Размещает элементы по краям */
  margin-bottom: 10px;
}

/* Ссылка-контейнер для мобильной иконки */
.notification-badge-mobile {
  position: relative;
  color: var(--text-muted);
  font-size: 1.5rem;
  /* Делаем иконку крупнее для удобства нажатия */
  padding: 8px;
  text-decoration: none;
}

/* Красный кружок-счетчик */
.notification-badge-mobile .badge-count {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 20px;
  height: 20px;
  font-size: 12px;

  /* Остальные стили копируем от десктопной версии */
  background-color: #e74c3c;
  color: white;
  border-radius: 50%;
  font-weight: 700;
  display: none;
  /* JS будет управлять видимостью */
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
  /* Цвет фона мобильного меню */
}


/* ======================================== */
/*  ИНДИКАТОР УВЕДОМЛЕНИЙ НА МОБИЛЬНОМ МЕНЮ */
/* ======================================== */

/* Делаем саму кнопку-гамбургер относительной, чтобы позиционировать кружок внутри нее */
.mobile-menu-toggle {
  position: relative;
}

/* Стили для самого кружка-индикатора */
.mobile-menu-toggle .badge-count {
  position: absolute;
  top: 0;
  right: 0;

  /* Уменьшаем размер, чтобы он выглядел как точка, а не счетчик */
  width: 10px;
  height: 10px;

  background-color: #e74c3c;
  /* Красный цвет */
  border-radius: 50%;

  /* Рамка для эффекта "вырезанности" */
  border: 2px solid var(--bg);
  /* Используйте цвет фона вашего мобильного хедера */

  /* Изначально скрыт */
  display: none;
}


/* ==========================================================================
   12) ОБНОВЛЕНИЯ / АНОНСЫ (приведено к тёмной теме)
   ========================================================================== */
.updates-widget {
  background: var(--card);
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.updates-widget .section-header {
  margin-bottom: 15px;
}

.updates-widget .section-title {
  font-size: 1.2rem;
  color: #fff;
}

.updates-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.update-item a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  transition: background-color .2s, transform .2s, border-color .2s;
}

.update-item a:hover {
  background-color: var(--bg-2);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.update-title {
  font-weight: 500;
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 10px;
}

.update-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.update-score {
  font-size: .85rem;
  color: var(--muted);
}

.update-score .fa-star {
  color: #f9ca24;
}

.update-badge {
  background-color: #e53935;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

/* Анонсы (без даты слева — выравниваем) */
.content-block-v2 .list-item {
  gap: 0;
}

.content-block-v2 .list-item .item-link {
  padding-left: 70px;
}

.details-announcement {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.year-badge {
  font-size: .85rem;
  color: var(--muted);
  flex-shrink: 0;
}

.genre-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.genre-tags .genre-tag {
  background-color: var(--bg-2);
  color: var(--text);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: .75em;
  font-weight: 500;
}

@media (max-width: 480px) {
  .content-block-v2 .list-item .item-link {
    padding-left: 0;
  }

  .details-announcement {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}


/* ==========================================================================
   13) БЫСТРАЯ СОРТИРОВКА
   ========================================================================== */
.quick-sort-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  margin-top: -10px;
  flex-wrap: wrap;
}

.quick-sort-filters a {
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  background-color: var(--bg-2);
  color: var(--text);
  font-size: .9rem;
  transition: background-color .2s, color .2s, border-color .2s;
  border: 1px solid var(--border);
}

.quick-sort-filters a:hover {
  background-color: var(--border);
}

.quick-sort-filters a.active {
  background-color: var(--accent);
  color: #2a2a4b;
  font-weight: 700;
}


/* ==========================================================================
   14) КОМНАТЫ И ЧАТ — финальная версия
   ========================================================================== */
.discussion-section {
  background: transparent;
  padding: 0;
  margin-top: 30px;
  border: none;
}

.discussion-section .description-header {
  margin-bottom: 20px;
}

.watch-party-controls {
  margin-bottom: 25px;
}

.active-rooms-header {
  font-size: 1.1em;
  font-weight: 600;
  color: #343a40;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e9ecef;
}

.active-rooms-header i {
  margin-right: 8px;
  color: #6c757d;
}

.room-list-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.room-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fff;
  color: #212529;
  padding: 12px 18px;
  border-radius: 8px;
  border: 1px solid #e1e4e8;
  transition: .2s;
}

.room-item:hover {
  border-color: #0d6efd;
  box-shadow: 0 4px 15px rgba(13, 110, 253, .1);
  transform: translateY(-2px);
}

.room-item-info {
  display: flex;
  flex-direction: column;
}

.room-item-info .room-name {
  color: #212529;
  font-weight: 600;
  margin-bottom: 2px;
}

.room-item-info .host-name {
  color: #6c757d;
  font-size: .9em;
}

/* UI внутри комнаты */
.watch-party-ui-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
}

.room-info {
  padding: 15px 20px;
  background: #fff;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.room-actions {
  display: flex;
  gap: 10px;
}

.chat-and-users {
  display: grid;
  grid-template-columns: 1fr 240px;
  height: 500px;
}

.chat-container {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid #dee2e6;
}

.chat-messages {
  flex-grow: 1;
  padding: 20px;
  gap: 18px;
  overflow-y: auto;
}

.chat-messages:empty::before {
  content: 'Сообщений пока нет. Начните диалог!';
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  color: #adb5bd;
  font-style: italic;
  font-size: .9em;
}

.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.chat-message-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.chat-message-main {
  display: flex;
  flex-direction: column;
}

.chat-message-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.chat-message-header .username {
  font-weight: 600;
  font-size: 1em;
  color: #343a40;
}

.chat-message-header .timestamp {
  font-size: .75em;
  color: #adb5bd;
}

.chat-message-body p {
  margin: 0;
  line-height: 1.5;
  color: #495057;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-input-area {
  padding: 10px 15px;
  border-top: 1px solid #dee2e6;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  gap: 10px;
}

#chat-input {
  flex: 1;
  min-width: 0;
  border-radius: 20px;
  padding: 10px 18px;
  border: 1px solid #ced4da;
  background: #fff;
  transition: .2s;
}

#chat-input:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
  outline: none;
}

#send-chat-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1em;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.user-list-container {
  background: #f8f9fa;
  border: none;
  padding: 15px;
  overflow-y: auto;
}

.user-list-container h4 {
  margin-top: 5px;
  color: #6c757d;
  font-size: .8em;
  text-transform: uppercase;
  letter-spacing: .5px;
}

#user-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#user-list li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 5px;
  transition: background-color .2s;
}

#user-list li:hover {
  background: #f1f3f5;
}

#user-list li.banned-user {
  opacity: .6;
  text-decoration: line-through;
}

#user-list li img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.user-actions {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  gap: 6px;
}

#user-list li:hover .user-actions {
  display: flex;
}

.user-actions button {
  background: #e9ecef;
  border: 1px solid #dee2e6;
  color: #495057;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8em;
  transition: .2s;
}

.user-actions button.kick-btn:hover {
  background: #ffc107;
  color: #fff;
  border-color: #ffc107;
}

.user-actions button.ban-btn:hover {
  background: #dc3545;
  color: #fff;
  border-color: #dc3545;
}

.user-actions button.unban-btn:hover {
  background: #198754;
  color: #fff;
  border-color: #198754;
}

@media (max-width: 800px) {
  .chat-and-users {
    grid-template-columns: 1fr;
    height: auto;
  }

  .user-list-container {
    order: -1;
  }

  .room-info {
    align-items: flex-start;
  }
}


/* ==========================================================================
   15) АДАПТИВ: ОБЩИЕ ПРАВКИ
   ========================================================================== */

/* ≤1024 — компактнее */
@media (max-width: 1024px) {
  .container {
    padding-inline: var(--px);
  }
}

/* ≤992 — мобильная шапка и блоки в столбик уже описаны выше */
@media (max-width: 992px) {

  main.container,
  .header+main.container,
  .header+.container {
    padding-top: 24px;
    ;
  }
}

/* ≤768 — единый мобильный ритм */
@media (max-width: 768px) {
  :root {
    --px-m: 14px;
    --s-4: 14px;
    --s-5: 16px;
    --s-6: 0px;
    --s-7: 24px;
  }

  .container {
    padding-inline: var(--px-m);
    padding-block: var(--s-6);
  }

  .header .container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 15px;
    padding-block: 10px;
  }

  .header .logo {
    margin-top: -20px;
    /* Компенсируем сверху */
    margin-bottom: -20px;
    /* Компенсируем снизу */
  }

  .header .logo img {
    height: 64px;
  }

  .home-section {
    border-top: 1px solid var(--border);
  }

  .section-header {
    margin-bottom: var(--s-4);
  }

  .section-title {
    font-size: 1.5em;
  }

  .quick-links-grid {
    grid-template-columns: 1fr;
  }

  .anime-title-header {
    padding: var(--s-6) var(--px-m);
    margin-bottom: var(--s-5);
  }

  .description-section {
    margin-top: var(--s-5);
  }

  .anime-description {
    font-size: 1rem;
    line-height: 1.7;
    color: #f0f0f0;
  }

  .anime-description strong,
  .description-section h3,
  .anime-title-header h1 {
    color: #fff;
  }

  .search-container {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0;
  }

  #live-search-input {
    background-color: rgba(0, 0, 0, .3);
    height: 38px;
  }

  /* фон прокручиваем для производительности */
  body {
    background-size: 100% auto;
    background-attachment: scroll;
  }
}

/* ≤420 / ≤390 — микро‑адаптация */
@media (max-width: 420px) {
  .profile-content .anime-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 390px) {
  .section-title {
    font-size: 1.125rem;
  }

  .anime-item .title {
    font-size: .8125rem;
  }
}

/* =========================================================
   LIVE SEARCH: аккуратный выпадающий список результатов
   ========================================================= */

.search-container {
  position: relative;
}

/* Контейнер дропдауна — подхватит самые частые варианты разметки */
.search-dropdown,
#search-results,
#live-search-results,
.live-search-results,
.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  background: var(--card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-height: min(70vh, 560px);
  overflow-y: auto;
  padding: 8px;
  z-index: 1200;
  /* поверх контента страницы, внутри z‑контекста header */
}

/* Убираем маркеры списков, выравниваем отступы */
.search-dropdown ul,
#search-results ul,
#live-search-results ul,
.live-search-results ul,
.search-results ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Стиль элемента результата */
.search-dropdown a,
#search-results a,
#live-search-results a,
.live-search-results a,
.search-results a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  line-height: 1.25;
  transition: background-color .15s ease, transform .15s ease;
}

.search-dropdown a:hover,
#search-results a:hover,
#live-search-results a:hover,
.live-search-results a:hover,
.search-results a:hover {
  background: var(--bg-2);
  transform: translateY(-1px);
}

/* Фикс «фиолетовых» посещённых ссылок в выпадающем списке */
.search-dropdown a:visited,
#search-results a:visited,
#live-search-results a:visited,
.live-search-results a:visited,
.search-results a:visited {
  color: var(--text);
}

/* Постер в пункте списка */
.search-dropdown img,
#search-results img,
#live-search-results img,
.live-search-results img,
.search-results img {
  width: 56px;
  height: 84px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

/* Заголовок и мета (если есть отдельные обёртки — подхватим) */
.search-result-title {
  font-weight: 600;
}

.search-result-meta {
  font-size: .85em;
  color: var(--muted);
  margin-top: 2px;
}

/* Мобильная подстройка радиуса/позиции */
@media (max-width: 480px) {

  .search-dropdown,
  #search-results,
  #live-search-results,
  .live-search-results,
  .search-results {
    top: calc(100% + 6px);
    border-radius: 10px;
  }
}


/* =========================================================
   HEADER MOBILE: гамбургер справа, сетка 3 колонки
   ========================================================= */
@media (max-width: 992px) {

  /* Переводим контейнер шапки в grid, чтобы зафиксировать колонки */
  .header .container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    /* Лого | Поиск | Гамбургер */
    align-items: center;
    gap: 15px;
  }

  .header .logo {
    grid-column: 1;
  }

  .header .search-container {
    grid-column: 2;
    min-width: 0;
    /* ВАЖНО: чтобы поиск не ронял гамбургер вниз */
    max-width: 100%;
    margin: 0;
  }

  .header .mobile-menu-toggle {
    grid-column: 3;
    justify-self: end;
    /* прижимаем к правому краю */
    align-self: center;
    margin: 0;
  }
}

/* =========================================================
   LIVE SEARCH: скрыть «второе поле», показать аккуратный список
   ========================================================= */

/* Контейнер поиска должен быть якорем для абсолютного дропдауна */
.search-container {
  position: relative;
}

/* Сам дропдаун (поддержка ваших селекторов) */
.search-dropdown,
#search-results,
#live-search-results,
.live-search-results,
.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  background: var(--card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-height: min(70vh, 560px);
  overflow-y: auto;
  padding: 8px;
  z-index: 1200;
}

/* ВАЖНО: когда контейнер пуст — полностью прячем.
   Это убирает «второе поле» под инпутом. */
.search-dropdown:empty,
#search-results:empty,
#live-search-results:empty,
.live-search-results:empty,
.search-results:empty {
  display: none !important;
  padding: 0;
  border: none;
  box-shadow: none;
}

.search-dropdown[hidden],
#search-results[hidden],
#live-search-results[hidden],
.live-search-results[hidden],
.search-results[hidden] {
  display: none !important;
}

/* Список без маркеров/лишних отступов (если внутри UL) */
.search-dropdown ul,
#search-results ul,
#live-search-results ul,
.live-search-results ul,
.search-results ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Элемент результата */
.search-dropdown a,
#search-results a,
#live-search-results a,
.live-search-results a,
.search-results a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: background-color .15s ease, transform .15s ease;
}

.search-dropdown a:hover,
#search-results a:hover,
#live-search-results a:hover,
.live-search-results a:hover,
.search-results a:hover {
  background: var(--bg-2);
  transform: translateY(-1px);
}

/* Фикс «фиолетовых» ссылок */
.search-dropdown a:visited,
#search-results a:visited,
#live-search-results a:visited,
.live-search-results a:visited,
.search-results a:visited {
  color: var(--text);
}

/* Постер слева */
.search-dropdown img,
#search-results img,
#live-search-results img,
.live-search-results img,
.search-results img {
  width: 56px;
  height: 84px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

/* Текстовая часть справа — не даём ей выталкивать верстку */
.search-dropdown .info,
#search-results .info,
#live-search-results .info,
.live-search-results .info,
.search-results .info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* КЛЮЧ: разрешаем сжиматься внутри flex, чтобы текст не обрезался */
}

/* Заголовок: 2 строки с клипом, перенос длинных слов */
.search-result-title,
.search-dropdown .title,
#search-results .title,
#live-search-results .title,
.live-search-results .title,
.search-results .title {
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  /* до двух строк */
  -webkit-box-orient: vertical;
}

/* Метаданные */
.search-result-meta,
.search-dropdown .meta,
#search-results .meta,
#live-search-results .meta,
.live-search-results .meta,
.search-results .meta {
  margin-top: 2px;
  font-size: .85em;
  color: var(--muted);
}

/* Компактнее на очень узких экранах */
@media (max-width: 480px) {

  .search-dropdown,
  #search-results,
  #live-search-results,
  .live-search-results,
  .search-results {
    top: calc(100% + 6px);
    border-radius: 10px;
  }

  .search-dropdown img,
  #search-results img,
  #live-search-results img,
  .live-search-results img,
  .search-results img {
    width: 48px;
    height: 72px;
  }
}

/* =========================================================
   HEADER MOBILE: справа только гамбургер, логин/выход скрыты
   ========================================================= */
@media (max-width: 992px) {

  /* Фикс раскладки: Лого | Поиск | Гамбургер */
  .header .container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 15px;
  }

  .header .logo {
    grid-column: 1;
  }

  .header .search-container {
    grid-column: 2;
    min-width: 0;
    /* чтобы поиск не «ронял» кнопку вниз */
    max-width: 100%;
    margin: 0;
  }

  .header .mobile-menu-toggle {
    grid-column: 3;
    justify-self: end;
    align-self: center;
    display: inline-flex !important;
  }

  /* Прячем блок пользователя полностью — он есть в самом выпадающем меню */
  .header .user-auth-block {
    display: none !important;
  }
}



/* === ANIVIBE CHAT UI REWORK (v3.0 - Glassmorphism) === */
:root {

  --chat-width-min: 320px;
  --chat-width-max: 560px;
  --vh: 1vh;
}

/* --- ОБЩАЯ СТРУКТУРА И СЕТКА (без изменений) --- */
.watch-grid {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.player-col {
  flex: 1 1 auto;
  min-width: 0;
}

.chat-col {
  display: flex;
  flex-direction: column;
  height: 60vh;
  max-height: 720px;
}

#watch-party-ui {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px;
  overflow: hidden;
}

/* --- КОМПАКТНЫЙ ЗАГОЛОВОК КОМНАТЫ (без изменений) --- */
.room-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border) !important;
  flex-shrink: 0;
}

.room-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.room-info #ui-room-name {
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.room-info .room-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.room-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.room-actions .btn {
  font-size: 0.9rem;

  height: 32px;
  padding: 0;

  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.room-actions .btn .btn-text,
.room-actions .btn span {
  display: none;
}

/* --- СТРУКТУРА ЧАТА И ЯРКОСТЬ СООБЩЕНИЙ (без изменений) --- */
#watch-party-ui .chat-and-users {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-input-area {
  flex-shrink: 0;
  border-top: 1px solid var(--border) !important;
  background: rgba(255, 255, 255, .03) !important;
}

.chat-message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.chat-message .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chat-message-content {
  min-width: 0;
}

.chat-message-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}

.chat-message-header .username {
  font-weight: 600;
  color: #EAEAEA !important;
  font-size: 0.9rem;
}

.chat-message-header .timestamp {
  font-size: 0.75rem;
  color: var(--muted);
}

.chat-message-body {
  color: #D1D1D1 !important;
  line-height: 1.4;
  word-wrap: break-word;
}


/* --- СТИЛИ ДЛЯ ПК (без изменений) --- */
@media (min-width: 1025px) {
  #watch-party-ui .chat-and-users {
    grid-template-columns: 1fr 240px;
  }

  .chat-container {
    border-right: 1px solid var(--border) !important;
  }

  .resizer {
    width: 6px;
    cursor: col-resize;
    flex: 0 0 6px;
    align-self: stretch;
    background: transparent;
    position: relative;
  }

  .resizer::after {
    content: "";
    position: absolute;
    inset: 0 2px;
    background: var(--border);
    border-radius: 3px;
  }

  body.is-resizing {
    cursor: col-resize;
    user-select: none;
  }
}


/* --- ОБНОВЛЕННАЯ МОБИЛЬНАЯ ВЕРСИЯ --- */
@media (max-width: 1024px) {
  .watch-grid {
    display: block;
  }

  .watch-grid .chat-col,
  .resizer {
    display: none;
  }

  /* Основная панель чата */
  body>.chat-col {
    display: flex;
    flex-direction: column;
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;

    /* 1. ВЫСОТА УМЕНЬШЕНА */
    height: calc(40 * var(--vh));
    max-height: 600px;

    z-index: 10000 !important;

    /* 2. ПРОЗРАЧНОСТЬ И ЭФФЕКТ РАЗМЫТИЯ */
    background: rgba(24, 26, 37, 0.85);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);

    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    /* Полупрозрачная граница */
    box-shadow: 0 -5px 25px rgba(0, 0, 0, .3);

    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }

  body>.chat-col.open {
    transform: translateY(0);
  }

  /* "Ручка" для закрытия панели */
  body>.chat-col::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
  }

  #watch-party-ui {
    /* Сбрасываем стили, так как они теперь на body > .chat-col */
    background: transparent !important;
    border: none !important;
    border-radius: 0;
  }

  .room-info,
  .mobile-chat-tabs,
  .chat-input-area {
    /* Границы дочерних элементов тоже делаем полупрозрачными */
    border-color: rgba(255, 255, 255, 0.1) !important;
  }

  .room-info {
    padding-top: 20px;
  }

  /* Отступ от ручки */
  .chat-input-area {
    background: transparent !important;
  }

  /* Табы для переключения Чат/Участники */
  .mobile-chat-tabs {
    flex-shrink: 0;
    padding: 10px 14px !important;
    display: flex !important;
    gap: 8px !important;
  }

  .mobile-chat-tabs button {
    flex: 1;
    padding: 8px 12px;
    border-radius: 8px;
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--muted);
    transition: all .2s;
  }

  /* 3. ОБНОВЛЕННЫЙ СТИЛЬ АКТИВНОГО ТАБА */
  .chat-col[data-mode="chat"] .mobile-chat-tabs button[data-mode="chat"],
  .chat-col[data-mode="users"] .mobile-chat-tabs button[data-mode="users"] {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
  }

  .chat-col[data-mode="chat"] .user-list-container {
    display: none;
  }

  .chat-col[data-mode="users"] .chat-container {
    display: none;
  }
}


/* --- ВСПОМОГАТЕЛЬНЫЕ СТИЛИ (без изменений) --- */
.peek-stack {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  z-index: 4200;
}

.peek-msg {
  align-self: flex-start;
  max-width: min(80%, 560px);
  background: rgba(0, 0, 0, .55);
  color: #fff;
  padding: 6px 10px;
  border-radius: 10px;
  line-height: 1.25;
  font-size: .9rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
  backdrop-filter: blur(6px);
  animation: peek-in .18s ease-out;
}

@keyframes peek-in {
  from {
    transform: translateY(8px);
    opacity: .3
  }
}

.chat-dock {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 4100 !important;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
}

.chat-dock .badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: #e03131;
  color: #fff;
  border-radius: 10px;
  font-size: .75rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
}

.chat-dock.has-unread .badge {
  display: inline-flex;
}

.chat-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 3999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}

.chat-scrim.show {
  pointer-events: auto;
}

body.chat-is-open {
  overflow: hidden;
}

/* Фиксы для полноэкранного режима */
:fullscreen .chat-dock,
:fullscreen .chat-col,
:-webkit-full-screen .chat-dock,
:-webkit-full-screen .chat-col {
  display: none !important;
}






/* =========================================================
   СТИЛИ ДЛЯ БЛОКА ВХОДА/РЕГИСТРАЦИИ (ПК-версия)
   ========================================================= */

.login-register-links {
  display: flex;
  align-items: center;
  gap: 12px;
  /* Расстояние между иконкой и текстом */
}

.login-register-links .auth-icon {
  height: 28px;
  /* Размер иконки-маски */
  width: auto;
  opacity: 0.8;
}

.login-register-links a {
  color: var(--muted);
  /* Используем цвет для неактивного текста из ваших переменных */
  text-decoration: none;
  font-weight: 600;
  /* Делаем текст чуть жирнее, как у других элементов */
  font-size: 15px;
  transition: color 0.2s ease;
}

.login-register-links a:hover {
  color: var(--accent);
  /* При наведении используем акцентный цвет */
  text-decoration: underline;
  /* Можно добавить подчеркивание для наглядности */
}

/* === ANIVIBE CHAT UI REWORK (v4.1 - Fixes & Polish) === */

/* --- ОБЩАЯ СТРУКТУРА И СЕТКА --- */
.watch-grid {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.player-col {
  flex: 1 1 auto;
  min-width: 0;
}

.chat-col {
  width: var(--chat-width);
  flex: 0 0 var(--chat-width);
  display: flex;
  flex-direction: column;
  height: 50vh;
  /* Высота подстраивается под плеер */
  max-height: 720px;
}

.resizer {
  width: 6px;
  cursor: col-resize;
  flex: 0 0 6px;
  align-self: stretch;
  background: transparent;
  position: relative;
}

.resizer::after {
  content: "";
  position: absolute;
  inset: 0 2px;
  background: var(--border);
  border-radius: 3px;
}

body.is-resizing {
  cursor: col-resize;
  user-select: none;
}

/* --- ОСНОВНОЙ КОНТЕЙНЕР ЧАТА (темная тема) --- */
#watch-party-ui {
  flex: 1;
  min-height: 0;

  flex-direction: column;
  background: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

/* --- ЗАГОЛОВОК КОМНАТЫ --- */
.room-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px !important;
  border-bottom: 1px solid var(--border) !important;
  background: transparent !important;
  flex-shrink: 0;
}

.room-title-group {
  color: var(--text);
}

#ui-room-name {
  color: inherit;
}

.room-meta,
#ui-host-name {
  color: var(--muted);
}

.room-actions .btn {
  background: var(--bg-2);
  border-color: var(--border);
}

/* --- СЕТКА "ЧАТ + УЧАСТНИКИ" --- */
#watch-party-ui .chat-and-users {
  flex: 1;
  min-height: 0;
  display: grid;
  height: auto !important;
  grid-template-columns: 1fr;
  /* По умолчанию одна колонка */
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: transparent !important;
  border: none !important;
}

/* --- СООБЩЕНИЯ --- */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  /* Новые сообщения снизу */
  gap: 10px;
}

.chat-messages:empty::before {
  content: 'Сообщений пока нет. Начните диалог!';
  color: var(--muted);

}

.chat-message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.chat-message-avatar img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.chat-message-header .username {
  color: var(--text) !important;
  font-size: 0.9rem;
}

.chat-message-header .timestamp {
  color: var(--muted);
}

.chat-message-body p {
  color: var(--text) !important;
  line-height: 1.4;
  word-break: break-word;
}

/* --- ПОЛЕ ВВОДА --- */
.chat-input-area {
  flex-shrink: 0;
  padding: 10px !important;
  border-top: 1px solid var(--border) !important;
  background: rgba(0, 0, 0, .1) !important;
}

#chat-input {
  background: var(--bg) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: 8px !important;
}

#chat-input:focus {
  border-color: var(--accent) !important;
  box-shadow: none !important;
}

#send-chat-btn {
  background-color: var(--accent) !important;
  color: var(--bg) !important;
}

/* --- СПИСОК УЧАСТНИКОВ --- */
.user-list-container {
  padding: 12px;
  overflow-y: auto;
  background: transparent !important;
}

.user-list-container h4 {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  margin-bottom: 10px;
}

#user-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#user-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 6px;
  position: relative;
  color: var(--text);
}

#user-list li:hover {
  background: var(--bg-2);
}

#user-list li .host-badge {
  font-size: 0.75rem;
  color: var(--accent);
  margin-left: auto;
  font-weight: 500;
}

#user-list li.banned-user .chat-username {
  text-decoration: line-through;
  opacity: 0.6;
}

/* === НОВЫЕ СТИЛИ ДЛЯ КНОПОК УПРАВЛЕНИЯ === */
.user-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
  opacity: 0;
  /* Скрыты по умолчанию */
  transition: opacity 0.2s ease;
}

#user-list li:hover .user-actions {
  opacity: 1;
  /* Появляются при наведении на пользователя */
}

.user-actions button {
  background: transparent;
  border: none;
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  /* Размер иконки */
  transition: all 0.2s ease;
}

.user-actions button i {
  pointer-events: none;
}

/* Чтобы клик всегда был по кнопке */
.user-actions button:hover {
  background-color: var(--bg-2);
}

.user-actions .kick-btn:hover {
  color: #f0ad4e;
}

/* Желтый для выгнать */
.user-actions .ban-btn:hover {
  color: #d9534f;
}

/* Красный для бана */
.user-actions .unban-btn:hover {
  color: #5cb85c;
}

/* Зеленый для разбана */


/* --- СТИЛИ ДЛЯ ПК --- */
@media (min-width: 1025px) {
  #watch-party-ui .chat-and-users {
    grid-template-columns: 1fr 240px;
  }

  .chat-container {
    border-right: 1px solid var(--border) !important;
  }
}

/* --- МОБИЛЬНАЯ ВЕРСИЯ (ПРОЗРАЧНАЯ ПАНЕЛЬ) --- */
@media (max-width: 1024px) {
  .watch-grid {
    display: block;
  }

  .watch-grid .chat-col,
  .resizer {
    display: none;
  }

  /* Панель, которая выезжает */
  body>.chat-col {
    display: flex;
    flex-direction: column;
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(40 * var(--vh));
    max-height: 600px;
    z-index: 10000 !important;

    /* ИЗМЕНЕНИЕ: Увеличена прозрачность и размытие */
    background: rgba(24, 26, 37, 0.55);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);

    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -5px 25px rgba(0, 0, 0, .3);

    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }

  body>.chat-col.open {
    transform: translateY(0);
  }

  /* "Ручка" для закрытия */
  body>.chat-col::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
  }

  #watch-party-ui {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none;
  }

  .room-info,
  .mobile-chat-tabs,
  .chat-input-area {
    border-color: rgba(255, 255, 255, 0.1) !important;
  }

  .room-info {
    padding-top: 20px !important;
  }

  .chat-input-area {
    background: transparent !important;
  }

  /* Табы Чат/Участники */
  .mobile-chat-tabs {
    flex-shrink: 0;
    padding: 10px 14px !important;
    display: flex !important;
    gap: 8px !important;
  }

  .mobile-chat-tabs button {
    flex: 1;
    padding: 8px 12px;
    border-radius: 8px;
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--muted);
    transition: all .2s;
  }

  .chat-col[data-mode="chat"] .mobile-chat-tabs button[data-mode="chat"],
  .chat-col[data-mode="users"] .mobile-chat-tabs button[data-mode="users"] {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
  }

  .chat-col[data-mode="chat"] .user-list-container {
    display: none;
  }

  .chat-col[data-mode="users"] .chat-container {
    display: none;
  }
}


/* --- ВСПОМОГАТЕЛЬНЫЕ СТИЛИ (кнопка, превью) --- */
.peek-stack {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  z-index: 4200;
}

.peek-msg {
  align-self: flex-start;
  max-width: min(80%, 560px);
  background: rgba(0, 0, 0, .55);
  color: #fff;
  padding: 6px 10px;
  border-radius: 10px;
  line-height: 1.25;
  font-size: .9rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
  backdrop-filter: blur(6px);
  animation: peek-in .18s ease-out;
}

@keyframes peek-in {
  from {
    transform: translateY(8px);
    opacity: .3
  }
}

.chat-dock {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 4100 !important;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
}

.chat-dock .badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: #e03131;
  color: #fff;
  border-radius: 10px;
  font-size: .75rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
}

.chat-dock.has-unread .badge {
  display: inline-flex;
}

.chat-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 3999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}

.chat-scrim.show {
  pointer-events: auto;
}

/* ИЗМЕНЕНИЕ: убираем блокировку скролла */
/* body.chat-is-open {
   overflow: hidden !important; 
} */

:fullscreen .chat-dock,
:fullscreen .chat-col,
:-webkit-full-screen .chat-dock,
:-webkit-full-screen .chat-col {
  display: none !important;
}

/* === ЕДИНЫЙ ВИД СЕКЦИЙ (как у светлого примера, но в тёмной теме) === */


/* Заголовок секции */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.section-head h3 {
  margin: 0;
  color: #fff;
  font-weight: 700;
}

/* Блок 2 — «Плеер + Комнаты»: убираем дублирующиеся внутренние заголовки */
.section-watch .episodes-section .description-header,
.section-watch .discussion-section .description-header {
  display: none !important;
}

/* Чуть плотнее размещаем лобби комнат под плеером */
.section-watch .discussion-section {
  margin-top: 18px;
}

.section-watch .active-rooms-header {
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

/* Комментарии — «воздушные» карточки в списке */
.section-comments .comment {
  background: rgb(20 30 43 / 17%);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  margin-bottom: 12px;
}

.section-comments .comment-replies {
  border-left-color: var(--border);
}

/* Секция рекомендаций — тоже карточка, чтобы все три блока были ровными */
.recommendations-section {
  padding: 0 !important;
}

.recommendations-section .description-header {
  display: none;
}

.recommendations-section::before {
  content: 'Вам также может понравиться';
  display: block;
  padding: 16px var(--s-6) 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  color: #fff;
  font-size: 1.2rem;
}

.recommendations-section .anime-list {
  padding: 0 var(--s-6) var(--s-6);
}

.recommendations-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  margin-top: var(--s-6);
}

/* Микрополировка player controls/заголовков под карточку */
.section-watch .player-controls {
  margin-top: 12px;
}

/* Только страница аниме: общий контейнер без рамки/стекла,
   чтобы визуально читались три отдельные карточки секций */
.page-anime main.container {
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0px var(--px);
}



/* Карточная оболочка секций */
.section-card-vibe {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: var(--s-6);
  margin-top: var(--s-6);
}

/* Заголовок внутри инфо-карточки — без «внутренней» рамки */
.section-info .anime-title-header {
  padding: 0 0 8px;
  margin: 0 0 12px;
  background: transparent;
  border: none;
}

/* ===========================
   БАЗОВЫЕ ПЕРЕМЕННЫЕ/ТОНАЛЬНОСТЬ
   =========================== */


/* Если у пользователя включено "меньше анимаций" — отключаем лишние переходы */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}



.users-page .page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.users-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.users-sort-link {
  padding: 4px 10px;
  border-radius: 999px;

  text-decoration: none;
  font-size: 13px;
  color: #888d9b;
}

.users-sort-link.active {
  background: #4b6083;
  color: #fff;
}

.users-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-card {
  background: rgba(15, 23, 42, 0.7);
  border-radius: 10px;
  padding: 10px 12px;
}

.user-card-main {
  display: flex;
  text-decoration: none;
  color: inherit;
  gap: 12px;
}

.user-card-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.user-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-card-name {
  font-weight: 600;
  font-size: 15px;
}

.user-card-status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
}

.user-card-status.online {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.user-card-status.offline {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.user-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  font-size: 12px;
  color: #cbd5f5;
}

.user-card-meta-item .label {
  opacity: 0.8;
  margin-right: 4px;
}

.user-card-last-anime {
  margin-top: 4px;
  font-size: 13px;
}

.user-card-last-anime .label {
  opacity: 0.85;
  margin-right: 4px;
}

.user-card-last-anime .value {
  font-weight: 500;
  margin-right: 6px;
  color: #9f9f9f;
}

.user-card-last-anime .badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.user-card-last-anime-title {
  color: inherit !important;
  text-decoration: none !important;
}

.footer-stats .stat-item-link {
  text-decoration: none;
  color: inherit;

  flex-direction: column;
  align-items: flex-start;
}

.footer-stats .stat-item-link:hover {
  opacity: 0.85;
}


.pagination {
  display: flex;
  gap: 8px;
  margin: 24px 0;
  flex-wrap: wrap;
  align-items: center;
}

.pagination a {
  padding: 4px 10px;
  border-radius: 4px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 14px;
  color: #7f7f7f;
}

.pagination-page.is-active {
  font-weight: 600;
  border-color: rgba(255, 255, 255, 0.4);
  color: #bbbbbb;
}

.pagination-ellipsis {
  padding: 4px 6px;
  font-size: 14px;
  opacity: 0.7;
}

/* ===========================
   ТАБЫ В ПРОФИЛЕ — БАЗА (ДЕСКТОП И ПЛАНШЕТ)
   =========================== */
.profile-tabs {

  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  /* без горизонтальной прокрутки по умолчанию */
  overflow-x: visible;
}

.tab-link {
  padding: 10px 14px;
  border: none;
  background: none;
  cursor: pointer;
  color: #aaa;
  font-size: clamp(14px, 1.6vw, 16px);
  line-height: 1;
  position: relative;
  border-radius: 6px;
  transition: color .18s ease, background-color .18s ease, transform .18s ease;
  /* Лучше явный шрифт-weight, чем bold-скачок метрик */
  font-weight: 550;
}

.tab-link:hover {
  color: #fff;
  background-color: var(--bg-elev);
}

.tab-link:active {
  transform: translateY(1px);
}

.tab-link:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--primary-color) 65%, white 35%);
  outline-offset: 2px;
  border-radius: 8px;
}

.tab-link.active {
  color: #fff;
}

.tab-link.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -7px;
  height: 2px;
  border-radius: 2px;
  background-color: var(--primary-color);
  transition: left .18s ease, right .18s ease;
}

.tab-link .count {
  background-color: #2b2b2b;
  color: #cfcfcf;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 12px;
  margin-left: 8px;
}

/* Секции вкладок */
.tab-pane {
  display: none;
}

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

/* ===========================
   СПИСОК АНИМЕ В ПРОФИЛЕ — БАЗА
   =========================== */
/* Стили для списка аниме в профиле */
.profile-anime-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}

.profile-anime-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  /* постер | инфо | (опционально метка/рейтинг справа) */
  gap: 12px;
  align-items: center;
  background-color: var(--bg-elev);
  padding: 12px;
  border-radius: var(--radius);
  transition: background-color .18s ease, transform .18s ease;
}

.profile-anime-item:hover {
  background-color: var(--bg-elev-hover);
  transform: translateY(-1px);
}

.profile-anime-item .poster {
  width: 56px;
  height: 78px;
  border-radius: 6px;
  overflow: hidden;
}

.profile-anime-item .poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-anime-item .info .title {
  font-weight: 650;
  color: #fff;
  text-decoration: none;
}

.profile-anime-item .info .title:hover {
  text-decoration: underline;
}

.profile-anime-item .info .meta {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 6px;
}

.profile-anime-item .info .meta .score {
  color: #f5c518;
  /* золотой для рейтинга */
  font-weight: 600;
}

/* ===========================
   ДЕСКТОП-УЛУЧШЕНИЯ (≥ 769px)
   =========================== */
@media (min-width: 769px) {
  .profile-tabs {
    /* На десктопе растягиваем, равномерные отступы */
    gap: 6px;
  }

  .tab-link {
    padding: 12px 16px;
    font-size: clamp(15px, 1.2vw, 17px);
  }

  .profile-anime-list {
    /* На широкой области — «карточки» в 2–3 колонки в зависимости от ширины */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }

  .profile-anime-item {
    grid-template-columns: 64px 1fr;
    min-height: 88px;
  }

  .profile-anime-item .poster {
    width: 64px;
    height: 90px;
  }
}

/* ===========================
   МОБИЛЬНАЯ АДАПТАЦИЯ (≤ 768px)
   =========================== */
@media (max-width: 768px) {
  .profile-tabs {
    /* Горизонтальная прокрутка вкладок на мобильных */
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
  }

  /* Прячем ползунок, прокрутка остаётся */
  .profile-tabs::-webkit-scrollbar {
    display: none;
  }

  /* Chrome/Safari/Opera */

  .tab-link {
    white-space: nowrap;
    /* чтобы вкладки не переносились */
    padding: 10px 14px;
  }

  .tab-link.active::after {
    left: 8px;
    right: 8px;
    bottom: -6px;
  }

  .profile-anime-item {
    grid-template-columns: 50px 1fr;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
  }

  .profile-anime-item .poster {
    width: 50px;
    height: 70px;
    border-radius: 5px;
  }
}

/* ===========================
   ДОП. ПОЛИРОВКА
   =========================== */
/* Более опрятные тонкие скроллбары на десктопе, если они всё же видны */
@media (hover: hover) and (pointer: fine) {
  .profile-tabs::-webkit-scrollbar {
    height: 8px;
  }

  .profile-tabs::-webkit-scrollbar-thumb {
    background-color: #444;
    border-radius: 8px;
  }

  .profile-tabs::-webkit-scrollbar-track {
    background: transparent;
  }
}

/* Небольшая защита от «дёргания» layout при появлении индикатора */
.tab-link::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -7px;
  height: 0;
  /* невидимая «резервная» линия */
}

/* Текстовые цвета по умолчанию внутри виджетов */
.profile-anime-item,
.tab-pane {
  color: var(--text);
}

/* === Overlay поверх чата, когда пользователь не в комнате === */
.chat-col {
  position: relative;
}

.chat-empty-overlay {
  position: absolute;
  inset: 8px;
  display: none;
  /* управляется скриптом */
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  text-align: center;
  padding: 16px;
  background: rgba(0, 0, 0, .35);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border: 1px dashed var(--border);
  border-radius: 12px;
  z-index: 50;
}

.chat-empty-overlay .icon {
  font-size: 22px;
  opacity: .85;
}

.chat-empty-overlay .title {
  margin: 2px 0 0;
  font-weight: 700;
  color: #fff;
}

.chat-empty-overlay .subtitle {
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
}

.chat-empty-overlay .auth-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .95rem;
}

.chat-empty-overlay .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.chat-empty-overlay .actions .btn {
  padding: 8px 12px;
  line-height: 1;
  height: auto;
}

/* Небольшая подсветка списка комнат при прокрутке к нему */
.room-list-container.highlight {
  box-shadow: 0 0 0 2px var(--accent) inset;
  border-radius: 8px;
}

/* Тихие ссылки в подсказках авторизации */
.login-prompt a,
.chat-login-prompt a,
.chat-empty-overlay .auth-note a,
.comments-section p a {
  color: var(--muted) !important;
  /* спокойный серо-лавандовый */
  text-decoration: underline;
  /* оставим подчёркивание, но… */
  text-underline-offset: 2px;
  text-decoration-color: rgba(255, 255, 255, .25);
  /* …делаем его мягким */
  transition: color .15s, text-decoration-color .15s;
}

/* Ховер/фокус — показываем, что это кликабельно */
.login-prompt a:hover,
.chat-login-prompt a:hover,
.chat-empty-overlay .auth-note a:hover,
.comments-section p a:hover,
.login-prompt a:focus-visible,
.chat-login-prompt a:focus-visible,
.chat-empty-overlay .auth-note a:focus-visible,
.comments-section p a:focus-visible {
  color: var(--accent) !important;
  /* твой акцентный (золото) */
  text-decoration-color: currentColor;
  /* подчёркивание таким же цветом */
  outline: none;
  /* чтобы не было «синей рамки» */
}

/* Фикс «фиолетовых» посещённых ссылок */
.login-prompt a:visited,
.chat-login-prompt a:visited,
.chat-empty-overlay .auth-note a:visited,
.comments-section p a:visited {
  color: var(--muted) !important;
}

/* Стили для страницы похожих аниме (similar.php) */

.similar-page-container {
  padding: var(--s-6) 0;
}

.breadcrumbs {
  margin-bottom: var(--s-5);
  font-size: 0.9em;
  color: var(--muted);
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

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

.breadcrumbs .separator {
  margin: 0 8px;
}

.page-description {
  max-width: 800px;
  margin: var(--s-2) 0 var(--s-6);
  line-height: 1.6;
  font-size: 1.1em;
}

.similar-anime-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
}

.similar-anime-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: var(--s-5);
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-4);
  overflow: hidden;
}

.similar-anime-item .poster-link {
  position: relative;
  display: block;
}

.similar-anime-item .poster-link img {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: calc(var(--radius) - 6px);
}

.similar-anime-item .score-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.9em;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.similar-anime-item .info h3 {
  margin: 0 0 var(--s-1);
  font-size: 1.4em;
}

.similar-anime-item .info .title-link {
  text-decoration: none;
  color: var(--text);
}

.similar-anime-item .info .title-link:hover {
  color: var(--accent);
}

.similar-anime-item .info .year {
  font-size: 0.9em;
  color: var(--muted);
  margin-bottom: var(--s-3);
}

.similar-anime-item .info .matched-genres {
  margin-bottom: var(--s-3);
  font-size: 0.95em;
}

.similar-anime-item .info .description {
  font-size: 0.95em;
  line-height: 1.5;
  color: var(--text-light);
}

@media (max-width: 768px) {
  .similar-anime-item {
    grid-template-columns: 100px 1fr;
    gap: var(--s-4);
  }

  .similar-anime-item .info h3 {
    font-size: 1.2em;
  }
}

/*
 * Стили для красивой ссылки на страницу "Похожие аниме"
 * на странице одного аниме (anime_single.php)
*/

.similar-link-wrapper {
  /* Главный отступ сверху, чтобы отодвинуть ссылку от блока с жанрами */
  margin-top: var(--s-5, 20px);
}

.similar-link-bar {
  display: flex;
  /* Используем flexbox для центрирования контента */
  justify-content: center;
  /* Центрируем по горизонтали */
  align-items: center;
  /* Центрируем по вертикали */
  gap: 10px;
  /* Отступ между иконкой и текстом */

  width: 100%;
  /* На всю ширину родительского блока */
  padding: 14px 20px;
  /* Внутренние отступы для высоты и "воздуха" */

  /* Цвета, как на вашем скриншоте. Подберите var() под вашу тему */
  background-color: rgba(127, 140, 141, 0.15);
  /* Полупрозрачный фон */
  color: var(--text-light, #ecf0f1);
  /* Светлый цвет текста */

  border-radius: var(--radius, 12px);
  /* Скругление углов */
  border: 1px solid transparent;
  /* Убираем стандартную границу */

  font-size: 1.05em;
  /* Немного увеличим шрифт */
  font-weight: 500;
  text-decoration: none;
  /* Убираем подчеркивание у ссылки */

  transition: background-color 0.2s ease, color 0.2s ease;
  /* Плавный переход для hover-эффекта */
}

.similar-link-bar:hover {
  background-color: rgba(127, 140, 141, 0.25);
  /* Делаем фон чуть ярче при наведении */
  color: #fff;
  /* Текст делаем чисто белым */
}

/*
==============================================
== СТИЛИ ДЛЯ СТРАНИЦЫ "ПОХОЖИЕ АНИМЕ" v2.0 ==
==============================================
*/

/* --- Общий контейнер и заголовки --- */
.similar-page-container {
  padding: var(--s-6) 0;
}

.breadcrumbs {
  margin-bottom: var(--s-5);
  font-size: 0.9em;
  color: var(--muted);
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

.breadcrumbs .separator {
  margin: 0 8px;
}

.page-description {
  max-width: 800px;
  margin: var(--s-2) 0 var(--s-6);
  line-height: 1.6;
  font-size: 1.1em;
  color: var(--text-light);
}

/* --- Сеточный макет списка --- */
.similar-anime-list {
  display: grid;
  /* Адаптивные колонки: минимум 280px, максимум 1fr (равномерное распределение) */
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--s-5, 20px);
}

/* --- Карточка аниме в сетке --- */
.similar-anime-item {
  background-color: var(--card, rgba(0, 0, 0, 0.15));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius, 12px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.similar-anime-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  border-color: var(--accent, #3498db);
}

/* --- Постер в карточке --- */
.similar-anime-item .poster-link {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  background-color: #333;
  /* Фон для медленно грузящихся картинок */
}

.similar-anime-item .poster-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.similar-anime-item .score-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.9em;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(4px);
}

/* --- Информационный блок под постером --- */
.similar-anime-item .info {
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  /* Растягивает блок, чтобы все карточки были одной высоты */
}

.similar-anime-item .info .title-link {
  text-decoration: none;
  color: var(--text);
}

.similar-anime-item .info h3 {
  margin: 0 0 var(--s-2);
  font-size: 1.25em;
  line-height: 1.3;
  transition: color 0.2s;
}

.similar-anime-item .info .title-link:hover h3 {
  color: var(--accent);
}

/* --- Мета-информация (год, тип, эпизоды) --- */
.meta-info {
  display: flex;
  gap: 12px;
  font-size: 0.9em;
  color: var(--muted);
  margin-bottom: var(--s-3);
  flex-wrap: wrap;
}

.meta-info span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* --- Теги похожести --- */
.similarity-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--s-4);
}

.similarity-tags .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 500;
  background-color: rgba(142, 68, 173, 0.15);
  /* Фиолетовый оттенок */
  border: 1px solid rgba(142, 68, 173, 0.3);
  color: #c9b3d5;
}

.similarity-tags .tag .fas {
  opacity: 0.7;
}

/* --- Описание в карточке --- */
.similar-anime-item .info .description {
  margin-top: auto;
  /* Прижимает описание к низу карточки */
  padding-top: var(--s-3);
  font-size: 0.95em;
  line-height: 1.5;
  color: var(--text-light);
  opacity: 0.9;
  border-top: 1px solid var(--border);
}

/* Стили для блока с подборками на странице аниме */
.collections-section {
  margin-top: 25px;

  border-top: 1px solid var(--border, #3a3d52);
}

.collections-section h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.2em;
}

.collections-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.collection-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--card-light, #3a3d52);
  color: var(--text-light, #e0e0e0);
  padding: 8px 14px;
  border-radius: var(--radius, 8px);
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s;
}

.collection-tag:hover {
  background-color: #666193;
  color: #fff;
}

.collection-tag i {
  opacity: 0.7;
}

/* ==== Стили для блока подборок ==== */
.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--s-5, 20px);
}

.collection-card {
  position: relative;
  display: block;
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius, 12px);
  overflow: hidden;
  min-height: 180px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.collection-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.collection-card .card-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.4s ease;
}

.collection-card:hover .card-background {
  transform: scale(1.05);
}

.collection-card .card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0.85) 100%);
}

.collection-card .card-content {
  position: relative;
  z-index: 2;
  padding: var(--s-5, 20px);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.collection-card .item-count {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(5px);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 10px;
}

.collection-card .card-title {
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 0;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}




.anime-latest-news-widget {
  background: rgba(var(--accent-rgb), 0.1);

  border-left: 1px solid var(--accent);

  padding: 15px;
  margin-bottom: 15px;
}

.widget-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ad9a74;
  margin-bottom: 12px;
}

.widget-header h4 {
  margin: 0;
  font-size: 1.1em;
  color: var(--text);
  font-weight: 600;
}

.widget-header .fa-bell {
  font-size: 1.1em;
}

.widget-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  /* Добавлено для лучшей адаптивности */
}

.widget-content p {
  margin: 0;
  line-height: 1.5;
  flex-grow: 1;
  color: var(--text-muted);
}

.widget-content .btn-small {
  padding: 5px 12px;
  font-size: 0.9em;
  flex-shrink: 0;
}

/* Стили для выделения информации об озвучке */
.translation-highlight {
  font-weight: 500;
  color: var(--text);
  background-color: rgba(var(--accent-rgb), 0.15);
  padding: 1px 1px;
  border-radius: 4px;
  margin-left: 4px;
}

.time-highlight {
  font-size: 0.9em;
  color: var(--muted);
  margin-left: 8px;
  white-space: nowrap;
  /* Чтобы дата не переносилась */
}

.section-vibe-rating {
  text-align: center;
}

.vibe-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1em;
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  background-color: var(--card-lighter);
  color: var(--text);
  border: 1px solid var(--border-light);
  transition: all 0.2s ease;
}

.vibe-btn:hover {
  border-color: var(--text-light);
}

.vibe-btn .fa-thumbs-up {
  color: #28a745;
}

.vibe-btn .fa-thumbs-down {
  color: #dc3545;
}

.vibe-btn.liked {
  background-color: rgba(40, 167, 69, 0.1);
  border-color: #28a745;
}

.vibe-btn.disliked {
  background-color: rgba(220, 53, 69, 0.1);
  border-color: #dc3545;
}

.vibe-count {
  font-size: 1.1em;
  font-weight: bold;
}

.share-title {
  font-size: 1em;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 15px;
}

.share-buttons-list {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.share-btn:hover {
  transform: scale(1.1);
  opacity: 0.9;
}

.share-btn.vk {
  background-color: #4a76a8;
}

.share-btn.tg {
  background-color: #24a1de;
}

.share-btn.ok {
  background-color: #f58220;
}

.share-btn.wa {
  background-color: #25d366;
}

@media (max-width: 768px) {

  /* Убираем старые стили фона из body, если они есть */
  body {
    background-image: none !important;
    /* !important для перезаписи базовых стилей */
    background-color: #2a2a4b;
    /* Только цвет как fallback */
    position: relative;
    /* Для z-index контента */
  }

  /* Псевдо-элемент с fixed фоном */
  body::before {
    content: '';
    position: fixed;
    /* Фиксируется к viewport, не двигается при скролле */
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    /* 100% высоты экрана (viewport height) */
    background-image: url('/css/sakura_top.webp');
    background-size: 170vw auto;
    /* Полное покрытие без искажений (пропорции сохраняются) */
    background-position: center top;
    /* Фокус на центре сверху (сакуры вверху?) */

    z-index: -1;
    /* Под всем контентом (body и main) */
    pointer-events: none;
    /* Не мешает кликам/тачам по контенту */
  }
}


/* ---- Стили для блока "Связанное аниме" ---- */

/* --- Стили для блока "Порядок просмотра" --- */
.watch-order-container {
  margin: 5px 0;
  background-color: var(--card-light);
  /* Или другой подходящий фон */
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.watch-order-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  background-color: #2aa158c4;
  /* Зеленый, как в примере */
  color: white;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.watch-order-toggle:hover {
  background-color: #2dab62e8;
  /* Более темный зеленый при наведении */
}

.watch-order-toggle .fa-chevron-up {
  transition: transform 0.3s ease;
}

/* Стиль для свернутого состояния */
.watch-order-container.collapsed .watch-order-toggle .fa-chevron-up {
  transform: rotate(180deg);
}

.watch-order-content {
  padding: 8px 16px 16px 16px;
  max-height: 1000px;
  /* Достаточно большая высота для анимации */
  transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out;
}

.watch-order-container.collapsed .watch-order-content {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.watch-order-list {
  list-style: none;
  padding: 0;
  margin: 0;
  padding-right: 25px;
  /* Место для линии и точек */
  position: relative;
}

/* Вертикальная линия */
.watch-order-list::before {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 10px;
  right: 8px;
  /* Позиционируем по центру точек */
  width: 2px;
  background-color: #e2e8f0;
  /* Цвет линии */
  z-index: 1;
}

.watch-order-list li {
  padding: 10px 0;
  font-size: 15px;
  position: relative;
  border-bottom: 1px solid var(--border);
}

.watch-order-list li:last-child {
  border-bottom: none;
}

/* Зеленые точки */
.watch-order-list li::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background-color: #68d391;
  border: 3px solid var(--card-light);
  /* "Вырезаем" точку из фона */
  border-radius: 50%;
  z-index: 2;
}

.watch-order-list li.current::after {
  background-color: #4299e1;
  /* Выделяем точку для текущего аниме синим */
}

.watch-order-list li a {
  color: #e53e3e;
  /* Красный цвет для названия */
  font-weight: 500;
  text-decoration: none;
}

.watch-order-list li a:hover {
  text-decoration: underline;
}

.watch-order-list li .details {
  color: var(--text-muted);
  /* Серый цвет для доп. информации */
}


/* Улучшенные стили для порядка просмотра */
.watch-order-container {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: var(--card-shadow);

  overflow: hidden;
}

.watch-order-toggle {
  width: 100%;
  background: transparent;
  border: none;
  padding: 1.1rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  transition: background-color 0.3s ease;
}

.watch-order-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
}

.watch-order-toggle .toggle-icon {
  margin-left: auto;
  transition: transform 0.3s ease;
}

.watch-order-container.collapsed .toggle-icon {
  transform: rotate(180deg);
}

.watch-order-content {
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
}

.watch-order-container.collapsed .watch-order-content {
  max-height: 0;
  opacity: 0;
}

.watch-order-list {
  padding: 0 1.5rem 1.5rem;
  margin: 0;
  list-style: none;
  counter-reset: watch-order;
}

.watch-order-list li {
  counter-increment: watch-order;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--glass-border);
  position: relative;
  padding-left: 2.5rem;
}

.watch-order-list li:last-child {
  border-bottom: none;
}

.watch-order-list li::before {
  content: counter(watch-order);
  position: absolute;
  left: 0;
  top: 0.75rem;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--primary-gradient);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.watch-order-list li.current::before {
  background: var(--success-color);
  box-shadow: 0 0 15px rgba(46, 204, 113, 0.4);
}

.watch-order-list li a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.watch-order-list li a:hover {
  color: var(--accent);
}

.watch-order-list li.current a {
  color: var(--success-color);
}

.watch-order-list li .details {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
  display: block;
}

/* --- ШАПКА ПРОФИЛЯ --- */
.profile-header {
  position: relative;
  min-height: 220px;
  background-color: var(--card-background);
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}

.profile-avatar-wrap {
  position: relative;
  margin-top: 60px;
}

.profile-avatar-lg {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-md);
  background: #222;
}

.profile-basic {
  padding-bottom: 8px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.profile-name {
  margin: 0;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.online {
  background: #22c55e;
}

.status-dot.offline {
  background: #64748b;
}

.profile-meta {
  color: rgba(255, 255, 255, 0.8);
  margin-top: 6px;
}

.banner-form,
.avatar-form-inline {
  display: inline-block;
  margin-top: 10px;
  margin-right: 10px;
}

.banner-form input[type="file"],
.avatar-form-inline input[type="file"] {
  display: none;
}

/* --- СЕТКА ПРОФИЛЯ (Сайдбар + Контент) --- */
.profile-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
}

.profile-sidebar section {
  background: var(--card-background);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.profile-sidebar h3 {
  margin-top: 0;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.profile-about textarea {
  background: var(--input-background);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px;
  border-radius: 8px;
  width: 100%;
  resize: vertical;
  box-sizing: border-box;
}

.about-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--text-muted);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  cursor: pointer;
}

.stats-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.stats-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.friends-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.friend.placeholder {
  width: 100%;
  padding-top: 100%;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

/* --- НАВИГАЦИЯ И ТАБЫ --- */
.profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
}

.profile-tabs .tab-link {
  padding: 10px 14px;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-bottom: 3px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-tabs .tab-link:hover {
  color: var(--text-primary);
}

.profile-tabs .tab-link.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background: rgba(var(--primary-rgb), 0.05);
}

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

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

/* --- ЛЕНТА АКТИВНОСТИ --- */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  padding: 15px;
  background: var(--card-background);
  border-radius: 10px;
  border-left: 3px solid var(--primary-color);
  transition: background 0.2s ease;
}

.activity-item:hover {
  background: rgba(var(--primary-rgb), 0.1);
}

.activity-icon {
  font-size: 1.2rem;
  color: var(--primary-color);
  margin-right: 15px;
  padding-top: 3px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.activity-details {
  flex-grow: 1;
}

.activity-text {
  margin: 0;
  line-height: 1.5;
  color: var(--text-primary);
}

.activity-target-link {
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.activity-target-link:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.activity-timestamp {
  display: block;
  font-size: 0.8em;
  color: var(--text-muted);
  margin-top: 5px;
}

/* --- СПИСКИ АНИМЕ (Избранное, Просмотрено и т.д.) --- */
.anime-list,
.watchlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 15px;
}

.anime-item,
.grid-item {
  text-align: center;
}

.anime-item a,
.grid-item a {
  text-decoration: none;
  display: block;
}

.anime-item .poster,
.grid-item .poster {
  aspect-ratio: 2/3;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 8px;
  background-color: #111;
  transition: transform 0.2s ease;
}

.anime-item a:hover .poster,
.grid-item a:hover .poster {
  transform: scale(1.05);
}

.anime-item img,
.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.anime-item .title,
.grid-item .title {
  font-size: 0.9em;
  color: var(--text-primary);
  transition: color 0.2s ease;
}

.anime-item a:hover .title,
.grid-item a:hover .title {
  color: var(--primary-color);
}

.watchlist-list.hidden,
.watchlist-grid.hidden {
  display: none;
}


/* --- АДАПТИВНОСТЬ --- */
@media (max-width: 900px) {
  .profile-grid {
    grid-template-columns: 240px 1fr;
  }
}

@media (max-width: 768px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-avatar-wrap {
    margin-top: -60px;
  }

  .profile-basic {
    padding-bottom: 0;
  }
}

/* Стили для нового списка серий под плеером */
.vibix-episodes-list-container {
  padding: 15px;
  background-color: var(--card-light);
  border-radius: 0 0 var(--radius) var(--radius);
  border-top: 1px solid var(--border);
  margin-top: -1px;
  /* Чтобы скрыть двойную границу */
}

.vibix-seasons-tabs {
  margin-bottom: 15px;
  display: flex;
  gap: 10px;
}

.vibix-episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
}

.vibix-list-btn {
  padding: 8px 12px;
  border: 1px solid var(--border);
  background-color: var(--background);
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  font-size: 0.9em;
  transition: all 0.2s ease;
}

.vibix-list-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.vibix-list-btn.active {
  background-color: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
  font-weight: 600;
}

/* --- АДАПТИВНЫЕ СТИЛИ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ --- */

@media (max-width: 768px) {
  .section-watch {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
}



/* ↓↓↓ Вставьте этот CSS в ваш основной блок стилей ↓↓↓ */

/* --- СТИЛИ ДЛЯ МОБИЛЬНОГО ИНТЕРФЕЙСА ПЛЕЕРА --- */

/* По умолчанию скрываем мобильные элементы */
.is-mobile {
  display: none;
}

@media (max-width: 768px) {

  /* На мобильных, наоборот, скрываем десктопные элементы и показываем мобильные */
  .is-desktop {
    display: none;
  }

  .is-mobile {
    display: block;
    /* или flex, в зависимости от элемента */
  }

  /* Стилизация основной мобильной панели под плеером */
  .mobile-player-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: var(--card-light);
    border-top: 1px solid var(--border);
  }

  .current-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .current-info__title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
  }

  .current-info__ep {
    font-size: 13px;
    color: var(--text-muted);
  }

  /* Строка с кнопками переключения серий */
  .current-info__ep-row {
    display: flex;
    align-items: center;
    gap: 3px;
  }

  /* Кнопки "Предыдущая" и "Следующая" серия */
  .ep-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  }

  .ep-nav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
  }

  .ep-nav-btn:active {
    transform: scale(0.95);
  }

  .ep-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
  }

  .ep-nav-btn i {
    pointer-events: none;
  }

  .controls-buttons {
    display: flex;
    gap: 10px;
  }

  .mobile-btn {
    padding: 8px 14px;
    background-color: var(--background);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .mobile-btn i {
    font-size: 12px;
  }

  /* Стили для всплывающей панели (Bottom Sheet) */
  .player-bottom-sheet {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;

    /* ДОБАВЛЕНО: Управляем видимостью */
    visibility: hidden;
    transition: visibility 0s linear 0.3s;
    /* Скрываем ПОСЛЕ завершения анимации */
  }

  .sheet-backdrop {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .sheet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(35, 36, 43, 0.85);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    max-height: 70vh;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.08);

    /* ИЗМЕНЕНИЕ: Управляем сдвигом и прозрачностью для более плавной анимации */
    transform: translateY(100%);

    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  /* Состояния, когда панель открыта */
  /* Состояния, когда панель открыта */
  .player-bottom-sheet.is-open {
    pointer-events: auto;

    /* ДОБАВЛЕНО: Делаем видимым СРАЗУ, как начинается анимация открытия */
    visibility: visible;
    transition-delay: 0s;
    /* Убираем задержку для transition-visibility */
  }

  .player-bottom-sheet.is-open .sheet-backdrop {
    opacity: 1;
  }

  .player-bottom-sheet.is-open .sheet-content {
    transform: translateY(0);
    opacity: 1;
    /* ДОБАВЛЕНО */
  }

  .sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }

  .sheet-title {
    font-size: 18px;
    margin: 0;
  }

  .sheet-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
  }

  .sheet-body {
    padding: 10px 0;
    overflow-y: auto;
  }

  /* Стили для элементов ВНУТРИ всплывающей панели */
  .sheet-body .dropdown-item,
  .sheet-body .episode-button-mobile {
    display: block;
    width: 100%;
    text-align: left;
    padding: 14px 20px;
    /* Немного увеличим отступ для воздушности */
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    font-size: 16px;
    font-weight: 500;
    /* Сделаем текст чуть жирнее */
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    /* Плавные переходы */

    /* ГЛАВНОЕ ИЗМЕНЕНИЕ: Устанавливаем цвет для неактивных элементов */
    color: var(--text-secondary, #aeb2c2);
    /* Используем переменную или запасной светло-серый цвет */
  }

  /* Убираем рамку у последнего элемента, чтобы было аккуратнее */
  .sheet-body .dropdown-item:last-child,
  .sheet-body .episode-button-mobile:last-child {
    border-bottom: none;
  }

  /* Стиль при наведении мыши (или касании) */
  .sheet-body .dropdown-item:hover,
  .sheet-body .episode-button-mobile:hover {
    background-color: rgba(255, 255, 255, 0.05);
  }


  /* Стиль для ВЫБРАННОГО/АКТИВНОГО элемента */
  .sheet-body .dropdown-item.selected,
  .sheet-body .episode-button-mobile.active {
    background-color: rgba(102, 126, 234, 0.15);
    /* Делаем фон чуть ярче */
    color: #ffffff;
    /* Белый цвет для максимального контраста */
    font-weight: 600;
    /* Делаем шрифт еще жирнее */
  }


  /* --- СТИЛИ ДЛЯ НИЖНЕЙ МОБИЛЬНОЙ ПАНЕЛИ (ВЕРСИЯ 3.0 С АКЦЕНТНОЙ КНОПКОЙ) --- */

  @media (max-width: 768px) {
    body.page-anime .mobile-bottom-bar {
      display: block;
      position: fixed;
      bottom: 10px;
      left: 10px;
      right: 10px;
      height: 60px;
      background-color: rgba(35, 36, 43, 0.85);
      -webkit-backdrop-filter: blur(12px);
      backdrop-filter: blur(12px);
      border-radius: 50px;
      box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
      border-top: 1px solid rgba(255, 255, 255, 0.1);
      z-index: 999;
    }

    body.page-anime {
      padding-bottom: 80px;
    }

    .mobile-bottom-bar__links {
      display: flex;
      justify-content: space-around;
      align-items: center;
      height: 100%;
      padding: 0 10px;
    }

    .mobile-bottom-bar__link {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      color: var(--text-muted, #aeb2c2);
      text-decoration: none;
      font-size: 11px;
      font-weight: 500;
      flex: 1;
      height: 100%;
      /* Растягиваем по высоте */
      transition: color 0.25s ease, transform 0.2s ease;
      -webkit-tap-highlight-color: transparent;
      background: none;
      border: none;
      padding: 0;
      cursor: pointer;
    }

    .mobile-bottom-bar__link i {
      font-size: 18px;
      margin-bottom: 3px;
    }

    .mobile-bottom-bar__link:active {
      transform: scale(0.95);
    }

    .mobile-bottom-bar__link.is-active {
      color: #fff;
    }

    .mobile-bottom-bar__link.is-active i {
      color: var(--primary-color, #8e44ad);
    }

    /* --- НОВЫЕ СТИЛИ ДЛЯ ЦЕНТРАЛЬНОЙ КНОПКИ --- */
    #mobile-add-action {
      /* Убираем flex-растягивание и задаем ширину, чтобы создать отступы */
      flex: 0 0 70px;
      /* Поднимаем кнопку вверх */
      transform: translateY(-15px);

      width: 56px;
      height: 56px;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      border-radius: 50%;
      box-shadow: 0 5px 15px rgba(118, 75, 162, 0.4);
      color: white;
      border: 3px solid var(--card-background);
    }

    #mobile-add-action i {
      font-size: 24px;
      margin-bottom: 0;
    }

    #mobile-add-action span {
      font-size: 10px;
    }

    #mobile-add-action:active {
      /* Корректируем анимацию нажатия с учетом подъема */
      transform: translateY(-15px) scale(0.95);
    }

    /* Скрываем другие "плавающие" кнопки */
    body.page-anime .chat-dock {
      display: none;
    }
  }

  @media (max-width: 768px) {

    /* --- Скрываем основные кнопки под постером на мобильных --- */
    .action-buttons__main-group {
      display: none;
    }

    /* --- Стилизуем оставшуюся кнопку "Написать рецензию" --- */
    .action-buttons {
      margin-top: 15px;
    }

    .btn-write-review {
      width: 100%;
      background: rgba(102, 126, 234, 0.15);
      color: var(--primary-color);
      border: 1px solid var(--primary-color);
    }
  }

  /* --- Стили для мобильного меню действий (Bottom Sheet) --- */

  /* Скорректированный заголовок группы */
  .sheet-group-title {
    color: var(--text-muted);
    font-size: 0.9em;
    font-weight: 700;
    padding: 15px 12px 8px;
    /* Уменьшаем вертикальный отступ */
    margin-top: 5px;
    /* Уменьшаем отступ сверху */
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    /* Добавляем тонкий разделитель под заголовком */
  }

  /* Общий стиль для всех элементов в списке действий */
  .mobile-action-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 12px;
    margin: 0;
    cursor: pointer;
    background-color: var(--card-background);
    transition: background-color 0.15s ease;
    user-select: none;
  }

  /* Визуально выделяем активный элемент, как в скриншоте */
  .mobile-action-item.active-status {
    background-color: rgba(102, 126, 234, 0.15);
    /* Темно-фиолетовый фон */
  }


  .item-info {
    display: flex;
    align-items: center;

  }

  /* Стиль для иконок */
  .item-icon {
    font-size: 1.2em;
    width: 30px;
    /* Увеличиваем область иконки */
    height: 30px;
    /* Добавляем высоту, если нужно вертикальное центрирование */
    display: flex;
    /* Делаем иконку Flex-контейнером */
    align-items: center;
    /* Выравнивание по вертикали */
    justify-content: center;
    /* Выравнивание по горизонтали */

    /* Задаем фиксированный отступ справа для текста */
    margin-right: 15px;

    text-align: center;
    color: var(--text-muted);
  }

  /* Иконка избранного всегда красная, как на скриншоте */
  .mobile-action-item[data-action="toggle_favorite"] .item-icon {
    color: #e74c3c;
  }

  .item-title {
    font-weight: 500;
    /* Чуть тоньше, чем 600 */
    color: var(--text-light);
  }

  /* Стили для бейджей "Текущий" и "Выбрать" */
  .item-badge {
    font-size: 0.85em;
    /* Чуть крупнее */
    padding: 6px 10px;
    /* Больше отступ */
    border-radius: 8px;
    /* Сильнее скругление */
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    /* Для кнопки "Выбрать" */
  }

  /* Бейдж "В избранном" */
  .mobile-action-item[data-action="toggle_favorite"].active .item-badge {
    background-color: #c0392b;
    /* Более темный красный фон */
    color: #fff;
    box-shadow: none;
  }

  /* Бейдж "Текущий" (Активный статус) */
  .mobile-action-item[data-status].active-status .item-badge {
    background-color: transparent;
    /* Убираем фон */
    color: var(--text-light);
    /* Светлый текст */
    font-weight: 600;
    padding: 0;
    /* Убираем лишние отступы */
  }

  /* Бейдж "Выбрать" */
  .mobile-action-item[data-status]:not(.active-status) .item-badge {
    background-color: #3b3d45;
    /* Темный фон для кнопки "Выбрать" */
    color: var(--text-light);
    transition: background-color 0.15s ease;
  }

  .mobile-action-item[data-status]:not(.active-status) .item-badge:hover {
    background-color: #50545f;
    /* Чуть светлее при наведении */
  }

  /* Иконка активного статуса - Галочка, белая */
  .mobile-action-item.active-status .item-icon {
    color: #fff;
  }

  /* Скорректированный заголовок группы */
  .sheet-group-title {
    color: var(--text-muted);
    font-size: 0.9em;
    font-weight: 700;
    padding: 10px 12px 8px;
    /* Чуть меньше вертикальный отступ */
    margin-top: 0;
    /* Убираем отступ сверху */
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  /* --- Стили для мобильного меню действий (Bottom Sheet) --- */

  /* Скорректированный заголовок группы */
  .sheet-group-title {
    color: var(--text-muted);
    font-size: 0.9em;
    font-weight: 700;
    padding: 10px 12px 8px;
    /* Уменьшаем вертикальный отступ */
    margin-top: 0;
    /* Убираем отступ сверху */
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  /* Общий стиль для всех элементов в списке действий */
  .mobile-action-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 12px;
    /* Возвращаем 15px */
    margin: 0;
    cursor: pointer;
    background-color: var(--card-background);
    transition: background-color 0.15s ease;
    user-select: none;
  }

  /* Визуально выделяем активный элемент, как в скриншоте */
  .mobile-action-item.active-status {
    background-color: #2e313c;
    /* Точный темно-фиолетовый фон из скриншота */
  }


  /* КЛЮЧЕВОЙ КОНТЕЙНЕР ДЛЯ ЛЕВОЙ ЧАСТИ */
  .item-info {
    display: grid;
    /* Создаем 2 колонки: 1) для иконки (фиксированная ширина) 2) для текста */
    grid-template-columns: 40px 1fr;
    align-items: center;
    /* Убираем gap, так как grid-template-columns сам управляет пространством */
  }

  /* Стиль для иконок - теперь это ячейка Grid */
  .item-icon {
    font-size: 1.2em;
    height: 100%;
    /* Занимаем всю высоту ячейки */
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Выравнивание иконки чуть правее, отступ от края */

    /* Смещение: используем Padding, чтобы сдвинуть иконку от левого края 12px */
    padding-left: 0px;

    text-align: center;
    color: var(--text-muted);
  }

  /* Иконка избранного всегда красная, как на скриншоте */
  .mobile-action-item[data-action="toggle_favorite"] .item-icon {
    color: #e74c3c;
  }

  /* Иконка активного статуса - Галочка, белая */
  .mobile-action-item.active-status .item-icon {
    color: #fff;
  }

  .item-title {
    font-weight: 500;
    color: var(--text-light);
    /* Текст начинается сразу после 40px контейнера иконок */
  }

  /* Бейдж "В избранном" */
  .mobile-action-item[data-action="toggle_favorite"].active .item-badge {
    background-color: #c0392b;
    color: #fff;
    box-shadow: none;
  }

  /* Бейдж "Текущий" (Активный статус) */
  .mobile-action-item[data-status].active-status .item-badge {
    background-color: transparent;
    color: var(--text-light);
    font-weight: 600;
    padding: 0;
  }

  /* Бейдж "Выбрать" */
  .mobile-action-item[data-status]:not(.active-status) .item-badge {
    background-color: #3b3d45;
    color: var(--text-light);
    transition: background-color 0.15s ease;
  }

  .mobile-action-item[data-status]:not(.active-status) .item-badge:hover {
    background-color: #50545f;
  }

  /* --- Стили для бейджей избранного в вертикальном меню --- */

  /* Бейдж, когда аниме уже в избранном */
  .mobile-action-item.active-fav .item-badge-corner {
    background-color: transparent;
    /* Убираем фон, если оно уже в избранном */
    color: #e74c3c;
    /* Цвет текста — красный */
    font-weight: 700;
    padding: 0;
  }

  /* Стиль для кнопки "Добавить" (когда аниме НЕ в избранном) */
  .item-badge-corner.btn-add-style {
    background-color: #c0392b;
    /* Красный фон */
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
  }

  /* Если вы хотите, чтобы избранное всегда выглядело как кнопка,
   но только при добавлении: */
  .mobile-action-item[data-action="toggle_favorite"] {
    /* Чтобы бейдж справа был всегда */
    display: flex;
  }

  /* ======================================== */
  /*    ANIME PAGE DECORATION                 */
  /* ======================================== */
}

/* ======================================== */
/*    ANIME PAGE DECORATION                 */
/* ======================================== */
.anime-decoration-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  /* Behind content */
  overflow: hidden;
}

.anime-decoration-left,
.anime-decoration-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 400px;
  background-image: url('/images/anime_decoration.webp');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;

  /* Dimmed by default */
  opacity: 0.2;
  filter: drop-shadow(0 0 5px rgba(138, 43, 226, 0.3));

  /* Interaction */
  pointer-events: auto;
  transition: all 0.4s ease;
}

.anime-decoration-left {
  left: -100px;
  /* Removed transform: scaleX(-1) to fix orientation */
}

.anime-decoration-right {
  right: -100px;
}

/* Vanish Animation */
@keyframes vanishEffect {
  0% {
    opacity: 0.2;
    transform: scale(1);
    filter: drop-shadow(0 0 5px rgba(138, 43, 226, 0.3));
  }

  20% {
    opacity: 1;
    transform: scale(1.05);
    filter: drop-shadow(0 0 25px rgba(138, 43, 226, 1));
  }

  100% {
    opacity: 0;
    transform: scale(1.1);
    filter: drop-shadow(0 0 0 rgba(138, 43, 226, 0));
    pointer-events: none;
    /* Disable interaction after vanish */
  }
}

.anime-decoration-left.vanish,
.anime-decoration-right.vanish {
  animation: vanishEffect 0.8s ease-out forwards;
}

/* Remove default hover to let JS handle it */
/* .anime-decoration-left:hover,
  .anime-decoration-right:hover {
    opacity: 0.8;
    filter: drop-shadow(0 0 20px rgba(138, 43, 226, 0.8));
  } */

@media (max-width: 1200px) {
  .anime-decoration-container {
    display: none;
  }
}

/* ==============================================
   PRO MOBILE OPTIMIZATION for Similar Anime
   (Fixing large posters issue)
   ============================================== */
@media (max-width: 768px) {

  /* Switch grid from 1 col to just vertical list, but we use flex row for items */
  .similar-anime-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Make the card a horizontal flex row: Image Left | Info Right */
  .similar-anime-item {
    flex-direction: row;
    align-items: flex-start;
    height: auto;
    min-height: 120px;
    padding: 8px;
    /* Slightly less padding */
  }

  /* Left side: Poster Thumbnail */
  .similar-anime-item .poster-link {
    width: 95px;
    min-width: 95px;
    /* Force width */
    height: 140px;
    /* Portrait ratio approx 2:3 */
    aspect-ratio: 2/3;
    flex-shrink: 0;
    margin-right: 0;
    background-color: transparent;
    /* Remove bg */
  }

  .similar-anime-item .poster-link img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    border-radius: calc(var(--radius) - 2px);
  }

  /* Adjust score badge for small poster */
  .similar-anime-item .score-badge {
    top: 4px;
    left: 4px;
    font-size: 10px;
    padding: 2px 5px;
  }

  /* Right side: Info */
  .similar-anime-item .info {
    padding: 0 0 0 12px;
    /* padding-left only */
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }

  /* Title */
  .similar-anime-item .info h3 {
    font-size: 1rem;
    margin: 0 0 4px 0;
    line-height: 1.3;
    /* Limit to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Meta info (Year, Type, Ep) */
  .meta-info {
    margin-bottom: 6px;
    font-size: 0.75rem;
    gap: 8px;
    flex-wrap: wrap;
    line-height: 1.2;
  }

  /* Similarity Tags - Make them very small */
  .similarity-tags {
    margin-bottom: 6px;
    gap: 4px;
  }

  .similarity-tags .tag {
    font-size: 0.65rem;
    padding: 2px 6px;
    height: auto;
  }

  /* Description: Show truncated 3 lines */
  .similar-anime-item .info .description {
    font-size: 0.8rem;
    line-height: 1.3;
    margin-top: auto;
    border-top: none;
    padding-top: 0;

    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-muted);
  }
}/* --- Вкладки профиля (Новая ревизия) --- */
.tabs-block {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 25px;
}

.tabs-header {
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid var(--border);
}

.flex-tabs {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
}

.flex-tabs li {
    padding: 15px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--muted);
    transition: all 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.flex-tabs li .count {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.flex-tabs li:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.flex-tabs li.active {
    color: #fff;
    background: rgba(102, 126, 234, 0.1);
}

.flex-tabs li.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
}

/* Под-вкладки (Sub-tabs) */
.lists-content .tabs-header {
    border-bottom: 1px solid var(--border);
    margin-bottom: 15px;
}

.lists-content .flex-tabs li {
    padding: 12px 18px;
    font-size: 0.85rem;
}

/* Строка поиска и фильтры */
.profile-search-row {
    display: flex;
    gap: 15px;
    padding: 0 15px 15px;
    align-items: center;
}

.profile-search-input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 15px;
    color: #fff;
    font-size: 0.9rem;
}

.profile-filter-btn {
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

/* Компактный вид карточек (List View) */
.profile-list-item {
    display: flex;
    gap: 15px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.profile-list-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.profile-list-item .poster-small {
    width: 50px;
    height: 70px;
    border-radius: 4px;
    object-fit: cover;
}

.profile-list-item .info {
    flex: 1;
}

.profile-list-item .title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.profile-list-item .meta {
    font-size: 0.8rem;
    color: var(--muted);
}

/* Вкладка комментариев (User Screenshot Style) */
.profile-comment-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid var(--border);
}

.profile-comment-item .anime-poster-mini {
    width: 48px;
    height: 68px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.profile-comment-item .comment-main {
    flex: 1;
}

.profile-comment-item .anime-title-link {
    color: #ff6b6b;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: block;
    margin-bottom: 2px;
}

.profile-comment-item .comment-date {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 8px;
}

.profile-comment-item .comment-text {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 8px;
}

.profile-comment-item .comment-votes {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    font-weight: 700;
}

.profile-comment-item .vote-up {
    color: #2ecc71;
}

.profile-comment-item .vote-down {
    color: #e74c3c;
}

.bordered-top {
    border-top: 1px solid var(--border);
}

.materiable {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}