:root {
  --bg: #050505;
  --bg-soft: #101010;
  --panel: rgba(20, 20, 20, 0.92);
  --panel-strong: rgba(9, 9, 9, 0.98);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f5f5f1;
  --muted: #b3b3b3;
  --accent-blue: #e50914;
  --accent-purple: #b20710;
  --accent-yellow: #ff6b6b;
  --shadow: 0 28px 60px rgba(0, 0, 0, 0.58);
  --sidebar-w: 148px;
  --sidebar-expanded: 270px;
  --sidebar-current: var(--sidebar-expanded);
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 92, 92, 0.7) rgba(255, 255, 255, 0.06);
}

*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

*::-webkit-scrollbar-track {
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(10, 10, 10, 0.62);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 10px 18px rgba(0, 0, 0, 0.24);
}

*::-webkit-scrollbar-thumb {
  border: 2px solid rgba(7, 7, 7, 0.58);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 129, 129, 0.95), rgba(229, 9, 20, 0.82) 52%, rgba(125, 7, 15, 0.94)),
    rgba(229, 9, 20, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 18px rgba(229, 9, 20, 0.22);
}

*::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(180deg, rgba(255, 149, 149, 1), rgba(255, 59, 72, 0.92) 52%, rgba(151, 11, 21, 0.98)),
    rgba(255, 59, 72, 0.88);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Montserrat", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 18%, rgba(229, 9, 20, 0.2), transparent 22%),
    radial-gradient(circle at 82% 12%, rgba(178, 7, 16, 0.16), transparent 24%),
    radial-gradient(circle at 50% 80%, rgba(255, 107, 107, 0.08), transparent 24%),
    linear-gradient(180deg, #111111 0%, #050505 45%, #000000 100%);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

body.auth-locked {
  overflow: hidden;
}

button,
input {
  font: inherit;
  touch-action: manipulation;
}

button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-current) minmax(0, 1fr);
  align-items: start;
  gap: 26px;
  width: min(1680px, calc(100% - 36px));
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 0 calc(40px + env(safe-area-inset-bottom));
}

body.auth-locked .app-shell {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.sidebar {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 18px;
  align-self: start;
  width: 100%;
  min-width: 0;
  height: calc(100vh - 36px);
  max-height: calc(100vh - 36px);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(24, 10, 12, 0.98), rgba(10, 10, 10, 0.98)),
    var(--panel);
  box-shadow: var(--shadow);
  overflow-x: hidden;
  overflow-y: auto;
  transition: height 220ms ease;
}

.sidebar,
.sidebar-nav,
.rail-track,
.channel-list,
.category-list,
.epg-next-list,
.guide-grid,
.modal-panel,
.player-panel,
.detail-panel-body {
  scrollbar-gutter: stable;
}

.brand-block {
  display: grid;
  gap: 14px;
}

.brand-button,
.nav-item,
.sidebar-toggle,
.playlist-chip,
.primary-btn,
.secondary-btn,
.ghost-btn,
.icon-btn,
.category-item,
.channel-card {
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.brand-button {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(229, 9, 20, 0.14), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.03);
}

.brand-mark {
  position: relative;
  width: 54px;
  height: 54px;
  display: block;
  overflow: hidden;
  border-radius: 18px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 10px 26px rgba(229, 9, 20, 0.28);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-glyph {
  position: relative;
  z-index: 1;
  font-size: 1rem;
}

.brand-copy {
  display: grid;
  gap: 2px;
  text-align: left;
}

.brand-copy small,
.nav-label,
.playlist-chip small,
.eyebrow,
.panel-head span,
.hero-copy,
.settings-card p,
.channel-meta span,
.epg-time,
.epg-program p,
.spotlight-card p {
  color: var(--muted);
}

.sidebar-toggle {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  justify-self: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-toggle span,
.sidebar-toggle span::before,
.sidebar-toggle span::after {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
  content: "";
}

.sidebar-toggle span::before {
  transform: translateY(-5px);
}

.sidebar-toggle span::after {
  transform: translateY(3px);
}

.sidebar-nav {
  display: grid;
  gap: 10px;
  overscroll-behavior-x: contain;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border-radius: 18px;
  color: #d8def0;
  text-align: left;
}

.nav-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #ffd8dc;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 96, 96, 0.34), transparent 58%),
    linear-gradient(180deg, rgba(79, 18, 23, 0.92), rgba(24, 18, 23, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 20px rgba(0, 0, 0, 0.24);
}

.nav-icon svg {
  width: 20px;
  height: 20px;
  display: block;
  stroke: currentColor;
  stroke-width: 1.85;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item:hover .nav-icon,
.nav-item:focus-visible .nav-icon,
.nav-item.active .nav-icon,
.brand-button:hover .nav-icon,
.brand-button:focus-visible .nav-icon {
  color: #fff5f6;
  border-color: rgba(255, 116, 116, 0.22);
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 120, 120, 0.46), transparent 56%),
    linear-gradient(180deg, rgba(169, 24, 35, 0.94), rgba(73, 9, 16, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 26px rgba(229, 9, 20, 0.28);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.account-chip {
  display: grid;
  gap: 4px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
}

.account-chip-label {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sidebar[data-collapsed="true"] .brand-copy,
.sidebar[data-collapsed="true"] .nav-label,
.sidebar[data-collapsed="true"] .account-chip-label,
.sidebar[data-collapsed="true"] #accountChipEmail,
.sidebar[data-collapsed="true"] .playlist-chip span,
.sidebar[data-collapsed="true"] .playlist-chip small {
  display: none;
}

.sidebar[data-collapsed="true"] {
  padding: 14px 12px;
  overflow-y: hidden;
}

.sidebar[data-collapsed="true"] .brand-block {
  justify-items: center;
}

.sidebar[data-collapsed="true"] .nav-item,
.sidebar[data-collapsed="true"] .brand-button,
.sidebar[data-collapsed="true"] .sidebar-footer > button {
  justify-content: center;
}

.sidebar[data-collapsed="true"] .sidebar-nav,
.sidebar[data-collapsed="true"] .sidebar-footer {
  justify-items: center;
}

.sidebar[data-collapsed="true"] .sidebar-footer {
  display: none;
}

.sidebar[data-collapsed="true"] .account-chip,
.sidebar[data-collapsed="true"] .playlist-chip {
  width: 100%;
  justify-items: center;
  text-align: center;
}

.sidebar[data-collapsed="true"] .nav-item {
  min-height: 64px;
  padding: 10px;
}

.sidebar[data-collapsed="true"] .nav-icon {
  width: 44px;
  height: 44px;
}

.sidebar[data-collapsed="true"] .account-chip {
  padding: 14px 10px;
}

.sidebar[data-collapsed="true"] #accountChipName {
  font-size: 0.82rem;
  line-height: 1.2;
  word-break: break-word;
}

.sidebar[data-collapsed="true"] .sidebar-footer > button {
  width: 100%;
  min-height: 52px;
  padding-inline: 10px;
  font-size: 0.82rem;
  line-height: 1.15;
  text-align: center;
}

.playlist-chip {
  display: grid;
  gap: 4px;
  padding: 16px;
  border-radius: 20px;
  color: #241201;
  background: linear-gradient(135deg, #ffcd55, #ff9d1f);
}

.app-install-btn {
  width: 100%;
  justify-content: center;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(229, 9, 20, 0.26);
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.18), rgba(178, 7, 16, 0.12));
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.22);
}

.hidden {
  display: none !important;
}

.app-install-btn.hidden {
  display: none;
}

.focusable:hover,
.focusable:focus-visible,
.nav-item.active,
.category-item.active,
.channel-card.active,
.brand-button.active {
  outline: none;
  transform: translateY(-2px) scale(1.01);
  border-color: rgba(229, 9, 20, 0.35);
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.22), rgba(178, 7, 16, 0.16));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 26px rgba(229, 9, 20, 0.22);
}

.main-shell {
  display: grid;
  min-width: 0;
}

.screen {
  display: none;
  gap: 28px;
  min-width: 0;
}

.screen.active {
  display: grid;
  animation: screenReveal 420ms cubic-bezier(0.18, 0.82, 0.2, 1) both;
}

.hero-banner,
.live-categories,
.channels-panel,
.epg-panel,
.settings-card,
.poster-card,
.spotlight-card,
.epg-row {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(24, 24, 24, 0.94), rgba(10, 10, 10, 0.98));
  box-shadow: var(--shadow);
}

.hero-banner {
  position: relative;
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 280px;
  align-items: end;
  gap: 22px;
  overflow: hidden;
  padding: 42px;
  border-radius: 34px;
  background-size: cover;
  background-position: center 24%;
  isolation: isolate;
}

.hero-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 72% 18%, rgba(229, 9, 20, 0.22), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 28%);
  z-index: 0;
  pointer-events: none;
}

.hero-backdrop,
.preview-gradient,
.player-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.96) 0%, rgba(10, 10, 10, 0.78) 38%, rgba(20, 0, 0, 0.28) 100%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.96) 0%, rgba(0, 0, 0, 0.54) 34%, transparent 74%);
}

.hero-content,
.hero-meta,
.preview-copy {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-weight: 700;
  color: #d7d7d7;
}

.hero-banner h1,
.section-heading h2,
.panel-head h3,
.preview-copy h3 {
  margin: 0;
  line-height: 0.92;
  font-family: "Bebas Neue", "Montserrat", sans-serif;
  letter-spacing: 0.02em;
}

.hero-banner h1 {
  max-width: 9ch;
  font-size: clamp(4.6rem, 8vw, 7.8rem);
  text-shadow: 0 14px 34px rgba(0, 0, 0, 0.48);
  overflow-wrap: anywhere;
}

.hero-copy {
  max-width: 54ch;
  font-size: 1.08rem;
  line-height: 1.85;
  margin: 20px 0 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.primary-btn {
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
}

.secondary-btn,
.ghost-btn,
.icon-btn {
  background: rgba(255, 255, 255, 0.06);
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 22px;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(229, 9, 20, 0.24), transparent 24%),
    radial-gradient(circle at 84% 14%, rgba(178, 7, 16, 0.18), transparent 30%),
    rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(16px);
}

.auth-panel {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: stretch;
}

.auth-panel-copy,
.auth-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 32px;
  box-shadow: var(--shadow);
  animation: modalRise 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.auth-panel-copy {
  display: none;
}

.auth-card {
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 28px;
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.98), rgba(8, 8, 8, 0.98));
}

.auth-card::before {
  content: "EZTIPTV";
  display: block;
  margin-bottom: 4px;
  color: #fff;
  font-size: clamp(2.5rem, 8vw, 3.4rem);
  line-height: 0.9;
  font-family: "Bebas Neue", "Montserrat", sans-serif;
  letter-spacing: 0.06em;
  text-align: center;
}

.auth-card::after {
  content: "Entre para acessar seu streaming e continuar de onde parou.";
  display: block;
  margin-top: -12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.auth-tab {
  min-height: 46px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
}

.auth-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  box-shadow: 0 12px 30px rgba(229, 9, 20, 0.28);
}

.auth-status {
  min-height: 48px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  line-height: 1.5;
}

.auth-status[data-tone="error"] {
  color: #ffd4d6;
  border-color: rgba(255, 106, 106, 0.26);
  background: rgba(111, 18, 25, 0.34);
}

.auth-status[data-tone="success"] {
  color: #ebfff0;
  border-color: rgba(72, 179, 116, 0.28);
  background: rgba(12, 74, 38, 0.34);
}

.auth-form {
  display: none;
  gap: 14px;
}

.auth-form.active {
  display: grid;
}

.auth-field {
  display: grid;
  gap: 8px;
}

.auth-field span {
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-field input {
  min-height: 54px;
  width: 100%;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  color: #fff;
  background: rgba(255, 255, 255, 0.045);
  outline: none;
}

.auth-field input:focus {
  border-color: rgba(229, 9, 20, 0.62);
  box-shadow: 0 0 0 4px rgba(229, 9, 20, 0.14);
}

.auth-submit {
  width: 100%;
  justify-content: center;
}

.hero-meta {
  display: grid;
  gap: 14px;
}

.hero-meta article {
  padding: 20px;
  border-radius: 24px;
  backdrop-filter: blur(20px);
  background: linear-gradient(180deg, rgba(22, 22, 22, 0.82), rgba(8, 8, 8, 0.7));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.home-search-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(24, 24, 24, 0.94), rgba(10, 10, 10, 0.98));
  box-shadow: var(--shadow);
  content-visibility: auto;
  contain-intrinsic-size: 360px;
}

.home-search-head h2 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3rem);
  font-family: "Bebas Neue", "Montserrat", sans-serif;
  letter-spacing: 0.03em;
}

.home-search-shell {
  margin: 0;
}

.home-search-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.home-search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}

.home-search-filter {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.home-search-filter.active {
  color: #fff;
  border-color: rgba(229, 9, 20, 0.32);
  background: rgba(229, 9, 20, 0.22);
}

.home-search-result {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 12px;
  text-align: left;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(229, 9, 20, 0.08));
}

.home-search-result-thumb {
  width: 84px;
  height: 112px;
  object-fit: cover;
  border-radius: 14px;
}

.home-search-result-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.home-search-result-copy strong {
  font-size: 1rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.home-search-result-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-search-result-badge {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: #fff;
  background: rgba(229, 9, 20, 0.28);
}

.home-search-empty {
  min-height: 120px;
}

.home-playlist-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(24, 24, 24, 0.94), rgba(10, 10, 10, 0.98));
  box-shadow: var(--shadow);
}

.home-playlist-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.home-playlist-grid article {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.045);
}

.home-playlist-grid span,
.home-playlist-meta,
.home-playlist-meta small {
  color: var(--muted);
}

.home-playlist-grid strong {
  font-size: 1.7rem;
  line-height: 1;
}

.home-playlist-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: space-between;
  line-height: 1.4;
}

.continue-watching-panel {
  display: grid;
  gap: 14px;
  content-visibility: auto;
  contain-intrinsic-size: 320px;
}

.stable-channels-panel {
  display: grid;
  gap: 14px;
  content-visibility: auto;
  contain-intrinsic-size: 300px;
}

.favorite-channels-panel {
  display: grid;
  gap: 14px;
  content-visibility: auto;
  contain-intrinsic-size: 260px;
}

.continue-watching-head h2 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3rem);
  font-family: "Bebas Neue", "Montserrat", sans-serif;
  letter-spacing: 0.03em;
}

.continue-watching-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

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

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

.stable-channel-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 124px;
  padding: 14px;
  text-align: left;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), rgba(229, 9, 20, 0.08)),
    rgba(255, 255, 255, 0.025);
}

.favorite-channel-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 104px;
  padding: 12px;
  text-align: left;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.favorite-channel-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  padding: 8px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.34);
}

.favorite-channel-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.favorite-channel-copy span,
.favorite-channel-copy small {
  color: var(--muted);
  line-height: 1.35;
}

.favorite-channel-copy span {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.favorite-channel-copy strong {
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.stable-channel-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 18px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stable-channel-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.stable-channel-copy strong {
  font-size: 1rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.stable-channel-copy p,
.stable-channel-copy small {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.stable-channel-copy p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.stable-channel-copy small {
  font-size: 0.78rem;
}

.stable-channel-badge {
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  overflow: hidden;
  border-radius: 999px;
  color: #fff;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(229, 9, 20, 0.28);
}

.home-favorites-panel {
  display: grid;
  gap: 14px;
}

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

.home-favorite-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  text-align: left;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.home-favorite-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 14px;
}

.home-favorite-card span {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.home-favorite-card strong {
  font-size: 0.92rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.continue-card {
  position: relative;
  display: block;
}

.continue-card-main {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 12px;
  text-align: left;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(229, 9, 20, 0.08));
}

.continue-remove-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  font-size: 1.25rem;
  line-height: 1;
  color: #f5f5f1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 8, 8, 0.76);
  backdrop-filter: blur(10px);
}

.continue-remove-btn:hover,
.continue-remove-btn:focus-visible {
  color: #fff;
  border-color: rgba(229, 9, 20, 0.35);
  background: rgba(229, 9, 20, 0.22);
}

.continue-card-thumb {
  width: 104px;
  height: 140px;
  object-fit: cover;
  border-radius: 16px;
}

.continue-card-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.continue-card-copy strong {
  font-size: 1rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.continue-card-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.continue-card-badge {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: #fff;
  background: rgba(229, 9, 20, 0.28);
}

.continue-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.continue-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple), var(--accent-yellow));
}

.continue-progress-label {
  color: var(--muted);
  font-size: 0.82rem;
}

.hero-meta span {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

.rails-shell,
.poster-grid,
.spotlight-grid,
.settings-grid,
.epg-board {
  display: grid;
  gap: 24px;
}

.catalog-group {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.catalog-browser {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.home-shortcut-shell {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.home-shortcut-card {
  padding: 20px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.home-shortcut-head {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.home-shortcut-head h3 {
  margin: 0;
}

.home-shortcut-head span {
  color: var(--muted);
}

.home-shortcut-list {
  display: grid;
  gap: 10px;
}

.home-shortcut-item {
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.home-shortcut-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.catalog-sidebar,
.catalog-results {
  padding: 20px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  content-visibility: auto;
  contain-intrinsic-size: 640px;
}

.catalog-search-shell {
  display: grid;
  gap: 8px;
  margin: 16px 0 18px;
}

.catalog-search-row {
  position: relative;
}

.live-search-shell {
  margin: 0 0 18px;
}

.catalog-search-shell span {
  color: var(--muted);
  font-size: 0.9rem;
}

.catalog-search-input {
  width: 100%;
  padding: 14px 48px 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(229, 9, 20, 0.08));
  color: var(--text);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.catalog-search-input:focus {
  border-color: rgba(229, 9, 20, 0.36);
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.14);
  transform: translateY(-1px);
}

.catalog-search-clear {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(229, 9, 20, 0.18);
  color: #fff;
  font-weight: 700;
}

.catalog-search-clear.hidden {
  display: none;
}

.search-highlight {
  padding: 0 3px;
  border-radius: 6px;
  color: #fff;
  background: rgba(229, 9, 20, 0.38);
}

.catalog-category-list {
  display: grid;
  gap: 10px;
  max-height: 68vh;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
}

.catalog-category-item {
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.catalog-category-item.active {
  background: linear-gradient(135deg, rgba(55, 182, 255, 0.28), rgba(119, 88, 255, 0.28));
  border-color: rgba(255, 255, 255, 0.12);
}

.catalog-category-item strong {
  display: block;
}

.catalog-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.catalog-group-head h3 {
  margin: 0;
  font-size: 1.25rem;
}

.catalog-group-head span {
  color: var(--muted);
}

.rail {
  display: grid;
  gap: 14px;
}

.rail-head,
.section-heading,
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
}

.rail-head h2,
.section-heading h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  font-family: "Bebas Neue", "Montserrat", sans-serif;
  letter-spacing: 0.03em;
}

.rail-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(188px, 188px);
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 10px;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.rail-track > * {
  scroll-snap-align: start;
}

.rail-empty-state {
  width: min(420px, 100%);
  min-height: 188px;
}

.rail-track::-webkit-scrollbar,
.channel-list::-webkit-scrollbar,
.category-list::-webkit-scrollbar,
.epg-next-list::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.rail-track::-webkit-scrollbar-thumb,
.channel-list::-webkit-scrollbar-thumb,
.category-list::-webkit-scrollbar-thumb,
.epg-next-list::-webkit-scrollbar-thumb {
  border-width: 1px;
}

.media-card,
.poster-card,
.spotlight-card {
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(28, 28, 28, 0.88), rgba(13, 13, 13, 0.98));
  transform-origin: center bottom;
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease,
    filter 220ms ease;
}

.media-card {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.media-card:hover,
.poster-card:hover,
.spotlight-card:hover {
  transform: translateY(-10px) scale(1.065);
  border-color: rgba(229, 9, 20, 0.26);
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 34px rgba(229, 9, 20, 0.18);
  filter: saturate(1.06);
}

.media-card:hover img,
.poster-card:hover img,
.spotlight-card:hover img {
  transform: scale(1.08);
}

.media-thumb,
.poster-thumb,
.spotlight-thumb {
  width: 100%;
  object-fit: cover;
  border-radius: 18px;
  transition: transform 260ms ease, filter 260ms ease;
}

.media-thumb.wide {
  aspect-ratio: 16 / 9;
}

.media-thumb.poster,
.poster-thumb {
  aspect-ratio: 2 / 3;
}

.media-copy strong,
.poster-copy strong,
.spotlight-copy strong,
.channel-meta strong,
.epg-program strong {
  display: block;
  font-size: 1.06rem;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.media-copy span,
.poster-copy span,
.spotlight-copy span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.live-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
}

.live-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.live-mode-switch {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 10px;
  padding: 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.mode-toggle {
  padding: 12px 18px;
  border-radius: 999px;
  color: var(--muted);
}

.mode-toggle.active {
  color: #071018;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-yellow));
  box-shadow: 0 0 24px rgba(55, 182, 255, 0.22);
}

.live-stage {
  display: grid;
}

.live-browser-grid,
.live-guide-view {
  display: none;
}

.live-browser-grid.active,
.live-guide-view.active {
  display: grid;
}

.live-browser-grid {
  grid-template-columns: 240px minmax(0, 1.1fr) 360px;
  gap: 18px;
  align-items: start;
}

.live-categories,
.channels-panel,
.epg-panel,
.live-preview-panel,
.guide-shell {
  padding: 20px;
  border-radius: 28px;
}

.category-list,
.channel-list,
.epg-next-list {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
}

.virtual-list,
.virtual-grid {
  position: relative;
  overflow: auto;
}

.virtual-spacer {
  width: 100%;
  pointer-events: none;
}

.virtual-window {
  position: absolute;
  inset: 0;
}

.virtual-card {
  position: absolute;
  margin: 0;
}

.category-item,
.channel-card {
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.category-item strong,
.guide-channel-cell strong {
  display: block;
}

.category-item span,
.guide-channel-cell span,
.preview-synopsis span,
.preview-upnext span,
.live-preview-meta span {
  color: var(--muted);
}

.live-main-panel {
  display: grid;
  gap: 18px;
}

.live-preview {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  border-radius: 30px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
}

.preview-copy {
  display: grid;
  align-content: end;
  height: 100%;
  padding: 24px;
}

.preview-copy h3 {
  font-size: clamp(2rem, 3vw, 3rem);
}

.live-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 360px;
  gap: 18px;
}

.channel-card {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.channel-logo {
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  border-radius: 18px;
  object-fit: cover;
}

.channel-meta {
  min-width: 0;
}

.channel-meta-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.channel-meta strong,
.channel-meta span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-now-title {
  margin: 8px 0 10px;
  font-weight: 700;
}

.channel-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--muted);
}

.channel-progress-track {
  margin-top: 8px;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.channel-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple), var(--accent-yellow));
}

.live-preview-card {
  display: grid;
  gap: 14px;
}

.live-preview-media {
  position: relative;
  min-height: 240px;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--line);
  background-size: cover;
  background-position: center;
}

.live-preview-media #liveProgramTitle {
  margin: 10px 0 0;
  color: #d8def0;
  font-size: 1rem;
}

.live-preview-details {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.live-preview-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.live-now-pill {
  padding: 8px 12px;
  border-radius: 999px;
  color: #09111a;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-yellow));
  font-weight: 700;
}

.live-preview-details p {
  margin: 0;
  line-height: 1.7;
}

.preview-synopsis,
.preview-upnext {
  display: grid;
  gap: 6px;
}

.guide-shell {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(14, 16, 27, 0.92), rgba(10, 11, 20, 0.96));
  box-shadow: var(--shadow);
}

.guide-shell-full {
  padding: 22px;
  border-radius: 28px;
}

.guide-board {
  overflow: auto;
  padding-bottom: 6px;
}

.guide-header,
.guide-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  min-width: 1180px;
}

.guide-header {
  position: sticky;
  top: 0;
  z-index: 2;
  margin-bottom: 14px;
}

.guide-channel-heading,
.guide-time-row,
.guide-channel-cell,
.guide-program-track {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.guide-channel-heading,
.guide-time-row span {
  font-weight: 700;
}

.guide-channel-heading {
  padding: 18px;
}

.guide-time-row {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.guide-time-row span {
  padding: 6px 8px;
  color: var(--muted);
}

.guide-rows {
  display: grid;
  gap: 14px;
}

.guide-channel-cell {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
}

.guide-channel-logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  object-fit: cover;
}

.guide-program-track {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.guide-program-block {
  min-height: 84px;
  padding: 14px;
  text-align: left;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(119, 88, 255, 0.08));
}

.guide-program-block span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.guide-program-block:hover,
.guide-program-focused {
  border-color: rgba(55, 182, 255, 0.35);
  background: linear-gradient(135deg, rgba(55, 182, 255, 0.24), rgba(119, 88, 255, 0.28));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 24px rgba(55, 182, 255, 0.2);
}

.epg-current,
.epg-program {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
}

.epg-time {
  display: block;
  margin-top: 6px;
  font-size: 0.88rem;
}

.poster-grid {
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  justify-content: start;
}

.poster-grid > .poster-card {
  max-width: 218px;
}

.poster-grid.virtual-grid {
  display: block;
  min-height: 420px;
  overflow: visible;
}

.poster-grid.virtual-grid .virtual-card {
  min-height: 0;
}

.poster-card {
  position: relative;
  display: grid;
  padding: 0;
  min-height: 100%;
  content-visibility: auto;
  contain-intrinsic-size: 460px;
  background:
    radial-gradient(circle at top right, rgba(229, 9, 20, 0.18), transparent 32%),
    linear-gradient(180deg, rgba(20, 18, 18, 0.96), rgba(9, 9, 9, 0.99));
}

.poster-media {
  position: relative;
  overflow: hidden;
}

.poster-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 7, 7, 0.04) 0%, rgba(7, 7, 7, 0) 34%, rgba(7, 7, 7, 0.88) 100%),
    linear-gradient(0deg, rgba(229, 9, 20, 0.16), transparent 42%);
  pointer-events: none;
}

.poster-badges {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  z-index: 1;
}

.poster-badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.poster-badge-primary {
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.92), rgba(143, 8, 16, 0.88));
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.poster-copy,
.spotlight-copy {
  padding: 14px 14px 16px;
}

.poster-copy {
  display: grid;
  gap: 8px;
}

.poster-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.poster-meta-row span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.77rem;
  line-height: 1;
}

.poster-action-hint {
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.spotlight-grid,
.settings-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.detail-screen {
  min-height: calc(100vh - 36px);
}

.detail-backdrop {
  position: relative;
  min-height: calc(100vh - 36px);
  overflow: hidden;
  border-radius: 34px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background-size: cover;
  background-position: center 18%;
  isolation: isolate;
}

.detail-backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 20%, rgba(229, 9, 20, 0.2), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 22%);
  pointer-events: none;
  z-index: 0;
}

.detail-backdrop-fade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.96) 0%, rgba(8, 8, 8, 0.82) 34%, rgba(15, 0, 0, 0.22) 76%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.58) 40%, transparent 78%);
}

.detail-layout {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 36px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 28px;
  align-items: end;
  padding: 42px;
}

.detail-primary {
  display: grid;
  gap: 22px;
  align-content: end;
  max-width: 820px;
}

.detail-back-button {
  width: fit-content;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.16), rgba(255, 255, 255, 0.06));
}

.detail-primary h1 {
  margin: 0;
  max-width: 9ch;
  font-size: clamp(4rem, 7vw, 6.8rem);
  line-height: 0.9;
  font-family: "Bebas Neue", "Montserrat", sans-serif;
  letter-spacing: 0.03em;
  text-shadow: 0 16px 34px rgba(0, 0, 0, 0.52);
  overflow-wrap: anywhere;
}

.detail-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.detail-meta-line span {
  padding: 10px 14px;
  border-radius: 999px;
  color: #f0f0ee;
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.18), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-width: 100%;
  overflow-wrap: anywhere;
}

.detail-synopsis {
  max-width: 62ch;
  margin: 0;
  line-height: 1.88;
  font-size: 1.08rem;
  color: #ededeb;
}

.detail-credits {
  display: grid;
  gap: 8px;
}

.detail-credits p {
  margin: 0;
  color: #d5d5d2;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.detail-actions button:disabled,
.detail-actions .is-disabled {
  cursor: not-allowed;
  opacity: 0.52;
  filter: grayscale(0.35);
}

.detail-secondary {
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(22, 22, 22, 0.78), rgba(7, 7, 7, 0.86));
  backdrop-filter: blur(24px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 20px 50px rgba(0, 0, 0, 0.38);
}

.series-panel-hidden {
  display: none;
}

.season-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.season-panel-head h3 {
  margin: 0;
}

.season-select-shell {
  display: grid;
  gap: 8px;
}

.season-select-shell select {
  min-width: 180px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(38, 38, 38, 0.96), rgba(18, 18, 18, 0.98));
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  color-scheme: dark;
}

.season-select-shell select option {
  background: #141414;
  color: #f5f5f1;
}

.episode-list {
  display: grid;
  gap: 14px;
  max-height: 66vh;
  overflow: auto;
  padding-right: 4px;
}

.episode-card {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(229, 9, 20, 0.08));
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.episode-card:hover {
  transform: translateY(-4px) scale(1.015);
  border-color: rgba(229, 9, 20, 0.28);
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.34),
    0 0 22px rgba(229, 9, 20, 0.12);
}

.episode-card-disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.episode-card-disabled:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.episode-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 16px;
}

.episode-copy {
  display: grid;
  gap: 8px;
}

.episode-title-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.episode-title-row span,
.episode-copy p {
  color: var(--muted);
}

.episode-copy p {
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.spotlight-card,
.settings-card,
.epg-row {
  padding: 22px;
  border-radius: 28px;
}

.spotlight-thumb {
  aspect-ratio: 16 / 9;
  border-radius: 20px;
}

.epg-row {
  display: grid;
  grid-template-columns: 200px repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: center;
}

.epg-row strong {
  font-size: 1.05rem;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.quality-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.quality-chips span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.player-diagnostic-grid,
.playlist-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.player-diagnostic-grid div,
.playlist-summary-grid div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.player-diagnostic-grid span,
.playlist-summary-grid span,
.playlist-summary-meta span {
  color: var(--muted);
  font-size: 0.78rem;
}

.player-diagnostic-grid strong,
.playlist-summary-grid strong,
.playlist-summary-meta span {
  overflow-wrap: anywhere;
}

.playlist-summary-meta {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.playlist-settings-card {
  align-content: start;
}

.playlist-upload-field {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.playlist-upload-field input,
.playlist-upload-field textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.playlist-upload-field textarea {
  resize: vertical;
  min-height: 180px;
}

.playlist-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.playlist-status {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #dce3f3;
}

.playlist-status.is-error {
  border-color: rgba(255, 112, 112, 0.32);
  background: rgba(255, 112, 112, 0.08);
  color: #ffd2d2;
}

.playlist-status.is-success {
  border-color: rgba(55, 182, 255, 0.24);
  background: rgba(55, 182, 255, 0.08);
  color: #d8f1ff;
}

.skeleton-card,
.skeleton-row {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
}

.skeleton-card {
  min-height: 280px;
}

.skeleton-row {
  min-height: 78px;
}

.skeleton-card::after,
.skeleton-row::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  animation: skeletonSweep 1200ms ease-in-out infinite;
}

body.low-power-mode *,
body.low-power-mode *::before,
body.low-power-mode *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

body.low-power-mode .sidebar,
body.low-power-mode .detail-secondary,
body.low-power-mode .player-status {
  backdrop-filter: none;
}

.empty-state {
  display: grid;
  gap: 8px;
  align-items: center;
  min-height: 168px;
  padding: 20px;
  border-radius: 22px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.03);
}

.empty-state strong {
  font-size: 1rem;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.player-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
}

.player-overlay:fullscreen,
.player-overlay:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  place-items: stretch;
  background: #000;
}

.player-overlay.hidden {
  display: none;
}

.player-stage {
  position: relative;
  z-index: 1;
  width: min(92vw, 1520px);
  animation: modalRise 320ms cubic-bezier(0.2, 0.85, 0.2, 1) both;
}

.player-overlay:fullscreen .player-stage,
.player-overlay:-webkit-full-screen .player-stage {
  width: 100vw;
  height: 100vh;
  animation: none;
}

.player-video {
  position: relative;
  min-height: 82vh;
  overflow: hidden;
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #000;
  box-shadow:
    0 34px 80px rgba(0, 0, 0, 0.64),
    0 0 0 1px rgba(255, 255, 255, 0.03);
}

.player-overlay:fullscreen .player-video,
.player-overlay:-webkit-full-screen .player-video {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  border-radius: 0;
  border: 0;
  box-shadow: none;
}

.player-video-surface {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 24%, rgba(229, 9, 20, 0.2), transparent 24%),
    radial-gradient(circle at 82% 16%, rgba(255, 107, 107, 0.14), transparent 24%),
    linear-gradient(180deg, #060606 0%, #101010 100%);
}

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

.player-video > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 82vh;
  object-fit: cover;
  opacity: 0.24;
  filter: saturate(0.88);
}

.player-overlay:fullscreen .player-video > img,
.player-overlay:-webkit-full-screen .player-video > img {
  height: 100vh;
}

.player-status {
  position: absolute;
  left: 28px;
  bottom: 144px;
  z-index: 2;
  max-width: min(420px, calc(100% - 56px));
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.player-status[data-tone="loading"] {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.player-status[data-tone="loading"]::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  animation: playerSpinner 800ms linear infinite;
}

.player-status.hidden {
  display: none;
}

.player-status[data-tone="error"] {
  border-color: rgba(229, 9, 20, 0.36);
  background: rgba(45, 7, 10, 0.88);
}

.player-retry-btn {
  position: absolute;
  left: 28px;
  bottom: 86px;
  z-index: 2;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.36);
}

.player-stability-btn {
  position: absolute;
  left: 28px;
  bottom: 140px;
  z-index: 2;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  color: #071018;
  font-weight: 900;
  background: linear-gradient(135deg, #ffffff, var(--accent-yellow));
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.36);
}

.player-retry-btn.hidden {
  display: none;
}

.player-stability-btn.hidden {
  display: none;
}

.player-similar-panel {
  position: absolute;
  left: 28px;
  bottom: 196px;
  z-index: 3;
  width: min(520px, calc(100% - 56px));
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 8, 8, 0.84);
  backdrop-filter: blur(18px);
}

.player-similar-panel.hidden {
  display: none;
}

.player-similar-panel > strong {
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.player-similar-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.player-similar-channel {
  min-width: 0;
  min-height: 48px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 7px;
  border-radius: 14px;
  text-align: left;
  background: rgba(255, 255, 255, 0.08);
}

.player-similar-channel img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.34);
}

.player-similar-channel span {
  overflow: hidden;
  font-size: 0.78rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.icon-btn.active {
  border-color: rgba(255, 214, 10, 0.72);
  color: #fff;
  background: rgba(255, 214, 10, 0.2);
}

.player-overlay:fullscreen .player-scrim,
.player-overlay:-webkit-full-screen .player-scrim {
  display: none;
}

.player-hit-area {
  position: absolute;
  inset: 0;
  z-index: 0;
  border: 0;
  background: transparent;
}

.player-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
}

.player-topbar h2 {
  margin: 0;
  font-family: "Bebas Neue", "Montserrat", sans-serif;
  font-size: clamp(2.4rem, 4vw, 4rem);
  letter-spacing: 0.04em;
}

.player-topbar,
.player-bottombar {
  position: absolute;
  left: 0;
  right: 0;
  padding: 26px 30px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  transition: opacity 180ms ease;
}

.player-topbar {
  top: 0;
  align-items: start;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.22), transparent);
}

.player-bottombar {
  bottom: 0;
  align-items: end;
  flex-direction: column;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.24), transparent);
}

.player-overlay.ui-hidden .player-ui,
.player-overlay.ui-hidden .player-stability-btn {
  opacity: 0;
  pointer-events: none;
}

.progress-block {
  width: 100%;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
}

.progress-track {
  position: relative;
  min-height: 24px;
  height: 24px;
  overflow: hidden;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  touch-action: pan-x;
}

.progress-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 12px;
  transform: translateY(-50%);
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.14);
}

.progress-buffer,
.progress-fill {
  position: absolute;
  left: 0;
  top: 50%;
  height: 12px;
  transform: translateY(-50%);
  border-radius: inherit;
}

.progress-buffer {
  width: 0;
  background: rgba(255, 255, 255, 0.28);
}

.progress-fill {
  width: 34%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple), var(--accent-yellow));
  box-shadow: 0 0 22px rgba(229, 9, 20, 0.3);
}

.progress-thumb {
  position: absolute;
  top: 50%;
  left: 34%;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow:
    0 0 0 4px rgba(229, 9, 20, 0.18),
    0 8px 20px rgba(0, 0, 0, 0.32);
  transform: translate(-50%, -50%);
}

.player-control-row,
.player-controls-left,
.player-controls-right {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.player-control-row {
  justify-content: space-between;
  flex-wrap: wrap;
}

.player-controls-left,
.player-controls-right {
  width: auto;
  flex-wrap: wrap;
}

.volume-shell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-slider {
  width: 0;
  opacity: 0;
  transition: width 180ms ease, opacity 180ms ease;
  accent-color: var(--accent-blue);
}

.volume-shell:hover .volume-slider,
.volume-shell:focus-within .volume-slider {
  width: 110px;
  opacity: 1;
}

.time-readout {
  color: #dce3f3;
  font-weight: 600;
}

.quick-channels-toggle.hidden,
.quick-channels-panel.hidden {
  display: none;
}

.quick-channels-toggle {
  align-self: flex-start;
  padding-inline: 18px;
}

.quick-channels-panel {
  position: absolute;
  right: 24px;
  top: 96px;
  width: 320px;
  max-height: calc(100% - 180px);
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(12, 12, 12, 0.92), rgba(24, 24, 24, 0.84));
  backdrop-filter: blur(24px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.44);
}

.quick-channels-head {
  display: grid;
  gap: 6px;
}

.quick-channels-list {
  display: grid;
  gap: 10px;
  overflow: auto;
  overscroll-behavior: contain;
}

.quick-channel-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px;
  text-align: left;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.quick-channel-item img {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: cover;
}

.quick-channel-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.quick-channel-item.active {
  background: linear-gradient(135deg, rgba(55, 182, 255, 0.24), rgba(119, 88, 255, 0.28));
  box-shadow: 0 0 24px rgba(55, 182, 255, 0.18);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 52px;
  height: 52px;
  padding: 0 14px;
  border-radius: 18px;
  backdrop-filter: blur(12px);
  color: #fff;
  background: rgba(15, 15, 15, 0.72);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
  font-size: 1rem;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  pointer-events: none;
}

.icon-btn .icon-label {
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

#closePlayerOverlay {
  min-width: 48px;
  width: 48px;
  padding: 0;
}

#togglePlayButton {
  min-width: 58px;
  width: 58px;
  height: 58px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
}

#togglePlayButton svg {
  width: 22px;
  height: 22px;
}

#rewindButton,
#forwardButton,
#qualityButton,
.quick-channels-toggle {
  min-width: 76px;
}

#togglePlayButton,
#rewindButton,
#forwardButton,
#volumeButton,
#captionsButton,
#qualityButton,
#fullscreenButton {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.icon-btn:hover,
.icon-btn:focus-visible,
.quick-channels-toggle:hover,
.quick-channels-toggle:focus-visible {
  transform: translateY(-2px) scale(1.03);
  background: rgba(229, 9, 20, 0.18);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
}

#togglePlayButton:hover,
#togglePlayButton:focus-visible {
  background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 720px) {
  .player-topbar,
  .player-bottombar {
    padding: 20px 18px;
  }

  .player-status {
    left: 18px;
    right: 18px;
    bottom: 126px;
    max-width: none;
  }

  .player-control-row {
    gap: 12px;
  }

  .player-controls-left,
  .player-controls-right {
    width: 100%;
    justify-content: space-between;
  }

  .progress-block {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
  }

  .progress-track {
    min-height: 30px;
    height: 30px;
  }

  .progress-track::before,
  .progress-buffer,
  .progress-fill {
    height: 14px;
  }

  .progress-thumb {
    width: 22px;
    height: 22px;
  }

  .time-readout {
    width: 100%;
    text-align: center;
  }

  .icon-btn {
    min-width: 46px;
    height: 46px;
    border-radius: 16px;
    gap: 8px;
  }

  .icon-btn svg {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }

  #togglePlayButton {
    min-width: 52px;
    width: 52px;
    height: 52px;
  }

  #rewindButton,
  #forwardButton,
  #qualityButton,
  .quick-channels-toggle {
    min-width: 66px;
  }

  .icon-btn .icon-label {
    font-size: 0.8rem;
  }

  .quick-channel-item {
    padding: 14px;
    border-radius: 20px;
  }

  .quick-channel-item img {
    width: 58px;
    height: 58px;
  }
}

.rail-track > *,
.poster-grid > *,
.spotlight-grid > *,
.episode-list > *,
.channel-list > * {
  animation: cardCascade 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.rail-track > *:nth-child(2),
.poster-grid > *:nth-child(2),
.spotlight-grid > *:nth-child(2),
.episode-list > *:nth-child(2),
.channel-list > *:nth-child(2) {
  animation-delay: 40ms;
}

.rail-track > *:nth-child(3),
.poster-grid > *:nth-child(3),
.spotlight-grid > *:nth-child(3),
.episode-list > *:nth-child(3),
.channel-list > *:nth-child(3) {
  animation-delay: 80ms;
}

.rail-track > *:nth-child(4),
.poster-grid > *:nth-child(4),
.spotlight-grid > *:nth-child(4),
.episode-list > *:nth-child(4),
.channel-list > *:nth-child(4) {
  animation-delay: 120ms;
}

.rail-track > *:nth-child(5),
.poster-grid > *:nth-child(5),
.spotlight-grid > *:nth-child(5),
.episode-list > *:nth-child(5),
.channel-list > *:nth-child(5) {
  animation-delay: 160ms;
}

@keyframes screenReveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardCascade {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modalRise {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes playerSpinner {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes skeletonSweep {
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 1240px) {
  .hero-banner,
  .live-content-grid,
  .epg-row {
    grid-template-columns: 1fr;
  }

  .live-layout,
  .live-browser-grid {
    grid-template-columns: 1fr;
  }

  .detail-layout {
    grid-template-columns: 1fr;
    align-items: end;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    width: min(100% - 22px, 100%);
    gap: 16px;
    padding: max(12px, env(safe-area-inset-top)) 0 calc(96px + env(safe-area-inset-bottom));
  }

  .sidebar {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: max(10px, env(safe-area-inset-bottom));
    top: auto;
    z-index: 35;
    width: min(620px, calc(100% - 20px)) !important;
    min-height: 0;
    height: 70px;
    max-height: 70px;
    padding: 8px;
    border-radius: 24px;
    gap: 0;
    overflow: hidden;
    transform: translateX(-50%);
    background:
      linear-gradient(180deg, rgba(30, 12, 14, 0.94), rgba(8, 8, 8, 0.96)),
      rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(20px);
  }

  body.player-open .sidebar {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(12px);
  }

  .brand-block {
    display: none;
  }

  .sidebar-toggle {
    display: none;
  }

  .live-layout {
    grid-template-columns: 1fr;
  }

  .catalog-browser {
    grid-template-columns: 1fr;
  }

  .home-shortcut-shell {
    grid-template-columns: 1fr;
  }

  .sidebar-nav {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: 100%;
    gap: 4px;
    overflow: hidden;
    padding: 0;
  }

  .sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    min-width: 0;
    min-height: 54px;
    height: 54px;
    padding: 6px 4px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    border-radius: 16px;
    text-align: center;
  }

  .nav-item:hover,
  .nav-item:focus-visible,
  .nav-item.active {
    transform: none;
  }

  .nav-item.active {
    color: #fff;
    border-color: rgba(255, 111, 111, 0.32);
    background:
      linear-gradient(180deg, rgba(126, 20, 28, 0.9), rgba(74, 11, 17, 0.84)),
      rgba(229, 9, 20, 0.18);
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.08),
      0 10px 24px rgba(229, 9, 20, 0.22);
  }

  .nav-item:active {
    transform: scale(0.98);
  }

  .nav-item[data-view="favorites"],
  .nav-item[data-view="epg"] {
    display: none;
  }

  .nav-icon {
    width: 28px;
    height: 28px;
    border-radius: 11px;
    font-size: 1rem;
  }

  .nav-icon svg {
    width: 16px;
    height: 16px;
  }

  .nav-label {
    max-width: 100%;
    overflow: hidden;
    font-size: 0.62rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-item[data-view="live"] .nav-label,
  .nav-item[data-view="settings"] .nav-label {
    font-size: 0;
  }

  .nav-item[data-view="live"] .nav-label::after,
  .nav-item[data-view="settings"] .nav-label::after {
    font-size: 0.62rem;
    line-height: 1.2;
  }

  .nav-item[data-view="live"] .nav-label::after {
    content: "TV";
  }

  .nav-item[data-view="settings"] .nav-label::after {
    content: "Config.";
  }

  .sidebar-footer {
    display: none !important;
  }

  .sidebar-footer > button {
    grid-column: span 2;
  }

  .account-chip,
  .playlist-chip {
    display: none !important;
  }

  .live-toolbar {
    align-items: stretch;
  }

  .live-mode-switch {
    width: 100%;
    grid-auto-flow: row;
  }
}

@media (max-width: 720px) {
  .auth-overlay {
    align-items: start;
    overflow-y: auto;
    padding: max(12px, env(safe-area-inset-top)) 12px calc(18px + env(safe-area-inset-bottom));
  }

  .auth-panel {
    width: min(100%, 520px);
  }

  .auth-card {
    border-radius: 24px;
    padding: 18px 16px 20px;
    gap: 16px;
  }

  .auth-card::before {
    font-size: clamp(2.2rem, 15vw, 3.2rem);
  }

  .auth-card::after {
    margin-top: -8px;
    font-size: 0.96rem;
    line-height: 1.5;
  }

  .auth-tabs {
    padding: 5px;
  }

  .auth-tab {
    min-height: 44px;
  }

  .auth-status {
    min-height: auto;
    padding: 12px 14px;
    border-radius: 18px;
    font-size: 0.94rem;
  }

  .auth-field input {
    min-height: 50px;
    border-radius: 16px;
  }

  .app-shell {
    width: min(100% - 20px, 100%);
    gap: 16px;
  }

  .sidebar {
    height: 66px;
    max-height: 66px;
    border-radius: 22px;
    padding: 7px;
  }

  .sidebar-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .nav-item {
    height: 52px;
    min-height: 52px;
    padding: 5px 3px;
    border-radius: 15px;
  }

  .nav-icon {
    width: 27px;
    height: 27px;
  }

  .nav-icon svg {
    width: 17px;
    height: 17px;
  }

  .nav-label {
    font-size: 0.59rem;
  }

  .nav-item[data-view="live"] .nav-label::after,
  .nav-item[data-view="settings"] .nav-label::after {
    font-size: 0.59rem;
  }

  .hero-banner,
  .live-categories,
  .channels-panel,
  .epg-panel,
  .live-preview-panel,
  .guide-shell,
  .detail-backdrop,
  .detail-secondary,
  .settings-card,
  .spotlight-card,
  .epg-row {
    border-radius: 24px;
  }

  .hero-banner,
  .spotlight-card,
  .settings-card,
  .epg-row,
  .live-categories,
  .channels-panel,
  .epg-panel,
  .live-preview-panel,
  .guide-shell,
  .detail-secondary {
    padding: 18px;
  }

  .rail-track {
    grid-auto-columns: minmax(136px, 42vw);
    gap: 14px;
    padding-bottom: 6px;
  }

  .hero-banner {
    grid-template-columns: 1fr;
    align-content: end;
    min-height: min(68svh, 560px);
    padding: 22px 18px 20px;
    background-position: center top;
  }

  .hero-backdrop {
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0.76) 42%, rgba(0, 0, 0, 0.98) 100%),
      linear-gradient(90deg, rgba(0, 0, 0, 0.82) 0%, rgba(10, 10, 10, 0.34) 100%);
  }

  .hero-banner h1 {
    max-width: 9ch;
    font-size: clamp(2.8rem, 13vw, 4.6rem);
  }

  .hero-copy {
    max-width: none;
    margin-top: 14px;
    font-size: 0.97rem;
    line-height: 1.58;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 22px;
  }

  .hero-actions > * {
    width: 100%;
    justify-content: center;
  }

  .hero-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .hero-meta article {
    padding: 14px;
    border-radius: 18px;
  }

  .rail-head,
  .section-heading,
  .panel-head {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }

  .rail-head h2,
  .section-heading h2 {
    font-size: clamp(1.8rem, 12vw, 2.9rem);
  }

  .media-card,
  .poster-card,
  .spotlight-card {
    border-radius: 20px;
  }

  .media-card {
    padding: 10px;
  }

  .home-shortcut-shell {
    gap: 14px;
  }

  .home-shortcut-card {
    padding: 18px;
    border-radius: 24px;
  }

  .catalog-browser {
    gap: 14px;
  }

  .catalog-sidebar,
  .catalog-results {
    padding: 16px;
    border-radius: 24px;
  }

  .catalog-category-list {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    max-height: none;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .catalog-category-item {
    white-space: nowrap;
  }

  .poster-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    justify-content: stretch;
  }

  .poster-grid > .poster-card {
    max-width: none;
  }

  .poster-grid.virtual-grid {
    min-height: 300px;
  }

  .poster-card {
    grid-template-columns: 94px minmax(0, 1fr);
    align-items: stretch;
    min-height: 142px;
    max-width: none;
    overflow: hidden;
  }

  .poster-card .poster-media {
    min-height: 142px;
  }

  .poster-thumb {
    height: 100%;
    min-height: 142px;
    border-radius: 18px 0 0 18px;
  }

  .poster-badges {
    left: 8px;
    right: 8px;
    top: 8px;
    gap: 5px;
  }

  .poster-badge {
    padding: 4px 7px;
    font-size: 0.6rem;
    letter-spacing: 0.04em;
  }

  .poster-copy {
    align-content: center;
    min-width: 0;
    padding: 12px;
  }

  .poster-copy strong {
    font-size: 1rem;
    line-height: 1.18;
  }

  .poster-copy span {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 0.84rem;
    line-height: 1.35;
  }

  .poster-meta-row {
    gap: 6px;
  }

  .poster-meta-row span {
    padding: 5px 8px;
    font-size: 0.68rem;
  }

  .poster-action-hint {
    display: none;
  }

  .channel-list,
  .category-list {
    max-height: none;
  }

  .channel-card {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 12px;
    padding: 11px 12px;
    border-radius: 18px;
  }

  .channel-logo {
    width: 54px;
    height: 54px;
    border-radius: 14px;
  }

  .channel-meta-top {
    align-items: center;
  }

  .channel-meta strong {
    font-size: 0.95rem;
  }

  .channel-meta span,
  .channel-now-title {
    font-size: 0.78rem;
  }

  .channel-now-title {
    display: -webkit-box;
    overflow: hidden;
    margin: 5px 0 7px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .channel-progress-meta,
  .channel-progress-track {
    display: none;
  }

  .detail-layout {
    min-height: auto;
    padding: 20px 18px 22px;
    gap: 18px;
    align-items: start;
  }

  .detail-primary h1 {
    max-width: none;
    font-size: clamp(2.6rem, 14vw, 4.2rem);
    line-height: 0.95;
  }

  .detail-primary,
  .detail-secondary {
    gap: 16px;
  }

  .detail-synopsis {
    font-size: 0.98rem;
    line-height: 1.72;
  }

  .detail-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .detail-actions > * {
    width: 100%;
    justify-content: center;
  }

  .detail-secondary {
    padding: 18px;
    border-radius: 24px;
  }

  .season-panel-head {
    gap: 10px;
  }

  .episode-list {
    max-height: none;
  }

  .episode-card {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 12px;
    padding: 10px;
    border-radius: 20px;
  }

  .episode-title-row {
    display: grid;
    gap: 4px;
  }

  .episode-title-row strong {
    font-size: 0.92rem;
    line-height: 1.2;
  }

  .episode-copy p {
    font-size: 0.8rem;
    line-height: 1.35;
  }

  .player-stage {
    width: 100%;
    height: 100%;
  }

  .player-video,
  .player-video > img {
    min-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
  }

  .player-topbar,
  .player-bottombar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .progress-block {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
  }

  .player-control-row {
    display: grid;
    gap: 12px;
  }

  .player-controls-left,
  .player-controls-right {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .quick-channels-panel {
    left: 12px;
    right: 12px;
    top: auto;
    bottom: calc(148px + env(safe-area-inset-bottom));
    width: auto;
    max-height: min(44dvh, 360px);
    overflow: auto;
  }

  .guide-header,
  .guide-row {
    grid-template-columns: 180px minmax(0, 1fr);
    min-width: 980px;
  }

  .season-panel-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .player-overlay {
    place-items: stretch;
  }

  .player-topbar {
    padding-top: calc(14px + env(safe-area-inset-top));
  }

  .player-bottombar {
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .player-status {
    left: 14px;
    right: 14px;
    bottom: calc(104px + env(safe-area-inset-bottom));
    max-width: none;
    padding: 10px 12px;
    border-radius: 16px;
    font-size: 0.86rem;
  }

  .player-retry-btn {
    left: 14px;
    bottom: calc(56px + env(safe-area-inset-bottom));
    min-height: 42px;
    padding: 0 16px;
  }

  .player-stability-btn {
    left: 14px;
    bottom: calc(106px + env(safe-area-inset-bottom));
    min-height: 42px;
    padding: 0 16px;
  }

  .player-similar-panel {
    left: 14px;
    right: 14px;
    bottom: calc(154px + env(safe-area-inset-bottom));
    width: auto;
  }

  .player-similar-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .sidebar-nav {
    grid-auto-columns: minmax(74px, 32vw);
  }

  .sidebar-footer {
    display: none;
  }

  .sidebar-footer > button {
    grid-column: auto;
  }

  .hero-meta {
    grid-template-columns: 1fr;
  }

  .catalog-search-input,
  .home-shortcut-item,
  .catalog-category-item,
  .primary-btn,
  .secondary-btn,
  .ghost-btn {
    min-height: 48px;
  }

  .poster-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .home-search-results,
  .home-playlist-grid,
  .continue-watching-grid,
  .stable-channels-grid,
  .favorite-channels-grid,
  .home-favorites-grid {
    grid-template-columns: 1fr;
  }

  .home-playlist-panel {
    padding: 14px;
    border-radius: 22px;
  }

  .home-playlist-grid article {
    min-height: 78px;
    padding: 14px;
  }

  .home-search-result {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    border-radius: 18px;
  }

  .home-search-result-copy strong,
  .continue-card-copy strong {
    font-size: 0.92rem;
  }

  .home-search-result-copy p,
  .continue-card-copy p {
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .home-search-result-thumb {
    width: 64px;
    height: 86px;
    border-radius: 12px;
  }

  .continue-card-main {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    border-radius: 18px;
  }

  .continue-card-thumb {
    width: 76px;
    height: 102px;
    border-radius: 12px;
  }

  .stable-channel-card {
    grid-template-columns: 62px minmax(0, 1fr);
    min-height: 106px;
    gap: 10px;
    padding: 10px;
    border-radius: 18px;
  }

  .stable-channel-logo {
    width: 62px;
    height: 62px;
    border-radius: 14px;
  }

  .stable-channel-copy strong {
    font-size: 0.92rem;
  }

  .stable-channel-copy p,
  .stable-channel-copy small {
    font-size: 0.78rem;
  }

  .favorite-channel-card {
    grid-template-columns: 62px minmax(0, 1fr);
    min-height: 96px;
    padding: 10px;
    border-radius: 18px;
  }

  .favorite-channel-logo {
    width: 62px;
    height: 62px;
    border-radius: 14px;
  }

  .home-favorite-card {
    grid-template-columns: 62px minmax(0, 1fr);
    align-items: center;
  }

  .home-favorite-card img {
    width: 62px;
    aspect-ratio: 2 / 3;
  }

  .player-diagnostic-grid,
  .playlist-summary-grid {
    grid-template-columns: 1fr;
  }

  .catalog-results {
    padding: 12px;
    border-radius: 22px;
  }

  .poster-card {
    grid-template-columns: 84px minmax(0, 1fr);
    min-height: 126px;
    border-radius: 18px;
  }

  .poster-card .poster-media {
    min-height: 126px;
  }

  .poster-thumb {
    min-height: 126px;
    border-radius: 18px 0 0 18px;
  }

  .poster-copy {
    padding: 10px 11px;
    gap: 6px;
  }

  .poster-copy strong {
    font-size: 0.9rem;
    line-height: 1.2;
  }

  .poster-copy span {
    margin-top: 0;
    font-size: 0.78rem;
    line-height: 1.34;
  }

  .poster-meta-row {
    gap: 6px;
  }

  .poster-meta-row span {
    padding: 4px 7px;
    font-size: 0.66rem;
  }

  .poster-action-hint {
    font-size: 0.72rem;
  }

  .rail-track {
    grid-auto-columns: minmax(126px, 40vw);
  }
}

@media (hover: none) and (pointer: coarse) {
  .media-card:hover,
  .poster-card:hover,
  .spotlight-card:hover,
  .focusable:hover {
    transform: none;
    filter: none;
    box-shadow: none;
  }

  .media-card:hover img,
  .poster-card:hover img,
  .spotlight-card:hover img {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
