/* ══════════════════════════════════════════════════════════════════════════
   HYDRAPLAY — PREMIUM MOBILE OVERHAUL
   ──────────────────────────────────────────────────────────────────────────
   Loaded AFTER styles.css and theme.css so this layer always wins the
   cascade. Owns:
     • Mobile-first navbar (hamburger + slide-in drawer)
     • Hero / Slidey responsive behaviour
     • Filter pill row (horizontal scroll, no wrap)
     • Rails (touch-friendly card sizing)
     • Watch page (movie-details) responsive layout
     • Skeleton loaders & richer empty states
     • Engagement bar polish (touch targets ≥ 44px)
     • Micro-animations (respects prefers-reduced-motion)

   No video-playback logic is altered here — only layout, typography,
   spacing, colour and motion.
   ══════════════════════════════════════════════════════════════════════════ */

/* ─── Design tokens layered on top of theme.css ─────────────────────────── */
:root {
  --hp-radius-sm: 10px;
  --hp-radius-md: 14px;
  --hp-radius-lg: 20px;
  --hp-radius-pill: 999px;

  --hp-blur-card: blur(16px) saturate(140%);
  --hp-blur-glass: blur(22px) saturate(160%);

  --hp-grad-accent: linear-gradient(135deg, #ff2d55 0%, #ff5e3a 50%, #ff9500 100%);
  --hp-grad-blue: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --hp-grad-luxury: linear-gradient(135deg, #ffd700 0%, #ffb24d 35%, #ff8c00 100%);
  --hp-grad-dark: linear-gradient(180deg, rgba(8,8,12,0.0) 0%, rgba(5,5,9,0.55) 35%, rgba(3,3,6,0.95) 100%);

  --hp-shadow-card: 0 14px 40px rgba(0,0,0,0.55);
  --hp-shadow-pop:  0 20px 60px rgba(0,0,0,0.7);

  --hp-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ──────────────────────────────────────────────────────────────────────────
   1. NAVBAR — premium logo bar, hamburger, mobile drawer
   ────────────────────────────────────────────────────────────────────────── */

.navbar {
  /* Slightly thinner on mobile, classic on desktop */
  height: var(--nav-height);
  padding: 0 clamp(14px, 4vw, 36px);
  gap: 14px;
}

/* Pulse animation under logo on hover/scroll for delight (Req: micro-animation) */
.nav-logo {
  position: relative;
  flex-shrink: 0;
}
.nav-logo .logo-text {
  font-size: clamp(17px, 4vw, 22px);
  letter-spacing: -0.5px;
}
/* Remove the underline sweep — new logo has its own hover glow */
.nav-logo::after { display: none; }
.nav-logo::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent, #3b82f6), transparent);
  opacity: 0;
  transform: scaleX(0.4);
  transition: opacity 0.4s var(--hp-ease), transform 0.4s var(--hp-ease);
}
.nav-logo:hover::after {
  opacity: 1;
  transform: scaleX(1);
}

/* Hamburger button — injected by mobileNav.js, hidden on desktop */
.hp-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.hp-hamburger:hover { background: rgba(255, 255, 255, 0.08); }
.hp-hamburger i { font-size: 22px; line-height: 1; }

/* Mobile search-icon button shown next to hamburger */
.hp-mobile-search-trigger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.hp-mobile-search-trigger i { font-size: 18px; }
.hp-mobile-search-trigger:hover { background: rgba(255, 255, 255, 0.08); }

/* Mobile drawer */
.hp-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1099;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--hp-ease), visibility 0.3s var(--hp-ease);
}
.hp-drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.hp-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  height: 100vh;
  width: min(86vw, 360px);
  background: linear-gradient(180deg, rgba(15, 15, 22, 0.98) 0%, rgba(8, 8, 14, 0.98) 100%);
  backdrop-filter: var(--hp-blur-glass);
  -webkit-backdrop-filter: var(--hp-blur-glass);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.6);
  z-index: 1100;
  transform: translateX(100%);
  transition: transform 0.4s var(--hp-ease);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0;
}
.hp-drawer.is-open { transform: translateX(0); }

.hp-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  background: inherit;
  z-index: 2;
}
.hp-drawer-header .hp-drawer-brand {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.5px;
}
.hp-drawer-header .hp-drawer-brand span {
  background: var(--hp-grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hp-drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.hp-drawer-close:hover { background: rgba(255, 255, 255, 0.1); transform: rotate(90deg); }

.hp-drawer-search {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.hp-drawer-search-wrap {
  position: relative;
}
.hp-drawer-search-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}
.hp-drawer-search-wrap input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 42px;
  border-radius: var(--hp-radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: var(--transition);
  font-family: var(--font-body);
}
.hp-drawer-search-wrap input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.hp-drawer-nav {
  display: flex;
  flex-direction: column;
  padding: 12px 12px 24px;
  gap: 2px;
}
.hp-drawer-nav-section {
  margin-top: 12px;
}
.hp-drawer-nav-section-title {
  padding: 10px 14px 6px;
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}
.hp-drawer-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border-radius: var(--hp-radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s var(--hp-ease), transform 0.2s var(--hp-ease);
  -webkit-tap-highlight-color: transparent;
}
.hp-drawer-link i {
  font-size: 18px;
  width: 24px;
  text-align: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.hp-drawer-link:hover,
.hp-drawer-link.is-active {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  transform: translateX(2px);
}
.hp-drawer-link.is-active i { color: var(--accent); }

.hp-drawer-footer {
  margin-top: auto;
  padding: 18px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
  color: var(--text-muted);
}

/* ──────────────────────────────────────────────────────────────────────────
   2. PREDICTIVE SEARCH OVERLAY — full-screen on mobile, dropdown on desktop
   ────────────────────────────────────────────────────────────────────────── */

.hp-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 9, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--hp-ease), visibility 0.25s var(--hp-ease);
}
.hp-search-overlay.is-open {
  opacity: 1;
  visibility: visible;
}
.hp-search-overlay-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(15, 15, 22, 0.6);
}
.hp-search-overlay-input-wrap {
  position: relative;
  flex: 1;
}
.hp-search-overlay-input-wrap i.search-leading {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
}
.hp-search-overlay-input-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  border-radius: var(--hp-radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: var(--transition);
}
.hp-search-overlay-input-wrap input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.1);
}
.hp-search-overlay-cancel {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 4px;
  flex-shrink: 0;
}
.hp-search-overlay-cancel:hover { color: #fff; }

.hp-search-overlay-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px 30px;
}
.hp-search-section-label {
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  margin: 18px 4px 10px;
}
.hp-search-section-label:first-child { margin-top: 4px; }

.hp-quick-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.hp-quick-chip {
  padding: 8px 14px;
  border-radius: var(--hp-radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.hp-quick-chip:hover,
.hp-quick-chip:focus {
  border-color: var(--accent);
  color: #fff;
  background: rgba(229, 9, 20, 0.08);
}

.hp-search-result {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border-radius: var(--hp-radius-md);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s var(--hp-ease);
}
.hp-search-result:hover {
  background: rgba(255, 255, 255, 0.04);
}
.hp-search-result-thumb {
  width: 56px;
  height: 80px;
  flex-shrink: 0;
  border-radius: var(--hp-radius-sm);
  overflow: hidden;
  background: var(--bg-card);
  position: relative;
}
.hp-search-result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hp-search-result-info {
  min-width: 0;
  flex: 1;
}
.hp-search-result-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hp-search-result-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.hp-search-result-meta .dot { color: var(--text-muted); }
.hp-search-result-rating { color: var(--gold, #f5c518); font-weight: 600; }

.hp-search-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.hp-search-empty i {
  display: block;
  font-size: 38px;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.2);
}

/* ──────────────────────────────────────────────────────────────────────────
   3. HOME — Slidey hero / Billboard polish (mobile-first)
   ────────────────────────────────────────────────────────────────────────── */

#slidey {
  /* Cleaner radius and edge separation on every viewport */
  margin: 0 0 12px;
  border-radius: 0;
  position: relative;
}

/* Stronger gradient overlay so titles always read well */
.slidey-left {
  /* Soft fallback so the hero never looks pitch-black while the backdrop loads */
  background-color: #0a0a14;
  background-image:
    radial-gradient(ellipse at 30% 30%, rgba(59, 130, 246, 0.08), transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(229, 9, 20, 0.10), transparent 55%);
}
.slidey-left::after {
  background:
    linear-gradient(180deg, rgba(0,0,0,0.0) 30%, rgba(0,0,0,0.85) 100%),
    linear-gradient(90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 45%, rgba(0,0,0,0.05) 100%);
}

.slidey-content {
  animation: hp-fade-up 0.7s var(--hp-ease) both;
}
.slidey-title {
  text-shadow: 0 4px 20px rgba(0,0,0,0.85);
}

/* Up-Next queue: card-look on every viewport */
.slidey-right {
  background: linear-gradient(180deg, #0a0a10 0%, #06060a 100%);
}
.slidey-queue-item {
  border: 1px solid transparent;
}
.slidey-queue-item:hover,
.slidey-queue-item.active {
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.04);
}

/* ──────────────────────────────────────────────────────────────────────────
   4. CARDS / RAILS — premium polish + social-proof badge slot
   ────────────────────────────────────────────────────────────────────────── */

/* Trending rank — softer + readable on mobile */
.trending-rank {
  font-size: 110px !important;
  left: -15px !important;
  bottom: -15px !important;
  -webkit-text-stroke: 2.5px rgba(255, 255, 255, 0.35) !important;
  color: #050508 !important;
  text-shadow: 0px 4px 10px rgba(0, 0, 0, 0.8) !important;
  font-family: Arial, sans-serif !important;
  font-weight: 900 !important;
  line-height: 1 !important;
}

/* Card hover: Netflix-style scale only on hover-capable pointers (already
   handled in styles.css, but tighten the curve) */
@media (hover: hover) and (pointer: fine) {
  .movies-row .movie-card,
  .movies-grid .movie-card,
  .stream-rail .movie-card {
    transition: transform 0.45s var(--hp-ease), box-shadow 0.45s var(--hp-ease) !important;
  }
}

/* Skeleton shimmer for loading rails */
.home-empty.is-skeleton,
.hp-skeleton-rail {
  display: flex;
  gap: 14px;
  overflow: hidden;
  padding: 6px 0 8px;
  background: none;
  border: none;
}
.hp-skel-card {
  flex: 0 0 auto;
  width: 168px;
  height: 252px;
  border-radius: var(--hp-radius-md);
  background:
    linear-gradient(110deg, rgba(255,255,255,0.04) 30%, rgba(255,255,255,0.10) 50%, rgba(255,255,255,0.04) 70%);
  background-size: 220% 100%;
  animation: hp-shimmer 1.4s linear infinite;
}
@keyframes hp-shimmer {
  0%   { background-position: 220% 0; }
  100% { background-position: -20% 0; }
}

/* Empty state — visually richer */
.home-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  letter-spacing: 0.2px;
}
.home-empty::before {
  content: "✦";
  font-size: 22px;
  color: rgba(255, 255, 255, 0.18);
}

/* ──────────────────────────────────────────────────────────────────────────
   5. CONTROL STRIP / FILTER PILLS
   ────────────────────────────────────────────────────────────────────────── */

.control-strip {
  border-radius: var(--hp-radius-lg);
}

.home-filter-btn {
  position: relative;
  overflow: hidden;
  font-size: 13.5px;
}
.home-filter-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.12) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s var(--hp-ease);
  pointer-events: none;
}
.home-filter-btn:hover::after,
.home-filter-btn.global-active::after {
  transform: translateX(100%);
}

/* ──────────────────────────────────────────────────────────────────────────
   6. WATCH PAGE (movie-details.html) — responsive layout overhaul
   ────────────────────────────────────────────────────────────────────────── */

/* Soften the cinema layout container */
body.movie-details-page .cinema-layout {
  padding: clamp(24px, 4vw, 40px) clamp(12px, 4vw, 36px) 60px !important;
  gap: clamp(20px, 3vw, 30px) !important;
}

/* Player frame — premium rounded shell with subtle accent halo */
body.movie-details-page #videoContainer.player-shell {
  padding: clamp(10px, 1.4vw, 18px) !important;
  border-radius: clamp(14px, 2vw, 22px) !important;
}

/* Player title row turns into an engagement bar on mobile */
body.movie-details-page .video-section > div[style*="max-width:980px"] {
  margin-top: 14px !important;
  border-radius: var(--hp-radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 12px 14px;
}

/* Title block spacing */
body.movie-details-page .details-info {
  padding: 4px 2px 0;
}
body.movie-details-page .details-title {
  letter-spacing: 1px !important;
}

/* Action buttons — touch friendly */
body.movie-details-page .details-actions .btn {
  min-height: 44px;
  padding: 10px 18px;
  font-size: 14px;
  border-radius: var(--hp-radius-pill);
}

/* Sidebar — drop sticky on mobile, transform into stacked cards */
body.movie-details-page .cinema-right {
  flex: 0 0 320px;
}
body.movie-details-page .server-switcher,
body.movie-details-page .episodes-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--hp-radius-lg);
}

/* Server buttons — premium pill look */
body.movie-details-page .srv-btn {
  border-radius: var(--hp-radius-md) !important;
  min-height: 44px;
  font-size: 13px !important;
  letter-spacing: 0.2px;
}

/* Episode card — refined */
body.movie-details-page .episode-card {
  border-radius: var(--hp-radius-md);
  transition: transform 0.25s var(--hp-ease), border-color 0.25s var(--hp-ease);
}
body.movie-details-page .ep-card-thumb {
  border-radius: 8px;
}

/* Comments — typography spacing */
body.movie-details-page .comment-item {
  border-radius: var(--hp-radius-md);
}

/* ──────────────────────────────────────────────────────────────────────────
   7. RESPONSIVE BREAKPOINTS
   ────────────────────────────────────────────────────────────────────────── */

/* === Tablet & below: hamburger appears, desktop links hide === */
@media (max-width: 1023.98px) {
  .navbar .nav-links {
    /* Hidden — replaced by drawer */
    display: none !important;
  }
  .navbar .nav-search {
    display: none !important;
  }
  .hp-hamburger,
  .hp-mobile-search-trigger {
    display: inline-flex;
  }
  .navbar .nav-right {
    gap: 8px;
  }
}

/* === Tablet (≤980px): slidey stacks vertically with refined sizing === */
@media (max-width: 980px) {
  #slidey {
    flex-direction: column !important;
    min-height: auto !important;
    height: auto !important;
  }
  .slidey-left {
    width: 100% !important;
    height: auto !important;
    min-height: 56vh;
    aspect-ratio: 16 / 11;
    padding: 0 5% 32px !important;
    border-radius: 0 !important;
  }
  .slidey-left::after {
    background:
      linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,0.8) 75%, rgba(0,0,0,0.96) 100%),
      linear-gradient(180deg, rgba(0,0,0,0.45) 0%, transparent 30%);
  }
  .slidey-content {
    max-width: 100% !important;
    text-align: left;
  }
  .slidey-right {
    width: 100% !important;
    height: auto !important;
    border-left: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    max-height: 320px;
    padding-bottom: 12px;
  }
  .slidey-queue-header {
    padding: 18px 20px 8px !important;
  }
  .slidey-queue-list {
    padding: 0 14px 16px !important;
  }

  /* Watch page becomes single column */
  body.movie-details-page .cinema-layout {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
  }
  body.movie-details-page .cinema-left,
  body.movie-details-page .cinema-right {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    position: static !important;
    top: auto !important;
  }
  body.movie-details-page .episodes-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
    max-height: none !important;
  }
}

/* === Phone (≤768px): tighten spacing, larger touch targets === */
@media (max-width: 768px) {
  /* Home shell padding */
  .home-shell {
    padding-top: 78px !important;
    padding-bottom: 60px;
  }

  /* Slidey content: smaller title, single line meta */
  .slidey-left {
    min-height: 64vh;
    padding: 0 5% 28px !important;
  }
  .slidey-title {
    font-size: clamp(28px, 7vw, 40px) !important;
    line-height: 1.05;
    margin-bottom: 12px !important;
  }
  .slidey-desc {
    font-size: 14px !important;
    line-height: 1.5;
    -webkit-line-clamp: 3;
  }
  .slidey-meta {
    gap: 10px !important;
    font-size: 12.5px !important;
    margin-bottom: 12px !important;
  }
  .slidey-content .hero-actions {
    margin-top: 16px !important;
    gap: 10px !important;
  }
  .slidey-content .hero-actions .btn {
    min-height: 44px;
    padding: 11px 20px !important;
    font-size: 14px !important;
    border-radius: 10px !important;
    flex: 1 1 auto;
    min-width: 130px;
    justify-content: center;
  }

  /* Up-Next list: thinner items, only 4 visible */
  .slidey-right {
    max-height: 280px;
  }
  .slidey-item-thumb {
    width: 44px !important;
    height: 60px !important;
  }
  .slidey-item-info h4 {
    font-size: 13px !important;
  }
  .slidey-item-info span {
    font-size: 11px !important;
  }

  /* Control strip → tighter with horizontal scroll */
  .control-strip {
    margin: -22px 4% 24px !important;
    padding: 12px !important;
    border-radius: var(--hp-radius-md) !important;
  }
  .home-filter-btn {
    padding: 10px 16px !important;
    font-size: 12.5px !important;
  }
  .control-hint {
    display: none;
  }

  /* Rails — show 2.4 cards by default, no rank overflow */
  .rail-section {
    padding: 0 4% !important;
    margin-bottom: 26px !important;
  }
  .rail-head {
    margin-bottom: 12px !important;
  }
  .rail-title {
    font-size: 18px !important;
    letter-spacing: 0.5px !important;
  }
  .rail-subtitle {
    font-size: 12.5px !important;
    line-height: 1.45;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .stream-rail,
  .movie-rail {
    gap: 10px !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .stream-rail .movie-card,
  .movies-row .movie-card {
    scroll-snap-align: start;
    min-width: 142px !important;
    max-width: 142px !important;
    width: 142px !important;
  }
  .stream-rail .rail-card {
    scroll-snap-align: start;
    display: flex;
    position: relative;
    width: auto !important;
    min-width: auto !important;
    max-width: none !important;
  }
  .stream-rail .rail-card:has(.trending-rank) {
    min-width: 192px !important;
    max-width: 192px !important;
    width: 192px !important;
  }
  .stream-rail .rail-card:has(.trending-rank) .movie-card {
    margin-left: 50px !important;
  }
  .stream-rail .card-thumbnail,
  .movies-row .card-thumbnail {
    height: 213px !important;
  }

  /* Spotlight + featured grid → 2 columns */
  .homepage-grid-section {
    padding: 0 4% 28px !important;
  }
  .movies-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .spotlight-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .spotlight-panel {
    padding: 18px 14px !important;
    border-radius: var(--hp-radius-md) !important;
  }

  /* Footer */
  .footer { padding: 36px 4% 24px !important; }
  .footer-grid { gap: 26px !important; }

  /* ── WATCH PAGE on phone ── */
  body.movie-details-page .details-bg {
    filter: blur(2px) brightness(0.18) !important;
  }
  body.movie-details-page .cinema-layout {
    padding: 18px 12px 48px !important;
    gap: 18px !important;
  }
  body.movie-details-page #videoContainer.player-shell {
    padding: 8px !important;
    border-radius: 14px !important;
  }
  body.movie-details-page .player-topbar {
    margin-bottom: 8px !important;
    gap: 8px !important;
  }
  body.movie-details-page .player-status {
    font-size: 12px !important;
  }
  body.movie-details-page .player-viewport {
    border-radius: 10px !important;
  }
  /* Engagement bar below player on mobile */
  body.movie-details-page .video-section > div[style*="max-width:980px"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
  body.movie-details-page #shareUnlockWrap {
    width: 100%;
    justify-content: center;
  }
  body.movie-details-page .rating-wrapper {
    width: 100%;
    justify-content: space-between;
  }
  body.movie-details-page #shortcutsBtn {
    display: none !important;
  }
  /* Title block */
  body.movie-details-page .details-info {
    margin-top: 18px !important;
  }
  body.movie-details-page .details-title {
    font-size: clamp(22px, 6vw, 32px) !important;
    line-height: 1.15 !important;
    margin-bottom: 10px !important;
    letter-spacing: 0.5px !important;
  }
  body.movie-details-page .details-meta {
    flex-wrap: wrap;
    gap: 8px !important;
    font-size: 12.5px !important;
  }
  body.movie-details-page .details-meta .separator {
    display: none;
  }
  body.movie-details-page .details-genres {
    gap: 6px !important;
    margin-bottom: 16px !important;
  }
  body.movie-details-page .genre-tag {
    padding: 4px 12px !important;
    font-size: 11px !important;
  }
  body.movie-details-page #movieDesc {
    font-size: 14px !important;
    line-height: 1.65 !important;
    margin-bottom: 18px !important;
  }
  body.movie-details-page .details-actions {
    gap: 8px !important;
  }
  body.movie-details-page .details-actions .btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    padding: 11px 14px !important;
    font-size: 13px !important;
  }
  body.movie-details-page .details-actions .btn-primary {
    flex-basis: 100%;
  }
  /* Details table → single column */
  body.movie-details-page .details-table {
    grid-template-columns: 1fr 1fr !important;
    gap: 14px !important;
    padding: 18px !important;
    border-radius: var(--hp-radius-md) !important;
  }
  body.movie-details-page .details-section {
    padding: 24px 0 0 !important;
  }
  /* Episodes grid */
  body.movie-details-page .episodes-section,
  body.movie-details-page .server-switcher {
    padding: 16px !important;
    border-radius: var(--hp-radius-md) !important;
  }
  body.movie-details-page .episodes-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  body.movie-details-page .episode-card {
    padding: 10px !important;
    gap: 12px !important;
  }
  body.movie-details-page .ep-card-thumb {
    width: 110px !important;
    height: 62px !important;
  }
  /* Recommendations */
  body.movie-details-page .recommendations-section {
    padding: 0 12px 36px !important;
  }
  body.movie-details-page .rec-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
  }
  body.movie-details-page .rec-card-info {
    padding: 8px !important;
  }
  body.movie-details-page .rec-card-title {
    font-size: 11.5px !important;
  }
  /* Comments */
  body.movie-details-page .comments-section {
    padding: 0 12px 48px !important;
  }
  body.movie-details-page .comment-form-box {
    padding: 16px !important;
    border-radius: var(--hp-radius-md) !important;
  }
  body.movie-details-page .comment-textarea {
    font-size: 14px !important;
    min-height: 90px !important;
  }
  body.movie-details-page .comment-form-footer {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
  body.movie-details-page .comment-form-footer .btn {
    width: 100%;
    justify-content: center;
  }
  body.movie-details-page .comment-item {
    padding: 16px !important;
    border-radius: var(--hp-radius-md) !important;
  }
}

/* === Small phone (≤480px): even tighter === */
@media (max-width: 480px) {
  .home-filter-btn {
    padding: 9px 14px !important;
    font-size: 12px !important;
  }
  .stream-rail .movie-card,
  .movies-row .movie-card {
    min-width: 132px !important;
    max-width: 132px !important;
    width: 132px !important;
  }
  .stream-rail .rail-card {
    width: auto !important;
    min-width: auto !important;
    max-width: none !important;
  }
  .stream-rail .rail-card:has(.trending-rank) {
    min-width: 177px !important;
    max-width: 177px !important;
    width: 177px !important;
  }
  .stream-rail .rail-card:has(.trending-rank) .movie-card {
    margin-left: 45px !important;
  }
  .stream-rail .rail-card:has(.trending-rank) .trending-rank {
    font-size: 95px !important;
    left: -12px !important;
    bottom: -12px !important;
    -webkit-text-stroke: 2px rgba(255, 255, 255, 0.35) !important;
  }
  .stream-rail .card-thumbnail,
  .movies-row .card-thumbnail {
    height: 198px !important;
  }
  body.movie-details-page .rec-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  /* Slidey actions stack into full-width primary + secondary */
  .slidey-content .hero-actions .btn {
    flex-basis: 100%;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   8. ANIMATIONS — used across components
   ────────────────────────────────────────────────────────────────────────── */
@keyframes hp-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes hp-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Cards lazy-fade in as rails render */
.stream-rail .movie-card,
.movies-grid .movie-card,
.spotlight-grid .movie-card {
  animation: hp-fade-up 0.6s var(--hp-ease) both;
}

/* Reduced-motion respect */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   9. iOS Safari safe-area + tap polish
   ────────────────────────────────────────────────────────────────────────── */
@supports (padding: env(safe-area-inset-bottom)) {
  .footer { padding-bottom: calc(24px + env(safe-area-inset-bottom)) !important; }
  .hp-drawer { padding-bottom: env(safe-area-inset-bottom); }
}

button,
a,
.movie-card,
.episode-card,
.home-filter-btn,
.hp-quick-chip {
  -webkit-tap-highlight-color: transparent;
}
