/* ============================================================
   SCORPIOFILMS — shared stylesheet
   Минимализм: один шрифт, один акцент, много воздуха.
   Две темы: тёмная (по умолчанию) и светлая — html[data-theme].
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;450;500;600;700&display=swap');

:root {
  color-scheme: dark;

  --bg:         #09090b;
  --surface:    #111114;
  --surface-2:  #1a1a1f;
  --line:       rgba(255,255,255,.08);
  --line-strong:rgba(255,255,255,.18);
  --text:       #f3f3f4;
  --text-dim:   #9b9ba5;
  --accent:     #ff4f3b;
  --accent-ink: #ffffff;
  --glass:      rgba(9,9,11,.72);
  --hover:      rgba(255,255,255,.06);
  --shadow:     0 24px 60px -24px rgba(0,0,0,.7);
  --hero-tint:  .5;
  --focus:      #6aa6ff;

  /* Алиасы старых имён — на них опираются panel.html и часть скриптов */
  --ink:        var(--bg);
  --ink-raised: var(--surface);
  --ink-line:   var(--line);
  --paper:      var(--text);
  --paper-dim:  var(--text-dim);
  --brass:      var(--text);
  --brass-dim:  var(--text-dim);
  --velvet:     var(--accent);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: var(--font);
  --font-body: var(--font);
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --radius: 10px;
  --radius-lg: 16px;
  --ease: cubic-bezier(.2,.8,.2,1);
  --header-h: 64px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg:         #f7f7f5;
  --surface:    #ffffff;
  --surface-2:  #efefec;
  --line:       rgba(0,0,0,.09);
  --line-strong:rgba(0,0,0,.2);
  --text:       #111113;
  --text-dim:   #61616b;
  --accent:     #d93a2a;
  --glass:      rgba(247,247,245,.78);
  --hover:      rgba(0,0,0,.05);
  --shadow:     0 24px 60px -28px rgba(20,20,30,.28);
  --hero-tint:  .2;
  --focus:      #1f6feb;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }

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

h1, h2, h3, h4 {
  font-family: var(--font);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: 0 0 .5em;
}

.eyebrow {
  display: inline-block;
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(18px, 3.2vw, 40px);
}

.is-hidden { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

kbd {
  font-family: var(--font-mono);
  font-size: .68rem;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--text-dim);
  background: transparent;
}

/* ---------------- Buttons ---------------- */

.btn {
  font-weight: 550;
  font-size: .92rem;
  line-height: 1;
  padding: 13px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s var(--ease), background .2s, border-color .2s, color .2s, opacity .2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { flex-shrink: 0; }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { opacity: .86; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { background: var(--hover); }
.btn-ghost.is-saved { border-color: var(--text); }
.btn-velvet { background: var(--accent); color: var(--accent-ink); }
.btn-velvet:hover { opacity: .88; }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 15px; font-size: .82rem; }
.btn-google { background: var(--text); color: var(--bg); gap: 10px; }
.btn-google:hover { opacity: .88; }
.link-btn {
  background: none; border: none; color: var(--text-dim);
  font-size: .82rem; cursor: pointer; text-decoration: underline;
  align-self: flex-end; padding: 0; margin: -6px 0 4px;
}
.link-btn:hover { color: var(--text); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 50%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

/* переключатель темы: солнце ↔ луна */
.theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: block; }
:root[data-theme="light"] .theme-toggle .i-moon { display: none; }

/* ---------------- Header ---------------- */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 clamp(16px, 3.2vw, 40px);
  border-bottom: 1px solid transparent;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
}
.site-header.is-scrolled {
  background: var(--glass);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: saturate(1.5) blur(18px);
  backdrop-filter: saturate(1.5) blur(18px);
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
}
.brand-mark {
  width: 22px; height: 22px; background: currentColor;
  -webkit-mask: url('/img/scorpion-icon.png') center / contain no-repeat;
  mask: url('/img/scorpion-icon.png') center / contain no-repeat;
}
.brand-name {
  font-size: .8rem; font-weight: 650; letter-spacing: .3em; text-transform: uppercase;
}
/* старое имя класса — на случай кэшированных страниц */
.site-header .wordmark { font-size: .8rem; font-weight: 650; letter-spacing: .3em; text-transform: uppercase; text-decoration: none; }

.header-links { display: flex; gap: 4px; margin-left: 8px; }
.header-links a {
  font-size: .88rem; color: var(--text-dim); text-decoration: none;
  padding: 7px 12px; border-radius: 999px; transition: color .2s, background .2s;
}
.header-links a:hover { color: var(--text); background: var(--hover); }

.header-nav { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.pill {
  font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong);
  text-decoration: none; color: var(--text);
}
.pill-admin { border-color: var(--accent); color: var(--accent); }

.user-chip { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  font-weight: 650; font-size: .85rem; overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-name { font-size: .88rem; color: var(--text-dim); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- Hero (главная) ---------------- */

.hero {
  position: relative;
  min-height: min(88svh, 860px);
  display: flex;
  align-items: flex-end;
  padding: calc(var(--header-h) + 56px) 0 72px;
  overflow: hidden;
  isolation: isolate;
}
.hero-backdrop {
  position: absolute; inset: -60px; z-index: -2;
  background-position: center; background-size: cover; background-repeat: no-repeat;
  filter: blur(48px) saturate(1.3);
  transform: scale(1.1);
  opacity: 0;
  transition: opacity 1s var(--ease);
}
.hero.has-backdrop .hero-backdrop,
.project-hero.has-backdrop .hero-backdrop { opacity: var(--hero-tint); }
.hero::after, .project-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to top, var(--bg) 2%, transparent 62%),
    radial-gradient(120% 90% at 0% 100%, var(--bg) 0%, transparent 60%);
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(32px, 6vw, 96px);
  align-items: end;
}
.hero-copy { max-width: 640px; animation: fade-up .9s var(--ease) both; }
.hero-copy .eyebrow { margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.hero-copy .eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; opacity: .6; }
.hero-title {
  font-size: clamp(2.8rem, 7.4vw, 6rem);
  line-height: .96;
  letter-spacing: -.045em;
  font-weight: 700;
  margin: 0 0 22px;
  text-wrap: balance;
}
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text-dim); font-size: .9rem; margin-bottom: 14px; }
.hero-meta .dot::before { content: "·"; margin-right: 14px; opacity: .6; }
.hero-text {
  color: var(--text-dim);
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  line-height: 1.65;
  max-width: 54ch;
  margin: 0 0 30px;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-poster {
  width: clamp(190px, 21vw, 290px);
  aspect-ratio: 2/3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
  background: var(--surface-2);
  animation: fade-up 1s .1s var(--ease) both;
  display: block;
}
.hero-poster img { width: 100%; height: 100%; object-fit: cover; }
.hero-poster:empty { display: none; }
.hero-skeleton { animation: none; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------- Sections ---------------- */

.section { padding: 72px 0; }
.section-tight { padding: 40px 0; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px 24px; flex-wrap: wrap; margin-bottom: 28px;
}
.section-head h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); margin: 0; }
.section-sub { color: var(--text-dim); font-size: .92rem; margin: 6px 0 0; }

section[id] { scroll-margin-top: calc(var(--header-h) + 12px); }

/* ---------------- Catalog toolbar ---------------- */

.catalog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap; margin-bottom: 30px; }
.catalog-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.catalog-tabs {
  display: inline-flex; gap: 2px; padding: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  overflow-x: auto; max-width: 100%;
  scrollbar-width: none;
}
.catalog-tabs::-webkit-scrollbar { display: none; }
.catalog-tab {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .85rem; font-weight: 500;
  background: none; border: none; color: var(--text-dim);
  padding: 8px 15px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  transition: color .2s, background .2s;
}
.catalog-tab:hover { color: var(--text); }
.catalog-tab.is-active { background: var(--surface-2); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.catalog-tab .count {
  font-size: .7rem; min-width: 18px; padding: 1px 6px; text-align: center;
  border-radius: 999px; background: var(--hover); color: var(--text-dim);
}
.catalog-tab .count:empty { display: none; }

.catalog-search { position: relative; display: flex; align-items: center; }
.catalog-search > svg { position: absolute; left: 14px; color: var(--text-dim); pointer-events: none; }
.catalog-search input {
  font-size: .88rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 44px 10px 38px;
  width: 210px;
  transition: border-color .2s, width .3s var(--ease);
}
.catalog-search input::-webkit-search-cancel-button { display: none; }
.catalog-search input::placeholder { color: var(--text-dim); }
.catalog-search input:focus { outline: none; border-color: var(--line-strong); width: 280px; }
.catalog-search kbd { position: absolute; right: 12px; pointer-events: none; }
.catalog-search input:focus ~ kbd, .catalog-search input:not(:placeholder-shown) ~ kbd { display: none; }
.catalog-search-clear {
  position: absolute; right: 8px; background: none; border: none; color: var(--text-dim);
  cursor: pointer; padding: 7px; display: flex; border-radius: 50%;
}
.catalog-search-clear:hover { color: var(--text); background: var(--hover); }

.select {
  appearance: none; -webkit-appearance: none;
  font-size: .85rem; background-color: var(--surface);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 36px 10px 16px; cursor: pointer; color: var(--text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239b9ba5' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.select:hover { border-color: var(--line-strong); }
.select option { background: var(--surface); color: var(--text); }

/* ---------------- Cards ---------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
  gap: 34px 22px;
}

.project-card { position: relative; }
.project-card-link { display: block; text-decoration: none; color: var(--text); }
.poster-wrap {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.poster-wrap::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--line);
}
.poster-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.poster-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 3rem; font-weight: 700; color: var(--text-dim);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
}
.project-card-link:hover .poster-wrap { transform: translateY(-4px); box-shadow: var(--shadow); }
.project-card-link:hover .poster-wrap img { transform: scale(1.045); }

.status-tag {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px;
  background: rgba(10,10,12,.62); color: #fff;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.status-tag.upcoming { background: var(--accent); color: var(--accent-ink); }
.rating-chip {
  position: absolute; bottom: 10px; left: 10px; z-index: 2;
  font-size: .74rem; font-weight: 600; padding: 4px 9px; border-radius: 999px;
  background: rgba(10,10,12,.62); color: #fff;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.rating-chip span { color: #ffc24a; }

.bookmark-btn {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,10,12,.62); color: #fff;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transform: scale(.9);
  transition: opacity .2s, transform .2s var(--ease), background .2s;
}
.project-card:hover .bookmark-btn,
.project-card:focus-within .bookmark-btn,
.bookmark-btn.is-saved { opacity: 1; transform: none; }
.bookmark-btn:hover { background: rgba(10,10,12,.85); }
.bookmark-btn.is-saved { background: #fff; color: #09090b; }
.bookmark-btn.is-saved .bm-path { fill: currentColor; }
.btn .bm-path { transition: fill .2s; }
.btn.is-saved .bm-path { fill: currentColor; }
@media (hover: none) { .bookmark-btn { opacity: 1; transform: none; } }

.card-body { padding: 14px 2px 0; }
.project-card h3 { font-size: 1rem; font-weight: 600; margin: 0 0 3px; letter-spacing: -.01em; }
.project-card .card-meta { font-size: .8rem; color: var(--text-dim); }

.empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 64px 20px;
  color: var(--text-dim);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  font-size: .95rem;
}
.empty-state strong { display: block; color: var(--text); font-weight: 600; margin-bottom: 4px; }

/* skeleton */
.skeleton {
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--radius-lg);
}
@keyframes shimmer { to { background-position: -220% 0; } }
.skeleton-card .sk-poster { aspect-ratio: 2/3; }
.skeleton-card .sk-line { height: 12px; margin-top: 14px; width: 70%; border-radius: 6px; }
.skeleton-card .sk-line.short { width: 40%; margin-top: 8px; }

/* horizontal rails */
.rail {
  display: flex; gap: 18px; overflow-x: auto; padding: 4px 2px 14px;
  scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.rail > * { flex: 0 0 auto; scroll-snap-align: start; }
.rail .project-card { width: 170px; }

/* continue watching */
.continue-card {
  position: relative; width: min(360px, 84vw);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  transition: border-color .2s, background .2s;
}
.continue-card:hover { border-color: var(--line-strong); background: var(--surface-2); }
.continue-main { display: flex; gap: 16px; align-items: center; padding: 12px; text-decoration: none; color: var(--text); }
.continue-thumb { width: 68px; aspect-ratio: 2/3; object-fit: cover; border-radius: 8px; background: var(--surface-2); flex-shrink: 0; }
.continue-info { min-width: 0; flex: 1; padding-right: 22px; }
.continue-info h3 { font-size: .98rem; margin: 0 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.continue-sub { font-size: .8rem; color: var(--text-dim); margin: 0 0 12px; }
.progress { height: 3px; border-radius: 3px; background: var(--line-strong); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.continue-left { font-size: .74rem; color: var(--text-dim); margin-top: 7px; }
.continue-remove {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: none; background: transparent; color: var(--text-dim); cursor: pointer;
  opacity: 0; transition: opacity .2s, background .2s;
}
.continue-card:hover .continue-remove, .continue-remove:focus-visible { opacity: 1; }
.continue-remove:hover { background: var(--hover); color: var(--text); }
@media (hover: none) { .continue-remove { opacity: .8; } }

/* ---------------- Studio / about ---------------- */

.studio-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(32px, 6vw, 96px); align-items: center;
}
.studio-lead {
  font-size: clamp(1.25rem, 2.3vw, 1.85rem);
  line-height: 1.42; font-weight: 500; letter-spacing: -.02em;
  max-width: 34em; margin: 14px 0 0; text-wrap: pretty;
}
.studio-stats { display: flex; gap: clamp(28px, 5vw, 64px); margin-top: 44px; flex-wrap: wrap; }
.studio-stat b { display: block; font-size: clamp(2rem, 4vw, 3rem); font-weight: 650; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.studio-stat span { display: block; margin-top: 8px; font-size: .82rem; color: var(--text-dim); }
.studio-emblem {
  width: clamp(120px, 16vw, 190px); height: auto; opacity: .92;
  filter: invert(1); cursor: pointer; user-select: none; -webkit-user-drag: none;
  transition: transform .3s var(--ease);
}
:root[data-theme="light"] .studio-emblem { filter: none; }
.studio-emblem:hover { transform: scale(1.06) rotate(-2deg); }

/* ---------------- Posts (news) ---------------- */

.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 32px 24px; }
.post-card { text-decoration: none; color: var(--text); display: block; }
.post-card-cover {
  aspect-ratio: 16/9; background: var(--surface-2); overflow: hidden; border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 16px; position: relative;
}
.post-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.post-card:hover .post-card-cover img { transform: scale(1.04); }
.post-card-date { font-size: .78rem; color: var(--text-dim); }
.post-card h3 { font-size: 1.15rem; margin: 6px 0 8px; }
.post-card p { color: var(--text-dim); font-size: .92rem; margin: 0; }
.post-card-reactions { display: inline-block; margin-top: 10px; font-size: .78rem; color: var(--text-dim); }

/* ---------------- Socials / partners ---------------- */

.socials-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.social-link-btn {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  text-decoration: none; font-size: 1rem; font-weight: 550; letter-spacing: -.01em;
  background: var(--surface); transition: border-color .2s, background .2s;
}
.social-link-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.social-link-arrow { color: var(--text-dim); transition: transform .25s var(--ease), color .2s; }
.social-link-btn:hover .social-link-arrow { transform: translate(3px, -3px); color: var(--text); }

.partners-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.partner-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  padding: 26px 14px 22px; border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.partner-logo {
  width: 64px; height: 64px; object-fit: cover; border-radius: 50%; margin-bottom: 10px;
  background: var(--surface-2); filter: grayscale(1); opacity: .85; transition: filter .3s, opacity .3s;
}
.partner-card:hover .partner-logo { filter: none; opacity: 1; }
.partner-name { margin: 0; font-weight: 600; font-size: .95rem; }
.partner-role { margin: 0; font-size: .8rem; color: var(--text-dim); }

/* ---------------- Footer ---------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 36px 0 44px;
  margin-top: 40px;
  color: var(--text-dim);
  font-size: .85rem;
}
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.site-footer a { color: var(--text-dim); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* ---------------- Toast ---------------- */

.toast-host {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px; border-radius: 999px;
  background: var(--text); color: var(--bg);
  font-size: .88rem; font-weight: 500;
  box-shadow: var(--shadow);
  animation: toast-in .3s var(--ease) both;
}
.toast button {
  background: none; border: none; cursor: pointer; font-weight: 650; font-size: .88rem;
  color: inherit; text-decoration: underline; padding: 0;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---------------- Modal (auth) ---------------- */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(4,4,6,.66);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  padding: 34px;
  width: 100%; max-width: 410px;
  position: relative;
  box-shadow: var(--shadow);
  animation: fade-up .3s var(--ease) both;
}
.modal-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; color: var(--text-dim);
  font-size: 1.5rem; cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--text); }

.auth-tabs { display: flex; gap: 2px; margin-bottom: 22px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.auth-tab {
  flex: 1; background: none; border: none; color: var(--text-dim);
  padding: 9px; border-radius: 999px; cursor: pointer; font-weight: 550; font-size: .85rem;
}
.auth-tab.is-active { background: var(--surface-2); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.auth-modal-title { font-size: 1.35rem; text-align: center; margin-bottom: 18px; }

.auth-error, .auth-notice { font-size: .82rem; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; }
.auth-error { background: rgba(255,79,59,.1); color: var(--accent); border: 1px solid rgba(255,79,59,.35); }
.auth-notice { background: var(--hover); color: var(--text); border: 1px solid var(--line-strong); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; font-size: .82rem; color: var(--text-dim); }
.field input, .field textarea, .field select {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 14px;
  color: var(--text);
  font-size: .92rem;
  transition: border-color .2s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--line-strong); outline: none; }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-dim); font-size: .78rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------------- Project page ---------------- */

.project-hero {
  position: relative; isolation: isolate; overflow: hidden;
  padding: calc(var(--header-h) + 48px) 0 44px;
}
.project-hero-inner {
  display: grid; grid-template-columns: minmax(190px, 270px) minmax(0, 1fr);
  gap: clamp(26px, 5vw, 64px); align-items: end;
}
.project-poster {
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
  aspect-ratio: 2/3; background: var(--surface-2);
  animation: fade-up .8s var(--ease) both;
}
.project-poster img { width: 100%; height: 100%; object-fit: cover; }
.project-info { animation: fade-up .8s .08s var(--ease) both; }
.project-info .eyebrow { margin-bottom: 14px; }
.project-info h1 { font-size: clamp(2.2rem, 5vw, 4rem); letter-spacing: -.04em; line-height: 1; font-weight: 700; margin-bottom: 16px; text-wrap: balance; }
.project-meta-row {
  display: flex; gap: 6px 14px; flex-wrap: wrap;
  font-size: .9rem; color: var(--text-dim); margin-bottom: 18px;
}
.project-meta-row > span:not(:empty) + span:not(:empty)::before { content: "·"; margin-right: 14px; opacity: .6; }
.project-synopsis { color: var(--text-dim); font-size: 1.04rem; line-height: 1.7; max-width: 64ch; margin: 0 0 26px; }
.project-synopsis:empty { display: none; }
.project-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }

.rating-block { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.star-row { display: flex; gap: 2px; }
.star-btn {
  background: none; border: none; cursor: pointer; padding: 2px;
  font-size: 1.5rem; line-height: 1; color: var(--line-strong);
  transition: color .15s, transform .15s var(--ease);
}
.star-btn.is-filled { color: #ffc24a; }
.star-btn:hover { transform: scale(1.18); }
.rating-summary { font-size: .88rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.rating-hint { font-size: .78rem; color: var(--text-dim); margin: 8px 0 0; opacity: .8; }

.episode-seo-details { margin: 0 0 22px; max-width: 64ch; }
.episode-seo-details h2 { font-size: 1.05rem; margin: 0 0 6px; }
.episode-seo-details p { font-size: .94rem; line-height: 1.6; color: var(--text-dim); margin: 0; }

.section-block { padding: 36px 0; }
.section-block h2 { font-size: 1.35rem; margin-bottom: 18px; }
.section-block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-block-head h2 { margin: 0; }
.hint-keys { font-size: .78rem; color: var(--text-dim); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.director-note {
  position: relative;
  padding: 4px 0 4px 26px;
  border-left: 2px solid var(--accent);
  font-size: clamp(1.1rem, 1.8vw, 1.35rem);
  line-height: 1.6; font-weight: 450; letter-spacing: -.01em;
  max-width: 62ch; color: var(--text);
}
.director-note .signoff { display: block; margin-top: 14px; font-size: .82rem; color: var(--text-dim); }

.player-wrap {
  position: relative; width: 100%; aspect-ratio: 16/9;
  background: #000; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
}
.player-wrap video, .player-wrap iframe { width: 100%; height: 100%; border: none; display: block; }
.player-placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 10px; color: #8d8d96; font-size: .9rem; text-align: center; padding: 20px;
}

/* ---------------- Comments ---------------- */

.comment-form { display: flex; gap: 12px; margin-bottom: 34px; align-items: flex-end; }
.comment-form textarea, .reply-form textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 16px;
  font-size: .94rem;
  transition: border-color .2s;
}
.comment-form textarea:focus, .reply-form textarea:focus { border-color: var(--line-strong); outline: none; }
.comment-form textarea::placeholder, .reply-form textarea::placeholder { color: var(--text-dim); }
.comment-form textarea { flex: 1; min-height: 52px; max-height: 220px; resize: vertical; line-height: 1.5; }
.comment-form .btn { flex-shrink: 0; }
.comment-name {
  width: 170px; flex-shrink: 0; align-self: stretch; max-height: 52px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; font-size: .92rem; transition: border-color .2s;
}
.comment-name:focus { border-color: var(--line-strong); outline: none; }
.comment-name::placeholder { color: var(--text-dim); }
.comment-signed-out {
  padding: 18px; border: 1px dashed var(--line-strong); border-radius: var(--radius);
  color: var(--text-dim); font-size: .9rem; text-align: center;
}

.comment-list { display: flex; flex-direction: column; gap: 24px; }
.comment { display: flex; gap: 14px; }
.comment-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-weight: 650; font-size: .85rem; overflow: hidden;
}
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 3px; flex-wrap: wrap; }
.comment-author { font-weight: 600; font-size: .92rem; }
.comment-time { font-size: .76rem; color: var(--text-dim); }
.comment-text { font-size: .94rem; margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); opacity: .92; }
.comment-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.comment-actions button, .comment-actions a {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-size: .78rem; padding: 0; text-decoration: none; transition: color .2s;
}
.comment-actions button:hover, .comment-actions a:hover { color: var(--text); }
.reply-list { margin-top: 16px; display: flex; flex-direction: column; gap: 18px; padding-left: 20px; border-left: 1px solid var(--line); }
.reply-form { display: none; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.reply-form.is-open { display: flex; }
.reply-form textarea { flex: 1; min-width: 180px; min-height: 50px; }

/* Комментарии из YouTube встроены в общий список */
#youtube-comments { margin: 0; }
#youtube-comments[hidden] { display: none; }
#youtube-comments .comment-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
#youtube-comments [data-youtube-status] { color: var(--text-dim); font-size: .85rem; }
.unified-comments { gap: 24px; }
.unified-comments > #youtube-comments, .unified-comments > #comment-list { margin: 0; }
.unified-comments .comment-actions [hidden], .unified-comments .comment[hidden] { display: none !important; }

/* ---------------- Post detail ---------------- */

.post-hero { padding: calc(var(--header-h) + 56px) 0 24px; max-width: 760px; }
.post-hero h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); letter-spacing: -.035em; line-height: 1.05; margin: 12px 0 0; text-wrap: balance; }
.post-cover-wrap {
  margin: 30px 0; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 0 0 1px var(--line); aspect-ratio: 16/9; background: var(--surface-2);
}
.post-cover-wrap img { width: 100%; height: 100%; object-fit: cover; }
.post-body { font-size: 1.08rem; line-height: 1.8; }
.post-body p { margin: 0 0 1.2em; }
.post-body p:last-child { margin-bottom: 0; }

.reaction-row { display: flex; gap: 10px; margin-top: 36px; flex-wrap: wrap; }
.reaction-btn {
  display: flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 8px 16px; cursor: pointer;
  color: var(--text-dim); transition: background .2s, border-color .2s, color .2s;
}
.reaction-btn:hover { background: var(--hover); }
.reaction-btn.is-active { border-color: var(--text); color: var(--text); background: var(--hover); }
.reaction-emoji { font-size: 1.1rem; line-height: 1; }
.reaction-count { font-size: .82rem; font-variant-numeric: tabular-nums; }

/* ---------------- Admin ---------------- */

.admin-tabs { display: flex; gap: 4px; margin: calc(var(--header-h) + 36px) 0 28px; padding: 4px; width: fit-content; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.admin-tab {
  font-size: .85rem; font-weight: 500;
  background: none; border: none; color: var(--text-dim);
  padding: 8px 20px; border-radius: 999px; cursor: pointer; transition: all .2s;
}
.admin-tab.is-active { background: var(--surface-2); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.admin-tab:hover { color: var(--text); }

.admin-shell { padding: 0 0 100px; }
.admin-guard { padding: calc(var(--header-h) + 80px) 20px 80px; text-align: center; color: var(--text-dim); }
.admin-guard h2 { color: var(--text); }
.admin-grid { display: grid; grid-template-columns: 400px 1fr; gap: 40px; align-items: start; }
.admin-form {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 26px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: calc(var(--header-h) + 20px);
}
.admin-form h2 { font-size: 1.2rem; }
.admin-list { display: flex; flex-direction: column; gap: 10px; }
.admin-row {
  display: flex; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px;
}
.admin-row img { width: 46px; height: 66px; object-fit: cover; border-radius: 6px; }
.admin-row .row-info { flex: 1; min-width: 0; }
.admin-row .row-info h4 { margin: 0 0 2px; font-size: .95rem; }
.admin-row .row-info span { font-size: .78rem; color: var(--text-dim); }
.admin-row-actions { display: flex; gap: 8px; }
.form-hint { font-size: .76rem; color: var(--text-dim); }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--text-dim); }
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--accent); }

.type-toggle { display: flex; gap: 8px; }
.type-toggle button {
  flex: 1; padding: 10px; border-radius: var(--radius); border: 1px solid var(--line);
  background: none; color: var(--text-dim); cursor: pointer; font-size: .85rem; font-weight: 550;
}
.type-toggle button.is-active { border-color: var(--text); color: var(--text); background: var(--hover); }

.season-builder { display: flex; flex-direction: column; gap: 16px; }
.season-block { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--bg); }
.season-block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.season-block-head strong { font-size: .9rem; }
.season-builder-episode {
  display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px;
  padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.season-builder-episode .ep-fields { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.season-builder-episode input, .season-builder-episode select {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; color: var(--text); font-size: .82rem; width: 100%;
}
.icon-remove-btn { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 1.1rem; padding: 4px 8px; flex-shrink: 0; }
.icon-remove-btn:hover { color: var(--accent); }
.add-episode-btn, .add-season-btn {
  background: none; border: 1px dashed var(--line-strong); color: var(--text-dim);
  border-radius: var(--radius); padding: 9px; cursor: pointer; font-size: .8rem; width: 100%;
}
.add-episode-btn:hover, .add-season-btn:hover { border-color: var(--text); color: var(--text); }

/* ---------------- Custom player ---------------- */

.cp-root {
  position: relative;
  background: #000;
  outline: none;
  overflow: hidden;
  border-radius: inherit;
  --cp-accent: var(--accent);
  --cp-fg: #f4f4f5;
  --cp-fg-dim: rgba(244,244,245,.62);
  --cp-track: rgba(255,255,255,.24);
}
.cp-root.is-fullscreen { border-radius: 0; }
.cp-root.cp-idle { cursor: none; }

.cp-root .cp-video,
.cp-root .cp-yt-target,
.cp-root .cp-yt-target iframe {
  width: 100%; height: 100%; display: block; object-fit: contain; background: #000;
}

.cp-btn svg, .cp-overlay svg { width: 18px; height: 18px; display: block; }

.cp-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(to top, rgba(0,0,0,.35), rgba(0,0,0,.12));
  cursor: pointer;
  transition: opacity .25s var(--ease);
  z-index: 3;
}
.cp-overlay > svg {
  width: 26px; height: 26px; padding: 22px; box-sizing: content-box; margin-left: 3px;
  color: #09090b; background: #fff; border-radius: 50%;
  transition: transform .2s var(--ease);
}
.cp-overlay > .cp-scorpion {
  width: 72px; height: 72px; box-sizing: border-box; padding: 17px; object-fit: contain;
  background: rgba(10,10,12,.5);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 50%;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: transform .2s var(--ease), background .2s;
  user-select: none; -webkit-user-drag: none;
}
.cp-overlay:hover > svg, .cp-overlay:hover > .cp-scorpion { transform: scale(1.07); }
.cp-overlay:hover > .cp-scorpion { background: rgba(10,10,12,.7); }
.cp-overlay.is-hidden { opacity: 0; pointer-events: none; }

.cp-buffering {
  position: absolute; top: 50%; left: 50%;
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: cp-spin .8s linear infinite;
  z-index: 4;
}
@keyframes cp-spin { to { transform: rotate(360deg); } }

.cp-hint {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-size: .78rem; font-weight: 550; color: var(--cp-fg);
  background: rgba(0,0,0,.6); padding: 8px 14px; border-radius: 999px;
  z-index: 4; opacity: 0; pointer-events: none;
}
.cp-hint-left { left: 20px; }
.cp-hint-right { right: 20px; }
.cp-hint.is-active { animation: cp-hint-flash .55s var(--ease); }
@keyframes cp-hint-flash { 0% { opacity: 0; } 25% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }

.cp-bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.45) 60%, transparent 100%);
  padding: 34px 14px 10px;
  opacity: 1; transform: translateY(0); pointer-events: auto;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.cp-root.cp-idle .cp-bar { opacity: 0; transform: translateY(6px); pointer-events: none; }

.cp-seek { position: relative; padding: 8px 0; margin: 0 2px 2px; cursor: pointer; }
.cp-seek::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  height: 3px; margin-top: -1.5px; border-radius: 3px; background: var(--cp-track);
  transition: height .15s, margin .15s;
}
.cp-seek:hover::before, .cp-seek.is-hover::before { height: 5px; margin-top: -2.5px; }
.cp-seek-buffered, .cp-seek-fill {
  position: absolute; left: 0; top: 50%; margin-top: -1.5px; height: 3px; border-radius: 3px; width: 0%;
  transition: height .15s, margin .15s;
}
.cp-seek.is-hover .cp-seek-buffered, .cp-seek.is-hover .cp-seek-fill { height: 5px; margin-top: -2.5px; }
.cp-seek-buffered { background: rgba(255,255,255,.3); transition: width .2s linear, height .15s, margin .15s; }
.cp-seek-fill { background: var(--cp-accent); }
.cp-seek-fill::after {
  content: ""; position: absolute; top: 50%; right: 0;
  width: 13px; height: 13px; border-radius: 50%; background: #fff;
  transform: translate(50%, -50%) scale(0); transition: transform .15s var(--ease);
}
.cp-seek.is-hover .cp-seek-fill::after { transform: translate(50%, -50%) scale(1); }
.cp-seek-input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer;
}
.cp-seek-input::-webkit-slider-runnable-track { background: transparent; height: 100%; }
.cp-seek-input::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 10px; }
.cp-seek-input::-moz-range-track { background: transparent; height: 100%; border: none; }
.cp-seek-input::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: transparent; border: none; }

.cp-buttons { display: flex; align-items: center; gap: 2px; height: 36px; }
.cp-btn {
  background: none; border: none; color: var(--cp-fg); cursor: pointer;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; flex-shrink: 0; opacity: .9;
  transition: opacity .15s, background .15s;
}
.cp-btn:hover { opacity: 1; background: rgba(255,255,255,.12); }
.cp-btn:active { opacity: .7; }
.cp-btn[hidden] { display: none; }
.cp-btn-text { width: auto; padding: 0 10px; font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.cp-vol { display: flex; align-items: center; }
.cp-vol-input {
  width: 0; opacity: 0; margin: 0; height: 3px;
  -webkit-appearance: none; appearance: none;
  background: linear-gradient(to right, var(--cp-fg) 0 var(--vol-pct, 100%), var(--cp-track) var(--vol-pct, 100%));
  border-radius: 3px; cursor: pointer;
  transition: width .18s var(--ease), opacity .18s, margin .18s;
}
.cp-vol:hover .cp-vol-input, .cp-vol:focus-within .cp-vol-input { width: 64px; opacity: 1; margin: 0 8px 0 2px; }
.cp-vol-input::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%; background: #fff; margin-top: -4px; }
.cp-vol-input::-moz-range-thumb { width: 11px; height: 11px; border-radius: 50%; background: #fff; border: none; }
.cp-vol-input::-moz-range-track { height: 3px; border-radius: 3px; background: var(--cp-track); }

.cp-clock {
  color: var(--cp-fg-dim); font-size: .78rem; white-space: nowrap; flex-shrink: 0;
  margin-left: 6px; display: inline-flex; gap: 4px; font-variant-numeric: tabular-nums;
}
.cp-clock-cur { color: var(--cp-fg); }
.cp-clock-sep { opacity: .5; }
.cp-fill { flex: 1; }

/* меню скорости */
.cp-speed-wrap { position: relative; }
.cp-menu {
  position: absolute; right: 0; bottom: 44px; min-width: 120px; padding: 6px;
  background: rgba(18,18,22,.94); border: 1px solid rgba(255,255,255,.12); border-radius: 12px;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px -12px rgba(0,0,0,.6);
  display: flex; flex-direction: column; z-index: 8;
}
.cp-menu[hidden] { display: none; }
.cp-menu button {
  background: none; border: none; color: var(--cp-fg); text-align: left; cursor: pointer;
  padding: 8px 12px; border-radius: 8px; font-size: .84rem; display: flex; justify-content: space-between; gap: 18px;
}
.cp-menu button:hover { background: rgba(255,255,255,.1); }
.cp-menu button[aria-checked="true"] { font-weight: 650; }
.cp-menu button[aria-checked="true"]::after { content: "✓"; color: var(--cp-accent); }

/* карточка «Следующая серия» */
.cp-next {
  position: absolute; right: 16px; bottom: 84px; z-index: 7;
  width: min(320px, calc(100% - 32px)); padding: 16px 18px;
  background: rgba(18,18,22,.94); border: 1px solid rgba(255,255,255,.14); border-radius: 16px;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  color: var(--cp-fg); box-shadow: 0 20px 50px -14px rgba(0,0,0,.7);
  animation: fade-up .35s var(--ease) both;
}
.cp-next[hidden] { display: none; }
.cp-next-label { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--cp-fg-dim); margin: 0 0 4px; }
.cp-next-title { font-size: 1rem; font-weight: 600; margin: 0 0 14px; line-height: 1.3; }
.cp-next-actions { display: flex; gap: 8px; }
.cp-next-actions .btn { padding: 10px 16px; font-size: .84rem; }
.cp-next-actions .btn-primary { background: #fff; color: #09090b; flex: 1; position: relative; overflow: hidden; }
.cp-next-actions .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.cp-next-actions .btn-ghost:hover { background: rgba(255,255,255,.1); }
.cp-next-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--cp-accent); transform-origin: left; animation: cp-next-fill var(--cp-next-ms, 7s) linear forwards; }
@keyframes cp-next-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (hover: none) {
  .cp-vol-input { width: 52px; opacity: 1; margin: 0 6px 0 2px; }
  .cp-seek-fill::after { transform: translate(50%, -50%) scale(1); }
  .cp-btn { width: 40px; height: 40px; }
  .cp-seek { padding: 11px 0; }
  .cp-bar { padding: 30px 8px 10px; }
}

/* ---------------- Series: seasons & episodes ---------------- */

.episode-nav { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.season-tabs { display: inline-flex; gap: 2px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; flex-wrap: wrap; }
.season-tab {
  font-size: .84rem; font-weight: 500; background: none; border: none; color: var(--text-dim);
  padding: 7px 16px; border-radius: 999px; cursor: pointer; transition: all .2s;
}
.season-tab:hover { color: var(--text); }
.season-tab.is-active { background: var(--surface-2); color: var(--text); box-shadow: 0 0 0 1px var(--line); }

.episode-list {
  display: flex; flex-direction: column; margin-bottom: 26px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
}
.episode-row {
  position: relative; display: flex; align-items: center; gap: 16px;
  padding: 14px 20px; cursor: pointer; text-align: left; width: 100%;
  color: var(--text); text-decoration: none; transition: background .2s;
}
.episode-row + .episode-row { border-top: 1px solid var(--line); }
.episode-row:hover { background: var(--hover); }
.episode-row.is-active { background: var(--hover); }
.episode-row.is-active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.episode-num { font-size: .85rem; color: var(--text-dim); width: 28px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.episode-info { flex: 1; min-width: 0; }
.episode-info h4 { margin: 0; font-size: .97rem; font-weight: 550; letter-spacing: -.005em; }
.episode-info p { margin: 3px 0 0; font-size: .82rem; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.episode-info .progress { margin-top: 9px; max-width: 220px; height: 2px; }
.episode-state { flex-shrink: 0; font-size: .78rem; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
.episode-row.is-active .episode-state { color: var(--accent); font-weight: 600; }
.episode-state .check { width: 15px; height: 15px; }
.episode-playing-icon { flex-shrink: 0; color: var(--accent); font-size: .78rem; font-weight: 600; }

/* ---------------- Error page (404) ---------------- */

.error-page { min-height: 100svh; display: flex; align-items: center; padding-top: var(--header-h); }
.error-page-inner { max-width: 600px; padding-top: 60px; padding-bottom: 60px; }
.error-code { font-size: clamp(5rem, 18vw, 10rem); font-weight: 700; letter-spacing: -.06em; line-height: .9; margin: 0 0 24px; color: transparent; -webkit-text-stroke: 1.5px var(--line-strong); }
.error-page-inner h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 14px; }
.error-page-inner p { color: var(--text-dim); font-size: 1.04rem; margin-bottom: 30px; }
.error-page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------- Responsive ---------------- */

@media (max-width: 960px) {
  .header-links { display: none; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-poster { display: none; }
  .studio-grid { grid-template-columns: 1fr; }
  .studio-emblem { display: none; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-form { position: static; }
}

@media (max-width: 760px) {
  .project-hero-inner { grid-template-columns: 1fr; align-items: start; }
  .project-poster { width: 160px; }
}

@media (max-width: 640px) {
  :root { --header-h: 58px; }
  .site-header { gap: 12px; }
  .brand-name { letter-spacing: .24em; }
  .user-name { display: none; }
  .user-chip .btn { padding: 8px 12px; }

  .hero { min-height: 78svh; padding-bottom: 48px; }
  .section { padding: 52px 0; }

  .catalog-toolbar { flex-direction: column; align-items: stretch; }
  .catalog-tools { width: 100%; }
  .catalog-search { flex: 1; }
  .catalog-search input, .catalog-search input:focus { width: 100%; }
  .catalog-search kbd { display: none; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 14px; }
  .project-card h3 { font-size: .94rem; }
  .rail .project-card { width: 140px; }

  .comment-form { flex-direction: column; align-items: stretch; }
  .comment-form .comment-name { width: 100%; max-height: none; }
  .comment-form .btn { width: 100%; }
  .reply-form { flex-direction: column; }
  .reply-form .btn { width: 100%; }
  .reply-list { padding-left: 12px; }

  .episode-row { padding: 12px 14px; gap: 12px; }
  .episode-state span.txt { display: none; }

  .cp-bar { padding: 26px 6px 6px; }
  .cp-buttons { gap: 0; }
  .cp-btn { width: 38px; height: 38px; }
  .cp-vol-input { display: none; }
  .cp-clock { font-size: .72rem; margin-left: 2px; }
  .cp-pip { display: none; }
  .cp-next { bottom: 70px; right: 10px; padding: 12px 14px; }

  .modal { padding: 26px 20px; }
  .admin-row { flex-wrap: wrap; }
  .admin-row-actions { width: 100%; justify-content: flex-end; }
  .season-builder-episode { flex-direction: column; align-items: stretch !important; }
  .posts-grid { grid-template-columns: 1fr; }
  .post-hero { padding-top: calc(var(--header-h) + 36px); }
  .section-block { padding: 28px 0; }
  .toast-host { bottom: 18px; }
}

/* ---------------- Pre-roll ---------------- */
.preroll-start {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: #000 center/contain no-repeat;
}
.preroll-play {
  width: 72px; height: 72px; box-sizing: border-box; border-radius: 50%; cursor: pointer;
  padding: 17px; display: flex; align-items: center; justify-content: center;
  background: rgba(10,10,12,.5); border: 1px solid rgba(255,255,255,.7);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: transform .2s var(--ease), background .2s;
}
.preroll-play:hover { transform: scale(1.07); background: rgba(10,10,12,.7); }
.preroll-play img { width: 100%; height: 100%; object-fit: contain; display: block; }
.preroll-video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.preroll-shield { position: absolute; inset: 0; z-index: 2; } /* блокирует клики по YouTube-рекламе */
.preroll-chrome {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  background: linear-gradient(transparent, rgba(0,0,0,.78)); color: #fff; font-size: .82rem;
}
.preroll-badge { background: rgba(255,255,255,.18); color: #fff; padding: 3px 10px; border-radius: 999px; font-weight: 600; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; }
.preroll-time { opacity: .8; font-variant-numeric: tabular-nums; }
.preroll-skip {
  margin-left: auto; background: rgba(0,0,0,.55); color: #fff; border: 1px solid rgba(255,255,255,.4);
  padding: 9px 16px; border-radius: 999px; cursor: pointer; font: inherit;
}
.preroll-skip:disabled { opacity: .6; cursor: default; }
.preroll-skip:not(:disabled):hover { background: #fff; color: #000; }
.ep-preroll-label { font-size: .75rem; opacity: .75; margin-top: 8px; }

/* новость без обложки — карточка с рамкой, чтобы сетка не «проваливалась» */
.post-card:not(:has(.post-card-cover)) {
  padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
  transition: border-color .2s, background .2s;
}
.post-card:not(:has(.post-card-cover)):hover { border-color: var(--line-strong); background: var(--surface-2); }

/* свёрнутые комментарии + кнопка «Показать все отзывы» */
.comment.is-collapsed { display: none !important; }
.comments-more { margin-top: 24px; }
/* статус синхронизации с YouTube теперь виден, чтобы было понятно, если что-то не так */
#youtube-comments [data-youtube-status]:not(:empty) { margin: 0 0 16px; }
.social-link-text { display: flex; flex-direction: column; gap: 2px; }
.social-link-text small { font-size: .78rem; font-weight: 400; color: var(--text-dim); }
