/* ==========================================================================
   Premium theme — edge-to-edge cinematic layout in the spirit of the Apple TV
   app: floating top bar over full-bleed artwork, calm graphite neutrals, white
   primary actions, one blue accent for focus and a muted red only for "live".
   Scoped under .premium (on <html>) so it wins over main.css and the styles
   injected at runtime by feature-overrides.js.
   ========================================================================== */

.premium {
  --bg-base: #0b0c0e;
  --bg-raised: #15161a;
  --bg-elevated: rgba(255, 255, 255, 0.06);
  --bg-hover: rgba(255, 255, 255, 0.1);
  --bg-surface: #15161a;

  --text-primary: #f5f5f7;
  --text-secondary: rgba(235, 235, 245, 0.62);
  --text-muted: rgba(235, 235, 245, 0.38);
  --border: rgba(255, 255, 255, 0.08);
  --border-bright: rgba(255, 255, 255, 0.16);

  --primary: #f5f5f7;
  --primary-glow: rgba(255, 255, 255, 0.1);
  --accent: #0a84ff;
  --live: #e5484d;

  --glass-bg: rgba(20, 21, 25, 0.72);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-blur: blur(30px) saturate(160%);

  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', system-ui, sans-serif;
  --gutter: clamp(20px, 4vw, 56px);
  --radius-card: 12px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --header-h: 68px;
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
.premium body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
}
.premium .app-container,
.premium .auth-container { background: var(--bg-base); }
.premium .icon { flex-shrink: 0; display: block; }
.premium :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.premium ::-webkit-scrollbar { width: 8px; height: 8px; }
.premium ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 8px; }
.premium ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.26); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.premium .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  transition: transform 0.18s var(--ease), background 0.2s, opacity 0.2s;
}
.premium .btn:active { transform: scale(0.97); }
.premium .btn-primary,
.premium .btn-light {
  background: #f5f5f7;
  color: #0b0c0e;
  border: none;
  box-shadow: none;
}
.premium .btn-primary:hover,
.premium .btn-light:hover { background: #ffffff; }
.premium .btn-secondary {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
  border: none;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.premium .btn-secondary:hover { background: rgba(255, 255, 255, 0.22); }
.premium .btn-danger { background: rgba(229, 72, 77, 0.16); color: #ff8a8e; border: none; }

/* ── Login ────────────────────────────────────────────────────────────────── */
.premium .auth-container {
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(255, 255, 255, 0.06), transparent 60%),
    var(--bg-base);
  padding: 24px;
}
.premium .auth-box {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 44px 40px 36px;
  max-width: 400px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55);
}
.premium .auth-logo {
  background: #f5f5f7;
  color: #0b0c0e;
  border-radius: 16px;
  box-shadow: none;
}
.premium .auth-logo svg { fill: #0b0c0e; }
.premium .auth-header h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
.premium .auth-header h1 span,
.premium .app-title span { color: var(--text-secondary); font-weight: 500; }
.premium .auth-header .subtitle { color: var(--text-secondary); }
.premium .form-group label { color: var(--text-secondary); font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 13px; }
.premium .form-group input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text-primary);
  height: 46px;
  font-size: 15px;
  transition: border-color 0.2s, background 0.2s;
}
.premium .form-group input:focus {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--accent);
  box-shadow: none;
}
.premium .auth-footer { border-top: none; color: var(--text-muted); }

/* Saved lists and the Xtream / M3U switch; the box can outgrow short screens */
.premium .auth-container { overflow-y: auto; align-items: safe center; }
.source-fields { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.source-fields[hidden] { display: none; }
.source-tabs {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px;
  background: rgba(255, 255, 255, 0.06); border-radius: 12px;
}
.source-tab {
  min-height: 40px; border: 0; border-radius: 9px; background: transparent;
  color: var(--text-secondary); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.source-tab.active { background: rgba(255, 255, 255, 0.14); color: var(--text-primary); }
.premium .form-group select {
  height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.06); color: var(--text-primary); font: inherit; font-size: 15px;
}
.premium .form-group select:focus { outline: none; border-color: var(--accent); }
.premium .form-group select option { background: #15161a; color: #f5f5f7; }
.premium .form-group input[type="file"] { height: auto; padding: 11px 12px; font-size: 13px; color: var(--text-secondary); }
.saved-playlists { margin-bottom: 22px; }
.saved-playlists h2 { font-size: 13px; font-weight: 500; color: var(--text-secondary); margin: 0 0 8px; }
.saved-playlists-list { display: flex; flex-direction: column; gap: 8px; }
.saved-playlist { display: flex; gap: 6px; }
.saved-playlist-open {
  flex: 1; min-width: 0; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 0 14px; border: 1px solid var(--border); border-radius: 12px;
  background: rgba(255, 255, 255, 0.06); color: var(--text-primary); font: inherit; text-align: left; cursor: pointer;
  transition: background 0.2s;
}
.saved-playlist-open:hover { background: rgba(255, 255, 255, 0.1); }
.saved-playlist-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-playlist-type { flex-shrink: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--text-muted); }
.saved-playlist-remove {
  width: 52px; flex-shrink: 0; border: 1px solid var(--border); border-radius: 12px;
  background: transparent; color: var(--text-muted); font-size: 20px; cursor: pointer;
}
.saved-playlist-remove:hover { color: var(--live); border-color: rgba(229, 72, 77, 0.4); }

/* ── Liquid glass ─────────────────────────────────────────────────────────────
   Controls float over the content with no bar behind them. Each glass surface
   is a faint tinted fill + strong backdrop blur/saturation, a light rim that is
   bright at opposite corners (refraction), and a soft specular sheen on top.
   The selected item is a brighter, denser lens rather than a solid fill. */
.premium {
  /* Clear glass: light blur, mild saturation, a faint neutral fill (no tint of its own) */
  --lg-fill: linear-gradient(135deg, rgba(255, 255, 255, 0.11) 0%, rgba(255, 255, 255, 0.03) 45%, rgba(255, 255, 255, 0.07) 100%);
  --lg-fill-hover: linear-gradient(135deg, rgba(255, 255, 255, 0.17) 0%, rgba(255, 255, 255, 0.06) 45%, rgba(255, 255, 255, 0.11) 100%);
  --lg-lens: linear-gradient(135deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.2) 100%);
  --lg-blur: blur(10px) saturate(140%);
  --lg-rim: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.1) 32%, rgba(255, 255, 255, 0.04) 62%, rgba(255, 255, 255, 0.36) 100%);
  --lg-depth:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.4),
    inset 0 -1px 0.5px rgba(255, 255, 255, 0.1),
    inset 0 0 16px rgba(255, 255, 255, 0.05),
    0 10px 30px rgba(0, 0, 0, 0.3);
  --lg-text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.premium .top-nav,
.premium .search-container,
.premium .icon-btn,
.premium .category-btn,
.premium .home-hero-pause,
.premium .home-row-arrow {
  position: relative;
  isolation: isolate;
  background: var(--lg-fill);
  border: none;
  box-shadow: var(--lg-depth);
  backdrop-filter: var(--lg-blur);
  -webkit-backdrop-filter: var(--lg-blur);
}
/* Refraction rim: a 1px gradient ring cut out with mask-composite */
.premium .top-nav::before,
.premium .search-container::before,
.premium .icon-btn::before,
.premium .category-btn::before,
.premium .home-hero-pause::before,
.premium .home-row-arrow::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 1px;
  border-radius: inherit;
  background: var(--lg-rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}
/* Specular sheen across the upper half */
.premium .top-nav::after,
.premium .search-container::after,
.premium .icon-btn::after,
.premium .category-btn::after {
  content: '';
  position: absolute;
  inset: 1px 1px 52% 1px;
  z-index: -1;
  border-radius: 999px 999px 60% 60% / 999px 999px 40% 40%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0));
  pointer-events: none;
}

/* ── Top bar: no background at all, only floating glass controls ─────────── */
.premium .app-header,
.premium .app-header.is-solid {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 300;
  height: var(--header-h);
  margin: 0;
  padding: 0 var(--gutter);
  gap: 20px;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none; /* clicks pass through the empty bar to the content below */
}
.premium .app-header > * { pointer-events: auto; }
.premium .header-left { flex: 0 0 auto; }
.premium .app-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
  text-shadow: var(--lg-text-shadow);
}

.premium .top-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
  padding: 5px;
  flex: 0 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  border-radius: 999px;
}
.premium .top-nav::-webkit-scrollbar { display: none; }
.premium .top-nav .nav-item {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: var(--lg-text-shadow);
  background: transparent;
  transition: background 0.25s var(--ease), color 0.2s, box-shadow 0.25s var(--ease);
}
.premium .top-nav .nav-item .icon { width: 16px; height: 16px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4)); }
.premium .top-nav a.nav-item { text-decoration: none; }
.premium .top-nav .nav-item:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
/* Selected: a brighter glass lens inside the capsule, not a solid fill */
.premium .top-nav .nav-item.active {
  color: #fff;
  font-weight: 600;
  background: var(--lg-lens);
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.65),
    inset 0 -1px 0.5px rgba(255, 255, 255, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    0 4px 14px rgba(0, 0, 0, 0.28);
}
.premium .top-nav .nav-item.active::before { display: none; }

.premium .header-center { flex: 0 1 300px; max-width: 300px; margin: 0 0 0 auto; }
.premium .search-container {
  height: 40px;
  border-radius: 999px;
  overflow: visible;
  transition: box-shadow 0.2s;
}
.premium .search-container:focus-within {
  background: var(--lg-fill-hover);
  box-shadow: var(--lg-depth), 0 0 0 2px rgba(10, 132, 255, 0.7);
}
.premium .search-input {
  position: relative;
  z-index: 2;
  min-width: 0; /* let the field shrink so the search button stays inside the capsule */
  background: transparent;
  border: none;
  font-family: var(--font);
  font-size: 14px;
  color: #fff;
  text-shadow: var(--lg-text-shadow);
}
.premium .search-input::placeholder { color: rgba(255, 255, 255, 0.62); }
.premium .search-btn { position: relative; z-index: 2; flex: 0 0 auto; background: transparent; color: rgba(255, 255, 255, 0.8); }
.premium .header-right { flex: 0 0 auto; gap: 8px; }
/* Wide screens: the nav capsule sits in the true centre of the screen; the two
   side columns are equal so the title and the search/icons don't pull it off-centre */
@media (min-width: 1400px) {
  .premium .app-header,
  .premium .app-header.is-solid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
  }
  .premium .header-left { grid-column: 1; grid-row: 1; justify-self: start; }
  .premium .top-nav { grid-column: 2; grid-row: 1; }
  .premium .header-right { grid-column: 3; grid-row: 1; justify-self: end; }
  /* Search shares the right column, kept clear of the three icon buttons */
  .premium .header-center {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    width: min(300px, calc(100% - 152px));
    margin: 0 152px 0 0;
  }
}
/* Not enough room for a centred capsule plus search: title, search and icons on
   the first row, the capsule centred on its own row below */
@media (min-width: 1101px) and (max-width: 1399px) {
  .premium .app-header,
  .premium .app-header.is-solid {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    height: auto;
    row-gap: 10px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .premium .header-left { grid-column: 1; grid-row: 1; }
  .premium .header-center { grid-column: 2; grid-row: 1; justify-self: end; width: 100%; max-width: 300px; }
  .premium .header-right { grid-column: 3; grid-row: 1; }
  .premium .top-nav { grid-column: 1 / -1; grid-row: 2; justify-self: center; max-width: 100%; }
}
.premium .icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  color: #fff;
  display: grid;
  place-items: center;
  transition: background 0.2s, transform 0.2s var(--ease);
}
.premium .icon-btn .icon { position: relative; z-index: 2; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4)); }
.premium .icon-btn:hover { background: var(--lg-fill-hover); }
.premium .icon-btn:active { transform: scale(0.94); }

/* ── Content scrolls underneath the glass ─────────────────────────────────── */
.premium .app-body { padding: 0; gap: 0; }
.premium .main-content { border: none; border-radius: 0; background: transparent; }
.premium .view-section:not(#home-view) { padding-top: 0; overflow-y: auto; }
.premium .view-section .grid-wrapper { flex: none; overflow: visible; }
.premium #home-view,
.premium #search-view,
.premium #favorites-view,
.premium #history-view { overflow-y: auto; }
/* Views without a category strip start below the floating bar */
.premium #favorites-view > .grid-wrapper:first-child { padding-top: calc(var(--header-real, var(--header-h)) + 20px); }

/* Category strip: stays pinned under the bar while cards scroll behind it */
.premium .categories-section {
  position: sticky;
  top: var(--header-real, var(--header-h));
  z-index: 40;
  margin-top: var(--header-real, var(--header-h));
  padding: 10px var(--gutter);
  background: none;
  border: none;
  pointer-events: none;
}
.premium .categories-scroll {
  gap: 8px;
  padding: 4px 2px 12px;
  scrollbar-width: none;
  pointer-events: auto;
}
.premium .categories-scroll::-webkit-scrollbar { display: none; }
.premium .category-btn {
  flex: 0 0 auto;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.86);
  text-shadow: var(--lg-text-shadow);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  padding: 9px 17px;
  transition: background 0.25s var(--ease), color 0.2s, transform 0.2s var(--ease);
}
.premium .category-btn:hover { background: var(--lg-fill-hover); color: #fff; }
.premium .category-btn:active { transform: scale(0.96); }
.premium .category-btn.active {
  color: #fff;
  font-weight: 600;
  background: var(--lg-lens);
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.7),
    inset 0 -1px 0.5px rgba(255, 255, 255, 0.22),
    inset 0 0 18px rgba(255, 255, 255, 0.1),
    0 10px 30px rgba(0, 0, 0, 0.32);
}
.premium .category-btn.is-locked { display: inline-flex; align-items: center; gap: 6px; }
.premium .category-btn .icon { position: relative; z-index: 2; }

.premium .grid-wrapper { padding: 20px var(--gutter) 48px; }
.premium .content-grid {
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 28px 18px;
}
.premium .content-grid:has(> .card--channel) { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.premium .content-card {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  transition: transform 0.35s var(--ease);
}
.premium .content-card:hover { transform: none; box-shadow: none; border: none; }
.premium .content-card .card-thumb {
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--bg-raised);
  border: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.premium .content-card:hover .card-thumb {
  transform: scale(1.04);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 24px 48px rgba(0, 0, 0, 0.55);
}
.premium .card-thumb img {
  opacity: 0;
  transition: opacity 0.45s ease;
}
.premium .card-thumb img.is-loaded { opacity: 1; }
.premium .content-card:hover .card-thumb img { transform: none; }

.premium .card--poster .card-thumb { aspect-ratio: 2 / 3; }
.premium .card--poster .card-thumb img { width: 100%; height: 100%; object-fit: cover; }

.premium .card--channel .card-thumb {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #23242a 0%, #17181c 100%);
}
.premium .card--channel .card-thumb img {
  width: 62%;
  height: 58%;
  object-fit: contain;
}

.premium .card-thumb-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.22);
  font-size: 0;
  opacity: 1;
  filter: none;
}
.premium .card-thumb-placeholder .icon { width: 30%; height: auto; min-width: 34px; max-width: 56px; }
.premium .card--poster .card-thumb-placeholder {
  background: linear-gradient(160deg, #24252b 0%, #16171b 100%);
}
.premium .card-overlay,
.premium .card-play-btn,
.premium .card-live-badge,
.premium .card-fav-badge { display: none; }

.premium .card-actions {
  opacity: 0;
  top: 8px;
  right: 8px;
  transition: opacity 0.25s;
}
.premium .content-card:hover .card-actions,
.premium .card-actions:has(.card-action-btn.active) { opacity: 1; }
.premium .card-action-btn {
  width: 32px;
  height: 32px;
  background: rgba(12, 13, 15, 0.6);
  border: none;
  color: #fff;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.premium .card-action-btn:hover { background: rgba(255, 255, 255, 0.24); border: none; }
.premium .card-action-btn.active { background: #f5f5f7; color: #0b0c0e; border: none; }

.premium .card-info { padding: 12px 2px 0; gap: 3px; display: flex; flex-direction: column; }
/* Virtual grids need one row height: room for the title and one line (year or EPG) on every card */
.premium .content-grid.is-virtual .card-info { min-height: calc(12px + 14px * 1.3 + 3px + 12.5px * 1.4); }
.premium .content-grid.is-virtual > * { overflow-anchor: none; }
.premium .card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.premium .card-meta { display: none; }
.premium .card-subtitle,
.premium .card-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.premium .card-epg {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 0;
}
.premium .card-epg::before {
  content: '';
  flex: 0 0 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
}
.premium .card-epg-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.premium .card-progress,
.premium .card-epg-progress {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
  z-index: 2;
}
.premium .card-progress > span,
.premium .card-epg-progress > span { display: block; height: 100%; background: #f5f5f7; border-radius: 3px; }

/* Skeleton cards while data loads */
.premium .skeleton-card .skeleton-thumb,
.premium .skeleton-card .skeleton-line {
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.05) 30%, rgba(255, 255, 255, 0.11) 50%, rgba(255, 255, 255, 0.05) 70%);
  background-size: 300% 100%;
  border-radius: var(--radius-card);
  @media (prefers-reduced-motion: no-preference) {
    animation: premium-shimmer 1.4s ease-in-out infinite;
  }
}
.premium .skeleton-card .skeleton-thumb { aspect-ratio: 2 / 3; }
.premium .skeleton-card.is-channel .skeleton-thumb { aspect-ratio: 16 / 9; }
.premium .skeleton-card .skeleton-line { height: 12px; margin-top: 12px; width: 70%; border-radius: 6px; }
.premium .skeleton-card .skeleton-line.short { width: 40%; margin-top: 8px; }
@keyframes premium-shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

/* ── Home: full-bleed billboard ───────────────────────────────────────────── */
.premium .home-rows { padding: 0 0 56px; gap: 40px; display: grid; }
.premium .home-hero {
  position: relative;
  min-height: clamp(460px, 78vh, 820px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
  border-radius: 0;
}
.premium .home-hero[hidden] { display: none; }
.premium .home-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center 20%;
  transition: opacity 0.8s ease;
  @media (prefers-reduced-motion: no-preference) {
    animation: premium-kenburns 18s ease-out both;
  }
}
.premium .home-hero-bg.is-poster { filter: blur(40px) saturate(120%) brightness(0.8); transform: scale(1.25); animation: none; }
@keyframes premium-kenburns {
  from { transform: scale(1.1); }
  to { transform: scale(1.02); }
}
.premium .home-hero::after {
  content: '';
  position: absolute;
  /* Overhang the bottom edge so sub-pixel rounding never lets the artwork peek through */
  inset: 0 0 -2px 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(11, 12, 14, 0.85) 0%, rgba(11, 12, 14, 0.4) 40%, rgba(11, 12, 14, 0) 70%),
    linear-gradient(0deg, var(--bg-base) 0%, var(--bg-base) 3%, rgba(11, 12, 14, 0.6) 24%, rgba(11, 12, 14, 0) 52%);
}
.premium .home-hero-bg { bottom: 4px; }
.premium .home-hero-inner {
  display: block;
  padding: 0 var(--gutter) clamp(36px, 7vh, 72px);
  max-width: 760px;
}
.premium .home-hero-poster { display: none; }
.premium .home-hero-eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.premium .home-hero-title {
  font-size: clamp(36px, 5.2vw, 72px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.045em;
  margin: 0 0 16px;
  text-wrap: balance;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.35);
}
.premium .home-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(245, 245, 247, 0.82);
}
.premium .home-hero-chip { padding: 0; background: none; border: none; backdrop-filter: none; font-size: 14px; }
.premium .home-hero-chip + .home-hero-chip::before { content: '·'; margin: 0 9px; color: var(--text-muted); }
.premium .home-hero-plot {
  max-width: 56ch;
  color: rgba(245, 245, 247, 0.78);
  font-size: 16px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 24px;
}
.premium .home-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.premium .home-hero-actions .btn { padding: 0 26px; height: 48px; font-size: 16px; }
.premium .home-hero-dots {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(36px, 7vh, 72px);
  display: flex;
  align-items: center;
  gap: 8px;
}
.premium .home-hero-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: width 0.3s var(--ease), background 0.3s;
}
.premium .home-hero-dot.active { width: 22px; background: #f5f5f7; }
.premium .home-hero-pause {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  margin-left: 8px;
}

/* Without a billboard the first row starts below the bar */
.premium .home-rows:not(:has(> .home-hero:not([hidden]))) { padding-top: calc(var(--header-real, var(--header-h)) + 24px); }

/* ── Rows ─────────────────────────────────────────────────────────────────── */
.premium .home-row { padding: 0; min-width: 0; position: relative; }
.premium .home-row-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 0 var(--gutter);
  margin-bottom: 14px;
}
.premium .home-row-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0;
}
.premium .home-row-more {
  border: none;
  background: none;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0;
}
.premium .home-row-more:hover { color: var(--text-primary); }
.premium .home-row-more .icon { width: 16px; height: 16px; }
.premium .home-row-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(140px, 13vw, 200px);
  gap: 18px;
  overflow-x: auto;
  padding: 10px var(--gutter) 14px;
  scroll-padding-inline: var(--gutter);
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.premium .home-row-strip::-webkit-scrollbar { display: none; }
.premium .home-row-strip > * { scroll-snap-align: start; }
.premium .home-row-strip:has(.card--channel) { grid-auto-columns: clamp(220px, 20vw, 290px); }
.premium .home-row-arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 44px;
  height: 44px;
  margin-top: 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s, background 0.2s;
}
.premium .home-row-arrow .icon { position: relative; z-index: 2; }
.premium .home-row-arrow.prev { left: 12px; }
.premium .home-row-arrow.next { right: 12px; }
.premium .home-row:hover .home-row-arrow:not([disabled]) { opacity: 1; }
.premium .home-row-arrow:hover { background: var(--lg-fill-hover); }
.premium .home-row-arrow[disabled] { pointer-events: none; }

/* ── Search, favorites, history ───────────────────────────────────────────── */
.premium .search-results { padding: calc(var(--header-real, var(--header-h)) + 24px) var(--gutter) 48px; gap: 36px; }
.premium .search-group-title { font-size: 22px; font-weight: 700; letter-spacing: -0.025em; margin-bottom: 14px; }
.premium .history-list { padding: calc(var(--header-real, var(--header-h)) + 20px) var(--gutter) 48px; gap: 10px; }
.premium .history-item {
  background: var(--bg-raised);
  border: none;
  border-radius: var(--radius-md);
  padding: 12px;
  transition: background 0.2s;
}
.premium .history-item:hover { background: #1d1e23; transform: none; }
.premium .history-item-thumbnail { border-radius: 10px; background: #202126; color: rgba(255, 255, 255, 0.3); display: grid; place-items: center; }
.premium .history-item-title { font-size: 15px; font-weight: 600; }
.premium .card-type-badge { background: rgba(255, 255, 255, 0.08); color: var(--text-secondary); border-radius: 6px; }
.premium .badge-live { background: rgba(229, 72, 77, 0.14); color: #ff8a8e; }

/* Empty states */
.premium .empty-state { padding: 72px 24px; gap: 10px; }
.premium .empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.55);
  opacity: 1;
  font-size: 0;
  margin: 0 auto 6px;
}
.premium .empty-state-icon .icon { width: 28px; height: 28px; }
.premium .empty-state h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.premium .empty-state p { color: var(--text-secondary); font-size: 14.5px; }

/* ── Modals ───────────────────────────────────────────────────────────────── */
.premium .modal,
.premium .detail-modal,
.premium .series-modal-overlay {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}
.premium .modal-content,
.premium .detail-shell,
.premium .series-modal-content,
.premium .pin-box {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 50px 120px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.premium .modal-content { overflow: auto; }
.premium .modal-header { border-bottom: 1px solid var(--border); padding: 20px 24px; }
.premium .modal-header h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.premium .close-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 0;
}
.premium .close-btn::before {
  content: '';
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E") center / contain no-repeat;
}
.premium .close-btn:hover { background: rgba(255, 255, 255, 0.18); }
.premium .detail-close,
.premium .series-close-x {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  width: 40px;
  height: 40px;
  background: rgba(12, 13, 15, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.premium .settings-tabs { border-bottom: 1px solid var(--border); gap: 6px; padding: 12px 18px; }
.premium .settings-tab {
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-weight: 500;
  padding: 8px 14px;
}
.premium .settings-tab:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.06); }
.premium .settings-tab.active { background: #f5f5f7; color: #0b0c0e; font-weight: 600; }
.premium .settings-content { padding: 24px; }
.premium .setting-group p { color: var(--text-muted); font-size: 13px; margin-top: 6px; }

/* Movie detail: full-width artwork header */
.premium .detail-modal { padding: clamp(12px, 3vw, 40px); }
.premium .detail-shell { width: min(1080px, 100%); max-height: 92vh; overflow: auto; }
.premium .detail-hero {
  min-height: clamp(360px, 52vh, 520px);
  background-size: cover;
  background-position: center 20%;
  display: flex;
  align-items: flex-end;
}
.premium .detail-hero::after {
  background:
    linear-gradient(90deg, rgba(21, 22, 26, 0.9) 0%, rgba(21, 22, 26, 0.45) 50%, rgba(21, 22, 26, 0.1) 100%),
    linear-gradient(0deg, var(--bg-raised) 0%, rgba(21, 22, 26, 0) 55%);
}
.premium .detail-content {
  grid-template-columns: 1fr;
  padding: 0 clamp(20px, 4vw, 44px) 28px;
  width: 100%;
}
.premium .detail-poster { display: none; }
.premium .detail-copy h2 {
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin-bottom: 12px;
}
.premium .detail-badges { gap: 0; margin-bottom: 12px; }
.premium .detail-badge {
  padding: 0;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: rgba(245, 245, 247, 0.82);
}
.premium .detail-badge + .detail-badge::before { content: '·'; margin: 0 9px; color: var(--text-muted); }
.premium .detail-overview { font-size: 15.5px; line-height: 1.6; color: rgba(245, 245, 247, 0.8); max-width: 62ch; }
.premium .detail-actions .btn { height: 46px; padding: 0 24px; }
.premium .detail-body { padding: 8px clamp(20px, 4vw, 44px) 36px; }
.premium .detail-body:not(:has(.detail-stat, .detail-cast:not([hidden]))) { display: none; }
.premium .detail-grid { grid-template-columns: 1fr; gap: 10px; }
.premium .detail-stat {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 0;
  background: none;
  border: none;
}
.premium .detail-stat-label {
  margin: 0;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
}
.premium .detail-stat-value { font-size: 14px; color: var(--text-secondary); }

/* Series */
.premium .series-modal-overlay { padding: clamp(12px, 3vw, 40px); }
.premium .series-modal-content { width: min(1080px, 100%); max-height: 92vh; }
.premium .series-hero {
  min-height: clamp(300px, 42vh, 440px);
  background-size: cover;
  background-position: center 25%;
  display: flex;
  align-items: flex-end;
}
.premium .series-hero-inner { width: 100%; }
.premium .series-hero-gradient {
  background:
    linear-gradient(90deg, rgba(21, 22, 26, 0.9) 0%, rgba(21, 22, 26, 0.4) 55%, rgba(21, 22, 26, 0.1) 100%),
    linear-gradient(0deg, var(--bg-raised) 0%, rgba(21, 22, 26, 0) 60%);
}
.premium .series-hero-inner { padding: 0 clamp(20px, 4vw, 44px) 24px; }
.premium .series-cover { display: none; }
.premium .series-hero-text h2 { font-size: clamp(28px, 3.6vw, 46px); font-weight: 800; letter-spacing: -0.04em; }
.premium .series-badge { background: none; border: none; padding: 0; color: rgba(245, 245, 247, 0.82); font-weight: 500; }
.premium .series-plot { color: rgba(245, 245, 247, 0.78); font-size: 15px; line-height: 1.6; max-width: 62ch; }
.premium .series-cast { color: var(--text-muted); }
.premium .season-tabs-bar { padding: 0 clamp(20px, 4vw, 44px); border: none; background: none; }
.premium .season-pager { gap: 8px; }
.premium .season-tab-window {
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  flex: 0 1 auto;
}
.premium .season-tab {
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-weight: 500;
  padding: 7px 14px;
}
.premium .season-tab.active { background: #f5f5f7; color: #0b0c0e; font-weight: 600; }
.premium .season-nav-btn { background: rgba(255, 255, 255, 0.07); border: none; color: var(--text-primary); }
.premium .season-tab-summary { color: var(--text-muted); }
.premium .episode-grid { padding: 18px clamp(20px, 4vw, 44px) 32px; gap: 10px; }
.premium .episode-card {
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px;
  gap: 18px;
  transition: background 0.2s;
}
.premium .episode-card:hover { background: rgba(255, 255, 255, 0.05); transform: none; }
.premium .episode-thumb { border-radius: 10px; overflow: hidden; background: #202126; }
.premium .episode-num-badge { background: rgba(12, 13, 15, 0.7); border-radius: 6px; }
.premium .episode-title { font-size: 15px; font-weight: 600; }
.premium .episode-plot { color: var(--text-secondary); }
.premium .episode-status-badge.watched { background: rgba(12, 13, 15, 0.7); }
.premium .episode-status-badge.next { background: #f5f5f7; color: #0b0c0e; }
.premium .episode-card.is-next { outline: none; background: rgba(255, 255, 255, 0.06); }

/* PIN dialog */
.premium .pin-box { padding: 28px; }
.premium .pin-input { background: rgba(255, 255, 255, 0.06); border: 1px solid transparent; border-radius: 14px; }
.premium .pin-input:focus { border-color: var(--accent); outline: none; }

/* Toast */
.premium .toast {
  background: rgba(30, 31, 36, 0.92);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-primary);
  font-weight: 500;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.premium .loading-spinner { background: var(--bg-base); }
.premium .spinner { border-color: rgba(255, 255, 255, 0.1); border-top-color: #f5f5f7; }
.premium .grid-loading { color: var(--text-secondary); }

/* ── View transitions ─────────────────────────────────────────────────────── */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.25s;
  animation-timing-function: ease;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .premium .app-header,
  .premium .app-header.is-solid {
    height: auto;
    flex-wrap: wrap;
    row-gap: 10px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .premium .header-center { order: 2; flex: 1 1 auto; max-width: none; }
  .premium .header-right { order: 3; }
  .premium .top-nav { order: 4; flex: 1 1 100%; }
}

@media (max-width: 768px) {
  .premium .header-center { display: block; order: 4; flex: 1 1 100%; }
  .premium .top-nav { order: 5; }
  .premium .top-nav .nav-item { padding: 8px 13px; font-size: 13.5px; }
  .premium .content-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 22px 12px; }
  .premium .content-grid:has(> .card--channel) { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .premium .home-hero { min-height: 70vh; }
  .premium .home-hero-dots { position: static; padding: 0 var(--gutter) 24px; }
  .premium .home-row-arrow { display: none; }
  .premium .detail-stat { grid-template-columns: 96px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .premium .content-card .card-thumb,
  .premium .card-thumb img { transition: none; }
  .premium .content-card:hover .card-thumb { transform: none; }
}

/* ── Radio ────────────────────────────────────────────────────────────────── */
.premium #radio-view { overflow-y: auto; }
.premium #radio-view > .grid-wrapper:first-child { padding-top: calc(var(--header-real, var(--header-h)) + 20px); padding-bottom: 120px; }
.radio-search { display: flex; gap: 10px; max-width: 560px; margin-bottom: 14px; }
.radio-search input {
  flex: 1; min-width: 0; height: 48px; padding: 0 16px; border-radius: 12px;
  border: 1px solid transparent; background: rgba(255, 255, 255, 0.06); color: var(--text-primary); font: inherit; font-size: 15px;
}
.radio-search input:focus { outline: none; border-color: var(--accent); background: rgba(255, 255, 255, 0.09); }
.radio-search .btn { flex: none; width: auto; min-height: 48px; padding: 0 22px; }
.radio-heading { margin: 0 0 18px; font-size: 13px; color: var(--text-secondary); }
.premium .radio-card.is-playing .card-thumb { box-shadow: 0 0 0 2px var(--accent), 0 8px 24px rgba(0, 0, 0, 0.35); }
.premium .radio-card.is-playing .card-title { color: var(--accent); }

.radio-bar {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 900;
  width: min(560px, calc(100% - 32px)); display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px;
  border-radius: 18px; border: 1px solid var(--glass-border); background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.radio-bar[hidden] { display: none; }
.radio-bar-logo {
  position: relative; flex-shrink: 0; width: 48px; height: 48px; border-radius: 12px; overflow: hidden;
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.08); color: var(--text-secondary);
}
.radio-bar-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #1b1c20; }
.radio-bar-text { flex: 1; min-width: 0; }
.radio-bar-name { font-size: 15px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radio-bar-status { font-size: 12.5px; color: var(--text-secondary); }
.radio-bar-btn {
  flex-shrink: 0; width: 48px; height: 48px; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.1); color: var(--text-primary); cursor: pointer;
}
.radio-bar-btn:hover { background: rgba(255, 255, 255, 0.18); }
.radio-bar-btn[data-act="toggle"] { background: #f5f5f7; color: #0b0c0e; }
.radio-bar-btn[data-act="favorite"].active { color: var(--live); }
.radio-bar-btn[data-act="favorite"].active svg { fill: currentColor; }
.radio-favorites { margin-bottom: 28px; }
.radio-favorites[hidden] { display: none; }
.premium .radio-card .card-favorite-btn.active svg { fill: currentColor; }

/* ── Tool tabs (YouTube, map, games, sounds open in a frame under the bar) ── */
.premium .view-section.tool-view:not(#home-view) { overflow: hidden; padding-top: var(--header-real, var(--header-h)); }
.tool-frame { flex: 1; width: 100%; min-height: 0; border: 0; background: var(--bg-base); }
.premium .view-section.tool-view.is-fullscreen:not(#home-view) { position: fixed; inset: 0; z-index: 3000; padding-top: 0; background: #000; }

/* Movie cast from TMDB and the actor window */
.premium .detail-cast { display: grid; gap: 10px; margin-top: 6px; }
.premium .detail-cast[hidden] { display: none; }
.premium .detail-cast .cast-member { background: none; border: 0; padding: 0; font: inherit; color: inherit; }
.premium .detail-cast .cast-member:focus-visible .cast-photo { border-color: var(--text-primary, #fff); }
.premium .cast-member { width: 86px; }
.premium .cast-photo { width: 72px; height: 72px; }
.premium #actor-movies-grid .card-thumb { position: relative; }
.premium .actor-movie-local { cursor: pointer; }
.premium .actor-movie-badge { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 999px; background: rgba(10, 10, 11, 0.82); color: #fff; font-size: 11px; font-weight: 600; }
.premium #actor-movies-grid .empty-note { color: var(--text-muted); }
