/* Лента видеоновостей: вертикальная прокрутка «по одному ролику», как в TikTok.
   Видео смотрят в темноте, поэтому у ленты одна тёмная тема независимо от настроек устройства. */
@font-face { font-family: "Onest"; font-style: normal; font-weight: 300 800; font-display: swap; src: url(/feed/fonts/onest-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 300 800; font-display: swap; src: url(/feed/fonts/onest-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/feed/fonts/unbounded-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/feed/fonts/unbounded-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #07080f;
  --fg: #ffffff;
  --dim: rgba(255, 255, 255, .78);
  --faint: rgba(255, 255, 255, .56);
  --glass: rgba(14, 15, 30, .52);
  --line: rgba(255, 255, 255, .18);
  --accent: #c4b5fd;
  --grad: linear-gradient(135deg, #4f46e5, #7c3aed 55%, #c026d3);
  --font: "Onest", "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  --font-display: "Unbounded", "Onest", "Segoe UI", sans-serif;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.nojs { padding: 24px; text-align: center; }

/* лента: каждый ролик — ровно один экран, прокрутка останавливается на каждом */
.feed { height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior-y: contain; }
.feed::-webkit-scrollbar { display: none; }
.slide { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: grid; place-items: center; overflow: hidden; overflow: clip; }
/* размытая обложка за роликом — в своей рамке: выступающий за край фон не должен давать экрану прокручиваться */
.bgw { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.bg { position: absolute; inset: -60px; background: center / cover no-repeat; filter: blur(40px) brightness(.42) saturate(1.25); }
/* ролик показываем целиком: в новостях плашка и субтитры вшиты в кадр, обрезать края нельзя */
.stage { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; overflow: hidden; overflow: clip; }
.vbox { position: relative; flex: 1 1 auto; min-height: 0; }
.vbox video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, .86) 0%, rgba(0, 0, 0, .5) 13%, transparent 26%),
              linear-gradient(to bottom, rgba(0, 0, 0, .5), transparent 15%); }
.tap { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; background: transparent; cursor: pointer; }
.tap:focus-visible { outline-offset: -4px; }
.paused { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(0, 0, 0, .42); backdrop-filter: blur(6px); pointer-events: none; }
.paused svg { width: 34px; height: 34px; margin-left: 4px; }
.spin { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .22); border-top-color: #fff; animation: spin .8s linear infinite; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.broken { position: absolute; inset: auto 16px 50% 16px; text-align: center; color: var(--dim); pointer-events: none; }
.prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .16); pointer-events: none; }
.prog i { display: block; height: 100%; width: 0; background: #fff; border-radius: 0 2px 2px 0; }

/* подпись новости: компактно внизу, чтобы не закрывать вшитые субтитры; «ещё» раскрывает текст целиком */
.panel { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; gap: 12px;
  padding: 0 12px calc(16px + var(--bottom)) 16px; pointer-events: none; text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
.panel > * { pointer-events: auto; }
.info { flex: 1; min-width: 0; display: grid; gap: 5px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 10px; font-size: 12.5px; color: var(--dim); }
.meta b { color: var(--fg); font-weight: 600; }
/* метка «ИИ-видео» — в углу кадра, под названием ленты */
.ai { position: absolute; left: 14px; top: calc(52px + var(--top)); font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .38); border: 1px solid var(--line); color: var(--fg); backdrop-filter: blur(6px); pointer-events: none; }
@media (min-aspect-ratio: 3/4) { .ai { top: 52px; } }
.info h2 { margin: 0; font-size: 16.5px; line-height: 1.3; font-weight: 700; text-wrap: balance;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.text { display: none; margin: 0; font-size: 14px; color: var(--dim); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.more { border: 0; background: none; padding: 0; font-size: 13px; font-weight: 600; color: var(--fg); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .16); border: 1px solid var(--line);
  backdrop-filter: blur(8px); color: var(--fg); text-decoration: none; font-size: 12.5px; font-weight: 600; text-shadow: none; }
.link:hover { background: rgba(255, 255, 255, .26); }
.link svg { width: 13px; height: 13px; }
.panel.open { max-height: 72%; overflow-y: auto; padding-top: 18px; background: rgba(7, 8, 15, .88); backdrop-filter: blur(10px); align-items: flex-start; }
.panel.open h2 { -webkit-line-clamp: unset; display: block; }
.panel.open .text { display: block; }

/* кнопки: звук и «поделиться» */
.rail { display: grid; gap: 10px; }
.rail button { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; padding: 0; cursor: pointer;
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); transition: transform .15s; }
.rail button:hover { transform: scale(1.07); }
.rail svg { width: 20px; height: 20px; }

/* высокий экран телефона: под роликом остаётся место — подпись уходит туда и ничего в кадре не закрывает */
@media (max-aspect-ratio: 100/206) {
  .vbox { flex: none; width: 100%; aspect-ratio: 9 / 16; }
  .shade { background: linear-gradient(to bottom, rgba(0, 0, 0, .5), transparent 15%); }
  .panel { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; align-items: flex-start; padding-top: 12px; background: var(--bg); text-shadow: none; }
  .text { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  .panel.open { position: absolute; max-height: 75%; }
  .panel.open .text { -webkit-line-clamp: unset; display: block; }
}
/* широкий экран: вертикальный «телефон» по центру, вокруг размытая обложка */
@media (min-aspect-ratio: 3/4) {
  .stage { width: auto; height: calc(100% - 32px); aspect-ratio: 9 / 16; max-width: calc(100% - 136px); border-radius: 18px; background: #000;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06); }
}

svg.ic { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.ic .f { fill: currentColor; stroke: none; }

/* верхняя строка: название ленты и звук */
.top { position: fixed; left: 0; right: 0; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(12px + var(--top)) 16px 0; pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { display: inline-flex; align-items: baseline; gap: 8px; color: var(--fg); text-decoration: none; text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
.brand b { font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.brand span { font-size: 13px; color: var(--dim); }
.sound { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; padding: 8px 14px 8px 11px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--glass); backdrop-filter: blur(10px); cursor: pointer; font-size: 13px; font-weight: 600; margin-left: auto; }
.sound svg { width: 18px; height: 18px; }
@media (min-aspect-ratio: 3/4) {
  .top { left: 50%; right: auto; width: min(calc((100vh - 32px) * 9 / 16), calc(100vw - 136px)); transform: translateX(-50%); top: 16px; padding-top: 12px; }
}

.fresh { position: fixed; left: 50%; top: calc(60px + var(--top)); z-index: 6; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border: 0; border-radius: 999px; background: var(--grad); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer;
  box-shadow: 0 10px 30px rgba(124, 58, 237, .45); }
.fresh svg { width: 16px; height: 16px; }

/* стрелки на компьютере — сбоку от ролика */
.nav { position: fixed; right: 20px; top: 50%; transform: translateY(-50%); z-index: 5; display: none; gap: 12px; }
.nav button { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(10px); cursor: pointer; display: grid; place-items: center; }
.nav button:disabled { opacity: .35; cursor: default; }
.nav svg { width: 22px; height: 22px; }
@media (min-aspect-ratio: 3/4) and (min-width: 640px) and (hover: hover) { .nav { display: grid; } }

/* последний экран, пустая лента, ошибка */
.note { display: grid; gap: 14px; justify-items: center; text-align: center; padding: 24px; max-width: 340px; position: relative; }
.note b { font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 1.3; }
.note span { color: var(--dim); }
.note button { border: 0; border-radius: 999px; padding: 11px 20px; background: var(--grad); color: #fff; font-weight: 600; cursor: pointer; }

.toast { position: fixed; left: 50%; bottom: calc(90px + var(--bottom)); z-index: 7; transform: translateX(-50%); max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 12px; background: rgba(20, 21, 40, .92); border: 1px solid var(--line); font-size: 14px; word-break: break-word; }

@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } .rail i { transition: none; } }
