/* Журнал просмотра — оформление.
 *
 * Правило, из которого следует всё остальное: латунь — это след зрителя.
 * Позиция в серии, просмотренные номера, статус, оценка, избранное — латунные.
 * Всё, что знает библиотека, — год, жанр, число серий, оценка Шикимори — пена
 * и дымка. Поэтому на странице каталога латуни почти нет, а на странице тайтла
 * её ровно столько, сколько человек успел насмотреть.
 *
 * Числа везде моноширинные: номер серии и таймкод — это измерение, а не текст.
 */

/* --- цвета и меры -------------------------------------------------------- */

:root {
  --abyss: #050b14;          /* фон страницы */
  --deep:  #0a1524;          /* панели */
  --sea:   #0f1f34;          /* приподнятое */
  --swell: #16294a;          /* наведение */
  --edge:  #1d3252;          /* волосяные линии */
  --foam:  #e8eef6;          /* основной текст */
  --haze:  #8296b0;          /* второстепенный */
  --dim:   #566b88;          /* совсем тихий */
  --brass: #d9a441;          /* след зрителя, и только он */
  --brass-dim: #8a6a2c;
  --rust:  #cf7361;          /* сбои */

  --pad: clamp(16px, 4vw, 40px);
  --r: 12px;
  --r-sm: 8px;
  --shell: 1560px;

  --sans: 'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Unbounded', var(--sans);
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* --- основа -------------------------------------------------------------- */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 50% -8%, rgba(38, 78, 132, .40), transparent 70%),
    radial-gradient(700px 400px at 92% 6%, rgba(217, 164, 65, .06), transparent 70%),
    var(--abyss);
  background-attachment: fixed;
  color: var(--foam);
  font: 400 15.5px/1.6 var(--sans);
  letter-spacing: .1px;
}

main {
  position: relative;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 30px var(--pad) 96px;
}
main.narrow { max-width: 960px; }

h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0 0 12px; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.sr {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.hidden { display: none !important; }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
  border-radius: 3px;
}

::selection { background: rgba(217, 164, 65, .28); }

/* --- шапка --------------------------------------------------------------- */

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 0 var(--pad);
  height: 62px;
  background: rgba(5, 11, 20, .78);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(29, 50, 82, .8);
}

.top .mark {
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: .22em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav { display: flex; gap: 22px; align-items: center; }
.nav a {
  font-size: 14px;
  color: var(--haze);
  padding: 4px 0;
  border-bottom: 1.5px solid transparent;
  transition: color .18s var(--ease), border-color .18s var(--ease);
  white-space: nowrap;
}
.nav a:hover { color: var(--foam); }
.nav a.on { color: var(--foam); border-bottom-color: var(--brass); }

.find { position: relative; margin-left: auto; flex: 0 1 380px; }
.find input {
  width: 100%;
  height: 38px;
  padding: 0 40px 0 15px;
  background: rgba(15, 31, 52, .8);
  border: 1px solid var(--edge);
  border-radius: 999px;
  transition: border-color .18s var(--ease), background .18s var(--ease);
  font-size: 14px;
}
.find input::placeholder { color: var(--dim); }
.find input:focus { outline: none; border-color: var(--brass-dim); background: var(--sea); }
.find kbd {
  position: absolute; right: 8px; top: 8px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  font: 500 11px var(--mono);
  color: var(--dim);
  border: 1px solid var(--edge);
  border-radius: 5px;
  pointer-events: none;
}
.find input:focus ~ kbd { opacity: 0; }

/* Живая подсказка поиска: три буквы — и видно, о чём вообще речь. */
.hits {
  position: absolute; top: 46px; left: 0; right: 0;
  background: var(--deep);
  border: 1px solid var(--edge);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
  z-index: 50;
}
.hits a {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(29, 50, 82, .5);
}
.hits a:last-child { border-bottom: 0; }
.hits a:hover, .hits a.cur { background: var(--sea); }
.hits img { width: 34px; height: 48px; object-fit: cover; border-radius: 4px; }
/* Название строкой, год и тип — под ним. Инлайном они цеплялись к длинному
   названию и уезжали на вторую строку вперемешку со словами. */
.hits .t { display: block; font-size: 14px; line-height: 1.3; }
.hits .f { display: block; margin-top: 2px; font: 400 11.5px var(--mono); color: var(--dim); }
.hits .no { font: 400 11.5px var(--mono); color: var(--dim); }
.hits { max-height: min(70vh, 520px); overflow-y: auto; }

.who {
  display: flex; align-items: center; gap: 9px;
  color: var(--haze);
  font-size: 14px;
  white-space: nowrap;
}
.who:hover { color: var(--foam); }
.who.on { color: var(--foam); }
.who.on .initial { border-color: var(--brass-dim); background: rgba(217, 164, 65, .12); }
.initial {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--sea);
  border: 1px solid var(--edge);
  font: 500 13px var(--mono);
  color: var(--brass);
}
.enter {
  font-size: 14px;
  color: var(--brass);
  border-bottom: 1px solid rgba(217, 164, 65, .4);
  white-space: nowrap;
}

/* --- кнопки и чипы ------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 22px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: rgba(15, 31, 52, .6);
  color: var(--foam);
  font-size: 14.5px;
  transition: border-color .18s var(--ease), background .18s var(--ease), transform .12s var(--ease);
}
.btn:hover { border-color: var(--dim); background: var(--swell); }
.btn:active { transform: translateY(1px); }

.btn.brass {
  background: var(--brass);
  border-color: var(--brass);
  color: #1a1206;
  font-weight: 500;
}
.btn.brass:hover { background: #e6b455; border-color: #e6b455; }
.btn[disabled], .btn.off { opacity: .4; pointer-events: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: transparent;
  color: var(--haze);
  font-size: 13px;
  white-space: nowrap;
  transition: border-color .16s var(--ease), color .16s var(--ease), background .16s var(--ease);
}
.chip:hover { color: var(--foam); border-color: var(--dim); }
.chip.on {
  color: var(--brass);
  border-color: var(--brass-dim);
  background: rgba(217, 164, 65, .09);
}
.chip.dim { color: var(--dim); border-color: rgba(29, 50, 82, .7); pointer-events: none; }
/* Не сбой, но и не то, что заказывали: выбранной озвучки на этой серии нет. */
.chip.warn {
  color: var(--rust);
  border-color: rgba(207, 115, 97, .4);
  background: rgba(207, 115, 97, .08);
  pointer-events: none;
}
.chip[disabled] { opacity: .35; pointer-events: none; }

/* --- заголовки разделов -------------------------------------------------- */

.head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 42px 0 16px;
  font-family: var(--display);
  font-size: 12.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--haze);
}
.head .note {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .02em;
  text-transform: none;
  color: var(--dim);
}
.head .all { margin-left: auto; font-family: var(--sans); font-size: 12.5px; letter-spacing: 0; text-transform: none; color: var(--dim); }
.head .all:hover { color: var(--brass); }

/* --- карточка ------------------------------------------------------------ */

.card { display: block; min-width: 0; }

.card .art {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--sea);
  border: 1px solid var(--edge);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.card:hover .art { border-color: var(--dim); transform: translateY(-3px); }
.card .art img { width: 100%; height: 100%; object-fit: cover; }

.card .blank {
  display: grid; place-items: center; height: 100%;
  font: 400 20px var(--mono); color: var(--dim);
}

/* Латунная нить по нижнему краю постера — доля просмотренного, и весь декор. */
.card .thread {
  position: absolute; left: 0; bottom: 0; height: 2.5px; width: var(--at, 0%);
  background: var(--brass);
  box-shadow: 0 0 12px rgba(217, 164, 65, .55);
}

.card .badge,
.card .mark,
.card .airing {
  position: absolute;
  top: 8px;
  padding: 3px 8px;
  border-radius: 5px;
  font: 500 11px var(--mono);
  backdrop-filter: blur(6px);
}
.card .badge { right: 8px; background: rgba(217, 164, 65, .92); color: #1a1206; }
.card .mark  { right: 8px; background: rgba(5, 11, 20, .78); color: var(--haze); }
.card .airing {
  left: 8px;
  background: rgba(5, 11, 20, .78);
  color: var(--foam);
  font-family: var(--sans);
  letter-spacing: .04em;
  font-weight: 400;
}
.card .airing::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--rust);
  vertical-align: 1px;
}

/* Тайтл, которого нет ни у одного источника, гасим — но не прячем: в каталоге
   таких половина библиотеки, и врать про них умолчанием нельзя. */
.card.nowhere .art img { opacity: .38; }
.card.nowhere .cname { color: var(--haze); }
.card .nope {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 5px 8px;
  background: rgba(5, 11, 20, .8);
  font-size: 11px;
  color: var(--dim);
  text-align: center;
  backdrop-filter: blur(4px);
}

.cname {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 9px;
  font-size: 14px;
  line-height: 1.35;
}
.card:hover .cname { color: #fff; }
.cfacts {
  display: block;
  margin-top: 3px;
  font: 400 11.5px/1.5 var(--mono);
  color: var(--dim);
}

/* --- ряды и сетка -------------------------------------------------------- */

.shelf { margin-bottom: 6px; }

.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 158px;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { height: 0; }
.rail > * { scroll-snap-align: start; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: 24px 16px;
}

/* --- витрина: главный блок ----------------------------------------------- */

.pickup {
  display: grid;
  grid-template-columns: 172px 1fr;
  gap: 32px;
  align-items: center;
  margin-top: 10px;
  padding: 30px;
  background: linear-gradient(120deg, rgba(15, 31, 52, .85), rgba(10, 21, 36, .45));
  border: 1px solid var(--edge);
  border-radius: 18px;
  position: relative;
  overflow: hidden;
}
.pickup::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(620px 220px at 10% 0%, rgba(217, 164, 65, .08), transparent 70%);
  pointer-events: none;
}
.pickup > * { position: relative; z-index: 1; }
/* Исключение из строки выше: подложка — единственный ребёнок карточки, который
   лежит под остальными, а не в общем ряду. */
.pickup > .back { position: absolute; inset: 0; z-index: 0; pointer-events: none; }

.pickup .poster {
  aspect-ratio: 2 / 3;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--edge);
  background: var(--sea);
}
.pickup .poster img { width: 100%; height: 100%; object-fit: cover; }

.where {
  font-size: 11.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--brass);
}
.pickup .name {
  margin: 12px 0 6px;
  font-family: var(--display);
  font-size: clamp(23px, 3vw, 38px);
  line-height: 1.14;
  letter-spacing: -.01em;
}
.pickup .eplabel { font: 400 13.5px var(--mono); color: var(--haze); }
.pickup .about { max-width: 62ch; margin: 12px 0 0; color: var(--haze); font-size: 15px; }
.pickup .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

/* Шкала брошенной серии — подпись всего сервиса.
   Метка стоит там, где человек вышел; клик по шкале запускает серию оттуда. */
.scrub {
  position: relative;
  /* Шкала не тянется во всю ширину экрана: на широком мониторе секунда
     остановки уезжала бы к левому краю полутора тысяч пикселей пустоты, и
     прицелиться в неё мышью становилось невозможно. */
  max-width: 720px;
  height: 36px;
  margin: 22px 0 2px;
  cursor: pointer;
  --at: 0%;
}
.scrub .line {
  position: absolute; left: 0; right: 0; top: 17px; height: 3px;
  background: var(--edge); border-radius: 2px;
}
.scrub .done {
  position: absolute; left: 0; top: 17px; height: 3px; width: var(--at);
  background: var(--brass); border-radius: 2px;
  box-shadow: 0 0 14px rgba(217, 164, 65, .5);
  transition: width .8s var(--ease);
}
.scrub .pin {
  position: absolute; top: 12px; left: var(--at);
  width: 13px; height: 13px; margin-left: -6.5px;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 0 4px rgba(217, 164, 65, .18);
  transition: left .8s var(--ease);
}
.scrub .stamp {
  position: absolute; top: -5px; left: var(--at);
  transform: translateX(-50%);
  font: 500 12px var(--mono);
  color: var(--brass);
  transition: left .8s var(--ease);
  pointer-events: none;
  white-space: nowrap;
}
.scrub .ghost {
  position: absolute; top: 27px;
  transform: translateX(-50%);
  font: 400 11.5px var(--mono);
  color: var(--haze);
  opacity: 0;
  pointer-events: none;
}
.scrub:hover .ghost { opacity: 1; }

/* --- новости ------------------------------------------------------------- */
/* Личная лента: вышла серия у того, что смотришь; вышел или объявлен новый
   сезон у того, что просмотрено. Строка появляется, только когда есть что
   сказать, — «ты досмотрел всё» новостью не является. */

.news { display: flex; flex-direction: column; gap: 2px; }
.news .row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 0 16px;
  align-items: center;
  padding: 13px 4px;
  border-bottom: 1px solid rgba(29, 50, 82, .55);
}
.news .row:hover { background: rgba(16, 32, 54, .5); }
.news .pic {
  width: 52px; height: 74px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--sea);
}
.news .what { min-width: 0; }
.news .what b { display: block; font-size: 15px; font-weight: 500; color: var(--foam); }
.news .what .sub { font-size: 13px; color: var(--haze); }
.news .what .sub .brass { color: var(--brass); }
.news .when {
  font: 400 12.5px var(--mono);
  color: var(--dim);
  white-space: nowrap;
  text-align: right;
}
.news .go { justify-self: end; }

/* --- живая подложка ------------------------------------------------------ */

/* Нижний слой — кадры библиотеки, верхний — сама серия с той секунды, где
   зритель вышел. Оба лежат друг на друге и меняются наплывом, поэтому
   позиционируются одинаково; оба притушены до дымки — фон не спорит с текстом. */
.backdrop {
  position: absolute;
  inset: 0 0 auto;
  height: 480px;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .35) 58%, transparent 100%);
}
.backdrop .shot,
.backdrop .live {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: saturate(75%);
  /* Уходящий кадр гаснет вдвое дольше, чем разгорается приходящий: при равных
     сроках на середине наплыва оба оказывались полупрозрачными разом, и фон
     на секунду проваливался в пустоту. */
  transition: opacity 2.6s var(--ease);
}
/* Приближение идёт втрое дольше, чем держится кадр: видно только начало хода,
   и движение читается как дыхание, а не как наезд камеры. */
.backdrop .shot.on {
  opacity: .24;
  transition-duration: 1.3s;
  animation: drift 26s var(--ease) infinite alternate;
}
@keyframes drift {
  from { transform: scale(1.04); }
  to   { transform: scale(1.16) translate3d(-2%, -1.5%, 0); }
}

/* Подложка внутри карточки витрины: маска уводит движение вправо, оставляя
   постер и начало заголовка на чистом фоне. */
.backdrop.inset {
  inset: 0;
  height: auto;
  mask-image: linear-gradient(100deg, transparent 6%, rgba(0, 0, 0, .5) 46%, #000 100%);
}
.backdrop.inset .shot.on { opacity: .3; }

/* Поехало видео — фотография уходит совсем.
   Весь этот кусок стоит последним намеренно, и селектор кадра взят с тем же
   весом, что у внутрикарточного (`.backdrop.inset .shot.on` — четыре класса):
   при равной силе решает порядок. Пока правило было короче на класс, оно
   проигрывало карточке витрины, и там серия шла ПОВЕРХ незакрытой фотографии —
   полупрозрачная, сквозь неё второе изображение. На странице тайтла, где
   `.inset` нет, всё это время было правильно. */
.backdrop.alive .shot.on,
.backdrop.alive .shot { opacity: 0; animation: none; transition-duration: 2.6s; }
/* Приходящий слой разгорается вдвое быстрее, чем гаснет уходящий: при равных
   сроках оба на секунду полупрозрачны разом, и фон проваливается в дымку. */
.backdrop.alive .live { opacity: .26; transition-duration: 1.1s; }
.backdrop.inset.alive .live { opacity: .32; }

/* Шов петли: видео моргает, и на эти полсекунды из-под него выходит
   фотография — перемотка происходит в темноте и не выглядит подвисшей. */
.backdrop.alive.turn .live { opacity: .05; transition-duration: .4s; }
.backdrop.alive.turn .shot.on { opacity: .2; transition-duration: .4s; }

@media (prefers-reduced-motion: reduce) {
  .backdrop .shot.on { animation: none; }
  .backdrop .shot, .backdrop .live { transition: none; }
}

/* --- страница тайтла ----------------------------------------------------- */

.title-head {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 236px 1fr;
  gap: 36px;
  margin-top: 6px;
}
.title-head .poster {
  aspect-ratio: 2 / 3;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--sea);
  border: 1px solid var(--edge);
  box-shadow: 0 22px 50px rgba(0, 0, 0, .55);
}
.title-head .poster img { width: 100%; height: 100%; object-fit: cover; }

.title-head h1 {
  font-family: var(--display);
  font-size: clamp(25px, 3.2vw, 42px);
  line-height: 1.1;
  letter-spacing: -.015em;
}
.romaji { margin-top: 8px; font: 400 14px var(--mono); color: var(--dim); }

.facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  font: 400 13px var(--mono);
  color: var(--haze);
}
.facts .dot { color: var(--edge); }
.facts .rate { color: var(--foam); }
.facts .rate::before { content: '★'; margin-right: 4px; color: var(--dim); }

.genres { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.genres a, .genres span {
  padding: 4px 11px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--haze);
}
.genres a:hover { color: var(--foam); border-color: var(--dim); }

.about {
  max-width: 78ch;
  margin: 18px 0 0;
  color: var(--haze);
  font-size: 14.5px;
  line-height: 1.65;
}
.about.clipped {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.more {
  margin-top: 8px;
  background: none;
  border: 0;
  padding: 0;
  color: var(--brass);
  font-size: 13.5px;
  border-bottom: 1px solid rgba(217, 164, 65, .35);
}

.title-head .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; align-items: center; }

/* Нигде нельзя посмотреть — говорим прямо, а не прячем кнопку. */
.nosource {
  padding: 13px 18px;
  border: 1px solid rgba(207, 115, 97, .32);
  border-radius: var(--r-sm);
  background: rgba(207, 115, 97, .06);
  font-size: 14px;
}
.nosource .why { display: block; margin-top: 3px; color: var(--haze); font-size: 13px; }

/* --- след зрителя -------------------------------------------------------- */

.trace {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  align-items: flex-end;
  margin-top: 34px;
  padding: 20px 24px;
  background: rgba(10, 21, 36, .7);
  border: 1px solid var(--edge);
  border-radius: var(--r);
}
.trace .group { display: flex; flex-direction: column; gap: 9px; }
.trace .group > span,
.filters .group > span,
.panel .group > span {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--dim);
}
.row-chips { display: flex; flex-wrap: wrap; gap: 7px; }

.score { display: flex; gap: 3px; }
.score button {
  width: 30px; height: 30px;
  border: 1px solid var(--edge);
  border-radius: 6px;
  background: transparent;
  font: 500 12.5px var(--mono);
  color: var(--dim);
  transition: all .13s var(--ease);
}
.score button:hover { border-color: var(--brass-dim); color: var(--brass); }
.score button.filled { background: rgba(217, 164, 65, .16); border-color: var(--brass-dim); color: var(--brass); }

.fav {
  height: 32px; padding: 0 15px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: transparent;
  color: var(--haze);
  font-size: 13px;
}
.fav:hover { border-color: var(--dim); color: var(--foam); }
.fav.on { color: var(--brass); border-color: var(--brass-dim); background: rgba(217, 164, 65, .09); }

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

.spine { margin-top: 6px; }

.season {
  display: grid;
  grid-template-columns: 54px 22px 1fr;
  gap: 0 14px;
  padding-bottom: 26px;
}
.season .year {
  padding-top: 3px;
  text-align: right;
  font: 400 13px var(--mono);
  color: var(--dim);
}
.season.current .year { color: var(--brass); }

.season .bone {
  position: relative;
  justify-self: center;
  width: 1px;
  background: var(--edge);
}
.season:last-child .bone { background: linear-gradient(var(--edge), transparent); }
.season .bone::before {
  content: '';
  position: absolute; top: 7px; left: 50%;
  width: 9px; height: 9px; margin-left: -4.5px;
  border-radius: 50%;
  background: var(--abyss);
  border: 1.5px solid var(--edge);
}
.season.seen .bone::before { border-color: var(--brass-dim); background: var(--brass-dim); }
.season.current .bone::before {
  border-color: var(--brass);
  background: var(--brass);
  box-shadow: 0 0 0 4px rgba(217, 164, 65, .18);
}

.season .body { min-width: 0; }
.season h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  font-size: 16.5px;
  line-height: 1.3;
}
.season.current h3 > a { color: #fff; }
.season h3 > a:hover { color: var(--brass); }
.season .meta { font: 400 12px var(--mono); color: var(--dim); }
.season .tally {
  margin-left: auto;
  max-width: 100%;
  font: 500 12px var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tally.all, .tally.some { color: var(--brass); }
.tally.none, .tally.no { color: var(--dim); }

.season .none { margin: 8px 0 0; font-size: 13.5px; color: var(--dim); }

/* --- сетка серий --------------------------------------------------------- */

.eps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 6px;
  margin-top: 12px;
}
.eps a {
  display: grid;
  place-items: center;
  height: 38px;
  border: 1px solid var(--edge);
  border-radius: 7px;
  font: 400 13px var(--mono);
  color: var(--haze);
  transition: all .13s var(--ease);
}
.eps a:hover { border-color: var(--dim); color: var(--foam); background: var(--sea); }
.eps a.part { border-color: var(--brass-dim); color: var(--brass); }
.eps a.seen { background: rgba(217, 164, 65, .13); border-color: rgba(217, 164, 65, .3); color: var(--brass); }
.eps a.here { background: var(--brass); border-color: var(--brass); color: #1a1206; font-weight: 500; }

/* Выбранной озвучки на этой серии нет. Не запрет — включится соседняя, — но
   знать об этом лучше заранее, чем упереться в середине сериала. Точка снизу,
   а не заливка: заливка спорила бы со следом зрителя. */
.eps a.nodub { color: var(--dim); }
.eps a.nodub::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--dim);
}
.eps a { position: relative; }
.eps a.nodub.here::after { background: rgba(26, 18, 6, .55); }

/* Сотни. У длинных сериалов сетка режется на страницы, и открыта та, где стоит
   зритель: раздел, в котором он находится, — тоже его след, поэтому чип
   латунный по общему правилу, а не по исключению из него. */
.epsbox { margin-top: 12px; }
/* Атрибут hidden — это всего лишь `display: none` из стилей браузера, и любое
   своё правило с display его перебивает: сетка помечена скрытой, а показаны
   разом все двенадцать сотен. Убрать нужно именно здесь, а не в разметке. */
.eps[hidden] { display: none; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; }
.pager .chip { height: 28px; padding: 0 11px; font: 400 12px var(--mono); }
.epsbox .eps { margin-top: 10px; }

/* --- каталог ------------------------------------------------------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 20px;
  align-items: flex-end;
  padding: 20px 22px;
  background: rgba(10, 21, 36, .6);
  border: 1px solid var(--edge);
  border-radius: var(--r);
}
.filters .group { display: flex; flex-direction: column; gap: 7px; }
.filters select {
  height: 34px;
  padding: 0 10px;
  background: var(--deep);
  border: 1px solid var(--edge);
  border-radius: var(--r-sm);
  font-size: 13.5px;
}
.filters select:focus { outline: none; border-color: var(--brass-dim); }

.genrebox {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  /* Ровно две строки чипов: обрезка посередине третьей читается как поломка. */
  max-height: 70px;
  overflow: hidden;
}
.genrebox.open { max-height: none; }
.filters .more { align-self: flex-start; }

.counted { margin: 22px 0 16px; font-size: 13.5px; color: var(--haze); }
.counted .num { color: var(--foam); font-weight: 500; }

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 34px;
}
.pager .num { color: var(--haze); font-size: 13px; }

/* --- списки и профиль ---------------------------------------------------- */

.tally-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 1px;
  margin-top: 22px;
  background: var(--edge);
  border: 1px solid var(--edge);
  border-radius: var(--r);
  overflow: hidden;
}
.tally-strip div { padding: 18px 20px; background: var(--deep); }
.tally-strip b {
  display: block;
  font: 500 26px var(--mono);
  color: var(--brass);
}
.tally-strip span { display: block; margin-top: 3px; font-size: 12.5px; color: var(--haze); }

.panel {
  margin-top: 26px;
  padding: 22px 24px;
  background: rgba(10, 21, 36, .6);
  border: 1px solid var(--edge);
  border-radius: var(--r);
}
.panel h2 {
  font-family: var(--display);
  font-size: 12.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--haze);
  margin-bottom: 16px;
}
.panel .hint { margin-top: 12px; font-size: 12.5px; color: var(--dim); }

/* Переключатели настроек. Родная галочка здесь не годится: она отвечает «да»
   или «нет», а настройка плеера — это «делай сам» или «спрашивай меня», и
   тумблер показывает своё состояние, не заставляя перечитывать подпись. */
.switches { display: flex; flex-direction: column; }
.switch {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 15px;
  align-items: start;
  padding: 15px 2px;
  cursor: pointer;
  border-top: 1px solid rgba(29, 50, 82, .55);
}
.switch:first-child { border-top: 0; padding-top: 2px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  position: relative;
  width: 40px; height: 23px;
  margin-top: 2px;
  border-radius: 999px;
  background: var(--sea);
  border: 1px solid var(--edge);
  transition: background .18s var(--ease), border-color .18s var(--ease);
}
.switch .knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--dim);
  transition: transform .18s var(--ease), background .18s var(--ease);
}
.switch input:checked + .track { background: rgba(217, 164, 65, .18); border-color: var(--brass-dim); }
.switch input:checked + .track .knob { transform: translateX(17px); background: var(--brass); }
.switch input:focus-visible + .track { outline: 2px solid var(--brass-dim); outline-offset: 2px; }
.switch:hover .track { border-color: var(--dim); }
.switch .say { display: block; }
.switch .t { display: block; font-size: 14.5px; }
.switch .d { display: block; margin-top: 2px; font-size: 12.5px; color: var(--dim); line-height: 1.5; }

/* Строка «поле + кнопка»: на телефоне кнопка уходит под поле, а не сжимает его
   до трёх букв. */
.pair { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.pair .field { flex: 1 1 240px; margin-bottom: 0; }
.pair .btn { flex: 0 0 auto; }

/* Полоска коротких фактов: имя и одна строка под ним. Именно .brief, а не
   .facts — под тем именем на странице тайтла живёт совсем другой ряд, и общее
   у них ровно одно слово. */
.brief {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: stretch;
  gap: 1px;
  background: var(--edge);
  border: 1px solid var(--edge);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.brief div { padding: 13px 15px; background: var(--deep); }
.brief b { display: block; font: 500 14px var(--sans); }
.brief span { display: block; margin-top: 2px; font-size: 12px; color: var(--dim); }

.lead-sm { margin: -6px 0 14px; font-size: 13.5px; color: var(--haze); }
.brasstext { color: var(--brass); font-weight: 500; }

/* Кнопка, которая ведёт себя как ссылка внутри абзаца. */
.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brass);
  font: inherit;
  border-bottom: 1px solid rgba(217, 164, 65, .35);
}
.link:hover { border-bottom-color: var(--brass); }

.btn.quiet { color: var(--haze); }
.btn.quiet:hover { color: var(--rust); border-color: var(--rust); background: rgba(207, 115, 97, .08); }

/* Выход стоит за чертой: это не ещё одна настройка в ряду. */
.leave {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid rgba(29, 50, 82, .55);
}
.leave .hint { font-size: 12.5px; color: var(--dim); }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field > span { font-size: 12.5px; color: var(--haze); }
.field input {
  height: 42px;
  padding: 0 14px;
  background: var(--deep);
  border: 1px solid var(--edge);
  border-radius: var(--r-sm);
  font-size: 15px;
}
.field input:focus { outline: none; border-color: var(--brass-dim); }

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

/* Шапка страницы: заголовок и одна строка о том, что здесь лежит. Без неё
   страница начинается сеткой карточек и выглядит как результат поиска. */
.lede { margin-bottom: 4px; }
.lede h1 {
  font-family: var(--display);
  font-size: clamp(23px, 3.4vw, 31px);
  font-weight: 300;
  letter-spacing: -.01em;
}
.lede p { margin: 9px 0 0; max-width: 62ch; color: var(--haze); font-size: 14.5px; }
.lede em { font-style: normal; color: var(--foam); }

/* Просеивание списка: поиск слева, порядок справа. На ста двадцати тайтлах
   искать глазами дороже, чем набрать три буквы. */
.sift {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin: 16px 0 22px;
}
.sift-find { flex: 1 1 220px; max-width: 340px; }
.sift-find input {
  width: 100%;
  height: 38px;
  padding: 0 14px;
  background: var(--deep);
  border: 1px solid var(--edge);
  border-radius: 999px;
  font-size: 14px;
}
.sift-find input:focus { outline: none; border-color: var(--brass-dim); }
.sift-find input::placeholder { color: var(--dim); }
.sift-find input::-webkit-search-cancel-button { filter: grayscale(1) opacity(.55); }
.sift-order { display: flex; gap: 7px; flex-wrap: wrap; }
.sift-order .chip { height: 30px; padding: 0 12px; font-size: 12.5px; }

@media (max-width: 560px) {
  .sift-find { max-width: none; }
  .sift-order { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .sift-order::-webkit-scrollbar { display: none; }
}

.rows { display: flex; flex-direction: column; }
.row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px 2px;
  border-bottom: 1px solid rgba(29, 50, 82, .5);
}
.row:hover { background: rgba(15, 31, 52, .4); }
.row img { width: 44px; height: 62px; object-fit: cover; border-radius: 5px; }
.row .t { font-size: 14.5px; }
.row .s { font: 400 12px var(--mono); color: var(--dim); }
.row .n { font: 500 14px var(--mono); color: var(--brass); }

/* --- вход ---------------------------------------------------------------- */

.gate { max-width: 400px; margin: 0 auto; padding-top: 64px; }
.gate .tabs { display: flex; gap: 8px; margin-bottom: 30px; }
.gate .tabs button {
  flex: 1;
  height: 38px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: transparent;
  color: var(--haze);
  font-size: 14px;
}
.gate .tabs button.on { color: var(--brass); border-color: var(--brass-dim); background: rgba(217, 164, 65, .09); }
.gate .lead { font-family: var(--display); font-size: 27px; line-height: 1.2; }
.gate .sub { margin: 10px 0 26px; color: var(--haze); font-size: 14.5px; }
.gate .btn { width: 100%; justify-content: center; }
.err { min-height: 20px; margin: 0 0 12px; color: var(--rust); font-size: 13.5px; }

/* --- пусто, сбой, ожидание ----------------------------------------------- */

.empty {
  padding: 44px 26px;
  border: 1px dashed var(--edge);
  border-radius: var(--r);
  text-align: center;
  color: var(--haze);
  font-size: 14px;
}
.empty strong {
  display: block;
  margin-bottom: 7px;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 400;
  color: var(--foam);
}
.empty a { color: var(--brass); border-bottom: 1px solid rgba(217, 164, 65, .35); }

.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(100deg, var(--deep) 30%, var(--sea) 50%, var(--deep) 70%);
  background-size: 220% 100%;
  animation: sweep 1.3s linear infinite;
}
.skeleton.card-ph { aspect-ratio: 2 / 3; }
@keyframes sweep { to { background-position: -220% 0; } }

.toast {
  position: fixed;
  left: 50%; bottom: 26px;
  transform: translate(-50%, 20px);
  padding: 11px 20px;
  background: var(--sea);
  border: 1px solid var(--edge);
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
  z-index: 90;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: rgba(207, 115, 97, .5); color: var(--rust); }

/* --- плеер --------------------------------------------------------------- */

.stage { background: #000; border-bottom: 1px solid var(--edge); }
.stage .wrap {
  position: relative;
  max-width: min(1400px, calc(76vh * 16 / 9));
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background: #000;
}
.stage video { width: 100%; height: 100%; display: block; background: #000; }

.stage .veil {
  position: absolute; inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background: rgba(5, 11, 20, .9);
  color: var(--haze);
  font-size: 14px;
  text-align: center;
  padding: 20px;
}
.spin {
  width: 30px; height: 30px;
  border: 2px solid var(--edge);
  border-top-color: var(--brass);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.stage .hint {
  position: absolute;
  right: 18px; bottom: 74px;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: rgba(5, 11, 20, .9);
  border: 1px solid var(--edge);
  border-radius: var(--r-sm);
  font-size: 13.5px;
  backdrop-filter: blur(8px);
}
.stage .hint button {
  height: 28px; padding: 0 12px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: transparent;
  color: var(--haze);
  font-size: 12.5px;
}
.stage .hint button:hover { color: var(--foam); border-color: var(--dim); }
.stage .hint button.solid { background: var(--brass); border-color: var(--brass); color: #1a1206; }

.bench {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 12px var(--pad);
}
.bench .mid { flex: 1; min-width: 0; text-align: center; }
.epname { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bench .chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.step {
  height: 36px; padding: 0 15px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: transparent;
  color: var(--haze);
  font-size: 13.5px;
  white-space: nowrap;
}
.step:hover:not([disabled]) { color: var(--foam); border-color: var(--dim); }
.step[disabled] { opacity: .3; pointer-events: none; }

/* --- панель управления (shell.js) ---------------------------------------- */

/* Кадру отдан весь экран, страничной обвязки вокруг него нет: шапка и панель
   плавают поверх видео и уезжают вместе. Сетка серий осталась ниже — до неё
   доезжают прокруткой, когда нужен прыжок далеко. */
.stage { background: #000; border-bottom: 0; }
.stage .wrap {
  width: 100%;
  max-width: none;
  height: 100dvh;
  margin: 0;
  aspect-ratio: auto;
}
.stage video { object-fit: contain; }

.shell { position: relative; overflow: hidden; }
.shell.is-away { cursor: none; }
.shell.is-away .shell-bar,
.shell.is-away .brow { opacity: 0; pointer-events: none; }
.shell.is-away .shell-row { opacity: 0; }

/* --- шапка поверх кадра --- */

.brow {
  position: absolute; left: 0; right: 0; top: 0;
  z-index: 3;
  display: flex; align-items: flex-start; gap: 14px;
  padding: 18px var(--pad) 44px;
  background: linear-gradient(to bottom, rgba(5, 11, 20, .82), transparent);
  transition: opacity .2s var(--ease);
}
.brow-mid { flex: 1; min-width: 0; }
.brow h1 {
  font-family: var(--display);
  font-size: clamp(17px, 2.2vw, 25px);
  line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brow-sub {
  margin-top: 4px;
  font: 400 12.5px var(--mono);
  color: var(--haze);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brow .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.brow .chip { height: 26px; padding: 0 11px; font-size: 12px; background: rgba(5, 11, 20, .5); }

.shut, .brow .keys {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  flex: none;
  border: 0; border-radius: 50%;
  background: rgba(5, 11, 20, .5);
  color: var(--haze);
  backdrop-filter: blur(6px);
}
.shut svg { width: 18px; height: 18px; }
.shut:hover, .brow .keys:hover { color: var(--foam); background: rgba(22, 41, 74, .8); }

/* --- центр кадра: перемотка и пуск --- */

.shell-row {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: clamp(26px, 7vw, 66px);
  opacity: 0;
  transition: opacity .18s var(--ease);
  /* Ряд остаётся сквозным ВСЕГДА: он растянут на весь кадр, и стоит дать ему
     pointer-events, как он перехватывает каждый тычок по видео — пауза по
     клику перестаёт работать. Ловят клики только сами кнопки. */
  pointer-events: none;
}
.shell.is-paused .shell-row,
.shell:hover .shell-row { opacity: 1; }
.shell-row .shell-big { pointer-events: auto; }
.shell.is-away .shell-row .shell-big { pointer-events: none; }

.shell-big {
  display: grid; place-items: center;
  width: 46px; height: 46px;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--foam);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .7));
  transition: transform .15s var(--ease), color .15s var(--ease);
}
.shell-big svg { width: 26px; height: 26px; }
.shell-big--play {
  width: 74px; height: 74px;
  background: rgba(5, 11, 20, .5);
  backdrop-filter: blur(8px);
}
.shell-big--play svg { width: 34px; height: 34px; }
.shell-big:hover { transform: scale(1.1); }
.shell-big--play:hover { background: var(--brass); color: #1a1206; }

/* --- нижняя панель --- */

.shell-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "line line line" "left mid right";
  align-items: center;
  gap: 4px 12px;
  padding: 40px var(--pad) 16px;
  background: linear-gradient(to top, rgba(5, 11, 20, .92) 40%, transparent);
  transition: opacity .2s var(--ease);
}
.shell-line { grid-area: line; }
.shell-side--left { grid-area: left; }
.shell-strip { grid-area: mid; }
.shell-side--right { grid-area: right; }

.shell-side { display: flex; align-items: center; gap: 4px; min-width: 0; }
.shell-side--right { justify-content: flex-end; }

.shell-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  flex: none;
  border: 0; border-radius: var(--r-sm);
  background: transparent;
  color: var(--foam);
  opacity: .8;
}
.shell-btn svg { width: 19px; height: 19px; }
.shell-btn:hover { opacity: 1; background: rgba(232, 238, 246, .1); }

/* Озвучка и скорость подписаны словом, а не значком: первое — единственное,
   что зритель здесь выбирает, второе должно читаться на просвет. */
.shell-pill {
  height: 30px;
  max-width: 190px;
  padding: 0 12px;
  flex: none;
  border: 1px solid rgba(232, 238, 246, .18);
  border-radius: 999px;
  background: rgba(5, 11, 20, .45);
  color: var(--foam);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.shell-pill:hover { border-color: var(--dim); background: var(--swell); }
.shell-pill.is-on { color: var(--brass); border-color: var(--brass-dim); }
.shell-pill--dub { font-weight: 500; }
.shell-pill--dub::after { content: ' ⌄'; color: var(--haze); }
.shell-pill.is-lonely { opacity: .55; }

/* --- полоса --- */

.shell-line { position: relative; height: 18px; }
.shell-track {
  position: absolute; left: 0; right: 0; top: 50%;
  transform: translateY(-50%);
  height: 4px;
  border-radius: 2px;
  background: rgba(232, 238, 246, .22);
  overflow: hidden;
  transition: height .12s var(--ease);
}
.shell-line:hover .shell-track { height: 7px; }
.shell-buffered, .shell-filled {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0;
  border-radius: 2px;
}
.shell-buffered { background: rgba(232, 238, 246, .2); }
.shell-filled { background: var(--brass); }

/* Метки заставки и эндинга. Не латунью: латунь — это след зрителя, а тайминги
   пришли от источника и к зрителю отношения не имеют. */
.shell-tags { position: absolute; inset: 0; pointer-events: none; }
.shell-tag { position: absolute; top: 0; bottom: 0; background: rgba(232, 238, 246, .5); }

.shell-seek {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  margin: 0;
  background: none;
  appearance: none;
  cursor: pointer;
}
.shell-seek::-webkit-slider-thumb {
  appearance: none;
  width: 14px; height: 14px;
  border: 0; border-radius: 50%;
  background: var(--foam);
  opacity: 0;
  transition: opacity .12s var(--ease);
}
.shell-seek::-moz-range-thumb {
  width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--foam); opacity: 0;
}
.shell-line:hover .shell-seek::-webkit-slider-thumb,
.shell-seek:focus-visible::-webkit-slider-thumb { opacity: 1; }
.shell-line:hover .shell-seek::-moz-range-thumb { opacity: 1; }

.shell-time {
  flex: none;
  font: 400 12px var(--mono);
  color: var(--haze);
  font-variant-numeric: tabular-nums;
}

/* Ползунок громкости разворачивается по наведению: в покое он лишний. */
.shell-vol { display: flex; align-items: center; flex: none; }
.shell-volslider {
  width: 0; height: 4px;
  margin: 0;
  appearance: none;
  border-radius: 2px;
  background: rgba(232, 238, 246, .25);
  opacity: 0;
  transition: width .16s var(--ease), opacity .16s var(--ease), margin .16s var(--ease);
  cursor: pointer;
}
.shell-vol:hover .shell-volslider,
.shell-volslider:focus-visible { width: 70px; opacity: 1; margin: 0 8px 0 2px; }
.shell-volslider::-webkit-slider-thumb {
  appearance: none;
  width: 11px; height: 11px;
  border: 0; border-radius: 50%;
  background: var(--foam);
}
.shell-volslider::-moz-range-thumb {
  width: 11px; height: 11px; border: 0; border-radius: 50%; background: var(--foam);
}

/* --- лента серий --- */

.shell-strip { display: flex; align-items: center; gap: 2px; }
.shell-eps { display: flex; align-items: center; gap: 2px; }
.shell-arr {
  display: grid; place-items: center;
  width: 28px; height: 30px;
  border: 0; border-radius: var(--r-sm);
  background: transparent;
  color: var(--haze);
}
.shell-arr svg { width: 16px; height: 16px; }
.shell-arr:hover:not([disabled]) { color: var(--foam); background: rgba(232, 238, 246, .1); }
.shell-arr[disabled] { opacity: .25; pointer-events: none; }

.shell-ep {
  position: relative;
  height: 30px;
  padding: 0 11px;
  border: 0; border-radius: 999px;
  background: transparent;
  color: var(--haze);
  font: 400 12.5px var(--mono);
  white-space: nowrap;
}
.shell-ep:hover { color: var(--foam); background: rgba(232, 238, 246, .1); }
.shell-ep.is-done, .shell-ep.is-part { color: var(--brass); }
.shell-ep.is-now { background: var(--brass); color: #1a1206; font-weight: 500; }
/* Точка снизу — «выбранной озвучки на этой серии нет». Заливкой нельзя:
   заливка здесь занята следом зрителя. */
.shell-ep.is-nodub::after {
  content: '';
  position: absolute;
  left: 50%; bottom: 3px;
  width: 3px; height: 3px;
  margin-left: -1.5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .7;
}

/* --- меню --- */

.shell-menu {
  position: absolute;
  display: none;
  min-width: 200px;
  max-height: min(58vh, 420px);
  overflow-y: auto;
  padding: 6px;
  background: rgba(10, 21, 36, .97);
  border: 1px solid var(--edge);
  border-radius: var(--r-sm);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .6);
  z-index: 6;
}
.shell-menu.open { display: block; }
.shell-head {
  padding: 8px 10px 5px;
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--dim);
}
.shell-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0; border-radius: 6px;
  background: transparent;
  color: var(--haze);
  font-size: 13.5px;
  text-align: left;
}
.shell-item:hover:not([disabled]) { background: var(--swell); color: var(--foam); }
.shell-item.is-on { color: var(--brass); }
.shell-item.is-off { opacity: .45; }
.shell-item[disabled] { cursor: default; }
.shell-check { display: grid; place-items: center; width: 14px; flex: none; }
.shell-check svg { width: 14px; height: 14px; }
.shell-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell-note { flex: none; font: 400 11px var(--mono); color: var(--dim); }
.shell-empty { padding: 12px 14px; font-size: 13px; color: var(--dim); }

/* Холст доводки лежит ровно поверх вписанного кадра. Само видео прячем
   visibility, а не display: оно продолжает играть и звучать, просто не видно.
   Прячем только после первого удачного кадра — иначе отказ по CORS оставил бы
   зрителя перед чёрным прямоугольником. */
.shell-sharp {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
}
.shell.is-sharp video { visibility: hidden; }

/* Подсказки не должны налезать на панель. */
.stage .hint { bottom: 96px; z-index: 4; }
.stage .veil { z-index: 2; }

/* Пока панель своя, встроенные подсказки браузера только мешают. */
.stage video::-webkit-media-controls { display: none !important; }

/* На узком экране лента серий уступает место: там есть сетка ниже и свайп. */
@media (max-width: 860px) {
  .shell-bar { grid-template-columns: auto 1fr; grid-template-areas: "line line" "left right"; }
  .shell-strip { display: none; }
  .shell-time { font-size: 11px; }
  .shell-pill { max-width: 120px; }
}

.top .note {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: var(--haze);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.keys { background: none; border: 0; color: var(--dim); padding: 4px; }
.keys kbd {
  display: grid; place-items: center;
  width: 24px; height: 24px;
  border: 1px solid var(--edge);
  border-radius: 5px;
  font: 500 12px var(--mono);
}

.jump { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--haze); }
.jump input {
  width: 84px; height: 32px;
  padding: 0 10px;
  background: var(--deep);
  border: 1px solid var(--edge);
  border-radius: var(--r-sm);
  font: 400 13px var(--mono);
}

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

.sheet {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background: rgba(5, 11, 20, .8);
  backdrop-filter: blur(6px);
  z-index: 100;
}
.sheet .card-box {
  width: min(420px, 92vw);
  padding: 26px;
  background: var(--deep);
  border: 1px solid var(--edge);
  border-radius: var(--r);
}
.sheet h2 {
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--haze);
  margin-bottom: 18px;
}
.sheet dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 18px;
  margin: 0 0 22px;
  font-size: 13.5px;
}
.sheet dt { display: flex; gap: 5px; }
.sheet dd { margin: 0; color: var(--haze); }
.sheet kbd {
  display: inline-grid; place-items: center;
  min-width: 24px; height: 22px;
  padding: 0 6px;
  border: 1px solid var(--edge);
  border-radius: 5px;
  font: 500 11.5px var(--mono);
}

/* --- узкий экран --------------------------------------------------------- */

@media (max-width: 900px) {
  .title-head { grid-template-columns: 152px 1fr; gap: 22px; }
  .pickup { grid-template-columns: 116px 1fr; gap: 22px; padding: 22px; }
  .season { grid-template-columns: 42px 18px 1fr; gap: 0 10px; }
  .trace { gap: 20px; padding: 16px 18px; }
}

@media (max-width: 700px) {
  body { font-size: 15px; }
  .top { gap: 14px; height: 56px; }
  .top .mark { font-size: 13px; letter-spacing: .16em; }
  .nav { display: none; }
  .find { flex: 1 1 auto; }
  .whoname { display: none; }
  .backdrop { height: 320px; }
  .title-head { grid-template-columns: 1fr; }
  .title-head .poster { width: 148px; }
  .pickup { grid-template-columns: 1fr; }
  .pickup .poster { width: 112px; }
  /* На телефоне карточка складывается в столбец, и текст ложится ровно туда,
     куда маска пускает движение. Гасим подложку до дымки: читаемость важнее.
     `:not(.alive)` здесь не украшение: под работающим видео фотографии быть
     не должно вовсе, а по весу это правило перебило бы то, что её прячет. */
  .backdrop.inset:not(.alive) .shot.on { opacity: .16; }
  .backdrop.inset.alive .live { opacity: .18; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 18px 12px; }
  .rail { grid-auto-columns: 126px; }
  .eps { grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); }
  .bench .lbl { display: none; }
  .filters { padding: 16px; }
  /* Счётчик просмотренного прижат вправо только там, где справа есть место.
     На телефоне он вылезал за экран и тянул горизонтальную прокрутку. */
  .season .tally { margin-left: 0; }
}

/* Нижняя панель на телефоне: пункты меню из шапки не исчезают, а переезжают
   туда, куда дотягивается большой палец. */
.dock {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 45;
  background: rgba(5, 11, 20, .93);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--edge);
  padding: 4px 0 max(4px, env(safe-area-inset-bottom));
}
.dock a {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 7px 0;
  font-size: 11px;
  color: var(--dim);
}
.dock a.on { color: var(--brass); }

@media (max-width: 700px) {
  .dock { display: flex; }
  main { padding-bottom: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
