/* =============================================
   CineNex V2 — Design System
   Colors: CineNex palette | Architecture: Free Movies
============================================= */

:root {
  --bg:     #000000;
  --bg2:    #080808;
  --bg3:    #101010;
  --card:   #13131c;
  --card2:  #1a1a26;
  --red:    #E50914;
  --red2:   #ff2233;
  --red3:   rgba(229,9,20,.12);
  --gold:   #f5c842;
  --blue:   #3B82F6;
  --green:  #22c55e;
  --border:  rgba(255,255,255,.06);
  --border2: rgba(255,255,255,.12);
  --txt:    #eeeae4;
  --muted:  #5c596e;
  --muted2: #282633;
  --display:'Bebas Neue', sans-serif;
  --body:   'Outfit', sans-serif;
  --mono:   'Space Mono', monospace;
  --radius: 12px;
  --nav-h:  64px;
  --max-w:  1400px;
  --trans:  .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--body);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, select, input { font-family: var(--body); border: none; outline: none; background: none; color: inherit; }
img { display: block; }
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-thumb { background: var(--red); border-radius: 2px; }

/* ============================================
   SCROLL PROGRESS
============================================ */
#scroll-prog {
  position: fixed; top: 0; left: 0; height: 2px;
  background: linear-gradient(90deg, var(--red), var(--gold));
  z-index: 10000; width: 0; transition: width .1s linear;
  pointer-events: none;
}

/* ============================================
   LOADING SCREEN
============================================ */
.loading-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 24px; z-index: 9999;
  transition: opacity .4s ease;
}
.loading-screen.hidden { opacity: 0; pointer-events: none; }
.loader-logo { animation: logoPulse 1.4s ease-in-out infinite; }
@keyframes logoPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.08)} }
.loader-bar {
  width: 160px; height: 3px;
  background: var(--muted2); border-radius: 2px; overflow: hidden;
}
.loader-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--red), var(--gold));
  border-radius: 2px;
  animation: loaderFill 1.2s ease-in-out infinite;
}
@keyframes loaderFill { 0%{width:0;margin-left:0} 50%{width:100%;margin-left:0} 100%{width:0;margin-left:100%} }

/* ============================================
   VIEWS
============================================ */
.view { display: none; }
.view.active { display: block; }

/* Detail views need relative positioning so backdrop is scoped inside */
#view-movie, #view-tv { position: relative; }

/* ============================================
   NAV — tighter logo-to-corner layout
============================================ */
#nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h); z-index: 1000;
  background: transparent;
  transition: background .3s ease, box-shadow .3s ease;
}
#nav.scrolled {
  background: rgba(0,0,0,.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--border);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  display: flex; align-items: center;
  padding: 0 20px;
  gap: 0;
}
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--display);
  font-size: 26px; letter-spacing: 3px;
  color: #fff; flex-shrink: 0;
  margin-right: 24px;
}
.nav-logo svg { flex-shrink: 0; }
.nav-links {
  display: flex; align-items: center; gap: 2px;
  list-style: none; flex: 1;
}
.nav-links a {
  padding: 7px 12px;
  font-size: 13.5px; font-weight: 500;
  color: rgba(255,255,255,.55);
  border-radius: 7px;
  transition: color var(--trans), background var(--trans);
  white-space: nowrap;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-links a.active { color: #fff; }
.nav-links a.anime-link { color: var(--gold); }
.nav-links a.anime-link:hover { background: rgba(245,200,66,.08); color: var(--gold); }
.nav-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-icon-btn {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.55); cursor: pointer;
  transition: color var(--trans), background var(--trans);
  position: relative;
}
.nav-icon-btn:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-icon-btn svg { width: 18px; height: 18px; }
.nav-mobile-toggle { display: none; }
.nav-watchlist-count {
  position: absolute; top: 2px; right: 2px;
  background: var(--red); color: #fff;
  font-size: 9px; font-weight: 700; font-family: var(--mono);
  border-radius: 10px; min-width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

/* Mobile menu */
.nav-mobile-menu {
  display: none; position: fixed;
  top: var(--nav-h); left: 0; right: 0;
  background: rgba(0,0,0,.97);
  backdrop-filter: blur(20px);
  padding: 12px 20px 20px;
  border-bottom: 1px solid var(--border);
  z-index: 999;
  flex-direction: column; gap: 2px;
}
.nav-mobile-menu.open { display: flex; }
.nav-mobile-menu a {
  padding: 11px 14px;
  font-size: 15px; font-weight: 500;
  color: rgba(255,255,255,.7);
  border-radius: 8px;
  transition: color var(--trans), background var(--trans);
}
.nav-mobile-menu a:hover, .nav-mobile-menu a.active { color: #fff; background: rgba(255,255,255,.06); }

/* ============================================
   SITE BANNER
============================================ */
.site-banner {
  position: relative; z-index: 100;
  background: rgba(229,9,20,.1);
  border-bottom: 1px solid rgba(229,9,20,.2);
  padding: 9px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin-top: var(--nav-h);
}
.site-banner.hidden { display: none; }
.site-banner-inner {
  display: flex; align-items: center; gap: 10px;
  flex: 1; font-size: 13px; flex-wrap: wrap;
}
.site-banner-icon { color: var(--red); }
.site-banner-text strong { color: var(--red); }
.site-banner-cta {
  background: var(--red); color: #fff;
  padding: 4px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
  white-space: nowrap;
  transition: background var(--trans);
}
.site-banner-cta:hover { background: var(--red2); }
.site-banner-close {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; cursor: pointer;
  color: rgba(255,255,255,.4); font-size: 14px;
  transition: color var(--trans), background var(--trans);
  flex-shrink: 0; background: none; border: none;
}
.site-banner-close:hover { color: #fff; background: rgba(255,255,255,.08); }

/* ============================================
   HERO
============================================ */
.hero {
  position: relative;
  width: 100%;
  height: 85vh; min-height: 520px; max-height: 860px;
  display: flex; align-items: flex-end;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center top;
  transition: opacity .8s ease;
}
.hero-bg.loading { opacity: 0; }
.hero-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(0,0,0,.95) 0%, rgba(0,0,0,.6) 50%, rgba(0,0,0,.1) 100%),
    linear-gradient(to top, rgba(0,0,0,1) 0%, transparent 45%);
}
.hero-content {
  position: relative; z-index: 2;
  padding: 0 32px 56px;
  max-width: 680px; width: 100%;
}

/* Skeletons */
.hero-skeleton { display: flex; flex-direction: column; gap: 12px; }
.skel {
  background: var(--card2);
  border-radius: 8px;
  animation: skelPulse 1.6s ease-in-out infinite;
}
@keyframes skelPulse { 0%,100%{opacity:.4} 50%{opacity:.8} }
.skel-badge  { width: 120px; height: 26px; border-radius: 20px; }
.skel-title  { width: 80%;  height: 64px; border-radius: 8px; }
.skel-meta   { width: 50%;  height: 16px; }
.skel-desc   { width: 100%; height: 52px; margin-top: 4px; }
.skel-btns   { width: 260px; height: 48px; margin-top: 8px; }

/* Hero content */
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--red3); border: 1px solid rgba(229,9,20,.3);
  border-radius: 20px; padding: 5px 14px;
  font-size: 11px; font-weight: 600; color: var(--red);
  font-family: var(--mono); letter-spacing: .06em;
  margin-bottom: 14px; animation: fadeUp .5s ease both;
}
.hero-title {
  font-family: var(--display);
  font-size: clamp(32px, 5.5vw, 84px);
  line-height: .93; letter-spacing: 1px;
  color: #fff; margin-bottom: 10px;
  text-shadow: 0 2px 40px rgba(0,0,0,.5);
  animation: fadeUp .5s .08s ease both;
}
.hero-meta {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px; flex-wrap: wrap;
  animation: fadeUp .5s .14s ease both;
}
.hero-meta-item { font-size: 13px; color: rgba(255,255,255,.5); }
.hero-meta-item.rating { color: var(--gold); font-weight: 600; font-family: var(--mono); }
.hero-meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }
.hero-desc {
  font-size: 14px; line-height: 1.65;
  color: rgba(255,255,255,.5); margin-bottom: 24px; max-width: 520px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  animation: fadeUp .5s .18s ease both;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; animation: fadeUp .5s .22s ease both; }
.btn-watch {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: var(--radius);
  background: var(--red); color: #fff;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: all var(--trans);
  box-shadow: 0 8px 28px rgba(229,9,20,.35);
}
.btn-watch:hover { background: var(--red2); transform: translateY(-2px); box-shadow: 0 12px 36px rgba(229,9,20,.5); }
.btn-watch svg { flex-shrink: 0; }
.btn-info {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 22px; border-radius: var(--radius);
  background: rgba(255,255,255,.1); color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: all var(--trans); backdrop-filter: blur(8px);
}
.btn-info:hover { background: rgba(255,255,255,.18); transform: translateY(-2px); }
.btn-4k {
  display: flex; align-items: center; gap: 6px;
  padding: 13px 18px; border-radius: var(--radius);
  background: rgba(245,200,66,.08); border: 1px solid rgba(245,200,66,.3);
  color: var(--gold); font-size: 13px; font-weight: 700; font-family: var(--mono);
}
.hero-dots {
  position: absolute; bottom: 24px; right: 40px;
  display: flex; gap: 6px; z-index: 3;
}
.hero-dot {
  width: 6px; height: 6px; border-radius: 3px;
  background: rgba(255,255,255,.2); cursor: pointer;
  transition: width .3s ease, background .3s ease;
  position: relative; overflow: hidden; flex-shrink: 0;
}
.hero-dot.active { width: 48px; background: rgba(255,255,255,.15); }
.hero-dot.active::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--red); border-radius: 3px;
  animation: dotProg 7s linear forwards;
}
@keyframes dotProg { from{width:0%} to{width:100%} }
.hero-scroll-hint {
  position: absolute; bottom: 28px; left: 50%;
  transform: translateX(-50%); z-index: 2;
  color: rgba(255,255,255,.2); cursor: pointer;
  animation: arrowBounce 2s ease-in-out infinite;
}
@keyframes arrowBounce { 0%,100%{transform:translateX(-50%) translateY(0)} 50%{transform:translateX(-50%) translateY(8px)} }
@keyframes fadeUp { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }

/* ============================================
   HOME MAIN
============================================ */
.home-main { padding: 8px 0 80px; background: var(--bg); }

/* ============================================
   SECTION ROW — with cosmot emoji icons
============================================ */
.section-row { margin-bottom: 40px; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; margin-bottom: 14px;
}
.section-title {
  font-family: var(--display);
  font-size: 21px; letter-spacing: 1.5px;
  color: #fff; display: flex; align-items: center; gap: 10px;
}
/* Cosmot emoji pill — the icon badge on each section */
.s-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 9px;
  font-size: 15px;
  font-family: 'Apple Color Emoji','Segoe UI Emoji','Noto Color Emoji',sans-serif;
  flex-shrink: 0;
  line-height: 1;
}
.section-see-all {
  font-size: 12px; color: var(--muted); font-weight: 500;
  cursor: pointer; background: none; border: none;
  font-family: var(--body); transition: color var(--trans);
  white-space: nowrap; text-decoration: none; display: inline-block;
}
.section-see-all:hover { color: var(--red); }

.row-scroll {
  display: flex; gap: 12px;
  overflow-x: auto; overflow-y: visible;
  padding: 6px 32px 12px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  align-items: flex-start;
}
.row-scroll::-webkit-scrollbar { display: none; }

/* ============================================
   MOVIE / POSTER CARD (row)
============================================ */
.movie-card {
  flex-shrink: 0;
  width: 154px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform .25s ease, box-shadow .25s ease;
  position: relative;
  display: block;
  text-decoration: none;
}
.movie-card:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 20px 48px rgba(0,0,0,.8); z-index: 4; }
.movie-card img {
  width: 154px; height: 230px;
  object-fit: cover; object-position: center;
  background: var(--card2);
  display: block;
}
.card-overlay {
  position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(to top, rgba(0,0,0,.96) 0%, rgba(0,0,0,.5) 42%, transparent 68%);
  opacity: 0; transition: opacity .25s ease;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 12px; border-radius: var(--radius);
}
.movie-card:hover .card-overlay { opacity: 1; }
.card-play {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--red); color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
  box-shadow: 0 4px 24px rgba(229,9,20,.6);
  transform: scale(.75); opacity: 0;
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), opacity .2s;
}
.movie-card:hover .card-play { transform: scale(1); opacity: 1; }
.card-title {
  font-size: 12px; font-weight: 700; line-height: 1.3;
  margin-bottom: 3px; color: #fff;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transform: translateY(5px); opacity: 0; transition: all .2s ease .05s;
}
.card-meta {
  font-size: 10px; color: rgba(255,255,255,.55);
  transform: translateY(5px); opacity: 0; transition: all .2s ease .1s;
}
.movie-card:hover .card-title,
.movie-card:hover .card-meta { transform: translateY(0); opacity: 1; }
.card-rating {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  background: rgba(0,0,0,.82); backdrop-filter: blur(8px);
  border: 1px solid rgba(229,9,20,.25);
  border-radius: 6px; padding: 3px 7px;
  font-size: 10px; font-weight: 700; color: var(--gold);
  font-family: var(--mono);
}
.card-type-badge {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  background: rgba(0,0,0,.72);
  border-radius: 4px; padding: 2px 6px;
  font-size: 9px; font-weight: 600; color: rgba(255,255,255,.65);
  font-family: var(--mono); letter-spacing: .04em;
}
.card-bookmark {
  position: absolute; bottom: 8px; right: 8px; z-index: 4;
  width: 30px; height: 30px; border-radius: 6px;
  background: rgba(0,0,0,.72); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; transition: opacity .2s, background var(--trans);
}
.card-bookmark.saved { background: var(--red3); border-color: rgba(229,9,20,.3); }
.card-bookmark svg { width: 14px; height: 14px; color: #fff; }
.card-bookmark.saved svg { color: var(--red); fill: var(--red); }
.movie-card:hover .card-bookmark { opacity: 1; }

/* Skeleton card */
.skel-card {
  flex-shrink: 0; width: 154px; height: 230px;
  border-radius: var(--radius);
  background: var(--card); animation: skelPulse 1.6s ease-in-out infinite;
}

/* Continue watching card */
.continue-card {
  flex-shrink: 0; width: 240px;
  border-radius: var(--radius); overflow: hidden;
  background: var(--card); cursor: pointer; position: relative;
  transition: transform .25s ease; display: block;
  text-decoration: none;
}
.continue-card:hover { transform: translateY(-4px); }
.continue-thumb { width: 240px; height: 136px; object-fit: cover; background: var(--card2); }
.continue-bar-wrap {
  position: absolute; bottom: 52px; left: 0; right: 0;
  padding: 0 10px;
}
.continue-bar-bg { height: 3px; background: rgba(255,255,255,.15); border-radius: 2px; overflow: hidden; }
.continue-bar-fill { height: 100%; background: var(--red); border-radius: 2px; }
.continue-info { padding: 10px 12px 12px; }
.continue-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; }
.continue-sub { font-size: 11px; color: var(--muted); }
.continue-play {
  position: absolute; top: 38px; left: 50%; transform: translateX(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(229,9,20,.85); display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s;
}
.continue-card:hover .continue-play { opacity: 1; }

/* ============================================
   POSTER GRID (search / genre / watchlist)
============================================ */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
  gap: 16px;
}
.poster-grid .movie-card { width: 100%; }
.poster-grid .movie-card img { width: 100%; height: auto; aspect-ratio: 2/3; object-fit: cover; }
.poster-grid .skel-card { width: 100%; height: auto; aspect-ratio: 2/3; }

/* ============================================
   DETAIL PAGE — FIX: absolute backdrop, not fixed
============================================ */
.detail-backdrop {
  /* FIXED BUG: was position:fixed which bled through player */
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 540px;
  background-size: cover; background-position: center top;
  z-index: 0;
}
.detail-backdrop-overlay {
  /* FIXED BUG: was position:fixed */
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 540px; z-index: 1;
  background:
    linear-gradient(to right, rgba(0,0,0,.92) 0%, rgba(0,0,0,.55) 55%, rgba(0,0,0,.15) 100%),
    linear-gradient(to bottom, rgba(0,0,0,.25) 0%, var(--bg) 95%);
}

/* Back button — always visible above backdrop */
.detail-back {
  position: relative; z-index: 5;
  padding: calc(var(--nav-h) + 16px) 0 0 28px;
}
.back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,.8);
  transition: all var(--trans);
  padding: 7px 14px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(12px);
  cursor: pointer;
}
.back-btn:hover { color: #fff; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); transform: translateX(-2px); }
.back-btn svg { width: 15px; height: 15px; }

/* Detail container */
.detail-container {
  position: relative; z-index: 2;
  max-width: var(--max-w);
  margin: 0 auto; padding: 12px 28px 28px;
}
.detail-hero {
  display: flex; gap: 28px; align-items: flex-start;
}
.detail-poster {
  width: 188px; min-width: 188px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 24px 60px rgba(0,0,0,.9);
  border: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.detail-info { flex: 1; min-width: 0; }
.detail-genres {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 12px;
}
.detail-genre-tag {
  background: var(--muted2); border: 1px solid var(--border2);
  padding: 4px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 500;
  color: rgba(255,255,255,.65);
}
.detail-title {
  font-family: var(--display);
  font-size: clamp(26px, 4vw, 62px);
  line-height: .95; letter-spacing: 1px;
  margin-bottom: 12px; color: #fff;
}
.detail-meta {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 14px;
}
.detail-meta-item { font-size: 13px; color: rgba(255,255,255,.5); }
.detail-meta-item.rating { color: var(--gold); font-weight: 600; font-family: var(--mono); }
.detail-meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.detail-overview {
  font-size: 14px; line-height: 1.7;
  color: rgba(255,255,255,.55); margin-bottom: 22px;
  max-width: 620px;
}
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================
   BUTTONS
============================================ */
.btn-red {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--radius);
  background: var(--red); color: #fff;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: all var(--trans);
  box-shadow: 0 6px 24px rgba(229,9,20,.3);
  border: none; text-decoration: none;
}
.btn-red:hover { background: var(--red2); transform: translateY(-2px); box-shadow: 0 10px 32px rgba(229,9,20,.45); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--radius);
  background: rgba(255,255,255,.07); color: #fff;
  border: 1px solid var(--border2);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all var(--trans);
}
.btn-ghost:hover { background: rgba(255,255,255,.13); transform: translateY(-2px); }
.btn-ghost.bookmarked { background: var(--red3); border-color: rgba(229,9,20,.35); color: var(--red); }
.btn-ghost svg { width: 15px; height: 15px; }

/* ============================================
   PLAYER — solid bg so no backdrop bleed
============================================ */
.player-section {
  /* FIXED BUG: added solid bg so backdrop doesn't show through */
  background: var(--bg);
  position: relative; z-index: 2;
  padding: 20px 0 16px;
}
.player-section .container { max-width: var(--max-w); margin: 0 auto; padding: 0 28px; }
.player-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 14px;
}
.player-title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--display); font-size: 19px;
  letter-spacing: 1px; color: #fff;
}
.player-title svg { color: var(--red); flex-shrink: 0; }
.server-selector-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.auto-badge {
  background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.25);
  color: var(--green); font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px; font-family: var(--mono);
  white-space: nowrap;
}
.server-selector { display: flex; gap: 5px; flex-wrap: wrap; }
.server-btn {
  padding: 6px 13px; border-radius: 8px;
  font-size: 12px; font-weight: 600;
  background: var(--card2); border: 1px solid var(--border);
  color: var(--muted); cursor: pointer;
  transition: all var(--trans); font-family: var(--mono);
}
.server-btn:hover { border-color: var(--border2); color: var(--txt); }
.server-btn.active {
  background: var(--red3); border-color: rgba(229,9,20,.4);
  color: var(--red);
}
.player-wrap {
  width: 100%; aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius);
  /* overflow:hidden removed — clips Videasy overlays & blocks fake-fullscreen */
  position: relative;
  border: 1px solid var(--border);
  box-shadow: 0 20px 56px rgba(0,0,0,.8);
}
/* Fullscreen hover button */
.player-fs-btn {
  position: absolute; top: 10px; right: 10px; z-index: 20;
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(0,0,0,.7); border: 1px solid rgba(255,255,255,.18);
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s, background .15s;
  pointer-events: none;
}
.player-wrap:hover .player-fs-btn { opacity: 1; pointer-events: auto; }
.player-fs-btn:hover { background: var(--red); border-color: transparent; }
.player-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; background: var(--bg2);
}
.play-trigger {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--red); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 32px rgba(229,9,20,.55);
  transition: transform var(--trans), box-shadow var(--trans);
  border: none;
}
.play-trigger:hover { transform: scale(1.1); box-shadow: 0 12px 40px rgba(229,9,20,.75); }
.player-placeholder p { font-size: 13px; color: var(--muted); }
.player-iframe { width: 100%; height: 100%; border: none; }
.ad-notice {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; padding: 9px 14px; border-radius: 10px;
  background: rgba(255,255,255,.02); border: 1px solid var(--border);
  font-size: 12px; color: var(--muted);
}
.ad-notice svg { flex-shrink: 0; color: var(--gold); }
.ad-notice strong { color: rgba(255,255,255,.45); }

/* ── Adsterra Ad Units ──────────────────────────────────────────────────────── */

/* Native Banner — between home content rows */
.ad-native-wrap {
  padding: 0 28px 8px;
  margin: 4px 0 12px;
}
.ad-native-wrap > div { width: 100%; }

/* Display Banners — 300×250 and 320×50 */
.ad-display-wrap {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 20px 0 12px;
  gap: 6px;
  background: rgba(255,255,255,.015);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.ad-display-label {
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); font-family: var(--mono); opacity: .45;
}
.ad-display-wrap iframe { display: block; border: none; max-width: 100%; }

/* ── ExoClick VAST In-Stream Video Ad ────────────────────────────────────── */
.ad-vast-wrap {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 20px 0 16px;
  gap: 8px;
  background: rgba(255,255,255,.015);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.ad-vast-video-box {
  position: relative;
  width: 100%; max-width: 640px;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
}
.ad-vast-video { width: 100%; height: 100%; object-fit: contain; display: block; cursor: pointer; }
.ad-vast-skip {
  position: absolute; bottom: 10px; right: 10px;
  padding: 6px 12px;
  font-size: 12px; font-family: var(--mono);
  background: rgba(0,0,0,.7); color: #fff;
  border: 1px solid rgba(255,255,255,.25); border-radius: 4px;
  cursor: pointer;
}
.ad-vast-skip:disabled { opacity: .5; cursor: default; }
.ad-vast-skip:not(:disabled):hover { background: rgba(0,0,0,.9); }

/* Sections below player — solid bg */
#castSection-movie, #castSection-tv,
#recsSection-movie, #recsSection-tv {
  background: var(--bg);
  position: relative; z-index: 2;
}

/* ============================================
   EPISODE SELECTOR — solid bg
============================================ */
.episode-section-container {
  background: var(--bg);
  position: relative; z-index: 2;
  padding: 0 28px;
}
.episode-section {
  margin: 0 0 28px;
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden;
}
.episode-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 10px;
}
.ep-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--display); font-size: 17px; letter-spacing: 1px;
}
.season-wrap {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--muted);
}
.season-select {
  background: var(--card2); border: 1px solid var(--border2);
  padding: 6px 12px; border-radius: 8px;
  font-size: 13px; color: var(--txt); cursor: pointer;
}
.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1px; background: var(--border);
  max-height: 420px; overflow-y: auto;
}
.episode-grid::-webkit-scrollbar { width: 3px; }
.episode-card {
  background: var(--card);
  padding: 13px 15px; cursor: pointer;
  transition: background var(--trans);
  display: flex; flex-direction: column; gap: 4px;
}
.episode-card:hover { background: var(--card2); }
.episode-card.active {
  background: rgba(229,9,20,.08);
  border-left: 3px solid var(--red);
}
.ep-num { font-size: 10px; color: var(--muted); font-family: var(--mono); }
.ep-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.ep-air { font-size: 11px; color: var(--muted); }

/* ============================================
   CAST ROW — solid bg
============================================ */
.cast-section {
  margin: 0 0 28px;
  background: var(--bg);
}
.cast-grid {
  display: flex; gap: 12px;
  overflow-x: auto; padding-bottom: 8px;
  scrollbar-width: none;
}
.cast-grid::-webkit-scrollbar { display: none; }
.cast-card {
  flex-shrink: 0; width: 90px; text-align: center;
  cursor: pointer;
}
.cast-photo {
  width: 90px; height: 90px; border-radius: 50%;
  object-fit: cover; margin-bottom: 8px;
  border: 2px solid var(--border2);
  background: var(--card2);
  transition: border-color var(--trans), transform .2s ease;
}
.cast-card:hover .cast-photo { border-color: var(--red); transform: scale(1.04); }
.cast-name { font-size: 11px; font-weight: 600; line-height: 1.3; }
.cast-char { font-size: 10px; color: var(--muted); margin-top: 2px; }

/* ============================================
   SEARCH PAGE
============================================ */
.search-header { padding: 92px 0 20px; }
.search-bar-wrap {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 13px 18px;
  transition: border-color var(--trans), box-shadow var(--trans);
}
.search-bar-wrap:focus-within {
  border-color: rgba(229,9,20,.5);
  box-shadow: 0 0 0 3px rgba(229,9,20,.08);
}
.search-bar-wrap svg { color: var(--muted); flex-shrink: 0; }
.search-input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 16px; color: var(--txt);
}
.search-input::placeholder { color: var(--muted); }
.search-clear {
  cursor: pointer; color: var(--muted); font-size: 14px;
  transition: color var(--trans); background: none; border: none;
}
.search-clear:hover { color: var(--txt); }
.search-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 28px; align-items: start;
  padding-bottom: 80px;
}
.filters-sidebar {
  position: sticky; top: calc(var(--nav-h) + 12px);
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.filter-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--display); font-size: 15px; letter-spacing: 1px;
  margin-bottom: 16px;
}
.filter-group { margin-bottom: 14px; }
.filter-label {
  font-size: 10px; color: var(--muted); font-family: var(--mono);
  letter-spacing: .08em; display: block; margin-bottom: 6px;
  text-transform: uppercase;
}
.filter-select {
  width: 100%; background: var(--card2); border: 1px solid var(--border);
  padding: 8px 10px; border-radius: 8px;
  font-size: 13px; color: var(--txt); cursor: pointer;
  transition: border-color var(--trans);
}
.filter-select:focus { border-color: var(--border2); outline: none; }
.search-results { min-height: 400px; }
.results-title {
  font-family: var(--display); font-size: 20px; letter-spacing: 1.5px;
  margin-bottom: 18px; color: var(--txt);
}

/* ============================================
   GENRE PAGE
============================================ */
.genre-page-header { padding: 92px 0 18px; }
.genre-page-title {
  font-family: var(--display); font-size: 44px;
  letter-spacing: 2px; color: #fff;
}
.genre-pills {
  display: flex; flex-wrap: wrap; gap: 7px;
  margin-bottom: 4px;
}
.genre-pill {
  padding: 7px 16px; border-radius: 20px;
  background: var(--card2); border: 1px solid var(--border);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all var(--trans);
}
.genre-pill:hover { border-color: var(--border2); color: #fff; }
.genre-pill.active {
  background: var(--red3); border-color: rgba(229,9,20,.4);
  color: var(--red);
}

/* ============================================
   WATCHLIST PAGE
============================================ */
.watchlist-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 92px 0 22px; flex-wrap: wrap; gap: 12px;
}
.watchlist-title {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--display); font-size: 38px; letter-spacing: 2px;
}
.btn-clear {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 15px; border-radius: 8px;
  background: rgba(239,68,68,.07); border: 1px solid rgba(239,68,68,.18);
  color: rgba(252,165,165,.75); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all var(--trans);
}
.btn-clear:hover { background: rgba(239,68,68,.13); color: #fca5a5; }

/* Empty state */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; padding: 80px 20px; text-align: center;
}
.empty-state.hidden { display: none; }
.empty-state h3 { font-family: var(--display); font-size: 26px; letter-spacing: 1px; }
.empty-state p { font-size: 14px; color: var(--muted); max-width: 300px; }

/* ============================================
   PAGINATION
============================================ */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-top: 28px; padding-bottom: 40px;
}
.pag-btn {
  width: 38px; height: 38px; border-radius: 8px;
  background: var(--card); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--trans); color: var(--txt);
}
.pag-btn:hover:not(:disabled) { border-color: var(--border2); background: var(--card2); }
.pag-btn:disabled { opacity: .3; cursor: not-allowed; }
.pag-info { font-size: 12px; color: var(--muted); font-family: var(--mono); }

/* ============================================
   MODALS
============================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.85); backdrop-filter: blur(12px);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 16px;
  width: 100%; max-width: 500px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 40px 80px rgba(0,0,0,.8);
}
.modal-box.wide { max-width: 680px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.modal-head-title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--display); font-size: 19px; letter-spacing: 1px;
}
.modal-close {
  width: 30px; height: 30px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted); font-size: 15px;
  transition: all var(--trans); background: none; border: none;
}
.modal-close:hover { background: rgba(255,255,255,.08); color: #fff; }
.modal-body { padding: 22px; }
.modal-body label { display: block; font-size: 11px; color: var(--muted); font-family: var(--mono); letter-spacing: .08em; margin-bottom: 7px; text-transform: uppercase; }
.modal-input {
  width: 100%; background: var(--card2);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 13px; font-size: 14px; color: var(--txt);
  margin-bottom: 14px; transition: border-color var(--trans);
}
.modal-input:focus { border-color: var(--border2); outline: none; }
.settings-help { font-size: 12px; color: var(--muted); margin-bottom: 18px; }
.settings-help a { color: var(--red); }
.btn-save {
  width: 100%; padding: 12px;
  background: var(--red); color: #fff;
  border: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: background var(--trans);
}
.btn-save:hover { background: var(--red2); }

/* Legal */
.legal-body h4 { font-family: var(--display); font-size: 17px; letter-spacing: 1px; margin: 18px 0 7px; }
.legal-body h4:first-child { margin-top: 0; }
.legal-body p { font-size: 13px; color: rgba(255,255,255,.55); line-height: 1.7; margin-bottom: 10px; }
.legal-body a { color: var(--red); }
.legal-body ul { padding-left: 18px; margin-bottom: 10px; }
.legal-body li { font-size: 13px; color: rgba(255,255,255,.55); line-height: 1.7; }
.legal-updated { font-size: 11px; color: var(--muted); font-family: var(--mono); display: block; margin-top: 18px; }

/* API alert */
.api-alert {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--card2); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 13px 18px;
  display: flex; align-items: center; gap: 12px;
  z-index: 3000; box-shadow: 0 16px 40px rgba(0,0,0,.6);
  max-width: 460px; width: calc(100% - 40px);
  transition: opacity .3s ease, transform .3s ease;
}
.api-alert.hidden { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(10px); }
.api-alert svg { color: var(--gold); flex-shrink: 0; }
.api-alert-content h4 { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.api-alert-content p { font-size: 12px; color: var(--muted); }
.api-alert-close { margin-left: auto; cursor: pointer; color: var(--muted); background: none; border: none; font-size: 16px; padding: 4px; }

/* ============================================
   FOOTER
============================================ */
.footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 44px 0 28px;
  position: relative; z-index: 2;
}
.footer-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 28px; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 36px; margin-bottom: 36px;
}
.footer-logo {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--display); font-size: 22px;
  letter-spacing: 3px; margin-bottom: 10px; color: #fff;
  text-decoration: none;
}
.footer-about p { font-size: 13px; color: var(--muted); line-height: 1.7; max-width: 260px; }
.footer-col-title {
  font-size: 10px; color: var(--muted); font-family: var(--mono);
  letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px;
}
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.footer-links a {
  font-size: 13px; color: rgba(255,255,255,.35);
  transition: color var(--trans); cursor: pointer;
}
.footer-links a:hover { color: var(--txt); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 22px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.footer-bottom p { font-size: 11px; color: var(--muted); }

/* ============================================
   CONTAINER UTILITY
============================================ */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 28px; }

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .search-layout { grid-template-columns: 175px 1fr; gap: 20px; }
}

@media (max-width: 768px) {
  :root { --nav-h: 58px; }
  .nav-links { display: none; }
  .nav-mobile-toggle { display: flex !important; }
  .nav-inner { padding: 0 16px; }
  .nav-logo { font-size: 22px; margin-right: 12px; }

  .hero { height: 70vh; min-height: 440px; }
  .hero-content { padding: 0 18px 40px; }
  .hero-dots { right: 18px; bottom: 18px; }

  .section-header { padding: 0 18px; }
  .row-scroll { padding: 4px 18px 10px; }

  .detail-back { padding: calc(var(--nav-h) + 10px) 0 0 18px; }
  .detail-container { padding: 10px 18px 20px; }
  .detail-hero { flex-direction: column; gap: 18px; align-items: center; text-align: center; }
  .detail-poster { width: 150px; min-width: 150px; }
  .detail-genres { justify-content: center; }
  .detail-actions { justify-content: center; }
  .detail-backdrop { height: 380px; }
  .detail-backdrop-overlay { height: 380px; }

  .player-section .container { padding: 0 18px; }
  .episode-section-container { padding: 0 18px; }

  .search-layout { grid-template-columns: 1fr; }
  .filters-sidebar { position: static; }
  .search-header { padding: 76px 0 16px; }
  .genre-page-header { padding: 76px 0 14px; }
  .watchlist-header { padding: 76px 0 18px; }

  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .container { padding: 0 18px; }
  .poster-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
  .episode-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

@media (max-width: 480px) {
  .hero-title { font-size: clamp(24px, 9vw, 40px); }
  .poster-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; }
}

/* ============================================
   UTILITIES
============================================ */
.hidden { display: none !important; }

/* ============================================
   CUSTOM SECTION ICONS — CineNex brand icons
   Replaces unicode emojis with styled SVG badges
============================================ */
.s-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 7px;
  flex-shrink: 0; transition: transform .2s ease;
}
.section-title:hover .s-icon { transform: scale(1.08); }

/* Icon color variants */
.si-fire  { background: linear-gradient(135deg, #ff4500, #ff8c00); box-shadow: 0 2px 10px rgba(255,69,0,.4); }
.si-film  { background: linear-gradient(135deg, #E50914, #a00610); box-shadow: 0 2px 10px rgba(229,9,20,.4); }
.si-pop   { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 2px 10px rgba(245,158,11,.4); }
.si-top   { background: linear-gradient(135deg, #f5c842, #e09b00); box-shadow: 0 2px 10px rgba(245,200,66,.4); }
.si-tv    { background: linear-gradient(135deg, #3B82F6, #1d4ed8); box-shadow: 0 2px 10px rgba(59,130,246,.4); }
.si-crown { background: linear-gradient(135deg, #8b5cf6, #6d28d9); box-shadow: 0 2px 10px rgba(139,92,246,.4); }
.si-anime { background: linear-gradient(135deg, #ec4899, #8b5cf6); box-shadow: 0 2px 10px rgba(236,72,153,.4); }
.si-play  { background: linear-gradient(135deg, #E50914, #a00610); box-shadow: 0 2px 10px rgba(229,9,20,.35); }
.si-clock { background: linear-gradient(135deg, #334155, #1e293b); border: 1px solid rgba(255,255,255,.08); }
.si-cast  { background: linear-gradient(135deg, #0ea5e9, #0284c7); box-shadow: 0 2px 10px rgba(14,165,233,.35); }
.si-like  { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 2px 10px rgba(16,185,129,.35); }
