/* Перенос стилей боевого миниаппа + скелетоны и хелперы для motion-переходов. */
:root { color-scheme: dark; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body, #root { height: 100%; }
html, body { overflow: hidden; }
body {
  margin: 0; background: #000; color: #fff;
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
}

/* ---- full-screen poster backdrop ---- */
#bg { position: fixed; inset: 0; z-index: 0; background: #000; }
/* Фоновый постер живёт в кроссфейд-слое .pbg (резкий постер + его размытая
   копия под контролами). Прозрачностью слоя плавно управляет motion при смене
   источника — раньше менялся src одного <img>, отчего картинка «прыгала». */
.pbg { position: absolute; inset: 0; }
.pbg .poster {
  width: 100%; height: 100%; object-fit: cover; display: block;
  animation: drift 36s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.07); } }

/* Размытая копия постера — постоянный фоновый блюр под контролами.
   Раньше это был backdrop-filter на .sheet::before, но Chromium отключает
   backdrop-filter, если на том же элементе есть mask-image (в WebKit/Telegram
   работало, отсюда «в хроме только градиент»). Обычный filter: blur() с маской
   ведёт себя одинаково везде. */
.pbg .posterblur {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
  filter: blur(24px);
  transform: scale(1.12);   /* прячем прозрачные края, которые даёт blur */
  mask-image: linear-gradient(180deg, transparent 38%, #000 60%);
  -webkit-mask-image: linear-gradient(180deg, transparent 38%, #000 60%);
  animation: drift-blur 36s ease-in-out infinite alternate;
}
@keyframes drift-blur { from { transform: scale(1.12); } to { transform: scale(1.2); } }
/* сплошное затемнение снизу доверху: у нижнего края чистый чёрный под контролами,
   к верху ослабевает, но постер остаётся приглушённым по всей высоте */
#bg .shade {
  position: absolute; inset: 0;
  background: linear-gradient(0deg,
    rgba(0,0,0,1) 0%, rgba(0,0,0,.97) 16%, rgba(0,0,0,.88) 32%,
    rgba(0,0,0,.72) 50%, rgba(0,0,0,.56) 70%, rgba(0,0,0,.45) 100%);
}

/* ---- foreground ---- */
#app {
  position: fixed; inset: 0; z-index: 1;
  display: flex; flex-direction: column; justify-content: flex-end;
  max-height: 100%; overflow: hidden;
}
.sheet {
  position: relative;
  padding: 26px 0 calc(env(safe-area-inset-bottom, 0px) + 18px);
}
/* блюр под контролами живёт в #bg (#posterblur) — постоянный слой, не мигает
   при сменах экрана и работает в Chrome, в отличие от backdrop-filter + mask */

.kicker {
  padding: 0 18px; font-size: 11px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; color: rgba(255,255,255,.55);
}
h1 {
  margin: 0 0 7px; padding: 0 18px;
  font-size: 31px; font-weight: 700; letter-spacing: -.022em; line-height: 1.12;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,.8));
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* разделитель секций — та же линия, что у .label, но без подписи */
.hr { height: 1px; margin: 15px 18px; background: rgba(255,255,255,.22); }

.label {
  display: flex; align-items: center; gap: 12px;
  margin-top: 10px; padding: 0 18px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: rgba(255,255,255,.48);
}
.label::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.22); }

/* horizontal carousels */
.row {
  display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden;
  padding: 10px 18px 6px; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
  /* снэп по левому краю: элемент встаёт ровно туда же, где стоит первый чип
     в состоянии покоя — та же линия, что и у остального контента */
  scroll-padding-left: 18px;
}
.row::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; scroll-snap-align: start;
  padding: 8px 16px; border-radius: 13px;
  background: rgba(255,255,255,.11); border: none;
  color: rgba(255,255,255,.88); font-size: 14px; font-weight: 500;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  cursor: pointer; white-space: nowrap; transition: transform .12s ease;
}
.chip:active { transform: scale(.95); }
.chip.active { background: #fff; color: #000; font-weight: 650; }
.chip.num { min-width: 44px; text-align: center; padding: 8px 12px; }
.chip.ghost {
  background: transparent; border: 1.5px dashed rgba(255,255,255,.3);
  color: rgba(255,255,255,.55); padding: 6.5px 10.5px; pointer-events: none;
}
.chip.ghost small {
  font-size: 11px; font-weight: 500; margin-left: 5px; color: rgba(255,255,255,.45);
}
.chip.mk-part { box-shadow: inset 0 0 0 1.5px #ffcf4d; }
.chip.mk-done { box-shadow: inset 0 0 0 1.5px #58d16a; }

.kicker .dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: #58d16a; margin-right: 7px; vertical-align: 1px;
}
/* единственный яркий элемент — резюм */
.resume {
  display: block; margin: 4px 18px 8px; padding: 15px; width: calc(100% - 36px);
  border: none; border-radius: 14px; cursor: pointer;
  font-size: 15.5px; font-weight: 700; letter-spacing: .01em; color: #1c1200;
  background: linear-gradient(135deg, #ffd978 0%, #ffb84d 55%, #ff9d3c 100%);
  box-shadow: 0 8px 28px rgba(255,166,60,.38), inset 0 1px 0 rgba(255,255,255,.5);
}
.resume:active { transform: scale(.98); }

.subbtn {
  display: block; margin: 10px 18px 8px; padding: 15px; width: calc(100% - 36px);
  border: none; border-radius: 14px; cursor: pointer;
  font-size: 15.5px; font-weight: 700; letter-spacing: .01em; color: #fff;
  background: linear-gradient(135deg, #7a5cff 0%, #a04dff 55%, #c93cff 100%);
  box-shadow: 0 8px 28px rgba(160,77,255,.38), inset 0 1px 0 rgba(255,255,255,.25);
}
.subbtn:active { transform: scale(.98); }
.subnote {
  margin: 2px 18px 6px; font-size: 12.5px; line-height: 1.45;
  color: rgba(255,255,255,.55); letter-spacing: .02em;
}

.back {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0 18px 10px; padding: 9px 16px;
  font-size: 13.5px; font-weight: 600; color: #fff;
  background: rgba(255,255,255,.13); border: none; border-radius: 12px;
  cursor: pointer; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform .12s ease;
}
.back:active { transform: scale(.96); }

.status {
  position: fixed; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 24px; text-align: center;
  color: rgba(255,255,255,.65); font-size: 14px; letter-spacing: .02em;
}
.err { color: #ff7a7a; }
.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.18); border-top-color: rgba(255,255,255,.85);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* верхняя панель: назад слева, действия справа — все стеклянные кружки в линию */
.topbar {
  position: fixed; z-index: 5; left: 12px; right: 12px;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  display: flex; align-items: center; gap: 10px;
}
.topbar .spacer { flex: 1 1 auto; }
.tbtn {
  flex: 0 0 auto;
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.4); border: none;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform .12s ease;
}
.tbtn:active { transform: scale(.88); }
.tbtn svg { width: 21px; height: 21px; fill: none; stroke: #fff; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
/* `hidden` — display:none в UA-таблице, но .tbtn задаёт display явно: возвращаем */
.tbtn[hidden] { display: none; }
.fav.on { background: rgba(255,77,109,.22); }

/* дропдаун «части франшизы» — пилюля в хедере (в отличие от круглых .tbtn) */
.collbtn {
  flex: 0 1 auto; min-width: 0; max-width: 48vw;
  height: 40px; border-radius: 20px; cursor: pointer; padding: 0 12px;
  display: flex; align-items: center; gap: 7px;
  background: rgba(0,0,0,.4); border: none; color: #fff;
  font: inherit; font-size: 13px; font-weight: 600; letter-spacing: -.01em;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform .12s ease;
}
.collbtn:active { transform: scale(.94); }
.collbtn .collname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.collbtn svg { flex: 0 0 auto; fill: none; stroke: #fff; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.collbtn svg.ic { width: 18px; height: 18px; }
.collbtn svg.chev { width: 15px; height: 15px; stroke: rgba(255,255,255,.65); }
.fav.on svg { fill: #ff4d6d; stroke: #ff4d6d; }
.bell.on { background: rgba(255,199,0,.22); }
.bell.on svg { fill: #ffc700; stroke: #ffc700; }

/* ---- native player overlay ---- */
#player { position: fixed; inset: 0; background: #000; display: none; z-index: 10; }
/* Видео вписано в safe-area, а не inset:0. Нативный слайдер перемотки iOS рисуется
   по НИЖНЕЙ кромке <video>; если она на самом краю экрана — совпадает с зоной
   системного жеста home-indicator (свайп «домой»/переключение приложений), и
   перемотать невозможно. Поднимаем кромку на высоту нижнего safe-area (+ запас),
   контролы уходят в досягаемую зону. object-fit:contain — видео в своём
   соотношении, без растяжения. Кнопка «на весь экран» остаётся нативной и
   разворачивает по-настоящему. */
#player video {
  display: block;
  width: 100%;
  /* <video> — replaced-элемент: при position:absolute с auto-размерами берёт свой
     интринсик-размер, а не тянется по insets. Поэтому явная высота + margin-top, а
     не absolute+inset. */
  margin-top: env(safe-area-inset-top, 0px);
  height: calc(100% - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 12px);
  object-fit: contain;
  background: #000;
}
#autonext {
  position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 84px);
  transform: translateX(-50%); z-index: 11;
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: rgba(0,0,0,.65); border-radius: 13px;
  font-size: 14px; font-weight: 600; white-space: nowrap;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
#autonext[hidden] { display: none; }
#autonext .spinner { width: 18px; height: 18px; }
#player .close {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px; z-index: 11;
  background: rgba(0,0,0,.55); color: #fff; border: none; border-radius: 50%;
  width: 40px; height: 40px; font-size: 22px; line-height: 40px; cursor: pointer;
}

/* ---- home view: экран без вертикального скролла, одна галерея у нижнего края ---- */
/* высота — из --app-h (см. lib/viewport.ts), а не inset: 0: раскладка не должна
   пересчитываться, когда клавиатура ужимает вьюпорт */
/* Вертикальный стек: у поиска своя высота, у вкладок своя, галерее достаётся
   ВЕСЬ остаток — размеры не угадываются, их считает раскладка. */
.home {
  position: absolute; left: 0; right: 0; top: 0;
  height: var(--app-h, 100dvh);
  z-index: 2; background: #000;
  overflow: hidden;
  display: flex; flex-direction: column;
  padding-top: calc(env(safe-area-inset-top, 0px) + 14px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
}

/* фон — сильно размытый постер активной карточки: свечение цвета постера.
   Весь слой чисто декоративный: pointer-events: none, чтобы ни курсор не
   менялся, ни одно событие не долетало до ютуб-плеера (его UI без событий
   не возвращается после стартового автоскрытия) */
.hbg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
/* Блюр-свечение рендерим в 1/16 разрешения: слой 25%×25%, blur 16px, и апскейл
   transform-ом до тех же 140% вьюпорта (5.6 = 4×1.4). Blur всё равно стирает
   детали — картинка неотличима, а GPU-растр в ~16 раз дешевле. Фуллскрин
   blur(64px) на DPR-3 телефонах ронял GPU-процесс WebView (чёрный экран). */
.hbg img {
  position: absolute; left: 37.5%; top: 37.5%; width: 25%; height: 25%;
  object-fit: cover; transform: scale(5.6);
  filter: blur(16px) saturate(1.6) brightness(.55);
}
/* фоновый трейлер: окно в верхних 2/3 экрана (галерея внизу — воздух сверху).
   Letterbox-полосы обрезать «наверняка» нельзя (они вшиты в видео, пропорции у
   всех разные, пиксели cross-origin iframe не читаются), поэтому два слоя защиты:
   1) зум-кроп — видимое окно ≤ 74% высоты кадра, полосы даже 2.39:1 (12.8%)
      уезжают за кроп; 2) градиентная маска сверху/снизу растворяет края окна
   в затемнённом фоне. */
/* pointer-events: none — на слое, а не на родителе: на экране фильма трейлер
   живёт внутри #bg, который события пропускать обязан. Без этого до ютуба
   долетали бы тапы, а его UI после автоскрытия возвращается именно от них */
/* z-index — не для красоты: #poster с анимацией drift создаёт свой контекст
   наложения (transform), и без явного слоя порядок держался бы только на
   порядке в DOM. Трейлер обязан быть поверх постера, блюра и затемнения */
.hbg-tr { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.tveil { position: absolute; inset: 0; background: rgba(0,0,0,.72); }
.twin {
  position: absolute; left: 0; right: 0; top: 0; height: 66dvh;
  overflow: hidden;
  mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 76%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 76%, transparent 100%);
}
.twin iframe {
  position: absolute; left: 50%; top: 50%;
  /* маленький вьюпорт → ютуб отдаёт ~480p; до cover растягивает transform из
     TrailerLayer (высота ≥ и cover-минимума, и 1.38×окна против letterbox) */
  width: 854px; height: 480px;
  border: 0; pointer-events: none;
}
.hbg-shade {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 42%,
    rgba(0,0,0,.12) 0%, rgba(0,0,0,.38) 62%, rgba(0,0,0,.62) 100%);
}

/* Поиск + вкладки одной строкой; не влезло — вкладки переносятся (flex-wrap).
   max-width держит строку компактной на десктопе, align-items центрирует вкладки
   по высоте поля. */
.ftop {
  flex: 0 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start;
  gap: 10px 16px;
  width: 100%;
  padding: 0 24px 4px;   /* тот же левый край, что у названия/галереи (24px) */
}

/* летающий поиск: полностью закруглённый, стекло без чёрных подложек.
   flex: 0 1 500px — фиксированной ширины, БЕЗ роста: вкладки садятся сразу
   за ним (обе прижаты влево). Когда базис + вкладки не помещаются — вкладки
   уезжают на строку ниже; на узком экране поиск сам сжимается на всю строку.
   position: relative — якорь для выпадашки результатов (падает ровно под полем). */
.fsearch {
  position: relative; z-index: 6;
  flex: 0 1 500px; max-width: 100%; min-width: 0;
}
.fsearch input {
  width: 100%; padding: 14px 24px; border-radius: 999px;
  color: #fff; font-size: 16px; outline: none;
  -webkit-appearance: none; appearance: none;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  transition: background .2s ease, border-color .2s ease;
}
.fsearch input::placeholder { color: rgba(255,255,255,.55); }
.fsearch input:focus { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.34); }
.fsearch input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* результаты поиска — стеклянная панель под пилюлей, скролл внутри неё */
.fresults {
  position: absolute; z-index: 6; left: 0; right: 0;
  top: calc(100% + 8px);   /* под полем, по его ширине — где бы поле ни стояло */
  /* единственный блок, который клавиатуре подчиняется: меряем по живой видимой
     высоте (--vis-h), чтобы список целиком помещался над клавиатурой */
  max-height: calc(var(--vis-h, 100dvh) - env(safe-area-inset-top, 0px) - 100px);
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  border-radius: 26px; border: 1px solid rgba(255,255,255,.14);
  background: rgba(30,30,34,.55);
  backdrop-filter: blur(30px) saturate(1.4);
  -webkit-backdrop-filter: blur(30px) saturate(1.4);
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
}

.hstatus { padding: 28px 18px; text-align: center; color: rgba(255,255,255,.55); font-size: 14px; }
/* заглушки пустой вкладки/ошибки — по центру отведённого галерее места */
.galbox .hstatus {
  position: absolute; inset: 0; padding: 24px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1.5;
}
.hstatus.err { color: #ff7a7a; }

/* вкладки-слайдер между поиском и галереей */
/* position+z-index обязательны: фон .hbg позиционирован (z-index: 0), а
   потоковый элемент без слоя рисуется ПОД ним — вкладки перекрывались блюром
   и мерцали на его кроссфейде при листании */
.ftabs {
  position: relative; z-index: 3;
  flex: 0 0 auto; display: flex; gap: 8px;
  /* тянем ряд влево на внутренний паддинг кнопки (.ftab 14px): у вкладок нет
     видимого фона, поэтому глаз выравнивает их по ТЕКСТУ — так первая вкладка
     садится ровно в общий левый край (24px), как название/рейтинг/постер */
  margin-left: -14px;
  max-width: 100%;
  overflow-x: auto; scrollbar-width: none;
}
.ftabs::-webkit-scrollbar { display: none; }
/* активная — чистый белый, остальные приглушены; вес одинаковый, иначе ряд
   передёргивало бы по ширине при каждом переключении */
.ftab {
  flex: 0 0 auto; cursor: pointer;
  padding: 9px 14px; border: none; background: none;
  color: rgba(255,255,255,.62); font-size: 14px; font-weight: 600;
  letter-spacing: .01em; white-space: nowrap;
  text-shadow: 0 1px 12px rgba(0,0,0,.5);
  transition: color .2s ease;
}
.ftab.on { color: #fff; }

/* остаток экрана под галерею: подпись прижата к её верхней кромке */
.gwrap {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
}
/* стабильная коробка галереи — её высоту меряет ResizeObserver (--gal-h),
   и уже от неё считается размер карточки */
.galbox { flex: 1 1 auto; min-height: 0; position: relative; }

/* галерея: свободный скролл, JS доводит ближайшую карточку к левому якорю
   после остановки инерции (CSS-снепа нет намеренно). Список конечный. */
.gal {
  position: absolute; left: 0; right: 0; z-index: 1;
  /* горизонтальный скроллер обязан обрезать по вертикали (overflow-y: visible
     у него не бывает), а обрезка идёт по padding-box. Поэтому растягиваем сам
     элемент на 30px за коробку и ровно на столько же даём паддинг: карточки
     остаются на месте, а тени получают запас и больше не срезаются полосой */
  top: -30px; bottom: -30px;
  display: flex; align-items: center; gap: 18px;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 30px 24px;
}
.gal::-webkit-scrollbar { display: none; }
.skgal { overflow-x: hidden; }
.gcard {
  flex: 0 0 auto; position: relative; cursor: pointer;
  /* Вся геометрия — из измеренной высоты галереи (--gal-h, ResizeObserver).
     Вычитаем 64px на тень (по 32 сверху/снизу, карточка отцентрована) и берём
     2/3 от остатка: высота = ширина × 1.5 гарантированно влезает. 84vw —
     потолок для узких экранов, пропорция при этом сохраняется. */
  width: min(calc((var(--gal-h, 60vh) - 64px) * .667), 84vw);
  aspect-ratio: 2 / 3;
  border-radius: 22px; overflow: hidden;
  background: rgba(255,255,255,.06);
  box-shadow: 0 18px 48px rgba(0,0,0,.45);
  /* без затемнения: при свободном скролле все постеры полноценные;
     активную выделяет лёгкий рост от нижней кромки + подпись слева */
  transform: scale(.96); transform-origin: 50% 50%;
  transition: transform .35s cubic-bezier(.22,.9,.28,1), box-shadow .35s ease;
  /* content-visibility: auto здесь БЫЛ и ломал скролл: браузер вправе не считать
     layout карточек за экраном, и их offsetLeft схлопывался — шаг сетки
     измерялся нулём, из-за чего тайтл менялся на каждый пиксель, а снэп липнул
     в никуда. Экономия не стоила этого: список конечный (24), картинки и так
     lazy. Не возвращать без contain-intrinsic-size. */
}
.gcard.on {
  transform: scale(1);
  box-shadow: 0 26px 70px rgba(0,0,0,.6);
}
.gcard img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  -webkit-user-drag: none; user-select: none;
}
.gph {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  padding: 18px; text-align: center; font-size: 16px; font-weight: 700;
  color: rgba(255,255,255,.7);
}
.gbadge {
  position: absolute; left: 12px; top: 12px;
  padding: 7px 13px; border-radius: 999px;
  font-size: 12px; font-weight: 700; color: #fff; letter-spacing: .02em;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22);
}
.gprog {
  position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: rgba(255,255,255,.28);
}
.gprog i { display: block; height: 100%; background: #ffb84d; }

/* подпись активной карточки: тайтл и золотая оценка над галереей.
   (z-index выше .gal — его верхний запас-паддинг перекрывает блок подписи) */
.ginfo {
  position: relative; z-index: 2; flex: 0 0 auto;
  /* высота ФИКСИРОВАНА, а не по содержимому: иначе тайтл в две строки вместо
     одной менял бы остаток места, а с ним и размер карточек — галерея дёргалась
     бы при листании. Тайтл и так обрезан двумя строками (line-clamp), так что
     overflow: hidden тут не нужен — он лишь срезал бы тень текста */
  height: 84px;
  padding: 0 24px; max-width: 680px;
  display: flex; flex-direction: column; justify-content: flex-end;
  text-align: left;
}
.ginfo .gt {
  font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15;
  /* не text-shadow: его срезал бы overflow: hidden, обязательный для
     line-clamp. filter накладывается поверх уже обрезанного элемента */
  filter: drop-shadow(0 2px 12px rgba(0,0,0,.75));
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.fmeta {
  margin-bottom: 5px; font-size: 14px; font-weight: 650; color: #ffcf4d;
  filter: drop-shadow(0 1px 6px rgba(0,0,0,.7));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* короткие вьюпорты (iPhone mini, телеграм-хедер съедает высоту) */
@media (max-height: 760px) {
  .ginfo .gt { font-size: 22px; }
}

.res {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  padding: 13px 18px; border-bottom: 1px solid rgba(255,255,255,.07);
}
.res:active { background: rgba(255,255,255,.05); }
.res .rt { flex: 1; min-width: 0; }
.res .rt b {
  font-size: 15px; font-weight: 600; display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.res .rt small { font-size: 12.5px; color: rgba(255,255,255,.45); }
.res .rating { flex: 0 0 auto; font-size: 13px; font-weight: 700; color: #ffcf4d; }

/* login gate */
.login {
  position: absolute; inset: 0; z-index: 4; background: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 32px; text-align: center;
}
.login .brand { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.login .brand span { color: #ffb84d; }
.login .sub {
  font-size: 15px; color: rgba(255,255,255,.6); line-height: 1.5;
  max-width: 320px; margin-bottom: 18px;
}
.login .widget { min-height: 48px; }
.login .hint { margin-top: 14px; font-size: 12.5px; color: rgba(255,255,255,.35); max-width: 300px; }

/* ---- выбор сезона/серии: два дропдауна в ряд вместо слайдеров ---- */
.selrow { display: flex; gap: 10px; padding: 10px 18px 2px; }
.seltrig {
  flex: 1 1 0; min-width: 0; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  padding: 11px 12px 11px 14px; border-radius: 13px; border: none;
  background: rgba(255,255,255,.11); color: #fff;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform .12s ease, background .2s ease;
}
.seltrig:active { transform: scale(.98); background: rgba(255,255,255,.16); }
.seltrig-l {
  flex: 0 0 auto; font-size: 10.5px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.45);
}
.seltrig-v {
  flex: 1 1 auto; min-width: 0; text-align: right;
  display: inline-flex; align-items: center; justify-content: flex-end; gap: 7px;
  font-size: 14.5px; font-weight: 650;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.seltrig-c {
  flex: 0 0 auto; width: 15px; height: 15px;
  fill: none; stroke: rgba(255,255,255,.5); stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* точка прогресса: жёлтая — начато, зелёная — досмотрено */
.pdot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; display: inline-block; }
.pdot.part { background: #ffcf4d; }
.pdot.done { background: #58d16a; }

/* мини-модалка выбора: затемнение с блюром + панель снизу */
.selback {
  position: fixed; inset: 0; z-index: 8;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.selpanel {
  position: fixed; z-index: 9; left: 12px; right: 12px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  max-height: 64vh; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 18px; border: 1px solid rgba(255,255,255,.1);
  background: rgba(22,22,24,.82);
  backdrop-filter: blur(26px) saturate(1.4);
  -webkit-backdrop-filter: blur(26px) saturate(1.4);
  box-shadow: 0 18px 50px rgba(0,0,0,.6);
}
.selhead {
  flex: 0 0 auto; padding: 15px 18px 11px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: rgba(255,255,255,.45);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sellist { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.selitem {
  width: 100%; cursor: pointer; border: none; background: none; color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; font-size: 15px; font-weight: 500; text-align: left;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.selitem:last-child { border-bottom: none; }
.selitem:active { background: rgba(255,255,255,.07); }
.selitem.active { background: rgba(255,255,255,.13); font-weight: 700; }
.selitem.off { color: rgba(255,255,255,.4); cursor: default; }
.selitem-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selitem-t small {
  margin-left: 8px; font-size: 12.5px; font-weight: 500; color: rgba(255,255,255,.4);
}

/* ---- инлайн-ряд качеств: место зарезервировано заранее, чипы проявляются
   по мере проверки доступности; спиннер — последним элементом ряда ---- */
.qrow { min-height: 51px; }   /* высота ряда с чипами: без прыжков макета */
.chip.qspin {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; background: transparent; pointer-events: none;
}
.chip.qspin .spinner { width: 16px; height: 16px; }

/* ---- нижний ряд запуска: «плей» и лейбл резюма рядом, прижаты влево ---- */
.playrow {
  display: flex; align-items: center; justify-content: flex-start;
  gap: 16px; margin: 14px 18px 0;
}
/* белый кружок с иконкой — единственный акцент запуска, без текста */
.playbtn {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%;
  border: none; cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; color: #000;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
  transition: background .25s ease, transform .12s ease;
}
/* треугольник тяжелее слева, поэтому геометрический центр читается как «вправо» —
   сдвигаем влево (сам path тоже смещён вправо внутри viewBox, это учтено) */
.playbtn svg { width: 17px; height: 17px; fill: currentColor; margin-left: -2px; }
.playbtn:active { transform: scale(.93); }
.playbtn:disabled {
  background: rgba(255,255,255,.14); color: rgba(255,255,255,.35);
  box-shadow: none; cursor: default;
}
.contlabel {
  border: none; background: none; cursor: pointer; text-align: left;
  font-size: 13.5px; font-weight: 500; color: rgba(255,255,255,.55);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 8px 0; min-width: 0;
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: rgba(255,255,255,.35);
}
.contlabel:active { color: rgba(255,255,255,.85); text-decoration-color: rgba(255,255,255,.6); }

/* ---- новое: скелетоны на время загрузки ---- */
.sk { position: relative; overflow: hidden; background: rgba(255,255,255,.07); }
.sk::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.09), transparent);
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
/* скелетоны галереи наследуют размер .gcard; шиммер живёт в базовом .sk */

/* ---- комната совместного просмотра ---- */
/* кнопка «Смотреть вместе»: вторичная рядом с play — контурная, не конкурирует */
.playbtn.together {
  background: rgba(255,255,255,.1); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}
.playbtn.together svg {
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; margin-left: 0;
}
.playbtn.together:disabled { background: rgba(255,255,255,.05); color: rgba(255,255,255,.3); }

#roomlayer {
  position: absolute; z-index: 11;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 12px; right: 64px;                       /* справа живёт кнопка закрытия */
  display: flex; align-items: center; gap: 10px;
}
.rl-avs { display: flex; }
.rl-av {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto;
  background: #3a3f4c; border: 2px solid #000; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 600;
}
.rl-av + .rl-av { margin-left: -9px; }
.rl-av img { width: 100%; height: 100%; object-fit: cover; }
.rl-av.buf { border-color: #ffcf4d; animation: rl-pulse 1.2s ease-in-out infinite; }
@keyframes rl-pulse { 50% { opacity: .4; } }
.rl-chip {
  border: 1px solid rgba(255,255,255,.35); background: rgba(0,0,0,.45);
  color: #fff; border-radius: 16px; padding: 5px 12px; font-size: 12px;
  cursor: pointer; flex: 0 0 auto;
}
.rl-chip:active { transform: scale(.95); }
/* тосты чужих действий — над контролами, мимо клика */
#roomtoasts {
  position: absolute; z-index: 11; left: 0; right: 0; bottom: 88px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  pointer-events: none;
}
.rl-toast {
  background: rgba(18,18,22,.92); color: #d9dce3; font-size: 12px;
  padding: 6px 13px; border-radius: 14px; max-width: 80%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* SelectSheet в оверлее комнаты должен всплыть над плеером (z-index: 10) */
.roomsel .selback { z-index: 12; }
.roomsel .selpanel { z-index: 13; }
.roomgone { font-size: 20px; color: #fff; }
