/* ============================================================
   AniTsuki — Основной стиль
   ============================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Arial, sans-serif;
}

:root {
  --bg-1: #1e1e2f;
  --bg-2: #2a2a40;
  --bg-3: #1a1a2a;
  --border: #3a3a55;
  --text: #ffffff;
  --text-dim: #bbb;
  --text-dim-2: #888;
  --accent-1: #ff6b9d;
  --accent-2: #c084fc;
  --accent-grad: linear-gradient(90deg, #ff6b9d, #c084fc);
  --green: #4ade80;
  --blue: #38bdf8;
  --yellow: #facc15;
  --red: #ef4444;
}

/* ============================================================
   СВЕТЛАЯ ТЕМА
   ============================================================ */

[data-theme="light"] {
  --bg-1: #f5f5f7;
  --bg-2: #ffffff;
  --bg-3: #ebebf0;
  --border: #e0e0e8;
  --text: #1a1a2a;
  --text-dim: #555;
  --text-dim-2: #888;
  --accent-1: #ff4d8d;
  --accent-2: #a855f7;
  --accent-grad: linear-gradient(90deg, #ff4d8d, #a855f7);
  --green: #16a34a;
  --blue: #0284c7;
  --yellow: #d97706;
  --red: #dc2626;
}

html, body {
  background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 100%);
  min-height: 100vh;
  color: var(--text);
  font-family: 'Segoe UI', Arial, sans-serif;
}

html {
  transition: background-color 0.3s ease;
}

body,
.site-header,
.card,
.profile-sidebar,
.modal,
.settings-modal {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 25px 25px 60px;
}

/* ============================================================
   ШАПКА САЙТА
   ============================================================ */

.site-header {
  background: rgba(30, 30, 47, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 25px;
  display: flex;
  align-items: center;
  gap: 25px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  cursor: pointer;
}

.logo-icon {
  font-size: 1.6rem;
}

.logo-text {
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Поиск в шапке */
.header-search {
  position: relative;
  flex: 1;
  max-width: 500px;
  margin: 0 auto;
}

.header-search input {
  width: 100%;
  padding: 11px 45px 11px 45px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
}

.header-search input:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 20px rgba(192, 132, 252, 0.3);
}

.header-search .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  opacity: 0.6;
  pointer-events: none;
}

.header-search .search-spinner {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid #555;
  border-top-color: var(--accent-2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.header-search .search-spinner.active {
  display: block;
}

@keyframes spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

/* Правый блок — профиль */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* ============================================================
   ПОДСКАЗКИ ПОИСКА
   ============================================================ */

.suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-2);
  border-radius: 15px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
  list-style: none;
  max-height: 400px;
  overflow-y: auto;
  z-index: 200;
  display: none;
  border: 1px solid var(--border);
}

.suggestions.show { display: block; }

.suggestions li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 15px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #33334d;
}

.suggestions li:last-child { border-bottom: none; }
.suggestions li:hover { background: var(--border); }

.suggestions li img {
  width: 45px;
  height: 65px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--bg-1);
}

.suggestions li .info { flex: 1; min-width: 0; }

.suggestions li .name {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestions li .meta {
  font-size: 0.8rem;
  color: var(--text-dim-2);
}

.suggestions li .meta .badge {
  display: inline-block;
  background: var(--border);
  color: var(--accent-2);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 0.7rem;
  margin-left: 6px;
}

.suggestions .no-result,
.suggestions .loading {
  padding: 20px;
  text-align: center;
  color: var(--text-dim-2);
  font-size: 0.95rem;
}

/* ============================================================
   ЛЕНТЫ-КАРУСЕЛИ (главная)
   ============================================================ */

.carousel-section {
  margin-bottom: 45px;
}

.carousel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 0 5px;
}

.carousel-header h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
}

.carousel-controls {
  display: flex;
  gap: 8px;
}

.carousel-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 1.3rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
  padding-bottom: 4px;
}

.carousel-btn:hover {
  background: var(--accent-grad);
  border-color: transparent;
  transform: scale(1.1);
}

.carousel-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
  background: var(--bg-2);
}

.carousel {
  position: relative;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 5px 5px 15px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.carousel-track::-webkit-scrollbar { height: 6px; }
.carousel-track::-webkit-scrollbar-track { background: transparent; }
.carousel-track::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.carousel-track::-webkit-scrollbar-thumb:hover {
  background: var(--accent-2);
}

/* Карточка в ленте */
.mini-anime-card {
  flex-shrink: 0;
  width: 170px;
  background: var(--bg-2);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.mini-anime-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.5);
}

.mini-anime-card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  background: var(--bg-1);
}

.mini-anime-card-info {
  padding: 10px 12px;
}

.mini-anime-card-title {
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 6px;
  height: 2.6em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.mini-anime-card-meta {
  font-size: 0.75rem;
  color: var(--text-dim-2);
  display: flex;
  justify-content: space-between;
  gap: 5px;
}

.mini-anime-card-meta .score {
  color: var(--yellow);
  font-weight: 600;
}

/* Скелетон при загрузке */
.skeleton-card {
  flex-shrink: 0;
  width: 170px;
  background: var(--bg-2);
  border-radius: 12px;
  overflow: hidden;
}

.skeleton-card-img {
  width: 100%;
  height: 240px;
  background: linear-gradient(90deg, #1e1e2f 0%, #2a2a40 50%, #1e1e2f 100%);
  background-size: 200% 100%;
  animation: skeleton 1.4s ease-in-out infinite;
}

.skeleton-card-line {
  height: 12px;
  margin: 10px 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, #1e1e2f 0%, #2a2a40 50%, #1e1e2f 100%);
  background-size: 200% 100%;
  animation: skeleton 1.4s ease-in-out infinite;
}

.skeleton-card-line:last-child {
  width: 60%;
  margin-bottom: 15px;
}

@keyframes skeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   СТРАНИЦА АНИМЕ
   ============================================================ */

.page-header {
  margin-bottom: 25px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 25px;
  font-size: 0.95rem;
  transition: all 0.2s;
  cursor: pointer;
}

.back-btn:hover {
  border-color: var(--accent-2);
  background: var(--border);
}

.anime-page {
  background: var(--bg-2);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.page-loading {
  padding: 60px;
  text-align: center;
  color: var(--text-dim-2);
  font-size: 1.1rem;
}

.anime-banner {
  width: 100%;
  height: 260px;
  background-size: cover;
  background-position: center;
  background-color: transparent;
  position: relative;
  transition: opacity 0.4s ease;
}

.anime-banner.banner-loading {
  opacity: 0;
}

.anime-banner.banner-loaded {
  opacity: 1;
}

.anime-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, var(--bg-2) 100%);
}


.anime-main {
  display: flex;
  gap: 30px;
  padding: 30px 40px;
  margin-top: -100px;
  position: relative;
  z-index: 2;
}

.anime-cover {
  width: 240px;
  height: 340px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.7), 0 0 30px rgba(192, 132, 252, 0.15);
  flex-shrink: 0;
  background: var(--bg-1);
  position: relative;
  z-index: 3;
}

.anime-info { flex: 1; min-width: 0; }

.anime-title {
  font-size: 2rem;
  margin-bottom: 15px;
  line-height: 1.2;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.anime-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.anime-meta span {
  background: var(--bg-1);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.anime-rating {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.anime-rating-label {
  color: var(--text-dim);
  font-size: 1rem;
}

.anime-rating-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--yellow);
  text-shadow: 0 0 15px rgba(255, 217, 61, 0.5);
}

.anime-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.anime-genres .genre {
  background: var(--accent-grad);
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.anime-description {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-dim);
  margin-bottom: 25px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 10px;
}

.anime-description::-webkit-scrollbar { width: 6px; }
.anime-description::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 3px;
}

.anime-parts {
  padding: 0 40px 40px;
}

.anime-parts-title {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--text);
  font-weight: 600;
}

.anime-parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

.part-card {
  background: var(--bg-1);
  border-radius: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  position: relative;
}

.part-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.5);
}

.part-card.current {
  border-color: var(--accent-2);
  box-shadow: 0 0 20px rgba(192, 132, 252, 0.5);
}

.part-card.status-watched { border-color: var(--green); }
.part-card.status-watching { border-color: var(--blue); }
.part-card.status-planned { border-color: var(--yellow); }
.part-card.status-dropped { border-color: var(--red); }

.part-image-wrap { cursor: default; }

.part-card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  border-radius: 10px 10px 0 0;
}

.part-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.part-title {
  font-size: 0.9rem;
  line-height: 1.3;
  margin-bottom: 6px;
  min-height: 2.6em;
  cursor: default;
  transition: color 0.2s;
}

.part-title:hover { color: var(--accent-2); }

.part-meta {
  font-size: 0.75rem;
  color: var(--text-dim-2);
  margin-bottom: 10px;
}

.part-status-wrap {
  margin-top: auto;
  position: relative;
}

/* ============================================================
   СТАТУС-СЕЛЕКТОР
   ============================================================ */

.status-selector {
  position: relative;
  width: 100%;
}

.status-btn {
  width: 100%;
  padding: 9px 14px;
  background: var(--bg-1);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.2s;
  font-family: inherit;
}

.status-btn:hover {
  border-color: var(--accent-2);
  color: var(--text);
}

.status-btn .status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #555;
  flex-shrink: 0;
}

.status-btn .status-arrow {
  font-size: 0.7rem;
  opacity: 0.6;
  transition: transform 0.2s;
}

.status-selector.open .status-arrow {
  transform: rotate(180deg);
}

.status-btn[data-status="watched"] {
  background: rgba(74, 222, 128, 0.15);
  border-color: var(--green);
  color: var(--green);
}
.status-btn[data-status="watched"] .status-dot { background: var(--green); }

.status-btn[data-status="watching"] {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--blue);
  color: var(--blue);
}
.status-btn[data-status="watching"] .status-dot { background: var(--blue); }

.status-btn[data-status="planned"] {
  background: rgba(250, 204, 21, 0.15);
  border-color: var(--yellow);
  color: var(--yellow);
}
.status-btn[data-status="planned"] .status-dot { background: var(--yellow); }

.status-btn[data-status="dropped"] {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--red);
  color: var(--red);
}
.status-btn[data-status="dropped"] .status-dot { background: var(--red); }

.status-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  list-style: none;
  padding: 6px;
  z-index: 20;
  display: none;
  animation: dropdown 0.15s ease;
}

@keyframes dropdown {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.status-selector.open .status-menu { display: block; }

.status-menu li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
  color: var(--text-dim);
}

.status-menu li:hover {
  background: var(--border);
  color: var(--text);
}

.status-menu li .status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-menu li[data-value="watched"] .status-dot { background: var(--green); }
.status-menu li[data-value="watching"] .status-dot { background: var(--blue); }
.status-menu li[data-value="planned"] .status-dot { background: var(--yellow); }
.status-menu li[data-value="dropped"] .status-dot { background: var(--red); }
.status-menu li[data-value="none"] .status-dot { background: #555; }

.status-menu li.active {
  background: var(--border);
  color: var(--text);
}

/* ============================================================
   МОДАЛКА ВХОДА
   ============================================================ */

.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
  z-index: 500;
  padding: 20px;
}

.auth-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.auth-modal {
  background: var(--bg-2);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  transform: scale(0.9);
  transition: transform 0.25s;
  position: relative;
  text-align: center;
}

.auth-modal-overlay.show .auth-modal {
  transform: scale(1);
}

.auth-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim-2);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-modal-close:hover {
  background: var(--border);
  color: var(--text);
}

.auth-modal h2 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-modal p {
  color: var(--text-dim-2);
  margin-bottom: 30px;
  font-size: 0.95rem;
}

.auth-google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 22px;
  background: #fff;
  color: #1e1e2f;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.1);
}

.auth-google-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
}

.auth-google-btn svg {
  width: 22px;
  height: 22px;
}

/* ============================================================
   ПРОФИЛЬ В ШАПКЕ
   ============================================================ */

.profile-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 2px solid var(--border);
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.profile-icon-btn:hover {
  border-color: var(--accent-2);
  transform: scale(1.05);
}

.profile-icon-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-icon-btn .icon-placeholder {
  font-size: 1.3rem;
}

/* Меню профиля */
.profile-menu-wrap {
  position: relative;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
  min-width: 230px;
  list-style: none;
  padding: 8px;
  z-index: 200;
  display: none;
  animation: dropdown 0.15s ease;
}

.profile-menu-wrap.open .profile-menu { display: block; }

.profile-menu .user-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.profile-menu .user-header img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
}

.profile-menu .user-header .user-info {
  flex: 1;
  min-width: 0;
}

.profile-menu .user-header .user-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu .user-header .user-email {
  font-size: 0.75rem;
  color: var(--text-dim-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu li.menu-item {
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.9rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-menu li.menu-item:hover {
  background: var(--border);
  color: var(--text);
}

.profile-menu li.menu-item.logout {
  color: var(--red);
}

.profile-menu li.menu-item.logout:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
}

/* ============================================================
   ПРОФИЛЬ (страница)
   ============================================================ */

.profile-header {
  background: var(--bg-2);
  border-radius: 20px;
  padding: 30px;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 25px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.profile-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-2);
  flex-shrink: 0;
}

.profile-info-main {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 6px;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.profile-email {
  color: var(--text-dim-2);
  font-size: 0.95rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-2);
  border-radius: 15px;
  padding: 20px;
  text-align: center;
  border: 1px solid var(--border);
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-2);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-dim-2);
}

/* Вкладки статусов */
.profile-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 25px;
  flex-wrap: wrap;
  justify-content: center;
}

.profile-tab {
  padding: 9px 18px;
  background: var(--bg-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 25px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-tab:hover {
  border-color: var(--accent-2);
  color: var(--text);
}

.profile-tab.active {
  background: var(--accent-grad);
  color: #fff;
  border-color: transparent;
}

.profile-tab .count {
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Сетка карточек в профиле */
.anime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 22px;
}

.anime-grid .card {
  background: var(--bg-2);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s, opacity 0.25s;
  animation: appear 0.4s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.anime-grid .card:hover {
  transform: translateY(-5px);
}

.anime-grid .card.status-watched {
  box-shadow: 0 0 0 3px var(--green), 0 8px 20px rgba(0, 0, 0, 0.4);
  opacity: 0.95;
}
.anime-grid .card.status-watching {
  box-shadow: 0 0 0 3px var(--blue), 0 8px 20px rgba(0, 0, 0, 0.4);
}
.anime-grid .card.status-planned {
  box-shadow: 0 0 0 3px var(--yellow), 0 8px 20px rgba(0, 0, 0, 0.4);
}
.anime-grid .card.status-dropped {
  box-shadow: 0 0 0 3px var(--red), 0 8px 20px rgba(0, 0, 0, 0.4);
}

@keyframes appear {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

.anime-grid .card-image-wrap {
  position: relative;
  cursor: pointer;
}

.anime-grid .card img.card-cover {
  width: 100%;
  height: 290px;
  object-fit: cover;
  display: block;
  background: var(--bg-1);
}

.anime-grid .card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.anime-grid .card-title {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 10px;
  text-align: center;
  word-break: break-word;
  line-height: 1.3;
  min-height: 2.6em;
  cursor: pointer;
  transition: color 0.2s;
}

.anime-grid .card-title:hover { color: var(--accent-2); }

.anime-grid .stars {
  display: flex;
  justify-content: center;
  gap: 4px;
  font-size: 1.4rem;
  user-select: none;
  margin-bottom: 12px;
}

.anime-grid .star {
  cursor: pointer;
  color: #555;
  transition: color 0.15s, transform 0.15s;
}

.anime-grid .star:hover { transform: scale(1.2); }
.anime-grid .star.active {
  color: #ffd93d;
  text-shadow: 0 0 10px rgba(255, 217, 61, 0.6);
}

.anime-grid .card-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
}

.anime-grid .card:hover .card-delete { opacity: 1; }
.anime-grid .card-delete:hover { background: var(--red); }

.anime-grid .card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.75);
  color: var(--accent-2);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 2;
}

.empty {
  text-align: center;
  color: var(--text-dim-2);
  grid-column: 1 / -1;
  padding: 60px 20px;
  font-size: 1.1rem;
}

.empty .empty-btn {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 28px;
  background: var(--accent-grad);
  color: #fff;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.2s;
}

.empty .empty-btn:hover { transform: translateY(-2px); }

/* ============================================================
   МОДАЛКА РУЧНОГО ДОБАВЛЕНИЯ
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
  z-index: 400;
  padding: 20px;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-2);
  border-radius: 20px;
  padding: 30px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  transform: scale(0.85);
  transition: transform 0.25s;
}

.modal-overlay.show .modal { transform: scale(1); }

.modal h2 {
  margin-bottom: 20px;
  text-align: center;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.modal input[type="text"],
.modal input[type="file"] {
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 18px;
  border-radius: 10px;
  border: 1px solid #444;
  background: var(--bg-1);
  color: var(--text);
  font-size: 1rem;
  outline: none;
}

.modal input:focus { border-color: var(--accent-2); }
.modal input[type="file"] { padding: 8px; cursor: pointer; }

.modal input[type="file"]::file-selector-button {
  background: var(--accent-grad);
  color: #fff;
  border: none;
  padding: 8px 15px;
  border-radius: 8px;
  cursor: pointer;
  margin-right: 10px;
  font-weight: 600;
}

.modal-buttons {
  display: flex;
  gap: 12px;
}

.modal-buttons button {
  flex: 1;
  padding: 13px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-cancel {
  background: var(--border);
  color: var(--text);
}

.btn-cancel:hover {
  background: var(--bg-3);
}

.btn-done { background: var(--accent-grad); color: #fff; }
.btn-done:hover { opacity: 0.9; }

.preview {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 15px;
  display: none;
  border: 1px solid #444;
}

/* ============================================================
   УВЕДОМЛЕНИЯ
   ============================================================ */

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-2);
  color: #fff;
  padding: 14px 25px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--green);
  transition: transform 0.3s ease;
  z-index: 1000;
  font-size: 0.95rem;
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--red); }

/* Синхронизация */
.sync-status {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--bg-2);
  color: var(--green);
  padding: 10px 18px;
  border-radius: 25px;
  font-size: 0.85rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--green);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 250;
  pointer-events: none;
}

.sync-status.show {
  opacity: 1;
  transform: translateY(0);
}

.sync-status.error {
  color: var(--red);
  border-color: var(--red);
}

/* ============================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
   ============================================================ */

@media (max-width: 700px) {
  .site-header-inner {
    padding: 10px 15px;
    gap: 12px;
  }

  .logo-text { display: none; }

  .header-search {
    flex: 1;
    min-width: 0;
  }

  .container {
    padding: 20px 15px 50px;
  }

  .carousel-header h2 { font-size: 1.15rem; }

  .mini-anime-card {
    width: 145px;
  }

  .mini-anime-card img { height: 205px; }

  .anime-main {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    margin-top: -80px;
  }

  .anime-cover {
    width: 160px;
    height: 240px;
  }

  .anime-meta,
  .anime-genres { justify-content: center; }

  .anime-title { font-size: 1.5rem; }

  .anime-parts { padding: 0 20px 30px; }

  .anime-parts-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
    padding: 25px 20px;
  }

  .profile-avatar {
    width: 80px;
    height: 80px;
  }

  .profile-name { font-size: 1.4rem; }

  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .anime-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }

  .anime-grid .card img.card-cover {
    height: 220px;
  }
}

/* ============================================================
   ПРОФИЛЬ — SIDEBAR LAYOUT
   ============================================================ */

/* ============================================================
   БАННЕР ПРОФИЛЯ
   ============================================================ */

.profile-banner {
  position: relative;
  width: 100%;
  height: 200px;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 30px;
  background: linear-gradient(135deg, #ff6b9d 0%, #c084fc 100%);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.profile-banner-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(25px) brightness(0.6);
  transform: scale(1.2);
  opacity: 0.7;
}

.profile-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.35) 0%, rgba(192, 132, 252, 0.35) 100%);
}

.profile-banner-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 25px;
  height: 100%;
  padding: 0 40px;
}

.profile-banner-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 40px rgba(192, 132, 252, 0.6);
  background: var(--bg-1);
  flex-shrink: 0;
}

.profile-banner-info {
  min-width: 0;
  flex: 1;
}

.profile-banner-name {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.6);
  word-break: break-word;
}

/* ============================================================
   ПРОФИЛЬ — SIDEBAR LAYOUT
   ============================================================ */

/* ============================================================
   ПРОФИЛЬ — SIDEBAR LAYOUT
   ============================================================ */

.profile-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 30px;
  align-items: start;
}
/* ---- SIDEBAR ---- */
.profile-sidebar {
  background: var(--bg-2);
  border-radius: 20px;
  padding: 0 30px 30px;
  position: sticky;
  top: 90px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

/* Мини-баннер внутри sidebar */
.profile-sidebar-banner {
  position: relative;
  overflow: hidden;
  margin: 0 -30px 25px;
  min-height: 150px;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #ff6b9d 0%, #c084fc 100%);
  border-radius: 20px 20px 0 0;
}

.profile-sidebar-banner-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.5);
  transform: none;
  opacity: 1;
}

.profile-sidebar-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(30, 30, 47, 0.85) 0%,
    rgba(30, 30, 47, 0.5) 60%,
    rgba(30, 30, 47, 0.2) 100%
  );
}

.profile-sidebar-banner-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 25px 30px;
  width: 100%;
}

.profile-sidebar-banner-inner .profile-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: none;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
  margin-bottom: 0;
  background: var(--bg-1);
}

.profile-sidebar-banner-inner .profile-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  word-break: break-word;
  background: none;
  -webkit-text-fill-color: #fff;
  line-height: 1.2;
  min-width: 0;
  align-self: flex-end;
  padding-bottom: 8px;
}

.profile-sidebar-info {
  text-align: center;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 25px;
}

.profile-avatar {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-2);
  box-shadow: 0 0 30px rgba(192, 132, 252, 0.5);
  margin-bottom: 18px;
  background: var(--bg-1);
}

.profile-name {
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  word-break: break-word;
}

/* ---- СТАТИСТИКА ---- */
.profile-stats-list {
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.profile-stats-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim-2);
  margin-bottom: 12px;
  font-weight: 600;
}

.profile-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.profile-stat-row .stat-icon {
  margin-right: 8px;
}

.profile-stat-row .stat-value {
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
}

.profile-stat-row .stat-value.accent {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.05rem;
}

/* ---- ВКЛАДКИ (вертикально) ---- */
.profile-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 22px;
}

.profile-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  color: var(--text-dim);
  border: none;
  border-radius: 10px;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  width: 100%;
  font-family: inherit;
}

.profile-tab:hover {
  background: var(--border);
  color: var(--text);
}

.profile-tab.active {
  background: var(--accent-grad);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(192, 132, 252, 0.3);
}

.profile-tab .tab-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.profile-tab .tab-label {
  flex: 1;
}

.profile-tab .count {
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  min-width: 30px;
  text-align: center;
}

.profile-tab.active .count {
  background: rgba(255, 255, 255, 0.25);
}

/* ---- КНОПКА ВЫЙТИ ---- */
.profile-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px;
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.profile-logout-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  transform: translateY(-1px);
}

/* ---- КОНТЕНТ ---- */
.profile-content {
  min-width: 0;
}

.profile-content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}

.profile-content-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
}

.profile-content-count {
  color: var(--text-dim-2);
  font-size: 0.95rem;
  background: var(--bg-2);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* ---- АДАПТАЦИЯ ---- */
@media (max-width: 900px) {
  .profile-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .profile-sidebar {
    position: static;
  }

  .profile-tabs {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .profile-tab {
    width: auto;
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }

  .profile-content-title {
    font-size: 1.3rem;
  }

  .profile-avatar {
    width: 100px;
    height: 100px;
  }
}

/* ============================================================
   НАСТРОЙКИ ПРОФИЛЯ (модалка)
   ============================================================ */

/* Кнопка-шестерёнка в баннере */
.profile-settings-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 1rem;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  backdrop-filter: blur(5px);
}

.profile-settings-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: rotate(45deg) scale(1.1);
  border-color: var(--accent-2);
}

/* Оверлей модалки настроек */
.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
  z-index: 600;
  padding: 20px;
  overflow-y: auto;
}

.settings-overlay.show {
  opacity: 1;
  visibility: visible;
}

.settings-modal {
  background: var(--bg-2);
  border-radius: 20px;
  padding: 30px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  transform: scale(0.9);
  transition: transform 0.25s;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.settings-overlay.show .settings-modal {
  transform: scale(1);
}

.settings-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim-2);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.settings-modal-close:hover {
  background: var(--border);
  color: var(--text);
}

.settings-modal h2 {
  font-size: 1.5rem;
  margin-bottom: 25px;
  text-align: center;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.settings-field {
  margin-bottom: 22px;
}

.settings-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--text-dim);
  font-weight: 500;
}

.settings-field input[type="text"] {
  width: 100%;
  padding: 12px 15px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border 0.2s;
}

.settings-field input[type="text"]:focus {
  border-color: var(--accent-2);
}

.settings-upload-row {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.settings-preview {
  border: 2px solid var(--border);
  background: var(--bg-1);
  object-fit: cover;
}

.settings-preview-round {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  flex-shrink: 0;
}

.settings-preview-banner {
  width: 140px;
  height: 80px;
  border-radius: 10px;
  flex-shrink: 0;
}

.settings-upload-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  background: var(--bg-1);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.settings-upload-btn:hover {
  border-color: var(--accent-2);
  background: var(--border);
}

.settings-upload-btn input[type="file"] {
  display: none;
}

.settings-buttons {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.settings-buttons button {
  flex: 1;
  padding: 13px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.settings-buttons .btn-cancel {
  background: var(--border);
  color: var(--text);
}

.settings-buttons .btn-cancel:hover {
  background: var(--bg-3);
}

.settings-buttons .btn-cancel:hover {
  background: #4a4a6a;
}

.settings-buttons .btn-done {
  background: var(--accent-grad);
  color: #fff;
}

.settings-buttons .btn-done:hover {
  opacity: 0.9;
}
/* ============================================================
   Страница аниме: действия (статус, рейтинг, добавить)
   ============================================================ */

.anime-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
}

.anime-actions .status-selector {
  max-width: 240px;
  min-width: 200px;
}

.anime-rating-stars {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rating-label {
  color: var(--text-dim);
  font-size: 0.95rem;
}

.stars.stars-lg {
  display: flex;
  gap: 6px;
  font-size: 1.7rem;
  user-select: none;
  margin: 0;
}

.stars.stars-lg .star {
  cursor: pointer;
  color: #555;
  transition: color 0.15s, transform 0.15s;
}

.stars.stars-lg .star:hover {
  transform: scale(1.2);
}

.stars.stars-lg .star.active {
  color: #ffd93d;
  text-shadow: 0 0 10px rgba(255, 217, 61, 0.6);
}

.add-to-list-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 28px;
  background: var(--accent-grad);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 6px 20px rgba(192, 132, 252, 0.4);
}

.add-to-list-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(192, 132, 252, 0.6);
}

.part-status-wrap {
  margin-top: auto;
  position: relative;
}

.part-status-wrap .status-btn {
  font-size: 0.75rem;
  padding: 6px 10px;
}

.part-status-wrap .status-menu {
  top: auto;
  bottom: calc(100% + 6px);
}

.part-status-wrap .status-menu li {
  font-size: 0.75rem;
  padding: 6px 10px;
}

/* Цветные рамки частей по статусу */
.part-card.status-watched  { border-color: #4ade80; }
.part-card.status-watching { border-color: #38bdf8; }
.part-card.status-planned  { border-color: #facc15; }
.part-card.status-dropped  { border-color: #ef4444; }


/* ============================================================
   Селектор шкалы оценок (в настройках)
   ============================================================ */

.settings-divider {
  height: 1px;
  background: var(--border);
  margin: 22px 0;
}

.rating-scale-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rating-scale-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 15px 10px;
  background: var(--bg-1);
  color: var(--text-dim);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.rating-scale-option:hover {
  border-color: var(--accent-2);
  color: var(--text);
}

.rating-scale-option.active {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 20px rgba(192, 132, 252, 0.4);
}

.rating-scale-option .scale-stars {
  font-size: 1rem;
  color: #ffd93d;
  letter-spacing: 1px;
  text-shadow: 0 0 6px rgba(255, 217, 61, 0.4);
}

.rating-scale-option.active .scale-stars {
  color: #fff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.rating-scale-option .scale-label {
  font-size: 0.85rem;
  font-weight: 600;
}

/* ============================================================
   10-звёздочная шкала (компактная)
   ============================================================ */

.stars.stars-10 {
  font-size: 0.95rem;
  gap: 2px;
}

.stars.stars-lg.stars-10 {
  font-size: 1.3rem;
  gap: 3px;
}

/* ============================================================
   Анимация кнопки "Сохранить" в настройках
   ============================================================ */

.settings-buttons .btn-done {
  transition: background 0.2s, opacity 0.2s, transform 0.15s;
  position: relative;
}

.settings-buttons .btn-done:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.settings-buttons .btn-done.saving {
  background: var(--bg-1);
  color: var(--text-dim);
  box-shadow: none;
}

.settings-buttons .btn-done.saved {
  background: linear-gradient(90deg, #22c55e, #4ade80);
  color: #fff;
  animation: savePulse 0.4s ease;
}

.settings-buttons .btn-done.error {
  background: linear-gradient(90deg, #ef4444, #f97316);
  color: #fff;
  animation: savePulse 0.4s ease;
}

@keyframes savePulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}


/* ============================================================
   Сортировка в профиле
   ============================================================ */

.profile-content-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sort-selector {
  position: relative;
}

.sort-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.sort-btn:hover {
  border-color: var(--accent-2);
  color: var(--text);
}

.sort-selector.open .sort-btn {
  border-color: var(--accent-2);
  color: var(--text);
}

.sort-btn .sort-icon {
  font-size: 1rem;
  opacity: 0.7;
}

.sort-btn .sort-arrow {
  font-size: 0.7rem;
  opacity: 0.6;
  transition: transform 0.2s;
}

.sort-selector.open .sort-arrow {
  transform: rotate(180deg);
}

.sort-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 240px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  list-style: none;
  padding: 6px;
  z-index: 30;
  display: none;
  animation: dropdown 0.15s ease;
}

.sort-selector.open .sort-menu {
  display: block;
}

.sort-menu li {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sort-menu li:hover {
  background: var(--border);
  color: var(--text);
}

.sort-menu li.active {
  background: var(--accent-grad);
  color: #fff;
}

.sort-menu li.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sort-menu li.disabled:hover {
  background: transparent;
  color: var(--text-dim);
}

.sort-menu li .soon {
  font-size: 0.7rem;
  background: var(--border);
  color: var(--text-dim-2);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

/* ============================================================
   Плейсхолдер для битых картинок
   ============================================================ */

.img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ff6b9d 0%, #c084fc 100%);
  color: #fff;
  font-size: 3rem;
  font-weight: 700;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  border-radius: inherit;
  user-select: none;
  letter-spacing: -2px;
  z-index: 1;
}

/* Лента на главной */
.mini-anime-card .img-placeholder {
  font-size: 3.5rem;
  height: 240px;
}

/* Карточки в профиле */
.anime-grid .card .img-placeholder {
  font-size: 4rem;
  height: 290px;
}

/* Страница аниме — обложка */
.anime-cover-wrap {
  position: relative;
  flex-shrink: 0;
}

.anime-main .img-placeholder {
  font-size: 5rem;
  width: 220px;
  height: 320px;
  border-radius: 14px;
  position: relative;
}

/* Части на странице аниме */
.part-card .img-placeholder {
  font-size: 2.5rem;
  height: 240px;
  border-radius: 10px 10px 0 0;
}

/* Поиск */
.suggestions li .img-placeholder {
  width: 45px;
  height: 65px;
  font-size: 1.5rem;
  border-radius: 6px;
  flex-shrink: 0;
  position: relative;
  inset: auto;
}


/* ============================================================
   Заглушка для аниме без обложки
   ============================================================ */

.anime-placeholder-img {
  object-fit: cover !important;
  object-position: center top !important;
  background: var(--bg-1);
}


/* ============================================================
   Кнопка "Случайное аниме"
   ============================================================ */

.random-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}

.random-btn:hover {
  background: var(--accent-grad);
  border-color: transparent;
  transform: scale(1.08) rotate(-10deg);
  box-shadow: 0 6px 20px rgba(192, 132, 252, 0.4);
}

.random-btn:active {
  transform: scale(0.98) rotate(0deg);
}

.random-btn:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.random-btn.spinning {
  animation: randomSpin 0.8s ease;
}

@keyframes randomSpin {
  0%   { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(180deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}

/* На мобилках — чуть компактнее */
@media (max-width: 700px) {
  .random-btn {
    width: 40px;
    height: 40px;
    font-size: 1.15rem;
  }
}


/* ============================================================
   Кнопка "Смотреть"
   ============================================================ */

.watch-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 28px;
  background: var(--bg-2);
  color: var(--text);
  border: 2px solid var(--accent-2);
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.watch-btn:hover {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(192, 132, 252, 0.4);
}

/* ============================================================
   Модалка "Где посмотреть"
   ============================================================ */

.watch-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
  z-index: 700;
  padding: 20px;
}

.watch-overlay.show {
  opacity: 1;
  visibility: visible;
}

.watch-modal {
  background: #1e1e2f; /* всегда тёмный */
  color: #fff;
  border-radius: 20px;
  padding: 30px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  transform: scale(0.9);
  transition: transform 0.25s;
  position: relative;
}

.watch-overlay.show .watch-modal {
  transform: scale(1);
}

.watch-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim-2);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 2;
}

.watch-modal-close:hover {
  background: var(--border);
  color: var(--text);
}

.watch-title {
  font-size: 1.5rem;
  margin-bottom: 25px;
  text-align: center;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Сетка 2×2 */
.watch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

/* Плитка сервиса */
.watch-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
    background: #2a2a40;
  border: 2px solid #3a3a55;
  color: #fff;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 120px;
  text-decoration: none;
}

.watch-tile .tile-icon {
  font-size: 3rem;
  line-height: 1;
}

.watch-tile .tile-name {
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.2s;
}

/* Активная плитка */
.watch-tile:hover {
  border-color: var(--accent-2);
  background: var(--border);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(192, 132, 252, 0.3);
}

.watch-tile:hover .tile-name {
  color: var(--accent-2);
}

/* Плитка "Скоро" */
.watch-tile.soon {
  opacity: 0.4;
  cursor: not-allowed;
  border-style: dashed;
}

.watch-tile.soon:hover {
  transform: none;
  border-color: var(--border);
  background: var(--bg-1);
  box-shadow: none;
}

.watch-tile.soon:hover .tile-name {
  color: var(--text);
}

.watch-note {
  text-align: center;
  color: var(--text-dim-2);
  font-size: 0.75rem;
  font-style: italic;
  margin-top: 10px;
}

.watch-grid-single {
  grid-template-columns: 1fr;
}

/* ============================================================
   Логотипы сервисов в модалке "Где посмотреть"
   ============================================================ */

.watch-tile .tile-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}

.watch-tile:hover .tile-logo {
  transform: scale(1.08);
}

/* Для AnimeGo — если лого тёмное, фон может быть не нужен */
/* Плитка AnimeGo — всегда тёмная (для белого логотипа) */
.watch-tile.animego {
  background: #1a1a2e;
  border-color: #2a2a40;
}

.watch-tile.animego:hover {
  background: #2a2a40;
  border-color: var(--accent-2);
}

.watch-tile.animego .tile-logo-text {
  color: #fff;
}

.watch-tile.kp {
  background: #1a1a2e;
  border-color: #2a2a40;
}

.watch-tile.kp:hover {
  background: #2a2a40;
  border-color: var(--accent-2);
}

/* Если логотип не загрузился — покажем fallback */
.watch-tile .tile-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  background: transparent;
  padding: 0;
  box-shadow: none;
  transition: transform 0.2s;
}

/* ============================================================
   Текстовый логотип AnimeGO
   ============================================================ */

.watch-tile .tile-logo-text {
  font-family: 'Arial Black', 'Segoe UI', Arial, sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
  user-select: none;
}

.watch-tile:hover .tile-logo-text {
  transform: scale(1.08);
}


/* Увеличенный логотип Кинопоиска */
.watch-tile.kp .tile-logo {
  width: 120px;
  height: 120px;
}

/* Можно чуть увеличить сам тайл Кинопоиска */
.watch-tile.kp {
  min-height: 140px;
}

/* ============================================================
   Кнопка "В топ" под обложкой
   ============================================================ */

.anime-cover-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.top-place-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-2);
  color: var(--text-dim);
  border: 2px dashed var(--border);
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
  width: 100%;
  justify-content: center;
}

.top-place-btn:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
  border-style: solid;
}

.top-place-btn.has-place {
  background: var(--accent-grad);
  border-color: transparent;
  border-style: solid;
  color: #fff;
  box-shadow: 0 6px 20px rgba(192, 132, 252, 0.4);
}

.top-place-btn.has-place:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(192, 132, 252, 0.6);
}

/* ============================================================
   Модалка "Куда поставить"
   ============================================================ */

.top-place-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
  z-index: 700;
  padding: 20px;
}

.top-place-overlay.show {
  opacity: 1;
  visibility: visible;
}

.top-place-modal {
  background: var(--bg-2);
  border-radius: 20px;
  padding: 30px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  transform: scale(0.9);
  transition: transform 0.25s;
  position: relative;
}

.top-place-overlay.show .top-place-modal {
  transform: scale(1);
}

.top-place-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim-2);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.top-place-close:hover {
  background: var(--border);
  color: var(--text);
}

.top-place-title {
  font-size: 1.5rem;
  margin-bottom: 8px;
  text-align: center;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.top-place-subtitle {
  text-align: center;
  color: var(--text-dim-2);
  font-size: 0.9rem;
  margin-bottom: 25px;
  word-break: break-word;
}

.top-place-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.top-place-cell {
  aspect-ratio: 1;
  background: var(--bg-1);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-place-cell:hover:not(.occupied):not(:disabled) {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  transform: scale(1.05);
}

.top-place-cell.current {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 15px rgba(192, 132, 252, 0.5);
}

.top-place-cell.occupied {
  background: var(--bg-1);
  color: var(--text-dim-2);
  opacity: 0.35;
  cursor: not-allowed;
  border-style: dashed;
}

.top-place-remove {
  display: block;
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.top-place-remove:hover {
  background: rgba(239, 68, 68, 0.15);
}


/* ============================================================
   Бейдж места в топе на карточке в профиле
   ============================================================ */

/* Базовые стили бейджа топ-места */
.card-top-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  color: #1e1e2f;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 800;
  z-index: 5;
  letter-spacing: 0.5px;
  pointer-events: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}
/* 🥇 Золото: места 1-5 */
.card-top-badge.top-gold {
  background: linear-gradient(135deg, #ffd93d, #ffa500);
  box-shadow: 0 4px 15px rgba(255, 204, 0, 0.55);
}

/* 🥈 Серебро: места 6-10 */
.card-top-badge.top-silver {
  background: linear-gradient(135deg, #e8e8e8, #a8a8a8);
  box-shadow: 0 4px 15px rgba(200, 200, 200, 0.5);
}

/* 🥉 Бронза: места 11-25 */
.card-top-badge.top-bronze {
  background: linear-gradient(135deg, #d4a574, #a0623a);
  color: #fff;
  box-shadow: 0 4px 15px rgba(184, 115, 51, 0.5);
}

/* ============================================================
   Поиск по своему списку в профиле
   ============================================================ */

.profile-search-wrap {
  position: relative;
  margin-bottom: 20px;
}

.profile-search-wrap input {
  width: 100%;
  padding: 12px 45px 12px 45px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.profile-search-wrap input:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 20px rgba(192, 132, 252, 0.25);
}

.profile-search-wrap input::placeholder {
  color: var(--text-dim-2);
}

.profile-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  opacity: 0.6;
  pointer-events: none;
}

.profile-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-dim);
  border: none;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.profile-search-clear:hover {
  background: var(--red);
  color: #fff;
}

/* ============================================================
   Переключатель темы в настройках
   ============================================================ */

.theme-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 15px 10px;
  background: var(--bg-1);
  color: var(--text-dim);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.theme-option:hover {
  border-color: var(--accent-2);
  color: var(--text);
}

.theme-option.active {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 20px rgba(192, 132, 252, 0.4);
}

.theme-option .theme-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.theme-option .theme-label {
  font-size: 0.85rem;
  font-weight: 600;
}

/* ============================================================
   Блок "Трейлер" на странице аниме
   ============================================================ */

.anime-trailer-wrap {
  padding: 0 40px 30px;
}

.anime-trailer {
  background: var(--bg-1);
  border-radius: 15px;
  padding: 20px;
}

.anime-trailer-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
  padding: 5px 0;
  border-radius: 8px;
}

.anime-trailer-title:hover {
  color: var(--accent-2);
}

.trailer-toggle-icon {
  font-size: 0.85rem;
  color: var(--text-dim-2);
  transition: transform 0.2s;
  margin-left: 10px;
}

/* Свёрнутое состояние */
.anime-trailer.collapsed .trailer-content {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  overflow: hidden;
}

.anime-trailer .trailer-content {
  max-height: 2000px;
  opacity: 1;
  transition: max-height 0.35s ease, opacity 0.25s ease, margin 0.25s ease;
}

.anime-trailer.collapsed .anime-trailer-title {
  margin-bottom: 0;
}

.trailer-preview {
  position: relative;
  width: 100%;
  max-width: 800px;
  aspect-ratio: 16 / 9;
  margin: 0 auto;          /* ← ЦЕНТРИРУЕМ ПО ГОРИЗОНТАЛИ */
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: #000;
  transition: transform 0.25s, box-shadow 0.25s;
}

.trailer-preview:hover {
  transform: scale(1.01);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.trailer-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.trailer-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 0, 0, 0.9);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 8px 30px rgba(255, 0, 0, 0.5);
  padding-left: 6px;
}

.trailer-preview:hover .trailer-play-btn {
  background: #ff0000;
  transform: translate(-50%, -50%) scale(1.1);
}

.trailer-play-btn svg {
  width: 36px;
  height: 36px;
}

/* ============================================================
   Модалка с YouTube-плеером
   ============================================================ */

.trailer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
  z-index: 800;
  padding: 20px;
}

.trailer-overlay.show {
  opacity: 1;
  visibility: visible;
}

.trailer-modal {
  position: relative;
  width: 100%;
  max-width: 900px;
  transform: scale(0.9);
  transition: transform 0.25s;
}

.trailer-overlay.show .trailer-modal {
  transform: scale(1);
}

.trailer-close {
  position: absolute;
  top: -45px;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trailer-close:hover {
  background: #ef4444;
}

.trailer-iframe-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
}

.trailer-iframe-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Адаптив */
@media (max-width: 700px) {
  .anime-trailer-wrap {
    padding: 0 20px 20px;
  }

  .trailer-play-btn {
    width: 60px;
    height: 60px;
  }

  .trailer-play-btn svg {
    width: 28px;
    height: 28px;
  }

  .trailer-close {
    top: -40px;
    width: 32px;
    height: 32px;
  }
}

/* ============================================================
   Расширенный поиск
   ============================================================ */

.advanced-search-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 25px;
  align-items: start;
}

/* ЛЕВАЯ КОЛОНКА — РЕЗУЛЬТАТЫ */
.advanced-search-results {
  min-width: 0;
}

.advanced-search-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.advanced-search-back-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.advanced-search-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
}

.advanced-search-count {
  font-size: 0.95rem;
  color: var(--text-dim-2);
  background: var(--bg-2);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.advanced-search-load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 25px;
}

.load-more-btn {
  padding: 12px 40px;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 25px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.load-more-btn:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
  transform: translateY(-2px);
}

.advanced-search-filters {
  background: var(--bg-2);
  border-radius: 15px;
  padding: 16px;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  /* Скрываем скроллбар, но оставляем прокрутку */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.advanced-search-filters::-webkit-scrollbar {
  display: none;
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.filters-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.filters-close {
  display: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim-2);
  border: none;
  font-size: 1rem;
  cursor: pointer;
}

.filters-close:hover {
  background: var(--border);
  color: var(--text);
}

.filter-group {
  margin-bottom: 12px;    /* ← было 18 */
  padding-bottom: 12px;   /* ← было 18 */
  border-bottom: 1px solid var(--border);
}

.filter-group:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.filter-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.filter-range {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-range input {
  flex: 1;
  width: 100%;
  padding: 8px 10px;       /* ← меньше */
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--text);
  font-size: 0.88rem;
  outline: none;
  font-family: inherit;
  min-width: 0;
}

.filter-range input:focus {
  border-color: var(--accent-2);
}

.filter-range-sep {
  color: var(--text-dim-2);
  font-weight: 600;
}

.genres-list {
  max-height: 160px;      /* ← было 220 */
  min-height: 140px;      /* ← было 180 */
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-1);
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.genres-list::-webkit-scrollbar {
  width: 5px;
}

.genres-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.genres-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent-2);
} 

.genres-list::-webkit-scrollbar {
  width: 6px;
}

.genres-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.genres-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent-2);
}

.genres-loading {
  padding: 20px;
  text-align: center;
  color: var(--text-dim-2);
  font-size: 0.9rem;
}

.genre-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;       /* ← было 7×10 */
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.genre-checkbox:hover {
  background: var(--border);
}

.genre-checkbox input {
  display: none;
}

.genre-checkbox-box {
  width: 18px;             /* ← вернули */
  height: 18px;
  border-radius: 4px;
  border: 2px solid var(--border);
  background: transparent;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  position: relative;
}

.genre-checkbox input:checked + .genre-checkbox-box {
  background: var(--accent-grad);
  border-color: transparent;
}

.genre-checkbox input:checked + .genre-checkbox-box::after {
  content: '';
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.genre-checkbox-label {
  font-size: 0.88rem;      /* ← вернули */
  color: var(--text-dim);
}

.genre-checkbox input:checked ~ .genre-checkbox-label {
  color: var(--text);
  font-weight: 500;
}

.genres-actions {
  margin-top: 6px;
}

.genres-clear-btn {
  padding: 5px 10px;     /* ← меньше */
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim-2);
  font-size: 0.75rem;    /* ← меньше */
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.genres-clear-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

.filter-radio-group {
  display: flex;
  flex-direction: column;
  gap: 4px;                /* ← чуть больше */
}

.filter-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;       /* ← было 7×10 */
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.filter-radio:hover {
  background: var(--border);
}

.filter-radio input {
  display: none;
}

.filter-radio input + span {
  position: relative;
  padding-left: 28px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.filter-radio input + span::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  transition: all 0.15s;
}

.filter-radio input:checked + span {
  color: var(--text);
  font-weight: 500;
}

.filter-radio input:checked + span::before {
  border-color: var(--accent-2);
  background: var(--accent-2);
  box-shadow: inset 0 0 0 3px var(--bg-2);
}

/* Кнопки */
.filter-buttons {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  padding-top: 12px;       /* ← было 16 */
  border-top: 1px solid var(--border);
}

.filter-buttons button {
  flex: 1;
  padding: 10px;           /* ← меньше */
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s;
}

.filter-buttons .btn-done {
  background: var(--accent-grad);
  color: #fff;
}

.filter-buttons .btn-done:hover {
  opacity: 0.9;
}

.filter-buttons .btn-done:disabled {
  opacity: 0.6;
  cursor: wait;
}

.filter-buttons .btn-cancel {
  background: var(--border);
  color: var(--text);
}

.filter-buttons .btn-cancel:hover {
  background: var(--bg-3);
}

/* Сетка результатов с учётом новой колонки */
.advanced-search-results .anime-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

/* Мобильная версия */
@media (max-width: 900px) {
  .advanced-search-layout {
    grid-template-columns: 1fr;
  }

  .advanced-search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

.advanced-search-filters {
  background: var(--bg-2);
  border-radius: 15px;
  padding: 15px;          /* ← было 20 */
  position: sticky;
  top: 90px;
  height: auto;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.advanced-search-filters::-webkit-scrollbar {
  display: none;
}

  .advanced-search-filters.open {
    right: 0;
  }

  .filters-close {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}


/* Кнопка "Расширенный поиск" */
.advanced-search-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  text-decoration: none;
  line-height: 1;
}

.advanced-search-btn:hover {
  background: var(--accent-grad);
  border-color: transparent;
  transform: scale(1.08) rotate(90deg);
  box-shadow: 0 6px 20px rgba(192, 132, 252, 0.4);
}

@media (max-width: 700px) {
  .advanced-search-btn {
    width: 40px;
    height: 40px;
    font-size: 1.15rem;
  }
}