:root {
  --bg: #0b0d14;
  --bg-2: #121522;
  --surface: #181c2c;
  --line: #262b40;
  --text: #eef0f7;
  --muted: #9aa1b8;
  --accent: #ff9a5c;
  --accent-2: #ff5f6d;
  --glow: linear-gradient(135deg, var(--accent), var(--accent-2));
  --radius: 14px;
  --wrap: 1280px;
  --display: 'Unbounded', 'Segoe UI', system-ui, sans-serif;
  --body: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: clamp(16px, 4vw, 40px); }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.header .wrap { display: flex; align-items: center; gap: 28px; height: 68px; }
.logo { font: 700 22px/1 var(--display); letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 50% 120%, var(--accent) 0 38%, var(--accent-2) 39% 55%, #6b3fa0 56%);
  box-shadow: 0 0 24px -4px var(--accent-2);
}
.nav { display: flex; gap: 22px; color: var(--muted); font-weight: 600; font-size: 15px; }
.nav a:hover, .nav a.active { color: var(--text); }
/* Поиск в шапке: по центру, с выпадающими подсказками */
.search {
  position: relative; flex: 1; max-width: 520px; margin-inline: auto; display: flex; align-items: center; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 14px 0 16px; height: 42px;
  transition: border-color .15s, background .15s;
}
.search:focus-within { border-color: var(--accent); background: var(--surface); }
.search > svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { all: unset; flex: 1; min-width: 0; font-size: 15px; color: var(--text); }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear { background: none; border: 0; color: var(--muted); font-size: 14px; padding: 4px; }
.search-clear:hover { color: var(--text); }
.search-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); margin: 0; padding: 6px; list-style: none; z-index: 50;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px -20px #000;
  max-height: min(70vh, 560px); overflow-y: auto;
}
.search-list a { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 8px; border-radius: 10px; }
.search-list li.active a, .search-list a:hover { background: var(--bg-2); }
.search-list img, .sg-ph { width: 40px; height: 60px; border-radius: 6px; object-fit: cover; display: block; }
.sg-text { display: grid; min-width: 0; }
.sg-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-name mark { background: none; color: var(--accent); }
.sg-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-rate { color: var(--accent); font-weight: 800; font-size: 13px; }
.sg-all button { width: 100%; background: none; border: 0; border-top: 1px solid var(--line); margin-top: 4px; padding: 12px 8px 8px; color: var(--accent); font-weight: 700; text-align: left; }
.sg-empty { padding: 14px 10px; color: var(--muted); font-size: 14px; }
.search-toggle { display: none; background: none; border: 0; padding: 8px; color: var(--text); }
.search-toggle svg { width: 22px; height: 22px; }
.empty-state { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty-state p:first-child { color: var(--text); font-weight: 700; font-size: 18px; }
.burger { display: none; background: none; border: 0; font-size: 22px; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 560px; display: flex; align-items: flex-end; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; }
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 70%, transparent) 45%, transparent 75%),
    linear-gradient(0deg, var(--bg) 0%, transparent 45%);
}
.hero-content { position: relative; padding-block: 120px 64px; width: 100%; }
.hero-content > * { max-width: 620px; }
.eyebrow {
  display: inline-flex; gap: 8px; align-items: center;
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent);
}
.eyebrow::before { content: ''; width: 18px; height: 2px; background: var(--glow); }
.hero h1 { font: 700 clamp(36px, 6vw, 64px)/1.02 var(--display); letter-spacing: -0.03em; margin: 14px 0 12px; }
.hero .tagline { font-size: 19px; color: var(--muted); margin: 0 0 18px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; color: var(--muted); font-size: 14px; font-weight: 600; }
.meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--line); }
.rating { color: var(--text); display: inline-flex; gap: 6px; align-items: center; }
.rating::before { content: '★'; color: var(--accent); }
.hero p.overview { color: #c9cde0; margin: 18px 0 28px; max-width: 540px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  border-radius: 999px; padding: 13px 24px; font-weight: 700; font-size: 15px;
  border: 1px solid var(--line); background: var(--surface); transition: transform .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); background: var(--bg-2); }
.btn.primary { background: var(--glow); border: 0; color: #1a0e0a; box-shadow: 0 10px 30px -10px var(--accent-2); }
.btn.primary:hover { filter: brightness(1.06); }

/* ---------- Art placeholder (вместо постеров TMDB) ---------- */
.art {
  --h: 220;
  position: relative; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(120% 80% at 20% 10%, hsl(calc(var(--h) + 30) 80% 62% / .55), transparent 60%),
    radial-gradient(90% 70% at 85% 90%, hsl(var(--h) 90% 45% / .7), transparent 65%),
    linear-gradient(160deg, hsl(var(--h) 45% 22%), hsl(calc(var(--h) - 40) 50% 9%));
}
.hero > .hero-bg, .title-hero > .hero-bg { position: absolute; inset: 0; }
.art::before {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: .25;
  background: repeating-linear-gradient(115deg, transparent 0 14px, hsl(0 0% 100% / .05) 14px 15px);
}

/* ---------- Sections ---------- */
main { padding-bottom: 40px; }
.section { margin-top: 48px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { font: 700 clamp(20px, 2.4vw, 26px)/1.2 var(--display); letter-spacing: -0.02em; margin: 0; }
.section-head a { color: var(--muted); font-size: 14px; font-weight: 700; }
.section-head a:hover { color: var(--accent); }

.row {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(140px, 16vw, 190px);
  gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 22px 18px; }

.card { scroll-snap-align: start; display: block; }
.card .poster {
  aspect-ratio: 2 / 3; border-radius: var(--radius); display: flex; flex-direction: column; justify-content: flex-end;
  padding: 14px; box-shadow: 0 1px 0 hsl(0 0% 100% / .06) inset, 0 18px 40px -22px #000;
  transition: transform .2s, box-shadow .2s;
}
.card .poster strong { font: 700 17px/1.15 var(--display); letter-spacing: -0.02em; text-shadow: 0 2px 12px #0008; }
.card:hover .poster { transform: translateY(-4px); box-shadow: 0 0 0 2px var(--accent), 0 22px 44px -20px var(--accent-2); }
.badge {
  position: absolute; top: 10px; left: 10px; font-size: 12px; font-weight: 800;
  background: #0b0d14cc; border-radius: 8px; padding: 3px 8px; backdrop-filter: blur(6px);
}
.badge.score { left: auto; right: 10px; color: var(--accent); }
.card .info { padding: 10px 2px 0; }
.card .info .name { font-weight: 700; font-size: 15px; line-height: 1.3; }
.card .info .sub { color: var(--muted); font-size: 13px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  border: 1px solid var(--line); background: var(--bg-2); border-radius: 999px;
  padding: 9px 18px; font-weight: 700; font-size: 14px; color: var(--muted); transition: .15s;
}
.chip:hover, .chip.active { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg-2)); }

.collections { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.collection {
  border-radius: 18px; padding: 24px; min-height: 170px; display: flex; flex-direction: column; justify-content: space-between;
  border: 1px solid hsl(0 0% 100% / .06);
}
.collection h3 { font: 700 20px/1.2 var(--display); margin: 0 0 6px; letter-spacing: -0.02em; }
.collection p { margin: 0; color: #d7dbea; font-size: 14px; }
.collection span { font-size: 13px; font-weight: 700; color: var(--accent); }

/* ---------- Title page ---------- */
.title-hero { position: relative; overflow: hidden; }
.title-hero .hero-bg::after {
  background: linear-gradient(0deg, var(--bg) 2%, color-mix(in srgb, var(--bg) 60%, transparent) 60%, color-mix(in srgb, var(--bg) 30%, transparent));
}
.title-layout { position: relative; display: grid; grid-template-columns: 280px 1fr; gap: 44px; padding-block: 64px 32px; align-items: end; }
.title-layout .poster-big { aspect-ratio: 2/3; border-radius: 18px; box-shadow: 0 30px 60px -25px #000; display: flex; align-items: flex-end; padding: 18px; }
.title-layout .poster-big strong { font: 700 22px/1.1 var(--display); }
.title-layout h1 { font: 700 clamp(32px, 5vw, 54px)/1.05 var(--display); letter-spacing: -0.03em; margin: 10px 0; }
.genres { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.genres span { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: #c9cde0; }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; margin-top: 24px; }
.panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.panel h2 { font: 700 18px/1.2 var(--display); margin: 0 0 16px; letter-spacing: -0.01em; }
.trailer {
  aspect-ratio: 16/9; border-radius: 16px; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line);
}
.play {
  width: 76px; height: 76px; border-radius: 50%; background: var(--glow); display: grid; place-items: center;
  box-shadow: 0 0 0 10px hsl(0 0% 100% / .08), 0 14px 40px -10px var(--accent-2); transition: transform .2s;
}
.trailer:hover .play { transform: scale(1.07); }
.play::before { content: ''; border-left: 22px solid #1a0e0a; border-block: 14px solid transparent; margin-left: 6px; }
.trailer-note { color: var(--muted); font-size: 13px; margin-top: 10px; }

.providers { display: grid; gap: 10px; }
.provider {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center;
  padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid transparent; transition: .15s;
}
.provider:hover { border-color: var(--accent); }
.provider .logo-box { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font: 800 16px var(--display); }
.provider .pname { font-weight: 800; }
.provider .pkind { color: var(--muted); font-size: 13px; }
.provider .go { font-size: 13px; font-weight: 800; color: var(--accent); white-space: nowrap; }
.disclaimer { color: var(--muted); font-size: 12px; margin: 14px 0 0; }

.cast { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 16px; }
.person .face { aspect-ratio: 1; border-radius: 50%; margin-bottom: 8px; display: grid; place-items: center; font: 700 26px var(--display); color: #ffffffcc; }
.person .pn { font-weight: 700; font-size: 14px; }
.person .pr { color: var(--muted); font-size: 13px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: 14px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 72px; padding-block: 36px; color: var(--muted); font-size: 14px; }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.footer .tmdb { max-width: 520px; font-size: 12px; }

/* ---------- Постеры и фоны из каталога ---------- */
.has-img > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.has-img::before { display: none; }
.card .poster { position: relative; }
.card-play {
  position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%;
  background: var(--glow); display: grid; place-items: center; opacity: 0; transform: scale(.8); transition: .2s;
  box-shadow: 0 12px 30px -8px var(--accent-2);
}
.card-play::before { content: ''; border-left: 17px solid #1a0e0a; border-block: 11px solid transparent; margin-left: 5px; }
.card:hover .card-play, .card:focus-visible .card-play { opacity: 1; transform: none; }

/* ---------- Карусель «Сейчас интересно» ---------- */
.promo { --gap: 20px; position: relative; margin-top: 20px; }
.promo-viewport { overflow: hidden; touch-action: pan-y; }
.promo-track { display: grid; justify-content: center; }
.slide {
  grid-area: 1 / 1; position: relative; width: min(1240px, 82vw); aspect-ratio: 16 / 7; border-radius: 24px; overflow: hidden;
  background: var(--bg-2); isolation: isolate; opacity: .4; cursor: pointer; user-select: none;
  transition: transform .6s cubic-bezier(.22,.7,.2,1), opacity .5s; will-change: transform;
}
.slide.active { opacity: 1; cursor: default; }
.slide-bg { position: absolute; inset: 0; z-index: -2; }
.slide-bg img { width: 100%; height: 100%; object-fit: cover; }
.slide-bg img.blur { filter: blur(30px) saturate(1.4) brightness(.7); transform: scale(1.25); }
.slide-bg img.slide-m { display: none; }
.slide::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, #0b0d14f2 0%, #0b0d14b0 38%, transparent 70%), linear-gradient(0deg, #0b0d14b0 0%, transparent 40%);
}
.slide-poster {
  position: absolute; right: 7%; top: 50%; height: 84%; aspect-ratio: 2 / 3; object-fit: cover; transform: translateY(-50%) rotate(2deg);
  border-radius: 16px; box-shadow: 0 30px 60px -20px #000c; z-index: -1;
}
.slide:not(.no-backdrop) .slide-poster { display: none; }
.slide-body { position: absolute; left: 0; bottom: 0; padding: clamp(24px, 4vw, 52px); max-width: min(600px, 62%); }
.slide-badge {
  display: inline-block; background: var(--glow); color: #1a0e0a; font-weight: 800; font-size: 12px;
  letter-spacing: .04em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px;
}
.slide h2 { font: 700 clamp(26px, 3.6vw, 48px)/1.05 var(--display); letter-spacing: -0.03em; margin: 14px 0 10px; text-wrap: balance; }
.slide .meta { color: #d4d8e6; }
.slide-text { color: #c9cde0; margin: 12px 0 22px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.btn.ghost { background: #ffffff1a; border-color: #ffffff26; backdrop-filter: blur(8px); }
.promo-arrow {
  position: absolute; top: calc(50% - 26px); width: 52px; height: 52px; border-radius: 50%; border: 1px solid #ffffff26;
  background: #0b0d14a6; backdrop-filter: blur(8px); font-size: 30px; line-height: 1; display: grid; place-items: center; padding-bottom: 4px;
  transition: background .15s, transform .15s;
}
.promo-arrow:hover { background: #0b0d14e6; transform: scale(1.06); }
.promo-arrow.prev { left: calc(9vw - 26px); }
.promo-arrow.next { right: calc(9vw - 26px); }
.promo-dots { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.promo-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: var(--line); transition: width .3s, background .3s; }
.promo-dots button[aria-current="true"] { width: 26px; background: var(--accent); }

/* ---------- Горизонтальные ряды со стрелками ---------- */
.scroller { position: relative; }
.scroll-btn {
  position: absolute; top: calc(50% - 40px); z-index: 2; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: #0b0d14e0; backdrop-filter: blur(6px); font-size: 26px; line-height: 1;
  display: grid; place-items: center; padding-bottom: 3px; transition: opacity .2s;
}
.scroll-btn.prev { left: -14px; }
.scroll-btn.next { right: -14px; }
.scroller.at-start .scroll-btn.prev, .scroller.at-end .scroll-btn.next { opacity: 0; pointer-events: none; }
@media (hover: none) { .scroll-btn { display: none; } }
.row, .genre-row-wrap { scrollbar-width: none; }
.row::-webkit-scrollbar, .genre-row-wrap::-webkit-scrollbar { display: none; }

/* ---------- Жанры ---------- */
.genre-row-wrap { overflow-x: auto; scroll-snap-type: x proximity; }
.genre-row { display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: 14px; padding-bottom: 4px; }
.genre-tile {
  scroll-snap-align: start; display: grid; justify-items: center; align-content: center; gap: 12px; height: 112px;
  border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); color: #c9cde0; font-weight: 700; font-size: 14px;
  transition: border-color .15s, background .15s, color .15s, transform .15s;
}
.genre-tile svg { width: 32px; height: 32px; }
.genre-tile:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); }
.genre-tile.active { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--bg-2)); }
.page-title { font: 700 clamp(24px, 3vw, 34px)/1.15 var(--display); letter-spacing: -0.02em; margin: 0; }

/* ---------- Шапка страницы фильма: описание и трейлер ---------- */
.title-desc {
  color: #d2d6e4; max-width: 680px; margin: 16px 0 0; font-size: 16px; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.title-desc.open { display: block; }
.more-link { background: none; border: 0; padding: 6px 0 0; color: var(--accent); font-weight: 700; font-size: 14px; }
.more-link:hover { text-decoration: underline; }
.title-info .actions { margin-top: 22px; }
.genres a { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: #c9cde0; transition: border-color .15s, color .15s; }
.genres a:hover { border-color: var(--accent); color: var(--text); }
.hero-bg img.hero-blur { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(40px) brightness(.55) saturate(1.3); transform: scale(1.2); z-index: -1; }
.title-hero { scroll-margin-top: 68px; }
.title-hero.trailer-on { min-height: calc(min(960px, 100vw - 48px) * 0.5625 + 100px); }
.title-hero.trailer-on .title-layout { visibility: hidden; }
.hero-trailer {
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 64px 24px 32px;
  background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px);
}
.hero-trailer[hidden] { display: none; }
.hero-trailer-box {
  position: relative; width: min(960px, 100%); aspect-ratio: 16 / 9; background: #000;
  border-radius: 16px; overflow: hidden; box-shadow: 0 40px 90px -30px #000;
}
.hero-trailer-box ins, .hero-trailer-box iframe { position: absolute; inset: 0; width: 100% !important; height: 100% !important; border: 0; }
.hero-trailer-close {
  position: absolute; top: 16px; right: clamp(16px, 4vw, 40px); border-radius: 999px; padding: 9px 16px;
  font-weight: 700; font-size: 14px; background: #ffffff1a; border: 1px solid #ffffff2e; backdrop-filter: blur(8px);
}
.hero-trailer-close:hover { background: #ffffff2e; }

/* ---------- Плеер ---------- */
.watch { margin-top: 8px; scroll-margin-top: 84px; }
#trailer, #about { scroll-margin-top: 84px; }
.player-box {
  position: relative; border-radius: 18px; overflow: hidden; background: #000; border: 1px solid var(--line);
  aspect-ratio: 16 / 9; box-shadow: 0 30px 70px -40px #000;
}
.player-box ins { display: block; position: absolute; inset: 0; }
.player-box iframe { position: absolute; inset: 0; width: 100% !important; height: 100% !important; border: 0; }

/* Заставка, пока грузятся данные */
.loading { min-height: 70vh; display: grid; place-items: center; }
.loading::before {
  content: ''; width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading::before { animation-duration: 2.4s; } }
.player-empty { margin: 0; padding: 80px 20px; text-align: center; color: var(--muted); }
.lead { font: 600 18px/1.4 var(--body); color: var(--text); margin: 0 0 10px; }
.description { color: #c9cde0; margin: 0; max-width: 760px; font-size: 16.5px; }
.btn.block { width: 100%; justify-content: center; margin-top: 20px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.btn[disabled] { opacity: .6; cursor: wait; }

/* ---------- Telegram сбоку от плеера ---------- */
.watch.with-side { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; align-items: start; }
.tg-side {
  display: grid; gap: 10px; justify-items: start; padding: 22px; border-radius: 18px;
  background: linear-gradient(160deg, color-mix(in srgb, #2aabee 16%, var(--bg-2)), var(--bg-2) 70%);
  border: 1px solid color-mix(in srgb, #2aabee 30%, var(--line));
}
.tg-side-icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: #2aabee; color: #fff; }
.tg-side-icon svg { width: 24px; height: 24px; margin-left: -2px; }
.tg-side h2 { font: 700 18px/1.2 var(--display); margin: 4px 0 0; }
.tg-side p { margin: 0; color: #c9cde0; font-size: 14px; line-height: 1.5; }
.tg-btn { background: #2aabee; border: 0; color: #fff; margin-top: 6px; width: 100%; justify-content: center; }
.tg-btn:hover { background: #229ed9; }
.tg-btn svg { width: 18px; height: 18px; }
@media (max-width: 1000px) {
  .watch.with-side { grid-template-columns: 1fr; }
  .tg-side { grid-template-columns: auto 1fr; align-items: center; justify-items: stretch; column-gap: 14px; }
  .tg-side h2 { margin: 0; }
  .tg-side p, .tg-side .tg-btn { grid-column: 1 / -1; }
}

/* ---------- Плашка Telegram ---------- */
.tg-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60; width: min(720px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line); backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px -20px #000; font-size: 14px; animation: tg-in .4s ease-out;
}
.tg-bar > svg { width: 22px; height: 22px; color: #2aabee; flex: none; }
.tg-bar > span { flex: 1; color: #d2d6e4; line-height: 1.35; }
.tg-close { background: none; border: 0; color: var(--muted); font-size: 15px; padding: 8px; }
.tg-close:hover { color: var(--text); }
@keyframes tg-in { from { opacity: 0; transform: translate(-50%, 16px); } }
@media (prefers-reduced-motion: reduce) { .tg-bar { animation: none; } }
.btn.small { padding: 8px 14px; font-size: 13px; }
.footer-grid { display: grid !important; grid-template-columns: 1.1fr 1.4fr 1fr; gap: 32px; }
.footer-col p { margin: 10px 0 0; }
.footer-col h3 { font: 700 15px/1.2 var(--display); color: var(--text); margin: 4px 0 0; }
.footer-small { font-size: 13px; line-height: 1.55; }
.footer-mail { color: var(--accent); font-weight: 700; white-space: nowrap; }
body:has(.tg-bar) .footer { padding-bottom: 110px; } /* плашка Telegram не закрывает подвал */
@media (max-width: 420px) { .footer-mail { white-space: normal; overflow-wrap: anywhere; } }
.footer-mail:hover { text-decoration: underline; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; gap: 22px; } }
.header-tg {
  display: inline-flex; align-items: center; gap: 7px; flex: none; padding: 7px 12px; border-radius: 999px;
  color: #2aabee; font-weight: 700; font-size: 14px; border: 1px solid color-mix(in srgb, #2aabee 40%, transparent);
  background: color-mix(in srgb, #2aabee 10%, transparent); transition: background .15s;
}
.header-tg:hover { background: color-mix(in srgb, #2aabee 20%, transparent); }
.header-tg svg { width: 17px; height: 17px; }
@media (max-width: 1100px) { .header-tg span { display: none; } .header-tg { padding: 8px; } }
.footer-tg { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; color: #2aabee; font-weight: 700; }
.footer-tg svg { width: 18px; height: 18px; }
@media (max-width: 600px) {
  .tg-bar { flex-wrap: wrap; bottom: 10px; gap: 8px 10px; }
  .tg-bar > span { flex: 1 1 calc(100% - 70px); }
  .tg-bar .btn { flex: 1; justify-content: center; }
}

/* ---------- Админка ---------- */
.admin-body { min-height: 100vh; }
.admin-top { border-bottom: 1px solid var(--line); background: var(--bg-2); position: sticky; top: 0; z-index: 10; }
.admin-top .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.admin-tabs { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.admin-tabs a { padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 700; font-size: 14px; white-space: nowrap; }
.admin-tabs a:hover { color: var(--text); }
.admin-tabs a.active { background: var(--surface); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.admin-inline { margin: 0; }
.admin-login { min-height: 100vh; display: grid; place-content: center; gap: 24px; padding: 24px; justify-items: center; }
.admin-login form { width: min(380px, calc(100vw - 32px)); }
.admin-login h1 { font: 700 22px/1.2 var(--display); margin: 0 0 6px; }
.admin-form .check { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; cursor: pointer; }
.admin-form .check input { width: 18px; height: 18px; accent-color: var(--accent); padding: 0; }
.admin-note-ok { margin: 0; padding: 12px 16px; border-radius: 12px; background: #1d3a2a; color: #9ff0bf; font-weight: 700; }
.owner-link.inline { display: inline; padding: 2px 6px; }
main.wrap.admin { max-width: 1180px; }
.serp { background: #fff; color: #202124; border-radius: 12px; padding: 16px 18px; font-family: Arial, sans-serif; max-width: 640px; }
.serp-url { font-size: 13px; color: #4d5156; }
.serp-title { font-size: 19px; color: #1a0dab; margin: 4px 0; line-height: 1.3; }
.serp-desc { font-size: 14px; color: #4d5156; line-height: 1.5; }
/* Текст для поисковиков, пока страница не дорисована (обычно доли секунды) */
.seo-static { padding-block: 24px; color: var(--muted); font-size: 14px; }
.seo-static h1 { font: 700 26px/1.2 var(--display); color: var(--text); margin: 0 0 10px; }
.seo-static h2 { font-size: 16px; color: var(--text); }
.seo-static ul { columns: 3 220px; padding-left: 18px; }
.seo-static a { color: #c9cde0; }
.catalog-pagination { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.seo-pagination { display: flex; gap: 16px; flex-wrap: wrap; margin: 18px 0; }
.crumbs { font-size: 13px; margin-bottom: 8px; }
.loading.loading:has(.seo-static)::before { position: fixed; top: 50%; left: 50%; margin: -22px 0 0 -22px; }
.loading:has(.seo-static) { display: block; min-height: 70vh; }
.loading .seo-static { visibility: visible; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.h1-sub { display: block; font: 600 15px/1.3 var(--body); color: var(--muted); letter-spacing: 0; margin-top: 6px; }
.design-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(460px, 100%), 1fr)); gap: 20px; }
.design-card { display: grid; gap: 12px; align-content: start; }
.design-card h2 { margin: 0; }
.design-card .admin-note { margin: 0; }
.design-card.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.design-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stats-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.stats-main { display: grid; gap: 20px; }
.stats-side { display: grid; gap: 16px; position: sticky; top: 84px; }
.stats-menu { display: grid; gap: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 8px; }
.stats-menu a { padding: 11px 14px; border-radius: 10px; color: var(--muted); font-weight: 700; font-size: 14.5px; }
.stats-menu a:hover { color: var(--text); background: var(--surface); }
.stats-menu a.active { color: var(--text); background: var(--surface); box-shadow: inset 3px 0 0 var(--accent); }
.side-card { padding: 16px; }
.side-card h2 { font-size: 15px; margin-bottom: 6px; }
.side-card .owner-link { font-size: 11.5px; }
.side-card.danger h2 { color: #ff8a8a; }
.admin-note.hint { margin: -6px 0 16px; line-height: 1.5; }
.kpis small { color: var(--muted); font-size: 12px; }
.stats td.bar { width: 40%; }
.stats tr.zero td { color: var(--muted); opacity: .6; }
.tag { font-size: 11px; font-weight: 800; color: var(--accent); margin-left: 6px; }
@media (max-width: 900px) {
  .stats-layout { grid-template-columns: 1fr; }
  /* на телефоне: меню разделов сверху, карточки «не считать» и «сбросить» — под статистикой */
  .stats-side { display: contents; }
  .stats-menu { order: -1; display: flex; overflow-x: auto; scrollbar-width: none; }
  .stats-menu a { white-space: nowrap; }
  .stats-menu a.active { box-shadow: inset 0 -2px 0 var(--accent); }
  .side-card { order: 1; }
  .stats td.bar { display: none; }
}
@media (max-width: 600px) {
  .admin-top .wrap { gap: 10px; }
  .admin-top .logo .text { display: none; }
  .admin-tabs a { padding: 8px 10px; }
}
.admin { max-width: 640px; padding-block: 40px; display: grid; gap: 20px; }
.admin h1 { font: 700 32px/1.1 var(--display); margin: 10px 0 0; }
.admin-form { display: grid; gap: 10px; margin-top: 14px; }
.admin-form label { font-weight: 700; font-size: 14px; color: var(--muted); }
.admin-form input, .admin-form select {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px;
  color: var(--text); font: inherit;
}
.admin-form input:focus, .admin-form select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.links-table td:first-child { white-space: normal; }
.links-table .link-actions { display: flex; gap: 6px; justify-content: flex-end; }
.links-table .owner-link { margin: 6px 0 2px; user-select: all; }
@media (max-width: 700px) { .links-table th:nth-child(4), .links-table td:nth-child(4), .links-table th:nth-child(5), .links-table td:nth-child(5) { display: none; } }
.admin-form .btn { justify-self: start; }
.admin-status { margin: 0; font-weight: 700; color: var(--muted); }
.admin-status.ok { color: #5fd38d; }
.admin-msg { margin: 10px 0 0; color: var(--accent); font-weight: 700; }
.admin-note { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.admin { max-width: 860px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpis div { background: var(--surface); border-radius: 12px; padding: 14px; display: grid; gap: 2px; }
.kpis b { font: 700 26px/1.1 var(--display); }
.kpis span { color: var(--muted); font-size: 13px; }
.stats { width: 100%; border-collapse: collapse; font-size: 14px; }
.stats th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.stats td { padding: 7px 8px; border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
.stats td:not(:first-child), .stats th:not(:first-child) { text-align: right; white-space: nowrap; }
.stats progress { width: 100%; min-width: 80px; height: 8px; accent-color: var(--accent); }
.owner-link { margin: 12px 0 0; padding: 12px; background: var(--surface); border-radius: 10px; font: 600 13px/1.4 ui-monospace, monospace; word-break: break-all; user-select: all; }
.owner-note { background: #1d3a2a; color: #9ff0bf; text-align: center; padding: 10px 16px; font-weight: 700; font-size: 14px; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .nav { overflow-x: auto; gap: 18px; scrollbar-width: none; }
  .header .wrap { gap: 18px; }
  .two-col { grid-template-columns: 1fr; }
  .title-layout { grid-template-columns: 170px 1fr; gap: 28px; padding-block: 32px 24px; }
  .hero { min-height: 520px; }
}
@media (max-width: 900px) {
  .hero-bg::after { background: linear-gradient(0deg, var(--bg) 8%, color-mix(in srgb, var(--bg) 75%, transparent) 50%, color-mix(in srgb, var(--bg) 25%, transparent)); }
  .hero-bg.has-img > img { object-position: 70% top; }
}
/* Телефон и узкий планшет: поиск прячется за иконку, по нажатию — строка во всю ширину под шапкой */
@media (max-width: 900px) {
  .header .wrap { position: relative; }
  .search-toggle { display: block; margin-left: auto; }
  .search { position: absolute; left: clamp(16px, 4vw, 40px); right: clamp(16px, 4vw, 40px); top: calc(100% + 8px); max-width: none; display: none; }
  body.search-open .search { display: flex; }
  body.search-open .header { padding-bottom: 58px; }
}
@media (max-width: 600px) {
  .header .wrap { gap: 12px; height: 60px; }
  .nav { gap: 14px; font-size: 14px; }
  .logo-mark { width: 26px; height: 26px; }
  .watch, #trailer, #about { scroll-margin-top: 70px; }
  /* Страница фильма: маленький постер рядом с названием, плеер сразу виден */
  .title-layout { grid-template-columns: 96px 1fr; gap: 16px; padding-block: 20px 18px; align-items: start; }
  .title-layout .poster-big { width: 96px; border-radius: 12px; padding: 8px; }
  .title-layout .poster-big strong { font-size: 12px; }
  .title-layout h1 { font-size: 24px; margin: 6px 0; }
  .title-layout .eyebrow { font-size: 11px; }
  .title-layout .genres { margin-top: 10px; }
  .title-layout .genres span, .title-layout .genres a { font-size: 12px; padding: 3px 10px; }
  .title-desc { font-size: 14.5px; -webkit-line-clamp: 3; margin-top: 12px; }
  .title-layout .title-info { display: contents; }
  .title-layout .title-info > :not(.eyebrow, h1, .meta) { grid-column: 1 / -1; }
  .title-layout .eyebrow, .title-layout h1, .title-layout .meta { grid-column: 2; }
  .title-layout { row-gap: 4px; }
  .title-layout .poster-big { grid-row: 1 / span 3; align-self: start; }
  .title-layout .eyebrow { align-self: end; }
  .hero-trailer { padding: 56px 12px 16px; }
  .hero-trailer-close { top: 10px; right: 12px; }
  .title-hero { scroll-margin-top: 60px; }
  .title-hero.trailer-on { min-height: calc((100vw - 24px) * 0.5625 + 80px); }
  .title-layout .actions { grid-column: 1 / -1; margin-top: 4px !important; }
  .title-layout .actions { gap: 8px; }
  .title-layout .actions .btn { flex: 1; justify-content: center; padding: 11px 10px; font-size: 14px; white-space: nowrap; gap: 6px; }
  .player-box { border-radius: 12px; }
  .btn { padding: 12px 20px; }
  .actions .btn { flex: 1; justify-content: center; }
}
/* Карусель на планшете и телефоне: вертикальная карточка с постером */
@media (max-width: 900px) {
  .slide { width: 86vw; aspect-ratio: 4 / 3; }
  .promo-arrow { display: none; }
  .slide-body { max-width: 100%; }
  .slide-text { -webkit-line-clamp: 2; }
  .slide-poster { height: 56%; top: 34%; right: 6%; }
  .slide::after { background: linear-gradient(0deg, #0b0d14f2 5%, #0b0d14b3 40%, transparent 75%); }
}
@media (min-width: 1100px) and (max-width: 1400px) {
  .slide-text { -webkit-line-clamp: 2; }
}
@media (max-width: 600px) {
  .promo { --gap: 10px; margin-top: 12px; }
  .slide { width: 88vw; aspect-ratio: 3 / 4; border-radius: 18px; opacity: .5; }
  .slide-bg img { display: none; }
  .slide-bg img.slide-m { display: block; object-position: center top; }
  .slide-poster { display: none; }
  .slide::after { background: linear-gradient(0deg, #0b0d14 2%, #0b0d14d9 35%, #0b0d1433 65%, transparent); }
  .slide-body { padding: 20px; }
  .slide h2 { font-size: 26px; margin: 10px 0 8px; }
  .slide-text { -webkit-line-clamp: 2; font-size: 14px; margin: 8px 0 16px; }
  .slide .meta { font-size: 13px; }
  .genre-row { grid-auto-columns: 128px; gap: 10px; }
  .genre-tile { height: 96px; font-size: 13px; gap: 10px; }
  .genre-tile svg { width: 28px; height: 28px; }
}
@media (max-width: 520px) {
  .logo span.text { display: none; }
  .hero { min-height: 480px; }
  .hero-content { padding-block: 80px 32px; }
  .hero h1 { font-size: 32px; }
  .hero .tagline { font-size: 16px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 18px 12px; }
  .row { grid-auto-columns: 132px; gap: 12px; }
  .card .poster strong { font-size: 14px; }
  .section { margin-top: 36px; }
  .two-col { gap: 0; }
}

/* ---------- Карточка в обёртке: крестик «убрать из списка», подпись «Обновлено …» ---------- */
.card-wrap { position: relative; min-width: 0; scroll-snap-align: start; }
.card-remove {
  position: absolute; top: 40px; right: 10px; z-index: 2; width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: #0b0d14d9; color: var(--text); font-size: 13px; opacity: 0; transition: opacity .15s;
}
.card-wrap:hover .card-remove, .card-remove:focus-visible { opacity: 1; }
@media (hover: none) { .card-remove { opacity: .85; } }
.card .info .sub.note { color: var(--accent); font-weight: 700; }

/* ---------- Подборки: плитки ---------- */
.coll-row { display: grid; grid-auto-flow: column; grid-auto-columns: 270px; gap: 14px; padding-bottom: 4px; }
.coll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.coll-tile {
  scroll-snap-align: start; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; height: 128px; padding: 14px 16px;
  border-radius: 16px; border: 1px solid var(--line); position: relative; overflow: hidden;
  background: linear-gradient(140deg, hsl(var(--h) 55% 30%), hsl(calc(var(--h) + 40) 45% 13%));
  transition: transform .15s, border-color .15s;
}
.coll-tile span, .coll-tile small { position: relative; z-index: 3; }
/* Текст занимает место слева от веера (~120px), постеры его не перекрывают */
.coll-tile span { font: 700 15px/1.2 var(--display); letter-spacing: -0.01em; max-width: calc(100% - 120px); text-shadow: 0 2px 10px #000a; }
.coll-tile small { color: #ffffffc0; font-size: 13px; font-weight: 600; }
.coll-tile:hover { transform: translateY(-2px); border-color: var(--accent); }
/* Веер из трёх постеров справа; при наведении раздвигается */
.coll-p {
  position: absolute; z-index: 1; width: 54px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 8px;
  box-shadow: 0 8px 20px #0009; background: #0003; transition: transform .2s;
}
.coll-p:nth-of-type(1) { right: 58px; top: 30px; transform: rotate(-10deg); }
.coll-p:nth-of-type(2) { right: 32px; top: 22px; transform: rotate(-2deg); z-index: 2; }
.coll-p:nth-of-type(3) { right: 6px; top: 28px; transform: rotate(8deg); }
.coll-tile:hover .coll-p:nth-of-type(1) { transform: rotate(-14deg) translateX(-6px); }
.coll-tile:hover .coll-p:nth-of-type(3) { transform: rotate(12deg) translateX(6px); }
@media (prefers-reduced-motion: reduce) { .coll-p { transition: none; } }
.hub-group + .hub-group { margin-top: 40px; }
.hub-group h2 { font: 700 clamp(18px, 2vw, 22px)/1.2 var(--display); margin: 0 0 16px; }
.page-lead { color: var(--muted); margin: 8px 0 0; }
@media (max-width: 600px) {
  .coll-row { grid-auto-columns: 240px; }
  .coll-tile { height: 112px; padding: 12px; }
  .coll-tile span { font-size: 13px; max-width: calc(100% - 100px); }
  .coll-tile small { font-size: 12px; }
  .coll-grid { grid-template-columns: 1fr; gap: 10px; }
  .coll-p { width: 44px; border-radius: 6px; }
  .coll-p:nth-of-type(1) { right: 48px; top: 26px; }
  .coll-p:nth-of-type(2) { right: 26px; top: 18px; }
  .coll-p:nth-of-type(3) { right: 4px; top: 24px; }
}

/* ---------- Фильтры каталога ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 22px; }
.filters select {
  appearance: none; -webkit-appearance: none; background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa1b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px;
  color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 10px 34px 10px 14px; font: 600 14px var(--body); cursor: pointer;
}
.filters select:hover, .filters select:focus-visible { border-color: var(--accent); outline: none; }
.filters select.set { border-color: var(--accent); background-color: color-mix(in srgb, var(--accent) 12%, var(--bg-2)); }
.filters .reset { background: none; border: 0; color: var(--muted); font-weight: 700; font-size: 14px; padding: 10px 6px; }
.filters .reset:hover { color: var(--accent); }
@media (max-width: 520px) { .filters { display: grid; grid-template-columns: 1fr 1fr; } .filters select { width: 100%; } }

/* ---------- Подвал: ссылки на подборки, установка приложения ---------- */
.footer .footer-links { display: flex !important; flex-wrap: wrap; justify-content: flex-start; gap: 8px 18px; padding-bottom: 24px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.footer-links a:hover { color: var(--accent); }
.install-btn { margin-top: 14px; }

/* ---------- Совместный просмотр ---------- */
.player-col { min-width: 0; }
.together-bar { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.together-btn { border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--line)); background: color-mix(in srgb, var(--accent) 10%, var(--bg-2)); }
.together-btn:hover { border-color: var(--accent); }
.watch.in-room { grid-template-columns: minmax(0, 1fr) 340px; }

.vx-panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; height: min(640px, calc(100vh - 110px)); position: sticky; top: 84px; overflow: hidden; }
.vx-p-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 15px; }
.vx-p-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vx-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.vx-dot, .wp-status { width: 9px; height: 9px; border-radius: 50%; background: #666; flex: none; }
.vx-dot.connected { background: #3ddc84; box-shadow: 0 0 0 3px #3ddc8433; }
.vx-p-sec { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.vx-p-label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.vx-link { display: flex; gap: 8px; }
.vx-link input, .vx-send input, .vx-dialog input:not([type=radio]) {
  flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; color: var(--text); font: 500 14px var(--body);
}
.vx-link input:focus, .vx-send input:focus, .vx-dialog input:focus { outline: none; border-color: var(--accent); }
.vx-who { display: flex; flex-wrap: wrap; gap: 6px; }
.vx-who:empty { display: none; }
.vx-who span { font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface); }
.vx-who span.me { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.vx-chat { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.vx-msg b { color: var(--accent); }
.vx-msg.own b { color: #7ee2a8; }
.vx-msg.sys { color: var(--muted); font-size: 12.5px; text-align: center; }
.vx-send { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.vx-leave { background: none; border: 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 700; padding: 10px; }
.vx-leave:hover { color: var(--accent-2); }
.vx-name { display: grid; gap: 8px; background: var(--surface); border-radius: 12px; padding: 12px; }
.vx-name label { font-weight: 700; font-size: 14px; }

/* Окно «Новая комната» */
body.vx-lock { overflow: hidden; }
.vx-modal { position: fixed; inset: 0; z-index: 60; background: #05060acc; display: grid; place-items: center; padding: 16px; backdrop-filter: blur(4px); }
.vx-dialog { position: relative; width: min(460px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; }
.vx-dialog h3 { font: 700 19px var(--display); margin: 0 0 18px; }
.vx-x { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--bg-2); color: var(--muted); }
.vx-fld { margin-bottom: 14px; display: grid; gap: 6px; }
.vx-fld > label { font-size: 13px; font-weight: 700; color: var(--muted); }
.vx-dialog input:not([type=radio]) { width: 100%; padding: 11px 14px; }
.vx-pick { display: flex; align-items: center; gap: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.vx-pick[hidden] { display: none; }
.vx-pick img { width: 34px; height: 50px; object-fit: cover; border-radius: 6px; }
.vx-pick div { flex: 1; min-width: 0; display: grid; }
.vx-pick small { color: var(--muted); font-size: 12px; }
.vx-change { background: none; border: 0; color: var(--accent); font-weight: 700; font-size: 13px; }
.vx-search { position: relative; }
.vx-sugg { list-style: none; margin: 6px 0 0; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; max-height: 260px; overflow-y: auto; }
.vx-sugg button { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 6px 8px; border-radius: 8px; text-align: left; }
.vx-sugg button:hover, .vx-sugg button:focus-visible { background: var(--surface); outline: none; }
.vx-sugg img { width: 28px; height: 42px; object-fit: cover; border-radius: 5px; }
.vx-sugg span { display: grid; font-weight: 700; font-size: 14px; }
.vx-sugg small { color: var(--muted); font-weight: 500; font-size: 12px; }
.vx-none { color: var(--muted); padding: 8px; font-size: 13px; }
.vx-seg { display: grid; grid-template-columns: 1fr; gap: 8px; }
.vx-seg label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; background: var(--bg); cursor: pointer; font-size: 12.5px; color: var(--muted); }
.vx-fld[hidden] { display: none; }
.vx-hint { color: var(--muted); font-size: 12.5px; }
.vx-name .vx-err { margin: 0; }
.vx-seg label:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.vx-seg input { position: absolute; opacity: 0; pointer-events: none; }
.vx-seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.vx-seg b { color: var(--text); font-size: 14px; }
.vx-err { color: #ff8a8a; font-size: 13.5px; margin: 0 0 10px; }
.vx-go { width: 100%; justify-content: center; }

/* Главная: левая колонка «Смотрим вместе» */
.home-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 32px; align-items: start; margin-top: 48px; }
.home-grid .home-rows > .section:first-child { margin-top: 0; }
.vx-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 12px; }
.vx-promo { position: relative; overflow: hidden; border-radius: 18px; padding: 20px; background: linear-gradient(150deg, #3b2366, #1a1530 60%, #2a1424); border: 1px solid #ffffff14; }
.vx-promo::after { content: ''; position: absolute; right: -40px; top: -40px; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, #ff5f6d55, transparent 70%); pointer-events: none; }
.vx-promo h2 { position: relative; font: 700 17px/1.25 var(--display); margin: 0 0 8px; }
.vx-promo p { position: relative; margin: 0 0 12px; color: #c9cde0; font-size: 13.5px; }
.vx-promo ul { position: relative; list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 5px; font-size: 13px; color: #dfe2ee; }
.vx-promo .btn { width: 100%; justify-content: center; position: relative; }
.vx-tabs { display: flex; gap: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.vx-tabs button { flex: 1; background: none; border: 0; border-radius: 9px; padding: 7px; font-weight: 700; font-size: 13px; color: var(--muted); }
.vx-tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); }
.vx-list { display: grid; gap: 8px; }
.vx-room { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); transition: border-color .15s; }
.vx-room:hover { border-color: var(--accent); }
.vx-room img, .vx-ph { width: 42px; height: 62px; object-fit: cover; border-radius: 8px; background: var(--surface); }
.vx-room-t { display: grid; min-width: 0; }
.vx-room-t b { font-size: 14px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vx-room-t small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vx-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #7ee2a8; font-weight: 700; margin-top: 2px; }
.vx-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 3px #3ddc8433; }
.vx-mine { font-size: 12px; color: var(--muted); margin-top: 2px; }
.vx-enter { font-size: 12px; font-weight: 800; color: var(--accent); white-space: nowrap; }
.vx-empty { color: var(--muted); font-size: 13px; margin: 4px 2px; line-height: 1.5; }

@media (max-width: 1000px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: 32px; } /* minmax: ряды постеров не растягивают колонку */
  .vx-side { position: static; }
  .home-grid .home-rows > .section:first-child { margin-top: 36px; }
  .watch.in-room { grid-template-columns: minmax(0, 1fr); }
  .vx-panel { position: static; height: 460px; }
}
@media (max-width: 520px) { .together-bar span { display: none; } .together-btn { width: 100%; justify-content: center; } }
/* Пока не введены пароль/имя — поля чата нет */
.vx-wait .vx-send, .vx-wait .vx-leave, .vx-wait .vx-invite { display: none; } /* ссылка — только у тех, кто уже в комнате */
/* В комнате плашка Telegram закрывала бы поле чата */
body:has(.vx-panel) .tg-bar { display: none; }
/* Длинное слово в названии не вылезает за край узкого экрана */
.title-info h1, .slide-body h2, .page-title { overflow-wrap: break-word; hyphens: auto; }

/* Телефоны и планшеты: всё, во что тыкают пальцем, — не меньше ~40 px */
@media (max-width: 900px) {
  .nav a { padding-block: 11px; }
  .logo { padding-block: 9px; }
  .section-head a { display: inline-block; padding: 10px 0 10px 12px; }
  .card-remove { width: 38px; height: 38px; top: 38px; right: 6px; font-size: 14px; }
  .tg-close { padding: 12px; }
  .footer-tg, .footer-links a { display: inline-block; padding-block: 9px; }
  .genres a, .title-layout .genres a { display: inline-flex; align-items: center; min-height: 36px; padding-inline: 12px; }
  .more-link { padding: 10px 0; }
  .vx-tabs button { padding: 10px; }
  .vx-x { width: 40px; height: 40px; top: 10px; right: 10px; }
}

@media (max-width: 600px) {
  .vx-promo ul { display: none; }            /* на телефоне блок короче: заголовок, строка и кнопка */
  .vx-promo { padding: 16px; }
  input, select, textarea { font-size: 16px !important; } /* iPhone не приближает страницу при вводе */
}

/* ---------- Окно «Отключите VPN» (проверка в браузере, layout.js) ---------- */
html.vx-vpn-lock, html.vx-vpn-lock body { overflow: hidden; }
#vx-vpn { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; overflow-y: auto;
  background: radial-gradient(60% 50% at 20% 15%, #2a1c4af2 0, transparent 70%), radial-gradient(50% 40% at 90% 90%, #3a1820f2 0, transparent 70%), #0b0d14f7;
  backdrop-filter: blur(10px); }
.vx-vpn-card { width: min(460px, 100%); text-align: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: 22px; padding: 34px 26px 28px; }
.vx-vpn-logo { width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%; overflow: hidden; position: relative; background: linear-gradient(#4a2a72, #6b3fa0); }
.vx-vpn-logo::before, .vx-vpn-logo::after { content: ''; position: absolute; left: 50%; border-radius: 50%; transform: translateX(-50%); }
.vx-vpn-logo::before { width: 88px; height: 88px; bottom: -58px; background: var(--accent-2); }
.vx-vpn-logo::after { width: 60px; height: 60px; bottom: -44px; background: var(--accent); }
.vx-vpn-card h2 { font: 700 22px/1.25 var(--display); margin: 0 0 10px; }
.vx-vpn-card > p { color: #b6bcd2; margin: 0 0 20px; }
.vx-vpn-steps { text-align: left; background: var(--bg); border-radius: 14px; padding: 14px 16px; margin: 0 0 20px; color: #dfe2ee; font-size: 15px; }
.vx-vpn-steps b { color: var(--accent); }
.vx-vpn-card .btn { width: 100%; justify-content: center; padding: 15px; }
.vx-vpn-card .vx-vpn-small { margin: 16px 0 0; font-size: 13px; color: var(--muted); }
.vx-vpn-small a { color: var(--accent); }
