/* =========================================================
   ANIMORI — page-specific styles
   ========================================================= */

/* ---------- profile page ---------- */
.cover-card{
  position:relative; border-radius:var(--radius-xl);
  min-height:clamp(180px,22vw,260px); display:flex; align-items:flex-end;
  /* аватар/имя/кнопки свисают ниже обложки на половину своей высоты
     (см. .cover-content) — нужен больший запас снизу */
  margin-bottom:96px;
}
.cover-card::before{
  content:""; position:absolute; inset:0; border-radius:inherit;
  background:
    radial-gradient(120% 160% at 15% 20%, rgba(124,92,255,.5), transparent 60%),
    linear-gradient(120deg,#2b2470 0%,#171226 50%,#0c0c10 100%);
}
.cover-shade{ position:absolute; inset:0; background:linear-gradient(180deg,rgba(11,11,13,.2),var(--bg)); }

/* содержимое обложки (аватар + имя + кнопки): без position оно рисовалось
   ПОД полупрозрачной .cover-shade (она абсолютно спозиционирована и красится
   позже в порядке отрисовки) — текст и кнопки были невидимы поверх градиента */
/* аватар + имя/ник — слева, кнопки — справа (margin-left:auto у .cover-actions).
   Весь ряд опущен на половину своей высоты — центр блока лежит ровно на нижней
   границе цветной обложки (половина элементов над ней, половина под) */
.cover-content{
  position:relative; z-index:1; width:100%;
  display:flex; align-items:center; justify-content:flex-start; gap:20px;
  padding:0 28px; flex-wrap:wrap; text-align:left;
  transform:translateY(50%);
}
.cover-info{ min-width:0; display:flex; flex-direction:column; align-items:flex-start; }
.cover-name{ font-size:22px; font-weight:700; color:var(--text); line-height:1.25; }
.cover-nick{ font-size:13.5px; color:var(--text-dim); margin-top:4px; }

/* на узких экранах кнопки переносятся на отдельную строку — блок
   выше, значит свисает ниже: увеличиваем запас под обложкой */
@media (max-width:700px){
  .cover-card{ margin-bottom:140px; }
}

/* темы обложки профиля (ключ user.cover) */
.cover-card[data-cover="ocean"]::before{
  background:
    radial-gradient(120% 160% at 15% 20%, rgba(61,123,214,.55), transparent 60%),
    linear-gradient(120deg,#12395e 0%,#101a2e 50%,#0c0c10 100%);
}
.cover-card[data-cover="sunset"]::before{
  background:
    radial-gradient(120% 160% at 15% 20%, rgba(216,75,42,.55), transparent 60%),
    linear-gradient(120deg,#5e2317 0%,#241318 50%,#0c0c10 100%);
}
.cover-card[data-cover="forest"]::before{
  background:
    radial-gradient(120% 160% at 15% 20%, rgba(30,164,106,.5), transparent 60%),
    linear-gradient(120deg,#0e4a2e 0%,#101a16 50%,#0c0c10 100%);
}
.cover-card[data-cover="rose"]::before{
  background:
    radial-gradient(120% 160% at 15% 20%, rgba(176,63,110,.55), transparent 60%),
    linear-gradient(120deg,#4a1a33 0%,#1c1218 50%,#0c0c10 100%);
}
.cover-card[data-cover="gold"]::before{
  background:
    radial-gradient(120% 160% at 15% 20%, rgba(214,158,31,.5), transparent 60%),
    linear-gradient(120deg,#4d3a0e 0%,#1d1810 50%,#0c0c10 100%);
}
.cover-card[data-cover="white"]::before{
  background:
    radial-gradient(120% 160% at 15% 20%, rgba(255,255,255,.9), transparent 62%),
    linear-gradient(120deg,#c7cfdd 0%,#6b7688 55%,#0c0c10 100%);
}

/* выбор темы обложки */
.cover-swatches{ display:flex; gap:10px; flex-wrap:wrap; }
.swatch{
  width:52px; height:36px; border-radius:10px; cursor:pointer; padding:0;
  border:2px solid transparent; outline:none; transition:transform .12s ease, border-color .12s ease;
}
.swatch:hover{ transform:translateY(-2px); }
.swatch.active{ border-color:#fff; }
.swatch[data-cover="violet"]{ background:linear-gradient(135deg,#7c5cff,#2a1f8f); }
.swatch[data-cover="ocean"]{ background:linear-gradient(135deg,#3d7bd6,#12395e); }
.swatch[data-cover="sunset"]{ background:linear-gradient(135deg,#d84b2a,#5e2317); }
.swatch[data-cover="forest"]{ background:linear-gradient(135deg,#1ea46a,#0e4a2e); }
.swatch[data-cover="rose"]{ background:linear-gradient(135deg,#b03f6e,#4a1a33); }
.swatch[data-cover="gold"]{ background:linear-gradient(135deg,#d69e1f,#4d3a0e); }
.swatch[data-cover="white"]{ background:linear-gradient(135deg,#ffffff,#aab4c8); }

/* вкладки настроек профиля */
.settings-tabs{ display:flex; gap:8px; flex-wrap:wrap; padding:14px 20px 0; }
.tab-btn{
  padding:8px 14px; border-radius:999px; border:1px solid var(--border);
  background:var(--bg-raised); color:var(--text-dim);
  font-size:13px; font-weight:600; transition:border-color .12s ease, color .12s ease, background .12s ease;
}
.tab-btn:hover{ color:var(--text); border-color:var(--border-strong); }
.tab-btn.active{
  background:color-mix(in srgb, var(--accent1) 15%, transparent);
  border-color:var(--accent1); color:var(--accent1);
}
.settings-panel{ display:none; }
.settings-panel.active{ display:block; }

/* ---------- friends page ---------- */
.friends-grid{ display:grid; grid-template-columns:minmax(0,1fr) 330px; gap:clamp(20px,3vw,40px); align-items:start; }
.friends-grid .section{ margin-bottom:0; min-width:0; }
.friends-grid .section-head{ min-height:64px; }
.friends-narrow .section-head{ flex-wrap:wrap; }
.friends-narrow .vrow{ padding:12px 10px; gap:8px 10px; }
@media (max-width:980px){ .friends-grid{ grid-template-columns:1fr; } }

/* ряд кнопок в шапке профиля: Друзья / Моё аниме / Настройки / Выйти */
.cover-actions{
  margin-left:auto; display:flex; gap:10px; padding-bottom:6px;
  align-items:center; flex-wrap:wrap; justify-content:flex-end;
}
@media (max-width:700px){
  .cover-actions{ margin-left:0; width:100%; justify-content:flex-start; }
}


/* ---------- profile settings ---------- */
/* две колонки профиля: контент + «избранное» сбоку */
.profile-body{
  display:grid; grid-template-columns:minmax(0,1fr) 300px;
  gap:clamp(20px,3vw,40px); align-items:start;
}
.profile-body > aside{ min-width:0; }
@media (max-width:980px){ .profile-body{ grid-template-columns:1fr; } }

/* мелкие подписи-подсказки внутри настроек */
.count-line{
  font-size:12px; line-height:1.5; color:var(--text-faint); font-weight:500;
}

/* вкладки настроек внутри модалки не должны прокручиваться вместе с телом */
.modal .settings-tabs{ flex:0 0 auto; border-bottom:1px solid var(--border); padding-bottom:14px; }
.modal-body .settings-panel:not(.active){ display:none; }

.settings-card{
  border:1px solid rgba(255,255,255,.09); border-radius:var(--radius-lg);
  background:var(--bg-panel); padding:20px; margin-bottom:16px;
}
.settings-card .field{ margin-bottom:12px; }
.settings-card.danger{ border-color:rgba(229,50,45,.45); }
.settings-card.danger .section-title{ color:#ff8f8b; }

/* ---------- auth page ---------- */
.auth-wrap{ display:flex; align-items:center; justify-content:center; padding:40px 16px; }
.auth-card{
  width:100%; max-width:420px;
  background:var(--bg-panel); border:1px solid var(--border);
  border-radius:var(--radius-xl); padding:36px 34px;
  box-shadow:var(--shadow-pop);
}
.auth-logo{ display:flex; align-items:center; justify-content:center; gap:12px; margin-bottom:24px; }
.auth-card h1{ font-size:20px; font-weight:700; text-align:center; margin-bottom:6px; }
.auth-sub{ font-size:13px; color:var(--text-faint); text-align:center; margin-bottom:26px; }
.auth-card .field{ margin-bottom:16px; }
.auth-switch{ font-size:13px; color:var(--text-dim); text-align:center; margin-top:18px; }
.auth-switch a{ color:var(--accent1); font-weight:500; }
.auth-divider{
  display:flex; align-items:center; gap:12px; margin:22px 0;
  font-size:11px; color:var(--text-faint); text-transform:uppercase; letter-spacing:.08em;
}
.auth-divider::before,.auth-divider::after{ content:""; flex:1; height:1px; background:var(--border); }
.social-row{ display:flex; flex-direction:column; gap:10px; }
.social-btn{
  display:flex; align-items:center; justify-content:center; gap:10px;
  padding:10px; border-radius:9px; font-size:13px; font-weight:500;
  color:var(--text); background:var(--bg-raised); border:1px solid var(--border);
  transition:background .15s ease;
}
.social-btn:hover{ background:var(--bg-hover); }

/* auth страница без сайдбара: одна колонка, форма по центру */
body[data-page="auth"] .app{ grid-template-columns:1fr; min-height:100vh; }
body[data-page="auth"] .main{ justify-content:center; }
body[data-page="auth"] .auth-wrap{ padding:56px 16px; }
a.auth-logo{ transition:opacity .15s ease; cursor:pointer; }
a.auth-logo:hover{ opacity:.8; }
.auth-back{ text-align:center; margin-top:14px; }
.auth-back a{ font-size:13px; color:var(--text-faint); transition:color .15s ease; }
.auth-back a:hover{ color:#fff; }
@media (max-width:420px){
  .auth-card{ padding:28px 20px; }
}

/* ---------- watch together ---------- */
.room-cta{
  display:grid; grid-template-columns:1fr auto; gap:10px; align-items:center;
  background:var(--bg-panel); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:20px; margin-bottom:26px;
}
.room-cta .input{ width:100%; height:42px; }
.room-cta .btn{ height:42px; padding:0 18px; font-size:13px; white-space:nowrap; }
@media (max-width:640px){ .room-cta{ grid-template-columns:1fr; } }
.rooms-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:18px; align-items:stretch; }
.room-card{
  background:var(--bg-panel); border:1px solid var(--border); border-radius:var(--radius-lg);
  padding:20px; transition:border-color .15s ease, transform .15s ease;
  display:flex; flex-direction:column; gap:12px; height:100%;
}
.room-card:hover{ border-color:var(--border-strong); transform:translateY(-2px); }
.room-foot{ margin-top:auto; display:flex; flex-direction:column; gap:8px; padding-top:4px; }
.room-foot .btn{ width:100%; }
.room-head{ display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
.room-head .pill{ margin-top:2px; flex-shrink:0; }
.room-title{ font-size:15px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.room-meta{ display:flex; flex-direction:column; gap:8px; font-size:12.5px; color:var(--text-dim); }
.room-meta .row{ display:flex; align-items:center; gap:8px; }
.room-viewers{ display:flex; align-items:center; flex-wrap:wrap; gap:6px 0; }
.room-viewers .avatar{ width:26px; height:26px; font-size:10px; margin-left:-8px; border:2px solid var(--bg-panel); }
.room-viewers .avatar:first-child{ margin-left:0; }

/* ---------- панель комнаты на странице тайтла ---------- */
.room-panel{
  background:var(--bg-panel); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:18px 20px; margin-top:14px;
  display:flex; flex-direction:column; gap:14px;
}
.room-panel-head{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.room-panel-head .grow{ flex:1; }
.room-sync{ display:inline-flex; align-items:center; gap:7px; font-size:12px; color:var(--text-faint); }
.room-panel .room-viewers{ display:flex; align-items:center; flex-wrap:wrap; gap:6px 0; }
.room-panel .room-viewers .avatar{ width:26px; height:26px; font-size:10px; margin-left:-8px; border:2px solid var(--bg-panel); }
.room-panel .room-viewers .avatar:first-child{ margin-left:0; }
.room-panel-sub{ font-size:13px; color:var(--text-dim); line-height:1.6; }
.room-chat{
  display:flex; flex-direction:column; gap:8px;
  max-height:220px; overflow-y:auto;
  background:var(--bg-raised); border:1px solid var(--border);
  border-radius:10x; padding:12px 14px;
}
.chat-line{ display:flex; align-items:baseline; gap:8px; font-size:12.5px; line-height:1.5; }
.chat-line b{ color:var(--accent1); font-weight:600; flex-shrink:0; max-width:140px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-line span{ color:var(--text); overflow-wrap:anywhere; }
.chat-line i{ margin-left:auto; font-style:normal; font-size:11px; color:var(--text-faint); flex-shrink:0; }
.room-chat-form{ display:flex; gap:10px; }
.room-chat-form .input{ flex:1; }

/* ---------- friend rows (overrides) ---------- */
.vrow .avatar{ position:relative; }
.add-friend{
  display:flex; gap:10px; align-items:center; flex-wrap:wrap;
  margin-bottom:18px;
}
.add-friend .input{ flex:1; min-width:200px; max-width:280px; }

/* ---------- collection cards ---------- */
.collection-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:18px; }
.collection-card{
  background:var(--bg-panel); border:1px solid var(--border); border-radius:var(--radius-lg);
  overflow:hidden; transition:border-color .15s ease, transform .15s ease;
  display:flex; flex-direction:column; cursor:pointer;
}
.collection-card:hover{ border-color:var(--border-strong); transform:translateY(-2px); }
.collection-cover{
  aspect-ratio:16/9; position:relative; display:flex; align-items:center; justify-content:center;
}
.collection-cover .count-pill{
  position:absolute; top:10px; right:10px;
  font-size:11px; font-weight:600; color:#fff;
  background:rgba(10,10,14,.68); backdrop-filter:blur(3px);
  border:1px solid rgba(255,255,255,.14); padding:3px 8px; border-radius:6px;
}
.collection-body{ padding:16px 18px 18px; display:flex; flex-direction:column; gap:8px; flex:1; }
.collection-title{ font-size:14.5px; font-weight:600; }
.collection-desc{ font-size:12.5px; color:var(--text-faint); line-height:1.55; }
.collection-foot{ margin-top:auto; display:flex; justify-content:space-between; align-items:center; font-size:11.5px; color:var(--text-faint); padding-top:6px; }

/* ---------- table-ish (collection detail / friends) ---------- */
.mini-thumb{
  width:44px; height:62px; border-radius:6px; flex-shrink:0; position:relative; overflow:hidden;
  display:block; background:var(--bg-raised);
}
.mini-thumb .poster-letters{ font-size:13px; }
/* =========================================================
   Страница тайтла (title.html) — шапка-обложка, плеер, серии.
   Раньше здесь не было ни одного стиля.
   ========================================================= */

/* ---------- шапка: backdrop с постером и инфой ---------- */
.backdrop{
  position:relative; border-radius:var(--radius-xl); overflow:hidden;
  margin:10px 0 28px;
}
.bg-shade{
  position:absolute; inset:0;
  background:linear-gradient(180deg,rgba(11,11,13,.15) 0%,var(--bg) 96%);
}
.backdrop-content{ position:relative; z-index:1; padding:32px 28px 28px; }
.title-top{ display:flex; gap:24px; align-items:flex-end; flex-wrap:wrap; }

.title-poster{
  position:relative; flex-shrink:0; width:150px; height:212px;
  border-radius:var(--radius-lg); overflow:hidden;
  box-shadow:var(--shadow-card); border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center;
  background-color:var(--bg-raised);
}
.title-poster .poster-letters{ position:relative; z-index:1; font-weight:700; color:var(--text); }

.title-info{ flex:1; min-width:260px; padding-bottom:4px; }
.title-title{
  font-family:var(--font-display); font-size:clamp(24px,3.2vw,36px);
  font-weight:700; line-height:1.15; letter-spacing:-.01em;
}
.title-alt{ font-size:14px; color:var(--text-dim); margin-top:6px; }
.title-alt:empty{ display:none; }
.title-meta{
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  margin-top:14px; font-size:13px; color:var(--text-dim);
}
.title-meta > span:not(.pill){ color:var(--text-faint); }
.meta-row{ display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }

.title-actions{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  margin-top:20px;
}

/* тело страницы: контент слева, статистика справа */
.title-body{
  display:grid; grid-template-columns:1fr 220px; gap:32px;
  align-items:start;
}
.title-synopsis{ font-size:14px; line-height:1.7; color:var(--text-dim); max-width:820px; }
@media (max-width:900px){
  .title-body{ grid-template-columns:1fr; }
  .title-body aside{ order:-1; }
  .title-body aside .stat-grid{ grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); }
}
@media (max-width:640px){
  .title-top{ flex-direction:column; align-items:flex-start; }
  .title-poster{ width:120px; height:170px; }
}

/* ---------- плеер (iframe Kodik) ---------- */
.player{
  position:relative; width:100%; border-radius:var(--radius-lg); overflow:hidden;
  background:#000; border:1px solid var(--border);
  aspect-ratio:16/9;
}
.player.player-embed .embed-frame{
  position:absolute; inset:0; width:100%; height:100%; border:0;
}

/* заглушка «плеер подключается» */
.player-placeholder{
  position:relative; width:100%; height:100%;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:8px; text-align:center; padding:24px;
  background-size:cover; background-position:center;
}
.player-placeholder .pp-ico{
  position:relative; z-index:1; width:52px; height:52px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:rgba(12,12,16,.55); backdrop-filter:blur(6px);
  color:var(--text); margin-bottom:4px;
}
.player-placeholder .pp-title{
  position:relative; z-index:1; font-size:15px; font-weight:600; color:var(--text);
}
.player-placeholder .pp-sub{
  position:relative; z-index:1; font-size:12.5px; color:var(--text-dim);
  max-width:380px; line-height:1.5;
}

/* полоска под плеером: название · сезон/эпизод · метка Kodik */
.player-bar{
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  margin-top:10px; padding:10px 14px;
  background:var(--bg-panel); border:1px solid var(--border);
  border-radius:var(--radius); font-size:12.5px; color:var(--text-dim);
}
.player-bar > span:first-child{ color:var(--accent1); display:flex; align-items:center; }
.player-bar b{ color:var(--text); font-weight:600; }
.player-bar .grow{ flex:1; }
#ppMeta{ color:var(--text-faint); font-size:11.5px; }

/* ---------- список серий ---------- */
.ep-group{ margin-bottom:22px; }
.ep-group-title{
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  font-size:14.5px; font-weight:600; color:var(--text); margin-bottom:10px;
}
.ep-group-title svg{ color:var(--accent1); flex-shrink:0; }

.ep-grid{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
  gap:8px;
}
.ep-item{
  display:flex; align-items:center; gap:10px; width:100%;
  padding:10px 12px; border-radius:var(--radius);
  background:var(--bg-panel); border:1px solid var(--border);
  color:var(--text-dim); text-align:left; cursor:pointer;
  transition:background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.ep-item:hover{ background:var(--bg-hover); border-color:var(--border-strong); color:var(--text); }
.ep-item.current{ border-color:var(--accent1); background:color-mix(in srgb, var(--accent1) 10%, var(--bg-panel)); color:var(--text); }
.ep-item.watched{ opacity:.55; }
.ep-item.watched:hover{ opacity:1; }

.ep-n{
  flex-shrink:0; width:26px; height:26px; border-radius:8px;
  display:flex; align-items:center; justify-content:center;
  background:var(--bg-raised); font-size:12px; font-weight:700; color:var(--text-faint);
}
.ep-item.current .ep-n{ background:var(--accent1); color:var(--on-accent); }
.ep-t{ flex:1; min-width:0; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ep-len{ flex-shrink:0; font-size:11.5px; color:var(--text-faint); }
.done-mark{ flex-shrink:0; color:var(--ok); display:flex; align-items:center; }

@media (max-width:640px){
  .ep-grid{ grid-template-columns:1fr; }
}

/* =========================================================
   Каталог / «Моё аниме»: панель фильтров (была без стилей).
   ========================================================= */
.filter-chips{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; }

.toolbar{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; flex-wrap:wrap; margin-bottom:20px;
}
.toolbar-left{ display:flex; gap:10px; flex-wrap:wrap; }
.toolbar .select{ min-width:150px; }
@media (max-width:640px){
  .toolbar{ flex-direction:column; align-items:stretch; }
  .toolbar-left{ flex-direction:column; }
  .toolbar .select{ width:100%; }
}

/* ---------- главная: плашка со счётчиком тайтлов в hero ---------- */
.stat-chip-text{ font-size:12.5px; line-height:1.4; color:var(--text-dim); }
.stat-chip-text strong{ color:var(--text); font-size:15px; }
