:root {
  --bg: #050505;
  --panel: rgba(10, 10, 10, 0.78);
  --panel-strong: rgba(16, 16, 16, 0.94);
  --surface: rgba(255, 255, 255, 0.08);
  --surface-strong: rgba(255, 255, 255, 0.16);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f8f8f8;
  --muted: rgba(248, 248, 248, 0.68);
  --soft: rgba(248, 248, 248, 0.42);
  --accent: #01b0ff;
  --accent-2: #24d06f;
  --danger: #ff4d4d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.62);
  --tv-scale: 1;
  --edge: clamp(18px, calc(68px * var(--tv-scale)), 154px);
  --sidebar-w: clamp(48px, calc(104px * var(--tv-scale)), 236px);
  --catalog-pane-w: clamp(180px, calc(350px * var(--tv-scale)), 780px);
  --catalog-option-w: clamp(150px, calc(300px * var(--tv-scale)), 680px);
  --catalog-menu-shift: clamp(10px, calc(24px * var(--tv-scale)), 56px);
  --catalog-content-gap: clamp(18px, calc(40px * var(--tv-scale)), 90px);
  --content-left: calc(var(--sidebar-w) + clamp(24px, calc(64px * var(--tv-scale)), 140px));
  --topbar: clamp(42px, calc(84px * var(--tv-scale)), 190px);
  --card-w: clamp(78px, calc(190px * var(--tv-scale)), 420px);
  --card-h: calc(var(--card-w) * 1.48);
  --home-vh: 100vh;
  --home-preview-hero-h: clamp(calc(300px * var(--tv-scale)), calc(var(--home-vh) - var(--card-h) - calc(250px * var(--tv-scale))), calc(640px * var(--tv-scale)));
  color-scheme: dark;
  font-family: Inter, Arial, sans-serif;
}

@supports (height: 100dvh) {
  :root {
    --home-vh: 100dvh;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -ms-touch-action: none;
  background: var(--bg);
  color: var(--text);
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/*
 * Android TV/WebView may keep the complete 4K catalogue scene in the
 * compositor underneath fullscreen video. Removing the hidden scene from
 * layout prevents AudioTrack starvation and crackling in every player.
 */
body.has-tv-player > .tv-boot,
body.has-tv-player > .tv-bg,
body.has-tv-player > .tv-sidebar,
body.has-tv-player > .tv-catalog-pane,
body.has-tv-player > .tv-topbar,
body.has-tv-player > .tv-main,
body.has-tv-player > .tv-search,
body.has-tv-player > .tv-detail,
body.has-tv-player > .tv-profile,
body.has-tv-player > .tv-toast {
  display: none !important;
}

body.has-tv-player {
  background: #000;
}

button,
a,
input {
  font: inherit;
  font-family: Inter, Arial, sans-serif;
}

html,
body,
textarea,
select {
  font-family: Inter, Arial, sans-serif;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.tv-boot {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: #000;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.tv-boot.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.tv-boot img {
  width: clamp(48px, calc(110px * var(--tv-scale)), 240px);
  height: clamp(48px, calc(110px * var(--tv-scale)), 240px);
  display: block;
  animation: tvBootSpin 1s linear infinite;
}

.tv-boot-version {
  position: absolute;
  right: 0;
  bottom: max(clamp(24px, calc(36px * var(--tv-scale)), 72px), env(safe-area-inset-bottom));
  left: 0;
  color: #737373;
  font-size: clamp(14px, calc(18px * var(--tv-scale)), 36px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-align: center;
}

@keyframes tvBootSpin {
  to {
    transform: rotate(360deg);
  }
}

.tv-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(90deg, #050505 0%, rgba(5, 5, 5, 0.98) 9%, rgba(5, 5, 5, 0.9) 23%, rgba(5, 5, 5, 0.54) 46%, rgba(5, 5, 5, 0.22) 70%, rgba(5, 5, 5, 0.58) 100%),
    linear-gradient(180deg, rgba(5, 5, 5, 0.2) 0%, rgba(5, 5, 5, 0.54) 58%, #050505 100%);
  background-position: center;
  background-size: cover;
  transform: scale(1.03);
  transition: background-image 0.28s ease, opacity 0.28s ease;
}

.tv-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #050505 0%, rgba(5, 5, 5, 0.94) 6%, rgba(5, 5, 5, 0.72) 18%, rgba(5, 5, 5, 0.24) 42%, rgba(5, 5, 5, 0) 68%),
    linear-gradient(180deg, rgba(5, 5, 5, 0.04), rgba(5, 5, 5, 0.76));
  pointer-events: none;
}

.tv-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: var(--topbar);
  padding: clamp(10px, calc(24px * var(--tv-scale)), 54px) clamp(12px, calc(40px * var(--tv-scale)), 90px) calc(8px * var(--tv-scale)) var(--content-left);
  background: transparent;
}

.tv-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 32;
  width: var(--sidebar-w);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: stretch;
  justify-items: center;
  gap: clamp(12px, calc(34px * var(--tv-scale)), 78px);
  padding: clamp(12px, calc(32px * var(--tv-scale)), 72px) clamp(6px, calc(12px * var(--tv-scale)), 28px) calc(clamp(10px, calc(18px * var(--tv-scale)), 44px) + env(safe-area-inset-bottom));
  background: transparent;
  border-right: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.tv-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(42px, calc(70px * var(--tv-scale)), 150px);
  min-height: clamp(42px, calc(70px * var(--tv-scale)), 150px);
  padding: clamp(4px, calc(8px * var(--tv-scale)), 18px);
  border-radius: 8px;
  color: var(--text);
  pointer-events: none;
  user-select: none;
}

.tv-brand img {
  width: clamp(30px, calc(54px * var(--tv-scale)), 112px);
  height: clamp(30px, calc(54px * var(--tv-scale)), 112px);
  display: block;
}

.tv-side-nav {
  width: 100%;
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, calc(10px * var(--tv-scale)), 24px);
  min-width: 0;
  padding: 0;
}

.tv-side-footer {
  width: 100%;
  display: flex;
  justify-content: center;
  padding-bottom: clamp(4px, calc(18px * var(--tv-scale)), 44px);
}

.tv-nav-btn,
.tv-primary,
.tv-secondary {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0;
  transition: transform 0.14s ease, border-color 0.14s ease, background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.tv-nav-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(42px, calc(70px * var(--tv-scale)), 150px);
  height: clamp(42px, calc(70px * var(--tv-scale)), 150px);
  min-height: 0;
  padding: 0;
  background-color: transparent;
  color: var(--muted);
  font-weight: 700;
}

.tv-sidebar .tv-nav-btn {
  border: 1px solid transparent;
  border-radius: 12px;
  contain: layout paint;
  flex: 0 0 clamp(42px, calc(70px * var(--tv-scale)), 150px);
  transition: none;
}

.tv-nav-active-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  border-radius: inherit;
  background-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
  transition: none;
}

.tv-nav-btn svg {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: clamp(20px, calc(32px * var(--tv-scale)), 68px);
  height: clamp(20px, calc(32px * var(--tv-scale)), 68px);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tv-sidebar .tv-nav-btn.has-avatar {
  overflow: hidden;
  border-radius: 50%;
}

.tv-sidebar .tv-nav-btn.has-avatar svg {
  display: none;
}

.tv-catalog-pane {
  position: fixed;
  inset: 0 auto 0 var(--sidebar-w);
  z-index: 31;
  width: var(--catalog-pane-w);
  padding: clamp(34px, calc(52px * var(--tv-scale)), 120px) clamp(7px, calc(16px * var(--tv-scale)), 38px) clamp(42px, calc(92px * var(--tv-scale)), 210px) calc(clamp(7px, calc(16px * var(--tv-scale)), 38px) + var(--catalog-menu-shift));
  scroll-padding-top: clamp(34px, calc(52px * var(--tv-scale)), 120px);
  scroll-padding-bottom: clamp(42px, calc(92px * var(--tv-scale)), 210px);
  overflow-x: hidden;
  overflow-y: auto;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.tv-catalog-pane[hidden] {
  display: none !important;
}

.tv-catalog-pane::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body.has-catalog-pane .tv-shelves.is-list-page {
  padding-left: calc(var(--sidebar-w) + var(--catalog-pane-w) + var(--catalog-content-gap));
  padding-top: clamp(76px, calc(136px * var(--tv-scale)), 310px);
  padding-bottom: clamp(8px, calc(18px * var(--tv-scale)), 44px);
}

body.has-catalog-pane .tv-list-page {
  gap: clamp(12px, calc(30px * var(--tv-scale)), 70px);
}

body.has-catalog-pane .tv-list-page h2 {
  display: none;
  max-width: min(100%, calc(100vw - var(--sidebar-w) - var(--catalog-pane-w) - var(--edge) - 190px));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(16px, calc(31px * var(--tv-scale)), 70px);
}

body.has-catalog-pane .tv-catalog-preview-empty {
  grid-template-rows: minmax(0, 1fr);
}

body.has-catalog-pane .tv-empty {
  padding-left: calc(var(--sidebar-w) + var(--catalog-pane-w) + var(--catalog-content-gap));
}

body.has-catalog-pane .tv-topbar {
  background: transparent;
}

.tv-nav-avatar {
  position: relative;
  z-index: 1;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  display: block;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.tv-nav-btn::after {
  content: attr(aria-label);
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  z-index: 96;
  display: none;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(32, 32, 32, 0.98);
  color: #fff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
  font-size: clamp(15px, 1.05vw, 20px);
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  padding: 11px 14px;
  pointer-events: none;
  transform: translate(8px, -50%);
  transition: opacity 0.14s ease, transform 0.14s ease;
  white-space: nowrap;
}

.tv-nav-btn:hover::after,
.tv-nav-btn.is-focused::after,
.tv-nav-btn:focus::after,
.tv-nav-btn:focus-visible::after {
  opacity: 0;
  transform: translate(8px, -50%);
}

.tv-clock {
  min-width: clamp(58px, calc(96px * var(--tv-scale)), 210px);
  justify-self: end;
  color: var(--muted);
  font-size: clamp(13px, calc(24px * var(--tv-scale)), 54px);
  font-weight: 650;
  text-align: right;
}

.tv-main {
  position: relative;
  z-index: 2;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-padding-top: calc(var(--topbar) + calc(24px * var(--tv-scale)));
  padding-bottom: clamp(32px, calc(64px * var(--tv-scale)), 150px);
}

.tv-main.is-home-preview {
  overflow-y: hidden;
  padding-bottom: 0;
}

.tv-home-loading {
  position: fixed;
  inset: 0 0 0 var(--sidebar-w);
  z-index: 30;
  display: grid;
  place-items: center;
  padding: var(--topbar) var(--edge) 64px var(--edge);
  pointer-events: none;
}

.tv-home-loading[hidden] {
  display: none !important;
}

.tv-home-loading-card {
  min-height: 76px;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 0 28px;
  border-radius: 16px;
  background: rgba(18, 18, 18, 0.9);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.5);
}

.tv-home-loading-spinner {
  width: 42px;
  height: 42px;
  border: 5px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: tv-home-loading-spin 0.82s linear infinite;
}

.tv-home-loading-text {
  color: #fff;
  font-size: clamp(22px, 1.5vw, 30px);
  font-weight: 700;
  line-height: 1;
}

@keyframes tv-home-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.tv-main::-webkit-scrollbar,
.tv-card-row::-webkit-scrollbar,
.tv-search::-webkit-scrollbar,
.tv-search-results::-webkit-scrollbar,
.tv-profile.is-login.is-telegram-id::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.tv-search,
.tv-search-results,
.tv-profile.is-login.is-telegram-id {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tv-main,
.tv-card-row,
.tv-search,
.tv-search-results,
.tv-catalog-pane,
.tv-player .direct-player-menu,
.tv-player .direct-player-serial-menu,
.tv-player .direct-player-serial-episode-grid {
  overscroll-behavior: none;
  touch-action: none;
  -ms-touch-action: none;
}

.tv-hero {
  position: sticky;
  top: 0;
  z-index: 3;
  height: var(--home-preview-hero-h);
  min-height: 0;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding: calc(var(--topbar) + clamp(4px, calc(18px * var(--tv-scale)), 42px)) var(--edge) clamp(10px, calc(30px * var(--tv-scale)), 70px) var(--content-left);
}

.tv-main.is-home-preview .tv-hero {
  position: sticky;
  top: 0;
  height: var(--home-preview-hero-h);
  overflow: visible;
  padding-bottom: clamp(4px, calc(10px * var(--tv-scale)), 24px);
}

.tv-hero-content {
  position: relative;
  z-index: 1;
  width: min(calc(1000px * var(--tv-scale)), 64vw);
  display: grid;
  gap: clamp(7px, calc(15px * var(--tv-scale)), 34px);
}

.tv-hero .tv-kicker {
  display: none;
}

.tv-kicker {
  color: var(--accent);
  font-size: clamp(11px, calc(20px * var(--tv-scale)), 44px);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tv-hero h1,
.tv-detail h2,
.tv-profile h2,
.tv-player h2,
.tv-empty h2 {
  margin: 0;
  letter-spacing: 0;
}

.tv-hero h1 {
  display: -webkit-box;
  max-height: 1.96em;
  max-width: min(calc(820px * var(--tv-scale)), 18ch);
  overflow: hidden;
  font-size: clamp(24px, calc(56px * var(--tv-scale)), 124px);
  line-height: 1;
  font-weight: 700;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tv-hero-meta,
.tv-hero-text,
.tv-detail-text,
.tv-empty p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

.tv-hero-meta {
  display: -webkit-box;
  max-width: calc(860px * var(--tv-scale));
  overflow: hidden;
  font-size: clamp(12px, calc(22px * var(--tv-scale)), 48px);
  font-weight: 500;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tv-hero-meta:not(:empty) {
  min-height: 0;
}

.tv-hero-rating {
  color: var(--accent-2);
  font-weight: 700;
}
.tv-hero-text {
  display: -webkit-box;
  max-width: calc(1040px * var(--tv-scale));
  max-height: 4.5em;
  overflow: hidden;
  font-size: clamp(11px, calc(21px * var(--tv-scale)), 46px);
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.tv-hero-text:not(:empty) {
  min-height: 0;
}

.tv-hero-text.is-pending-description {
  display: none;
  min-height: 0;
  visibility: hidden;
}
.tv-main.is-home-preview .tv-hero-content {
  width: min(calc(1000px * var(--tv-scale)), 64vw);
  gap: clamp(7px, calc(15px * var(--tv-scale)), 34px);
  transform: translateY(clamp(32px, calc(72px * var(--tv-scale)), 164px));
}

.tv-main.is-home-preview .tv-hero-text {
  display: -webkit-box;
  max-width: calc(1040px * var(--tv-scale));
  max-height: 4.5em;
  overflow: hidden;
  -webkit-line-clamp: 3;
}

.tv-hero-text.is-empty,
.tv-rating-line.is-empty {
  display: none;
}

.tv-rating-line {
  display: flex;
  align-items: center;
  gap: clamp(8px, calc(24px * var(--tv-scale)), 56px);
  min-height: clamp(18px, calc(34px * var(--tv-scale)), 76px);
}

.tv-rating-item {
  display: inline-flex;
  align-items: center;
  gap: clamp(5px, calc(10px * var(--tv-scale)), 24px);
  color: var(--text);
  font-size: clamp(13px, calc(26px * var(--tv-scale)), 58px);
  font-weight: 500;
  line-height: 1;
}

.tv-rating-item img {
  width: clamp(16px, calc(30px * var(--tv-scale)), 68px);
  height: clamp(16px, calc(30px * var(--tv-scale)), 68px);
  object-fit: contain;
}

.tv-actions {
  display: flex;
  align-items: center;
  gap: clamp(8px, calc(16px * var(--tv-scale)), 38px);
  flex-wrap: wrap;
  padding-top: 8px;
}

.tv-detail .tv-actions {
  padding-top: clamp(6px, calc(18px * var(--tv-scale)), 44px);
}

.tv-hero .tv-actions {
  display: none;
}

.tv-primary,
.tv-secondary {
  min-height: clamp(36px, calc(58px * var(--tv-scale)), 132px);
  padding: 0 clamp(14px, calc(30px * var(--tv-scale)), 70px);
  font-size: clamp(13px, calc(23px * var(--tv-scale)), 52px);
  font-weight: 700;
}

.tv-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.tv-secondary {
  background: rgba(255, 255, 255, 0.18);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.tv-primary:hover,
.tv-primary.is-focused,
.tv-primary:focus-visible {
  border-color: var(--accent);
  background: var(--accent);
}

.tv-secondary:hover,
.tv-secondary.is-focused,
.tv-secondary:focus-visible {
  background: rgba(1, 176, 255, 0.12);
  border-color: transparent;
  color: var(--accent);
}

.tv-secondary:disabled,
.tv-primary:disabled {
  cursor: default;
  opacity: 0.42;
  transform: none !important;
  box-shadow: none !important;
}

.tv-watch-btn.is-opening {
  opacity: 0.72;
}

.tv-watch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, calc(14px * var(--tv-scale)), 34px);
  min-width: clamp(118px, calc(230px * var(--tv-scale)), 520px);
  min-height: clamp(40px, calc(66px * var(--tv-scale)), 150px);
  padding-inline: clamp(16px, calc(38px * var(--tv-scale)), 88px);
}

.tv-watch-btn svg {
  width: clamp(13px, calc(22px * var(--tv-scale)), 50px);
  height: clamp(13px, calc(22px * var(--tv-scale)), 50px);
  fill: currentColor;
}

.tv-favorite-btn,
.tv-site-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(40px, calc(66px * var(--tv-scale)), 150px);
  min-width: clamp(40px, calc(66px * var(--tv-scale)), 150px);
  max-width: clamp(40px, calc(66px * var(--tv-scale)), 150px);
  aspect-ratio: 1;
  min-height: clamp(40px, calc(66px * var(--tv-scale)), 150px);
  padding: 0;
}

.tv-favorite-btn svg,
.tv-site-btn svg {
  width: clamp(15px, calc(24px * var(--tv-scale)), 54px);
  height: clamp(15px, calc(24px * var(--tv-scale)), 54px);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tv-favorite-btn span {
  display: none;
}

.tv-favorite-btn.is-active,
.tv-site-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tv-favorite-btn.is-active svg {
  fill: #fff;
  stroke: #fff;
}

.tv-shelves {
  display: grid;
  gap: clamp(8px, calc(24px * var(--tv-scale)), 58px);
  padding: 0 0 clamp(48px, calc(150px * var(--tv-scale)), 340px);
}

.tv-shelves.is-list-page {
  height: 100vh;
  min-height: 0;
  align-content: start;
  gap: 0;
  overflow: hidden;
  padding: clamp(20px, calc(48px * var(--tv-scale)), 112px) var(--edge) clamp(14px, calc(34px * var(--tv-scale)), 80px) var(--content-left);
}
.tv-shelves.is-list-page.is-library-list-page {
  padding-left: calc(var(--sidebar-w) + var(--catalog-menu-shift) + clamp(7px, calc(16px * var(--tv-scale)), 38px));
  padding-top: clamp(34px, calc(52px * var(--tv-scale)), 120px);
  padding-bottom: clamp(8px, calc(18px * var(--tv-scale)), 44px);
}

.tv-shelf {
  display: grid;
  gap: clamp(5px, calc(12px * var(--tv-scale)), 30px);
}

.tv-main.is-home-preview .tv-shelves {
  height: calc(var(--home-vh) - var(--home-preview-hero-h));
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0;
  overflow: hidden;
  padding-bottom: clamp(10px, calc(26px * var(--tv-scale)), 64px);
}

.tv-shelves.is-home-preview .tv-shelf.is-home-preview-hidden {
  display: none;
}

.tv-shelves.is-home-preview .tv-shelf:not(.is-home-preview-active) {
  display: none;
}

.tv-shelves.is-home-preview .tv-shelf.is-home-preview-active {
  width: 100%;
  margin-top: auto;
}

.tv-shelves.is-home-preview .tv-shelf.is-home-preview-next {
  display: none;
}

.tv-shelves.is-home-preview .tv-shelf.is-home-preview-next .tv-card-row {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.tv-list-page {
  display: grid;
  gap: clamp(10px, calc(26px * var(--tv-scale)), 64px);
  align-content: start;
  min-height: 0;
  opacity: 1;
  transition: opacity 140ms ease;
}
.tv-list-page.is-library-list-page {
  grid-template-columns: minmax(0, 1fr);
  column-gap: 0;
  row-gap: 0;
}

.tv-list-page.is-library-list-page h2 {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  max-width: 100%;
  font-size: clamp(16px, calc(30px * var(--tv-scale)), 68px);
}

.tv-list-page.is-library-list-page .tv-list-grid {
  grid-column: 1;
  grid-row: 2;
  margin-top: clamp(26px, calc(52px * var(--tv-scale)), 120px);
}

.tv-list-page.is-library-list-page .tv-list-more-wrap {
  grid-column: 1;
  justify-self: start;
  width: min(100%, var(--list-grid-width, 100%));
}

.tv-shelves.is-catalog-refreshing .tv-list-page {
  opacity: 0.72;
  pointer-events: none;
}

.tv-list-page.is-catalog-entering {
  opacity: 0;
}

.tv-shelf h2 {
  margin: 0;
  padding: 0 var(--edge) 0 var(--content-left);
  font-size: clamp(15px, calc(30px * var(--tv-scale)), 68px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: 0;
}

.tv-list-page h2 {
  margin: 0;
  padding: 0;
  max-width: min(100%, calc(100vw - var(--content-left) - var(--edge) - 170px));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(18px, calc(38px * var(--tv-scale)), 86px);
  line-height: 1.08;
  font-weight: 700;
}

.tv-catalog-preview-empty {
  min-height: calc(100vh - clamp(36px, 5vh, 58px) - clamp(24px, 3.2vh, 38px));
  grid-template-rows: auto minmax(0, 1fr);
}

.tv-catalog-preview-state {
  align-self: center;
  justify-self: center;
  display: grid;
  justify-items: center;
  gap: clamp(18px, 2.5vh, 34px);
  padding-bottom: clamp(56px, 8vh, 104px);
  text-align: center;
}

.tv-catalog-preview-state .tv-catalog-message {
  margin: 0;
  color: var(--text);
  font-size: clamp(36px, 3vw, 62px);
  line-height: 1.08;
  font-weight: 700;
}

.tv-catalog-reset {
  min-width: clamp(150px, 10vw, 210px);
  min-height: clamp(48px, 5.6vh, 64px);
  justify-content: center;
  padding-inline: clamp(22px, 1.7vw, 34px);
  font-size: clamp(18px, 1.1vw, 23px);
}

.tv-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-w), var(--card-w)));
  justify-content: start;
  gap: clamp(12px, calc(30px * var(--tv-scale)), 70px) clamp(8px, calc(20px * var(--tv-scale)), 46px);
  align-items: start;
}

.tv-list-grid .tv-card {
  flex: initial;
  width: var(--card-w);
}

.tv-list-more-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-left: 0;
  padding: clamp(8px, calc(18px * var(--tv-scale)), 44px) 0 0;
}

.tv-list-more-wrap[hidden] {
  display: none !important;
}

.tv-list-more {
  min-width: clamp(92px, calc(160px * var(--tv-scale)), 360px);
  min-height: clamp(34px, calc(52px * var(--tv-scale)), 120px);
  justify-content: center;
  border-color: var(--accent);
  padding-inline: clamp(12px, calc(24px * var(--tv-scale)), 56px);
  font-size: clamp(12px, calc(19px * var(--tv-scale)), 44px);
}

.tv-shelves.is-catalog-menu {
  min-height: 100vh;
  align-content: start;
  gap: 0;
  padding: calc(var(--topbar) + clamp(12px, calc(34px * var(--tv-scale)), 78px)) var(--edge) clamp(24px, calc(46px * var(--tv-scale)), 110px) var(--content-left);
}

.tv-catalog-menu {
  display: grid;
  gap: clamp(8px, calc(22px * var(--tv-scale)), 52px);
  align-content: start;
}

.tv-catalog-selected {
  display: grid;
  gap: clamp(8px, 1vh, 12px);
  width: min(var(--catalog-option-w), 100%);
  padding: clamp(10px, 1.35vh, 18px) 0 clamp(6px, 0.8vh, 10px);
  border-bottom: 0;
}

.tv-catalog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 1.8vw, 28px);
}

.tv-catalog-menu h2 {
  margin: 0;
  padding: 0;
  color: rgba(248, 248, 248, 0.94);
  font-size: clamp(16px, calc(30px * var(--tv-scale)), 68px);
  line-height: 1.04;
  font-weight: 700;
  text-shadow: none;
}

.tv-catalog-apply {
  flex: 0 0 auto;
  min-width: clamp(128px, 9vw, 170px);
  min-height: clamp(46px, 5.2vh, 60px);
  padding-inline: clamp(18px, 1.4vw, 26px);
  font-size: clamp(17px, 1.05vw, 21px);
}

.tv-catalog-group {
  display: grid;
  gap: clamp(8px, 1.05vh, 13px);
}

.tv-catalog-group + .tv-catalog-group {
  padding-top: clamp(2px, 0.4vh, 8px);
  border-top: 0;
}

.tv-catalog-group h3 {
  margin: 0;
  color: var(--muted);
  height: clamp(2px, 0.25vh, 5px);
  font-size: 0;
  line-height: 1;
  font-weight: 700;
  visibility: hidden;
}

.tv-catalog-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(8px, 1.05vh, 14px);
  width: min(var(--catalog-option-w), 100%);
}

.tv-catalog-option {
  position: relative;
  --catalog-option-icon: clamp(14px, calc(28px * var(--tv-scale)), 64px);
  --catalog-option-action: clamp(14px, calc(28px * var(--tv-scale)), 64px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  min-height: clamp(34px, calc(62px * var(--tv-scale)), 140px);
  padding: clamp(5px, calc(10px * var(--tv-scale)), 24px) calc(var(--catalog-option-action) + clamp(14px, calc(32px * var(--tv-scale)), 76px));
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: clamp(11px, calc(20px * var(--tv-scale)), 46px);
  line-height: 1.1;
  font-weight: 600;
  outline: none;
  text-align: center;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.tv-catalog-option::before {
  content: "+";
  position: absolute;
  left: clamp(10px, calc(24px * var(--tv-scale)), 58px);
  top: 50%;
  display: grid;
  place-items: center;
  width: var(--catalog-option-icon);
  min-width: var(--catalog-option-icon);
  height: var(--catalog-option-icon);
  color: currentColor;
  font-size: clamp(16px, calc(29px * var(--tv-scale)), 66px);
  font-weight: 400;
  line-height: 1;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 0.14s ease;
}

.tv-catalog-option span:first-child {
  grid-column: 1;
  justify-self: stretch;
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-catalog-option.is-selected {
  border-color: transparent;
  background: #fff;
  color: #050505;
  box-shadow: none;
}

.tv-catalog-option[data-catalog-kind="category"].is-selected {
  border-color: transparent;
  background: #fff;
  color: #050505;
  box-shadow: none;
}

.tv-catalog-option.is-selected::before {
  opacity: 0;
}

.tv-catalog-option.is-filter-chip {
  min-height: clamp(34px, calc(62px * var(--tv-scale)), 140px);
  border-color: transparent;
  border-radius: 999px;
  background: #fff;
  color: #050505;
  box-shadow: none;
  font-size: clamp(11px, calc(20px * var(--tv-scale)), 46px);
}

.tv-catalog-option.is-filter-chip.is-selected {
  border-color: transparent;
  background: #fff;
  color: #050505;
  box-shadow: none;
}

.tv-catalog-option.is-filter-chip::before,
.tv-catalog-option.is-filter-chip.is-selected::before {
  opacity: 0;
}

.tv-catalog-option.is-filter-chip span:first-child {
  grid-column: 1;
}

.tv-catalog-option.is-filter-chip .tv-catalog-check {
  grid-column: 1;
}

.tv-catalog-check {
  position: absolute;
  right: clamp(10px, calc(24px * var(--tv-scale)), 58px);
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--catalog-option-action);
  min-width: var(--catalog-option-action);
  height: var(--catalog-option-action);
  margin-left: 0;
  color: var(--accent);
  font-size: clamp(10px, calc(17px * var(--tv-scale)), 40px);
  line-height: 1;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
}

.tv-catalog-option.is-selected .tv-catalog-check {
  opacity: 0;
}

.tv-catalog-option.is-filter-chip .tv-catalog-check {
  background: transparent;
  color: currentColor;
  font-size: clamp(14px, calc(30px * var(--tv-scale)), 66px);
  font-weight: 400;
  opacity: 1;
}

.tv-card-row {
  display: flex;
  align-items: flex-start;
  gap: clamp(8px, calc(20px * var(--tv-scale)), 46px);
  overflow-x: auto;
  overflow-y: hidden;
  --card-focus-gutter: clamp(8px, calc(14px * var(--tv-scale)), 32px);
  margin-left: calc(var(--content-left) - var(--card-focus-gutter));
  padding: clamp(4px, calc(8px * var(--tv-scale)), 22px) var(--edge) clamp(8px, calc(18px * var(--tv-scale)), 44px) var(--card-focus-gutter);
  scroll-padding-inline: var(--card-focus-gutter) var(--edge);
  scroll-behavior: auto;
}

.tv-card {
  position: relative;
  flex: 0 0 var(--card-w);
  width: var(--card-w);
  border: 0;
  border-radius: 8px;
  padding: 0;
  overflow: visible;
  background: transparent;
  color: var(--text);
  text-align: left;
  outline: none;
  transform-origin: center center;
  transition: transform 120ms ease-out;
  will-change: transform;
}

.tv-card-media {
  position: relative;
  width: var(--card-w);
  height: var(--card-h);
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(145deg, #1b1b1b, #0b0b0b);
  box-shadow: 0 calc(14px * var(--tv-scale)) calc(34px * var(--tv-scale)) rgba(0, 0, 0, 0.36);
}

.tv-card-media.is-no-poster,
.tv-detail-poster.is-no-poster {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.055), transparent 34%),
    linear-gradient(160deg, #232323, #111);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 14px 34px rgba(0, 0, 0, 0.36);
}

.tv-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 4px var(--accent);
  transition: opacity 120ms ease-out;
}

.tv-card-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 1;
}

.tv-card-media img.is-loading {
  opacity: 0;
}

.tv-no-poster-placeholder {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(5px, calc(10px * var(--tv-scale)), 24px);
  padding: clamp(8px, calc(18px * var(--tv-scale)), 42px);
  color: rgba(255, 255, 255, 0.74);
  text-align: center;
}

.tv-no-poster-placeholder img {
  width: clamp(42px, 31%, 70px);
  height: auto;
  display: block;
  object-fit: contain;
  opacity: 0.78;
  filter: grayscale(1) brightness(1.7) contrast(0.72) drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
}

.tv-no-poster-placeholder span {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: clamp(13px, min(0.92rem, 1.7vh), 16px);
  font-weight: 700;
  line-height: 1.18;
}

.tv-card-badge {
  position: absolute;
  left: clamp(4px, calc(8px * var(--tv-scale)), 20px);
  top: clamp(4px, calc(8px * var(--tv-scale)), 20px);
  max-width: calc(100% - 16px);
  padding: clamp(2px, calc(3px * var(--tv-scale)), 8px) clamp(4px, calc(7px * var(--tv-scale)), 16px);
  border-radius: 2px;
  background: rgba(80, 80, 80, 0.9);
  color: #fff;
  font-size: clamp(9px, calc(13px * var(--tv-scale)), 30px);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-card-badge.is-good {
  background: var(--accent-2);
}

.tv-shelves:not(.is-list-page):not(.is-catalog-menu) .tv-card-badge {
  display: none;
}

.tv-card-title {
  display: -webkit-box;
  min-height: 0;
  max-height: 2.36em;
  margin: clamp(5px, calc(10px * var(--tv-scale)), 24px) 0 calc(2px * var(--tv-scale));
  overflow: hidden;
  color: var(--text);
  font-size: clamp(10px, calc(19px * var(--tv-scale)), 42px);
  line-height: 1.18;
  font-weight: 700;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tv-card-meta {
  min-height: 1.35em;
  color: var(--muted);
  font-size: clamp(9px, calc(16px * var(--tv-scale)), 36px);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-shelves:not(.is-list-page):not(.is-catalog-menu) .tv-card-meta {
  display: none;
}

.tv-skeleton-card {
  pointer-events: none;
}

.tv-skeleton-block,
.tv-skeleton-line,
.tv-profile-skeleton-row {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.09);
}

.tv-skeleton-block::after,
.tv-skeleton-line::after,
.tv-profile-skeleton-row::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.15) 46%, transparent 82%);
  transform: translateX(-100%);
  animation: tvSkeletonSweep 1.15s ease-in-out infinite;
}

@keyframes tvSkeletonSweep {
  to {
    transform: translateX(100%);
  }
}

.tv-skeleton-card .tv-card-media {
  box-shadow: none;
}

.tv-skeleton-card .tv-card-media::after {
  display: none;
}

.tv-skeleton-line {
  display: block;
  border-radius: 4px;
}

.tv-skeleton-card .tv-skeleton-title {
  width: 100%;
  height: 2.36em;
  min-height: 2.36em;
  margin: clamp(5px, calc(10px * var(--tv-scale)), 24px) 0 calc(2px * var(--tv-scale));
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.3em;
  color: transparent;
  background: transparent;
}

.tv-skeleton-card .tv-skeleton-title .tv-skeleton-line {
  width: 88%;
  height: 0.82em;
  min-height: 0.82em;
}

.tv-skeleton-card .tv-skeleton-title .is-title-short {
  width: 64%;
}

.tv-skeleton-card .tv-skeleton-meta {
  width: 100%;
  height: 1.35em;
  min-height: 1.35em;
  display: flex;
  align-items: flex-start;
  color: transparent;
  background: transparent;
}

.tv-skeleton-card .tv-skeleton-meta .tv-skeleton-line {
  width: 62%;
  height: 0.78em;
  min-height: 0.78em;
}

.tv-more-card {
  align-self: flex-start;
  display: block;
}

.tv-more-card .tv-card-media {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
    rgba(5, 5, 5, 0.72);
}

.tv-more-label {
  display: block;
  width: 100%;
  color: #fff;
  font-size: clamp(18px, min(1.35vw, 3vh), 28px);
  line-height: 1;
  font-weight: 700;
  text-align: center;
}

.tv-more-card .tv-card-title {
  min-height: 0;
  margin: 0;
}

.tv-more-card .tv-card-meta {
  min-height: 0;
  visibility: hidden;
}

.tv-empty {
  min-height: 36vh;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 16px;
  padding: var(--topbar) var(--edge) 72px var(--content-left);
}

.tv-empty h2 {
  font-size: clamp(32px, 2.8vw, 54px);
}

.tv-empty p {
  max-width: 760px;
  font-size: clamp(19px, 1.35vw, 25px);
}

.tv-search,
.tv-detail,
.tv-profile,
.tv-player {
  position: fixed;
  z-index: 40;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 5, 5, 0.98), rgba(5, 5, 5, 0.84) 56%, rgba(5, 5, 5, 0.96)),
    rgba(5, 5, 5, 0.94);
}

.tv-profile {
  z-index: 49;
  display: grid;
  align-items: center;
  padding: calc(var(--topbar) + 26px) var(--edge) 58px var(--content-left);
}

.tv-profile.is-login {
  align-items: center;
  justify-items: center;
  padding: clamp(24px, 3.4vh, 48px) var(--edge);
  background: #050505;
  overflow: hidden;
}

.tv-profile.is-subscription {
  background: #050505;
}

.tv-profile-shell {
  width: min(980px, 72vw);
  display: grid;
  gap: clamp(20px, 2.8vh, 34px);
}

.tv-profile.is-login .tv-profile-shell {
  width: min(1240px, calc(100vw - (var(--edge) * 2)));
  max-height: calc(100vh - clamp(48px, 6.8vh, 86px));
  grid-template-columns: minmax(430px, 1fr) minmax(300px, 0.82fr);
  align-items: center;
  justify-items: stretch;
  column-gap: clamp(34px, 4vw, 76px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.tv-profile.is-subscription .tv-profile-shell {
  width: min(1320px, 84vw);
  grid-template-columns: minmax(520px, 1fr) minmax(360px, 0.88fr);
  align-items: start;
  column-gap: clamp(54px, 5vw, 96px);
}

.tv-profile-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(18px, 2.2vw, 34px);
}

.tv-profile.is-login .tv-profile-head {
  grid-column: 1;
  grid-row: 1;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  justify-self: stretch;
  width: min(610px, 100%);
  text-align: left;
}

.tv-profile-avatar {
  width: clamp(98px, 8.6vw, 150px);
  height: clamp(98px, 8.6vw, 150px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.11);
  box-shadow: var(--shadow);
}

.tv-profile-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.tv-profile-avatar svg {
  width: 52%;
  height: 52%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  color: var(--muted);
}

.tv-profile h2 {
  max-width: 16ch;
  font-size: clamp(38px, 3.8vw, 72px);
  line-height: 1;
  font-weight: 700;
}

.tv-profile.is-login h2 {
  max-width: none;
  font-size: clamp(34px, min(3vw, 5.4vh), 58px);
  white-space: normal;
}

.tv-profile.is-subscription h2 {
  max-width: 13ch;
  font-size: clamp(44px, 3.8vw, 78px);
  white-space: normal;
}

.tv-profile-text {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 1.32vw, 25px);
  line-height: 1.42;
}

.tv-profile.is-login .tv-profile-text {
  max-width: 600px;
  margin-top: clamp(14px, 2vh, 26px);
  font-size: clamp(16px, min(1.05vw, 2.25vh), 22px);
  line-height: 1.34;
}

.tv-profile-text span {
  display: block;
}

.tv-profile-text span + span {
  margin-top: 0.75em;
  color: var(--soft);
}

.tv-profile.is-login .tv-profile-text span + span {
  margin-top: clamp(14px, 2.1vh, 28px);
  color: var(--muted);
}

.tv-login-refresh {
  min-height: clamp(48px, 5.4vh, 62px);
  min-width: clamp(200px, 15vw, 300px);
  margin-top: clamp(18px, 2.8vh, 36px);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  font-size: clamp(16px, 1.05vw, 21px);
}

.tv-profile.is-subscription .tv-profile-text {
  max-width: 650px;
}

.tv-profile-body {
  display: grid;
  gap: 18px;
}

.tv-profile-skeleton {
  display: grid;
  gap: 14px;
  width: min(820px, 100%);
}

.tv-profile-skeleton-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(52px, 4vw, 76px);
  align-items: center;
  gap: clamp(18px, 1.6vw, 28px);
  min-height: clamp(68px, 7vh, 88px);
  padding: clamp(18px, 2vh, 26px) clamp(20px, 2.2vw, 30px);
  border-radius: 8px;
  border: 1px solid transparent;
}

.tv-profile-skeleton-row .tv-skeleton-line {
  height: clamp(16px, 1.5vh, 22px);
  background: rgba(255, 255, 255, 0.11);
}

.tv-profile-skeleton-row .tv-skeleton-line.is-short {
  width: clamp(42px, 3vw, 64px);
  justify-self: end;
}

.tv-profile.is-login .tv-profile-body {
  grid-column: 2;
  grid-row: 1;
  width: min(420px, 100%);
  justify-items: center;
  justify-self: start;
  align-self: center;
}

.tv-profile-status {
  display: grid;
  gap: 12px;
  max-width: 820px;
  padding: clamp(20px, 2.2vw, 30px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.tv-profile-login {
  display: grid;
  gap: clamp(14px, 2vh, 24px);
  justify-items: center;
  justify-self: center;
  width: 100%;
  padding: 0;
}

.tv-profile-code {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: clamp(7px, 1vh, 12px);
  justify-items: center;
  margin-top: clamp(4px, 0.7vh, 10px);
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.tv-profile-code span {
  color: var(--muted);
  font-size: clamp(15px, 0.95vw, 19px);
  line-height: 1.25;
  text-align: center;
}

.tv-profile-code strong {
  color: var(--accent);
  font-size: clamp(25px, min(1.8vw, 3.6vh), 36px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.05;
  text-align: center;
}

.tv-profile-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tv-profile-stat {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.tv-profile-stat strong {
  font-size: clamp(24px, 2vw, 38px);
  font-weight: 700;
}

.tv-profile-stat span {
  color: var(--muted);
  font-size: clamp(16px, 1.12vw, 22px);
  line-height: 1.35;
}

.tv-profile-qr {
  width: clamp(300px, 24vw, 430px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.tv-profile.is-login .tv-profile-qr {
  width: min(32vw, 48vh, 390px);
}

.tv-profile.is-login .tv-profile-qr svg rect {
  fill: transparent;
}

.tv-profile.is-login .tv-profile-qr svg path {
  fill: var(--accent);
}

.tv-profile-qr-placeholder {
  width: min(28vw, 42vh, 340px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.tv-profile.is-subscription .tv-profile-qr {
  width: clamp(340px, 26vw, 500px);
}

.tv-profile-qr svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tv-profile-actions {
  padding-top: 0;
}

.tv-profile.is-login .tv-profile-actions {
  display: none;
}

.tv-search {
  z-index: 46;
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
  padding: clamp(16px, calc(46px * var(--tv-scale)), 110px) var(--edge) clamp(52px, calc(116px * var(--tv-scale)), 260px);
  scroll-padding-top: clamp(16px, calc(46px * var(--tv-scale)), 110px);
  scroll-padding-bottom: clamp(52px, calc(116px * var(--tv-scale)), 260px);
}

.tv-search-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  justify-items: center;
  margin-bottom: clamp(18px, calc(52px * var(--tv-scale)), 120px);
  max-height: clamp(72px, calc(150px * var(--tv-scale)), 340px);
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
  transition:
    max-height 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    margin-bottom 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease,
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.tv-search-box {
  position: relative;
  width: min(calc(920px * var(--tv-scale)), 84vw);
  height: clamp(34px, calc(78px * var(--tv-scale)), 180px);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.tv-search-display {
  position: relative;
  max-width: calc(100% - 18px);
  min-width: 0;
  overflow: visible;
  color: var(--text);
  font-size: clamp(22px, calc(56px * var(--tv-scale)), 126px);
  font-weight: 400;
  line-height: 1.08;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-search-display.is-placeholder {
  color: rgba(248, 248, 248, 0.38);
}

.tv-search-box.has-tv-caret.has-value .tv-search-display::after {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(100% + calc(7px * var(--tv-scale)));
  width: clamp(2px, calc(4px * var(--tv-scale)), 9px);
  height: 1.34em;
  border-radius: 999px;
  background: var(--accent);
  transform: translateY(-50%);
  animation: tv-search-caret 1s steps(1) infinite;
  pointer-events: none;
}

@keyframes tv-search-caret {
  50% {
    opacity: 0;
  }
}

.tv-search-box:focus-within {
  border-color: transparent;
  box-shadow: none;
}

.tv-search-box svg {
  display: none;
  width: clamp(22px, 1.5vw, 30px);
  height: clamp(22px, 1.5vw, 30px);
  fill: none;
  stroke: rgba(248, 248, 248, 0.68);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tv-search input {
  position: absolute;
  inset: 0;
  width: 1px;
  height: 1px;
  border: 0;
  border-radius: 0;
  outline: none;
  padding: 0;
  background: transparent;
  color: transparent;
  font-size: clamp(22px, calc(56px * var(--tv-scale)), 126px);
  font-weight: 400;
  text-align: center;
  caret-color: transparent;
  pointer-events: none;
  user-select: none;
  opacity: 0;
}

.tv-search input::placeholder {
  color: rgba(248, 248, 248, 0.38);
}

.tv-search input::-webkit-search-cancel-button,
.tv-search input::-webkit-search-decoration,
.tv-search input::-webkit-search-results-button,
.tv-search input::-webkit-search-results-decoration {
  display: none;
  -webkit-appearance: none;
}

.tv-search-keyboard {
  --keyboard-key: clamp(30px, calc(70px * var(--tv-scale)), 158px);
  width: min(calc(1160px * var(--tv-scale)), 88vw);
  display: grid;
  gap: clamp(5px, calc(14px * var(--tv-scale)), 34px);
  margin: 0 auto clamp(8px, calc(24px * var(--tv-scale)), 58px);
  max-height: clamp(210px, calc(410px * var(--tv-scale)), 920px);
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
  transition:
    max-height 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    margin-bottom 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease,
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.tv-search-keyboard-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(5px, calc(14px * var(--tv-scale)), 34px);
}

.tv-search-key {
  appearance: none;
  -webkit-appearance: none;
  width: var(--keyboard-key);
  min-width: var(--keyboard-key);
  height: var(--keyboard-key);
  min-height: var(--keyboard-key);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  border-radius: 8px;
  box-sizing: border-box;
  outline: none;
  padding: 0;
  background: transparent;
  color: rgba(248, 248, 248, 0.88);
  font-size: clamp(15px, calc(36px * var(--tv-scale)), 82px);
  font-weight: 700;
  line-height: 0.9;
  text-align: center;
  vertical-align: middle;
  box-shadow: none;
  transition: background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.tv-search-key svg {
  display: block;
  width: clamp(16px, calc(34px * var(--tv-scale)), 78px);
  height: clamp(16px, calc(34px * var(--tv-scale)), 78px);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tv-search-key--wide {
  width: calc(var(--keyboard-key) * 2.55 + clamp(5px, calc(14px * var(--tv-scale)), 34px));
  min-width: calc(var(--keyboard-key) * 2.55 + clamp(5px, calc(14px * var(--tv-scale)), 34px));
  justify-items: center;
  padding-inline: clamp(7px, calc(18px * var(--tv-scale)), 42px);
  font-size: clamp(12px, calc(24px * var(--tv-scale)), 54px);
}

.tv-search-key--space {
  width: calc(var(--keyboard-key) * 2 + clamp(5px, calc(14px * var(--tv-scale)), 34px));
  min-width: calc(var(--keyboard-key) * 2 + clamp(5px, calc(14px * var(--tv-scale)), 34px));
}

.tv-search-key.is-active,
.tv-search-key.is-focused,
.tv-search-key:focus-visible {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 14px 34px rgba(1, 176, 255, 0.22);
  transform: none;
}

.tv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--card-w));
  justify-content: start;
  gap: clamp(12px, calc(28px * var(--tv-scale)), 64px) clamp(8px, calc(20px * var(--tv-scale)), 46px);
  align-items: start;
}

.tv-search-results {
  min-height: auto;
  overflow: visible;
  padding: clamp(10px, calc(28px * var(--tv-scale)), 66px) 0 clamp(52px, calc(116px * var(--tv-scale)), 260px);
  scroll-padding-top: clamp(12px, calc(30px * var(--tv-scale)), 70px);
  scroll-padding-bottom: clamp(52px, calc(116px * var(--tv-scale)), 260px);
  transition: padding-top 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.tv-search.is-results-stage .tv-search-head,
.tv-search.is-results-stage .tv-search-keyboard {
  max-height: 0;
  margin-bottom: 0;
  opacity: 0;
  transform: translateY(clamp(-48px, calc(-22px * var(--tv-scale)), -12px));
  pointer-events: none;
}

.tv-search.is-results-stage .tv-search-results {
  padding-top: clamp(28px, calc(72px * var(--tv-scale)), 160px);
}

@media (prefers-reduced-motion: reduce) {
  .tv-search-head,
  .tv-search-keyboard,
  .tv-search-results {
    transition-duration: 0.01ms;
  }
}

.tv-search-results::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.tv-search .tv-grid {
  width: 100%;
  justify-content: center;
}

.tv-search .tv-list-more-wrap {
  padding-top: clamp(14px, calc(40px * var(--tv-scale)), 92px);
  padding-bottom: clamp(20px, calc(52px * var(--tv-scale)), 122px);
}

.tv-grid .tv-card,
.tv-grid .tv-card-media {
  width: var(--card-w);
}

.tv-inline-state {
  grid-column: 1 / -1;
  min-height: 140px;
  display: grid;
  align-items: center;
  color: var(--muted);
  font-size: clamp(24px, 2vw, 38px);
  font-weight: 700;
}

.tv-detail {
  z-index: 48;
  display: grid;
  grid-template-columns: clamp(150px, calc(340px * var(--tv-scale)), 760px) minmax(0, calc(760px * var(--tv-scale)));
  align-items: center;
  gap: clamp(18px, calc(70px * var(--tv-scale)), 160px);
  padding: calc(var(--topbar) + calc(28px * var(--tv-scale))) var(--edge) clamp(34px, calc(58px * var(--tv-scale)), 140px) calc(var(--edge) + clamp(12px, calc(28px * var(--tv-scale)), 66px));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.tv-detail::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--detail-bg);
  background-position: center;
  background-size: cover;
  opacity: 0.22;
  filter: saturate(1.05);
}

.tv-detail::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(5, 5, 5, 0.98), rgba(5, 5, 5, 0.76) 52%, rgba(5, 5, 5, 0.96));
}


.tv-close {
  position: absolute;
  top: clamp(24px, 3.2vh, 42px);
  right: var(--edge);
}

.tv-msx-exit {
  display: none !important;
}

html.is-msx-runtime .tv-detail .tv-close {
  z-index: 6;
  display: grid;
  place-items: center;
  width: clamp(40px, calc(58px * var(--tv-scale)), 132px);
  min-height: 0;
  height: clamp(40px, calc(58px * var(--tv-scale)), 132px);
  padding: 0;
}

html.is-msx-runtime .tv-detail .tv-close svg {
  width: 48%;
  height: 48%;
}

html.is-msx-runtime .tv-player.is-player-paused .direct-player-center-play:focus,
html.is-msx-runtime .tv-player.is-player-paused .direct-player-center-play:focus-visible {
  background: rgba(0, 0, 0, 0.68);
  outline: none;
  box-shadow: none;
}

.tv-detail-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(145deg, #202020, #0d0d0d);
  box-shadow: var(--shadow);
}

.tv-detail-poster img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.tv-detail-poster .tv-no-poster-placeholder img {
  width: clamp(42px, 31%, 70px);
  height: auto;
  object-fit: contain;
}

.tv-detail-info {
  display: grid;
  gap: clamp(8px, calc(16px * var(--tv-scale)), 38px);
}

.tv-detail h2 {
  max-width: 13ch;
  font-size: clamp(26px, calc(64px * var(--tv-scale)), 144px);
  line-height: 1;
  font-weight: 700;
}

.tv-detail-text {
  display: -webkit-box;
  max-width: calc(880px * var(--tv-scale));
  overflow: hidden;
  color: #fff;
  font-size: clamp(13px, calc(24px * var(--tv-scale)), 54px);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 8;
}

.tv-player {
  z-index: 60;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  padding: 0;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.tv-player:focus,
.tv-player:focus-visible,
.tv-player.is-focused {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.tv-player-bar {
  display: none;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 0 0 clamp(14px, 1.6vh, 24px);
}

.tv-player h2 {
  overflow: hidden;
  font-size: clamp(24px, 2vw, 40px);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-player .tv-close {
  position: static;
}

.tv-player iframe,
.tv-player video {
  grid-area: 1 / 1;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: #000;
}

.tv-player video {
  object-fit: contain;
  outline: none;
}

.tv-player video::-webkit-media-controls,
.tv-player video::-webkit-media-controls-enclosure,
.tv-player video::-webkit-media-controls-panel {
  display: none !important;
  opacity: 0 !important;
}

.tv-player-ui {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 30%),
    linear-gradient(180deg, transparent 52%, rgba(0, 0, 0, 0.78));
  transition: opacity 0.16s ease;
}

.tv-player-ui.is-visible,
.tv-player-ui.is-paused,
.tv-player-ui.is-buffering {
  opacity: 1;
}

.tv-player-bottom {
  position: absolute;
  left: clamp(30px, 3.2vw, 70px);
  right: clamp(30px, 3.2vw, 70px);
  bottom: clamp(26px, 4.2vh, 58px);
  display: grid;
  gap: clamp(12px, 1.4vh, 18px);
}

.tv-player-progress {
  position: relative;
  height: clamp(6px, 0.7vh, 10px);
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.tv-player-progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: var(--accent);
  box-shadow: 0 0 24px rgba(1, 176, 255, 0.42);
}

.tv-player-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(16px, 1.08vw, 22px);
  font-weight: 700;
  line-height: 1;
}

@keyframes tv-player-spin {
  to {
    transform: rotate(360deg);
  }
}

.tv-player.player {
  background: #000;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.tv-player .direct-player-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 14;
  min-width: clamp(140px, calc(280px * var(--tv-scale)), 640px);
  min-height: clamp(42px, calc(72px * var(--tv-scale)), 164px);
  display: grid;
  grid-template-columns: auto minmax(0, auto);
  align-items: center;
  justify-content: center;
  gap: clamp(8px, calc(16px * var(--tv-scale)), 38px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(10, 10, 10, 0.72);
  color: #fff;
  font-size: clamp(13px, calc(23px * var(--tv-scale)), 52px);
  font-weight: 700;
  line-height: 1.15;
  padding: clamp(8px, calc(16px * var(--tv-scale)), 38px) clamp(12px, calc(26px * var(--tv-scale)), 62px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.38);
}

.tv-player .direct-player-loading[hidden] {
  display: none;
}

.tv-player .direct-player-loading-spinner {
  width: clamp(18px, calc(38px * var(--tv-scale)), 86px);
  aspect-ratio: 1;
  border-radius: 999px;
  border: 4px solid rgba(255, 255, 255, 0.24);
  border-top-color: #fff;
  animation: tv-player-loading-spin 0.82s linear infinite;
}

@keyframes tv-player-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.tv-player .direct-player-loading-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tv-player.is-player-loading .direct-player-center-play,
.tv-player.is-player-buffering .direct-player-center-play {
  opacity: 0;
  pointer-events: none;
}

.tv-player .player-video {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  cursor: default;
  object-fit: contain;
}

.tv-player .player-video.subtitle-size-standard::cue {
  font-size: 100%;
}

.tv-player .player-video.subtitle-size-large::cue {
  font-size: 125%;
}

.tv-player .player-video.subtitle-size-huge::cue {
  font-size: 155%;
}

.tv-player .direct-player-subtitles {
  position: absolute;
  left: clamp(28px, calc(96px * var(--tv-scale)), 240px);
  right: clamp(28px, calc(96px * var(--tv-scale)), 240px);
  bottom: clamp(56px, calc(128px * var(--tv-scale)), 300px);
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-height: 4.1em;
  max-height: 4.1em;
  overflow: hidden;
  color: #fff;
  font-size: clamp(16px, calc(34px * var(--tv-scale)), 76px);
  font-weight: 700;
  line-height: 1.22;
  pointer-events: none;
  text-align: center;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.96),
    0 0 14px rgba(0, 0, 0, 0.9);
}

.tv-player .direct-player-subtitles[hidden],
.tv-player .direct-player-subtitles:empty {
  display: none;
}

.tv-player .direct-player-subtitles span {
  display: block;
  max-width: 100%;
  padding: 0 0.1em;
  overflow-wrap: anywhere;
}

.tv-player .direct-player-subtitles.subtitle-size-large {
  font-size: clamp(22px, calc(48px * var(--tv-scale)), 108px);
}

.tv-player .direct-player-subtitles.subtitle-size-huge {
  font-size: clamp(28px, calc(58px * var(--tv-scale)), 132px);
}

.tv-player .direct-player-poster {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
  background-color: #050505;
  background-position: center;
  background-size: contain;
  filter: saturate(1.04);
  transform: none;
  pointer-events: none;
}

.tv-player .direct-player-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.18) 46%, rgba(0, 0, 0, 0.42)),
    radial-gradient(circle at 50% 48%, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.46) 74%);
}

.tv-player .direct-player-ui {
  z-index: 8;
  pointer-events: none;
  background: none;
}

.tv-player .direct-player-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: clamp(18px, calc(38px * var(--tv-scale)), 90px) clamp(34px, calc(78px * var(--tv-scale)), 180px) clamp(50px, calc(104px * var(--tv-scale)), 240px) clamp(22px, calc(48px * var(--tv-scale)), 112px);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.68) 0%, rgba(0, 0, 0, 0.32) 46%, rgba(0, 0, 0, 0) 100%);
  color: #fff;
  pointer-events: none;
}

.tv-player .direct-player-title-stack {
  min-width: 0;
  max-width: min(58vw, calc(920px * var(--tv-scale)));
  display: grid;
  gap: clamp(3px, calc(6px * var(--tv-scale)), 16px);
}

.tv-player .direct-player-title {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(22px, calc(48px * var(--tv-scale)), 108px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0;
  text-transform: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.42);
}

.tv-player .direct-player-episode-title {
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(12px, calc(24px * var(--tv-scale)), 54px);
  font-weight: 600;
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.42);
}

.tv-player .direct-player-bottom-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-rows: auto auto;
  align-content: end;
  gap: clamp(2px, calc(4px * var(--tv-scale)), 10px);
  min-height: clamp(94px, calc(150px * var(--tv-scale)), 340px);
  padding: 0 clamp(18px, calc(44px * var(--tv-scale)), 104px) clamp(12px, calc(28px * var(--tv-scale)), 66px);
  background: transparent;
  color: #fff;
  pointer-events: auto;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.tv-player.has-player-settings-window::before,
.tv-player.has-player-serial-window::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 18;
  background: rgba(0, 0, 0, 0.34);
  pointer-events: none;
}

.tv-player.has-player-settings-window .direct-player-ui,
.tv-player.has-player-serial-window .direct-player-ui {
  z-index: auto;
}

.tv-player.has-player-settings-window .direct-player-bottom-panel,
.tv-player.has-player-serial-window .direct-player-bottom-panel {
  z-index: 31;
}

.tv-player.has-player-menu-open .direct-player-center-play,
.tv-player.has-player-menu-open .direct-player-feedback {
  opacity: 0 !important;
  pointer-events: none !important;
}

.tv-player.has-player-menu-open .direct-player-loading {
  display: none !important;
}

.tv-player.has-player-menu-open .direct-player-progress-row {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.tv-player .direct-player-progress-row {
  order: 1;
  display: grid;
  grid-template-columns: minmax(clamp(58px, calc(104px * var(--tv-scale)), 235px), auto) minmax(0, 1fr) minmax(clamp(76px, calc(118px * var(--tv-scale)), 270px), auto);
  align-items: center;
  gap: clamp(8px, calc(16px * var(--tv-scale)), 38px);
  min-height: clamp(28px, calc(42px * var(--tv-scale)), 100px);
}

.tv-player .direct-player-time {
  min-width: clamp(58px, calc(108px * var(--tv-scale)), 250px);
  color: #fff;
  font-size: clamp(12px, calc(24px * var(--tv-scale)), 54px);
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.72);
  white-space: nowrap;
}

.tv-player .direct-player-time-current {
  display: block;
  text-align: left;
}

.tv-player .direct-player-time-duration {
  min-width: clamp(76px, calc(118px * var(--tv-scale)), 270px);
  text-align: right;
}

.tv-player .direct-player-progress-wrap {
  position: relative;
  min-width: 0;
  display: grid;
  align-items: center;
}

.tv-player .direct-player-hover-time {
  position: absolute;
  left: var(--direct-hover-percent, 50%);
  bottom: calc(100% + calc(16px * var(--tv-scale)));
  z-index: 2;
  min-width: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: clamp(14px, calc(28px * var(--tv-scale)), 64px);
  font-weight: 700;
  line-height: 1;
  padding: 0;
  pointer-events: none;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
  transform: translateX(-50%);
  white-space: nowrap;
}

.tv-player .direct-player-hover-time.is-hover {
  background: transparent;
}

.tv-player .direct-player-progress,
.tv-player .direct-player-volume {
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.tv-player .direct-player-progress {
  width: 100%;
  height: clamp(20px, calc(30px * var(--tv-scale)), 70px);
}

.tv-player .direct-player-progress::-webkit-slider-runnable-track,
.tv-player .direct-player-volume::-webkit-slider-runnable-track {
  height: clamp(4px, calc(7px * var(--tv-scale)), 16px);
  border-radius: 999px;
  background: linear-gradient(90deg, #16b8ff 0%, #16b8ff var(--direct-progress-percent, 0%), rgba(255, 255, 255, 0.36) var(--direct-progress-percent, 0%), rgba(255, 255, 255, 0.36) 100%);
}

.tv-player .direct-player-progress:focus-visible {
  outline: none;
}

.tv-player .direct-player-progress:focus-visible::-webkit-slider-runnable-track {
  box-shadow: 0 0 0 5px #fff;
}

.tv-player .direct-player-volume::-webkit-slider-runnable-track {
  height: clamp(4px, calc(7px * var(--tv-scale)), 16px);
  background: linear-gradient(90deg, #16b8ff 0%, #16b8ff var(--direct-volume-percent, 100%), rgba(255, 255, 255, 0.32) var(--direct-volume-percent, 100%), rgba(255, 255, 255, 0.32) 100%);
}

.tv-player .direct-player-progress::-webkit-slider-thumb,
.tv-player .direct-player-volume::-webkit-slider-thumb {
  width: clamp(14px, calc(22px * var(--tv-scale)), 52px);
  height: clamp(14px, calc(22px * var(--tv-scale)), 52px);
  margin-top: calc(clamp(4px, calc(7px * var(--tv-scale)), 16px) * -1);
  border: 0;
  border-radius: 50%;
  background: #16b8ff;
  box-shadow: 0 2px 10px rgba(1, 176, 255, 0.38), 0 1px 8px rgba(0, 0, 0, 0.42);
  appearance: none;
  -webkit-appearance: none;
}

.tv-player .direct-player-volume::-webkit-slider-thumb {
  width: clamp(12px, calc(19px * var(--tv-scale)), 44px);
  height: clamp(12px, calc(19px * var(--tv-scale)), 44px);
  margin-top: calc(clamp(3px, calc(6px * var(--tv-scale)), 14px) * -1);
}

.tv-player .direct-player-progress::-moz-range-track {
  height: clamp(4px, calc(7px * var(--tv-scale)), 16px);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
}

.tv-player .direct-player-progress:focus-visible::-moz-range-track {
  box-shadow: 0 0 0 5px #fff;
}

.tv-player .direct-player-progress::-moz-range-progress {
  height: clamp(4px, calc(7px * var(--tv-scale)), 16px);
  border-radius: 999px;
  background: #16b8ff;
}

.tv-player .direct-player-progress::-moz-range-thumb {
  width: clamp(14px, calc(22px * var(--tv-scale)), 52px);
  height: clamp(14px, calc(22px * var(--tv-scale)), 52px);
  border: 0;
  border-radius: 50%;
  background: #16b8ff;
  box-shadow: 0 2px 10px rgba(1, 176, 255, 0.38), 0 1px 8px rgba(0, 0, 0, 0.42);
}

.tv-player .direct-player-progress:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 5px #fff, 0 2px 10px rgba(1, 176, 255, 0.38), 0 1px 8px rgba(0, 0, 0, 0.42);
}

.tv-player .direct-player-progress:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 5px #fff, 0 2px 10px rgba(1, 176, 255, 0.38), 0 1px 8px rgba(0, 0, 0, 0.42);
}

.tv-player .direct-player-volume::-moz-range-track {
  height: clamp(4px, calc(7px * var(--tv-scale)), 16px);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
}

.tv-player .direct-player-volume::-moz-range-progress {
  height: clamp(4px, calc(7px * var(--tv-scale)), 16px);
  border-radius: 999px;
  background: #16b8ff;
}

.tv-player .direct-player-volume::-moz-range-thumb {
  width: clamp(12px, calc(19px * var(--tv-scale)), 44px);
  height: clamp(12px, calc(19px * var(--tv-scale)), 44px);
  border: 0;
  border-radius: 50%;
  background: #16b8ff;
  box-shadow: 0 1px 8px rgba(1, 176, 255, 0.34), 0 1px 6px rgba(0, 0, 0, 0.34);
}

.tv-player .direct-player-toolbar {
  order: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, calc(14px * var(--tv-scale)), 34px);
  min-height: clamp(40px, calc(62px * var(--tv-scale)), 144px);
}

.tv-player .direct-player-panel-left,
.tv-player .direct-player-panel-right {
  display: flex;
  align-items: center;
  gap: clamp(8px, calc(14px * var(--tv-scale)), 34px);
  min-width: 0;
}

.tv-player .direct-player-episode-nav-left {
  gap: clamp(4px, calc(8px * var(--tv-scale)), 20px);
}

.tv-player .direct-player-panel-right {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.tv-player .direct-player-panel-left {
  display: flex !important;
  justify-content: flex-start;
  margin-right: auto;
}

.tv-player .direct-player-panel-left #playerPlay,
.tv-player .direct-player-panel-left .direct-player-volume-wrap {
  display: none !important;
}

.tv-player .direct-player-panel-right {
  margin-left: auto;
}

.tv-player .direct-player-panel-btn,
.tv-player .direct-player-option-btn {
  min-width: clamp(38px, calc(58px * var(--tv-scale)), 136px);
  min-height: clamp(38px, calc(58px * var(--tv-scale)), 136px);
  border: 2px solid transparent;
  border-radius: clamp(7px, calc(12px * var(--tv-scale)), 28px);
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: clamp(12px, calc(18px * var(--tv-scale)), 42px);
  font-weight: 700;
  line-height: 1;
  transition: border-color 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.tv-player .direct-player-panel-btn {
  display: grid;
  place-items: center;
  padding: 0;
}

.tv-player .direct-player-panel-btn svg,
.tv-player .direct-player-option-icon svg {
  width: clamp(24px, calc(38px * var(--tv-scale)), 88px);
  height: clamp(24px, calc(38px * var(--tv-scale)), 88px);
  display: block;
  fill: currentColor;
}

.tv-player .direct-player-panel-btn svg path[fill="none"],
.tv-player .direct-player-option-icon svg path[fill="none"] {
  stroke: currentColor;
}

.tv-player .direct-player-panel-btn:hover,
.tv-player .direct-player-panel-btn:focus-visible,
.tv-player .direct-player-panel-btn.is-focused,
.tv-player .direct-player-option-btn:hover,
.tv-player .direct-player-option-btn:focus-visible,
.tv-player .direct-player-option-btn.is-focused {
  border-color: transparent;
  background: transparent;
  color: #fff;
  opacity: 1;
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.92);
}

.tv-player .direct-player-panel-btn.active,
.tv-player .direct-player-option-btn.active {
  border-color: transparent;
  background: transparent;
  color: #fff;
  opacity: 1;
  outline: none;
  box-shadow: none;
}

.tv-player .direct-player-panel-btn.active:hover,
.tv-player .direct-player-panel-btn.active:focus-visible,
.tv-player .direct-player-panel-btn.active.is-focused,
.tv-player .direct-player-option-btn.active:hover,
.tv-player .direct-player-option-btn.active:focus-visible,
.tv-player .direct-player-option-btn.active.is-focused {
  border-color: transparent;
  background: transparent;
  opacity: 1;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.92);
}

.tv-player .direct-player-toolbar:has(.direct-player-panel-btn:hover, .direct-player-option-btn:hover, .direct-player-panel-btn:focus-visible, .direct-player-option-btn:focus-visible, .direct-player-panel-btn.is-focused, .direct-player-option-btn.is-focused, .direct-player-panel-btn.active, .direct-player-option-btn.active) .direct-player-panel-btn:not(:hover):not(:focus-visible):not(.is-focused):not(.active):not(:disabled),
.tv-player .direct-player-toolbar:has(.direct-player-panel-btn:hover, .direct-player-option-btn:hover, .direct-player-panel-btn:focus-visible, .direct-player-option-btn:focus-visible, .direct-player-panel-btn.is-focused, .direct-player-option-btn.is-focused, .direct-player-panel-btn.active, .direct-player-option-btn.active) .direct-player-option-btn:not(:hover):not(:focus-visible):not(.is-focused):not(.active):not(:disabled) {
  color: #efeff1;
  opacity: 0.74;
}

.tv-player .direct-player-panel-btn:disabled,
.tv-player .direct-player-option-btn:disabled {
  cursor: default;
  opacity: 0.35;
}

.tv-player .direct-player-panel-btn:disabled:hover,
.tv-player .direct-player-panel-btn:disabled:focus-visible,
.tv-player .direct-player-option-btn:disabled:hover,
.tv-player .direct-player-option-btn:disabled:focus-visible {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.tv-player #playerFullscreen,
.tv-player #playerClose {
  display: none !important;
}

.tv-player .direct-player-volume-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-width: clamp(44px, calc(76px * var(--tv-scale)), 170px);
  min-height: clamp(44px, calc(76px * var(--tv-scale)), 170px);
  border-radius: 999px;
}

.tv-player .direct-player-volume {
  width: 0;
  height: clamp(16px, calc(24px * var(--tv-scale)), 56px);
  opacity: 0;
  pointer-events: none;
  transition: width 0.16s ease, opacity 0.16s ease, margin-left 0.16s ease;
}

.tv-player .direct-player-volume-wrap:hover,
.tv-player .direct-player-volume-wrap:focus-within {
  gap: clamp(8px, calc(14px * var(--tv-scale)), 34px);
  min-width: clamp(120px, calc(210px * var(--tv-scale)), 470px);
}

.tv-player .direct-player-volume-wrap:hover .direct-player-volume,
.tv-player .direct-player-volume-wrap:focus-within .direct-player-volume {
  width: clamp(78px, calc(130px * var(--tv-scale)), 300px);
  opacity: 1;
  pointer-events: auto;
}

.tv-player .direct-player-volume-tip {
  position: absolute;
  left: var(--direct-volume-tip-x, 78px);
  bottom: calc(100% + calc(18px * var(--tv-scale)));
  z-index: 21;
  display: block;
  min-width: clamp(42px, calc(74px * var(--tv-scale)), 170px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 13px;
  background: rgba(32, 32, 32, 0.98);
  color: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.38);
  font-size: clamp(12px, calc(20px * var(--tv-scale)), 46px);
  font-weight: 700;
  line-height: 1;
  padding: clamp(7px, calc(12px * var(--tv-scale)), 28px) clamp(8px, calc(14px * var(--tv-scale)), 34px);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, 8px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  white-space: nowrap;
}

.tv-player .direct-player-volume-tip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% - 1px);
  width: 0;
  height: 0;
  border-top: 8px solid rgba(32, 32, 32, 0.98);
  border-right: 8px solid transparent;
  border-left: 8px solid transparent;
  transform: translateX(-50%);
}

.tv-player .direct-player-volume-wrap:hover .direct-player-volume-tip,
.tv-player .direct-player-volume-wrap:focus-within .direct-player-volume-tip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.tv-player .direct-player-menu-wrap {
  position: relative;
}

.tv-player .direct-player-option-btn {
  display: inline-flex;
  align-items: center;
  gap: clamp(8px, calc(14px * var(--tv-scale)), 34px);
  max-width: clamp(160px, calc(270px * var(--tv-scale)), 620px);
  padding: 0 clamp(10px, calc(18px * var(--tv-scale)), 42px);
  white-space: nowrap;
}

.tv-player .direct-player-audio-wrap .direct-player-option-btn {
  max-width: clamp(190px, calc(320px * var(--tv-scale)), 740px);
}

.tv-player .direct-player-audio-wrap {
  display: none !important;
}

.tv-player .direct-player-season-wrap .direct-player-option-btn,
.tv-player .direct-player-episode-wrap .direct-player-option-btn {
  max-width: clamp(190px, calc(330px * var(--tv-scale)), 760px);
}

.tv-player .direct-player-quality-wrap .direct-player-option-btn {
  max-width: clamp(120px, calc(210px * var(--tv-scale)), 490px);
}

.tv-player .direct-player-settings-submenu-quality {
  padding: 0;
}

.tv-player .direct-player-season-wrap .direct-player-option-btn.active:not(:hover):not(:focus-visible):not(.is-focused) {
  background: transparent;
  box-shadow: none;
}

.tv-player .direct-player-season-wrap .direct-player-option-btn:focus-visible,
.tv-player .direct-player-season-wrap .direct-player-option-btn.is-focused,
.tv-player .direct-player-season-wrap .direct-player-option-btn.active:focus-visible,
.tv-player .direct-player-season-wrap .direct-player-option-btn.active.is-focused {
  background: transparent;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.92);
}

.tv-player .direct-player-option-prefix {
  min-width: clamp(20px, calc(34px * var(--tv-scale)), 78px);
  display: inline-grid;
  place-items: center;
  color: currentColor;
  font-size: clamp(12px, calc(18px * var(--tv-scale)), 42px);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tv-player .direct-player-option-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.tv-player .direct-player-option-btn small {
  max-width: clamp(90px, calc(150px * var(--tv-scale)), 350px);
  overflow: hidden;
  color: currentColor;
  font-size: clamp(13px, calc(21px * var(--tv-scale)), 48px);
  font-weight: 700;
  text-overflow: ellipsis;
}

.tv-player .direct-player-audio-wrap .direct-player-option-btn small {
  max-width: clamp(120px, calc(208px * var(--tv-scale)), 480px);
}

.tv-player .direct-player-season-wrap .direct-player-option-btn small,
.tv-player .direct-player-episode-wrap .direct-player-option-btn small {
  max-width: clamp(130px, calc(220px * var(--tv-scale)), 510px);
}

.tv-player .direct-player-quality-wrap .direct-player-option-btn small {
  max-width: clamp(58px, calc(96px * var(--tv-scale)), 230px);
}

.tv-player .direct-player-quality-badge {
  width: auto !important;
  min-width: clamp(28px, calc(46px * var(--tv-scale)), 106px);
  height: clamp(22px, calc(34px * var(--tv-scale)), 80px);
  display: inline-grid;
  place-items: center;
  padding: 0 clamp(3px, calc(6px * var(--tv-scale)), 16px);
  border: 3px solid currentColor;
  border-radius: 6px;
  color: currentColor;
  font-size: clamp(9px, calc(15px * var(--tv-scale)), 36px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  filter: none;
}

.tv-player .direct-player-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + calc(16px * var(--tv-scale)));
  z-index: 20;
  width: min(calc(470px * var(--tv-scale)), calc(100vw - calc(48px * var(--tv-scale))));
  max-height: min(calc(640px * var(--tv-scale)), 72vh);
  overflow: auto;
  padding: 0 0 clamp(8px, calc(14px * var(--tv-scale)), 34px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  background: #111;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.46);
}

.tv-player .direct-player-menu.direct-player-settings-submenu-quality {
  padding: 0;
}

.tv-player .direct-player-main-settings-menu {
  position: absolute;
  left: auto;
  top: auto;
  right: 0;
  bottom: calc(100% + calc(18px * var(--tv-scale)));
  z-index: 28;
  width: min(calc(650px * var(--tv-scale)), calc(100vw - calc(96px * var(--tv-scale))));
  max-height: none;
  overflow: visible;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  background: #111;
  box-shadow: 0 28px 86px rgba(0, 0, 0, 0.58);
  transform: none;
}

.tv-player .direct-player-main-settings-menu.is-subview {
  width: min(calc(590px * var(--tv-scale)), calc(100vw - calc(96px * var(--tv-scale))));
  max-height: min(calc(760px * var(--tv-scale)), calc(100vh - calc(170px * var(--tv-scale))));
  overflow: auto;
  scroll-padding-top: clamp(62px, calc(100px * var(--tv-scale)), 228px);
  padding: 0;
}

.tv-player .direct-player-settings-header {
  min-height: clamp(58px, calc(92px * var(--tv-scale)), 210px);
  display: grid;
  grid-template-columns: clamp(58px, calc(96px * var(--tv-scale)), 220px) minmax(0, 1fr);
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.tv-player .direct-player-settings-header-main {
  grid-template-columns: minmax(0, 1fr);
  padding: 0 clamp(20px, calc(36px * var(--tv-scale)), 84px);
}

.tv-player .direct-player-settings-back {
  width: clamp(58px, calc(96px * var(--tv-scale)), 220px);
  height: clamp(58px, calc(96px * var(--tv-scale)), 220px);
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: clamp(46px, calc(76px * var(--tv-scale)), 176px);
  font-weight: 500;
  line-height: 1;
  padding: 0 0 8px;
}

.tv-player .direct-player-settings-back:hover,
.tv-player .direct-player-settings-back:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}

.tv-player .direct-player-settings-title {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: clamp(20px, calc(32px * var(--tv-scale)), 74px);
  font-weight: 700;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-player .direct-player-settings-list {
  padding: clamp(6px, calc(10px * var(--tv-scale)), 24px) 0 clamp(10px, calc(18px * var(--tv-scale)), 42px);
}

.tv-player .direct-player-main-settings-menu:not(.is-subview) .direct-player-settings-list {
  overflow: visible;
}

.tv-player .direct-player-settings-choice {
  width: 100%;
  min-height: clamp(58px, calc(96px * var(--tv-scale)), 220px);
  display: grid;
  grid-template-columns: clamp(32px, calc(52px * var(--tv-scale)), 120px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(10px, calc(18px * var(--tv-scale)), 42px);
  border: 0;
  background: transparent;
  color: #fff;
  padding: 0 clamp(20px, calc(36px * var(--tv-scale)), 84px);
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.tv-player .direct-player-settings-choice:disabled,
.tv-player .direct-player-settings-row:disabled {
  color: #fff;
}

.tv-player .direct-player-settings-row {
  min-height: clamp(54px, calc(86px * var(--tv-scale)), 198px);
  grid-template-columns: clamp(36px, calc(58px * var(--tv-scale)), 134px) minmax(clamp(96px, calc(150px * var(--tv-scale)), 350px), auto) minmax(0, 1fr);
  gap: clamp(10px, calc(18px * var(--tv-scale)), 42px);
  padding: 0 clamp(20px, calc(36px * var(--tv-scale)), 84px);
}

.tv-player .direct-player-settings-row:disabled {
  cursor: default;
  opacity: 1;
}

.tv-player .direct-player-settings-row-icon {
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.88);
}

.tv-player .direct-player-settings-row-icon svg {
  width: clamp(26px, calc(42px * var(--tv-scale)), 96px);
  height: clamp(26px, calc(42px * var(--tv-scale)), 96px);
  display: block;
  fill: currentColor;
}

.tv-player .direct-player-settings-row-icon svg path[fill="none"] {
  stroke: currentColor;
}

.tv-player .direct-player-settings-row-title {
  color: #fff;
  font-size: clamp(17px, calc(28px * var(--tv-scale)), 64px);
  font-weight: 700;
}

.tv-player .direct-player-settings-row-value {
  min-width: 0;
  overflow: hidden;
  justify-self: end;
  max-width: 100%;
  color: rgba(255, 255, 255, 0.62);
  font-size: clamp(16px, calc(26px * var(--tv-scale)), 60px);
  font-weight: 700;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-player .direct-player-settings-hd-icon {
  min-width: clamp(28px, calc(46px * var(--tv-scale)), 106px);
  height: clamp(22px, calc(34px * var(--tv-scale)), 80px);
  display: inline-grid;
  place-items: center;
  border: 3px solid currentColor;
  border-radius: 6px;
  font-size: clamp(9px, calc(15px * var(--tv-scale)), 36px);
  font-weight: 700;
  line-height: 1;
}

.tv-player .direct-player-settings-choice strong {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(18px, calc(30px * var(--tv-scale)), 70px);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-player .direct-player-settings-row .direct-player-settings-row-title {
  font-size: clamp(17px, calc(28px * var(--tv-scale)), 64px);
  font-weight: 700;
}

.tv-player .direct-player-settings-choice-marker {
  display: grid;
  place-items: center;
  color: #16b8ff;
  font-size: clamp(17px, calc(28px * var(--tv-scale)), 64px);
  font-weight: 700;
  line-height: 1;
}

.tv-player .direct-player-episode-play-marker svg {
  width: clamp(14px, calc(23px * var(--tv-scale)), 54px);
  height: clamp(14px, calc(23px * var(--tv-scale)), 54px);
  display: block;
}

.tv-player .direct-player-settings-choice.active {
  background: rgba(255, 255, 255, 0.07);
}

.tv-player .direct-player-settings-choice:hover,
.tv-player .direct-player-settings-choice.is-focused,
.tv-player .direct-player-settings-choice:focus-visible {
  background: rgba(255, 255, 255, 0.13);
  outline: none;
  box-shadow: none;
}

.tv-player .direct-player-settings-choice:disabled:hover,
.tv-player .direct-player-settings-choice:disabled.is-focused,
.tv-player .direct-player-settings-choice:disabled:focus-visible {
  background: transparent;
  box-shadow: none;
}

.tv-player .direct-player-serial-settings-menu {
  position: absolute;
  left: auto;
  top: auto;
  right: 0;
  bottom: calc(100% + calc(18px * var(--tv-scale)));
  z-index: 28;
  width: min(calc(650px * var(--tv-scale)), calc(100vw - calc(96px * var(--tv-scale))));
  max-height: min(calc(760px * var(--tv-scale)), calc(100vh - calc(170px * var(--tv-scale))));
  overflow: auto;
  scroll-padding-top: clamp(62px, calc(100px * var(--tv-scale)), 228px);
  padding: 0;
  border-color: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  background: #111;
  box-shadow: 0 28px 86px rgba(0, 0, 0, 0.58);
  transform: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.tv-player .direct-player-serial-settings-menu .direct-player-settings-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #111;
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}

.tv-player .direct-player-serial-settings-menu::-webkit-scrollbar {
  width: 8px;
}

.tv-player .direct-player-serial-settings-menu::-webkit-scrollbar-track {
  background: transparent;
}

.tv-player .direct-player-serial-settings-menu::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.tv-player .direct-player-season-list {
  padding: 0;
}

.tv-player .direct-player-season-group {
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.tv-player .direct-player-season-group:last-child {
  border-bottom: 0;
}

.tv-player .direct-player-season-row {
  grid-template-columns: clamp(32px, calc(52px * var(--tv-scale)), 120px) minmax(0, 1fr) auto clamp(24px, calc(42px * var(--tv-scale)), 96px);
}

.tv-player .direct-player-season-row.active,
.tv-player .direct-player-season-row.is-playing-season {
  background: rgba(255, 255, 255, 0.055);
}

.tv-player .direct-player-season-row.active.is-playing-season {
  background: rgba(255, 255, 255, 0.08);
}

.tv-player .direct-player-season-row.active:not(.is-playing-season) {
  background: rgba(255, 255, 255, 0.075);
}

.tv-player .direct-player-season-row.is-playing-season .direct-player-settings-row-title,
.tv-player .direct-player-season-row.is-playing-season .direct-player-season-count {
  color: #fff;
}

.tv-player .direct-player-season-count {
  max-width: clamp(92px, calc(160px * var(--tv-scale)), 380px);
}

.tv-player .direct-player-season-chevron {
  display: grid;
  place-items: center;
  justify-self: center;
  align-self: center;
  width: clamp(24px, calc(40px * var(--tv-scale)), 92px);
  height: clamp(24px, calc(40px * var(--tv-scale)), 92px);
  color: rgba(255, 255, 255, 0.68);
  transform: rotate(90deg);
  transform-origin: center;
}

.tv-player .direct-player-season-row.is-expanded .direct-player-season-chevron {
  transform: rotate(-90deg);
}

.tv-player .direct-player-season-chevron svg {
  width: clamp(22px, calc(36px * var(--tv-scale)), 84px);
  height: clamp(22px, calc(36px * var(--tv-scale)), 84px);
  display: block;
}

.tv-player .direct-player-episode-list {
  padding: 0 0 clamp(8px, calc(12px * var(--tv-scale)), 28px);
  background: rgba(255, 255, 255, 0.018);
}

.tv-player .direct-player-episode-row {
  min-height: clamp(50px, calc(78px * var(--tv-scale)), 180px);
  grid-template-columns: clamp(32px, calc(52px * var(--tv-scale)), 120px) minmax(0, 1fr) auto;
  padding-left: clamp(42px, calc(78px * var(--tv-scale)), 180px);
}

.tv-player .direct-player-episode-row.active {
  background: rgba(255, 255, 255, 0.08);
}

.tv-player .direct-player-serial-settings-menu .direct-player-settings-choice.is-focused,
.tv-player .direct-player-serial-settings-menu .direct-player-settings-choice:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.tv-player .direct-player-serial-settings-menu .direct-player-settings-choice.is-focused .direct-player-settings-row-value,
.tv-player .direct-player-serial-settings-menu .direct-player-settings-choice:focus-visible .direct-player-settings-row-value {
  color: rgba(255, 255, 255, 0.88);
}

.tv-player .direct-player-episode-row + .direct-player-episode-row {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.tv-player .direct-player-episode-row .direct-player-settings-row-title {
  font-size: clamp(16px, calc(26px * var(--tv-scale)), 60px);
}

.tv-player .direct-player-episode-row .direct-player-settings-row-value {
  max-width: clamp(68px, calc(112px * var(--tv-scale)), 260px);
}

.tv-player .direct-player-episode-empty {
  min-height: clamp(50px, calc(78px * var(--tv-scale)), 180px);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.58);
  font-size: clamp(16px, calc(26px * var(--tv-scale)), 60px);
  font-weight: 700;
}

@media (max-height: 820px) {
  .tv-player .direct-player-main-settings-menu {
    width: min(calc(620px * var(--tv-scale)), calc(100vw - calc(80px * var(--tv-scale))));
  }

  .tv-player .direct-player-serial-settings-menu {
    width: min(calc(620px * var(--tv-scale)), calc(100vw - calc(80px * var(--tv-scale))));
    max-height: min(calc(680px * var(--tv-scale)), calc(100vh - calc(132px * var(--tv-scale))));
  }

  .tv-player .direct-player-settings-header {
    min-height: clamp(52px, calc(82px * var(--tv-scale)), 190px);
  }

  .tv-player .direct-player-settings-header-main {
    padding: 0 clamp(20px, calc(36px * var(--tv-scale)), 84px);
  }

  .tv-player .direct-player-settings-title {
    font-size: clamp(19px, calc(30px * var(--tv-scale)), 70px);
  }

  .tv-player .direct-player-settings-list {
    padding: clamp(4px, calc(6px * var(--tv-scale)), 16px) 0 clamp(7px, calc(12px * var(--tv-scale)), 30px);
  }

  .tv-player .direct-player-settings-row {
    min-height: clamp(52px, calc(82px * var(--tv-scale)), 190px);
    grid-template-columns: clamp(36px, calc(58px * var(--tv-scale)), 134px) minmax(clamp(110px, calc(176px * var(--tv-scale)), 410px), auto) minmax(0, 1fr);
    gap: clamp(10px, calc(18px * var(--tv-scale)), 42px);
    padding: 0 clamp(20px, calc(36px * var(--tv-scale)), 84px);
  }

  .tv-player .direct-player-settings-row-icon svg {
    width: clamp(25px, calc(40px * var(--tv-scale)), 92px);
    height: clamp(25px, calc(40px * var(--tv-scale)), 92px);
  }

  .tv-player .direct-player-settings-row-title,
  .tv-player .direct-player-settings-row .direct-player-settings-row-title {
    font-size: clamp(17px, calc(27px * var(--tv-scale)), 62px);
  }

.tv-player .direct-player-settings-row-value {
    font-size: clamp(15px, calc(24px * var(--tv-scale)), 56px);
  }
}

@media (min-width: 1600px) and (min-height: 850px) {
  :root {
    --edge: clamp(18px, calc(68px * var(--tv-scale)), 154px);
    --sidebar-w: clamp(48px, calc(104px * var(--tv-scale)), 236px);
    --content-left: calc(var(--sidebar-w) + clamp(24px, calc(64px * var(--tv-scale)), 140px));
    --topbar: clamp(42px, calc(84px * var(--tv-scale)), 190px);
    --card-w: clamp(78px, calc(190px * var(--tv-scale)), 420px);
    --home-preview-hero-h: clamp(calc(300px * var(--tv-scale)), calc(var(--home-vh) - var(--card-h) - calc(250px * var(--tv-scale))), calc(640px * var(--tv-scale)));
  }

  .tv-brand {
    width: clamp(42px, calc(70px * var(--tv-scale)), 150px);
  }

  .tv-brand img {
    width: clamp(30px, calc(54px * var(--tv-scale)), 112px);
    height: clamp(30px, calc(54px * var(--tv-scale)), 112px);
  }

  .tv-nav-btn {
    width: clamp(42px, calc(70px * var(--tv-scale)), 150px);
    height: clamp(42px, calc(70px * var(--tv-scale)), 150px);
  }

  .tv-sidebar .tv-nav-btn {
    flex-basis: clamp(42px, calc(70px * var(--tv-scale)), 150px);
  }

  .tv-nav-btn svg {
    width: clamp(20px, calc(32px * var(--tv-scale)), 68px);
    height: clamp(20px, calc(32px * var(--tv-scale)), 68px);
  }

  .tv-clock {
    font-size: clamp(13px, calc(24px * var(--tv-scale)), 54px);
  }

  .tv-main.is-home-preview .tv-hero {
    padding-bottom: clamp(4px, calc(10px * var(--tv-scale)), 24px);
  }

  .tv-main.is-home-preview .tv-shelves {
    padding-bottom: clamp(10px, calc(26px * var(--tv-scale)), 64px);
  }

  .tv-hero-content {
    width: min(calc(1000px * var(--tv-scale)), 64vw);
  }

  .tv-hero h1 {
    max-width: min(calc(820px * var(--tv-scale)), 18ch);
    font-size: clamp(24px, calc(56px * var(--tv-scale)), 124px);
  }

  .tv-hero-meta {
    max-width: calc(860px * var(--tv-scale));
    font-size: clamp(12px, calc(22px * var(--tv-scale)), 48px);
  }

  .tv-hero-text {
    max-width: calc(1040px * var(--tv-scale));
    font-size: clamp(11px, calc(21px * var(--tv-scale)), 46px);
  }

  .tv-shelf h2 {
    font-size: clamp(15px, calc(30px * var(--tv-scale)), 68px);
  }

  .tv-card-row {
    gap: clamp(8px, calc(20px * var(--tv-scale)), 46px);
  }

  .tv-card-title {
    font-size: clamp(10px, calc(19px * var(--tv-scale)), 42px);
  }

  .tv-card-meta {
    font-size: clamp(9px, calc(16px * var(--tv-scale)), 36px);
  }
}

body.is-low-power-tv {
  --edge: clamp(18px, calc(64px * var(--tv-scale)), 146px);
  --sidebar-w: clamp(46px, calc(102px * var(--tv-scale)), 232px);
  --content-left: calc(var(--sidebar-w) + clamp(20px, calc(62px * var(--tv-scale)), 136px));
  --topbar: clamp(40px, calc(80px * var(--tv-scale)), 184px);
  --card-w: clamp(78px, calc(190px * var(--tv-scale)), 420px);
  --home-preview-hero-h: clamp(calc(300px * var(--tv-scale)), calc(var(--home-vh) - var(--card-h) - calc(236px * var(--tv-scale))), calc(620px * var(--tv-scale)));
}

body.is-low-power-tv .tv-sidebar {
  gap: clamp(10px, calc(28px * var(--tv-scale)), 64px);
  padding-top: clamp(12px, calc(28px * var(--tv-scale)), 64px);
  padding-bottom: clamp(10px, calc(26px * var(--tv-scale)), 60px);
}

body.is-low-power-tv .tv-brand {
  width: clamp(42px, calc(66px * var(--tv-scale)), 144px);
}

body.is-low-power-tv .tv-brand img {
  width: clamp(30px, calc(52px * var(--tv-scale)), 108px);
  height: clamp(30px, calc(52px * var(--tv-scale)), 108px);
}

body.is-low-power-tv .tv-nav-btn,
body.is-low-power-tv .tv-sidebar .tv-nav-btn {
  width: clamp(42px, calc(66px * var(--tv-scale)), 144px);
  height: clamp(42px, calc(66px * var(--tv-scale)), 144px);
  flex-basis: clamp(42px, calc(66px * var(--tv-scale)), 144px);
}

body.is-low-power-tv .tv-nav-btn svg {
  width: clamp(20px, calc(31px * var(--tv-scale)), 66px);
  height: clamp(20px, calc(31px * var(--tv-scale)), 66px);
}

body.is-low-power-tv .tv-clock {
  font-size: clamp(13px, calc(23px * var(--tv-scale)), 52px);
}

body.is-low-power-tv .tv-main.is-home-preview .tv-hero {
  height: var(--home-preview-hero-h);
  padding-top: calc(var(--topbar) + clamp(4px, calc(12px * var(--tv-scale)), 30px));
  padding-bottom: clamp(4px, calc(10px * var(--tv-scale)), 24px);
}

body.is-low-power-tv .tv-hero-content,
body.is-low-power-tv .tv-main.is-home-preview .tv-hero-content {
  width: min(calc(1000px * var(--tv-scale)), 64vw);
  gap: clamp(7px, calc(14px * var(--tv-scale)), 32px);
}

body.is-low-power-tv .tv-hero h1 {
  max-width: min(calc(820px * var(--tv-scale)), 20ch);
  font-size: clamp(24px, calc(54px * var(--tv-scale)), 120px);
}

body.is-low-power-tv .tv-hero-meta {
  max-width: calc(900px * var(--tv-scale));
  font-size: clamp(12px, calc(22px * var(--tv-scale)), 48px);
  line-height: 1.48;
  -webkit-line-clamp: 2;
}

body.is-low-power-tv .tv-hero-text,
body.is-low-power-tv .tv-main.is-home-preview .tv-hero-text {
  max-width: calc(1040px * var(--tv-scale));
  max-height: 4.44em;
  overflow: hidden;
  font-size: clamp(11px, calc(20px * var(--tv-scale)), 44px);
  line-height: 1.48;
  -webkit-line-clamp: 3;
}

body.is-low-power-tv .tv-main.is-home-preview .tv-shelves {
  height: calc(var(--home-vh) - var(--home-preview-hero-h));
  padding-bottom: clamp(8px, calc(20px * var(--tv-scale)), 50px);
}

body.is-low-power-tv .tv-shelf h2 {
  font-size: clamp(15px, calc(30px * var(--tv-scale)), 68px);
}

body.is-low-power-tv .tv-card-row {
  gap: clamp(8px, calc(18px * var(--tv-scale)), 42px);
  padding-top: clamp(3px, calc(7px * var(--tv-scale)), 18px);
}

body.is-low-power-tv .tv-card.is-focused,
body.is-low-power-tv .tv-card:focus-visible {
  transform: none;
}

body.is-low-power-tv .tv-card-title {
  font-size: clamp(10px, calc(19px * var(--tv-scale)), 42px);
}

body.is-low-power-tv .tv-card-meta {
  font-size: clamp(9px, calc(15.5px * var(--tv-scale)), 35px);
}

body.is-low-power-tv .tv-shelves.is-list-page {
  height: 100vh;
  overflow: hidden;
  padding-top: clamp(18px, calc(42px * var(--tv-scale)), 100px);
  padding-bottom: clamp(4px, calc(10px * var(--tv-scale)), 24px);
}
body.is-low-power-tv .tv-shelves.is-list-page.is-library-list-page {
  padding-top: clamp(34px, calc(52px * var(--tv-scale)), 120px);
  padding-bottom: clamp(8px, calc(18px * var(--tv-scale)), 44px);
}

/* Keep fixed TV list pages pinned while focus moves between their two rows. */
body.is-low-power-tv.has-catalog-pane .tv-shelves.is-list-page {
  overflow: hidden;
  padding-top: clamp(76px, calc(136px * var(--tv-scale)), 310px);
  padding-bottom: clamp(8px, calc(18px * var(--tv-scale)), 44px);
}

body.is-low-power-tv .tv-list-page {
  gap: clamp(8px, calc(22px * var(--tv-scale)), 54px);
  transition-duration: 90ms;
}
body.is-low-power-tv .tv-list-page.is-library-list-page {
  column-gap: 0;
  row-gap: 0;
}

body.is-low-power-tv .tv-list-page h2 {
  font-size: clamp(18px, calc(38px * var(--tv-scale)), 86px);
}

body.is-low-power-tv .tv-list-page.is-library-list-page h2 {
  font-size: clamp(16px, calc(30px * var(--tv-scale)), 68px);
}

body.is-low-power-tv .tv-list-grid {
  gap: clamp(12px, calc(28px * var(--tv-scale)), 64px) clamp(8px, calc(18px * var(--tv-scale)), 42px);
}

body.is-low-power-tv .tv-list-more-wrap {
  padding-top: clamp(10px, calc(26px * var(--tv-scale)), 62px);
}

body.is-low-power-tv .tv-list-more {
  min-height: clamp(34px, calc(52px * var(--tv-scale)), 120px);
  font-size: clamp(12px, calc(19px * var(--tv-scale)), 44px);
}

body.is-low-power-tv .tv-detail {
  grid-template-columns: clamp(130px, calc(300px * var(--tv-scale)), 680px) minmax(0, calc(860px * var(--tv-scale)));
  gap: clamp(18px, calc(58px * var(--tv-scale)), 136px);
  padding: calc(var(--topbar) + clamp(10px, calc(24px * var(--tv-scale)), 58px)) var(--edge) clamp(28px, calc(52px * var(--tv-scale)), 126px) var(--content-left);
}

body.is-low-power-tv .tv-detail h2 {
  max-width: 18ch;
  font-size: clamp(24px, calc(58px * var(--tv-scale)), 130px);
}

body.is-low-power-tv .tv-detail-text {
  max-width: calc(860px * var(--tv-scale));
  font-size: clamp(13px, calc(23px * var(--tv-scale)), 52px);
  line-height: 1.42;
  -webkit-line-clamp: 8;
}

body.is-low-power-tv .tv-detail .tv-actions {
  padding-top: clamp(5px, calc(14px * var(--tv-scale)), 34px);
}

body.is-low-power-tv .tv-primary,
body.is-low-power-tv .tv-secondary {
  min-height: clamp(36px, calc(56px * var(--tv-scale)), 128px);
  font-size: clamp(12px, calc(21px * var(--tv-scale)), 48px);
}

body.is-low-power-tv .tv-watch-btn {
  min-width: clamp(110px, calc(210px * var(--tv-scale)), 480px);
  min-height: clamp(38px, calc(60px * var(--tv-scale)), 138px);
}

body.is-low-power-tv .tv-player .direct-player-topbar {
  padding: clamp(16px, calc(34px * var(--tv-scale)), 80px) clamp(28px, calc(64px * var(--tv-scale)), 150px) clamp(44px, calc(88px * var(--tv-scale)), 210px) clamp(20px, calc(44px * var(--tv-scale)), 104px);
}

body.is-low-power-tv .tv-player .direct-player-title {
  font-size: clamp(22px, calc(46px * var(--tv-scale)), 104px);
}

body.is-low-power-tv .tv-player .direct-player-bottom-panel {
  min-height: clamp(86px, calc(138px * var(--tv-scale)), 320px);
  padding: 0 clamp(16px, calc(38px * var(--tv-scale)), 92px) clamp(10px, calc(24px * var(--tv-scale)), 58px);
}

body.is-low-power-tv .tv-player .direct-player-progress-row {
  grid-template-columns: minmax(clamp(54px, calc(92px * var(--tv-scale)), 210px), auto) minmax(0, 1fr) minmax(clamp(68px, calc(104px * var(--tv-scale)), 240px), auto);
  gap: clamp(8px, calc(14px * var(--tv-scale)), 34px);
}

body.is-low-power-tv .tv-player .direct-player-time {
  min-width: clamp(54px, calc(86px * var(--tv-scale)), 200px);
  font-size: clamp(12px, calc(22px * var(--tv-scale)), 50px);
}

body.is-low-power-tv .tv-player .direct-player-time-duration {
  min-width: clamp(68px, calc(104px * var(--tv-scale)), 240px);
}

body.is-low-power-tv .tv-player .direct-player-panel-btn,
body.is-low-power-tv .tv-player .direct-player-option-btn {
  min-width: clamp(36px, calc(54px * var(--tv-scale)), 126px);
  min-height: clamp(36px, calc(54px * var(--tv-scale)), 126px);
}

body.is-low-power-tv .tv-player .direct-player-option-btn small {
  font-size: clamp(12px, calc(19px * var(--tv-scale)), 44px);
}

.tv-player .direct-player-serial-menu {
  position: absolute;
  left: auto;
  top: auto;
  right: 0;
  bottom: calc(100% + 18px);
  z-index: 27;
  display: block;
  width: min(1180px, calc(100vw - 96px));
  max-height: min(860px, calc(100vh - 120px));
  padding: 0;
  border-color: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  background: #111;
  box-shadow: 0 28px 86px rgba(0, 0, 0, 0.58);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  transform: none;
}

.tv-player .direct-player-serial-menu.direct-player-serial-columns-1 {
  width: min(540px, calc(100vw - 96px));
}

.tv-player .direct-player-serial-menu.direct-player-serial-columns-2 {
  width: min(660px, calc(100vw - 96px));
}

.tv-player .direct-player-serial-menu.direct-player-serial-columns-3 {
  width: min(820px, calc(100vw - 96px));
}

.tv-player .direct-player-serial-menu.direct-player-serial-columns-4 {
  width: min(980px, calc(100vw - 96px));
}

.tv-player .direct-player-serial-menu.direct-player-serial-columns-5 {
  width: min(1120px, calc(100vw - 96px));
}

.tv-player .direct-player-serial-menu.direct-player-serial-columns-6 {
  width: min(1280px, calc(100vw - 96px));
}

.tv-player .direct-player-serial-menu::-webkit-scrollbar {
  width: 8px;
}

.tv-player .direct-player-serial-menu::-webkit-scrollbar-track {
  background: transparent;
}

.tv-player .direct-player-serial-menu::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.tv-player .direct-player-serial-head {
  min-height: 0;
  display: grid;
  align-content: center;
  margin: 0;
  padding: 42px 36px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.tv-player .direct-player-serial-heading {
  display: block;
  color: #fff;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}

.tv-player .direct-player-serial-summary {
  margin-top: 9px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.1;
}

.tv-player .direct-player-serial-section {
  min-height: 0;
  padding: 30px 36px 0;
  border-bottom: 0;
}

.tv-player .direct-player-serial-section + .direct-player-serial-section {
  margin-top: 0;
}

.tv-player .direct-player-serial-title {
  margin-bottom: 12px;
  padding: 0;
  color: rgba(255, 255, 255, 0.64);
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
}

.tv-player .direct-player-serial-season-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tv-player .direct-player-serial-episode-section {
  display: block;
  padding: 30px 36px 36px;
}

.tv-player .direct-player-serial-season-pill {
  min-width: 118px;
  min-height: 50px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  padding: 0 20px;
  text-align: center;
}

.tv-player .direct-player-serial-season-pill.active {
  border-color: #16b8ff;
  background: #16b8ff;
  color: #fff;
}

.tv-player .direct-player-serial-season-pill:hover,
.tv-player .direct-player-serial-season-pill:focus-visible,
.tv-player .direct-player-serial-season-pill.is-focused {
  outline: none;
  border-color: transparent;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.92);
}

.tv-player .direct-player-serial-season-pill.active:hover,
.tv-player .direct-player-serial-season-pill.active:focus-visible,
.tv-player .direct-player-serial-season-pill.active.is-focused {
  border-color: transparent;
  background: #16b8ff;
  box-shadow: 0 0 0 4px #fff;
}

.tv-player .direct-player-serial-episode-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(180px, 1fr));
  gap: 12px;
  overflow: visible;
  padding: 4px;
  margin: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.tv-player .direct-player-serial-columns-1 .direct-player-serial-episode-grid {
  grid-template-columns: repeat(1, minmax(180px, 1fr));
}

.tv-player .direct-player-serial-columns-2 .direct-player-serial-episode-grid {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.tv-player .direct-player-serial-columns-3 .direct-player-serial-episode-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.tv-player .direct-player-serial-columns-4 .direct-player-serial-episode-grid {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.tv-player .direct-player-serial-columns-5 .direct-player-serial-episode-grid {
  grid-template-columns: repeat(5, minmax(180px, 1fr));
}

.tv-player .direct-player-serial-columns-6 .direct-player-serial-episode-grid {
  grid-template-columns: repeat(6, minmax(180px, 1fr));
}

.tv-player .direct-player-serial-episode-grid::-webkit-scrollbar {
  width: 8px;
}

.tv-player .direct-player-serial-episode-grid::-webkit-scrollbar-track {
  background: transparent;
}

.tv-player .direct-player-serial-episode-grid::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.tv-player .direct-player-serial-episode-card {
  position: relative;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.065));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
  padding: 21px 20px 18px;
  text-align: left;
  transition: background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, color 0.14s ease;
}

.tv-player .direct-player-serial-episode-card.active {
  border-color: rgba(22, 184, 255, 0.96);
  background: linear-gradient(135deg, #18bdff, #079ee8);
  box-shadow: none;
  color: #fff;
}

.tv-player .direct-player-serial-episode-card:hover,
.tv-player .direct-player-serial-episode-card:focus-visible,
.tv-player .direct-player-serial-episode-card.is-focused {
  outline: none;
  border-color: transparent;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.115), rgba(255, 255, 255, 0.075));
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.92), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  color: #fff;
}

.tv-player .direct-player-serial-episode-card.active:hover,
.tv-player .direct-player-serial-episode-card.active:focus-visible,
.tv-player .direct-player-serial-episode-card.active.is-focused {
  border-color: transparent;
  background: linear-gradient(135deg, #18bdff, #079ee8);
  box-shadow: 0 0 0 4px #fff;
  color: #fff;
}

.tv-player .direct-player-serial-episode-title {
  min-width: 0;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-player .direct-player-serial-empty {
  grid-column: 1 / -1;
  min-height: 90px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 24px;
  font-weight: 700;
}

.tv-player .direct-player-serial-menu {
  position: fixed;
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  width: min(1180px, calc(100vw - 96px));
  max-height: min(88vh, 920px);
  border: 0;
  border-radius: 30px;
  background: rgba(16, 16, 16, 0.94);
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.64);
  overflow: auto;
  transform: translate(-50%, -50%);
}

.tv-player .direct-player-serial-menu.direct-player-serial-columns-1,
.tv-player .direct-player-serial-menu.direct-player-serial-columns-2,
.tv-player .direct-player-serial-menu.direct-player-serial-columns-3,
.tv-player .direct-player-serial-menu.direct-player-serial-columns-4,
.tv-player .direct-player-serial-menu.direct-player-serial-columns-5,
.tv-player .direct-player-serial-menu.direct-player-serial-columns-6 {
  width: min(1180px, calc(100vw - 96px));
}

.tv-player .direct-player-serial-season-panel {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tv-player .direct-player-serial-season-panel:last-child {
  border-bottom: 0;
}

.tv-player .direct-player-serial-season-row,
.tv-player .direct-player-serial-season-pill,
.tv-player .direct-player-serial-season-pill.active {
  width: 100%;
  min-height: 148px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.018);
  box-shadow: none;
  color: #fff;
  padding: 0 44px;
  text-align: left;
}

.tv-player .direct-player-serial-season-panel.is-expanded .direct-player-serial-season-row {
  background: rgba(255, 255, 255, 0.026);
}

.tv-player .direct-player-serial-season-label {
  color: #fff;
  font-size: clamp(30px, min(2.45vw, 5.2vh), 44px);
  font-weight: 700;
  line-height: 1;
}

.tv-player .direct-player-serial-season-count {
  color: rgba(255, 255, 255, 0.56);
  font-size: clamp(24px, min(1.85vw, 4vh), 34px);
  font-weight: 700;
  line-height: 1;
}

.tv-player .direct-player-serial-season-chevron {
  justify-self: end;
  width: 28px;
  height: 28px;
  border-right: 5px solid rgba(255, 255, 255, 0.62);
  border-bottom: 5px solid rgba(255, 255, 255, 0.62);
  transform: rotate(45deg);
}

.tv-player .direct-player-serial-season-panel.is-expanded .direct-player-serial-season-chevron {
  transform: translateY(8px) rotate(225deg);
}

.tv-player .direct-player-serial-season-pill:hover,
.tv-player .direct-player-serial-season-pill:focus-visible,
.tv-player .direct-player-serial-season-pill.is-focused,
.tv-player .direct-player-serial-season-pill.active:hover,
.tv-player .direct-player-serial-season-pill.active:focus-visible,
.tv-player .direct-player-serial-season-pill.active.is-focused {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.92);
  color: #fff;
}

.tv-player .direct-player-serial-episode-grid,
.tv-player .direct-player-serial-columns-1 .direct-player-serial-episode-grid,
.tv-player .direct-player-serial-columns-2 .direct-player-serial-episode-grid,
.tv-player .direct-player-serial-columns-3 .direct-player-serial-episode-grid,
.tv-player .direct-player-serial-columns-4 .direct-player-serial-episode-grid,
.tv-player .direct-player-serial-columns-5 .direct-player-serial-episode-grid,
.tv-player .direct-player-serial-columns-6 .direct-player-serial-episode-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 0 24px 28px;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.018);
}

.tv-player .direct-player-serial-episode-card,
.tv-player .direct-player-serial-episode-card.active {
  min-height: clamp(150px, 17vh, 205px);
  display: grid;
  grid-template-columns: clamp(260px, 30vw, 370px) 26px minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.016);
  box-shadow: none;
  color: #fff;
  padding: 16px 42px;
}

.tv-player .direct-player-serial-episode-card + .direct-player-serial-episode-card {
  border-top: 1px solid rgba(255, 255, 255, 0.045);
}

.tv-player .direct-player-serial-episode-card:hover,
.tv-player .direct-player-serial-episode-card:focus-visible,
.tv-player .direct-player-serial-episode-card.is-focused,
.tv-player .direct-player-serial-episode-card.active:hover,
.tv-player .direct-player-serial-episode-card.active:focus-visible,
.tv-player .direct-player-serial-episode-card.active.is-focused {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.92);
  color: #fff;
}

.tv-player .direct-player-serial-episode-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    #151515;
  background-position: center;
  background-size: cover;
}

.tv-player .direct-player-serial-episode-duration {
  position: absolute;
  right: 14px;
  bottom: 12px;
  color: #fff;
  font-size: clamp(18px, min(1.45vw, 3.1vh), 26px);
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.82);
}

.tv-player .direct-player-serial-episode-marker {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ff5b00;
}

.tv-player .direct-player-serial-episode-card.active .direct-player-serial-episode-marker {
  opacity: 0;
}

.tv-player .direct-player-serial-episode-title {
  color: #fff;
  font-size: clamp(25px, min(2.1vw, 4.5vh), 38px);
  font-weight: 700;
  line-height: 1.1;
  white-space: normal;
}

@media (max-width: 1180px) {
  .tv-player .direct-player-serial-columns-5 .direct-player-serial-episode-grid,
  .tv-player .direct-player-serial-columns-6 .direct-player-serial-episode-grid {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
  }
}

@media (max-width: 760px) {
  .tv-player .direct-player-serial-menu {
    width: calc(100vw - 48px);
    max-height: calc(100vh - 150px);
  }

  .tv-player .direct-player-serial-head {
    min-height: 0;
    padding: 36px 28px 26px;
  }

  .tv-player .direct-player-serial-section {
    padding: 26px 28px 0;
  }

  .tv-player .direct-player-serial-episode-section {
    padding: 26px 28px 34px;
  }

  .tv-player .direct-player-serial-episode-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .tv-player .direct-player-serial-episode-card {
    min-height: 104px;
  }
}

.tv-player .direct-player-resume,
.tv-player .direct-player-ended {
  position: absolute;
  inset: 0;
  z-index: 22;
  display: grid;
  place-items: center;
  padding: clamp(42px, 5vw, 96px);
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.62) 72%),
    rgba(0, 0, 0, 0.24);
  color: #fff;
  pointer-events: auto;
}

.tv-player .direct-player-resume[hidden],
.tv-player .direct-player-ended[hidden] {
  display: none !important;
}

.tv-player .direct-player-next {
  position: absolute;
  left: auto;
  right: clamp(24px, calc(64px * var(--tv-scale)), 150px);
  bottom: clamp(120px, calc(250px * var(--tv-scale)), 580px);
  z-index: 23;
  width: auto;
  color: #fff;
  pointer-events: none;
  transform: none;
}

.tv-player .direct-player-next[hidden] {
  display: none !important;
}

.tv-player .direct-player-error {
  position: absolute;
  inset: 0;
  z-index: 72;
  display: grid;
  place-items: center;
  padding: clamp(24px, calc(72px * var(--tv-scale)), 170px);
  background: rgba(0, 0, 0, 0.86);
  color: #fff;
  pointer-events: auto;
}

.tv-player .direct-player-error[hidden] {
  display: none !important;
}

.tv-player.is-player-error .direct-player-ui,
.tv-player.is-player-error .direct-player-loading,
.tv-player.is-player-error .direct-player-feedback,
.tv-player.is-player-error .direct-player-center-play,
.tv-player.is-player-error .direct-player-next,
.tv-player.is-player-error .direct-player-back-hint {
  pointer-events: none !important;
}

.tv-player .direct-player-error-card {
  width: min(calc(860px * var(--tv-scale)), calc(100vw - calc(120px * var(--tv-scale))));
  display: grid;
  justify-items: center;
  gap: clamp(12px, calc(22px * var(--tv-scale)), 54px);
  padding: clamp(22px, calc(44px * var(--tv-scale)), 104px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  background: #111;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.48);
  pointer-events: auto;
}

.tv-player .direct-player-error-title {
  font-size: clamp(22px, calc(46px * var(--tv-scale)), 106px);
  font-weight: 700;
  line-height: 1.08;
  text-align: center;
}

.tv-player .direct-player-error-text {
  color: rgba(255, 255, 255, 0.68);
  font-size: clamp(13px, calc(26px * var(--tv-scale)), 60px);
  font-weight: 400;
  line-height: 1.28;
  text-align: center;
  max-width: calc(760px * var(--tv-scale));
}

.tv-player .direct-player-error-actions {
  display: flex;
  gap: clamp(16px, calc(28px * var(--tv-scale)), 68px);
  justify-content: center;
  width: 100%;
  margin-top: clamp(16px, calc(28px * var(--tv-scale)), 68px);
}

.tv-player .direct-player-error-btn {
  width: min(380px, 100%);
  min-height: clamp(44px, calc(74px * var(--tv-scale)), 172px);
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  font-size: clamp(13px, calc(24px * var(--tv-scale)), 56px);
  font-weight: 700;
  line-height: 1;
  padding: 0 22px;
}

.tv-player .direct-player-error-btn.primary {
  background: #16b8ff;
}

.tv-player .direct-player-error-btn:disabled {
  cursor: default;
  opacity: 0.42;
}

.tv-player .direct-player-error-btn:not(:disabled):hover,
.tv-player .direct-player-error-btn:not(:disabled):focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px #16b8ff;
}

.tv-player .direct-player-error-btn.primary:not(:disabled):hover,
.tv-player .direct-player-error-btn.primary:not(:disabled):focus-visible {
  box-shadow: 0 0 0 4px #fff;
}

.tv-player .direct-player-next-card {
  display: grid;
  grid-template-columns: auto;
  align-items: center;
  gap: 0;
  padding: 0;
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
}

.tv-player .direct-player-next-title {
  display: none !important;
}

.tv-player .direct-player-next-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(9px, calc(16px * var(--tv-scale)), 38px);
  min-width: clamp(160px, calc(270px * var(--tv-scale)), 620px);
  min-height: clamp(50px, calc(82px * var(--tv-scale)), 190px);
  border: 0;
  border-radius: 17px;
  background: #16b8ff;
  color: #fff;
  cursor: pointer;
  font-size: clamp(16px, calc(32px * var(--tv-scale)), 74px);
  font-weight: 700;
  line-height: 1.1;
  padding: 0 clamp(20px, calc(34px * var(--tv-scale)), 82px);
  pointer-events: auto;
  white-space: nowrap;
}

.tv-player .direct-player-next-btn svg {
  width: clamp(24px, calc(40px * var(--tv-scale)), 92px);
  height: clamp(24px, calc(40px * var(--tv-scale)), 92px);
  display: block;
  flex: 0 0 auto;
  fill: currentColor;
}

.tv-player .direct-player-next-btn.secondary {
  display: none;
  min-width: 190px;
  background: rgba(255, 255, 255, 0.14);
}

.tv-player .direct-player-next-btn:hover,
.tv-player .direct-player-next-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px #fff;
}

.tv-player .direct-player-resume-card,
.tv-player .direct-player-ended-card {
  width: min(calc(680px * var(--tv-scale)), calc(100vw - calc(96px * var(--tv-scale))));
  display: grid;
  justify-items: center;
  gap: clamp(6px, calc(10px * var(--tv-scale)), 24px);
  padding: clamp(18px, calc(34px * var(--tv-scale)), 80px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: #111;
  box-shadow: 0 24px 78px rgba(0, 0, 0, 0.5);
}

.tv-player .direct-player-ended-card {
  width: min(calc(640px * var(--tv-scale)), calc(100vw - calc(96px * var(--tv-scale))));
}

.tv-player .direct-player-resume-title,
.tv-player .direct-player-ended-title {
  font-size: clamp(16px, calc(32px * var(--tv-scale)), 74px);
  font-weight: 700;
  line-height: 1.16;
  text-align: center;
}

.tv-player .direct-player-resume-title {
  white-space: nowrap;
}

.tv-player .direct-player-resume-subtitle {
  margin-top: 0;
  color: #fff;
  font-size: clamp(16px, calc(32px * var(--tv-scale)), 74px);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.tv-player .direct-player-resume-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(14px, calc(28px * var(--tv-scale)), 68px);
  width: min(calc(620px * var(--tv-scale)), 100%);
  margin-top: clamp(16px, calc(30px * var(--tv-scale)), 70px);
}

.tv-player .direct-player-resume-btn,
.tv-player .direct-player-ended-btn {
  min-height: clamp(42px, calc(68px * var(--tv-scale)), 158px);
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  font-size: clamp(13px, calc(24px * var(--tv-scale)), 56px);
  font-weight: 700;
  line-height: 1;
  padding: 0 clamp(14px, calc(22px * var(--tv-scale)), 54px);
  transition: none;
}

body.is-low-power-tv .tv-player *,
body.is-low-power-tv .tv-player *::before,
body.is-low-power-tv .tv-player *::after {
  transition-duration: 0s !important;
}

body.is-low-power-tv .tv-player .direct-player-resume,
body.is-low-power-tv .tv-player .direct-player-ended {
  background: rgba(0, 0, 0, 0.72);
}

body.is-low-power-tv .tv-player .direct-player-resume-card,
body.is-low-power-tv .tv-player .direct-player-ended-card {
  box-shadow: none;
}

.tv-player .direct-player-resume-btn.primary,
.tv-player .direct-player-ended-btn.primary {
  background: #16b8ff;
}

.tv-player .direct-player-resume-btn.primary:hover,
.tv-player .direct-player-resume-btn.primary:focus,
.tv-player .direct-player-resume-btn.primary:focus-visible,
.tv-player .direct-player-resume-btn.primary.is-focused {
  outline: none;
  background: #16b8ff;
  box-shadow: 0 0 0 4px #fff;
}

.tv-player .direct-player-resume-btn:not(.primary):hover,
.tv-player .direct-player-resume-btn:not(.primary):focus,
.tv-player .direct-player-resume-btn:not(.primary):focus-visible,
.tv-player .direct-player-resume-btn:not(.primary).is-focused {
  outline: none;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 0 4px #16b8ff;
}

.tv-player .direct-player-ended-btn:hover,
.tv-player .direct-player-ended-btn:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 0 4px #16b8ff;
}

.tv-player .direct-player-ended-btn.primary:hover,
.tv-player .direct-player-ended-btn.primary:focus-visible {
  background: #16b8ff;
  box-shadow: 0 0 0 4px #fff;
}

.tv-player .direct-player-feedback {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 11;
  display: grid;
  width: clamp(90px, calc(190px * var(--tv-scale)), 440px);
  height: clamp(90px, calc(190px * var(--tv-scale)), 440px);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  place-items: center;
  transform: translate(-50%, -50%) scale(0.86);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.tv-player .direct-player-feedback.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.tv-player .direct-player-back-hint {
  position: absolute;
  left: 50%;
  bottom: clamp(56px, calc(120px * var(--tv-scale)), 280px);
  z-index: 30;
  max-width: min(calc(760px * var(--tv-scale)), calc(100vw - calc(96px * var(--tv-scale))));
  padding: clamp(10px, calc(16px * var(--tv-scale)), 38px) clamp(14px, calc(22px * var(--tv-scale)), 54px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(16, 16, 16, 0.94);
  color: #fff;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.42);
  font-size: clamp(12px, calc(23px * var(--tv-scale)), 52px);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: pre-line;
  pointer-events: none;
  transform: translateX(-50%);
}

.tv-player .direct-player-back-hint[hidden] {
  display: none;
}

.tv-player .direct-player-feedback svg {
  display: block;
  width: clamp(46px, calc(96px * var(--tv-scale)), 220px);
  height: clamp(46px, calc(96px * var(--tv-scale)), 220px);
  fill: currentColor;
}

.tv-player .direct-player-feedback .direct-player-seek-icon {
  width: clamp(50px, calc(104px * var(--tv-scale)), 240px);
  height: clamp(50px, calc(104px * var(--tv-scale)), 240px);
}

.tv-player .direct-player-feedback .direct-player-seek-icon.is-hold {
  width: clamp(50px, calc(104px * var(--tv-scale)), 240px);
  height: clamp(50px, calc(104px * var(--tv-scale)), 240px);
}

.tv-player .direct-player-center-play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 13;
  width: clamp(58px, calc(112px * var(--tv-scale)), 260px);
  height: clamp(58px, calc(112px * var(--tv-scale)), 260px);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.52);
  color: #fff;
  cursor: default;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.94);
  outline: none;
  box-shadow: none;
  transition: opacity 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.tv-player .direct-player-center-play svg {
  width: clamp(28px, calc(56px * var(--tv-scale)), 130px);
  height: clamp(28px, calc(56px * var(--tv-scale)), 130px);
  display: block;
  fill: currentColor;
  transform: none;
}

.tv-player.is-player-paused .direct-player-center-play {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.tv-player.is-player-paused .direct-player-center-play:hover,
.tv-player.is-player-paused .direct-player-center-play:focus-visible {
  background: rgba(0, 0, 0, 0.68);
  outline: none;
  box-shadow: none;
}

.tv-toast {
  position: fixed;
  left: 50%;
  bottom: clamp(28px, 4vh, 50px);
  z-index: 70;
  max-width: min(760px, calc(100vw - 80px));
  padding: 16px 22px;
  border-radius: 8px;
  background: rgba(20, 20, 20, 0.94);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: clamp(17px, 1.1vw, 23px);
  font-weight: 700;
  text-align: center;
  transform: translateX(-50%);
  white-space: pre-line;
}


.tv-nav-btn.is-focused,
.tv-secondary:hover,
.tv-secondary.is-focused,
.tv-search input.is-focused,
.tv-nav-btn:focus-visible,
.tv-secondary:focus-visible,
.tv-search input:focus-visible {
  border-color: transparent;
  box-shadow: 0 0 0 4px var(--accent), 0 18px 44px rgba(0, 0, 0, 0.52);
  transform: none;
}

.tv-primary:hover,
.tv-primary.is-focused,
.tv-primary:focus-visible {
  border-color: transparent;
  box-shadow: 0 0 0 4px #fff, 0 18px 44px rgba(0, 0, 0, 0.52);
  transform: none;
}

.tv-secondary.is-active:hover,
.tv-secondary.is-active.is-focused,
.tv-secondary.is-active:focus-visible,
.tv-secondary[aria-pressed="true"]:hover,
.tv-secondary[aria-pressed="true"].is-focused,
.tv-secondary[aria-pressed="true"]:focus-visible {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px #fff, 0 18px 44px rgba(0, 0, 0, 0.52);
  transform: none;
}

.tv-actions .tv-secondary:hover,
.tv-actions .tv-secondary.is-focused,
.tv-actions .tv-secondary:focus-visible {
  transform: none;
}

.tv-catalog-option:hover,
.tv-catalog-option.is-focused,
.tv-catalog-option:focus-visible {
  border-color: transparent;
  outline: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: none;
  transform: none;
}

.tv-catalog-option:hover::before,
.tv-catalog-option.is-focused::before,
.tv-catalog-option:focus-visible::before {
  opacity: 1;
}

.tv-catalog-option[data-catalog-kind="category"]:hover,
.tv-catalog-option[data-catalog-kind="category"].is-focused,
.tv-catalog-option[data-catalog-kind="category"]:focus-visible {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: none;
}

.tv-catalog-option.is-filter-chip:hover,
.tv-catalog-option.is-filter-chip.is-focused,
.tv-catalog-option.is-filter-chip:focus-visible {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: none;
}

.tv-catalog-option.is-filter-chip:hover::before,
.tv-catalog-option.is-filter-chip.is-focused::before,
.tv-catalog-option.is-filter-chip:focus-visible::before {
  opacity: 0;
}

.tv-catalog-option.is-selected,
.tv-catalog-option[data-catalog-kind="category"].is-selected {
  border-color: transparent;
  background: #fff;
  color: #050505;
  box-shadow: none;
}

.tv-catalog-option.is-selected:hover,
.tv-catalog-option.is-selected.is-focused,
.tv-catalog-option.is-selected:focus-visible,
.tv-catalog-option[data-catalog-kind="category"].is-selected:hover,
.tv-catalog-option[data-catalog-kind="category"].is-selected.is-focused,
.tv-catalog-option[data-catalog-kind="category"].is-selected:focus-visible {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: none;
}

.tv-catalog-option.is-selected::before,
.tv-catalog-option.is-selected:hover::before,
.tv-catalog-option.is-selected.is-focused::before,
.tv-catalog-option.is-selected:focus-visible::before {
  opacity: 0;
}

.tv-catalog-option.is-filter-chip.is-focused,
.tv-catalog-option.is-filter-chip:focus-visible {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: none;
}

.tv-catalog-option.is-filter-chip.is-focused .tv-catalog-check,
.tv-catalog-option.is-filter-chip:focus-visible .tv-catalog-check {
  color: #fff;
}

.tv-sidebar .tv-nav-btn:hover,
.tv-sidebar .tv-nav-btn.is-focused,
.tv-sidebar .tv-nav-btn:focus-visible {
  border-color: transparent;
  box-shadow: inset 0 0 0 4px var(--accent);
  transform: none;
}

.tv-sidebar .tv-nav-btn.is-active {
  border-color: transparent;
  background-color: transparent;
  box-shadow: none;
}

.tv-sidebar .tv-nav-btn.is-active:hover,
.tv-sidebar .tv-nav-btn.is-active.is-focused,
.tv-sidebar .tv-nav-btn.is-active:focus-visible {
  border-color: transparent;
  background-color: transparent;
  box-shadow: inset 0 0 0 4px var(--accent);
}

.tv-sidebar .tv-nav-btn.is-focused:not(.is-active),
.tv-sidebar .tv-nav-btn:focus-visible:not(.is-active) {
  background-color: rgba(255, 255, 255, 0.06);
}

.tv-card.is-focused,
.tv-card:focus-visible {
  z-index: 2;
  transform: scale(1.05);
}
@keyframes tvHomeShelfEnter {
  from {
    opacity: 0.35;
    transform: translate3d(0, var(--home-shelf-enter-y, clamp(24px, 7vh, 72px)), 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.tv-shelves.is-home-preview .tv-shelf.is-home-preview-active.is-home-shelf-entering {
  animation: tvHomeShelfEnter 220ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  .tv-card {
    transition-duration: 0.01ms;
  }

  .tv-shelves.is-home-preview .tv-shelf.is-home-preview-active.is-home-shelf-entering {
    animation-duration: 0.01ms;
  }
}


.tv-card.is-focused .tv-card-media,
.tv-card:focus-visible .tv-card-media {
  box-shadow: none;
}

.tv-card.is-focused .tv-card-media::after,
.tv-card:focus-visible .tv-card-media::after {
  opacity: 1;
}

.tv-card.is-focused .tv-card-title,
.tv-card:focus-visible .tv-card-title {
  color: #fff;
}

.tv-search input.is-focused,
.tv-search input:focus-visible {
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.is-loading .tv-card,
.is-loading .tv-primary,
.is-loading .tv-secondary {
  pointer-events: none;
}

@media (max-width: 980px) {
  :root {
    --edge: clamp(18px, calc(68px * var(--tv-scale)), 154px);
    --sidebar-w: clamp(48px, calc(104px * var(--tv-scale)), 236px);
    --content-left: calc(var(--sidebar-w) + clamp(24px, calc(64px * var(--tv-scale)), 140px));
    --topbar: clamp(42px, calc(84px * var(--tv-scale)), 190px);
    --card-w: clamp(78px, calc(190px * var(--tv-scale)), 420px);
  }

  .tv-topbar {
    padding-left: var(--content-left);
  }

  .tv-sidebar {
    padding-inline: clamp(6px, calc(12px * var(--tv-scale)), 28px);
  }

  .tv-side-nav .tv-nav-btn {
    width: clamp(42px, calc(70px * var(--tv-scale)), 150px);
    height: clamp(42px, calc(70px * var(--tv-scale)), 150px);
  }

  .tv-hero-content {
    width: min(calc(780px * var(--tv-scale)), 82vw);
  }

  .tv-detail {
    grid-template-columns: clamp(120px, calc(260px * var(--tv-scale)), 560px) minmax(0, 1fr);
    gap: clamp(16px, calc(42px * var(--tv-scale)), 96px);
  }
}

@media (max-aspect-ratio: 4 / 3) {
  :root,
  body.is-low-power-tv {
    --edge: clamp(16px, calc(46px * var(--tv-scale)), 108px);
    --sidebar-w: clamp(44px, calc(86px * var(--tv-scale)), 188px);
    --content-left: calc(var(--sidebar-w) + clamp(18px, calc(44px * var(--tv-scale)), 102px));
    --topbar: clamp(38px, calc(64px * var(--tv-scale)), 144px);
    --card-w: clamp(78px, calc(196px * var(--tv-scale)), 390px);
    --home-preview-hero-h: clamp(calc(240px * var(--tv-scale)), 31vh, calc(440px * var(--tv-scale)));
  }

  .tv-topbar {
    padding-top: clamp(8px, calc(16px * var(--tv-scale)), 36px);
    padding-right: clamp(12px, calc(28px * var(--tv-scale)), 66px);
  }

  .tv-sidebar,
  body.is-low-power-tv .tv-sidebar {
    gap: clamp(8px, calc(22px * var(--tv-scale)), 52px);
    padding-top: clamp(10px, calc(22px * var(--tv-scale)), 52px);
    padding-bottom: clamp(10px, calc(20px * var(--tv-scale)), 48px);
  }

  .tv-brand,
  body.is-low-power-tv .tv-brand {
    width: clamp(40px, calc(58px * var(--tv-scale)), 128px);
    min-height: clamp(40px, calc(58px * var(--tv-scale)), 128px);
  }

  .tv-brand img,
  body.is-low-power-tv .tv-brand img {
    width: clamp(28px, calc(44px * var(--tv-scale)), 96px);
    height: clamp(28px, calc(44px * var(--tv-scale)), 96px);
  }

  .tv-nav-btn,
  .tv-sidebar .tv-nav-btn,
  body.is-low-power-tv .tv-nav-btn,
  body.is-low-power-tv .tv-sidebar .tv-nav-btn {
    width: clamp(40px, calc(60px * var(--tv-scale)), 132px);
    height: clamp(40px, calc(60px * var(--tv-scale)), 132px);
    flex-basis: clamp(40px, calc(60px * var(--tv-scale)), 132px);
  }

  .tv-main.is-home-preview .tv-hero,
  body.is-low-power-tv .tv-main.is-home-preview .tv-hero {
    height: var(--home-preview-hero-h);
    padding-top: calc(var(--topbar) + clamp(2px, calc(8px * var(--tv-scale)), 20px));
    padding-bottom: clamp(4px, calc(8px * var(--tv-scale)), 18px);
  }

  .tv-hero-content,
  .tv-main.is-home-preview .tv-hero-content,
  body.is-low-power-tv .tv-hero-content,
  body.is-low-power-tv .tv-main.is-home-preview .tv-hero-content {
    width: min(calc(900px * var(--tv-scale)), 72vw);
    gap: clamp(5px, calc(10px * var(--tv-scale)), 24px);
  }

  .tv-main.is-home-preview .tv-hero-content,
  body.is-low-power-tv .tv-main.is-home-preview .tv-hero-content {
    transform: translateY(clamp(20px, calc(42px * var(--tv-scale)), 96px));
  }

  .tv-hero h1,
  body.is-low-power-tv .tv-hero h1 {
    max-width: min(calc(820px * var(--tv-scale)), 21ch);
    font-size: clamp(22px, calc(46px * var(--tv-scale)), 104px);
    line-height: 0.98;
  }

  .tv-hero-meta,
  body.is-low-power-tv .tv-hero-meta {
    max-width: calc(820px * var(--tv-scale));
    font-size: clamp(11px, calc(18px * var(--tv-scale)), 40px);
    line-height: 1.36;
    -webkit-line-clamp: 1;
  }

  .tv-hero-meta:not(:empty),
  body.is-low-power-tv .tv-hero-meta:not(:empty) {
    min-height: 0;
  }

  .tv-hero-text,  .tv-main.is-home-preview .tv-hero-text,
  body.is-low-power-tv .tv-hero-text,
  body.is-low-power-tv .tv-main.is-home-preview .tv-hero-text {
    max-width: calc(880px * var(--tv-scale));
    max-height: 2.8em;
    font-size: clamp(10px, calc(17px * var(--tv-scale)), 38px);
    line-height: 1.4;
    -webkit-line-clamp: 2;
  }

  .tv-hero-text:not(:empty),
  .tv-hero-text.is-pending-description,
  .tv-main.is-home-preview .tv-hero-text:not(:empty),
  .tv-main.is-home-preview .tv-hero-text.is-pending-description,
  body.is-low-power-tv .tv-hero-text:not(:empty),
  body.is-low-power-tv .tv-hero-text.is-pending-description,
  body.is-low-power-tv .tv-main.is-home-preview .tv-hero-text:not(:empty),
  body.is-low-power-tv .tv-main.is-home-preview .tv-hero-text.is-pending-description {
    min-height: 0;
  }

  .tv-main.is-home-preview .tv-shelves,  body.is-low-power-tv .tv-main.is-home-preview .tv-shelves {
    height: calc(var(--home-vh) - var(--home-preview-hero-h));
    justify-content: flex-end;
    gap: 0;
    padding-bottom: clamp(8px, calc(18px * var(--tv-scale)), 44px);
  }

  .tv-shelf h2,
  body.is-low-power-tv .tv-shelf h2 {
    font-size: clamp(14px, calc(25px * var(--tv-scale)), 58px);
  }

  .tv-card-row,
  body.is-low-power-tv .tv-card-row {
    gap: clamp(7px, calc(16px * var(--tv-scale)), 38px);
    padding-top: clamp(3px, calc(6px * var(--tv-scale)), 16px);
    padding-bottom: clamp(6px, calc(12px * var(--tv-scale)), 30px);
  }

  .tv-shelves.is-home-preview .tv-shelf.is-home-preview-next {
    gap: clamp(3px, calc(8px * var(--tv-scale)), 20px);
    margin-top: 0;
  }

  .tv-shelves.is-home-preview .tv-shelf.is-home-preview-next .tv-card-row {
    max-height: none;
    padding-top: clamp(3px, calc(6px * var(--tv-scale)), 16px);
    padding-bottom: clamp(6px, calc(12px * var(--tv-scale)), 30px);
    overflow-x: auto;
    overflow-y: hidden;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .tv-card-title,
  body.is-low-power-tv .tv-card-title {
    margin-top: clamp(4px, calc(8px * var(--tv-scale)), 18px);
    font-size: clamp(10px, calc(17px * var(--tv-scale)), 38px);
  }

  .tv-card-meta,
  body.is-low-power-tv .tv-card-meta {
    font-size: clamp(9px, calc(14px * var(--tv-scale)), 32px);
  }
}

/* Filmach QR profile screen */
.tv-profile.is-login {
  position: fixed;
  isolation: isolate;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: clamp(20px, 3vh, 38px) var(--edge);
  background: #050505;
  overflow: hidden;
}

.tv-profile.is-login::before,
.tv-profile.is-login::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tv-profile.is-login::before {
  z-index: 0;
  inset: -1%;
  background:
    linear-gradient(180deg, rgba(2, 2, 2, 0.55), rgba(2, 2, 2, 0.76)),
    linear-gradient(90deg, rgba(2, 2, 2, 0.28), transparent 30% 70%, rgba(2, 2, 2, 0.28)),
    url("/uploads/preview.png") center / cover no-repeat,
    url("/uploads/preview.jpg") center / cover no-repeat;
  filter: saturate(0.72) contrast(1.02);
  transform: scale(1.02);
}

.tv-profile.is-login::after {
  z-index: 0;
  background: radial-gradient(circle at 50% 45%, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.34) 72%);
}

.tv-profile.is-login > * {
  position: relative;
  z-index: 1;
}

.tv-profile.is-login .tv-profile-shell {
  width: min(860px, calc(100vw - (var(--edge) * 2)));
  max-height: calc(100vh - clamp(40px, 6vh, 76px));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: center;
  gap: clamp(18px, 2.2vh, 28px);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.tv-profile.is-login .tv-profile-head {
  grid-column: 1;
  grid-row: auto;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  text-align: center;
}

.tv-profile.is-login .tv-profile-copy {
  width: 100%;
  display: grid;
  justify-items: center;
}

.tv-profile.is-login .tv-profile-copy::before {
  content: "";
  width: clamp(62px, 5vw, 88px);
  height: clamp(62px, 5vw, 88px);
  margin-bottom: clamp(10px, 1.5vh, 18px);
  background: url("/favicon.svg") center / contain no-repeat;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.34));
}

.tv-profile.is-login h2 {
  max-width: none;
  margin: 0;
  font-size: clamp(42px, min(3.2vw, 5.8vh), 62px);
  line-height: 1.04;
  font-weight: 700;
  text-align: center;
  white-space: normal;
}

.tv-profile.is-login .tv-profile-text {
  max-width: 820px;
  margin: clamp(12px, 1.6vh, 20px) auto 0;
  color: var(--muted);
  font-size: clamp(18px, min(1.18vw, 2.3vh), 24px);
  line-height: 1.45;
  text-align: center;
}

.tv-profile.is-login .tv-profile-text span {
  display: block;
}

.tv-profile.is-login .tv-profile-body {
  grid-column: 1;
  grid-row: auto;
  width: min(760px, 100%);
  display: grid;
  justify-items: center;
  justify-self: center;
  margin-inline: auto;
}

.tv-profile-login {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: clamp(12px, 1.6vh, 20px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.tv-profile-qr-title {
  display: none;
}

.tv-profile.is-login .tv-profile-qr,
.tv-profile.is-login .tv-profile-qr-placeholder {
  width: min(34vw, 38vh, 390px);
  aspect-ratio: 1;
  padding: clamp(10px, 0.9vw, 14px);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.tv-profile.is-login .tv-profile-qr svg rect {
  fill: transparent;
}

.tv-profile.is-login .tv-profile-qr svg path {
  fill: var(--accent);
}

.tv-profile.is-login .tv-profile-qr-placeholder {
  display: grid;
  place-items: center;
  color: #59666c;
  font-size: clamp(17px, 1.05vw, 21px);
  text-align: center;
}

.tv-profile.is-login .tv-profile-code {
  gap: 7px;
  margin: 0;
}

.tv-profile.is-login .tv-profile-code span {
  color: var(--muted);
  font-size: clamp(16px, 1vw, 20px);
}

.tv-profile.is-login .tv-profile-code strong {
  color: var(--accent);
  font-size: clamp(28px, min(2vw, 3.8vh), 38px);
  font-weight: 700;
}

.tv-profile-login-hint {
  width: min(760px, calc(100vw - (var(--edge) * 2)));
  margin-top: clamp(2px, 0.8vh, 10px);
  color: var(--muted);
  font-size: clamp(16px, min(1.02vw, 2vh), 21px);
  line-height: 1.4;
  text-align: center;
}

.tv-profile .tv-close,
.tv-login-refresh {
  display: none !important;
}

.tv-profile.is-login.is-loading .tv-profile-shell,
.tv-profile.is-login.is-loading .tv-profile-body {
  width: min(860px, calc(100vw - (var(--edge) * 2)));
}

.tv-profile.is-login.is-loading .tv-profile-head {
  display: grid;
}

@media (max-height: 760px) {
  .tv-profile.is-login {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .tv-profile.is-login .tv-profile-shell {
    gap: 10px;
  }

  .tv-profile.is-login .tv-profile-copy::before {
    width: 52px;
    height: 52px;
    margin-bottom: 6px;
  }

  .tv-profile.is-login h2 {
    font-size: clamp(34px, 5.2vh, 46px);
  }

  .tv-profile.is-login .tv-profile-text {
    margin-top: 8px;
    font-size: clamp(15px, 2.15vh, 18px);
  }

  .tv-profile.is-login .tv-profile-qr,
  .tv-profile.is-login .tv-profile-qr-placeholder {
    width: min(29vw, 37vh, 290px);
    padding: 8px;
  }

  .tv-profile-login {
    gap: 8px;
  }

  .tv-profile.is-login .tv-profile-code strong {
    font-size: clamp(24px, 4.2vh, 32px);
  }

  .tv-profile-login-hint {
    margin-top: 0;
    font-size: clamp(14px, 2vh, 17px);
  }
}
/* Filmach Telegram ID login */
.tv-profile-id-toggle,
.tv-profile-id-action,
.tv-profile-id-key {
  min-height: 62px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  color: #f7f7f7;
  background: rgba(30, 30, 30, 0.94);
  font: inherit;
  font-weight: 700;
  transition: border-color 100ms ease, background-color 100ms ease, transform 100ms ease;
}

.tv-profile-id-toggle {
  min-width: min(360px, 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 28px;
  border: 4px solid transparent;
  color: #fff;
  background: var(--accent);
  font-size: clamp(18px, 1.15vw, 23px);
  box-shadow: none;
}

.tv-profile-id-toggle:focus {
  outline: 0;
  border-color: #fff;
  background: var(--accent);
  box-shadow: none;
}

.tv-profile-id-action:focus,
.tv-profile-id-action:focus-visible,
.tv-profile-id-key:focus,
.tv-profile-id-key:focus-visible {
  outline: 0;
  border-color: transparent;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 14px 34px rgba(1, 176, 255, 0.22);
}

.tv-profile.is-telegram-id .tv-profile-shell {
  gap: clamp(14px, 1.8vh, 22px);
}

.tv-profile.is-telegram-id .tv-profile-body {
  width: min(520px, 100%);
}

.tv-profile-id-login {
  width: 100%;
  gap: 14px;
}

.tv-profile-id-display {
  width: min(560px, 100%);
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: transparent;
  font-size: clamp(36px, 2.6vw, 52px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.tv-profile-id-display::after {
  content: "";
  width: 4px;
  height: 1.18em;
  margin-left: 10px;
  border-radius: 3px;
  background: var(--accent);
  animation: tv-id-caret 1s steps(1, end) infinite;
}

.tv-profile-id-display.is-empty {
  color: #fff;
  font-size: clamp(36px, 2.6vw, 52px);
  letter-spacing: 0;
}

.tv-profile-id-display.is-empty::after {
  margin-left: 0;
}

@keyframes tv-id-caret {
  0%,
  52% {
    opacity: 1;
  }

  53%,
  100% {
    opacity: 0.24;
  }
}

.tv-profile-id-error {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(255, 102, 102, 0.34);
  border-radius: 10px;
  color: #ffb1b1;
  background: rgba(95, 24, 24, 0.36);
  font-size: clamp(15px, 0.95vw, 19px);
  line-height: 1.35;
  text-align: center;
}

.tv-profile-id-error[hidden] {
  display: none;
}

.tv-profile-id-keypad {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tv-profile-id-key {
  min-width: 0;
  padding: 0 10px;
  font-size: clamp(24px, 1.65vw, 34px);
}

.tv-profile-id-key.control {
  color: var(--muted);
  font-size: clamp(15px, 0.95vw, 19px);
}

.tv-profile-id-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tv-profile-id-action {
  min-width: 0;
  padding: 0 18px;
  font-size: clamp(16px, 1vw, 20px);
}

.tv-profile-id-action.primary {
  border-color: rgba(1, 176, 255, 0.72);
  background: var(--accent);
  color: #fff;
}

.tv-profile-id-action:disabled {
  opacity: 0.42;
  pointer-events: none;
}

.tv-profile-id-pending {
  width: min(520px, 100%);
  display: grid;
  justify-items: center;
  gap: clamp(34px, 5vh, 58px);
  padding: clamp(18px, 2.6vh, 30px) 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.tv-profile-id-pending-spinner {
  width: clamp(68px, 8vh, 92px);
  aspect-ratio: 1;
  border: 5px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: tv-profile-id-pending-spin 0.85s linear infinite;
}

.tv-profile-id-pending .tv-profile-id-actions {
  width: min(500px, 100%);
  grid-template-columns: minmax(0, 1fr);
}

@keyframes tv-profile-id-pending-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tv-profile-id-pending-spinner {
    animation-duration: 1.8s;
  }
}
@media (max-height: 760px) {
  .tv-profile.is-telegram-id .tv-profile-copy::before {
    display: none;
  }

  .tv-profile-id-display,
  .tv-profile-id-key,
  .tv-profile-id-action,
  .tv-profile-id-toggle {
    min-height: 50px;
  }

  .tv-profile-id-login {
    gap: 8px;
  }

  .tv-profile-id-keypad,
  .tv-profile-id-actions {
    gap: 7px;
  }
}
/* Compact Telegram ID keypad */
.tv-profile.is-telegram-id .tv-profile-body {
  width: min(620px, 100%);
  justify-self: center;
}

.tv-profile-id-login .tv-profile-login-hint {
  width: 100%;
  max-width: 100%;
  margin: 2px 0 0;
}
.tv-profile-id-display {
  width: min(520px, 100%);
}

.tv-profile-id-keypad {
  width: min(264px, 100%);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-content: center;
  gap: 12px;
}

.tv-profile-id-key {
  width: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  font-size: clamp(22px, 1.45vw, 29px);
}

.tv-profile-id-key.icon-only {
  line-height: 1;
}

.tv-profile-id-key-icon {
  width: 30px;
  height: 30px;
  fill: none;
  color: #fff;
  stroke: #fff;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tv-profile-id-key-backspace-icon {
  width: 34px;
  height: 34px;
}

.tv-profile-id-actions {
  width: min(520px, 100%);
  grid-template-columns: minmax(0, 1fr);
}

.tv-profile-id-action {
  border: 0;
  background: rgba(30, 30, 30, 0.94);
  box-shadow: none;
}

.tv-profile-id-action.primary {
  border-color: transparent;
  background: rgba(30, 30, 30, 0.94);
}

.tv-profile-id-action.primary::before,
.tv-profile-id-action.secondary::before {
  content: none;
}

.tv-profile-id-action.is-focused,
.tv-profile-id-action:focus,
.tv-profile-id-action:focus-visible,
.tv-profile-id-key.is-focused,
.tv-profile-id-key:focus,
.tv-profile-id-key:focus-visible {
  outline: 0;
  border-color: transparent;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 14px 34px rgba(1, 176, 255, 0.22);
}

@media (max-height: 760px) {
  .tv-profile-id-key {
    min-height: 0;
  }

  .tv-profile-id-keypad {
    width: min(228px, 100%);
    gap: 8px;
  }
}
/* Telegram login focus style */
.tv-profile-id-toggle.is-focused,
.tv-profile-id-toggle:hover,
.tv-profile-id-toggle:focus,
.tv-profile-id-toggle:focus-visible {
  border-color: #fff;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9), 0 10px 28px rgba(1, 176, 255, 0.24);
  transform: none;
}

/* Telegram ID help and actions */
.tv-profile-id-login .tv-profile-id-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.tv-profile-id-hint-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  color: var(--accent);
}

.tv-profile-id-hint-icon svg,
.tv-profile-id-action-icon {
  width: 100%;
  height: 100%;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tv-profile-id-hint-text strong {
  color: var(--accent);
  font-weight: 500;
}

.tv-profile-id-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 2px solid rgba(93, 139, 164, 0.36);
  border-radius: 12px;
  color: #fff;
  background: rgba(14, 24, 32, 0.9);
}

.tv-profile-id-action.primary:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 12px 28px rgba(1, 176, 255, 0.2);
}

.tv-profile-id-action.primary:disabled {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(24, 24, 24, 0.92);
  box-shadow: none;
}

.tv-profile-id-action.secondary {
  border-color: rgba(255, 255, 255, 0.16);
  background: #242424;
}

.tv-profile-id-action-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
}

.tv-profile-id-action:not(:disabled).is-focused,
.tv-profile-id-action:not(:disabled):hover,
.tv-profile-id-action:not(:disabled):focus,
.tv-profile-id-action:not(:disabled):focus-visible {
  outline: 0;
  color: #fff;
  box-shadow: 0 0 0 4px #fff, 0 14px 34px rgba(1, 176, 255, 0.28);
  transform: none;
}

.tv-profile-id-action.primary:not(:disabled).is-focused,
.tv-profile-id-action.primary:not(:disabled):hover,
.tv-profile-id-action.primary:not(:disabled):focus,
.tv-profile-id-action.primary:not(:disabled):focus-visible {
  border-color: var(--accent);
  background: var(--accent);
}

.tv-profile-id-action.secondary.is-focused,
.tv-profile-id-action.secondary:hover,
.tv-profile-id-action.secondary:focus,
.tv-profile-id-action.secondary:focus-visible {
  border-color: rgba(255, 255, 255, 0.16);
  background: #2b2b2b;
}
/* Keep the Telegram ID form inside short TV/WebView viewports. */
.tv-profile.is-login.is-telegram-id {
  padding: clamp(8px, 1.4vh, 18px) var(--edge);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.tv-profile.is-login.is-telegram-id .tv-profile-shell {
  width: min(760px, calc(100vw - (var(--edge) * 2)));
  min-height: min-content;
  max-height: none;
  gap: clamp(26px, 3.2vh, 40px);
}

.tv-profile.is-login.is-telegram-id .tv-profile-head {
  width: 100%;
  gap: 0;
}

.tv-profile.is-login.is-telegram-id .tv-profile-copy::before {
  width: clamp(44px, 7vh, 72px);
  height: clamp(44px, 7vh, 72px);
  margin-bottom: clamp(7px, 1vh, 12px);
}

.tv-profile.is-login.is-telegram-id h2 {
  font-size: clamp(34px, 5.2vh, 56px);
  line-height: 1;
}

.tv-profile.is-login.is-telegram-id .tv-profile-text {
  margin-top: clamp(8px, 1.15vh, 14px);
  font-size: clamp(14px, 2vh, 20px);
  line-height: 1.3;
}

.tv-profile.is-login.is-telegram-id .tv-profile-text span {
  white-space: pre-line;
}

.tv-profile.is-telegram-id .tv-profile-body {
  width: min(560px, 100%);
  min-height: 0;
  gap: clamp(8px, 1.2vh, 14px);
}

.tv-profile.is-telegram-id .tv-profile-id-login {
  gap: clamp(8px, 1.2vh, 14px);
}

.tv-profile.is-telegram-id .tv-profile-id-display {
  min-height: clamp(42px, 6.2vh, 64px);
  margin-bottom: clamp(18px, 2.4vh, 30px);
  font-size: clamp(30px, 4.4vh, 46px);
}

.tv-profile.is-telegram-id .tv-profile-id-keypad {
  width: clamp(156px, 24vh, 246px);
  gap: clamp(8px, 1.05vh, 12px);
}

.tv-profile.is-telegram-id .tv-profile-id-key {
  font-size: clamp(21px, 3.1vh, 28px);
}

.tv-profile.is-telegram-id .tv-profile-id-key-icon {
  width: clamp(24px, 3.5vh, 30px);
  height: clamp(24px, 3.5vh, 30px);
}

.tv-profile.is-telegram-id .tv-profile-id-key-backspace-icon {
  width: clamp(27px, 4vh, 34px);
  height: clamp(27px, 4vh, 34px);
}

.tv-profile.is-telegram-id .tv-profile-id-hint {
  gap: clamp(6px, 0.9vh, 10px);
  font-size: clamp(13px, 1.7vh, 17px);
  line-height: 1.25;
}

.tv-profile.is-telegram-id .tv-profile-id-hint-icon {
  width: clamp(22px, 3vh, 28px);
  height: clamp(22px, 3vh, 28px);
  flex-basis: clamp(22px, 3vh, 28px);
}

.tv-profile.is-telegram-id .tv-profile-id-actions {
  width: min(500px, 100%);
  gap: clamp(8px, 1.05vh, 12px);
}

.tv-profile.is-telegram-id .tv-profile-id-action {
  min-height: clamp(44px, 5.6vh, 56px);
  font-size: clamp(16px, 2vh, 20px);
}

.tv-profile.is-telegram-id .tv-profile-id-action-icon {
  width: clamp(24px, 3.2vh, 28px);
  height: clamp(24px, 3.2vh, 28px);
  flex-basis: clamp(24px, 3.2vh, 28px);
}

@media (max-height: 760px) {
  .tv-profile.is-login.is-telegram-id .tv-profile-shell {
    gap: clamp(12px, 2vh, 18px);
  }

  .tv-profile.is-login.is-telegram-id .tv-profile-copy::before {
    display: none;
  }

  .tv-profile.is-telegram-id .tv-profile-id-display {
    margin-bottom: clamp(8px, 1.4vh, 12px);
  }
}
