/* Play4u home — app shell (sidebar + search + hero + rows) */
:root {
  --bg: #090b12;
  --bg-elev: rgba(18, 22, 34, 0.72);
  --ink: #f4f6fa;
  --muted: #9aa3b5;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #ff9000;
  --accent-hi: #ffa42a;
  --accent-soft: rgba(255, 144, 0, 0.16);
  --glass: rgba(16, 20, 32, 0.55);
  --glass-strong: rgba(12, 15, 24, 0.78);
  --sidebar-rail: 76px;
  --sidebar-open: 248px;
  --sidebar-w: var(--sidebar-rail);
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: "Syne", ui-sans-serif, sans-serif;
  --font-body: "Figtree", ui-sans-serif, sans-serif;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  /* Solid scroll surface — gradients live on a fixed layer to avoid scroll repaints. */
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 15% 10%, rgba(255, 144, 0, 0.12), transparent 55%),
    radial-gradient(ellipse 55% 40% at 90% 20%, rgba(70, 100, 180, 0.16), transparent 50%),
    radial-gradient(ellipse 50% 35% at 70% 90%, rgba(255, 144, 0, 0.06), transparent 55%);
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--accent);
  color: #111;
  font-weight: 700;
  border-radius: 8px;
}
.skip-link:focus {
  top: 12px;
}

/* ---- shell ---- */
.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.main-wrap {
  min-width: 0;
  margin-left: var(--sidebar-w);
  padding: 18px 22px 28px;
  transition: margin-left 0.22s ease;
}

/* ---- sidebar (Hotstar-style rail → expand) ---- */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-w);
  height: 100vh;
  height: 100dvh;
  padding: 18px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--glass-strong);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 40;
  overflow: hidden;
  transition: width 0.22s ease, padding 0.22s ease, box-shadow 0.22s ease;
}
@media (hover: hover) and (min-width: 961px) {
  .sidebar:hover,
  body.sidebar-expanded .sidebar {
    width: var(--sidebar-open);
    padding: 22px 14px 16px;
    box-shadow: 8px 0 28px rgba(0, 0, 0, 0.28);
  }
  body.sidebar-expanded {
    --sidebar-w: var(--sidebar-open);
  }
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.logo .logo-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(157, 80, 255, 0.35));
}
.logo .logo-text {
  display: inline-flex;
  align-items: baseline;
  line-height: 1;
}
.logo .logo-play {
  background: linear-gradient(180deg, #ffffff 0%, #e8e8f2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.logo .logo-accent {
  margin-left: 1px;
  font-weight: 800;
  background: linear-gradient(115deg, #b06cff 0%, #8b3dff 42%, #4b00d1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.sidebar-logo {
  justify-content: center;
  min-height: 40px;
}
.sidebar-logo .logo-text {
  display: none;
  white-space: nowrap;
}
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.side-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.18s ease, color 0.18s ease;
}
.side-link-label {
  display: none;
  white-space: nowrap;
}
.side-link svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  flex-shrink: 0;
}
.side-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.side-link.is-active {
  color: #111;
  background: var(--accent);
}

/* Expanded: labels + fold text / lists */
@media (hover: hover) and (min-width: 961px) {
  .sidebar:hover .sidebar-logo,
  body.sidebar-expanded .sidebar-logo {
    justify-content: flex-start;
    padding: 0 4px;
  }
  .sidebar:hover .sidebar-logo .logo-text,
  body.sidebar-expanded .sidebar-logo .logo-text {
    display: inline-flex;
  }
  .sidebar:hover .side-link,
  body.sidebar-expanded .side-link {
    justify-content: flex-start;
    padding: 11px 14px;
  }
  .sidebar:hover .side-link-label,
  body.sidebar-expanded .side-link-label {
    display: inline;
  }
  .sidebar:hover .side-fold,
  body.sidebar-expanded .side-fold {
    justify-content: space-between;
    padding: 8px 10px;
  }
  .sidebar:hover .side-fold-title > span,
  body.sidebar-expanded .side-fold-title > span {
    display: inline;
  }
  .sidebar:hover .side-fold-icon,
  body.sidebar-expanded .side-fold-icon {
    display: block;
  }
  .sidebar:hover .side-fold-title > svg,
  body.sidebar-expanded .side-fold-title > svg {
    width: 14px;
    height: 14px;
  }
  .sidebar:hover .side-expand-label,
  body.sidebar-expanded .side-expand-label {
    display: inline;
  }
  .sidebar:hover .side-expand,
  body.sidebar-expanded .side-expand {
    justify-content: flex-start;
    padding: 10px 12px;
  }
  body.sidebar-expanded .side-expand-ico {
    transform: rotate(180deg);
  }
}

.side-expand {
  appearance: none;
  border: 0;
  background: transparent;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.side-expand:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.side-expand-ico {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.side-expand-label {
  display: none;
  white-space: nowrap;
}

/* Hero hidden while catalog search is active */
.hero-banner.is-search-hidden {
  display: none;
}

/* Browse facets — icon-only when rail collapsed; labels when expanded */
.side-browse {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.side-section {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
}
.side-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 10px 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(154, 163, 181, 0.85);
}
.side-label > svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
  opacity: 0.85;
}
.side-fold {
  appearance: none;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 12px 10px;
  border-radius: 12px;
  color: var(--muted);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.side-fold-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}
.side-fold-title > span {
  display: none;
  white-space: nowrap;
}
.side-fold-title > svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  flex-shrink: 0;
  opacity: 0.95;
}
.side-fold:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.side-fold-icon {
  display: none;
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
  opacity: 0.75;
  transition: transform 0.18s ease;
}
.side-section:not(.is-collapsed) .side-fold-icon {
  transform: rotate(180deg);
}
.side-section:not(.is-collapsed) .side-fold {
  color: #fff;
}
.side-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 4px;
}
.side-section.is-collapsed .side-list {
  display: none;
}
/* Icon rail (not pinned, not hovered): never show submenu items — they clip as "H 64". */
@media (hover: hover) and (min-width: 961px) {
  body:not(.sidebar-expanded) .sidebar:not(:hover) .side-list {
    display: none !important;
  }
}
.side-item {
  appearance: none;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--muted);
  font: inherit;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.side-item-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-count {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: rgba(154, 163, 181, 0.65);
}
.side-item:hover,
.side-item.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.side-item.is-active .side-count {
  color: rgba(255, 255, 255, 0.7);
}

/* ---- topbar / search ---- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--glass);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  backdrop-filter: blur(10px);
}
.menu-btn span {
  display: block;
  width: 16px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}
.search-icon {
  width: 20px;
  height: 20px;
  fill: var(--muted);
  flex-shrink: 0;
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: #fff;
  padding: 12px 0;
  font-size: 16px; /* iOS zooms inputs under 16px */
  /* Use our clear button — native cancel is tiny/missing on many mobiles */
  -webkit-appearance: none;
  appearance: none;
}
.search input::-webkit-search-decoration,
.search input::-webkit-search-cancel-button,
.search input::-webkit-search-results-button,
.search input::-webkit-search-results-decoration {
  display: none;
  -webkit-appearance: none;
}
.search input::placeholder {
  color: rgba(154, 163, 181, 0.9);
}
.search-clear {
  appearance: none;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin: 0 -6px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.search-clear.is-visible,
.search-clear:not([hidden]) {
  display: inline-flex;
}
.search-clear[hidden] {
  display: none !important;
}
.search-clear svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.search-clear:active {
  background: rgba(255, 255, 255, 0.18);
}

/* ---- hero ---- */
.hero-banner {
  position: relative;
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  min-height: min(52vh, 420px);
  background: #111522;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  isolation: isolate;
}
.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: end;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.6s ease;
  z-index: 0;
}
.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  transform: scale(1.03);
}
.hero-slide.is-active .hero-media img {
  animation: hero-drift 24s ease-in-out infinite alternate;
}
.hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(105deg, rgba(8, 10, 16, 0.92) 0%, rgba(8, 10, 16, 0.55) 45%, rgba(8, 10, 16, 0.2) 72%),
    linear-gradient(180deg, transparent 20%, rgba(8, 10, 16, 0.75) 100%);
}
.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 34rem;
  padding: clamp(28px, 5vw, 48px);
}
.hero-kicker {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.hero-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
  color: #fff;
  overflow-wrap: anywhere;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: rgba(244, 246, 250, 0.72);
  font-size: 0.92rem;
  font-weight: 600;
}
.hero-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: #fff;
}
.hero-chip-imax {
  color: #7ec4ff;
  border-color: rgba(0, 114, 206, 0.45);
  background: rgba(0, 50, 100, 0.35);
}
.hero-lead {
  margin: 0 0 22px;
  color: rgba(244, 246, 250, 0.78);
  font-size: 1rem;
  max-width: 36ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}
.btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--accent);
  color: #111;
}
.btn-primary:hover {
  background: var(--accent-hi);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
  backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.14);
}

.hero-controls {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-arrow {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  backdrop-filter: blur(8px);
}
.hero-dots {
  display: flex;
  gap: 6px;
  padding: 0 4px;
}
.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
}
.hero-dot.is-active {
  background: var(--accent);
  width: 18px;
  border-radius: 999px;
}

@keyframes hero-drift {
  from {
    transform: scale(1.04);
  }
  to {
    transform: scale(1.08) translate3d(-1%, -0.5%, 0);
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---- filters ---- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.filter-sep {
  display: inline-block;
  width: 1px;
  align-self: stretch;
  min-height: 22px;
  margin: 0 2px;
  background: var(--line);
}
.filter-pill {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--muted);
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.filter-pill:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
}
.filter-pill.is-active {
  color: #111;
  background: var(--accent);
  border-color: transparent;
}

.catalog-note {
  margin: -6px 0 18px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.empty-filter {
  margin: 0 0 18px;
  color: var(--muted);
}
.search-hits[hidden],
#catalogBrowse[hidden] {
  display: none !important;
}

/* ---- rows ---- */
.row {
  margin-bottom: 28px;
}
.row.is-dimmed {
  opacity: 0.35;
  pointer-events: none;
}
.row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 0 2px;
}
.row-head h2,
.row-head .row-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.row-count {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}
.row-track {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px 14px;
  padding: 4px 2px 6px;
  overflow: visible;
}

.poster-card {
  min-width: 0;
}
.poster-card.is-hidden {
  display: none;
}
.poster-link {
  display: block;
}
.poster {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 14px;
  background: #151925;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  /* Promote once; avoid transform transitions during scroll on touch. */
  transform: translateZ(0);
}
.poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.72) 100%);
  z-index: 1;
  pointer-events: none;
}
.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.poster-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--muted);
  background: #151925;
}
@media (hover: hover) and (pointer: fine) {
  .poster {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
  }
  .poster-link:hover .poster,
  .poster-link:focus-visible .poster {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.42);
  }
}

.badge-imax {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  background: #0a0c12;
  border: 1px solid rgba(0, 114, 206, 0.45);
}
.badge-age {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  min-width: 28px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  color: #fff;
  background: rgba(10, 12, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.22);
  pointer-events: none;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}
/* U / G — all ages */
.badge-age--all {
  color: #e8fff0;
  background: rgba(16, 120, 64, 0.92);
  border-color: rgba(110, 220, 150, 0.55);
}
/* PG / UA 7+ — mild */
.badge-age--kids {
  color: #e8f7ff;
  background: rgba(20, 110, 160, 0.92);
  border-color: rgba(110, 190, 230, 0.5);
}
/* UA / PG-13 / TV-14 — teens */
.badge-age--teen {
  color: #fff8e6;
  background: rgba(170, 120, 20, 0.94);
  border-color: rgba(240, 190, 70, 0.55);
}
/* UA 16+ / 15–17 — mature */
.badge-age--mature {
  color: #fff4ec;
  background: rgba(180, 80, 24, 0.94);
  border-color: rgba(240, 150, 80, 0.55);
}
/* A / R / TV-MA / 18 — adults */
.badge-age--adult {
  color: #ffeaea;
  background: rgba(160, 28, 36, 0.94);
  border-color: rgba(240, 110, 110, 0.5);
}
/* NR / unrated */
.badge-age--nr {
  color: #e8e8ec;
  background: rgba(70, 74, 84, 0.94);
  border-color: rgba(170, 174, 186, 0.4);
}
.badge-imax svg {
  width: 34px;
  height: 8px;
  fill: #0072ce;
  display: block;
}
.poster-badges {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: flex-end;
  /* Chips stay opaque — no backdrop-filter (scroll FPS killer). */
  pointer-events: none;
}
.badge-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  width: 100%;
}
.badge-chip {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: #0a0c12;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.badge-quality {
  color: #111;
  background: var(--accent);
  border-color: transparent;
}
.badge-season {
  color: #111;
  background: var(--accent);
  border-color: transparent;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge-new-ep {
  color: #111;
  background: #f0c14b;
  border-color: transparent;
  letter-spacing: 0.02em;
}
.badge-lang {
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.poster-meta {
  display: block;
  padding: 10px 2px 0;
}
.poster-name {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.015em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.poster-sub {
  display: block;
  margin-top: 3px;
  font-size: 0.82rem;
  color: var(--muted);
}

.rail-empty {
  color: var(--muted);
}

/* ---- pagination ---- */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  margin: 8px 0 6px;
  padding: 18px 0 4px;
}
.pager-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pager-btn,
.pager-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #151925;
  color: var(--ink);
  font-weight: 650;
  font-size: 0.9rem;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.pager-btn.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}
.pager-num.is-current {
  background: var(--accent);
  border-color: transparent;
  color: #111;
}
.pager-gap {
  color: var(--muted);
  padding: 0 2px;
  font-weight: 600;
}
@media (hover: hover) and (pointer: fine) {
  a.pager-btn:hover,
  a.pager-num:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: #1a2030;
  }
}

/* ---- footer ---- */
.site-foot {
  margin-top: 20px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.site-foot p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.sidebar-backdrop {
  display: none;
}

/* ---- responsive ---- */
@media (max-width: 960px) {
  html {
    scroll-behavior: auto;
  }
  body::before {
    display: none;
  }
  .main-wrap {
    margin-left: 0;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100dvh;
    width: min(280px, calc(86vw - env(safe-area-inset-left, 0px)));
    padding: 22px 16px 24px;
    padding-top: calc(22px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    padding-left: calc(16px + env(safe-area-inset-left, 0px));
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow);
    background: #0c101a;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .sidebar-logo {
    justify-content: flex-start;
  }
  .sidebar-logo .logo-text {
    display: inline-flex;
  }
  .side-link {
    justify-content: flex-start;
    padding: 11px 14px;
  }
  .side-link-label {
    display: inline;
  }
  .side-browse {
    display: flex;
  }
  .side-fold {
    justify-content: space-between;
    padding: 8px 10px;
  }
  .side-fold-title > span {
    display: inline;
  }
  .side-fold-title > svg {
    width: 14px;
    height: 14px;
  }
  .side-fold-icon {
    display: block;
  }
  .side-expand {
    display: none;
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  body.sidebar-open {
    overflow: hidden;
  }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .sidebar-backdrop[hidden] {
    display: none;
  }
  .menu-btn {
    display: inline-flex;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: #151925;
  }
  .search {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: #151925;
    box-shadow: none;
    min-height: 44px;
    padding: 0 14px;
  }
  .filter-pill {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: #151925;
    flex-shrink: 0;
  }
  .btn-ghost,
  .hero-arrow {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .main-wrap {
    margin-left: 0;
    padding: 0 14px calc(24px + env(safe-area-inset-bottom, 0px));
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    margin: 0 -14px 14px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
    /* Opaque sticky chrome — translucent + scroll = flicker on Android. */
    background: #090b12;
    border-bottom: 1px solid var(--line);
  }
  .hero-banner,
  .hero-slide {
    min-height: min(46vh, 400px);
  }
  .hero-banner {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    border-radius: 14px;
  }
  .hero-copy {
    max-width: none;
    padding: clamp(20px, 5vw, 36px) clamp(16px, 4vw, 28px) 58px;
  }
  .hero-lead {
    max-width: none;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
  }
  .hero-controls {
    left: 0;
    right: 0;
    bottom: 12px;
    justify-content: center;
  }
  /* Ken Burns during scroll = sustained GPU tax on Android Chrome. */
  .hero-slide.is-active .hero-media img {
    animation: none !important;
    transform: none;
  }
  .hero-media img {
    transform: none;
  }
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -14px 18px;
    padding: 0 14px 4px;
    gap: 8px;
  }
  .filters::-webkit-scrollbar {
    display: none;
  }
  .row-track {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 12px;
  }
  .poster {
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transform: none;
  }
  .btn:hover {
    transform: none;
  }
  .site-foot {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .hero-banner,
  .hero-slide {
    min-height: min(42vh, 340px);
  }
  .hero-slide.is-active {
    position: relative;
    inset: auto;
  }
  .hero-kicker {
    margin-bottom: 6px;
  }
  .hero-title {
    margin-bottom: 8px;
  }
  .hero-meta {
    gap: 6px;
    font-size: 0.82rem;
    margin-bottom: 8px;
  }
  .hero-lead {
    font-size: 0.92rem;
    margin-bottom: 14px;
    -webkit-line-clamp: 2;
  }
  .hero-copy {
    padding: 18px 14px 72px;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .hero-actions .btn {
    width: 100%;
    min-height: 44px;
  }
  .hero-controls {
    bottom: 10px;
  }
  .row-track {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 8px;
  }
  .poster {
    border-radius: 10px;
  }
  .poster-name {
    font-size: 0.86rem;
  }
  .poster-sub {
    font-size: 0.75rem;
  }
  .row-head h2,
  .row-head .row-title {
    font-size: 1.1rem;
  }
}

@media (max-width: 380px) {
  .row-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .main-wrap {
    padding-left: 10px;
    padding-right: 10px;
  }
  .topbar {
    margin-left: -10px;
    margin-right: -10px;
    padding-left: 10px;
    padding-right: 10px;
  }
  .filters {
    margin-left: -10px;
    margin-right: -10px;
    padding-left: 10px;
    padding-right: 10px;
  }
  .hero-banner {
    border-radius: 12px;
  }
}

/* Coarse pointer / touch: same paint cuts even on wide tablets */
@media (hover: none) and (pointer: coarse) {
  html {
    scroll-behavior: auto;
  }
  body::before {
    display: none;
  }
  .hero-slide.is-active .hero-media img {
    animation: none !important;
    transform: none;
  }
  .search,
  .filter-pill,
  .menu-btn,
  .btn-ghost,
  .hero-arrow {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .poster {
    box-shadow: none;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .hero-slide {
    transition: none;
  }
  .hero-slide.is-active .hero-media img {
    animation: none !important;
    transform: none;
  }
}
