/* a1 — центр українського телебачення.
   Дизайн-система перенесена с донора start.ru (задание владельца 22.08.2026):
   фон #14161A, текст #F2F2F2, вторичный #757D8A, острые радиусы 2/4/8/12,
   дисплей — узкий гротеск капсом с трекингом, двухъярусная шапка, чипы на карточках.
   Роли, не значения: акцент — наш красный из логотипа, Druk → Oswald, Proxima → Manrope. */

@font-face {
  font-family: "Manrope";
  src: url("/static/fonts/manrope-v20-cyrillic_cyrillic-ext_latin-regular.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("/static/fonts/manrope-v20-cyrillic_cyrillic-ext_latin-500.woff2") format("woff2");
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("/static/fonts/manrope-v20-cyrillic_cyrillic-ext_latin-600.woff2") format("woff2");
  font-weight: 600; font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("/static/fonts/manrope-v20-cyrillic_cyrillic-ext_latin-700.woff2") format("woff2");
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: "Oswald";
  src: url("/static/fonts/oswald-v57-cyrillic_cyrillic-ext_latin-500.woff2") format("woff2");
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: "Oswald";
  src: url("/static/fonts/oswald-v57-cyrillic_cyrillic-ext_latin-600.woff2") format("woff2");
  font-weight: 600; font-display: swap;
}

:root {
  --bg: #14161a;
  --surface: rgba(42, 47, 55, .36);
  --surface-solid: #252930;
  --overlay-chip: rgba(20, 22, 26, .5);
  --line: rgba(242, 242, 242, .1);
  --text: #f2f2f2;
  --text-dim: #757d8a;
  --accent: #e8291c;
  --accent-press: #c81f14;
  --r-chip: 2px;
  --r-small: 4px;
  --r-card: 8px;
  --r-panel: 12px;
  --pad: clamp(16px, 3.9vw, 56px);
  --display: "Oswald", "Manrope", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 "Manrope", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: inherit; }

/* ── Шапка: два яруса, как у донора ── */
/* Как у донора: шапка растворена в странице. На главной поверх hero она
   полностью прозрачна (подложка картинки затемнена) и набирает фон по мере
   прокрутки — к списку каналов становится непрозрачной. */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  padding: 0 var(--pad);
  background: rgba(20, 22, 26, var(--topbar-alpha, 1));
}
body { padding-top: 124px; }
body.has-hero { padding-top: 0; }
body.has-hero .topbar { --topbar-alpha: 0; }
.row, .channel-meta { scroll-margin-top: 132px; }
.topbar-row {
  display: flex; align-items: center; gap: 24px;
  height: 72px;
}
.brand { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.brand img { display: block; }
.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border-radius: var(--r-card);
  height: 40px; padding: 0 16px;
  color: var(--text-dim);
  width: clamp(220px, 36vw, 524px);
  transition: background .15s;
}
.search:focus-within { background: rgba(42, 47, 55, .7); color: var(--text); }
.search input {
  background: none; border: 0; outline: 0; color: var(--text);
  font: inherit; width: 100%;
}
.search input::placeholder { color: var(--text-dim); }
.topbar-note {
  margin-left: auto; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text); font-size: 16px;
}
.subnav {
  display: flex; gap: 28px; overflow-x: auto;
  padding: 4px 0 14px; scrollbar-width: none;
}
.subnav a {
  text-decoration: none; font-size: 16px; line-height: 24px;
  color: var(--text); white-space: nowrap; opacity: .9;
}
.subnav a:hover { opacity: 1; color: #fff; }

/* ── Hero: промо в духе донора ── */
.hero {
  position: relative; overflow: hidden;
  min-height: clamp(520px, 82vh, 820px);
  display: flex; align-items: flex-end;
}
.hero-backdrop { position: absolute; inset: 0; }
.hero-backdrop img {
  width: 100%; height: 100%; object-fit: cover; object-position: 70% center;
}
.hero-backdrop::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(20, 22, 26, .92) 12%, rgba(20, 22, 26, .72) 42%, rgba(20, 22, 26, .12) 76%, rgba(20, 22, 26, .4) 100%),
    linear-gradient(180deg, rgba(20, 22, 26, .78) 0%, rgba(20, 22, 26, .2) 22%, rgba(20, 22, 26, 0) 42%, rgba(20, 22, 26, .55) 78%, var(--bg) 99%);
}
.hero-inner {
  position: relative; padding: 0 var(--pad) clamp(40px, 7vh, 72px);
  max-width: 700px;
}
.hero-title {
  font-family: var(--display);
  font-weight: 600; font-size: clamp(34px, 4.5vw, 64px);
  line-height: 1.0; letter-spacing: .045em; text-transform: uppercase;
  margin: 0 0 16px;
}
.hero-sub {
  font-size: clamp(16px, 1.5vw, 20px); line-height: 1.45;
  color: var(--text); opacity: .92; margin: 0 0 28px; max-width: 480px;
}
.hero-live {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff;
  font-weight: 700; font-size: 12px; line-height: 1;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 8px; border-radius: var(--r-chip);
  margin: 0 0 18px;
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; }
@media (prefers-reduced-motion: no-preference) {
  .live-dot { animation: live-pulse 2s infinite; }
  @keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
  }
}
.btn-play {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--accent); color: #fff; text-decoration: none;
  font-family: var(--display);
  font-weight: 500; font-size: 17px; letter-spacing: .08em; text-transform: uppercase;
  height: 48px; padding: 0 36px; border-radius: 24px; border: 0; cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn-play:hover { background: var(--accent-press); }
.btn-play:active { transform: scale(.98); }

/* ── Ряды каналов ── */
.catalog-note { color: var(--text-dim); font-size: 14px; margin: 8px var(--pad) 0; }
.row { padding: 22px 0 10px; }
.row-head {
  margin: 0 var(--pad) 16px;
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
}
.row-title {
  font-weight: 700; font-size: 20px; line-height: 24px;
  margin: 0; color: var(--text);
}
.row-sub { margin: 6px 0 0; font-size: 16px; color: var(--text-dim); flex-basis: 100%; }
.row-more {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); color: var(--text);
  border: 0; border-radius: var(--r-card); cursor: pointer;
  font: 500 14px/1 "Manrope", sans-serif;
  padding: 8px 12px;
  transition: background .15s;
}
.row-more:hover { background: rgba(42, 47, 55, .7); }
.row-more svg { transition: transform .15s; }
.row.expanded .row-more svg { transform: rotate(180deg); }
/* Сетка без горизонтального скролла, как у донора; свёрнутый ряд — одна линия */
.row-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 24px 20px; padding: 0 var(--pad);
}
@media (max-width: 1280px) { .row-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 960px)  { .row-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px)  { .row-grid { grid-template-columns: repeat(2, 1fr); } }
.card {
  text-decoration: none;
  display: block; outline-offset: 3px;
}
.card.folded { display: none; }
.card-cover {
  position: relative; display: block; aspect-ratio: 16 / 9;
  border-radius: var(--r-card); overflow: hidden;
  background: var(--surface-solid);
  transition: transform .16s ease, box-shadow .16s ease;
}
.card-cover > img:first-child { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-live {
  position: absolute; left: 8px; bottom: 8px;
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 600; line-height: 1;
  letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 6px; border-radius: var(--r-chip);
  opacity: 0; transition: opacity .15s;
}
.card:hover .card-live, .card:focus-visible .card-live { opacity: 1; }
@media (hover: none) { .card-live { display: none; } }
.card-logo {
  position: absolute; right: 8px; top: 8px;
  width: 34px; height: 34px; object-fit: contain;
  background: rgba(242, 242, 242, .92); border-radius: var(--r-small); padding: 3px;
}
.card:hover .card-cover, .card:focus-visible .card-cover {
  transform: scale(1.03);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
}
.card-name {
  display: block; margin-top: 10px;
  font-weight: 600; font-size: 16px; line-height: 1.3; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-genre {
  display: block; margin-top: 3px;
  font-size: 12px; line-height: 14px; color: var(--text-dim);
}
.search-empty { color: var(--text-dim); margin: 40px var(--pad); }

/* ── Страница канала ── */
.player-stage { padding: clamp(10px, 2vw, 28px) var(--pad) 0; }
.player-shell {
  position: relative; aspect-ratio: 16 / 9; max-height: 74vh;
  margin: 0 auto; max-width: 1200px;
  border-radius: var(--r-panel); overflow: hidden;
  background: #0b0c0f;
}
.player-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.player-start {
  position: absolute; inset: 0; margin: auto;
  width: 88px; height: 88px; border-radius: 50%;
  border: 0; cursor: pointer; color: #fff;
  background: color-mix(in srgb, var(--accent) 94%, transparent);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s, background .15s;
  box-shadow: 0 8px 40px rgba(232, 41, 28, .4);
}
.player-start:hover { transform: scale(1.05); background: var(--accent-press); }
.player-start svg { margin-left: 5px; }
#player-video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.player-controls {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 26px 14px 12px;
  background: linear-gradient(180deg, transparent, rgba(10, 11, 14, .78));
}
.player-controls button {
  background: none; border: 0; color: #fff; cursor: pointer;
  padding: 6px; border-radius: var(--r-small); display: flex;
}
.player-controls button:hover { background: rgba(242, 242, 242, .14); }
#ctl-volume { width: 90px; accent-color: var(--accent); }
.ctl-live {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent); border-radius: var(--r-chip);
  padding: 4px 7px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.ctl-live .live-dot { background: #fff; }
.ctl-spacer { flex: 1; }
.player-controls select {
  background: var(--overlay-chip); color: #fff;
  border: 1px solid rgba(242, 242, 242, .25); border-radius: var(--r-small);
  font: 600 12.5px "Manrope", sans-serif; padding: 5px 8px;
}
.player-error {
  position: absolute; inset: auto 0 0; margin: 0;
  padding: 14px var(--pad); text-align: center;
  background: rgba(20, 22, 26, .92); color: var(--text);
}
.player-error a { color: #ffb4ae; }

/* ── Зепінг і обране ── */
.zapping {
  display: flex; align-items: stretch; gap: 12px;
  max-width: 1200px; margin: 14px auto 0; padding: 0 var(--pad);
}
.zap {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--surface); color: var(--text); text-decoration: none;
  border: 0; border-radius: var(--r-card); cursor: pointer;
  font: 600 14px/1.2 "Manrope", sans-serif; padding: 10px 16px;
  transition: background .15s;
}
.zap:hover { background: rgba(42, 47, 55, .7); }
.zap span { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.zap small { font-size: 11px; font-weight: 500; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; }
.zap-next { margin-left: auto; text-align: right; }
.zap-next span { text-align: right; }
.zap-fav.is-on { background: var(--accent); color: #fff; }
.zap-fav.is-on svg path { fill: currentColor; }

/* ── Програма передач ── */
.epg-now {
  margin: 18px 0 0; padding: 14px 16px;
  background: var(--surface); border-radius: var(--r-card);
  max-width: 760px;
}
.epg-label {
  margin: 0 0 4px; font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--accent);
}
.epg-title { margin: 0; font-size: 17px; font-weight: 700; }
.epg-desc { margin: 6px 0 0; font-size: 14px; color: var(--text-dim); line-height: 1.5; }
.epg-next { margin: 18px 0 0; max-width: 760px; }
.epg-heading { font-size: 16px; font-weight: 700; margin: 0 0 8px; }
.epg-next ul { list-style: none; margin: 0; padding: 0; }
.epg-next li {
  display: flex; gap: 14px; padding: 7px 0;
  border-bottom: 1px solid var(--line); font-size: 14.5px;
}
.epg-next li:last-child { border-bottom: 0; }
.epg-time { color: var(--text-dim); font-variant-numeric: tabular-nums; min-width: 46px; }
.hero-now { margin: -8px 0 20px; font-size: 15px; color: var(--text); opacity: .85; }
.player-fallback {
  position: absolute; left: 12px; top: 12px; margin: 0;
  background: var(--overlay-chip); color: var(--text);
  font-size: 12px; padding: 6px 10px; border-radius: var(--r-small);
}

.channel-meta { padding: 22px var(--pad) 8px; max-width: 1200px; margin: 0 auto; width: 100%; }
.channel-title { display: flex; align-items: center; gap: 16px; }
.channel-title img {
  background: rgba(242, 242, 242, .92); border-radius: var(--r-small); padding: 5px;
}
.channel-title h1 {
  font-family: var(--display);
  font-weight: 600; font-size: clamp(24px, 3vw, 36px); line-height: 1.1;
  letter-spacing: .03em; text-transform: uppercase; margin: 0;
}
.channel-title p { margin: 5px 0 0; color: var(--text-dim); font-size: 14px; }
.channel-title p a { color: var(--text-dim); }
.channel-about {
  margin: 14px 0 0; max-width: 760px;
}
.channel-about p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--text); opacity: .88; }
.about-src { margin-top: 6px !important; font-size: 12px !important; color: var(--text-dim) !important; opacity: 1 !important; }
.about-src a { color: var(--text-dim); }

/* ── 404 ── */
.missing { padding: 80px var(--pad); max-width: 620px; }
.missing h1 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(26px, 3.4vw, 40px); line-height: 1.1;
  letter-spacing: .04em; text-transform: uppercase;
}
.missing p { color: var(--text-dim); margin-bottom: 28px; }

/* ── Футер ── */
.footer {
  margin-top: 48px; padding: 30px var(--pad) 38px;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between;
  color: var(--text-dim); font-size: 13px;
}
.footer a { color: var(--text-dim); }
.footer-brand { display: flex; align-items: center; gap: 14px; max-width: 520px; }
.footer-brand p { margin: 0; }
.footer-legal p { margin: 0 0 6px; text-align: right; }
.footer-dev { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.footer-dev img { display: inline-block; vertical-align: middle; opacity: .8; }

@media (max-width: 720px) {
  body { padding-top: 108px; }
  body.has-hero { padding-top: 0; }
  /* На телефоне: соседние каналы в одну строку, обране — второй */
  .zapping { flex-wrap: wrap; gap: 8px; }
  .zap { flex: 1 1 0; justify-content: center; padding: 10px 12px; font-size: 13px; }
  .zap-prev { order: 1; }
  .zap-next { order: 2; margin-left: 0; }
  .zap-fav { order: 3; flex-basis: 100%; }
  .zap small { display: none; }
  .zap span { text-align: center; }
  .topbar-row { height: 60px; gap: 12px; }
  .topbar-note { display: none; }
  .subnav { gap: 20px; }
  .footer { flex-direction: column; }
  .footer-legal p, .footer-dev { text-align: left; justify-content: flex-start; }
  #ctl-volume { display: none; }
}
