/* Kotodama · главная. Тёмная тема как на скрине */
:root {
  --bg: #0a0614;
  --panel: #141020;
  --panel-2: #171324;
  --border: rgba(255, 255, 255, 0.09);
  --text: #f3f1f7;
  --muted: #8b8798;
  --accent: #8b2cf6; /* цвет скроллбара = цвет фокусов/ховера админки */
  --accent-light: #a855f7;
  --gold: #fbbf24;
  --radius: 12px;
}

* { box-sizing: border-box; }
html { scrollbar-color: var(--accent) #0d0a16; }
/* Кастомный курсор: лапка + кот */
body { cursor: url('/img/cursor/default-32.png') 6 4, auto; }
a, button, select, input[type="button"], input[type="submit"], label, summary,
.card, .genre-chip, [role="button"], [role="tab"], [role="menuitem"] {
  cursor: url('/img/cursor/pointer-32.png') 16 2, pointer !important;
}
input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input[type="url"], input[type="number"], textarea {
  cursor: text;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Кастомный скроллбар как на скрине */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #0d0a16; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent-light), var(--accent));
  border-radius: 8px;
  border: 2px solid #0d0a16;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-light); }

/* Фон: твоя картинка на весь экран.
   F-11: background.jpg весил 143.6 KB и был 75% критического пути. Теперь
   отдаём background.webp (≈29 KB — ресайз/пережатие), а JPEG оставлен
   фолбэком: браузеры, не понимающие image-set()/WebP, берут строку выше. */
.bg {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background-color: var(--bg);
  background-image: url("/img/background.jpg");
  background-image: image-set(
    url("/img/background.webp") type("image/webp"),
    url("/img/background.jpg") type("image/jpeg")
  );
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}
/* лёгкое затемнение чтобы текст читался, картинку не перекрывает */
.bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,6,20,.15), rgba(10,6,20,.55));
}
.bg-glow { display: none; }

/* Летающая пыль: мелкие светящиеся частицы медленно поднимаются */
.dust { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.dust i {
  position: absolute; bottom: -12px; border-radius: 50%;
  background: radial-gradient(circle, rgba(216, 180, 255, 0.9), rgba(139, 44, 246, 0.28) 55%, transparent 70%);
  opacity: 0;
  animation-name: dustRise;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.dust i:nth-child(1) { left: 4%; width: 4px; height: 4px; animation-duration: 18s; animation-delay: -2s; }
.dust i:nth-child(2) { left: 12%; width: 3px; height: 3px; animation-duration: 24s; animation-delay: -11s; }
.dust i:nth-child(3) { left: 21%; width: 5px; height: 5px; animation-duration: 16s; animation-delay: -6s; }
.dust i:nth-child(4) { left: 33%; width: 3px; height: 3px; animation-duration: 22s; animation-delay: -15s; }
.dust i:nth-child(5) { left: 44%; width: 4px; height: 4px; animation-duration: 19s; animation-delay: -9s; }
.dust i:nth-child(6) { left: 53%; width: 2px; height: 2px; animation-duration: 26s; animation-delay: -4s; }
.dust i:nth-child(7) { left: 61%; width: 5px; height: 5px; animation-duration: 17s; animation-delay: -13s; }
.dust i:nth-child(8) { left: 70%; width: 3px; height: 3px; animation-duration: 23s; animation-delay: -7s; }
.dust i:nth-child(9) { left: 79%; width: 4px; height: 4px; animation-duration: 20s; animation-delay: -17s; }
.dust i:nth-child(10) { left: 87%; width: 3px; height: 3px; animation-duration: 25s; animation-delay: -10s; }
.dust i:nth-child(11) { left: 94%; width: 4px; height: 4px; animation-duration: 18s; animation-delay: -20s; }
.dust i:nth-child(12) { left: 27%; width: 2px; height: 2px; animation-duration: 27s; animation-delay: -1s; }
.dust i:nth-child(13) { left: 57%; width: 3px; height: 3px; animation-duration: 21s; animation-delay: -22s; }
.dust i:nth-child(14) { left: 74%; width: 2px; height: 2px; animation-duration: 28s; animation-delay: -14s; }
@keyframes dustRise {
  0% { transform: translate(0, 0); opacity: 0; }
  12% { opacity: 0.8; }
  50% { transform: translate(26px, -55vh); }
  88% { opacity: 0.8; }
  100% { transform: translate(-14px, -112vh); opacity: 0; }
}
@media (max-width: 720px) {
  .dust i:nth-child(n+9) { display: none; }
}
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ШАПКА стеклянная */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 6, 20, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.header-left, .header-right { display: flex; align-items: center; gap: 10px; }
/* Левая группа плотнее: надпись ближе к кнопке новостей */
.header-left { gap: 4px; }

/* ЛОГО: картинка img/logo.png строго по центру надписи.
   Оба слоя центрированы (left:50% + translate -50%), поэтому надпись
   появляется ровно на месте лого. Ховер: лого уезжает влево и испаряется. */
.logo {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin: 0; padding: 0;
  width: 190px; height: 56px; text-decoration: none; overflow: hidden;
  line-height: 1; vertical-align: middle;
}
.logo-img {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  transform: translateY(-2px);
  transition: transform .45s ease .12s;
}
.logo-img img { width: 56px; height: 56px; object-fit: contain; display: block; }
/* Надпись статична: всегда на своём месте, без движения — только проявляется.
   top скорректирован (-2px): у крупного кегля низ уходил ниже низа «Новостей»,
   так выравниваем базовые линии. */
.logo-text {
  position: absolute; left: 50%; top: calc(50% - 2px);
  transform: translate(-50%, -50%) translateX(30px);
  font-weight: 800; font-size: 22px; letter-spacing: .2px; opacity: 0;
  line-height: 1; white-space: nowrap;
  background: linear-gradient(90deg, #c084fc, #8b2cf6);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  transition: opacity .3s ease;
}
/* Ховер: кот уезжает влево (не исчезает), текст проявляется на месте */
.logo:hover .logo-img, .logo:focus-visible .logo-img { transform: translate(-45px, -2px); transition: transform .45s ease; }
.logo:hover .logo-text, .logo:focus-visible .logo-text { opacity: 1; transition: opacity .3s ease .12s; }

/* Новости: серый -> белый. Высота и центрирование как у остальных — общий Y */
.nav-link {
  background: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  height: 38px; margin: 0; line-height: 1;
  color: var(--muted); font-size: 15px; padding: 0 10px; border-radius: 8px;
  transition: color .2s ease;
}
.nav-link:hover { color: #fff; }

/* Колокольчик: рамка+svg -> белые */
.icon-btn {
  width: 38px; height: 38px; margin: 0; padding: 0; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border); border-radius: 10px;
  color: var(--muted); cursor: pointer; transition: color .2s, border-color .2s, background .2s;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { color: #fff; border-color: #fff; }
.icon-btn { position: relative; }

/* Обёртка колокола — якорь для попапа */
.bell-wrap { position: relative; display: inline-flex; }

/* Точка непрочитанных */
.bell-dot {
  position: absolute; top: 8px; right: 9px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-light);
  box-shadow: 0 0 0 2px #0d0a16;
}
.bell-dot[hidden] { display: none; }

/* Попап уведомлений: отцентрирован по центру кнопки */
.notif-pop {
  position: absolute; top: calc(100% + 12px); left: 50%;
  transform: translateX(-50%);
  width: 340px; max-width: calc(100vw - 24px); max-height: 380px;
  display: flex; flex-direction: column; overflow: hidden;
  background: rgba(20, 14, 32, 0.96);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  z-index: 60;
  animation: popIn 0.18s ease;
}
.notif-pop[hidden] { display: none; }
@keyframes popIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 14px;
}
.notif-head button {
  background: none; border: 0; cursor: pointer;
  color: var(--accent-light); font-size: 12.5px; padding: 4px;
}
.notif-head button:hover { color: #fff; }
.notif-list { overflow-y: auto; display: flex; flex-direction: column; }
.notif-item {
  position: relative; padding: 11px 34px 11px 14px; border-bottom: 1px solid rgba(255,255,255,.05);
  font-size: 13.5px; cursor: pointer;
}
.notif-del {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px;
  background: none; border: 0; border-radius: 6px; cursor: pointer;
  color: var(--muted); font-size: 16px; line-height: 1; padding: 0;
  opacity: 0; transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.notif-item:hover .notif-del { opacity: 1; }
.notif-del:hover { color: #ff7b7b; background: rgba(255, 80, 80, 0.12); }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: rgba(139,44,246,.1); }
.notif-item.unread { background: rgba(139,44,246,.12); }
.notif-item time { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.notif-empty { margin: 0; padding: 22px 14px; text-align: center; color: var(--muted); font-size: 13.5px; }
.notif-empty[hidden] { display: none; }

/* Админка: ховер рамка+svg фиолетовые (цвет скроллбара) */
.admin-btn:hover { color: var(--accent-light); border-color: var(--accent); }
.admin-btn[hidden] { display: none; }

/* Ник / Войти: фиолетовый, ховер светлее */
.user-btn {
  border: 0; cursor: pointer; border-radius: 10px; padding: 0 18px; height: 38px; margin: 0;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
  background: #6d1fd4; color: #fff; font-weight: 700; font-size: 14px;
  transition: background .2s ease, transform .1s ease;
}
.user-btn:hover { background: var(--accent-light); }
.user-btn:active { transform: scale(.98); }
/* Состояние проверки сессии: шиммер вместо текста, клики выключены */
.user-btn.loading { pointer-events: none; }
.btn-skeleton {
  display: block; width: 64px; height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,.25), rgba(255,255,255,.55), rgba(255,255,255,.25));
  background-size: 200% 100%;
  animation: shimmer 1.1s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* HERO: надпись летает вверх-вниз */
.hero { text-align: center; padding: 34px 20px 60px; }
.hero-title {
  margin: 0; font-size: clamp(30px, 5vw, 48px); font-weight: 800; letter-spacing: .3px;
  background: linear-gradient(180deg, #c084fc, #8b2cf6);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: floatY 5s ease-in-out infinite;
}
@keyframes floatY { 0%,100% { transform: translateY(-6px); } 50% { transform: translateY(6px); } }
.hero-sub { margin: 14px 0 0; color: var(--muted); font-size: 16px; }

/* КАТАЛОГ */
.section-title { font-size: 24px; margin: 0 0 18px; }
.catalog-bar { display: flex; gap: 10px; margin-bottom: 22px; }
.search-wrap { flex: 1; }
.search {
  width: 100%; height: 46px; padding: 0 16px; border-radius: var(--radius);
  background: #100c1c; border: 1px solid var(--border); color: var(--text);
  outline: none; font-size: 14px; transition: border-color .2s ease, box-shadow .2s ease;
}
.search::placeholder { color: #6b6778; }
.search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,44,246,.18); }

/* Строка "Найдено: N" — видна только при активном поиске */
.search-meta { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.search-meta[hidden] { display: none; }

/* Витрина над каталогом: один слот на всю ширину + стрелки */
.spot { position: relative; margin-bottom: 24px; }
.spot[hidden] { display: none; }
.spot-one {
  position: relative; cursor: pointer; overflow: hidden;
  display: flex; align-items: flex-end;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 90px 70px 22px 22px;
  min-height: 300px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.spot-one.skeleton { cursor: default; }
.spot-sk-label { width: 110px; height: 24px; border-radius: 8px; position: absolute; top: 12px; left: 14px; }
.spot-sk-info { position: relative; z-index: 1; width: 100%; max-width: 420px; }
.spot-sk-title { height: 28px; border-radius: 8px; margin-bottom: 10px; }
.spot-sk-meta { height: 16px; width: 45%; border-radius: 6px; margin-bottom: 16px; }
.spot-sk-btn { height: 40px; width: 150px; border-radius: 10px; }
/* Фазы свайпа: --sx задаёт JS (направление) */
.spot-one.swap-out { opacity: 0; transform: translateX(var(--sx, -60px)); }
.spot-one.swap-in { opacity: 0; transform: translateX(var(--sx, 60px)); transition: none; }
@media (prefers-reduced-motion: reduce) {
  .spot-one { transition: none; }
}
/* Картинка-фон во всю длину плашки */
.spot-bg { position: absolute; inset: 0; }
.spot-bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spot-one::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(5, 3, 12, 0.92) 20%, rgba(5, 3, 12, 0.45) 55%, rgba(5, 3, 12, 0.15));
}
.spot-label {
  position: absolute; top: 12px; left: 14px; z-index: 1;
  background: rgba(0,0,0,.72); border-radius: 8px; padding: 4px 10px;
  font-size: 11.5px; font-weight: 700; color: var(--accent-light);
}
.spot-info { position: relative; z-index: 1; }
.spot-info h4 { margin: 0 0 6px; font-size: 24px; text-shadow: 0 2px 12px rgba(0,0,0,.8); }
.spot-info p { margin: 0 0 14px; font-size: 14px; color: #d6d0e4; text-shadow: 0 1px 8px rgba(0,0,0,.8); }
.spot-go {
  height: 40px; padding: 0 26px; border: 0; cursor: pointer; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 700;
}
.spot-go:hover { background: var(--accent-light); }
.spot-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  background: rgba(0,0,0,.55); border: 1px solid var(--border);
  color: #fff; font-size: 22px; line-height: 1;
  transition: border-color 0.2s, background 0.2s;
}
.spot-arrow:hover { border-color: var(--accent); background: rgba(139, 44, 246, 0.3); }
.spot-arrow.left { right: 58px; }
.spot-arrow.right { right: 8px; }
@media (max-width: 720px) {
  .spot-one { padding: 70px 12px 62px 12px; min-height: 220px; }
  .spot-label { left: 12px; }
  .spot-info h4 { font-size: 18px; }
  .spot-arrow { top: auto; bottom: 10px; transform: none; width: 40px; height: 40px; }
  .spot-arrow.left { right: 58px; }
  .spot-arrow.right { right: 12px; }
}
/* Превью широкого арта витрины в админке */
#asImg { width: 100%; max-width: 340px; aspect-ratio: 16/9; }
/* Вкладки категории под поиском: Аниме / Мультсериалы */
.cat-row { display: flex; gap: 8px; margin-bottom: 20px; }
.cat-tab {
  flex: 1; height: 42px; border-radius: 12px; cursor: pointer;
  background: #100c1c; border: 1px solid var(--border);
  color: var(--muted); font-size: 14px; font-weight: 700;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.cat-tab:hover { color: #fff; border-color: #fff; }
.cat-tab.active { color: #fff; border-color: var(--accent); background: rgba(139, 44, 246, 0.18); }

/* Пустое состояние поиска */
.catalog-empty { text-align: center; padding: 40px 20px 60px; color: var(--muted); }
.catalog-empty[hidden] { display: none; }
.catalog-empty p { margin: 0 0 14px; font-size: 15px; }
.catalog-empty button {
  height: 40px; padding: 0 20px; border-radius: 10px; cursor: pointer;
  background: #6d1fd4; border: 0; color: #fff; font-weight: 700; font-size: 13.5px;
  transition: background .2s ease;
}
.catalog-empty button:hover { background: var(--accent-light); }

/* Подсветка совпадения в названии */
.card-title mark { background: rgba(139,44,246,.45); color: #fff; border-radius: 3px; padding: 0 1px; }

/* Скелетоны загрузки: стоят в HTML сразу, JS меняет на данные — сайт не скачет */
.sk {
  background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.14), rgba(255,255,255,.06));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
.card.skeleton { pointer-events: none; }
.sk-poster { position: absolute; inset: 0; overflow: hidden; }
/* Размеры строк = размерам настоящих (заголовок 18px + отступ 6 + мета 16),
   тело карточки уже даёт падинги — свои отступы не добавляем */
.sk-line { height: 20px; border-radius: 6px; margin: 0 0 6px; }
.sk-line.short { height: 16px; margin: 0; width: 60%; }
/* Полоса блика, пробегающая по постеру (transform — плавно, без дёрганий layout) */
.sk-poster::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  animation: glare 1.4s linear infinite;
  will-change: transform;
}
@keyframes glare { from { transform: translateX(-110%); } to { transform: translateX(230%); } }
/* Постер держит заглушку пока картинка не загрузилась */
.card-poster.loading .poster-img { opacity: 0; }
.card-poster .poster-img { transition: opacity 0.3s ease, transform 0.35s ease; }
.card-poster.loading .sk-poster { display: block; }
.card-poster:not(.loading) .sk-poster { display: none; }
.comment.skeleton { pointer-events: none; }
.comment.skeleton .avatar { border: 0; }
.comment.skeleton .sk-line { margin: 4px 0 0; }
.comment.skeleton .sk-line.short { margin-top: 8px; width: 45%; }
.sk-chip { display: inline-block; width: 72px; height: 28px; border-radius: 20px; }
.sk-meta { display: block; height: 14px; width: 75%; border-radius: 6px; }
.sk-area { min-height: 86px; border-radius: 12px; }
.comment-form.skeleton { pointer-events: none; }
.comment-form.skeleton::after { display: none; }
.admin-user.skeleton { pointer-events: none; }
.admin-user.skeleton .avatar { border: 0; }
.admin-user.skeleton .sk-line { flex: 1; margin: 0; }

/* Кнопка Все: ховер текст+svg+рамка белые */
.filter-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px;
  background: #100c1c; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--muted); cursor: pointer; font-size: 14px;
  transition: color .2s, border-color .2s;
}
.filter-btn svg { width: 16px; height: 16px; }
.filter-btn:hover { color: #fff; border-color: #fff; }
.filter-btn:hover svg { color: #fff; }
/* Активный жанр: подпись на кнопке белая */
.filter-btn.active { color: #fff; border-color: var(--accent); }

/* Обёртка фильтра — якорь для попапа */
.filter-wrap { position: relative; flex-shrink: 0; display: inline-flex; }

/* Попап жанров: вид как у уведомлений, прижат к правому краю кнопки
   (кнопка у правого края экрана — по центру кнопки вылезал бы за край) */
.filter-pop {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 230px; max-width: calc(100vw - 24px); max-height: 340px;
  display: flex; flex-direction: column; overflow: hidden;
  background: rgba(20, 14, 32, 0.96);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  z-index: 60;
  animation: popInR 0.18s ease;
}
.filter-pop[hidden] { display: none; }
@keyframes popInR {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.filter-head {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 14px;
}
.filter-list { overflow-y: auto; display: flex; flex-direction: column; padding: 6px; }
.filter-item {
  background: none; border: 0; cursor: pointer; text-align: left;
  padding: 9px 10px; border-radius: 8px; font-size: 13.5px; color: var(--muted);
  transition: background .15s, color .15s;
}
.filter-item:hover { background: rgba(139,44,246,.1); color: #fff; }
.filter-item.active { background: rgba(139,44,246,.18); color: #fff; }

/* КАРТОЧКИ: 1 тестовая, дальше рендерит backend */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; padding-bottom: 60px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
  cursor: pointer;
}
.card:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: 0 12px 32px rgba(139,44,246,.25); }
.card-poster { position: relative; aspect-ratio: 3/4; overflow: hidden; background: #1d1830; }
.poster-placeholder {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #2a2140, #171226);
  transition: transform .35s ease;
}
.card:hover .poster-placeholder { transform: scale(1.08); }
.poster-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .35s ease;
}
.card:hover .poster-img { transform: scale(1.08); }
.rating {
  position: absolute; top: 8px; left: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(0,0,0,.72); border-radius: 8px; padding: 4px 8px;
  font-size: 12px; font-weight: 700; color: #fff;
}
.rating svg { width: 13px; height: 13px; color: var(--gold); }
/* Статус тайтла: тот же фон, что у рейтинга, но правый нижний угол */
.card-status {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,.72); border-radius: 8px; padding: 4px 8px;
  font-size: 12px; font-weight: 700; color: #fff;
}
.card-body { padding: 12px 14px 14px; }
.card-title { margin: 0 0 6px; font-size: 15px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { margin: 0; font-size: 12.5px; line-height: 16px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ПОДВАЛ — без затемнения как у шапки: прозрачный, без blur */
.footer { position: relative; overflow: hidden; border-top: 1px solid var(--border); background: transparent; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; padding-bottom: 20px; }
.footer-links button {
  background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 14px; padding: 4px 2px;
  transition: color .2s;
}
.footer-links button:hover { color: var(--accent-light); }
.dot { color: var(--muted); margin: 0 4px; }
.copy { margin: 0; color: var(--muted); font-size: 14px; }

.socials { display: flex; gap: 8px; }
.soc {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 10px;
  transition: background .2s, color .2s, border-color .2s;
}
.soc svg { width: 18px; height: 18px; }
/* Иконки сразу в цветах брендов */
.soc-tg { color: #229ED9; }
.soc-ds { color: #5865F2; }
.soc-tw { color: #9146FF; }
.soc-bo { color: #ff5c25; }
.soc-vk { color: #0077FF; }
.soc-tg:hover { background: #229ED9; border-color: #229ED9; color: #fff; }
.soc-ds:hover { background: #5865F2; border-color: #5865F2; color: #fff; }
.soc-tw:hover { background: #9146FF; border-color: #9146FF; color: #fff; }
.soc-bo:hover { background: #ff5c25; border-color: #ff5c25; color: #fff; }
.soc-vk:hover { background: #0077FF; border-color: #0077FF; color: #fff; }

/* МОДАЛКА ВХОД/РЕГИСТРАЦИЯ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(5, 3, 10, 0.65);
  animation: fadeIn 0.18s ease;
}
.modal-overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative; width: 400px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px);
  overflow-y: auto; padding: 26px 26px 24px;
  background: #1e1830;
  border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  animation: popUp 0.2s ease;
}
@keyframes popUp {
  from { opacity: 0; transform: scale(0.97) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: 0; cursor: pointer; padding: 6px;
  color: var(--muted); transition: color 0.2s;
}
.modal-close svg { width: 18px; height: 18px; display: block; }
.modal-close:hover { color: #fff; }
.modal-title { margin: 0 0 18px; text-align: center; font-size: 18px; font-weight: 800; }

.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: #100c1c; border-radius: 10px; padding: 4px; margin-bottom: 20px;
}
.auth-tab {
  border: 0; cursor: pointer; height: 38px; border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 14px; font-weight: 600;
  transition: background 0.2s, color 0.2s;
}
.auth-tab.active { background: var(--accent); color: #fff; }

.field { display: block; margin: 0 0 14px; }
.field label { display: block; margin-bottom: 7px; font-size: 12.5px; color: var(--muted); cursor: default; }
.field input {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 10px;
  background: #100c1c; border: 1px solid var(--border); color: var(--text);
  outline: none; font-size: 14px; transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder { color: #6b6778; }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,44,246,.18); }
.field textarea {
  width: 100%; min-height: 110px; padding: 12px 14px; border-radius: 10px; resize: vertical;
  background: #100c1c; border: 1px solid var(--border); color: var(--text);
  outline: none; font-size: 14px; font-family: inherit; line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea::placeholder { color: #6b6778; }
.field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,44,246,.18); }
.field textarea:disabled { opacity: 0.6; }

.turnstile-slot { margin: 4px 0 14px; display: flex; justify-content: center; }
.turnstile-slot:empty { display: none; }
/* Заглушка капчи пока нет Cloudflare-ключей (dev-режим) */
.turnstile-dev {
  width: 100%; padding: 12px 14px; border-radius: 10px; font-size: 12.5px;
  color: var(--muted); background: #100c1c; border: 1px dashed var(--border);
  text-align: center;
}

.form-error { margin: 0 0 12px; font-size: 13px; color: #f87171; }
.form-error[hidden] { display: none; }
.form-info { margin: 0 0 12px; font-size: 13px; color: #4ade80; }
.form-info[hidden] { display: none; }

.form-submit {
  width: 100%; height: 46px; border: 0; cursor: pointer; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 15px; font-weight: 700;
  transition: background 0.2s ease, opacity 0.2s;
}
.form-submit:hover { background: var(--accent-light); }
.form-submit:disabled { opacity: 0.6; cursor: wait; }

/* Вход через Telegram */
.tg-login { margin-top: 18px; }
.tg-login[hidden] { display: none; }
.tg-div { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; color: var(--muted); font-size: 12.5px; }
.tg-div::before, .tg-div::after { content: ''; flex: 1; border-top: 1px solid var(--border); }
.tg-div span { flex-shrink: 0; }
#tgLoginSlot { display: flex; justify-content: center; min-height: 40px; }
.tg-btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 22px; border: 0; border-radius: 10px; cursor: pointer;
  background: #229ED9; color: #fff; font-size: 14.5px; font-weight: 700;
  transition: background 0.2s ease, transform 0.1s ease;
}
.tg-btn:hover { background: #1d8dc2; }
.tg-btn:active { transform: scale(0.98); }
.tg-btn svg { width: 20px; height: 20px; }

/* ПРОФИЛЬ */
.modal-profile { width: 520px; }
/* Заглушка на время загрузки данных профиля */
.profile-loader {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  background: #1e1830; border-radius: 16px;
}
.profile-loader[hidden] { display: none; }
.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent-light);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* Лоадер-кот вместо колёсика на экранах загрузки */
.loader-gif { width: 112px; height: 112px; image-rendering: pixelated; }
.modal-profile .modal-close { z-index: 2; }
.profile-top { display: flex; align-items: center; gap: 16px; }
.avatar-wrap { position: relative; flex-shrink: 0; }
.avatar {
  width: 72px; height: 72px; border-radius: 50%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #7c3aed, #4c1d95);
  font-size: 30px; font-weight: 800; color: #fff;
  border: 2px solid rgba(255,255,255,.12);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar img[hidden] { display: none; }
/* Рамка поверх аватара: проценты от размера — масштабируется сама
   (комменты 38px, профиль 72px, списки) и на телефоне, и на пк */
.ava-wrap { position: relative; display: inline-flex; flex-shrink: 0; align-self: flex-start; }
.ava-frame {
  position: absolute; left: 50%; top: 50%;
  width: 114%; height: auto; aspect-ratio: 1 / 1; max-width: none;
  object-fit: contain;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.avatar-edit {
  position: absolute; right: -2px; bottom: -2px;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #100c1c; border: 1px solid var(--border);
  color: var(--muted); cursor: pointer; transition: color 0.2s, border-color 0.2s;
}
.avatar-edit svg { width: 13px; height: 13px; }
.avatar-edit:hover { color: #fff; border-color: #fff; }
.profile-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.profile-name h3 { margin: 0; font-size: 22px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Тег роли: маленький, как степень (верхний индекс у ника) */
.role-tag {
  flex-shrink: 0; align-self: flex-start; margin-top: 3px;
  font-size: 9.5px; font-weight: 700; padding: 2px 7px; border-radius: 12px;
  letter-spacing: 0.3px; text-transform: uppercase; line-height: 1.4;
  white-space: nowrap;
}
.role-tag[hidden] { display: none; }
.role-tag.tag-owner { background: rgba(139, 44, 246, 0.18); color: #c084fc; border: 1px solid rgba(139, 44, 246, 0.45); }
.role-tag.tag-admin { background: rgba(34, 197, 94, 0.14); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.4); }
/* Кастомные теги юзеров: только классы палитры (inline-style под CSP запрещён) */
.profile-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; }
.profile-tags:empty { display: none; }
.tag-pill {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 12px;
  letter-spacing: 0.3px; white-space: nowrap; border: 1px solid;
}
.tag-red { background: rgba(248, 113, 113, 0.14); color: #f87171; border-color: rgba(248, 113, 113, 0.4); }
.tag-orange { background: rgba(251, 146, 60, 0.14); color: #fb923c; border-color: rgba(251, 146, 60, 0.4); }
.tag-amber { background: rgba(251, 191, 36, 0.14); color: #fbbf24; border-color: rgba(251, 191, 36, 0.4); }
.tag-green { background: rgba(74, 222, 128, 0.14); color: #4ade80; border-color: rgba(74, 222, 128, 0.4); }
.tag-teal { background: rgba(45, 212, 191, 0.14); color: #2dd4bf; border-color: rgba(45, 212, 191, 0.4); }
.tag-sky { background: rgba(56, 189, 248, 0.14); color: #38bdf8; border-color: rgba(56, 189, 248, 0.4); }
.tag-blue { background: rgba(129, 140, 248, 0.14); color: #818cf8; border-color: rgba(129, 140, 248, 0.4); }
.tag-violet { background: rgba(168, 85, 247, 0.16); color: #c084fc; border-color: rgba(168, 85, 247, 0.45); }
.tag-purple { background: rgba(232, 121, 249, 0.14); color: #e879f9; border-color: rgba(232, 121, 249, 0.4); }
.tag-pink { background: rgba(244, 114, 182, 0.14); color: #f472b6; border-color: rgba(244, 114, 182, 0.4); }
.tag-grey { background: rgba(156, 163, 175, 0.14); color: #9ca3af; border-color: rgba(156, 163, 175, 0.4); }
.tag-white { background: rgba(229, 231, 235, 0.12); color: #e5e7eb; border-color: rgba(229, 231, 235, 0.35); }
/* Чужой профиль: редакторы и кнопки выхода/удаления скрыты */
.modal.view-only .avatar-edit,
.modal.view-only #nickEdit,
.modal.view-only #bioEdit,
.modal.view-only .nick-editor,
.modal.view-only #btnLogout,
.modal.view-only #btnDelete { display: none; }
/* Чужой профиль: модерацию не светим */
.modal.view-only #modSec { display: none; }
.mini-btn {
  width: 30px; height: 30px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  color: var(--muted); cursor: pointer; transition: color 0.2s, border-color 0.2s;
}
.mini-btn svg { width: 14px; height: 14px; }
.mini-btn:hover { color: #fff; border-color: #fff; }

.nick-editor { margin-top: 14px; }
.nick-editor input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 10px;
  background: #100c1c; border: 1px solid var(--border); color: var(--text);
  outline: none; font-size: 14px;
}
.nick-editor input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,44,246,.18); }
.editor-row { display: flex; gap: 8px; margin-top: 10px; }
.editor-row + .field { margin-top: 14px; }
.save-btn {
  height: 40px; padding: 0 18px; border: 0; cursor: pointer; border-radius: 10px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 13.5px;
  transition: background 0.2s;
}
.save-btn:hover { background: var(--accent-light); }

.profile-div { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.profile-sec { margin-bottom: 18px; }
.profile-sec:last-of-type { margin-bottom: 0; }
.profile-sec h4 { margin: 0 0 8px; font-size: 14px; color: var(--muted); font-weight: 600; }
.profile-bio {
  position: relative; margin: 14px 0; padding: 10px 14px;
  font-size: 14.5px; white-space: pre-wrap; word-break: break-word;
  background: #1e1830; border: 1px solid var(--border);
  border-radius: 8px 14px 14px 14px;
}
/* Хвостик-пик сверху слева как на макете: внешний — цветом рамки,
   внутренний — цветом пузыря (иначе на фоне модалки его не видно) */
.profile-bio::before {
  content: ''; position: absolute; left: 10px; top: -11px;
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 11px solid var(--border);
}
.profile-bio::after {
  content: ''; position: absolute; left: 11px; top: -9px;
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 10px solid #1e1830;
}
.muted { margin: 0; font-size: 13.5px; color: var(--muted); }
.muted.tight { margin: 0 0 8px; word-break: break-all; }
#at2Prev { width: 160px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: #000; }
#at2Prev[hidden] { display: none; }
.bio-editor textarea {
  width: 100%; padding: 10px 14px; border-radius: 10px; resize: vertical;
  background: #100c1c; border: 1px solid var(--border); color: var(--text);
  outline: none; font-size: 14px; font-family: inherit;
}
.bio-editor textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,44,246,.18); }
#bioEdit { margin-top: 2px; }

.ghost-btn {
  height: 40px; padding: 0 18px; cursor: pointer; border-radius: 10px;
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); font-size: 13.5px; transition: color 0.2s, border-color 0.2s;
}
.ghost-btn:hover { color: #fff; border-color: #fff; }

/* Кнопки профиля: 4 иконки с подписями в один ряд */
.profile-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pbtn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 64px; padding: 10px 4px; cursor: pointer; border-radius: 12px;
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.pbtn svg { width: 20px; height: 20px; }
.pbtn span { font-size: 11px; line-height: 1.2; text-align: center; }
.pbtn:hover { color: #fff; border-color: #fff; }
.pbtn:disabled { opacity: 0.6; cursor: wait; }
.pbtn.danger { color: #e05252; border-color: rgba(224, 82, 82, 0.4); }
.pbtn.danger:hover { background: #e05252; border-color: #e05252; color: #fff; }
.pbtn.danger.armed { background: #8f1d1d; border-color: #8f1d1d; color: #fff; animation: blink 1s ease infinite; }
.ghost-btn.danger { color: #e05252; border-color: rgba(224, 82, 82, 0.4); }
.ghost-btn.danger:hover { background: rgba(224, 82, 82, 0.12); border-color: #e05252; color: #ff7b7b; }
.ghost-btn.danger.armed { background: #8f1d1d; border-color: #8f1d1d; color: #fff; animation: blink 1s ease infinite; }
.sup-delete { margin-top: 22px; }
@keyframes blink { 50% { opacity: 0.75; } }

/* СТРАНИЦА ТАЙТЛА */
.titleview[hidden] { display: none; }
.back-btn {
  display: inline-block; text-decoration: none;
  background: none; border: 0; cursor: pointer; padding: 0; margin: 26px 0 14px;
  color: var(--muted); font-size: 14px; transition: color 0.2s;
}
.back-btn:hover { color: #fff; }
.title-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.title-head h1 { margin: 0; font-size: clamp(22px, 3.5vw, 32px); font-weight: 800; }
.watch-btn {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px;
  background: #100c1c; border: 1px solid var(--border); border-radius: 12px;
  color: var(--muted); font-size: 13.5px; cursor: pointer; transition: color 0.2s, border-color 0.2s;
}
.watch-btn svg { width: 17px; height: 17px; }
.watch-btn:hover { color: #fff; border-color: #fff; }
.watch-btn:disabled { opacity: 0.6; cursor: wait; }
.watch-btn.active { color: var(--accent-light); border-color: var(--accent); }
.watch-btn.active svg { fill: rgba(139, 44, 246, 0.25); }

.title-main { display: flex; gap: 26px; margin-bottom: 26px; }
.title-poster {
  position: relative; flex-shrink: 0; align-self: flex-start;
  width: 230px; aspect-ratio: 3/4;
  border-radius: 14px; overflow: hidden; background: #1d1830;
  border: 1px solid var(--border);
}
.title-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.title-info { flex: 1; min-width: 0; }
.genre-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.genre-chip {
  border: 1px solid rgba(139, 44, 246, 0.5); background: rgba(139, 44, 246, 0.1);
  color: var(--accent-light); font-size: 12.5px; padding: 6px 14px; border-radius: 20px;
  cursor: pointer; transition: background 0.2s, color 0.2s;
}
.genre-chip:hover { background: rgba(139, 44, 246, 0.25); color: #fff; }
.title-meta { margin: 0 0 16px; font-size: 14px; color: var(--muted); }
.title-meta b { color: var(--text); font-weight: 600; }
.title-info h3 { margin: 0 0 10px; font-size: 17px; }
.title-desc { font-size: 14.5px; line-height: 1.65; color: #cfc9dd; white-space: pre-wrap; }

/* Слот плеера (сам плеер рисует js/player.js) */
.player-slot { margin-bottom: 22px; }
.player-slot:empty { display: none; }
/* Заглушка плеера до монтирования: чёрный экран 16:9 */
.player-loading {
  aspect-ratio: 16/9; border-radius: 12px;
  background: #000; border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 12px;
  align-items: center; justify-content: center;
}
.player-loading p { margin: 0; color: var(--muted); font-size: 14px; }
/* Статический скелетон вкладок источников (до монтирования плеера) */
.source-switcher.static {
  display: flex; gap: 8px; justify-content: flex-start; flex-wrap: wrap;
  margin: 0 0 10px;
}
.source-switcher.static[hidden] { display: none; }
.source-switcher.static .sk-tab {
  width: 104px; height: 34px; padding: 0;
  border: 0; border-radius: 12px; pointer-events: none;
}

/* Оценки */
.rate-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 30px; }
.rate-box {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px 20px;
}
.rate-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.rate-head span { font-size: 14.5px; font-weight: 700; }
.rate-avg { color: var(--accent-light); font-size: 17px; }
.stars { display: flex; gap: 5px; }
/* Тамон справа от звёзд */
.rate-stars-row { display: flex; align-items: center; gap: 10px; }
.rate-stars-row .stars { flex-shrink: 0; }
.tamon-gif { width: 72px; height: 42px; object-fit: cover; margin-left: auto; border-radius: 8px; flex-shrink: 0; }
.stars button {
  background: none; border: 0; cursor: pointer; padding: 1px;
  color: #4a4458; transition: color 0.12s, transform 0.12s;
}
.stars button svg { width: 21px; height: 21px; display: block; }
.stars button.lit { color: var(--gold); }
.stars button:hover { transform: scale(1.15); }
.rate-votes { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }

/* Комменты */
.comments { padding-bottom: 70px; }
.comments h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; margin: 0 0 16px; }
.count-badge {
  font-size: 12px; font-weight: 700; color: #fff;
  background: rgba(139, 44, 246, 0.35); border-radius: 12px; padding: 3px 10px;
}
.comment-form textarea {
  width: 100%; min-height: 86px; padding: 12px 14px; border-radius: 12px; resize: vertical;
  background: #100c1c; border: 1px solid var(--border); color: var(--text);
  outline: none; font-size: 14px; font-family: inherit;
}
.comment-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,44,246,.18); }
.comment-form button, .comment-guest button {
  float: right; margin-top: 10px; height: 40px; padding: 0 22px;
  border: 0; cursor: pointer; border-radius: 10px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 13.5px;
  transition: background 0.2s;
}
.comment-form button:hover, .comment-guest button:hover { background: var(--accent-light); }
.comment-form::after, .comment-guest::after { content: ''; display: block; clear: both; }
.comment-guest { text-align: right; }
.comment-guest button { float: none; }
.comments-empty { margin: 26px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.comments-empty[hidden] { display: none; }
#supportEmpty { margin-bottom: 30px; }
.comment-list { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.comment {
  display: flex; gap: 12px; padding: 14px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
}
.comment .avatar { width: 38px; height: 38px; font-size: 16px; flex-shrink: 0; border-width: 1px; }
.comment-body { flex: 1; min-width: 0; }
.comment-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.comment-top .role-tag { margin-top: 0; }
.comment-name { font-weight: 700; font-size: 13.5px; }
.comment-name[data-profile], .comment .ava-wrap[data-profile],
.post-name[data-profile], .admin-user .ava-wrap[data-profile],
.admin-user .comment-name[data-profile] { cursor: pointer; }

/* Кастомный указатель: добивка поверх всех системных pointer.
   Кнопки/ссылки/селекты уже закрыты !important-правилом сверху —
   здесь только кликабельные НЕ-кнопки. */
[data-profile], .spot-one, .spot-card, .notif-item,
input[type="checkbox"], input[type="radio"] {
  cursor: url('/img/cursor/pointer-32.png') 16 2, pointer !important;
}
.comment-time { font-size: 11.5px; color: var(--muted); }
.comment-text { margin: 0; font-size: 14px; line-height: 1.55; word-break: break-word; white-space: pre-wrap; }
.comment-del {
  margin-left: auto; background: none; border: 0; cursor: pointer; padding: 4px;
  color: var(--muted); font-size: 12px; flex-shrink: 0;
}
.comment-del:hover { color: #e05252; }

/* СТРАНИЦА ПРАВИЛ */
.rulesview[hidden] { display: none; }
.rulesview { padding-bottom: 70px; }
.rulesview h1 { font-size: clamp(24px, 4vw, 32px); margin: 26px 0 18px; }
.rules-tabs {
  position: relative;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  background: #100c1c; border: 1px solid var(--border);
  border-radius: 12px; padding: 4px; margin-bottom: 20px;
}
/* Бегущая фиолетовая пилюля */
.rules-slider {
  position: absolute; top: 4px; bottom: 4px; left: 0; width: 0;
  background: var(--accent); border-radius: 9px;
  transition: transform 0.3s ease, width 0.3s ease;
}
.rules-tab {
  position: relative; z-index: 1;
  border: 0; cursor: pointer; min-height: 42px; border-radius: 9px; padding: 8px 6px;
  background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 600;
  transition: color 0.2s;
}
.rules-tab.active { color: #fff; }
.rules-pane {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px 26px;
  font-size: 14.5px; line-height: 1.7; color: #cfc9dd;
}
.rules-pane[hidden] { display: none; }
.rules-pane h2 { font-size: 17px; color: var(--text); margin: 22px 0 8px; }
.rules-pane h2:first-child { margin-top: 0; }
.rules-pane p { margin: 0 0 10px; }
.rules-pane ol { margin: 0 0 10px; padding-left: 22px; }
.rules-pane ol li { margin-bottom: 10px; }
.rules-pane b { color: var(--text); }
.rules-intro { color: var(--muted); }
/* Каждое правило — отдельная плашка с номером */
.rule-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: #100c1c; border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 18px; margin-bottom: 12px;
}
.rule-card:last-of-type { margin-bottom: 16px; }
.rule-card p { margin: 0; }
.rule-card.block { display: block; }
.rule-card.block h2 { margin-top: 0; }
.rule-num {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: 13.5px; font-weight: 800;
}

/* АДМИНКА — отдельная страница admin.html (фулскрин по построению) */
.adminview[hidden] { display: none; }
.admin-body { background: #0a0614; }
.admin-body .bg { display: none; } /* декору тут нечего просвечивать */
.admin-page {
  min-height: 100vh; min-height: 100dvh;
  background: #0a0614;
}
.admin-page .admin-layout {
  margin-top: 0; border: 0; border-radius: 0;
  background: #0a0614;
  display: block; /* сайдбар fixed — флекс-растяжение больше не при чём */
}
/* Десктоп: сайдбар прибит к вьюпорту сверху донизу, контент скроллится рядом */
@media (min-width: 721px) {
  .admin-page .admin-side {
    position: fixed; left: 0; top: 0; bottom: 0; width: 240px; z-index: 5;
    overflow-y: auto;
  }
  .admin-page .admin-main {
    margin-left: 240px; min-height: 100vh; min-height: 100dvh;
    padding: 26px 30px;
  }
}
.admin-page .admin-side { background: #141020; border-right: 1px solid rgba(255, 255, 255, 0.12); }
.adminview { padding-bottom: 70px; }
.admin-layout {
  display: flex; gap: 0; margin-top: 26px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; min-height: 480px;
}
.admin-side {
  width: 240px; flex-shrink: 0; padding: 18px 14px;
  background: #100c1c; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 14px;
}
.admin-brand {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-weight: 800; font-size: 15px; padding: 2px 6px 14px;
  border-bottom: 1px solid var(--border);
}
.admin-brand img { width: 34px; height: 34px; object-fit: contain; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-nav-item {
  border: 0; cursor: pointer; text-align: left;
  padding: 10px 12px; border-radius: 9px;
  background: transparent; color: var(--muted); font-size: 14px; font-weight: 600;
  transition: background 0.2s, color 0.2s;
}
.admin-nav-item:hover { color: #fff; }
.admin-nav-item.active { background: rgba(139, 44, 246, 0.25); color: #fff; }
/* Дерево подразделов как на референсе */
.admin-parent { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; }
.admin-parent svg { width: 14px; height: 14px; flex-shrink: 0; transition: transform 0.2s; }
.admin-parent.open svg { transform: rotate(90deg); }
.admin-sub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 2px 10px; padding-left: 8px; border-left: 1px solid rgba(255, 255, 255, 0.09); }
.admin-sub[hidden] { display: none; }
.admin-nav-item.sub { font-size: 13px; font-weight: 500; padding: 8px 10px; }
.admin-nav-item.sub.deep { font-size: 12.5px; padding: 7px 10px; }
.admin-exit {
  margin-top: auto; border: 1px solid var(--border); cursor: pointer;
  padding: 10px 12px; border-radius: 9px; text-align: left;
  background: transparent; color: var(--muted); font-size: 14px; font-weight: 600;
  transition: color 0.2s, border-color 0.2s;
}
.admin-exit:hover { color: #fff; border-color: #fff; }
.admin-main { flex: 1; min-width: 0; padding: 22px 24px; }
.admin-main h1 { margin: 0 0 16px; font-size: 24px; }
.admin-toolbar { display: flex; gap: 10px; margin-bottom: 8px; }
.admin-toolbar .search { flex: 1; }
/* Кастомный дропдаун ролей */
.role-wrap { position: relative; flex-shrink: 0; }
#admRoleBtn {
  height: 46px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px;
  background: #100c1c; border: 1px solid var(--border); border-radius: 12px;
  color: var(--muted); font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
#admRoleBtn svg { width: 14px; height: 14px; transition: transform 0.2s; }
#admRoleBtn:hover { color: #fff; border-color: #fff; }
.role-wrap.open #admRoleBtn { color: #fff; border-color: var(--accent); }
.role-wrap.open #admRoleBtn svg { transform: rotate(180deg); }
.role-pop {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 180px; z-index: 60;
  background: #1e1830;
  border: 1px solid var(--border); border-radius: 12px; padding: 6px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  animation: popInR 0.18s ease;
}
.role-pop[hidden] { display: none; }
.role-pop button {
  display: block; width: 100%; text-align: left;
  background: transparent; border: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  cursor: pointer;
  padding: 10px 12px; border-radius: 0;
  color: var(--muted); font-size: 13.5px;
  transition: background 0.15s, color 0.15s;
}
.role-pop button:last-child { border-bottom: 0; }
.role-pop button:first-child { border-radius: 8px 8px 0 0; }
.role-pop button:last-child { border-radius: 0 0 8px 8px; }
.role-pop button:hover { background: rgba(139, 44, 246, 0.18); color: #fff; }
.role-pop button.active { color: #fff; }
.admin-toolbar > button {
  height: 46px; padding: 0 22px; border: 0; cursor: pointer; border-radius: 12px;
  background: #2a2440; color: #fff; font-size: 13.5px; font-weight: 600;
  transition: background 0.2s;
}
.admin-toolbar > button:hover { background: var(--accent); }
.admin-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.info-row { cursor: default; }
.info-row .muted { margin-left: auto; }
.row-end { display: flex; justify-content: flex-end; }
.admin-user {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 12px;
  background: #100c1c; border: 1px solid var(--border);
}
.admin-user .avatar { width: 38px; height: 38px; font-size: 16px; flex-shrink: 0; border-width: 1px; }
.admin-user .comment-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-online { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.admin-online i { width: 8px; height: 8px; border-radius: 50%; background: #6b6778; }
.admin-online.on { color: #4ade80; }
.admin-online.on i { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.8); }
.admin-role { font-size: 12px; color: var(--muted); flex-shrink: 0; margin-left: auto; }
.admin-role.r-admin { color: #4ade80; }
.admin-role.r-owner { color: #c084fc; }
.warn-btn {
  width: 34px; height: 34px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border); border-radius: 9px;
  color: var(--muted); cursor: pointer; transition: color 0.2s, border-color 0.2s;
}
.warn-btn svg { width: 16px; height: 16px; }
.warn-btn:hover { color: #fbbf24; border-color: #fbbf24; }

/* НОВОСТИ: посты как в ТГ */
.newsview[hidden] { display: none; }
.newsview { padding-bottom: 70px; }
.newsview .section-title { text-align: center; margin-top: 28px; }
.news-feed { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.post {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 18px;
}
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.post-head .avatar { width: 42px; height: 42px; font-size: 18px; flex-shrink: 0; border-width: 1px; }
.post-head .avatar img { width: 100%; height: 100%; object-fit: cover; }
/* Автор поста — просто ник + дата в ряд */
.post-author { display: flex; align-items: center; gap: 8px; margin: 4px 0 6px; font-size: 13px; }
.post-author .post-name { font-weight: 700; }
.post-author .dot { color: var(--muted); }
.post-author .post-date { margin: 0; color: var(--muted); font-size: 12.5px; }
.post-name { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.post-name .role-tag { margin-top: 0; }
.post-date { font-size: 12px; color: var(--muted); margin-top: 2px; }
.post-title { margin: 0 0 8px; font-size: 17px; font-weight: 800; }
.post-text { margin: 0 0 10px; font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.post-photo { margin-bottom: 4px; }
.post-photo img { width: 100%; border-radius: 10px; border: 1px solid var(--border); display: block; }
.post-foot { display: flex; gap: 6px; margin-top: 6px; }
.post-foot button {
  background: none; border: 0; cursor: pointer; padding: 6px 10px; border-radius: 8px;
  color: var(--muted); font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px;
  transition: color 0.2s, background 0.2s;
}
.post-foot button:hover { color: #fff; background: rgba(139, 44, 246, 0.12); }
/* Скелетоны постов */
.post.skeleton { pointer-events: none; }
.sk-circle { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; }
.sk-who { flex: 1; min-width: 0; }
.post .sk-line { margin: 0 0 8px; }
.post .sk-line.short { width: 40%; margin-bottom: 0; }
.post-thread { margin-top: 4px; border-top: 1px solid var(--border); padding-top: 12px; }
.post-thread[hidden] { display: none; }
.post-thread .comment-list { margin-top: 12px; }
.reply { margin-left: 24px; border-left: 2px solid rgba(139, 44, 246, 0.35); padding-left: 10px; }
.comment-reply {
  background: none; border: 0; cursor: pointer; padding: 2px 4px;
  color: var(--accent-light); font-size: 12px;
}
.comment-reply:hover { color: #fff; }
.news-more-wrap { max-width: 680px; margin: 18px auto 0; text-align: center; }
/* Кастомные эмодзи-стикеры (видео/картинки, шорткод :p1-042:) */
video.emote, img.emote, span.emote {
  width: 1.5em; height: 1.5em; object-fit: contain;
  display: inline-block; vertical-align: -0.3em;
}
span.emote svg, .tgs-thumb svg { width: 100%; height: 100%; display: block; }
.tgs-thumb { display: block; width: 100%; aspect-ratio: 1; }
/* Пикер стикеров */
.emoji-wrap { position: relative; display: inline-block; }
.emote-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  width: 320px; padding: 8px;
  background: #1e1830; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}
.emote-pop[hidden] { display: none; }
/* Вкладки паков */
.emote-tabs { display: flex; gap: 4px; margin-bottom: 8px; overflow-x: auto; }
.emote-tabs button {
  flex: 1; background: none; border: 1px solid var(--border); cursor: pointer;
  padding: 6px 4px; border-radius: 8px; white-space: nowrap;
  color: var(--muted); font-size: 12px; font-weight: 600;
}
.emote-tabs button.active { background: rgba(139, 44, 246, 0.25); color: #fff; border-color: var(--accent); }
.emote-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px;
  max-height: 240px; overflow-y: auto;
}
.emote-grid button {
  background: none; border: 0; cursor: pointer;
  padding: 3px; border-radius: 8px; line-height: 0;
  aspect-ratio: 1;
}
.emote-grid button:hover { background: rgba(139, 44, 246, 0.25); }
.emote-grid button video, .emote-grid button img {
  width: 100%; height: 100%; object-fit: contain; pointer-events: none;
}
/* Модалка пользовательского соглашения (центр, как вход — закрыть нельзя, только выбор) */
.consent-overlay {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(8, 5, 16, 0.7);
  backdrop-filter: blur(6px);
}
.consent-overlay[hidden] { display: none; }
/* Телефон: обычная центрированная модалка как было до маскота */
.consent-mascot {
  width: 460px; max-width: 100%;
}
.consent-mascot img { display: none; }
.consent-board {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 26px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  text-align: center;
}
.consent-board h2 { margin: 0 0 12px; font-size: 20px; }
.consent-board p { margin: 0 0 20px; font-size: 14px; color: var(--muted); line-height: 1.6; }
.consent-link {
  background: none; border: 0; cursor: pointer; padding: 0;
  color: var(--accent-light); font-size: inherit; text-decoration: underline;
}
.consent-btns { display: flex; gap: 8px; }
.consent-btns .save-btn, .consent-btns .ghost-btn { flex: 1; height: 44px; }
.consent-board .consent-btns .ghost-btn {
  color: #e8e4f2; border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
}
.consent-board .consent-btns .ghost-btn:hover {
  border-color: #fff; color: #fff; background: rgba(255, 255, 255, 0.1);
}

/* Десктоп: маскот на весь экран, текст на доске в лапах */
@media (min-width: 1024px) {
  .consent-overlay { padding: 0; overflow: hidden; }
  .consent-mascot { position: fixed; inset: 0; width: auto; max-width: none; }
  .consent-mascot img {
    display: block; width: 100%; height: 100%; object-fit: cover; user-select: none;
    -webkit-user-drag: none;
  }
  .consent-board {
    position: fixed; overflow: hidden;
    display: flex; flex-direction: column; justify-content: center;
    background: transparent; border: 0; border-radius: 0;
    box-shadow: none; padding: 0.5em 0.8em;
  }
  .consent-board h2 { margin: 0 0 0.4em; font-size: 1.3em; }
  .consent-board p { margin: 0 0 0.8em; font-size: 0.95em; line-height: 1.9; }
  .consent-board .consent-btns { gap: 0.6em; }
  .consent-board .consent-btns .save-btn,
  .consent-board .consent-btns .ghost-btn {
    height: 2.6em; font-size: 0.95em; border-radius: 0.6em;
    white-space: nowrap; min-width: 0;
  }
}

/* Состав: карточки команды (ховер как у аниме + рост насыщенности) */
.team-group { margin-bottom: 38px; }
.team-group-title { margin: 0 0 16px; font-size: 19px; font-weight: 800; }
.tm-type-row { display: flex; gap: 8px; margin-bottom: 8px; }
.tm-type-row select { flex: 1; }
.tm-type-x { flex-shrink: 0; width: 42px; padding: 0; }
.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 1000px) { .team-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .team-grid { grid-template-columns: repeat(2, 1fr); } }
.team-card { min-width: 0; }
.team-photo {
  position: relative; aspect-ratio: 3/4; overflow: hidden; border-radius: 14px;
  background: #1d1830; border: 1px solid var(--border);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.team-photo img, .team-photo video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: saturate(0.55);
  transition: transform 0.35s ease, filter 0.35s ease;
}
.team-card:hover .team-photo {
  transform: translateY(-6px); border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(139, 44, 246, 0.25);
}
.team-card:hover .team-photo img, .team-card:hover .team-photo video { transform: scale(1.08); filter: saturate(1); }
.team-shade {
  position: absolute; inset: auto 0 0 0; height: 62%;
  background: linear-gradient(to top, rgba(5, 3, 12, 0.92), transparent);
  pointer-events: none;
}
.team-cap { position: absolute; left: 14px; right: 14px; bottom: 12px; }
.team-handle { display: block; font-size: 12.5px; color: var(--accent-light); }
.team-link {
  display: block; font-size: 12.5px; color: var(--accent-light);
  text-decoration: none; border-bottom: 1px dashed rgba(139, 44, 246, 0.5);
  width: fit-content;
}
.team-link:hover { color: #fff; border-bottom-color: #fff; }
.team-cap h3 { margin: 2px 0 0; font-size: 21px; font-weight: 800; color: #fff; }
.team-desc { margin: 10px 2px 0; font-size: 13px; color: var(--muted); line-height: 1.55; }
.team-row { align-items: center; }
.team-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: #1d1830; }
/* Миниатюра рамки в админке: жёсткий квадрат, ничто не должно её растягивать */
.frame-thumb {
  width: 44px; height: 44px; min-width: 44px; min-height: 44px;
  max-width: 44px; max-height: 44px;
  border-radius: 10px; object-fit: contain; flex-shrink: 0; background: #1d1830;
}
.team-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

/* Поддержка: тикеты + диалог */
.supportview { padding-bottom: 70px; }
.support-guest { text-align: center; padding: 40px 20px; color: var(--muted); }
.support-guest p { margin: 0 0 18px; }
.support-login { max-width: 260px; margin: 0 auto; }
.support-tickets { display: flex; flex-direction: column; gap: 10px; margin-bottom: 30px; }
.sup-ticket {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  color: inherit; text-decoration: none; transition: border-color 0.2s;
}
a.sup-ticket:hover { border-color: var(--accent); }
.sup-ticket.admin {
  width: 100%; font: inherit; text-align: left; cursor: pointer;
  background: var(--panel);
}
.sup-ticket.admin:hover { border-color: var(--accent); }
.sup-ticket.dim { opacity: 0.6; }
.sup-ticket-subj { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-ticket time { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.sup-author { font-size: 12.5px; color: var(--accent-light); flex-shrink: 0; }
.sup-badge { font-size: 11.5px; padding: 3px 10px; border-radius: 20px; flex-shrink: 0; }
.sup-badge.open { background: rgba(60, 200, 120, 0.15); color: #5fd693; }
.sup-badge.closed { background: rgba(255, 255, 255, 0.07); color: var(--muted); }
.sup-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex-shrink: 0; box-shadow: 0 0 8px var(--accent); }
#supportNew {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px;
}
#supportNew h2 { margin: 0 0 16px; font-size: 17px; }
.sup-thread-title { margin: 14px 0 18px; font-size: 20px; }
.sup-messages { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.sup-messages.admin { max-height: 420px; overflow-y: auto; padding-right: 6px; }
.sup-msg {
  max-width: 82%; padding: 12px 15px; border-radius: 13px;
  background: var(--panel); border: 1px solid var(--border);
}
.sup-msg p { margin: 6px 0; white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.sup-msg time { font-size: 11.5px; color: var(--muted); }
.sup-msg.mine { align-self: flex-end; border-color: var(--accent); }
.sup-msg.staff { align-self: flex-start; }
.sup-who { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.sup-who.staff { color: var(--accent-light); }
#supReply { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
#supClosed { margin-top: 18px; }

/* Админка: секция Аниме */
#adminMainAnime[hidden] { display: none; }
#adminMainAnime[hidden] { display: none; }
.asec-tabs { grid-template-columns: 1fr 1fr; max-width: 420px; }
.msub-tabs { grid-template-columns: repeat(5, 1fr); }
.msub-tabs .rules-tab { font-size: 12.5px; min-height: 38px; }
[data-apane][hidden], [data-mpane][hidden] { display: none; }
.aform {
  background: #100c1c; border: 1px solid var(--border);
  border-radius: 12px; padding: 18px; margin-bottom: 14px;
}
.aform-title { margin: 0 0 12px; font-size: 15px; }
/* Свatches цветов тега */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; padding: 0;
  transition: transform 0.15s, border-color 0.15s;
}
.swatch:hover { transform: scale(1.12); }
.swatch.sel { border-color: #fff; }
.swatch.tag-red { background: rgba(248, 113, 113, 0.35); }
.swatch.tag-orange { background: rgba(251, 146, 60, 0.35); }
.swatch.tag-amber { background: rgba(251, 191, 36, 0.35); }
.swatch.tag-green { background: rgba(74, 222, 128, 0.35); }
.swatch.tag-teal { background: rgba(45, 212, 191, 0.35); }
.swatch.tag-sky { background: rgba(56, 189, 248, 0.35); }
.swatch.tag-blue { background: rgba(129, 140, 248, 0.35); }
.swatch.tag-violet { background: rgba(168, 85, 247, 0.35); }
.swatch.tag-purple { background: rgba(232, 121, 249, 0.35); }
.swatch.tag-pink { background: rgba(244, 114, 182, 0.35); }
.swatch.tag-grey { background: rgba(156, 163, 175, 0.35); }
.swatch.tag-white { background: rgba(229, 231, 235, 0.35); }
/* Теги юзера в форме выдачи: крестик снятия */
.tg-user-tags { margin-top: 12px; }
.tg-user-tags:empty { display: none; }
.tg-user-tags .tag-pill button {
  background: none; border: 0; cursor: pointer;
  color: inherit; font-size: 13px; padding: 0 0 0 4px; line-height: 1;
}
.aform .field { margin-bottom: 12px; }
.aform .field label { display: block; margin-bottom: 6px; font-size: 12.5px; color: var(--muted); }
.aform input[type="text"], .aform input[type="url"], .aform input[type="number"],
.aform select, .aform textarea {
  width: 100%; min-height: 44px; padding: 0 14px; border-radius: 10px;
  background: #0a0614; border: 1px solid var(--border); color: var(--text);
  outline: none; font-size: 14px; font-family: inherit;
}
.aform textarea { padding: 10px 14px; resize: vertical; }
.aform select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238b8798' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.aform select:hover { border-color: #fff; }
/* Кастомные селекты админки (нативные рисует ОС) */
.cselect { position: relative; }
.cselect select[hidden] { display: none; }
.cselect-btn {
  width: 100%; min-height: 44px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 14px; border-radius: 10px; cursor: pointer;
  background: #0a0614; border: 1px solid var(--border);
  color: var(--text); font-size: 14px; text-align: left;
  transition: border-color 0.2s;
}
.cselect-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cselect-btn svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--muted); transition: transform 0.2s; }
.cselect-btn:hover { border-color: #fff; }
.cselect.open .cselect-btn { border-color: var(--accent); }
.cselect.open .cselect-btn svg { transform: rotate(180deg); }
.cselect-pop {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  max-height: 240px; overflow-y: auto;
  background: #1e1830; border: 1px solid var(--border);
  border-radius: 10px; padding: 5px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  animation: popInR 0.15s ease;
}
.cselect-pop[hidden] { display: none; }
.cselect-pop button {
  display: block; width: 100%; text-align: left;
  background: transparent; border: 0; cursor: pointer;
  padding: 9px 12px; border-radius: 7px;
  color: var(--muted); font-size: 13.5px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  transition: background 0.15s, color 0.15s;
}
.cselect-pop button:hover { background: rgba(139, 44, 246, 0.18); color: #fff; }
.cselect-pop button.active { color: #fff; }
.aform input:focus, .aform select:focus, .aform textarea:focus { border-color: var(--accent); }
.arow { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.arow3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; align-items: end; }
.poster-row { display: flex; align-items: center; gap: 12px; }
.poster-row img { width: 90px; aspect-ratio: 3/4; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.poster-row img[hidden] { display: none; }
/* Фото новости — в родном формате кадра */
#nwImg { width: auto; max-width: 480px; height: auto; max-height: 360px; aspect-ratio: auto; }
.check { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.ep-row, .skip-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; border-radius: 10px; font-size: 13px;
  background: #0a0614; border: 1px solid var(--border);
}
.ep-row b, .skip-row b { color: var(--text); }
.ep-row .muted, .skip-row .muted { font-size: 12px; }
.mini-del {
  margin-left: auto; background: none; border: 1px solid var(--border);
  color: var(--muted); border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer;
}
.mini-del:hover { color: #e05252; border-color: #e05252; }

/* Модалка модерации */
.save-btn.red { background: #e05252; }
.save-btn.red:hover { background: #c24343; }
.mod-history { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; max-height: 260px; overflow-y: auto; }
.mod-history:empty { display: none; }
.mod-item {
  position: relative;
  padding: 10px 12px; border-radius: 10px; font-size: 13px;
  background: #100c1c; border: 1px solid var(--border);
}
.mod-item time { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.mod-item.spent { opacity: 0.55; }
.warn-del {
  position: absolute; top: 6px; right: 6px;
  width: 24px; height: 24px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.warn-del:hover { color: #4ade80; border-color: #4ade80; }
.mod-ban {
  padding: 10px 12px; border-radius: 10px; font-size: 13px;
  background: rgba(224, 82, 82, 0.1); border: 1px solid rgba(224, 82, 82, 0.4);
}
.mod-ban time { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.mod-ok { color: #4ade80; font-size: 13px; }
/* Бейджи в списке юзеров */
.warn-badge {
  flex-shrink: 0; font-size: 11px; font-weight: 700; color: #fbbf24;
  background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 12px; padding: 3px 9px;
}
.ban-badge {
  flex-shrink: 0; font-size: 11px; font-weight: 700; color: #fff;
  background: #e05252; border-radius: 12px; padding: 3px 9px;
}

/* Лоадер проверки прав: непрозрачный фулскрин, клики не проходят */
.admin-loader {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; gap: 14px;
  align-items: center; justify-content: center;
  background: #0a0614;
}
.admin-loader[hidden] { display: none; }
.admin-loader p { margin: 0; color: var(--muted); font-size: 14px; }

@media (max-width: 720px) {
  .title-main { flex-direction: column; }
  .title-poster { width: 170px; }
  .rate-row { grid-template-columns: 1fr; }

  /* Админка на мобильных: сайдбар сверху статично, контент под ним */
  .admin-page .admin-layout { display: flex; flex-direction: column; }
  .admin-page .admin-side {
    position: static; width: auto;
    border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }
  .admin-page .admin-main { margin-left: 0; min-height: 0; }
  
  .footer-inner { flex-direction: column; }
  .catalog-bar { flex-direction: row; }
  /* На узких экранах попапы во всю ширину, чтобы не вылезать за край */
  .notif-pop,
  .filter-pop {
    position: fixed; top: 66px; left: 12px; right: 12px;
    width: auto; max-width: none; transform: none;
    animation: popInMobile 0.18s ease;
  }
  @keyframes popInMobile {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ (аудит 2026-10-05) ===== */
@media (max-width: 720px) {
  /* Шапка: лого только картинкой, кнопки компактнее */
  .logo { width: 60px; height: 52px; }
  .logo-img img { width: 48px; height: 48px; }
  .logo-text { display: none; }
  .logo:hover .logo-img, .logo:focus-visible .logo-img { transform: translateY(-2px); }
  .header-left { gap: 2px; }
  .header-right { gap: 6px; }
  .nav-link { font-size: 13.5px; padding: 0 6px; height: 36px; }
  .user-btn { padding: 0 12px; height: 36px; font-size: 13px; }
  .icon-btn { width: 36px; height: 36px; }
  .container { padding: 0 14px; }

  /* Каталог: 2 колонки вместо одной гигантской */
  .cards { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-title { font-size: 13.5px; }
  .card-meta { font-size: 11.5px; }
  .filter-btn { padding: 0 12px; font-size: 13px; }

  /* Тайтл: заголовок и кнопка не давятся */
  .title-head { flex-wrap: wrap; }
  .title-head h1 { flex: 1 1 220px; }

  /* Звёзды: 10 шт должны входить в 240px */
  .rate-box { padding: 14px; }
  .stars { gap: 3px; }
  .stars button { padding: 0; }
  .stars button svg { width: 16px; height: 16px; }
  .tamon-gif { width: 52px; height: 32px; }

  /* Правила/посты: меньше паддинги */
  .rules-pane { padding: 16px; }
  .post { padding: 13px 14px; }
  .reply { margin-left: 12px; }

  /* Тикеты: перенос строк */
  .sup-ticket { flex-wrap: wrap; row-gap: 6px; }
  .sup-ticket-subj { flex: 1 1 140px; min-width: 0; }
  .sup-ticket time { margin-left: auto; }

  /* Админка: формы в одну колонку, строки переносятся */
  .arow, .arow3 { grid-template-columns: 1fr; }
  .admin-toolbar { flex-wrap: wrap; }
  .admin-toolbar .search { flex: 1 1 180px; }
  .admin-page .admin-main { padding: 16px 14px; }
  .admin-main h1 { font-size: 20px; }
  .admin-user { flex-wrap: wrap; row-gap: 8px; }
  .admin-role { margin-left: 0; }
  .ep-row, .skip-row { flex-wrap: wrap; }
  .tm-type-row select { min-width: 0; }

  /* iOS не зумит поля с кеглем 16px */
  .field input, .field textarea,
  .search, .comment-form textarea,
  .aform input[type="text"], .aform input[type="url"],
  .aform input[type="number"], .aform select, .aform textarea,
  #tmPos { font-size: 16px; }
}

/* Тач: нет ховера — крестик уведомлений виден всегда, курсор обычный */
@media (hover: none) {
  .notif-del { opacity: 1; }
  body { cursor: auto; }
  /* Ховер на тапе залипает: карточка остаётся сдвинутой с зумом постера.
     Движение убираем, оставляем только подсветку рамки. */
  .card:hover, .team-card:hover .team-photo { transform: none; }
  .card:hover .poster-img, .card:hover .poster-placeholder,
  .team-card:hover .team-photo img, .team-card:hover .team-photo video { transform: none; }
  .card:active { transform: scale(0.98); }
}