/* ============================================================
   StreamHub — Graphite Amber theme
   Design system copied from Telegram Stremio admin dashboard
   (themes.py → graphite_amber + base.html component styles)
   ============================================================ */

:root {
  color-scheme: dark;

  /* ── Graphite Amber palette (exact values from themes.py) ── */
  --primary: #f59e0b;
  --secondary: #d97706;
  --accent: #fbbf24;
  --bg: #0c0c0d;
  --card: #18181b;
  --border: #2b2b30;
  --text: #fafaf9;
  --text-sec: #a9a8a4;

  /* ── derived tokens (color-mix, exactly like base.html) ── */
  --surface: color-mix(in srgb, var(--text) 5%, transparent);
  --surface-2: color-mix(in srgb, var(--text) 9%, transparent);
  --surface-3: color-mix(in srgb, var(--text) 14%, transparent);
  --hairline: color-mix(in srgb, var(--text) 12%, transparent);
  --hairline-strong: color-mix(in srgb, var(--text) 20%, transparent);
  --muted: color-mix(in srgb, var(--text) 42%, transparent);
  --ring: color-mix(in srgb, var(--primary) 35%, transparent);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-strong: 0 24px 60px rgba(0, 0, 0, 0.45);
  --glow-primary: 0 0 18px color-mix(in srgb, var(--primary) 40%, transparent);
  --glow-soft: 0 0 30px color-mix(in srgb, var(--primary) 22%, transparent);

  --grad: linear-gradient(120deg, var(--primary), var(--accent));
  --radius: 1.5rem;
  --radius-xl: 2rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-pill: cubic-bezier(0.4, 0, 0.2, 1);
  --topbar-h: 92px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* hidden attribute always wins (lightbox/setup/toast ke liye) */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ambient radial glows — same as Telegram Stremio body::before */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 15% 10%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 40%),
    radial-gradient(circle at 85% 80%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 40%),
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--card) 40%, transparent), transparent 60%);
}

a {
  color: inherit;
  text-decoration: none;
}
img {
  display: block;
  max-width: 100%;
}
button {
  font-family: inherit;
  cursor: pointer;
}
input,
select,
textarea {
  font-family: inherit;
}

::selection {
  background: color-mix(in srgb, var(--primary) 30%, transparent);
  color: var(--text);
}
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* thin scrollbars like the dashboard */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--hairline-strong) transparent;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--hairline-strong);
  border-radius: 9999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ============================================================
   Floating glass pill navbar (Telegram Stremio style)
   ============================================================ */
.topbar {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(95%, 1180px);
  height: 62px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 10px 0 16px;
  z-index: 60;
  background: color-mix(in srgb, var(--card) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--hairline);
  border-radius: 9999px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.35s var(--ease), background 0.3s ease, box-shadow 0.3s ease;
}
.topbar.solid {
  background: color-mix(in srgb, var(--card) 92%, transparent);
  box-shadow: var(--shadow-strong);
  transform: translateX(-50%) translateY(-4px) scale(0.985);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: var(--primary);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-size: 13px;
  box-shadow: 0 0 15px color-mix(in srgb, var(--primary) 55%, transparent);
  transition: transform 0.3s var(--ease), box-shadow 0.3s ease;
}
.brand:hover .brand-mark {
  transform: scale(1.08) rotate(-6deg);
  box-shadow: 0 0 24px color-mix(in srgb, var(--primary) 75%, transparent);
}
.brand-mark.big {
  width: 58px;
  height: 58px;
  font-size: 22px;
  margin: 0 auto 14px;
}
.brand-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* nav + sliding amber pill indicator */
.nav {
  position: relative;
  display: flex;
  gap: 2px;
  margin: 0 auto;
}
.nav a {
  position: relative;
  z-index: 1;
  padding: 9px clamp(12px, 1.6vw, 20px);
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sec);
  transition: color 0.3s ease;
  white-space: nowrap;
}
.nav a:hover {
  color: var(--text);
}
.nav a.active {
  color: var(--bg) !important;
  font-weight: 700;
}
#active-pill {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  background: var(--primary);
  border-radius: 9999px;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  box-shadow: 0 0 15px color-mix(in srgb, var(--primary) 40%, transparent);
  transition:
    left 0.35s var(--ease-pill),
    top 0.35s var(--ease-pill),
    width 0.35s var(--ease-pill),
    height 0.35s var(--ease-pill),
    opacity 0.3s ease;
}

.top-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  position: relative;
}
.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  color: var(--text-sec);
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: 0.22s var(--ease);
}
.icon-btn:hover {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  transform: translateY(-1px);
}
.icon-btn svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

/* ============================================================
   Layout
   ============================================================ */
.view {
  min-height: calc(100vh - 120px);
  padding-bottom: 60px;
}

/* ultra-smooth page enter */
.view > * {
  animation: pageIn 0.5s var(--ease) both;
}
.view > *:nth-child(2) {
  animation-delay: 0.05s;
}
.view > *:nth-child(3) {
  animation-delay: 0.1s;
}
.view > *:nth-child(4) {
  animation-delay: 0.15s;
}
@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

.section {
  padding: 0 clamp(16px, 4vw, 48px);
  margin-top: 38px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 15px;
}
.section-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(17px, 2.2vw, 21px);
  font-weight: 800;
  letter-spacing: -0.4px;
}
.section-head h2::before {
  content: "";
  width: 6px;
  height: 20px;
  border-radius: 6px;
  background: var(--grad);
  box-shadow: var(--glow-soft);
  flex-shrink: 0;
}
.section-head .sub {
  font-size: 12px;
  color: var(--text-sec);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: clamp(380px, 64vh, 620px);
  display: flex;
  align-items: flex-end;
  padding: var(--topbar-h) clamp(16px, 4vw, 48px) 48px;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 20%;
  transform: scale(1.05);
  animation: heroZoom 16s ease-out forwards;
}
@keyframes heroZoom {
  to {
    transform: scale(1);
  }
}
.hero-fade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(12, 12, 13, 0.96) 5%, rgba(12, 12, 13, 0.5) 55%, rgba(12, 12, 13, 0.88)),
    linear-gradient(0deg, var(--bg) 2%, transparent 45%);
}
.hero-content {
  position: relative;
  max-width: 660px;
  animation: fadeUp 0.65s var(--ease) both;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
}
.hero-tag {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 12px;
}
.hero-tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
  animation: pulseDot 1.8s ease-in-out infinite;
}
@keyframes pulseDot {
  50% {
    opacity: 0.35;
    transform: scale(0.75);
  }
}
.hero h1 {
  font-size: clamp(30px, 5.5vw, 58px);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
  text-shadow: 0 6px 34px rgba(0, 0, 0, 0.7);
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 13.5px;
  color: color-mix(in srgb, var(--text) 82%, transparent);
  margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
}
.hero p {
  color: var(--text-sec);
  font-size: 15px;
  line-height: 1.65;
  max-width: 560px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 24px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-dots {
  position: absolute;
  right: clamp(16px, 4vw, 48px);
  bottom: 52px;
  display: flex;
  gap: 8px;
  z-index: 3;
}
.hero-dots span {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: var(--hairline-strong);
  transition: 0.35s var(--ease);
}
.hero-dots span.on {
  background: var(--primary);
  width: 26px;
  box-shadow: var(--glow-primary);
}

/* ============================================================
   Buttons / chips / badges
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  padding: 13px 24px;
  border-radius: 1rem;
  font-size: 14.5px;
  font-weight: 700;
  transition: filter 0.2s ease, transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease,
    border-color 0.2s ease;
  white-space: nowrap;
}
.btn.primary {
  background: var(--primary);
  color: var(--bg);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 30%, transparent);
}
.btn.primary:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--primary) 45%, transparent);
}
.btn.primary:active {
  transform: scale(0.97);
}
.btn.ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn.ghost:hover {
  background: var(--surface-2);
  border-color: var(--hairline-strong);
  transform: translateY(-2px);
}
.btn.ghost:active {
  transform: scale(0.97);
}
.btn.small {
  padding: 10px 16px;
  font-size: 13px;
  border-radius: 0.85rem;
}
.btn.active-list {
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 45%, transparent);
  box-shadow: var(--glow-soft);
}

/* ek-click "Watch on <service>" CTA — detail page ka sabse prominent button */
.btn.watch-cta {
  padding: 13px 26px;
  font-size: 15.5px;
  font-weight: 800;
  box-shadow:
    0 10px 34px color-mix(in srgb, var(--primary) 45%, transparent),
    var(--glow-soft);
}
.btn.watch-cta:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 14px 44px color-mix(in srgb, var(--primary) 55%, transparent),
    var(--glow-primary);
}

.chip {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent);
}

.rating {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.rating svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.badge {
  font-size: 10px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 9999px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.badge.hd {
  background: var(--surface-2);
  color: var(--text-sec);
  border: 1px solid var(--hairline);
}
.badge.type {
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--primary);
}

/* ============================================================
   Rows + cards
   ============================================================ */
.row-wrap {
  position: relative;
}
.row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 6px 2px 16px;
  scrollbar-width: thin;
}
.row::-webkit-scrollbar {
  height: 8px;
}

.card {
  position: relative;
  flex: 0 0 auto;
  width: clamp(132px, 15vw, 180px);
  scroll-snap-align: start;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s var(--ease), box-shadow 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
  animation: cardIn 0.55s var(--ease) both;
  animation-delay: var(--d, 0ms);
}
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
}
.card:hover {
  transform: translateY(-8px) scale(1.03);
  border-color: color-mix(in srgb, var(--primary) 55%, transparent);
  box-shadow: var(--shadow-strong), var(--glow-soft);
  z-index: 2;
}
.card-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  background: var(--card);
  overflow: hidden;
}
.card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: imgIn 0.6s var(--ease) both;
  transition: transform 0.45s var(--ease);
}
.card:hover .card-poster img {
  transform: scale(1.06);
}
@keyframes imgIn {
  from {
    opacity: 0;
  }
}
.card-poster .placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--text-sec);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  padding: 10px;
  background: radial-gradient(circle at 30% 20%, var(--surface-2), var(--card));
}
.card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px;
  opacity: 0;
  background: linear-gradient(0deg, rgba(8, 8, 9, 0.97) 28%, transparent);
  transition: opacity 0.28s ease;
}
.card:hover .card-overlay,
.card:focus-within .card-overlay {
  opacity: 1;
}
.card-overlay .t {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transform: translateY(6px);
  transition: transform 0.3s var(--ease);
}
.card:hover .card-overlay .t {
  transform: translateY(0);
}
.card-overlay .m {
  font-size: 11.5px;
  color: var(--text-sec);
  display: flex;
  gap: 8px;
  align-items: center;
  font-variant-numeric: tabular-nums;
}
.card-list-btn {
  width: 100%;
  padding: 9px;
  border-radius: 0.75rem;
  border: 1px solid var(--hairline);
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--text);
  transition: 0.18s ease;
}
.card-list-btn:hover {
  background: var(--primary);
  color: var(--bg);
  border-color: transparent;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 40%, transparent);
}
.card-list-btn.in-list {
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 40%, transparent);
}

.card-actions-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.card-play-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: 0.75rem;
  border: none;
  font-size: 11.5px;
  font-weight: 800;
  background: var(--grad);
  color: #000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: var(--glow-primary);
  transition: transform 0.15s ease, filter 0.15s ease;
  cursor: pointer;
}
.card-play-btn:hover {
  transform: scale(1.03);
  filter: brightness(1.1);
}
.card-actions-row .card-list-btn {
  width: auto;
  padding: 8px 10px;
}

/* top-10 rank numbers */
.card.rank {
  width: clamp(196px, 22vw, 268px);
  display: flex;
  align-items: flex-end;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
}
.card.rank:hover {
  box-shadow: none;
  background: transparent;
  border: 0;
}
.rank-num {
  font-size: clamp(76px, 9vw, 122px);
  font-weight: 900;
  line-height: 0.72;
  margin-right: -16px;
  color: transparent;
  -webkit-text-stroke: 3px var(--hairline-strong);
  letter-spacing: -0.06em;
  flex: 0 0 auto;
  user-select: none;
  transform: translateY(8px);
  transition: 0.35s var(--ease);
}
.card.rank .card-poster {
  border-radius: 14px;
  width: clamp(112px, 13vw, 150px);
  aspect-ratio: 2/3;
  border: 1px solid var(--hairline);
}
.card.rank:hover .rank-num {
  -webkit-text-stroke-color: var(--primary);
  text-shadow: 0 0 26px color-mix(in srgb, var(--primary) 45%, transparent);
}

/* row navigation buttons (in section-head) */
.row-nav-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}
.row-arrow-btn {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--primary) 14%, var(--card));
  border: 1.5px solid color-mix(in srgb, var(--primary) 40%, transparent);
  color: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), var(--glow-soft);
  transition: all 0.22s var(--ease);
  outline: none;
  padding: 0;
}
.row-arrow-btn:hover {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
  transform: scale(1.08);
  box-shadow: var(--glow-primary);
}
.row-arrow-btn:active {
  transform: scale(0.95);
}
.row-nav-btns {
  display: none !important;
}

.row-arrow-btn[data-scroll="-1"] svg,
.row-arrow.left svg {
  transform: rotate(180deg);
}

/* row side arrows (floating over row-wrap) — sleek, compact 34px circle */
.row-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--primary) 45%, transparent);
  background: color-mix(in srgb, var(--card) 85%, var(--primary) 15%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--primary);
  font-size: 15px;
  display: grid;
  place-items: center;
  opacity: 0.9;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), var(--glow-soft);
  transition: all 0.2s var(--ease);
  z-index: 6;
  outline: none;
  padding: 0;
}
.row-wrap:hover .row-arrow {
  opacity: 1;
}
.row-arrow.left {
  left: 6px;
}
.row-arrow.right {
  right: 6px;
}
.row-arrow:hover {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
  box-shadow: var(--glow-primary);
  transform: translateY(-50%) scale(1.12);
}
.row-arrow:active {
  transform: translateY(-50%) scale(0.95);
}

/* ============================================================
   Grid (search / watchlist)
   ============================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  gap: 18px 15px;
}
.grid .card {
  width: 100%;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
}
.search-box {
  position: relative;
  flex: 1 1 320px;
}
.search-box svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  fill: var(--text-sec);
  transition: fill 0.2s;
}
.search-box input {
  width: 100%;
  padding: 15px 18px 15px 46px;
  border-radius: 1rem;
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--card) 88%, var(--bg));
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-box input::placeholder {
  color: color-mix(in srgb, var(--text-sec) 78%, transparent);
}
.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}
.search-box input:focus + svg,
.search-box:focus-within svg {
  fill: var(--primary);
}
.filter-chips {
  display: flex;
  gap: 8px;
}
.filter-chips button {
  padding: 11px 17px;
  border-radius: 9999px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text-sec);
  font-size: 13px;
  font-weight: 700;
  transition: 0.2s var(--ease);
}
.filter-chips button:hover {
  color: var(--text);
  border-color: var(--hairline-strong);
  transform: translateY(-1px);
}
.filter-chips button.on {
  background: var(--primary);
  color: var(--bg);
  border-color: transparent;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 35%, transparent);
}

.page-title {
  padding: calc(var(--topbar-h) + 34px) clamp(16px, 4vw, 48px) 0;
}
.page-title h1 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-title p {
  color: var(--text-sec);
  font-size: 14px;
  margin-top: 8px;
}
.page-body {
  padding: 24px clamp(16px, 4vw, 48px) 0;
}

/* ============================================================
   Detail page
   ============================================================ */
.detail-hero {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: center;
  gap: clamp(18px, 3.5vw, 42px);
  padding: calc(var(--topbar-h) + 24px) clamp(16px, 4vw, 48px) 36px;
  overflow: visible;
}
.detail-poster {
  position: relative;
  width: clamp(170px, 22vw, 240px);
  aspect-ratio: 2/3;
  flex: 0 0 auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  border: 1px solid var(--hairline);
  z-index: 2;
  transition: transform 0.4s var(--ease);
}
.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.detail-poster:hover {
  transform: translateY(-6px) scale(1.02);
}
.detail-info {
  position: relative;
  z-index: 2;
  max-width: 720px;
  animation: fadeUp 0.6s var(--ease) both;
}
.detail-info h1 {
  font-size: clamp(28px, 5vw, 54px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 12px;
  text-shadow: 0 6px 34px rgba(0, 0, 0, 0.7);
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 14px;
  color: color-mix(in srgb, var(--text) 84%, transparent);
  margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
}
.detail-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.detail-info .overview {
  color: var(--text-sec);
  line-height: 1.7;
  font-size: 15px;
  max-width: 640px;
  margin-bottom: 22px;
}
.detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.providers {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.provider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 8px;
  border-radius: 1rem;
  background: color-mix(in srgb, var(--card) 90%, var(--bg));
  border: 1px solid var(--hairline);
  transition: 0.22s var(--ease);
  font-size: 13px;
  font-weight: 700;
}
.provider:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--primary) 55%, transparent);
  box-shadow: var(--glow-soft);
}
.provider img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-2);
}
.provider .kind {
  font-size: 10px;
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.provider .kind.free {
  color: var(--bg);
  background: var(--primary);
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-block;
  margin-top: 3px;
}

/* cast */
.cast-card {
  flex: 0 0 auto;
  width: clamp(104px, 12vw, 134px);
  text-align: center;
  animation: cardIn 0.5s var(--ease) both;
}
.cast-card .ph {
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 800;
  color: var(--text-sec);
  margin-bottom: 10px;
  border: 1px solid var(--hairline);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.35);
}
.cast-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 10px;
  border: 1px solid var(--hairline);
  transition: 0.3s var(--ease);
}
.cast-card:hover img,
.cast-card:hover .ph {
  border-color: var(--primary);
  box-shadow: 0 0 20px color-mix(in srgb, var(--primary) 30%, transparent);
  transform: translateY(-4px);
}
.cast-card .n {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
}
.cast-card .c {
  font-size: 11.5px;
  color: var(--text-sec);
}

/* ============================================================
   States: skeleton / empty / error
   ============================================================ */
.skeleton {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--text) 6%, transparent) 25%,
    color-mix(in srgb, var(--text) 14%, transparent) 37%,
    color-mix(in srgb, var(--text) 6%, transparent) 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}
.skel-hero {
  height: clamp(380px, 64vh, 620px);
  border-radius: 0;
  border: 0;
}
.skel-card {
  flex: 0 0 auto;
  width: clamp(132px, 15vw, 180px);
  aspect-ratio: 2/3;
}

.state {
  text-align: center;
  padding: 74px 20px;
  color: var(--text-sec);
  animation: pageIn 0.5s var(--ease) both;
}
.state .big {
  width: 88px;
  height: 88px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  color: var(--primary);
  box-shadow: 0 0 36px color-mix(in srgb, var(--primary) 16%, transparent);
}
.state h3 {
  color: var(--text);
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 8px;
}
.state p {
  font-size: 14px;
  max-width: 450px;
  margin: 0 auto 20px;
  line-height: 1.65;
}

/* ============================================================
   Lightbox (trailer)
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 5, 6, 0.93);
  display: grid;
  place-items: center;
  padding: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
}
.lightbox-inner {
  width: min(1000px, 100%);
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-strong), 0 0 60px color-mix(in srgb, var(--primary) 18%, transparent);
  background: #000;
  border: 1px solid var(--hairline);
  animation: fadeUp 0.35s var(--ease) both;
}
.lightbox-inner iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 46px;
  height: 46px;
  border-radius: 9999px;
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--card) 80%, transparent);
  color: var(--text);
  font-size: 17px;
  transition: 0.22s var(--ease);
}
.lightbox-close:hover {
  background: var(--primary);
  color: var(--bg);
  border-color: transparent;
  box-shadow: var(--glow-primary);
  transform: rotate(90deg);
}

/* ============================================================
   Toast (styled like Telegram Stremio toasts)
   ============================================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(14px) scale(0.98);
  min-width: 260px;
  max-width: 90vw;
  display: flex;
  align-items: center;
  gap: 9px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  color: var(--text);
  padding: 14px 20px;
  border-radius: 1rem;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
  font-size: 14px;
  font-weight: 700;
  z-index: 120;
  opacity: 0;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  transition: opacity 0.22s ease-out, transform 0.22s ease-out;
}
.toast[hidden] {
  display: none;
}
.toast .i {
  color: var(--primary);
  flex-shrink: 0;
}
.toast[data-kind="error"] .i {
  color: var(--danger, #f87171);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* ============================================================
   Setup screen
   ============================================================ */
.setup {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
}
.setup-card {
  width: min(450px, 100%);
  background: color-mix(in srgb, var(--card) 92%, var(--bg));
  border-radius: 2rem;
  padding: 38px 32px;
  text-align: center;
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-strong), 0 0 70px color-mix(in srgb, var(--primary) 12%, transparent);
  animation: fadeUp 0.5s var(--ease) both;
}
.setup-card h1 {
  font-size: 25px;
  font-weight: 900;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 10px;
}
.setup-card p {
  color: var(--text-sec);
  font-size: 13.5px;
  line-height: 1.65;
  margin-bottom: 20px;
}
.setup-card a {
  color: var(--primary);
}
.setup-card input,
.setup-card select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 1rem;
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--card) 88%, var(--bg));
  color: var(--text);
  font-size: 14px;
  outline: none;
  margin-bottom: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.setup-card input:focus,
.setup-card select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}
.setup-card .btn {
  width: 100%;
  justify-content: center;
}
.field-label {
  display: block;
  text-align: left;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-sec);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}

/* ============================================================
   Settings page
   ============================================================ */
.settings-card {
  max-width: 640px;
  background: color-mix(in srgb, var(--card) 90%, var(--bg));
  border-radius: var(--radius-xl);
  padding: 28px;
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-soft);
  margin-bottom: 18px;
  transition: border-color 0.25s ease, transform 0.25s var(--ease);
}
.settings-card:hover {
  border-color: var(--hairline-strong);
  transform: translateY(-2px);
}
.settings-card h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 5px;
}
.settings-card .hint {
  font-size: 13px;
  color: var(--text-sec);
  line-height: 1.65;
  margin-bottom: 16px;
}
.settings-card .hint a {
  color: var(--primary);
  font-weight: 600;
}
.settings-card code,
.hint code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  padding: 2px 7px;
  border-radius: 7px;
  color: var(--accent);
  word-break: break-all;
}
.settings-card input,
.settings-card select {
  width: 100%;
  padding: 13px 15px;
  border-radius: 1rem;
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--card) 88%, var(--bg));
  color: var(--text);
  font-size: 14px;
  outline: none;
  margin-bottom: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.settings-card input:focus,
.settings-card select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}
select option {
  background-color: var(--card);
  color: var(--text);
}
.danger {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.danger:hover {
  background: rgba(239, 68, 68, 0.24);
  transform: translateY(-2px);
}

/* ============================================================
   Services directory (OTT links)
   ============================================================ */
.sub.link {
  color: var(--primary);
  font-weight: 700;
  transition: 0.2s var(--ease);
}
.sub.link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.svc-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.svc-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 17px 9px 9px;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--card) 90%, var(--bg));
  border: 1px solid var(--hairline);
  font-size: 13.5px;
  font-weight: 700;
  transition: 0.24s var(--ease);
  animation: cardIn 0.5s var(--ease) both;
}
.svc-chip:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--primary) 55%, transparent);
  box-shadow: var(--glow-soft);
  color: var(--primary);
}
.svc-chip-logo {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}
.svc-chip-logo img {
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.svc-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 46px 16px 16px;
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--card) 90%, var(--bg));
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: transform 0.28s var(--ease), border-color 0.28s ease, box-shadow 0.28s ease;
  animation: cardIn 0.5s var(--ease) both;
  animation-delay: var(--d, 0ms);
}
.svc-card::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -60px;
  width: 170px;
  height: 170px;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 16%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.svc-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--primary) 55%, transparent);
  box-shadow: var(--shadow-strong), var(--glow-soft);
}
.svc-card:hover::after {
  opacity: 1;
}
.svc-logo {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 19px;
  color: var(--primary);
  overflow: hidden;
  flex-shrink: 0;
}
.svc-logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 7px;
  background: #fff;
  animation: imgIn 0.4s var(--ease) both;
}
.svc-body {
  min-width: 0;
  flex: 1;
}
.svc-name {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.svc-host {
  font-size: 12px;
  color: var(--text-sec);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}
.svc-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.svc-tag {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  white-space: nowrap;
}
.svc-region {
  font-size: 11px;
  color: var(--text-sec);
  font-weight: 600;
  white-space: nowrap;
}
.svc-arrow {
  position: absolute;
  top: 13px;
  right: 15px;
  font-size: 15px;
  color: var(--muted);
  opacity: 0;
  transform: translate(-5px, 5px);
  transition: 0.25s var(--ease);
}
.svc-card:hover .svc-arrow {
  opacity: 1;
  transform: translate(0, 0);
  color: var(--primary);
}

/* ============================================================
   Theme picker (Stremio-style dropdown) + 3 style modes
   ============================================================ */
#themeBtn.on {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 50%, transparent);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.theme-panel {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: 380px;
  max-width: calc(100vw - 24px);
  padding: 16px 14px;
  border-radius: 1.5rem;
  background: color-mix(in srgb, var(--card) 95%, var(--bg));
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow-strong), var(--glow-soft);
  backdrop-filter: blur(32px) saturate(190%);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  z-index: 70;
  box-sizing: border-box;
  animation: tpIn 0.28s var(--ease) both;
}
@keyframes tpIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
  }
}
.tp-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.tp-head span {
  color: var(--primary);
  letter-spacing: 0;
  text-transform: none;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tp-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 10px 0 8px;
}
.tp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  width: 100%;
  box-sizing: border-box;
}
.tp-swatch {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  cursor: pointer;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  transition: 0.2s var(--ease);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.tp-swatch:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 55%, transparent);
}
.tp-swatch.on {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  box-shadow: var(--glow-soft);
}
.tp-dots {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}
.tp-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}
.tp-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.2;
}
.tp-tick {
  margin-left: auto;
  color: var(--primary);
  opacity: 0;
  font-weight: 900;
  font-size: 11px;
  line-height: 1;
  flex-shrink: 0;
}
.tp-swatch.on .tp-tick {
  opacity: 1;
}
.tp-styles {
  display: flex;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}
.tp-style {
  flex: 1;
  min-width: 0;
  text-align: center;
  padding: 8px 8px;
  border-radius: 9999px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  font: inherit;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-sec);
  cursor: pointer;
  transition: 0.2s var(--ease);
  white-space: nowrap;
  box-sizing: border-box;
}
.tp-style:hover {
  color: var(--text);
  transform: translateY(-2px);
}
.tp-style.on {
  color: var(--bg);
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: var(--glow-soft);
}

/* ── Style: Glassy (StreamHub default) — TG Stremio glassy rules ── */
[data-style="glassy"] .topbar {
  background: color-mix(in srgb, var(--card) 30%, transparent);
  backdrop-filter: blur(56px) saturate(240%);
  -webkit-backdrop-filter: blur(56px) saturate(240%);
}
[data-style="glassy"] .card,
[data-style="glassy"] .settings-card,
[data-style="glassy"] .svc-card,
[data-style="glassy"] .svc-chip,
[data-style="glassy"] .state,
[data-style="glassy"] .setup-card {
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
}
[data-style="glassy"] .btn.primary {
  background: color-mix(in srgb, var(--primary) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 28px color-mix(in srgb, var(--primary) 45%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 15%, transparent);
}

/* ── Style: Neo Brutalism — TG Stremio neo_brutal rules ── */
[data-style="neo_brutal"] {
  --radius: 0.75rem;
  --radius-xl: 0.85rem;
}
[data-style="neo_brutal"] .topbar,
[data-style="neo_brutal"] .card,
[data-style="neo_brutal"] .settings-card,
[data-style="neo_brutal"] .svc-card,
[data-style="neo_brutal"] .svc-chip,
[data-style="neo_brutal"] .state,
[data-style="neo_brutal"] .setup-card,
[data-style="neo_brutal"] .theme-panel,
[data-style="neo_brutal"] .toast,
[data-style="neo_brutal"] .chip {
  background: var(--card);
  border: 3px solid var(--text);
  box-shadow: 6px 6px 0 var(--text);
  border-radius: var(--radius);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
[data-style="neo_brutal"] .topbar {
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  box-shadow: 0 6px 0 var(--text);
}
[data-style="neo_brutal"] .btn {
  border: 3px solid var(--text);
  border-radius: 0.5rem;
  box-shadow: 4px 4px 0 var(--text);
  font-weight: 900;
}
[data-style="neo_brutal"] .btn.primary {
  background: var(--primary);
  color: var(--bg);
}
[data-style="neo_brutal"] .btn.primary:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--text);
  filter: none;
}
[data-style="neo_brutal"] .btn.primary:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--text);
}
[data-style="neo_brutal"] .btn.ghost {
  background: var(--card);
  color: var(--text);
}
[data-style="neo_brutal"] .badge,
[data-style="neo_brutal"] .svc-tag,
[data-style="neo_brutal"] .tp-style.on {
  border: 2px solid var(--text);
  border-radius: 0.35rem;
  font-weight: 900;
  box-shadow: 2px 2px 0 var(--text);
  background: var(--accent);
  color: var(--text);
}
[data-style="neo_brutal"] .search-box input,
[data-style="neo_brutal"] .settings-card input,
[data-style="neo_brutal"] .settings-card select,
[data-style="neo_brutal"] .setup-card input,
[data-style="neo_brutal"] .setup-card select {
  background: var(--card);
  border: 3px solid var(--text);
  border-radius: 0.5rem;
  box-shadow: 3px 3px 0 var(--text);
}
[data-style="neo_brutal"] .search-box input:focus,
[data-style="neo_brutal"] .settings-card input:focus,
[data-style="neo_brutal"] .settings-card select:focus {
  border-color: var(--primary);
  box-shadow: 3px 3px 0 var(--primary);
}
[data-style="neo_brutal"] body::before {
  opacity: 0.5;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  border-top: 1px solid var(--hairline);
  padding: 28px clamp(16px, 4vw, 48px) 44px;
  font-size: 12.5px;
  color: var(--text-sec);
  line-height: 1.75;
  text-align: center;
}
.footer a {
  color: var(--primary);
  font-weight: 600;
}
.footer .muted {
  opacity: 0.6;
  font-size: 12px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 820px) {
  :root {
    --topbar-h: 112px;
  }
  .topbar {
    top: 8px;
    width: calc(100% - 16px);
    max-width: 100%;
    height: auto;
    min-height: 50px;
    padding: 6px 10px;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: space-between;
    border-radius: 1.25rem;
  }
  .brand {
    gap: 8px;
  }
  .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
  .brand-name {
    font-size: 16px;
  }
  .top-actions {
    gap: 4px;
  }
  .icon-btn {
    width: 36px;
    height: 36px;
  }
  .nav {
    order: 3;
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 2px 0 0;
    padding: 2px 2px 4px;
    gap: 4px;
  }
  .nav::-webkit-scrollbar {
    display: none;
  }
  .nav a {
    padding: 6px 11px;
    font-size: 12.5px;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .detail-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: calc(var(--topbar-h) + 16px) 16px 28px;
    gap: 20px;
  }
  .detail-poster {
    width: 150px;
    margin: 0 auto;
    aspect-ratio: 2/3;
  }
  .detail-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .detail-info {
    width: 100%;
    text-align: center;
  }
  .detail-info h1 {
    font-size: clamp(24px, 5.5vw, 36px);
  }
  .detail-meta {
    justify-content: center;
  }
  .detail-actions {
    justify-content: center;
    gap: 8px;
  }
  .hero-dots {
    display: none;
  }
  .row-arrow {
    display: none;
  }
}

@media (max-width: 480px) {
  :root {
    --topbar-h: 106px;
  }
  .topbar {
    top: 6px;
    width: calc(100% - 12px);
    padding: 5px 8px;
    border-radius: 1rem;
  }
  .hero {
    min-height: 400px;
    padding: calc(var(--topbar-h) + 12px) 14px 28px;
  }
  .hero h1 {
    font-size: 26px;
    line-height: 1.15;
    margin-bottom: 10px;
  }
  .hero p {
    font-size: 13px;
    line-height: 1.5;
    -webkit-line-clamp: 2;
    margin-bottom: 16px;
  }
  .hero-actions {
    gap: 8px;
  }
  .hero-actions .btn,
  .detail-actions .btn {
    padding: 9px 16px;
    font-size: 13px;
    border-radius: 0.75rem;
  }
  .detail-hero {
    padding: calc(var(--topbar-h) + 14px) 12px 24px;
    gap: 16px;
  }
  .detail-poster {
    width: 135px;
  }
  .section {
    padding: 16px 12px;
  }
  .section-head h2 {
    font-size: 18px;
  }
  .card {
    width: 120px;
  }
  .theme-panel {
    width: calc(100vw - 20px) !important;
    right: -4px !important;
    padding: 14px 10px !important;
  }
  .tp-grid {
    gap: 5px !important;
  }
  .tp-swatch {
    padding: 7px 7px !important;
    font-size: 10.5px !important;
    gap: 4px !important;
  }
  .tp-dots i {
    width: 8px !important;
    height: 8px !important;
  }
}

/* ============================================================
   Ultra-smooth: respect reduced motion (same as Telegram Stremio)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
   SVG icons (single system — js/app.js icon())
   ============================================================ */
svg.i {
  display: inline-block;
  vertical-align: -0.16em;
  flex-shrink: 0;
}
.row-arrow.left .i {
  transform: rotate(180deg);
}

/* ============================================================
   Row scroll — smooth snap, clean track
   ============================================================ */
.row {
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.row::-webkit-scrollbar {
  display: none;
}
.row > * {
  scroll-snap-align: start;
}

/* ============================================================
   StreamHub Single Cinema Player & Download Hub Styles
   ============================================================ */

/* ── Fullscreen Cinema Player Modal ─────────────────────── */
.player-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeInPlayer 0.25s var(--ease);
}

@keyframes fadeInPlayer {
  from { opacity: 0; transform: scale(0.985); }
  to { opacity: 1; transform: scale(1); }
}

.player-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  position: relative;
  background: #000;
  overflow: hidden;
}

/* ── Floating Cinema Player Topbar (Exact Screenshot Layout) ── */
.player-header {
  height: 52px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(6, 8, 13, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 40;
  flex-shrink: 0;
}

.player-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* Back Button (Pill Button) */
.player-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.18s ease;
  cursor: pointer;
  flex-shrink: 0;
}
.player-back-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(-1px);
}

.player-meta-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.player-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  flex-shrink: 0;
  animation: livePulse 2s infinite ease-in-out;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.player-title-text {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

.badge-type {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  flex-shrink: 0;
}

.badge-rating {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.2);
  flex-shrink: 0;
}

.badge-ep {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  flex-shrink: 0;
}

/* ── Player Header Right Buttons ────────────────────────── */
.player-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.player-btn-tool {
  height: 32px;
  padding: 0 12px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
  cursor: pointer;
}
.player-btn-tool:hover {
  background: rgba(255, 255, 255, 0.18);
}
.player-btn-tool.dl {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}
.player-btn-tool.dl:hover {
  background: rgba(245, 158, 11, 0.3);
}

/* ── Player Server Selector Dropdown (Floating Glass) ── */
.player-dropdown-wrap {
  position: relative;
}

.player-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 280px;
  background: rgba(14, 16, 23, 0.96);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  padding: 10px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: dropdownFade 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.player-dropdown-menu[hidden] {
  display: none !important;
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 4px 10px 8px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.dropdown-item.active {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  font-weight: 700;
}

.dropdown-item .check-icon {
  stroke: #f59e0b;
  margin-left: 8px;
  flex-shrink: 0;
}

.player-close-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
  cursor: pointer;
}
.player-close-circle:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fff;
  transform: scale(1.05);
}

/* ── Player Body (100% Cinema Viewport) ── */
.player-body {
  flex: 1;
  width: 100%;
  height: calc(100vh - 52px);
  position: relative;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Video Aspect Wrapper (Cinema Viewport, Player Controls 100% Visible) ── */
.player-aspect-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  background: #000;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s var(--ease), width 0.25s var(--ease), height 0.25s var(--ease);
}

/* True Immersive Edge-to-Edge Fullscreen & Aspect Modes (Zero Camera Cutout Black Bars) */
#playerAspectWrapper:fullscreen,
#playerAspectWrapper:-webkit-full-screen,
#playerAspectWrapper.fullscreen-mode,
.player-aspect-wrapper:fullscreen,
.player-aspect-wrapper:-webkit-full-screen,
.player-aspect-wrapper.fullscreen-mode {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-width: 100vw !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  z-index: 999999 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  aspect-ratio: unset !important;
  background: #000 !important;
}
#playerAspectWrapper:fullscreen #playerFrame,
#playerAspectWrapper:-webkit-full-screen #playerFrame,
#playerAspectWrapper.fullscreen-mode #playerFrame,
.player-aspect-wrapper:fullscreen #playerFrame,
.player-aspect-wrapper:-webkit-full-screen #playerFrame,
.player-aspect-wrapper.fullscreen-mode #playerFrame {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-width: 100vw !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  aspect-ratio: unset !important;
  border-radius: 0 !important;
  border: none !important;
  transform: none !important;
}

/* Force Landscape Cinema Rotation (When Phone Auto-Rotate is Locked) */
#playerAspectWrapper.force-rotated,
.player-aspect-wrapper.force-rotated {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  width: 100dvh !important;
  height: 100vw !important;
  min-width: 100dvh !important;
  min-height: 100vw !important;
  max-width: none !important;
  max-height: none !important;
  transform: translate(-50%, -50%) rotate(90deg) !important;
  transform-origin: center center !important;
  z-index: 999999 !important;
  aspect-ratio: unset !important;
  border-radius: 0 !important;
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #000 !important;
}
#playerAspectWrapper.force-rotated #playerFrame,
.player-aspect-wrapper.force-rotated #playerFrame {
  position: absolute !important;
  inset: 0 !important;
  width: 100dvh !important;
  height: 100vw !important;
  min-width: 100dvh !important;
  min-height: 100vw !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  border-radius: 0 !important;
  border: none !important;
}

/* Floating Back Button for Mobile Landscape Cinema Mode & Rotated Screen */
.landscape-back-btn {
  display: none;
  position: fixed;
  top: max(10px, env(safe-area-inset-top, 10px));
  left: max(10px, env(safe-area-inset-left, 10px));
  z-index: 1000001;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: all 0.15s ease;
}
.landscape-back-btn:hover {
  background: rgba(0, 0, 0, 0.95);
  border-color: rgba(255, 255, 255, 0.4);
}
body.player-open .player-aspect-wrapper.force-rotated ~ .landscape-back-btn,
body.player-open .player-aspect-wrapper.fullscreen-mode ~ .landscape-back-btn {
  display: flex !important;
}

/* Mobile Landscape Cinema Mode (Automatic Edge-to-Edge Past Camera Notch) */
@media (orientation: landscape) and (max-height: 650px) and (max-width: 768px) {
  body.player-open #playerModal,
  body.player-open .player-modal {
    overflow: hidden !important;
    padding: 0 !important;
    inset: 0 !important;
    position: fixed !important;
    width: 100vw !important;
    height: 100dvh !important;
    z-index: 999999 !important;
  }
  body.player-open .player-header {
    display: none !important;
  }
  body.player-open .player-container {
    max-width: none !important;
    width: 100vw !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body.player-open .player-body {
    height: 100dvh !important;
    width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body.player-open #playerAspectWrapper,
  body.player-open .player-aspect-wrapper {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-width: 100vw !important;
    min-height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    aspect-ratio: unset !important;
    z-index: 999999 !important;
    background: #000 !important;
  }
  body.player-open #playerAspectWrapper #playerFrame,
  body.player-open .player-aspect-wrapper #playerFrame {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-width: 100vw !important;
    min-height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    aspect-ratio: unset !important;
    border-radius: 0 !important;
    border: none !important;
    transform: none !important;
  }
  body.player-open .landscape-back-btn {
    display: flex !important;
  }
}

/* 16:9 Standard Fit / Zoom Fill (Camera Hide) / Stretch Fill */
.player-aspect-wrapper.aspect-fill #playerFrame {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
.player-aspect-wrapper.aspect-stretch #playerFrame {
  width: 100% !important;
  height: 100% !important;
  object-fit: fill !important;
}

#playerFrame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
  display: block;
}

/* ── TV Episodes Slide-Over Panel Backdrop (Dim & Blur Behind Drawer) ── */
.player-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 70;
  cursor: pointer;
  animation: fadeInPlayer 0.2s ease;
}

/* ── TV Episodes Slide-Over Panel (Opens on Demand, Never Blocks Progress Bar) ── */
.player-tv-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 92vw);
  background: rgba(14, 14, 19, 0.96);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.7);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 80;
  overflow-y: hidden;
  animation: slideDrawerIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDrawerIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.player-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.drawer-title {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-active-ep {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: rgba(245, 158, 11, 0.15);
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.drawer-nav-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-step {
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  padding: 5px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  cursor: pointer;
}
.btn-step:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.btn-step.btn-close-drawer {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.25);
  color: #f87171;
  padding: 5px 8px;
}
.btn-step.btn-close-drawer:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fff;
}

.player-seasons-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  flex-shrink: 0;
  scrollbar-width: thin;
}

.season-tab {
  font-size: 11px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  white-space: nowrap;
  transition: all 0.15s ease;
  cursor: pointer;
}
.season-tab:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.season-tab.active {
  background: var(--primary);
  color: #000;
  font-weight: 800;
  border-color: var(--primary);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.4);
}

.player-episodes-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
  flex: 1;
  scrollbar-width: thin;
}

.episode-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #cbd5e1;
  transition: all 0.18s ease;
  cursor: pointer;
}
.episode-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateX(-2px);
}
.episode-btn.active {
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--primary);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.3);
}
.ep-number {
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
}
.episode-btn.active .ep-number {
  color: var(--primary);
}
.ep-title {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Download Hub Modal ─────────────────────────────────── */
.download-modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeInPlayer 0.2s ease;
}

.download-card {
  width: min(100%, 520px);
  background: #141418;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9);
  position: relative;
}

.dl-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 14px;
}

.dl-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--primary);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 6px;
}

.dl-card-head h2 {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.dl-meta {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

.dl-desc {
  font-size: 12px;
  color: #a1a1aa;
  margin-bottom: 14px;
  line-height: 1.5;
}

/* ── Player Dropdown Tool Controls (Audio & Quality) ────── */
.player-dropdown-wrap {
  position: relative;
}

.player-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  background: rgba(18, 18, 24, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
  padding: 8px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: fadeInPlayer 0.15s ease;
}

.dropdown-header {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #94a3b8;
  padding: 4px 8px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 2px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
}
.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.dropdown-item.active {
  background: rgba(245, 158, 11, 0.15);
  color: var(--primary);
  font-weight: 700;
}
.dropdown-item .check-icon {
  stroke: var(--primary);
  flex-shrink: 0;
}

/* ── Direct Stream & Download Modal ────────────────────── */
.dl-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1000005;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeInPlayer 0.2s ease;
}
.dl-modal-backdrop[hidden] {
  display: none !important;
}
.dl-modal-card {
  width: 100%;
  max-width: 520px;
  background: #0f131d;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 85vh;
  box-sizing: border-box;
}
.dl-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.dl-modal-heading {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  margin: 0;
}
.dl-modal-subheading {
  font-size: 12px;
  color: #94a3b8;
  margin: 3px 0 0 0;
}

/* ── Live Download & Stream Hub Sources ───────────────────── */
.dl-sources-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 4px;
}

.dl-source-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.18s ease;
}
.dl-source-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(245, 158, 11, 0.35);
}

.dl-source-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dl-source-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dl-source-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dl-source-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.18);
  color: var(--primary);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.dl-source-badge.green {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

.dl-copy-all-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 12px;
}
.dl-copy-all-btn:hover {
  background: var(--primary);
  color: #000;
  transform: translateY(-1px);
}
.dl-copy-all-btn.copied {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
}

.dl-source-url-preview {
  font-size: 10px;
  font-family: var(--font-mono, monospace);
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 6px 10px;
  border-radius: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.dl-source-url-preview:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fff;
}

.dl-source-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dl-action-open {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--primary);
  color: #000;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.dl-action-open:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.dl-action-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: all 0.15s ease;
}
.dl-action-copy:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.dl-action-copy.copied {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
}

/* ── Mobile Player Optimizations ────────────────────────── */
@media (max-width: 768px) {
  .player-header {
    height: 54px;
    padding: 0 10px;
  }
  .player-title-text {
    max-width: 140px;
    font-size: 12px;
  }
  .player-badges-row {
    display: none;
  }
  .player-servers-strip {
    padding: 2px 4px;
    gap: 3px;
  }
  .server-label {
    display: none;
  }
  .server-chip {
    padding: 3px 6px;
    font-size: 10px;
  }
  .player-btn-tool span {
    display: none;
  }
  .player-btn-tool {
    padding: 0 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    justify-content: center;
  }
  .player-btn-icon {
    width: 32px;
    height: 32px;
  }
  .player-tv-drawer {
    max-height: 50vh;
  }
  .player-episodes-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}

/* ── IPTV Category Filter Pills ── */
.cat-pill {
  padding: 7px 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted, #94a3b8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.cat-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}
.cat-pill.active {
  background: var(--primary, #f59e0b) !important;
  color: #0c0c0d !important;
  border-color: var(--primary, #f59e0b) !important;
  font-weight: 700 !important;
  box-shadow: 0 0 12px color-mix(in srgb, var(--primary, #f59e0b) 45%, transparent);
}

