/* Tsukimi — чёрная тема. Один акцент: лунный «костяной» цвет; красный только у сердечка. */
:root {
  --bg: #030304;
  --ink: #000;
  --s1: #0d0d0d;
  --panel: #0d0d0d;
  --s2: #161616;
  --panel-2: #181818;
  --s3: #222;
  --line: rgba(255, 255, 255, .1);
  --line-2: rgba(255, 255, 255, .18);
  --text: #f3f1ea;
  --muted: #8f8d87;
  --moon: #ece4cc;
  --moon-ink: #0a0a0a;
  --rose: #ff5d6c;
  --radius: 14px;
  --nav-h: 68px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --font-head: "Geologica", "Onest", system-ui, sans-serif;
  --font-body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.6 var(--font-body); -webkit-font-smoothing: antialiased;
}
/* чистый глубокий чёрный: без зерна, только очень мягкий объём (большие размытые отсветы и виньетка) */
body { background-color: #030304; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 45% at 12% -5%, rgba(236, 228, 204, .055), transparent 70%),
    radial-gradient(ellipse 55% 50% at 100% 35%, rgba(120, 130, 190, .045), transparent 70%),
    radial-gradient(ellipse 70% 40% at 20% 105%, rgba(236, 228, 204, .035), transparent 70%),
    radial-gradient(ellipse 120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, .55) 100%);
}
::selection { background: var(--moon); color: var(--moon-ink); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--moon); outline-offset: 3px; border-radius: 6px; }
main { min-height: 70vh; outline: none; }
[hidden] { display: none !important; }
* { scrollbar-width: thin; scrollbar-color: #333 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 8px; }

/* смена страницы */
#app.enter > * { animation: pagein .45s var(--ease); }
@keyframes pagein { from { opacity: 0; } }

/* ---------- шапка ---------- */
.nav {
  position: sticky; top: 0; z-index: 30; height: var(--nav-h);
  display: flex; align-items: center; gap: 22px; padding: 0 clamp(16px, 4vw, 56px);
  background: transparent; border: 0;
  transition: background .35s, box-shadow .35s, backdrop-filter .35s;
}
/* затемнение под шапкой поверх яркого баннера: текст читается на любой картинке */
.nav::before {
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: 0; height: calc(var(--nav-h) + 56px); pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .88) 0%, rgba(0, 0, 0, .7) 38%, rgba(0, 0, 0, .3) 72%, rgba(0, 0, 0, 0) 100%);
  transition: opacity .35s;
}
.nav.scrolled { background: rgba(0, 0, 0, .78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--line); }
.nav.scrolled::before { opacity: 0; }
.logo { text-shadow: 0 1px 10px rgba(0, 0, 0, .8); display: inline-flex; align-items: center; gap: 10px; font: 700 21px var(--font-head); letter-spacing: -.04em; color: var(--text); white-space: nowrap; }
/* луна: при загрузке «растёт» из новолуния */
.logo::before {
  content: ""; width: 20px; height: 20px; border-radius: 50%; background: var(--moon);
  box-shadow: inset -7px 0 0 0 #000; animation: phase 1.6s .2s var(--ease) both;
}
@keyframes phase { from { box-shadow: inset -20px 0 0 0 #000; transform: rotate(-30deg); } to { box-shadow: inset -7px 0 0 0 #000; transform: rotate(0); } }
.nav-search { flex: 1; max-width: 440px; }
.nav-search input {
  width: 100%; padding: 10px 18px; border-radius: 999px; background: rgba(0, 0, 0, .45);
  border: 1px solid var(--line-2); transition: background .2s, border-color .2s;
}
.nav-search input::placeholder { color: var(--muted); }
.nav-search input:focus { outline: none; background: rgba(255, 255, 255, .1); border-color: var(--line-2); }
.nav-links { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.nav-links a, .nav-links button {
  padding: 8px 14px; border-radius: 999px; background: none; border: 0; color: rgba(243, 241, 234, .82); font-weight: 500; font-size: 15px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .85);
  transition: color .2s, background .2s;
}
.nav-links a:hover, .nav-links button:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.nav-links a.on { color: #fff; background: rgba(255, 255, 255, .14); }

/* ---------- общие блоки ---------- */
.wrap { padding: 28px clamp(16px, 4vw, 56px) 72px; max-width: 1480px; margin: 0 auto; }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -.03em; line-height: 1.1; margin: 0; }
h2 { font-size: 22px; font-weight: 600; }
.section { margin-top: 44px; content-visibility: auto; contain-intrinsic-size: auto 420px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; gap: 12px; }
.muted { color: var(--muted); }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.loading { padding: 100px 0; text-align: center; color: var(--muted); }
.loading::before { content: ""; display: block; width: 22px; height: 22px; margin: 0 auto 14px; border-radius: 50%; background: var(--moon); box-shadow: inset -8px 0 0 0 #000; animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .05); font-weight: 600;
  transition: background .2s, transform .2s var(--ease), border-color .2s, color .2s;
}
.btn:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .3); }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--text); color: #000; border-color: var(--text); }
.btn.primary:hover { background: #fff; transform: translateY(-1px); }
.btn.liked { color: var(--rose); border-color: var(--rose); background: rgba(255, 93, 108, .1); }
.btn[disabled] { opacity: .45; cursor: default; }

/* ---------- карточки ---------- */
.row {
  display: grid; grid-auto-flow: column; grid-auto-columns: 176px; gap: 18px; overflow-x: auto; padding: 4px 2px 16px;
  scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain;
}
.row::-webkit-scrollbar { display: none; }
.row > * { scroll-snap-align: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 26px 18px; }
.card { display: block; position: relative; transition: transform .35s var(--ease); }
.card:hover { transform: translateY(-5px); }
.card .poster {
  position: relative; z-index: 1; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 12px;
  background: linear-gradient(110deg, #101010 30%, #1b1b1b 50%, #101010 70%) 0 0 / 200% 100%; animation: shimmer 1.6s linear 3;
  box-shadow: inset 0 0 0 1px var(--line);
}
@keyframes shimmer { to { background-position: -200% 0; } }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); animation: imgin .6s .05s var(--ease) both; }
@keyframes imgin { from { opacity: 0; } }
.card:hover img { transform: scale(1.07); }
/* затемнение и кнопка «играть» при наведении */
.card .poster.ld { animation: none; background: #101010; }
.card .poster::after {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .35s;
  background: linear-gradient(to top, rgba(0, 0, 0, .85), rgba(0, 0, 0, .15) 55%, transparent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); border-radius: inherit;
}
.card .poster::before {
  content: ""; position: absolute; z-index: 2; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
  background: var(--text) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 6.5v11l9-5.5z' fill='black'/></svg>") center / 26px no-repeat;
  opacity: 0; transform: scale(.7); transition: opacity .3s, transform .4s var(--ease);
}
.card:hover .poster::after { opacity: 1; }
.card:hover .poster::before { opacity: 1; transform: scale(1); }
.card .score {
  position: absolute; z-index: 3; top: 9px; left: 9px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: rgba(0, 0, 0, .72); color: var(--text); border: 1px solid var(--line);
}
.card .score::before { content: "★ "; color: var(--moon); }
.card .heart { position: absolute; z-index: 3; top: 8px; right: 10px; color: var(--rose); font-size: 18px; text-shadow: 0 1px 6px #000; }
.card .bar { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .15); }
.card .bar i { display: block; height: 100%; background: var(--text); }
.card .name {
  margin-top: 10px; font-weight: 600; font-size: 14.5px; line-height: 1.3; transition: color .2s;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card:not(:hover) .name { color: #d9d7d0; }
.card .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* топ: крупные контурные цифры за постерами (у 10+ места под две цифры) */
.row.ranked { grid-auto-columns: max-content; counter-reset: rank; gap: 10px; }
.row.ranked .card { counter-increment: rank; --pad: 44px; width: calc(176px + var(--pad)); padding-left: var(--pad); }
.row.ranked .card:nth-child(n+10) { --pad: 100px; }
.row.ranked .card::before {
  content: counter(rank); position: absolute; left: 0; top: 150px; z-index: 0;
  font: 800 118px/1 var(--font-head); letter-spacing: -.07em; color: transparent; -webkit-text-stroke: 2px rgba(255, 255, 255, .3);
  transition: -webkit-text-stroke-color .3s;
}
.row.ranked .card:hover::before { -webkit-text-stroke-color: var(--moon); }
.row.ranked .poster { width: 176px; }

/* ---------- главная ---------- */
.hero {
  position: relative; min-height: min(82vh, 720px); overflow: hidden; background: #080808;
  margin-top: calc(var(--nav-h) * -1);
}
.hero-slide {
  position: absolute; inset: 0; display: flex; align-items: flex-end;
  padding: calc(var(--nav-h) + 40px) clamp(16px, 4vw, 56px) clamp(60px, 7vw, 96px);
  opacity: 0; visibility: hidden; transition: opacity .9s var(--ease), visibility 0s .9s;
}
.hero-slide.on { opacity: 1; visibility: visible; transition: opacity .9s var(--ease), visibility 0s; z-index: 1; }
.hero-slide .bg { position: absolute; inset: 0; background: 30% 20% / cover no-repeat; transform: scale(1.07); transition: transform 9s linear; }
.hero-slide.on .bg { transform: scale(1); }
.hero-slide .bg.hq { animation: hqin .8s var(--ease) both; }
@keyframes hqin { from { opacity: .3; } }
.hero-slide::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(to right, rgba(0, 0, 0, .9) 0%, rgba(0, 0, 0, .55) 42%, rgba(0, 0, 0, .05) 80%),
    linear-gradient(to top, #000 2%, rgba(0, 0, 0, .35) 38%, transparent 70%);
}
.hero-in { position: relative; z-index: 2; max-width: 780px; }
.hero h1 { font-size: clamp(34px, 5vw, 64px); font-weight: 700; line-height: 1.02; letter-spacing: -.045em; text-wrap: balance; }
.hero p { color: #cfcdc6; margin: 16px 0 26px; max-width: 56ch; min-height: 4.5em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero .meta { margin-top: 18px; }
.hero-tag { display: inline-block; margin-bottom: 14px; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--moon); background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(8px); }
/* текст слайда выезжает по очереди при каждой смене */
.hero-slide.on .hero-in > * { animation: heroin .9s var(--ease) both; }
.hero-slide.on .hero-in > :nth-child(1) { animation-delay: .15s; }
.hero-slide.on .hero-in > :nth-child(2) { animation-delay: .25s; }
.hero-slide.on .hero-in > :nth-child(3) { animation-delay: .35s; }
.hero-slide.on .hero-in > :nth-child(4) { animation-delay: .45s; }
.hero-slide.on .hero-in > :nth-child(5) { animation-delay: .55s; }
@keyframes heroin { from { opacity: 0; transform: translateY(22px); filter: blur(6px); } }
.hero-dots { position: absolute; z-index: 3; left: clamp(16px, 4vw, 56px); bottom: clamp(26px, 3.5vw, 44px); display: flex; gap: 8px; }
.hd { width: 38px; height: 20px; padding: 8px 0; background: none; border: 0; cursor: pointer; }
.hd i { display: block; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .22); position: relative; overflow: hidden; }
.hd i::after { content: ""; position: absolute; inset: 0; background: var(--moon); transform: scaleX(0); transform-origin: left; }
.hd.on i::after { animation: hdfill 8s linear forwards; }
.hero:hover .hd.on i::after { animation-play-state: paused; }
@keyframes hdfill { to { transform: scaleX(1); } }
.hd:hover i { background: rgba(255, 255, 255, .4); }
.hero + .wrap { padding-top: 0; }

.friend-list { display: grid; gap: 10px; }
.friend { display: flex; gap: 14px; align-items: center; padding: 10px; border-radius: var(--radius); background: var(--s1); border: 1px solid var(--line); transition: border-color .2s, background .2s; }
.friend:hover { border-color: var(--line-2); background: var(--s2); }
.friend img { width: 48px; height: 68px; object-fit: cover; border-radius: 8px; }
.friend b { color: var(--moon); }

/* ---------- страница аниме ---------- */
.detail { position: relative; }
.detail-banner { height: 440px; margin-top: calc(var(--nav-h) * -1); background: #080808 center 25% / cover; position: relative; animation: bannerin 1.4s var(--ease) both; }
@keyframes bannerin { from { opacity: 0; transform: scale(1.04); } }
.detail-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, #000 0%, rgba(0, 0, 0, .55) 50%, rgba(0, 0, 0, .35)); }
.detail-body { display: grid; grid-template-columns: 250px 1fr; gap: 36px; margin-top: -180px; position: relative; z-index: 1; }
.detail-body .cover { width: 100%; border-radius: 14px; aspect-ratio: 2 / 3; object-fit: cover; background: var(--s2); box-shadow: 0 0 0 1px var(--line-2), 0 24px 60px rgba(0, 0, 0, .8); }
.detail h1 { font-size: clamp(28px, 4.4vw, 52px); font-weight: 700; letter-spacing: -.04em; text-wrap: balance; }
.detail .alt { color: var(--muted); margin-top: 8px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 14px; margin-top: 16px; }
.meta b { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip {
  padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line);
  font-size: 13.5px; color: #d9d7d0; cursor: pointer; transition: background .2s, border-color .2s, color .2s;
}
.chip:hover { background: rgba(255, 255, 255, .11); border-color: var(--line-2); }
.chip.on { background: var(--text); color: #000; border-color: var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; align-items: center; }
.select { padding: 10px 16px; border-radius: 999px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line-2); }
.select option { background: #111; }
.desc { max-width: 68ch; margin-top: 24px; white-space: pre-line; color: #c9c7c0; line-height: 1.7; }
.eps { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; margin-top: 14px; }
.ep { padding: 10px 0; text-align: center; border-radius: 10px; background: var(--s1); border: 1px solid var(--line); font-weight: 600; font-size: 14px; transition: background .2s, color .2s, transform .2s var(--ease), border-color .2s; }
.ep:hover { background: var(--text); color: #000; border-color: var(--text); transform: translateY(-2px); }
.ep.cur { background: var(--text); color: #000; border-color: var(--text); }
.ep.done { color: var(--muted); }

/* ---------- плеер ---------- */
.watch { max-width: 1160px; margin: 0 auto; }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 16px; overflow: hidden; box-shadow: 0 0 0 1px var(--line), 0 30px 80px rgba(0, 0, 0, .9); }
.player video { display: block; width: 100%; height: 100%; background: #000; }
.player iframe { display: block; width: 100%; height: 100%; border: 0; }
.player-note { position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 10px 14px; border-radius: 10px; background: rgba(0, 0, 0, .8); backdrop-filter: blur(10px); border: 1px solid var(--line); color: var(--text); font-size: 14px; }
.player-empty { height: 100%; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); }
/* источники — сегментированный переключатель */
.srcbar { display: flex; flex-wrap: wrap; gap: 2px; margin: 0 0 14px; padding: 4px; width: fit-content; max-width: 100%; background: var(--s1); border: 1px solid var(--line); border-radius: 999px; }
.srcbar .chip { background: none; border-color: transparent; padding: 7px 16px; color: var(--muted); }
.srcbar .chip:hover { color: var(--text); background: rgba(255, 255, 255, .07); }
.srcbar .chip.on { background: var(--text); color: #000; }
.srcbar .chip.off { opacity: .4; }
.or { display: flex; align-items: center; gap: 12px; margin: 20px 0 4px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn.oauth { width: 100%; justify-content: center; margin-top: 12px; }
.btn.google { width: 100%; justify-content: center; margin-top: 12px; background: #fff; color: #1f1f1f; border-color: #fff; }
.btn.google:hover { background: #e8e8e8; }
.tip { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 14px; padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--s1); color: var(--muted); font-size: 14px; line-height: 1.5; }
.tip p { margin: 0; flex: 1; max-width: 70ch; }
.tip a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.tip-ico { color: var(--moon); font-size: 18px; line-height: 1.2; }
.tip-x { flex: none; margin-left: auto; width: 28px; height: 28px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: 20px; line-height: 1; transition: background .2s, color .2s; }
.tip-x:hover { background: rgba(255, 255, 255, .1); color: var(--text); }
.alt-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.watch-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0; }
.watch-bar .grow { flex: 1; min-width: 200px; }
.watch-bar h1 { font-size: 19px; font-weight: 600; }

/* ---------- поиск ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 8px; align-items: center; }
.filters input[type=search], .filters input[type=number] { padding: 11px 18px; border-radius: 999px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line-2); }
.filters input:focus { outline: none; border-color: var(--text); }
.filters input[type=number] { width: 110px; }
.more { display: block; margin: 32px auto 0; }

/* ---------- вход ---------- */
.auth { max-width: 430px; margin: 64px auto 0; padding: 32px; background: var(--s1); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .8); animation: heroin .7s var(--ease) both; }
.auth h1 { font-size: 26px; margin-bottom: 6px; }
.tabs { display: flex; gap: 4px; margin: 22px 0 8px; padding: 4px; background: #000; border: 1px solid var(--line); border-radius: 999px; }
.tabs button { flex: 1; padding: 9px; border-radius: 999px; border: 0; background: none; color: var(--muted); font-weight: 600; transition: background .25s, color .25s; }
.tabs button.on { background: var(--text); color: #000; }
.field { display: block; margin-top: 16px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input { width: 100%; padding: 12px 15px; border-radius: 12px; background: #000; border: 1px solid var(--line-2); transition: border-color .2s; }
.field input:focus { outline: none; border-color: var(--text); }
.auth .btn { width: 100%; justify-content: center; margin-top: 22px; }
.error { color: var(--rose); margin-top: 12px; font-size: 14px; min-height: 1.4em; }
.note { margin-top: 16px; font-size: 13px; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 24px); background: var(--text); color: #000;
  padding: 11px 20px; border-radius: 999px; font-weight: 600; opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .35s var(--ease); z-index: 300; box-shadow: 0 12px 40px rgba(0, 0, 0, .7);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* сезоны */
.seasons { display: flex; gap: 10px; flex-wrap: wrap; }
.season {
  display: flex; flex-direction: column; gap: 3px; padding: 12px 16px; border-radius: 12px; min-width: 150px; max-width: 250px;
  background: var(--s1); border: 1px solid var(--line); transition: background .2s, border-color .2s, transform .25s var(--ease);
}
.season b { font-size: 13.5px; }
.season span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.season small { font-size: 11.5px; color: var(--muted); opacity: .7; }
.season:hover { background: var(--s2); border-color: var(--line-2); transform: translateY(-2px); }
.season.cur { background: var(--text); border-color: var(--text); }
.season.cur b, .season.cur span, .season.cur small { color: #000; opacity: 1; }
.season.cur span, .season.cur small { color: #444; }

.skel { height: 12px; border-radius: 6px; margin: 10px 0; background: linear-gradient(90deg, #111, #222, #111); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skel.s { width: 60%; }

/* меню пользователя */
.usermenu { position: relative; margin-left: 6px; }
.usermenu > button { background: rgba(0, 0, 0, .5); color: #fff; border: 1px solid var(--line-2); }
.usermenu .menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; padding: 6px; z-index: 60; display: flex; flex-direction: column;
  background: rgba(14, 14, 14, .96); backdrop-filter: blur(16px); border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .85); transform-origin: top right; animation: pop .25s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(-6px); } }
.usermenu .menu a, .usermenu .menu button { display: block; width: 100%; text-align: left; padding: 10px 13px; border-radius: 9px; background: none; border: 0; color: var(--text); font-weight: 500; }
.usermenu .menu a:hover, .usermenu .menu button:hover { background: rgba(255, 255, 255, .09); }
.usermenu .menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.usermenu .menu .danger { color: var(--rose); }

/* окно добавления */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .72); backdrop-filter: blur(8px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px; overflow: auto; animation: pagein .25s; }
.modal-box { background: #0b0b0b; border: 1px solid var(--line-2); border-radius: 20px; padding: 22px; width: 100%; max-width: 580px; box-shadow: 0 40px 100px #000; animation: pop .35s var(--ease); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.modal-head h3 { margin: 0; font-size: 19px; font-weight: 600; }
.modal .x { background: none; border: 0; color: var(--muted); font-size: 18px; width: 32px; height: 32px; border-radius: 50%; transition: background .2s, color .2s; }
.modal .x:hover { background: rgba(255, 255, 255, .1); color: var(--text); }
.add-res { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; max-height: 56vh; overflow: auto; }
.add-row { display: flex; gap: 14px; align-items: center; padding: 8px; border-radius: 12px; background: var(--s1); border: 1px solid transparent; transition: border-color .2s, background .2s; }
.add-row:hover { background: var(--s2); border-color: var(--line); }
.add-row img { width: 46px; height: 64px; object-fit: cover; border-radius: 7px; }
.add-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.add-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.add-info span { font-size: 12.5px; }

/* «продолжаем с…» */
.resume { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 11px 16px; margin-bottom: 12px; border-radius: 14px; background: var(--s1); border: 1px solid var(--line-2); animation: heroin .5s var(--ease); }
.resume span::before { content: "▶  "; color: var(--moon); font-size: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- живой поиск ---------- */
.nav-search { position: relative; }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 10px); min-width: min(460px, 92vw); max-height: min(70vh, 560px); overflow-y: auto;
  padding: 6px; background: rgba(12, 12, 12, .96); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .9);
  transform-origin: top center; animation: pop .28s var(--ease); transition: opacity .15s;
}
.suggest.busy { opacity: .72; }
.sg-row { display: flex; gap: 12px; align-items: center; padding: 7px; border-radius: 12px; animation: sgin .35s var(--ease) both; transition: background .15s; }
@keyframes sgin { from { opacity: 0; transform: translateX(-10px); } }
.sg-row:hover, .sg-row.sel { background: rgba(255, 255, 255, .09); }
.sg-row img { width: 40px; height: 56px; object-fit: cover; border-radius: 6px; background: var(--s2); flex: none; }
.sg-t { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sg-t b { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-t span { font-size: 12.5px; color: var(--muted); }
.sg-t mark { background: none; color: var(--moon); text-decoration: underline; text-decoration-color: rgba(236, 228, 204, .4); text-underline-offset: 3px; }
.sg-row.sk { animation: none; }
.sg-row.sk i { width: 40px; height: 56px; border-radius: 6px; background: linear-gradient(110deg, #141414 30%, #222 50%, #141414 70%) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; }
.sg-row.sk b, .sg-row.sk span { display: block; height: 11px; border-radius: 6px; background: #1a1a1a; margin: 6px 0; width: 180px; }
.sg-row.sk span { width: 110px; }
.sg-empty { padding: 18px 14px; color: var(--muted); font-size: 14px; }
.sg-all { display: block; margin-top: 4px; padding: 11px 14px; border-radius: 12px; text-align: center; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); transition: color .15s, background .15s; }
.sg-all:hover { color: var(--text); background: rgba(255, 255, 255, .06); }

/* ---------- ряды: стрелки и перетаскивание ---------- */
.row-wrap { position: relative; }
.row-wrap::after { content: ""; position: absolute; top: 0; right: 0; bottom: 16px; width: 64px; pointer-events: none; background: linear-gradient(to right, transparent, var(--bg)); transition: opacity .3s; }
.row-wrap.at-end::after { opacity: 0; }
.row { cursor: grab; }
.row.dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.row.dragging * { pointer-events: none; }
.row .card img { -webkit-user-drag: none; user-select: none; }
.row-btn {
  position: absolute; top: calc(50% - 40px); z-index: 5; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2);
  background: rgba(10, 10, 10, .82); backdrop-filter: blur(10px); color: var(--text); font-size: 26px; line-height: 1; padding: 0 0 3px;
  opacity: 0; transform: scale(.85); transition: opacity .25s, transform .3s var(--ease), background .2s;
}
.row-btn.prev { left: -8px; } .row-btn.next { right: -8px; }
.row-wrap:hover .row-btn { opacity: 1; transform: scale(1); }
.row-btn:hover { background: var(--text); color: #000; }
.row-btn.off { opacity: 0 !important; pointer-events: none; }
@media (hover: none) { .row-btn { display: none; } .row { cursor: auto; } }

/* ---------- библиотека ---------- */
.lib-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.lib-head h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 700; letter-spacing: -.04em; }
.lib-cont {
  display: flex; align-items: center; gap: 18px; margin-top: 22px; padding: 14px 20px 14px 14px; max-width: 560px;
  border-radius: 18px; background: var(--s1); border: 1px solid var(--line); transition: border-color .25s, background .25s, transform .3s var(--ease);
}
.lib-cont:hover { border-color: var(--line-2); background: var(--s2); transform: translateY(-2px); }
.lib-cont img { width: 52px; height: 74px; object-fit: cover; border-radius: 8px; }
.lib-cont div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lib-cont b { font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-cont span { font-size: 13px; }
.lib-cont i { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: #000; font-style: normal; font-size: 14px; padding-left: 3px; transition: transform .3s var(--ease); }
.lib-cont:hover i { transform: scale(1.1); }
.lib-tabs { display: flex; gap: 4px; margin: 28px 0 26px; padding: 4px; width: fit-content; max-width: 100%; overflow-x: auto; background: var(--s1); border: 1px solid var(--line); border-radius: 999px; scrollbar-width: none; }
.lib-tabs::-webkit-scrollbar { display: none; }
.lib-tabs a { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; color: var(--muted); font-weight: 500; white-space: nowrap; transition: color .2s, background .25s; }
.lib-tabs a:hover { color: var(--text); background: rgba(255, 255, 255, .07); }
.lib-tabs a.on { background: var(--text); color: #000; }
.lib-tabs em { font-style: normal; font-size: 12px; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, .1); }
.lib-tabs a.on em { background: rgba(0, 0, 0, .12); }
.lib-grid .card.in { animation: cardin .55s var(--ease) backwards; animation-delay: calc(var(--i) * 40ms); }
@keyframes cardin { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.lib-empty { padding: 64px 20px; text-align: center; border: 1px dashed var(--line-2); border-radius: 22px; color: var(--muted); }
.lib-empty p { max-width: 44ch; margin: 18px auto 22px; }
.lib-empty .moon { width: 42px; height: 42px; margin: 0 auto; border-radius: 50%; background: var(--moon); box-shadow: inset -15px 0 0 0 #000, 0 0 0 1px var(--line-2); opacity: .9; }

/* ---------- каталог ---------- */
.cat-head h1 { font-size: clamp(30px, 4.4vw, 48px); font-weight: 700; letter-spacing: -.045em; }
.cat-head p { margin: 8px 0 0; max-width: 60ch; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 16px; padding: 10px; align-items: center; background: var(--s1); border: 1px solid var(--line); border-radius: 22px; }
.f-search { flex: 1 1 280px; position: relative; }
.f-search::before { content: ""; position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; margin-top: -9px; opacity: .55; pointer-events: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='M20 20l-3.5-3.5'/></svg>") center / contain no-repeat; }
.f-search input { width: 100%; padding: 13px 18px 13px 44px !important; background: #000 !important; border: 1px solid var(--line-2) !important; border-radius: 999px; font-size: 16px; }
.filters .select, .filters input[type=number] { background: #000; }
.filters .btn { padding: 11px 18px; }
.genre-row { flex-wrap: nowrap; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; margin-top: 0; }
.genre-row::-webkit-scrollbar { display: none; }
.genre-row .chip { flex: none; }
#results { margin-top: 20px; transition: opacity .2s; }
#results.busy { opacity: .6; }
.card.sk .poster { animation: shimmer 1.2s linear infinite; }
.card.sk .name, .card.sk .sub { height: 12px; border-radius: 6px; background: #151515; margin-top: 10px; width: 80%; }
.card.sk .sub { width: 45%; margin-top: 8px; }
.card.in { animation: cardin .5s var(--ease) backwards; animation-delay: calc(var(--i) * 28ms); }
.card.sk:hover { transform: none; }

/* ---------- умный поиск ---------- */
.ai-block { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--line); }
.ai-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-bottom: 18px; }
.ai-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-tags .chip { cursor: default; padding: 3px 11px; font-size: 12.5px; }
.ai-wait { display: flex; align-items: center; gap: 10px; margin-top: 26px; color: var(--muted); font-size: 14px; }
.ai-wait i { width: 14px; height: 14px; border-radius: 50%; background: var(--moon); box-shadow: inset -5px 0 0 0 #000; animation: spin 1s linear infinite; }

.btn.soon { cursor: default; color: var(--muted); border-style: dashed; background: transparent; }
.btn.soon:hover { background: transparent; border-color: var(--line-2); }


/* ---------- сенсорные экраны: наведение мыши не «залипает» после касания ---------- */
@media (hover: none) {
  .card:hover { transform: none; }
  .card:hover img { transform: none; }
  .card:hover .poster::after, .card:hover .poster::before { opacity: 0; }
  .ep:hover, .season:hover, .lib-cont:hover, .btn.primary:hover { transform: none; }
  .row.ranked .card:hover::before { -webkit-text-stroke-color: inherit; }
}

/* ---------- телефон: отдельный интерфейс (html[data-device="mobile"] выставляется скриптом в index.html) ---------- */
html[data-device="mobile"] { -webkit-text-size-adjust: 100%; }
html[data-device="mobile"] body { -webkit-tap-highlight-color: transparent; padding-bottom: env(safe-area-inset-bottom); }
html[data-device="mobile"] input, html[data-device="mobile"] select, html[data-device="mobile"] textarea { font-size: 16px; } /* iOS не приближает экран при вводе */
html[data-device="mobile"] { --nav-h: 56px; }

/* шапка: сплошная, не лежит поверх баннера; прячется при прокрутке вниз и возвращается при прокрутке вверх */
html[data-device="mobile"] .nav {
  height: auto; flex-wrap: wrap; gap: 8px 8px; padding: calc(8px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
  background: #000; box-shadow: 0 1px 0 var(--line); transition: transform .3s var(--ease);
}
html[data-device="mobile"] .nav::before { display: none; }
html[data-device="mobile"] .nav.scrolled { background: rgba(0, 0, 0, .92); }
html[data-device="mobile"] .nav.hide { transform: translateY(-100%); }
html[data-device="mobile"] .logo { font-size: 19px; text-shadow: none; }
html[data-device="mobile"] .nav-links { gap: 0; }
html[data-device="mobile"] .nav-links a, html[data-device="mobile"] .nav-links button { padding: 10px 12px; min-height: 40px; display: inline-flex; align-items: center; text-shadow: none; }
html[data-device="mobile"] .nav-search { order: 3; flex-basis: 100%; max-width: none; }
html[data-device="mobile"] .nav-search input { padding: 11px 18px; background: var(--s1); }
html[data-device="mobile"] .suggest { left: 0; right: 0; width: auto; max-height: 60vh; overflow: auto; }

html[data-device="mobile"] .wrap { padding: 18px 14px 56px; }
html[data-device="mobile"] .section { margin-top: 32px; }
html[data-device="mobile"] h2 { font-size: 20px; }

/* главная: сверху чёткая картинка, текст под ней и частично наплывает на её низ */
html[data-device="mobile"] .hero { min-height: 600px; margin-top: 0; touch-action: pan-y; background: #000; }
html[data-device="mobile"] .hero-slide { padding: 0 16px 52px; }
html[data-device="mobile"] .hero-slide .bg { inset: 0 0 auto 0; height: 330px; background-position: center 30%; transform: none; transition: none; }
html[data-device="mobile"] .hero-slide.on .bg { transform: none; }
html[data-device="mobile"] .hero-slide::before {
  inset: 0 0 auto 0; height: 331px; bottom: auto;
  background: linear-gradient(to bottom, transparent 0%, transparent 38%, rgba(0, 0, 0, .65) 78%, #000 100%);
}
html[data-device="mobile"] .hero h1 { font-size: clamp(26px, 7.6vw, 34px); }
html[data-device="mobile"] .hero p { font-size: 14.5px; margin: 12px 0 18px; min-height: 0; -webkit-line-clamp: 3; }
html[data-device="mobile"] .hero .meta { margin-top: 12px; flex-wrap: wrap; }
html[data-device="mobile"] .hero-tag { margin-bottom: 10px; font-size: 11.5px; }
html[data-device="mobile"] .hero .btn { min-height: 46px; padding: 0 28px; }
html[data-device="mobile"] .hero-dots { left: 16px; bottom: 20px; }
html[data-device="mobile"] .hd { width: 30px; }

/* ряды: свайп пальцем, края на всю ширину экрана, без стрелок */
html[data-device="mobile"] .row { grid-auto-columns: 130px; gap: 12px; margin: 0 -14px; padding: 4px 14px 14px; scroll-padding: 0 14px; -webkit-overflow-scrolling: touch; cursor: auto; }
html[data-device="mobile"] .row-btn, html[data-device="mobile"] .row-wrap::after { display: none; }
html[data-device="mobile"] .row.ranked .card { --pad: 30px; width: calc(130px + var(--pad)); }
html[data-device="mobile"] .row.ranked .card:nth-child(n+10) { --pad: 70px; }
html[data-device="mobile"] .row.ranked .poster { width: 130px; }
html[data-device="mobile"] .row.ranked .card::before { font-size: 82px; top: 100px; }
html[data-device="mobile"] .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
html[data-device="mobile"] .card .name { font-size: 14px; }

/* страница аниме */
html[data-device="mobile"] .detail-banner { height: 220px; margin-top: 0; }
html[data-device="mobile"] .detail-body { grid-template-columns: 1fr; gap: 18px; margin-top: -90px; }
html[data-device="mobile"] .detail-body .cover { width: 140px; }
html[data-device="mobile"] .detail-body h1 { font-size: clamp(26px, 8vw, 34px); }
html[data-device="mobile"] .actions { gap: 8px; }
html[data-device="mobile"] .actions .btn.primary, html[data-device="mobile"] .actions .btn.soon { flex: 1 1 100%; justify-content: center; text-align: center; min-height: 48px; }
html[data-device="mobile"] .actions .btn:not(.primary):not(.soon), html[data-device="mobile"] .actions .select { flex: 1 1 calc(50% - 4px); min-height: 46px; }
html[data-device="mobile"] .seasons { display: flex; flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px; padding: 2px 14px 10px; scroll-snap-type: x proximity; scrollbar-width: none; }
html[data-device="mobile"] .seasons::-webkit-scrollbar { display: none; }
html[data-device="mobile"] .seasons .season { scroll-snap-align: start; flex: 0 0 74%; min-width: 0; }

/* просмотр: плеер на всю ширину, крупные кнопки серий */
html[data-device="mobile"] .watch { margin: 0; padding-left: 0; padding-right: 0; }
html[data-device="mobile"] .srcbar { max-width: calc(100% - 28px); }
html[data-device="mobile"] .watch > *:not(.player-wrap) { margin-left: 14px; margin-right: 14px; }
html[data-device="mobile"] .player { border-radius: 0; box-shadow: none; }
html[data-device="mobile"] .watch-bar { margin: 14px 14px; }
html[data-device="mobile"] .watch-bar .grow { min-width: 100%; }
html[data-device="mobile"] .srcbar { flex-wrap: nowrap; overflow-x: auto; width: auto; max-width: calc(100% - 28px); scrollbar-width: none; }
html[data-device="mobile"] .srcbar::-webkit-scrollbar { display: none; }
html[data-device="mobile"] .srcbar .chip { white-space: nowrap; flex: none; padding: 9px 14px; }
html[data-device="mobile"] .eps { grid-template-columns: repeat(5, 1fr); gap: 8px; }
html[data-device="mobile"] .ep { padding: 13px 0; }

/* каталог и библиотека */
html[data-device="mobile"] .filters { padding: 8px; gap: 8px; }
html[data-device="mobile"] .filters .f-search { flex-basis: 100%; }
html[data-device="mobile"] .filters .select, html[data-device="mobile"] .filters input[type=number] { flex: 1 1 calc(50% - 4px); width: auto; min-height: 44px; }
html[data-device="mobile"] .genre-row { margin: 0 -14px; padding: 2px 14px 10px; }
html[data-device="mobile"] .chip { min-height: 38px; display: inline-flex; align-items: center; }
html[data-device="mobile"] .lib-tabs { width: auto; margin: 18px -14px 18px; border-radius: 0; border-left: 0; border-right: 0; padding: 4px 10px; }
html[data-device="mobile"] .lib-tabs a { padding: 10px 14px; }

/* вход */
html[data-device="mobile"] .auth { margin: 18px auto 0; padding: 22px 18px; border-radius: 20px; }
html[data-device="mobile"] .field input { padding: 14px 15px; }
html[data-device="mobile"] .btn { min-height: 44px; }

/* окна: выезжают снизу как на телефоне, меню и уведомления учитывают нижнюю «чёлку» */
html[data-device="mobile"] .modal { align-items: flex-end; padding: 0; }
html[data-device="mobile"] .modal-box { max-width: none; border-radius: 22px 22px 0 0; max-height: 88svh; overflow: auto; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
html[data-device="mobile"] .toast { bottom: calc(20px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); text-align: center; }
html[data-device="mobile"] .usermenu .menu { right: 0; }

/* свой плеер на весь экран: картинка заполняет экран без чёрных полос по бокам (у длинных телефонов экран шире, чем 16:9) */
.player video:fullscreen, .player video:-webkit-full-screen { object-fit: cover; background: #000; }

/* пропуск опенинга/эндинга: кнопка поверх плеера */
.player-wrap { position: relative; }
.skip-btn {
  position: absolute; right: 16px; bottom: 78px; z-index: 6; min-height: 44px; padding: 0 20px; border-radius: 999px;
  background: rgba(0, 0, 0, .74); color: #fff; border: 1px solid rgba(255, 255, 255, .3); font-weight: 600; font-size: 15px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); cursor: pointer; animation: pop .28s var(--ease);
  transition: background .2s, color .2s;
}
.skip-btn:hover { background: #fff; color: #000; }
.skip-btn[hidden] { display: none; }
.auto-skip { font-size: 13.5px; padding: 9px 16px; color: var(--muted); }
.auto-skip.on { color: #000; background: var(--moon); border-color: var(--moon); }
html[data-device="mobile"] .skip-btn { right: 10px; bottom: 62px; }

/* ---------- фон страницы просмотра: тёмный, с мягким свечением цвета обложки ---------- */
.watch-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; background:
  radial-gradient(ellipse 70% 55% at 50% 0%, color-mix(in srgb, var(--glow) 24%, transparent), transparent 70%),
  radial-gradient(ellipse 45% 40% at 0% 55%, color-mix(in srgb, var(--glow) 12%, transparent), transparent 70%),
  radial-gradient(ellipse 45% 40% at 100% 65%, color-mix(in srgb, var(--glow) 12%, transparent), transparent 70%),
  #050507; }
.watch .player { box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 30px 90px color-mix(in srgb, var(--glow) 22%, #000); }

/* ---------- обновлённые ряды и карточки главной ---------- */
.section { margin-top: 56px; }
.section-head { margin-bottom: 20px; }
.section-head h2 { font-size: 24px; font-weight: 700; display: flex; align-items: center; gap: 12px; }
.section-head h2::before { content: ""; width: 4px; height: 22px; border-radius: 3px; background: var(--moon); box-shadow: 0 0 14px rgba(236, 228, 204, .45); }
.row { gap: 20px; padding: 8px 2px 22px; }
.card .poster { border-radius: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .08); transition: box-shadow .4s var(--ease); }
.card:hover { transform: translateY(-7px); }
.card:hover .poster { box-shadow: 0 18px 44px color-mix(in srgb, var(--c, #666) 55%, transparent), inset 0 0 0 1px rgba(255, 255, 255, .3); }
.card .poster::before { display: none; }
.card .gen { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; padding: 38px 12px 12px; display: flex; flex-direction: column; gap: 2px;
  background: linear-gradient(to top, rgba(0, 0, 0, .92), transparent); opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .4s var(--ease); font-size: 12.5px; }
.card .gen b { font-weight: 600; } .card .gen em { font-style: normal; color: var(--muted); }
.card:hover .gen { opacity: 1; transform: none; }
.card .poster::after { background: linear-gradient(to top, rgba(0, 0, 0, .55), transparent 60%); box-shadow: none; }
.card .score { backdrop-filter: blur(8px); background: rgba(0, 0, 0, .55); font-size: 12px; }
.card .bar { height: 4px; background: rgba(255, 255, 255, .18); }
.card .bar i { background: var(--moon); box-shadow: 0 0 8px rgba(236, 228, 204, .6); border-radius: 0 3px 3px 0; }
.card .name { margin-top: 12px; font-size: 14.5px; font-weight: 600; }
.card .sub { font-size: 12.5px; }
@media (hover: none) { .card .gen { display: none; } }

/* ---------- ряды на всю ширину: карточки растягиваются, ряд заканчивается ровно у края ---------- */
html:not([data-device="mobile"]) .wrap { max-width: 1760px; }
html:not([data-device="mobile"]) .row:not(.ranked) {
  --n: 5; --gap: 20px; gap: var(--gap);
  grid-auto-columns: calc((100% - (var(--n) - 1) * var(--gap)) / var(--n));
}
@media (min-width: 900px)  { html:not([data-device="mobile"]) .row:not(.ranked) { --n: 6; } }
@media (min-width: 1300px) { html:not([data-device="mobile"]) .row:not(.ranked) { --n: 7; } }
@media (min-width: 1650px) { html:not([data-device="mobile"]) .row:not(.ranked) { --n: 8; } }
html:not([data-device="mobile"]) .row:not(.ranked) .card .poster { width: 100%; }
html:not([data-device="mobile"]) .row.ranked {
  --n: 5; --gap: 14px; gap: var(--gap);
  grid-auto-columns: calc((100% - (var(--n) - 1) * var(--gap)) / var(--n));
}
@media (min-width: 900px)  { html:not([data-device="mobile"]) .row.ranked { --n: 6; } }
@media (min-width: 1300px) { html:not([data-device="mobile"]) .row.ranked { --n: 7; } }
@media (min-width: 1650px) { html:not([data-device="mobile"]) .row.ranked { --n: 8; } }
html:not([data-device="mobile"]) .row.ranked .card { width: auto; }
html:not([data-device="mobile"]) .row.ranked .poster { width: 100%; }
html:not([data-device="mobile"]) .row.ranked .card::before { top: auto; bottom: 92px; font-size: 104px; }

/* ---------- библиотека: счётчики ---------- */
.lib-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.lib-stats span { padding: 6px 14px; border-radius: 999px; background: var(--s1); border: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
.lib-stats b { color: var(--text); font-weight: 700; margin-right: 4px; }
.add-sec { display: flex; align-items: center; gap: 8px; margin: 14px 0 6px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; letter-spacing: .02em; }
.ai-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--moon); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .25; transform: scale(.7); } }

/* ---------- ряд «в тренде»: постеры подогнаны под ширину, места под большие цифры сохранены ---------- */
.row-wrap { container-type: inline-size; }
html:not([data-device="mobile"]) .row.ranked {
  --pw: calc((100cqw - 4px - (var(--n) - 1) * var(--gap)) / var(--n) - 44px);
  grid-auto-columns: max-content;
}
html:not([data-device="mobile"]) .row.ranked .card { width: calc(var(--pw) + var(--pad)); }
html:not([data-device="mobile"]) .row.ranked .poster { width: var(--pw); }

/* ---------- карточки крупнее (раньше сжимались до 150px) ---------- */
@media (min-width: 1px)    { html:not([data-device="mobile"]) .row:not(.ranked) { --n: 4; } html:not([data-device="mobile"]) .row.ranked { --n: 3; } }
@media (min-width: 900px)  { html:not([data-device="mobile"]) .row:not(.ranked) { --n: 5; } html:not([data-device="mobile"]) .row.ranked { --n: 4; } }
@media (min-width: 1250px) { html:not([data-device="mobile"]) .row:not(.ranked) { --n: 6; } html:not([data-device="mobile"]) .row.ranked { --n: 4; } }
@media (min-width: 1500px) { html:not([data-device="mobile"]) .row:not(.ranked) { --n: 7; } html:not([data-device="mobile"]) .row.ranked { --n: 5; } }
@media (min-width: 1900px) { html:not([data-device="mobile"]) .row:not(.ranked) { --n: 8; } html:not([data-device="mobile"]) .row.ranked { --n: 6; } }
/* при прокрутке ряда эффекты наведения выключены, края постеров не мерцают */
.row.scrolling .card { pointer-events: none; }
.row.scrolling .card:hover { transform: none; }
.card .poster { isolation: isolate; transform: translateZ(0); }
.card img { backface-visibility: hidden; }

/* ---------- объёмные цифры в «В тренде» ---------- */
.row.ranked .card::before {
  color: transparent; -webkit-text-stroke: 0;
  background-image: linear-gradient(170deg, #fffdf2 0%, #cfc7ad 38%, #6f6a58 72%, #2c2a22 100%);
  -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(1px 1px 0 #3a372c) drop-shadow(2px 2px 0 #2f2d24) drop-shadow(3px 3px 0 #25231c) drop-shadow(4px 4px 0 #1b1a15) drop-shadow(0 10px 16px rgba(0, 0, 0, .85));
  transition: filter .35s, transform .4s var(--ease);
}
.row.ranked .card:hover::before {
  background-image: linear-gradient(170deg, #fffdf2 0%, #ece4cc 40%, #a99d70 75%, #4a4330 100%);
  filter: drop-shadow(1px 1px 0 #5a5030) drop-shadow(2px 2px 0 #463e26) drop-shadow(3px 3px 0 #342e1c) drop-shadow(4px 4px 0 #242013) drop-shadow(0 10px 18px rgba(0, 0, 0, .9)) drop-shadow(0 0 16px rgba(236, 228, 204, .35));
  transform: translateY(-4px);
}
html:not([data-device="mobile"]) .row.ranked { --pw: calc((100cqw - 4px - (var(--n) - 1) * var(--gap)) / var(--n) - 72px); }
html:not([data-device="mobile"]) .row.ranked .card { --pad: 72px; }
html:not([data-device="mobile"]) .row.ranked .card:nth-child(n+10) { --pad: 130px; }
html:not([data-device="mobile"]) .row.ranked .card::before { font-size: 118px; bottom: 96px; left: 2px; }

/* ---------- шрифт названий аниме ---------- */
:root { --font-title: "Oswald", "Onest", system-ui, sans-serif; }
.hero h1, .detail h1, .watch-bar h1, .lib-cont b { font-family: var(--font-title); font-weight: 600; letter-spacing: .005em; line-height: 1.04; }
.hero h1 { font-size: clamp(38px, 5.4vw, 72px); }
.detail h1 { font-size: clamp(32px, 4.8vw, 58px); }
.card .name { font-family: var(--font-title); font-weight: 500; font-size: 16.5px; letter-spacing: .01em; line-height: 1.25; }
.sg-t b { font-family: var(--font-title); font-weight: 500; letter-spacing: .01em; }

/* ---------- шапка: без полосы, кнопки «жидкое стекло» ---------- */
html:not([data-device="mobile"]) .nav, html:not([data-device="mobile"]) .nav.scrolled {
  background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
}
html:not([data-device="mobile"]) .nav::before, html:not([data-device="mobile"]) .nav::after { display: none; }
html:not([data-device="mobile"]) .nav { gap: 16px; padding-top: 6px; }
html:not([data-device="mobile"]) .nav-search { flex: 1; max-width: 460px; margin: 0 auto; transform: translateX(-3.5vw); }
html:not([data-device="mobile"]) .nav-links { margin-left: 0; gap: 8px; }
/* стекло: видно, что находится за кнопкой */
html:not([data-device="mobile"]) .nav-search input,
html:not([data-device="mobile"]) .nav-links > a,
html:not([data-device="mobile"]) .usermenu > button {
  background: linear-gradient(135deg, rgba(255, 255, 255, .17), rgba(255, 255, 255, .05));
  backdrop-filter: blur(14px) saturate(1.8); -webkit-backdrop-filter: blur(14px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, .22); color: #fff; text-shadow: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38), inset 0 -1px 0 rgba(255, 255, 255, .06), 0 8px 22px rgba(0, 0, 0, .28);
}
html:not([data-device="mobile"]) .nav-search input { padding: 10px 18px 10px 44px; background-image: linear-gradient(135deg, rgba(255, 255, 255, .17), rgba(255, 255, 255, .05)), url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f3f1ea' stroke-width='2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='M20 20l-3.5-3.5'/></svg>"); background-position: 0 0, 16px center; background-size: auto, 18px; background-repeat: no-repeat; }
html:not([data-device="mobile"]) .nav-search input:focus { background-color: transparent; border-color: rgba(255, 255, 255, .45); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 0 0 4px rgba(255, 255, 255, .1), 0 12px 30px rgba(0, 0, 0, .35); }
html:not([data-device="mobile"]) .nav-links > a.on { background: var(--moon); color: #0a0a0a; border-color: transparent; }

/* ---------- анимации наведения ---------- */
:root { --spring: cubic-bezier(.34, 1.56, .64, 1); }
.nav-links > a, .usermenu > button { position: relative; overflow: hidden; transition: transform .4s var(--spring), background-color .25s, border-color .25s, box-shadow .3s, color .2s; }
.nav-links > a::after, .usermenu > button::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; transform: translateX(-130%);
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .45) 50%, transparent 65%); transition: transform .7s var(--ease);
}
.nav-links > a:hover::after, .usermenu > button:hover::after { transform: translateX(130%); }
.nav-links > a:hover, .usermenu > button:hover { transform: translateY(-2px) scale(1.06); border-color: rgba(255, 255, 255, .5); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 14px 30px rgba(0, 0, 0, .4), 0 0 22px rgba(255, 255, 255, .12); }
.nav-links > a:active, .usermenu > button:active { transform: scale(.94); transition-duration: .12s; }
.btn, .chip, .lib-tabs a, .srcbar .chip, .ep { transition: transform .4s var(--spring), background-color .25s, border-color .25s, color .2s, box-shadow .3s; }
.btn:hover, .chip:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .4); }
.btn:active, .chip:active, .lib-tabs a:active, .ep:active { transform: scale(.94); transition-duration: .12s; }
.lib-tabs a:hover, .srcbar .chip:hover { transform: translateY(-1px) scale(1.04); }
.lib-tabs a em { transition: transform .35s var(--spring), background .25s; }
.lib-tabs a:hover em { transform: scale(1.18); }
.usermenu .menu a, .usermenu .menu button { transition: background-color .2s, transform .35s var(--spring), padding-left .3s var(--ease); }
.usermenu .menu a:hover, .usermenu .menu button:hover { transform: translateX(3px); padding-left: 17px; }
.usermenu .menu > * { animation: itemin .4s var(--ease) both; }
.usermenu .menu > *:nth-child(2) { animation-delay: .04s; } .usermenu .menu > *:nth-child(3) { animation-delay: .08s; } .usermenu .menu > *:nth-child(4) { animation-delay: .12s; }
@keyframes itemin { from { opacity: 0; transform: translateX(-8px); } }
.logo::before { transition: transform .6s var(--spring); }
.logo:hover::before { transform: rotate(180deg) scale(1.15); }
@media (prefers-reduced-motion: reduce) { .nav-links > a::after, .usermenu > button::after { display: none; } }
html:not([data-device="mobile"]) .logo {
  padding: 8px 18px 8px 14px; border-radius: 999px; text-shadow: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, .17), rgba(255, 255, 255, .05));
  backdrop-filter: blur(14px) saturate(1.8); -webkit-backdrop-filter: blur(14px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, .22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38), 0 8px 22px rgba(0, 0, 0, .28);
  transition: transform .4s var(--spring), box-shadow .3s;
}
html:not([data-device="mobile"]) .logo:hover { transform: translateY(-2px) scale(1.04); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 14px 30px rgba(0, 0, 0, .4); }
html:not([data-device="mobile"]) .nav-search input::placeholder { color: rgba(255, 255, 255, .72); }
.nav-links > a::after, .usermenu > button::after { background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .2) 50%, transparent 65%); }
html:not([data-device="mobile"]) .nav-links > a, html:not([data-device="mobile"]) .usermenu > button { text-shadow: 0 1px 6px rgba(0, 0, 0, .55); }
html:not([data-device="mobile"]) .nav-links > a.on { text-shadow: none; }

/* ---------- шапка: чистая, без стекла и подложек ---------- */
html:not([data-device="mobile"]) .logo,
html:not([data-device="mobile"]) .nav-links > a,
html:not([data-device="mobile"]) .usermenu > button {
  background: none; backdrop-filter: none; -webkit-backdrop-filter: none; border: 0; box-shadow: none; border-radius: 999px;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .85), 0 0 2px rgba(0, 0, 0, .5);
}
html:not([data-device="mobile"]) .logo { padding: 0; }
html:not([data-device="mobile"]) .logo:hover { transform: none; box-shadow: none; }
html:not([data-device="mobile"]) .nav-links { gap: 4px; }
html:not([data-device="mobile"]) .nav-links > a, html:not([data-device="mobile"]) .usermenu > button { padding: 8px 14px; color: rgba(255, 255, 255, .85); font-weight: 500; }
.nav-links > a::after, .usermenu > button::after { display: none; }
/* подчёркивание вырастает из центра */
.nav-links > a::before { content: ""; position: absolute; left: 50%; bottom: 3px; width: 0; height: 2px; border-radius: 2px; background: var(--moon); transform: translateX(-50%); transition: width .35s var(--ease); }
.nav-links > a:hover::before, .nav-links > a.on::before { width: calc(100% - 28px); }
html:not([data-device="mobile"]) .nav-links > a:hover, html:not([data-device="mobile"]) .usermenu > button:hover { background: none; color: #fff; transform: translateY(-1px); box-shadow: none; border: 0; }
html:not([data-device="mobile"]) .nav-links > a.on { background: none; color: #fff; text-shadow: 0 1px 10px rgba(0, 0, 0, .85); font-weight: 600; }
html:not([data-device="mobile"]) .usermenu > button { background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .16); }
html:not([data-device="mobile"]) .usermenu > button:hover { background: rgba(0, 0, 0, .4); border: 1px solid rgba(255, 255, 255, .3); }
/* поиск: тонкое тёмное поле, как раньше */
html:not([data-device="mobile"]) .nav-search input {
  background-color: rgba(0, 0, 0, .35); background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d6d4cc' stroke-width='2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='M20 20l-3.5-3.5'/></svg>");
  background-position: 16px center; background-size: 18px; background-repeat: no-repeat;
  backdrop-filter: none; -webkit-backdrop-filter: none; border: 1px solid rgba(255, 255, 255, .16); box-shadow: none; transition: background-color .25s, border-color .25s, box-shadow .3s;
}
html:not([data-device="mobile"]) .nav-search input:hover { border-color: rgba(255, 255, 255, .3); }
html:not([data-device="mobile"]) .nav-search input:focus { background-color: rgba(0, 0, 0, .55); border-color: rgba(255, 255, 255, .45); box-shadow: 0 0 0 4px rgba(255, 255, 255, .08); }
html:not([data-device="mobile"]) .nav-search input::placeholder { color: rgba(255, 255, 255, .6); }

/* ---------- цифры топа: белые объёмные, на наведении «выскакивают» ---------- */
.row.ranked .card::before {
  background-image: linear-gradient(175deg, #ffffff 0%, #f1f1f1 45%, #bdbdbd 100%); background-size: 100% 100%;
  filter: drop-shadow(1px 1px 0 #6a6a6a) drop-shadow(2px 2px 0 #565656) drop-shadow(3px 3px 0 #424242) drop-shadow(4px 4px 0 #2e2e2e) drop-shadow(0 10px 16px rgba(0, 0, 0, .85));
  transform-origin: 30% 80%;
}
.row.ranked .card:hover::before {
  background-image: linear-gradient(175deg, #ffffff 0%, #ffffff 40%, #d0d0d0 100%);
  filter: drop-shadow(2px 2px 0 #7a7a7a) drop-shadow(4px 4px 0 #626262) drop-shadow(6px 6px 0 #4a4a4a) drop-shadow(8px 8px 0 #323232) drop-shadow(0 14px 22px rgba(0, 0, 0, .9));
  transform: translateY(-6px) rotate(-3deg) scale(1.06);
  animation: numpop .65s var(--spring);
}
@keyframes numpop {
  0% { transform: translateY(0) rotate(0) scale(1); }
  35% { transform: translateY(-16px) rotate(-8deg) scale(1.14); }
  70% { transform: translateY(-3px) rotate(-1deg) scale(1.03); }
  100% { transform: translateY(-6px) rotate(-3deg) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) { .row.ranked .card:hover::before { animation: none; } }

/* ---------- шапка ПК: редакторский стиль, прячется при прокрутке вниз ---------- */
html:not([data-device="mobile"]) .nav { transition: transform .5s var(--ease), opacity .4s; }
html:not([data-device="mobile"]) .nav.hide { transform: translateY(-110%); opacity: 0; }
/* вернувшаяся шапка: мягкая тень сверху без границ, чтобы текст читался на любом контенте */
html:not([data-device="mobile"]) .nav.scrolled::before {
  display: block; opacity: 1; height: calc(var(--nav-h) + 40px);
  background: linear-gradient(to bottom, rgba(0, 0, 0, .92) 0%, rgba(0, 0, 0, .75) 45%, rgba(0, 0, 0, 0) 100%);
}
html:not([data-device="mobile"]) .nav-links > a { font-size: 13px; letter-spacing: .09em; text-transform: uppercase; font-weight: 600; padding: 9px 14px; }
html:not([data-device="mobile"]) .nav-links > a.on { font-weight: 700; }
html:not([data-device="mobile"]) .logo { font-size: 22px; letter-spacing: -.03em; }
html:not([data-device="mobile"]) .logo::before { width: 22px; height: 22px; box-shadow: inset -8px 0 0 0 #000, 0 0 18px rgba(236, 228, 204, .45); }
.usermenu > button { display: inline-flex; align-items: center; gap: 9px; padding: 4px 12px 4px 4px; }
.usermenu .av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--moon); color: #0a0a0a; font: 700 13px var(--font-head); text-shadow: none; flex: none; transition: transform .4s var(--spring); }
.usermenu > button:hover .av { transform: rotate(-12deg) scale(1.12); }
.usermenu .un { font-size: 13.5px; font-weight: 600; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu .car { font-size: 10px; opacity: .7; transition: transform .3s var(--ease); }
.usermenu > button[aria-expanded="true"] .car { transform: rotate(180deg); }
html:not([data-device="mobile"]) .usermenu > button { padding: 4px 14px 4px 4px; background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .14); }
html:not([data-device="mobile"]) .nav::before { display: block; height: calc(var(--nav-h) + 30px); background: linear-gradient(to bottom, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0)); }

/* ---------- фикс цветных полос по краям постеров ---------- */
.card .poster { background: #0d0d0d !important; }
.card .poster img { display: block; position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; }

/* ---------- общий визуальный полиш ---------- */
.genre-row { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent); }
.auth { margin-top: 56px; padding-bottom: 28px; background: linear-gradient(180deg, #131315, #0d0d0f); border-color: rgba(255,255,255,.09); box-shadow: 0 30px 80px rgba(0,0,0,.8), 0 0 90px rgba(244,239,228,.04); }
.auth input { transition: border-color .25s, box-shadow .25s, background .25s; }
.auth input:focus, .srcbar input:focus, .filters input:focus { outline: none; border-color: rgba(244,239,228,.55); box-shadow: 0 0 0 4px rgba(244,239,228,.08); }
.desc { max-width: 64ch; font-size: 15.5px; color: #bdbbb4; }
.chips .chip { transition: transform .35s var(--spring), background .25s, border-color .25s, color .25s; }
.chips .chip:hover { transform: translateY(-2px); border-color: rgba(244,239,228,.5); }
.section-title, .row-head h2 { letter-spacing: .01em; }
html[data-device="mobile"] .nav { background: linear-gradient(180deg, rgba(0,0,0,.85), rgba(0,0,0,.6)); }

/* ---------- мобильный полиш ---------- */
html[data-device="mobile"] .nav { padding-top: calc(4px + env(safe-area-inset-top)); padding-bottom: 8px; gap: 4px; background: rgba(3,3,4,.94); box-shadow: none; }
html[data-device="mobile"] .nav-search input { padding: 8px 16px; font-size: 14px; min-height: 38px; background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.08); }
html[data-device="mobile"] .nav-links a.on { background: none; position: relative; color: #fff; }
html[data-device="mobile"] .nav-links a.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 5px; height: 2px; border-radius: 2px; background: var(--moon); }
html[data-device="mobile"] .filters input:focus, html[data-device="mobile"] .nav-search input:focus { box-shadow: none; }
html[data-device="mobile"] .empty { padding: 28px 18px !important; font-size: 14.5px; }
html[data-device="mobile"] .page-title, html[data-device="mobile"] .wrap > h1 { font-size: 30px; }
html[data-device="mobile"] .watch-bar { margin: 10px 14px; }
html[data-device="mobile"] .watch .notice, html[data-device="mobile"] .watch [class*="note"] { font-size: 12.5px; line-height: 1.5; padding: 10px 14px; }
html[data-device="mobile"] .watch [class*="note"] p, html[data-device="mobile"] .watch .notice p { font-size: 12.5px; line-height: 1.5; }
html[data-device="mobile"] .tip { padding: 10px 14px; gap: 10px; }
html[data-device="mobile"] .tip p { font-size: 12.5px; line-height: 1.5; }
html[data-device="mobile"] .watch-bar .grow { min-width: 0; flex: 1 1 100%; }
html[data-device="mobile"] .watch-bar h1, html[data-device="mobile"] .watch-bar .grow { font-size: 18px; }

/* ---------- друзья ---------- */
.fr-h { font-size: 18px; margin: 30px 0 12px; }
.fr-add { margin-top: 20px; }
.fr-add input { width: 100%; max-width: 420px; padding: 12px 18px; border-radius: 999px; background: #000; border: 1px solid var(--line); color: var(--text, #fff); font: inherit; }
.fr-add input:focus { outline: none; border-color: rgba(244,239,228,.55); }
.fr-list { display: grid; gap: 8px; margin-top: 10px; max-width: 520px; }
.fr-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; background: var(--s1); border: 1px solid var(--line); border-radius: 14px; }
.fr-av { width: 34px; height: 34px; border-radius: 50%; background: var(--moon); color: var(--moon-ink); display: grid; place-items: center; font-weight: 700; }
.fr-btns { margin-left: auto; display: flex; gap: 6px; }
.fr-btns .btn { min-height: 34px; padding: 0 14px; font-size: 13px; }
html[data-device="mobile"] .tip { padding: 10px 14px; gap: 10px; }
html[data-device="mobile"] .tip p { font-size: 12.5px; line-height: 1.5; }
html[data-device="mobile"] .watch-bar { gap: 8px 10px; }
html[data-device="mobile"] .watch-bar .grow { order: 3; flex: 1 1 100%; min-width: 100%; font-size: 17px; }
html[data-device="mobile"] .watch-bar .auto-skip { margin-left: auto; padding: 0 12px; font-size: 12.5px; }
html[data-device="mobile"] .watch-bar .btn { min-height: 38px; padding: 0 14px; font-size: 13.5px; }

/* ---------- переключатель режимов ---------- */
.modesw { display: inline-flex; gap: 2px; padding: 3px; margin-left: 14px; border-radius: 999px; background: rgba(255,255,255,.07); border: 1px solid var(--line); flex: none; }
.modesw a { padding: 5px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); transition: background .3s var(--spring), color .2s; }
.modesw a:hover { color: #fff; }
.modesw a.on { background: var(--moon); color: var(--moon-ink); }
html[data-device="mobile"] .modesw { margin-left: 8px; }
html[data-device="mobile"] .modesw a { padding: 5px 11px; }
html[data-device="mobile"] .nav .logo { flex: none; }

/* ---------- режим «Киноман»: жёлто-чёрная тема ---------- */
html[data-mode="kino"] { --moon: #ffc61a; --moon-ink: #141000; --bg: #050503; }
html[data-mode="kino"] body, html[data-mode="kino"] body { background-color: #050503; }
html[data-mode="kino"] body::before {
  background:
    radial-gradient(ellipse 60% 45% at 12% -5%, rgba(255,198,26,.08), transparent 70%),
    radial-gradient(ellipse 55% 50% at 100% 35%, rgba(255,150,0,.04), transparent 70%),
    radial-gradient(ellipse 120% 90% at 50% 50%, transparent 55%, rgba(0,0,0,.6) 100%);
}
html[data-mode="kino"] .logo { color: var(--moon); letter-spacing: .02em; text-transform: uppercase; font-weight: 800; }
html[data-mode="kino"] .section-head h2::before, html[data-mode="kino"] .section-title::before { background: var(--moon); }
html[data-mode="kino"] .btn.primary { background: var(--moon); color: var(--moon-ink); }
html[data-mode="kino"] .row.ranked .card::before { background-image: linear-gradient(180deg, #ffe38a, #ffc61a 60%, #c98f00); }
.kino-hero { position: relative; min-height: 62vh; display: flex; align-items: flex-end; background-size: cover; background-position: center 25%; margin-top: calc(-1 * var(--nav-h)); }
.kino-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, #050503 4%, rgba(5,5,3,.55) 45%, rgba(5,5,3,.25)); }
.kino-hero-in { position: relative; z-index: 1; padding-bottom: 44px; max-width: 760px; margin-left: 0; }
.kino-hero h1 { font-family: var(--font-title, var(--font-head)); font-size: clamp(34px, 5vw, 64px); line-height: 1.05; margin: 10px 0; }
.kino-hero p { color: #cfcabb; max-width: 56ch; margin: 0 0 20px; }
html[data-device="mobile"] .kino-hero { min-height: 480px; margin-top: 0; }
html[data-device="mobile"] .kino-hero { min-height: 400px; }
html[data-device="mobile"] .kino-hero p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 14.5px; }
html[data-device="mobile"][data-mode="kino"] .nav .logo { font-size: 17px; }
html[data-device="mobile"] .nav-links { margin-left: auto; }
html[data-mode="kino"] .btn.primary { border-color: var(--moon); }
html[data-mode="kino"] .chip.on, html[data-mode="kino"] .ep.cur, html[data-mode="kino"] .srcbar .chip.on { background: var(--moon); color: var(--moon-ink); border-color: var(--moon); }
.kino-player { margin-top: 18px; }
#kWatch { padding-top: 28px; }

/* Киноман: вкладки «Фильмы / Сериалы» в каталоге */
.kf-tabs { display: inline-flex; gap: 4px; padding: 4px; margin-top: 18px; background: var(--s1); border: 1px solid var(--line); border-radius: 999px; }
.kf-tabs button { padding: 9px 22px; border-radius: 999px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; transition: background .25s, color .25s; }
.kf-tabs a { padding: 9px 22px; border-radius: 999px; color: var(--moon); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.kf-tabs button.on { background: var(--moon); color: var(--moon-ink, #0a0a0a); }
html[data-device="mobile"] .kf-tabs { display: flex; margin-top: 14px; }
html[data-device="mobile"] .kf-tabs a { flex: 1; padding: 0 8px; min-height: 42px; }
html[data-device="mobile"] .kf-tabs button { flex: 1; min-height: 42px; }
