:root {
  --bg: #1c1724;
  --bg-deep: #14101a;
  --surface: rgba(36, 30, 44, 0.72);
  --surface-2: rgba(48, 40, 58, 0.88);
  --text: #f4f0f7;
  --muted: #a79bb3;
  --accent: #ff8a2b;
  --accent-2: #ff4d2e;
  --primary: #ff8a2b;
  --ok: #3ecf8e;
  --radius: 14px;
  --focus: #ffd089;
  --page-gutter: clamp(14px, 3vw, 48px);
  --font: "Manrope", "Segoe UI", sans-serif;
  --font-display: "Unbounded", "Manrope", sans-serif;
  --glass: rgba(20, 16, 26, 0.42);
  --line: rgba(255, 255, 255, 0.1);
}

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(255, 138, 43, 0.16), transparent 55%),
    radial-gradient(900px 500px at 88% 8%, rgba(120, 80, 180, 0.14), transparent 50%),
    linear-gradient(180deg, #241c2e 0%, var(--bg) 28%, var(--bg-deep) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  position: relative;
}

.page-glow {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(255, 77, 46, 0.07), transparent 70%);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select { font: inherit; }

:where(a, button, input, select, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 2px var(--bg-deep);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px; left: 8px;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #1a0f05;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- Шапка ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: max(10px, env(safe-area-inset-top)) max(var(--page-gutter), env(safe-area-inset-right))
    10px max(var(--page-gutter), env(safe-area-inset-left));
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, backdrop-filter 0.2s;
}

.topbar.is-scrolled {
  background: rgba(20, 16, 26, 0.78);
  border-bottom-color: var(--line);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

.page-home .topbar:not(.is-scrolled) {
  position: absolute;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(12, 8, 16, 0.55), transparent);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 1440px;
  margin: 0 auto;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}
.logo-mark {
  display: grid;
  place-items: center;
  filter: drop-shadow(0 6px 16px rgba(255, 77, 46, 0.35));
}
.logo-word {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #fff;
  line-height: 1;
}
.logo-kp {
  background: linear-gradient(120deg, #fff 30%, #ffd089 55%, #ff8a2b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.searchbar {
  display: flex;
  flex: 1;
  max-width: 420px;
  margin-left: auto;
  gap: 0;
  position: relative;
}
.searchbar input {
  flex: 1;
  min-width: 0;
  padding: 11px 46px 11px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 15px;
}
.searchbar input::placeholder { color: rgba(255, 255, 255, 0.45); }
.searchbar input:focus {
  border-color: rgba(255, 138, 43, 0.55);
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}
.searchbar button {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.searchbar button:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

.btn {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
}
.btn:hover { background: rgba(255, 255, 255, 0.14); }
.btn-primary { background: var(--primary); border-color: var(--primary); font-weight: 700; color: #1a0f05; }
.btn-accent { background: var(--accent); border-color: var(--accent); font-weight: 700; color: #1a0f05; }
.btn-lg { padding: 14px 26px; font-size: 17px; }
.btn-glass {
  background: rgba(12, 8, 16, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn-glass:hover { background: rgba(255, 255, 255, 0.14); }

.topbar nav {
  display: flex;
  gap: 6px;
  align-items: center;
}
.topbar nav a {
  color: rgba(255, 255, 255, 0.72);
  padding: 8px 12px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 14px;
  border-radius: 999px;
  position: relative;
}
.topbar nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.topbar nav a.is-active { color: #fff; }
.topbar nav a.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.tg-ok { color: var(--ok) !important; }

main {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px var(--page-gutter) 72px;
}
.page-home main {
  max-width: none;
  padding: 0;
}
.home-stack {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px var(--page-gutter) 72px;
}
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 24px max(var(--page-gutter), env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(var(--page-gutter), env(safe-area-inset-left));
}

/* ---------- Общие ---------- */

.muted { color: var(--muted); }
.small { font-size: 13px; }
.alert {
  background: #3a2230;
  border: 1px solid #6b3048;
  color: #ffb3c0;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin: 16px 0;
}

.badge {
  display: inline-block;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin: 4px 4px 0 0;
}
.badge-new { background: #33230f; border-color: var(--accent); color: var(--accent); }
.badge-ok { background: #12291f; border-color: var(--ok); color: var(--ok); }

/* ---------- Cinematic hero ---------- */

.home-hero {
  position: relative;
  height: clamp(480px, 68vh, 720px);
  margin: 0;
  overflow: hidden;
  background: #16101c;
  color: #fff;
  isolation: isolate;
}
.home-hero-slides {
  position: absolute;
  inset: 0;
}
.home-hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.55s ease, visibility 0.55s;
  z-index: 0;
}
.home-hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}
.home-hero-media,
.home-hero-shade {
  position: absolute;
  inset: 0;
}
.home-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  transform: scale(1.03);
}
.home-hero-slide.is-active .home-hero-media img {
  animation: heroKen 14s ease-out forwards;
}
@keyframes heroKen {
  from { transform: scale(1.08); }
  to { transform: scale(1.02); }
}
.home-hero-shade {
  z-index: 1;
  background:
    linear-gradient(105deg,
      rgba(16, 12, 22, 0.94) 0%,
      rgba(16, 12, 22, 0.78) 32%,
      rgba(16, 12, 22, 0.28) 58%,
      rgba(16, 12, 22, 0.08) 100%),
    linear-gradient(180deg,
      rgba(16, 12, 22, 0.45) 0%,
      transparent 26%,
      transparent 58%,
      rgba(22, 16, 28, 0.88) 100%);
}
.home-hero-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 0;
  padding: 0 var(--page-gutter) 56px;
  padding-left: max(var(--page-gutter), calc((100vw - 1440px) / 2 + var(--page-gutter)));
  padding-right: max(var(--page-gutter), calc((100vw - 1440px) / 2 + var(--page-gutter)));
  max-width: none;
  margin: 0;
  box-sizing: border-box;
  width: 100%;
}
.home-hero-kind {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 700;
}
.home-hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(32px, 5.5vw, 58px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-wrap: balance;
  max-width: min(14ch, 90%);
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}
.home-hero-desc {
  margin: 14px 0 0;
  max-width: 42ch;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}
.home-hero-nav {
  position: absolute;
  top: 50%;
  z-index: 4;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(12, 8, 16, 0.35);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.home-hero-prev { left: max(12px, env(safe-area-inset-left)); }
.home-hero-next { right: max(12px, env(safe-area-inset-right)); }
.home-hero-nav:hover { background: rgba(255, 255, 255, 0.16); }
.home-hero-dots {
  position: absolute;
  left: 50%;
  bottom: 20px;
  z-index: 4;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  align-items: center;
}
.home-hero-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
}
.home-hero-dots button[aria-selected="true"] {
  width: 22px;
  background: linear-gradient(90deg, var(--accent), #ffc14d);
}

/* ---------- Герой fallback ---------- */

.hero { text-align: center; padding: 56px 16px; }
.hero-gradient {
  background:
    radial-gradient(ellipse 70% 90% at 50% -10%, rgba(255, 138, 43, .22), transparent),
    radial-gradient(ellipse 40% 60% at 85% 10%, rgba(140, 90, 200, .14), transparent);
  border-radius: 20px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.15;
  margin-top: 0;
}
.hero p { color: var(--muted); max-width: 560px; margin: 16px auto 28px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Главная в стиле кинотеатра ---------- */

.home-section { margin-top: 36px; }
.home-section:first-child { margin-top: 8px; }
.home-section h2 {
  margin: 0 0 14px;
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.home-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.home-section-head h2 { margin: 0; }
.home-section-more {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}
.home-section-more:hover { color: var(--text); }

.home-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.home-row::-webkit-scrollbar { display: none; }

.home-row-continue { gap: 16px; }
.continue-card {
  flex: 0 0 min(280px, 72vw);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.continue-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #1a1d27;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.continue-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.continue-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  opacity: 0;
  background: rgba(0, 0, 0, 0.28);
  transition: opacity 0.15s;
}
.continue-card:hover .continue-play { opacity: 1; }
.continue-play svg {
  width: 44px;
  height: 44px;
  padding: 11px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
}
.continue-time {
  position: absolute;
  right: 10px;
  bottom: 12px;
  z-index: 1;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}
.continue-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.22);
}
.continue-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ff8a2b, #ffc14d);
}
.continue-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.continue-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: -4px;
}

.home-row-chips { gap: 10px; }
.tv-chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.tv-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 138, 43, 0.35);
  transform: translateY(-1px);
}
.tv-chip img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.35);
}

.home-row-posters { gap: 14px; }
.home-row-posters .poster-card {
  flex: 0 0 min(150px, 38vw);
  scroll-snap-align: start;
}
.home-row-posters .poster-wrap {
  border-radius: 12px;
}
.poster-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 138, 43, 0.95);
  color: #1a0f05;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
}

.rating-hi { color: #3ecf8e; }
.rating-mid { color: #ffc14d; }
.rating-lo { color: #ff7b7b; }

/* ---------- Карточки «мои сериалы» / поиск ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 20px;
  margin-top: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid #262a38;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .15s, border-color .15s;
}
.card:hover, .card:focus-visible { transform: translateY(-3px); border-color: var(--primary); }
.card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; }
.card-body { padding: 14px; }
.card-body h3 { margin: 0 0 4px; font-size: 16px; }
.card-body p { margin: 4px 0; }

.progress {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin: 8px 0 4px;
}
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--ok)); }

/* ---------- Популярное (ряды постеров) ---------- */

.popular { margin-top: 40px; }
.popular h2 { margin-bottom: 14px; }
.poster-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}
.poster-card { display: flex; flex-direction: column; gap: 2px; }
.poster-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #262a38;
  transition: transform .15s, border-color .15s;
}
.poster-card:hover .poster-wrap,
.poster-card:focus-visible .poster-wrap { transform: translateY(-3px); border-color: var(--primary); }
.poster-wrap img { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; }
.rating {
  position: absolute;
  top: 8px; left: 8px;
  background: rgba(15, 17, 23, .85);
  color: var(--ok);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}
.poster-title {
  font-size: 14px;
  font-weight: 600;
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Карточка фильма / сериала (hero как в онлайн-кинотеатре) ---------- */

.show-hero {
  position: relative;
  width: 100vw;
  margin: -32px calc(50% - 50vw) 36px;
  min-height: clamp(460px, 68vh, 680px);
  overflow: hidden;
  background: #050506;
  color: #fff;
}

.show-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.show-hero-bg img {
  position: absolute;
  top: 0;
  right: 0;
  width: min(72%, 1100px);
  height: 100%;
  object-fit: cover;
  object-position: center top;
  max-width: none;
}

.show-hero.has-poster-bg .show-hero-bg img {
  width: min(58%, 780px);
  right: -2%;
  transform: scale(1.08);
  filter: saturate(1.05) contrast(1.05);
  opacity: 0.92;
}

.show-hero-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg,
      #050506 0%,
      #050506 30%,
      rgba(5, 5, 6, 0.94) 44%,
      rgba(5, 5, 6, 0.55) 60%,
      rgba(5, 5, 6, 0.12) 80%,
      transparent 100%),
    linear-gradient(180deg,
      rgba(5, 5, 6, 0.4) 0%,
      transparent 26%,
      transparent 68%,
      rgba(5, 5, 6, 0.9) 100%);
}

.show-hero.has-poster-bg .show-hero-shade {
  background:
    linear-gradient(90deg,
      #050506 0%,
      #050506 36%,
      rgba(5, 5, 6, 0.88) 52%,
      rgba(5, 5, 6, 0.4) 72%,
      transparent 100%),
    linear-gradient(180deg,
      rgba(5, 5, 6, 0.45) 0%,
      transparent 30%,
      transparent 65%,
      rgba(5, 5, 6, 0.92) 100%);
}

.show-hero:not(.has-backdrop):not(.has-poster-bg) .show-hero-shade {
  background: radial-gradient(120% 80% at 70% 20%, #1a2030 0%, #050506 55%);
}

.show-hero-back {
  position: absolute;
  z-index: 2;
  top: max(14px, env(safe-area-inset-top));
  left: max(var(--page-gutter), calc((100vw - 1440px) / 2 + var(--page-gutter)));
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px 8px 8px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.15s, color 0.15s;
}

.show-hero-back:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.show-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  gap: clamp(20px, 3vw, 40px);
  align-items: flex-end;
  min-height: inherit;
  padding: clamp(56px, 8vh, 72px) max(var(--page-gutter), calc((100vw - 1440px) / 2 + var(--page-gutter)))
    clamp(28px, 4vh, 48px);
  max-width: none;
  margin: 0;
  box-sizing: border-box;
}

.show-hero-poster {
  width: clamp(148px, 17vw, 236px);
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.show-hero-info {
  flex: 1;
  min-width: 0;
  max-width: 680px;
  padding-bottom: 4px;
}

.show-hero-kind {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
}

.show-hero-title {
  margin: 0;
  font-size: clamp(28px, 4.5vw, 48px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.show-hero-title-logo {
  font-size: 0;
  line-height: 0;
}

.show-hero-logo {
  display: block;
  width: auto;
  max-width: min(100%, 460px);
  height: auto;
  max-height: clamp(72px, 14vh, 120px);
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.45));
}

.show-hero-alt {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 15px;
}

.show-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin-top: 16px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.78);
}

.show-meta-line { color: rgba(255, 255, 255, 0.78); }

.show-rating {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #ff8a3d;
  font-weight: 700;
  font-size: 15px;
}

.show-age {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.show-hero-desc {
  margin: 16px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 54ch;
}

.show-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 22px;
}

.show-hero-actions form { margin: 0; }

.btn-watch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 13px 24px;
  font-weight: 700;
  font-size: 15px;
  color: #1a0f05;
  cursor: pointer;
  background: linear-gradient(90deg, #ff8a2b 0%, #ffc14d 100%);
  box-shadow: 0 8px 24px rgba(255, 138, 43, 0.28);
  transition: transform 0.15s, filter 0.15s;
}

.btn-watch:hover { filter: brightness(1.05); transform: translateY(-1px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 13px 16px;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.15s;
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.18); }
a.btn-ghost { text-decoration: none; }

.show-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.show-hero-stat {
  min-width: 88px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.show-hero-stat b {
  display: block;
  font-size: 17px;
  font-weight: 700;
}

.show-hero-stat span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: lowercase;
}

.show-hero-stat.is-new {
  border-color: rgba(255, 138, 43, 0.45);
}

.show-hero-stat.is-new b { color: #ff9a4a; }

.season {
  margin-top: 28px;
  padding-top: 8px;
}

.season h2 {
  font-size: 20px;
  margin-bottom: 12px;
}

.actions { display: flex; gap: 12px; align-items: center; margin: 18px 0; flex-wrap: wrap; }
.actions form { margin: 0; }

/* ---------- Плеер ---------- */

.player-section { margin-top: 32px; scroll-margin-top: 120px; }
.player-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.player-toolbar select {
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid #2c3040;
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px;
  max-width: 100%;
  min-height: 46px;
}
.player-close { margin-left: auto; }
.player-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #262a38;
}
.player-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Список серий ---------- */

.season { margin-top: 36px; }
.season h2 { border-bottom: 1px solid #262a38; padding-bottom: 8px; }
.episodes { list-style: none; margin: 0; padding: 0; }
.episode {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px 12px;
  border-radius: 8px;
}
.episode:hover, .episode:focus-within { background: var(--surface); }
.episode.future { opacity: .55; }
.episode.watched .ep-name, .episode.watched .ep-num { color: var(--muted); text-decoration: line-through; }
.episode form { margin: 0; }
.check {
  width: 46px; height: 46px;
  border-radius: 8px;
  border: 1.5px solid #3a3f52;
  background: var(--surface-2);
  color: var(--ok);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}
.check:disabled { opacity: .4; cursor: default; }
.episode.watched .check { border-color: var(--ok); }
.ep-play {
  min-width: 118px;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1.5px solid #3a3f52;
  background: var(--surface-2);
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ep-play:hover, .ep-play:focus-visible { border-color: var(--primary); }
.ep-info { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; flex: 1; min-width: 0; }
.ep-num { font-family: ui-monospace, monospace; color: var(--muted); }
.ep-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-date { font-size: 13px; white-space: nowrap; }
.upto button {
  min-height: 44px;
  background: none; border: 1px solid transparent; border-radius: 8px; color: var(--muted);
  font-size: 13px; cursor: pointer; padding: 8px 10px;
}
.upto button:hover, .upto button:focus-visible { color: var(--text); border-color: #3a3f52; }

/* «до этой» показываем по наведению только там, где есть мышь */
@media (hover: hover) {
  .episode:not(:hover):not(:focus-within) .upto { opacity: .45; }
}

/* ---------- Адаптивная вёрстка ---------- */

@media (min-width: 1280px) {
  .topbar { min-height: 64px; }
  .logo-word { font-size: 22px; }
  .card-body h3 { font-size: 18px; }
  .poster-title { font-size: 16px; }
}

@media (min-width: 721px) and (max-width: 1024px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .episode { align-items: flex-start; flex-wrap: wrap; }
  .ep-info { flex-basis: calc(100% - 146px); }
}

@media (max-width: 720px) {
  .topbar-inner {
    flex-wrap: wrap;
    gap: 10px;
  }
  .logo { order: 1; }
  .topbar nav {
    order: 3;
    width: 100%;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .topbar nav::-webkit-scrollbar { display: none; }
  .searchbar {
    order: 2;
    margin-left: 0;
    flex: 1 1 140px;
    max-width: none;
  }
  .page-home .topbar:not(.is-scrolled) {
    position: absolute;
  }
  .home-hero {
    height: clamp(420px, 64vh, 560px);
  }
  .home-hero-title { max-width: none; font-size: clamp(28px, 9vw, 40px); }
  .home-hero-nav { display: none; }
  .home-hero-content {
    padding-bottom: 48px;
  }

  main {
    padding: 18px max(14px, env(safe-area-inset-right))
      max(56px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }
  .page-home main { padding: 0; }
  .home-stack {
    padding: 20px max(14px, env(safe-area-inset-right))
      max(56px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }

  .hero { padding: 36px 12px; }
  .hero h1 { font-size: clamp(25px, 8vw, 34px); }
  .hero-actions .btn { width: 100%; }

  /* мои сериалы — компактные карточки в 2 колонки */
  .cards { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-body { padding: 10px; }
  .card-body h3 { font-size: 14px; }

  /* популярное — горизонтальная лента со свайпом */
  .poster-row {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .poster-row::-webkit-scrollbar { display: none; }
  .poster-card { flex: 0 0 130px; scroll-snap-align: start; }

  /* страница фильма / сериала */
  .show-hero {
    margin-top: -18px;
    min-height: auto;
  }
  .show-hero-bg img,
  .show-hero.has-poster-bg .show-hero-bg img {
    width: 100%;
    right: 0;
    transform: none;
    opacity: 0.42;
    filter: none;
  }
  .show-hero-shade,
  .show-hero.has-poster-bg .show-hero-shade {
    background:
      linear-gradient(180deg, rgba(5,5,6,0.15) 0%, rgba(5,5,6,0.72) 38%, #050506 82%),
      linear-gradient(90deg, rgba(5,5,6,0.75), transparent 75%);
  }
  .show-hero-back {
    left: var(--page-gutter);
    top: 12px;
    padding: 7px 10px 7px 6px;
    font-size: 13px;
  }
  .show-hero-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 56px var(--page-gutter) 28px;
  }
  .show-hero-poster {
    width: min(42vw, 160px);
    align-self: flex-start;
  }
  .show-hero-info { max-width: none; }
  .show-hero-title { font-size: clamp(24px, 7vw, 32px); }
  .show-hero-logo {
    max-width: min(92vw, 320px);
    max-height: 72px;
  }
  .show-hero-desc { -webkit-line-clamp: 5; max-width: none; }
  .btn-watch { flex: 1; justify-content: center; }
  .show-hero-actions .btn-ghost { flex: 1; }
  .show-hero-actions form { flex: 1; display: flex; }
  .show-hero-actions form .btn-ghost { width: 100%; }

  .player-toolbar { align-items: stretch; flex-direction: column; gap: 8px; }
  .player-toolbar select { width: 100%; }
  .player-close { margin-left: 0; }
  .player-section { scroll-margin-top: 150px; }

  .episode { align-items: stretch; flex-wrap: wrap; gap: 8px; padding: 12px 6px; }
  .ep-play { order: 2; flex: 1; min-width: 0; }
  .ep-info { order: 1; flex-basis: 100%; grid-template-columns: 44px minmax(0, 1fr); }
  .ep-date { grid-column: 2; white-space: normal; }
  .episode form { order: 3; }
  .episode .upto { order: 4; margin-left: auto; opacity: 1; }
  .check { width: 46px; }
}

@media (max-width: 380px) {
  .poster-card { flex-basis: 112px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
}

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

/* ---------- Вход с ПК ---------- */

.login-panel {
  margin: 24px 0;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid #262a38;
}

.login-panel-alt {
  background: var(--surface-2);
}

.login-panel-title {
  margin: 0 0 12px;
  font-size: 18px;
}

.login-code-box {
  display: inline-block;
  margin: 8px 0 12px;
  padding: 14px 28px;
  border-radius: var(--radius);
  background: #0b0d12;
  border: 2px dashed var(--primary);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.28em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.login-command code {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 8px;
  background: #0b0d12;
  font-size: 16px;
}

/* ---------- FM Радио ---------- */

.radio-page {
  padding: 24px var(--page-gutter) 120px;
  max-width: 1100px;
  margin: 0 auto;
}

.radio-hero h1 {
  margin: 0 0 6px;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.radio-search {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  max-width: 420px;
}

.radio-search input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid #2c3142;
  background: var(--surface);
  color: var(--text);
}

.radio-countries,
.radio-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.genre-pill {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #2c3142;
  background: var(--surface);
  font-size: 13px;
  color: var(--text);
}

.genre-pill.is-active,
.genre-pill:hover {
  border-color: var(--accent);
  color: #fff;
}

.radio-section {
  margin-top: 36px;
}

.radio-section h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.station-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

.station-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.station-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  background: var(--surface-2);
}

.station-card-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.has-radio-player {
  padding-bottom: 88px;
}

.radio-player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px 16px;
  align-items: center;
  padding: 10px max(var(--page-gutter), env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom)) max(var(--page-gutter), env(safe-area-inset-left));
  background: rgba(15, 17, 23, 0.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid #262a38;
}

.radio-player-cover {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
}

.radio-player-title {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.radio-player-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
}

.btn-icon-main {
  background: var(--text);
  color: #0f1117;
  font-size: 14px;
}

.btn-icon.is-liked { color: var(--accent); }

@media (max-width: 720px) {
  .radio-player-cover { width: 48px; height: 48px; }
}

/* ---------- Онлайн ТВ (Кинопоиск-like) ---------- */

.tv-page {
  max-width: 1280px;
  margin: 0 auto;
  padding-bottom: 48px;
}

.tv-head h1 {
  margin: 0 0 18px;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.tv-cats {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 20px;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tv-cats::-webkit-scrollbar { display: none; }

.tv-cat {
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #a3a3a3;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  appearance: none;
  transition: background 0.15s, color 0.15s;
}

.tv-cat:hover { color: #fff; }

.tv-cat.is-active {
  background: #2a2a2a;
  color: #fff;
}

.tv-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.tv-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 88px;
  margin: 0;
  padding: 14px 16px;
  border: 0;
  border-radius: 12px;
  background: #1a1a1a;
  color: #fff;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background 0.15s, transform 0.12s;
}

.tv-card:hover {
  background: #242424;
  transform: translateY(-1px);
}

.tv-card.is-active {
  background: #2c2c2c;
  outline: 1px solid #3a3a3a;
}

.tv-card-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.tv-card-name {
  font-size: 13px;
  font-weight: 500;
  color: #9a9a9a;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tv-card-now {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tv-card-logo-wrap { flex-shrink: 0; }

.tv-card-logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: contain;
  background: #111;
  display: block;
}

.tv-card-logo-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2a2a2a;
  color: #c8c8c8;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tv-empty { margin-top: 24px; text-align: center; }

/* Полноэкранный плеер */
body.tv-theater-open {
  overflow: hidden;
}

body.tv-theater-open .topbar {
  visibility: hidden;
  pointer-events: none;
}

.tv-theater {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: #000;
  color: #fff;
}

.tv-theater[hidden] { display: none !important; }

.watch-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #000;
}

.tv-theater video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* Сторонний iframe: наша панель сверху, видео ниже — без наложения */
.tv-theater.is-iframe {
  display: grid !important;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr;
}
.tv-theater.is-iframe video {
  display: none !important;
}
.tv-theater.is-iframe .tv-theater-shade {
  display: none !important;
}
.tv-theater.is-iframe .tv-theater-close {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  grid-row: 1;
  grid-column: 1;
  align-self: center;
  margin: 8px 0 8px 10px;
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.08);
}
.tv-theater.is-iframe .tv-theater-ui {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  grid-row: 1;
  grid-column: 2;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 10px 16px 10px 8px;
  opacity: 1 !important;
  pointer-events: auto !important;
  background: #0b0910;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.tv-theater.is-iframe .tv-theater-meta {
  margin: 0;
  max-width: min(42vw, 420px);
  min-width: 0;
  flex: 1 1 160px;
}
.tv-theater.is-iframe .tv-theater-ch {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
}
.tv-theater.is-iframe .tv-theater-title {
  margin-top: 2px;
  font-size: 16px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-theater.is-iframe .watch-pickers {
  margin: 0;
  flex: 1 1 auto;
}
.tv-theater.is-iframe .tv-theater-bar {
  display: flex;
  justify-content: flex-end;
  margin-left: auto;
  gap: 4px;
  flex: 0 0 auto;
}
.tv-theater.is-iframe .tv-theater-left,
.tv-theater.is-iframe .watch-progress {
  display: none !important;
}
.tv-theater.is-iframe .watch-stage {
  position: relative !important;
  inset: auto !important;
  grid-row: 2;
  grid-column: 1 / -1;
  min-height: 0;
  isolation: isolate;
}
.tv-theater.is-iframe .watch-stage #watch-iframe,
.tv-theater.is-iframe #watch-iframe {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 1;
}

.tv-theater-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, transparent 18%, transparent 55%, rgba(0,0,0,0.75) 100%);
  opacity: 0;
  transition: opacity 0.25s;
  z-index: 2;
}

.tv-theater:has(.tv-theater-ui.is-visible) .tv-theater-shade {
  opacity: 1;
}

.tv-theater-close {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 6;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  /* Непрозрачный hit-target: иначе клики уходят в <video> под кнопкой */
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  /* Всегда кликабельна: иначе при скрытом chrome (и во время долгой загрузки HLS) × мёртва */
  opacity: 0.55;
  pointer-events: auto;
  transition: opacity 0.25s, background 0.2s;
}

.tv-theater:has(.tv-theater-ui.is-visible) .tv-theater-close,
.tv-theater.is-loading .tv-theater-close,
.tv-theater:has(.tv-theater-error:not([hidden])) .tv-theater-close {
  opacity: 0.9;
}

.tv-theater-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.55);
}

.tv-theater-loader,
.tv-theater-error {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  color: #ddd;
  font-size: 16px;
  padding: 24px;
  text-align: center;
  pointer-events: none;
}

.tv-theater-loader[hidden],
.tv-theater-error[hidden] {
  display: none !important;
}

.tv-theater-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.tv-theater-spinner {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tvTheaterSpin 0.75s linear infinite;
}

.tv-theater-loader-label {
  color: #ddd;
  font-size: 15px;
  letter-spacing: 0.02em;
}

@keyframes tvTheaterSpin {
  to { transform: rotate(360deg); }
}

.tv-theater-error { color: #f88; }

.tv-theater-ui {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  padding: 28px 32px 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.tv-theater-ui.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.tv-theater-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  max-width: 720px;
}

.tv-theater-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: contain;
  background: #111;
  flex-shrink: 0;
}

.tv-theater-ch {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.tv-theater-title {
  margin-top: 4px;
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.tv-theater-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.tv-theater-left,
.tv-theater-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tv-ctrl {
  margin: 0;
  padding: 8px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.92;
}

.tv-ctrl:hover { opacity: 1; }

.tv-ctrl.is-on { color: #ffd166; }

.tv-ctrl-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}

.tv-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #e8e8e8;
}

.tv-live i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  display: inline-block;
}

@media (max-width: 1100px) {
  .tv-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .tv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tv-theater-ui { padding: 20px; }
  .tv-theater-title { font-size: 22px; }
}

@media (max-width: 560px) {
  .tv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tv-card { min-height: 76px; padding: 12px; }
  .tv-card-logo { width: 44px; height: 44px; }
  .tv-card-now { font-size: 13px; }
  .tv-ctrl-label { font-size: 0; gap: 0; }
  .tv-ctrl-label::before { content: "≡"; font-size: 18px; }
}
