:root {
  --bg: #05070f;
  --bg2: #080c18;
  --surface: rgba(10, 16, 30, 0.95);
  --surface2: rgba(15, 22, 42, 0.97);
  --accent: #3b82f6;
  --accent2: #60a5fa;
  --gold: #f59e0b;
  --text: #eef4ff;
  --muted: #7a96c4;
  --muted2: #3f5880;
  --border: rgba(59, 130, 246, 0.14);
  --border2: rgba(59, 130, 246, 0.32);
  --red: #ef4444;
  --green: #22c55e;
  --r: 14px;
  --r2: 20px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent; /* remove tap flash on mobile */
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "DM Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh; /* dynamic viewport height — fixes mobile browser bar */
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;          /* prevent iOS font inflation */
  -webkit-text-size-adjust: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse 70% 60% at 5% 0%,
      rgba(59, 130, 246, 0.08),
      transparent 65%),
    radial-gradient(ellipse 50% 50% at 95% 100%,
      rgba(37, 99, 235, 0.06),
      transparent 65%);
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: #080c18;
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

/* ── LOADER ── */
#pageLoader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  opacity: 1;
  transition: opacity 0.5s;
}

#pageLoader.out {
  opacity: 0;
  pointer-events: none;
}

.ld-logo {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  animation: ldPulse 1.1s ease-in-out infinite;
}

@keyframes ldPulse {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
  }

  50% {
    box-shadow: 0 0 50px rgba(59, 130, 246, 0.95);
  }
}

.ld-bar {
  width: 180px;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.ld-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  animation: ldLoad 1.2s ease-in-out infinite;
}

@keyframes ldLoad {
  0% {
    width: 0;
    margin-left: 0;
  }

  50% {
    width: 80%;
    margin-left: 0;
  }

  100% {
    width: 0;
    margin-left: 100%;
  }
}

/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  z-index: 600;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  padding-left: max(36px, env(safe-area-inset-left));
  padding-right: max(36px, env(safe-area-inset-right));
  background: rgba(5, 7, 15, 0.97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  will-change: transform;
  transition: background 0.3s;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
}

.nav-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 0 18px rgba(59, 130, 246, 0.45);
}

.nav-name {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  background: linear-gradient(130deg, #fff 40%, var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  gap: 6px;
  list-style: none;
}

.nav-links li a,
.nav-tab {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  background: none;
  padding: 7px 14px;
  border-radius: 100px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.nav-links li a:hover,
.nav-tab:hover,
.nav-links li a.active,
.nav-tab.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-search-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s;
  flex-shrink: 0;
}

.nav-search-btn:hover {
  border-color: var(--border2);
  color: var(--text);
}

.nav-cta {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 8px 18px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
  text-decoration: none;
}

.nav-cta:hover {
  background: var(--accent2);
  transform: translateY(-1px);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 10px;           /* larger touch target — 44px total with spans */
  background: none;
  border: none;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

.hamburger span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s;
  display: block;
}

/* ── MOBILE MENU ── */
#mobileMenu {
  position: fixed;
  inset: 0;
  z-index: 590;
  background: rgba(5, 7, 15, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  padding-bottom: env(safe-area-inset-bottom); /* notch/home-bar clearance */
  overflow-y: auto;
}

#mobileMenu.open {
  opacity: 1;
  pointer-events: all;
}

#mobileMenu a,
#mobileMenu button {
  font-family: "Syne", sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--muted);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: 0.2s;
}

#mobileMenu a:hover,
#mobileMenu button:hover {
  color: var(--text);
}

/* ── PAGES (if needed for SPA, not used in multi-page) ── */
/* ── HERO ── */
.hero {
  position: relative;
  z-index: 2;
  min-height: 91vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#heroBg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.24) saturate(1.3);
  transform: scale(1.05);
  transition: background-image 1.2s ease, transform 8s ease;
}

.hero:hover #heroBg {
  transform: scale(1.08);
}

.hero-over {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
      rgba(5, 7, 15, 0.25) 0%,
      rgba(5, 7, 15, 0.75) 65%,
      var(--bg) 100%);
}

.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 0 24px;
  max-width: 840px;
  animation: heroIn 0.9s cubic-bezier(0.2, 0.9, 0.4, 1) both;
}

@keyframes heroIn {
  from {
    opacity: 0;
    transform: translateY(28px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 100px;
  padding: 6px 18px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #93c5fd;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 26px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: bPulse 2s infinite;
}

@keyframes bPulse {

  0%,
  100% {
    opacity: 0.5;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.hero h1 {
  font-family: "Syne", sans-serif;
  font-size: clamp(2.4rem, 5.5vw, 4.6rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.grad {
  background: linear-gradient(120deg, #fff 20%, var(--accent2) 58%, #7aa2ff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 5s linear infinite;
}

@keyframes shimmer {
  0% {
    background-position: 0%;
  }

  100% {
    background-position: 200%;
  }
}

.hero-sub {
  font-size: 1rem;
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto 30px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

.btn-pri {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(120deg, var(--accent), #2563eb);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 13px 28px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.25s;
  box-shadow: 0 8px 24px -4px rgba(59, 130, 246, 0.5);
  text-decoration: none;
}

.btn-pri:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px -4px rgba(59, 130, 246, 0.7);
}

.btn-out {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 100px;
  padding: 12px 26px;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.25s;
}

.btn-out:hover {
  border-color: var(--accent2);
  background: rgba(59, 130, 246, 0.1);
}

.hero-stats {
  display: flex;
  gap: 28px;
  justify-content: center;
  flex-wrap: wrap;
}

.h-stat .n {
  font-family: "Syne", sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
}

.h-stat .l {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted2);
}

.scroll-hint {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--muted2);
  font-size: 0.68rem;
  animation: bob 2.2s ease-in-out infinite;
}

@keyframes bob {

  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(7px);
  }
}

/* ── LAYOUT ── */
.container {
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 32px;
}

section {
  position: relative;
  z-index: 2;
  padding: 50px 0;
}

.sec-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}

.sec-title {
  font-family: "Syne", sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sec-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

.see-all {
  color: var(--accent2);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  transition: 0.2s;
}

.see-all:hover {
  color: #fff;
}

/* ── SLIDERS ── */
.slider-wrap {
  position: relative;
  overflow: hidden;
}

.slider {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;  /* momentum scroll on iOS */
  touch-action: pan-x;               /* prevent accidental page scroll */
  overscroll-behavior-x: contain;    /* don't trigger back/forward nav */
}

.slider::-webkit-scrollbar {
  display: none;
}

.sl-btn {
  position: absolute;
  top: 38%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: rgba(5, 7, 15, 0.9);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.sl-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.sl-btn.prev {
  left: -18px;
}

.sl-btn.next {
  right: -18px;
}

/* ── MOVIE CARD ── */
.mc {
  flex: 0 0 172px;
  scroll-snap-align: start;
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  background: var(--surface2);
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1);
  position: relative;
}

.mc:hover {
  transform: translateY(-8px) scale(1.03);
  border-color: var(--accent2);
  box-shadow: 0 22px 44px -8px rgba(59, 130, 246, 0.28);
}

.mc-poster {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
}

.mc-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
  display: block;
}

.mc:hover .mc-poster img {
  transform: scale(1.08);
}

.mc-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  opacity: 0;
  transition: all 0.3s;
}

.mc:hover .mc-play {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.mc-rating {
  position: absolute;
  top: 9px;
  right: 9px;
  background: rgba(5, 7, 15, 0.82);
  border-radius: 100px;
  padding: 3px 9px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold);
  backdrop-filter: blur(6px);
}

.mc-hot {
  position: absolute;
  top: 9px;
  left: 9px;
  background: linear-gradient(120deg, var(--red), #f97316);
  border-radius: 100px;
  padding: 2px 8px;
  font-size: 0.62rem;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mc-info {
  padding: 11px;
}

.mc-title {
  font-family: "Syne", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.mc-meta {
  font-size: 0.7rem;
  color: var(--muted);
}

/* ── SHIMMER ── */
.shim-card {
  flex: 0 0 172px;
  border-radius: var(--r);
  overflow: hidden;
}

.shim-poster {
  height: 258px;
}

.shim-info {
  padding: 11px;
}

.shim-title {
  height: 11px;
  border-radius: 6px;
  margin-bottom: 7px;
  width: 80%;
}

.shim-meta {
  height: 9px;
  border-radius: 6px;
  width: 50%;
}

.shim-poster,
.shim-title,
.shim-meta {
  background: linear-gradient(90deg,
      rgba(15, 22, 40, 1) 25%,
      rgba(35, 48, 72, 0.7) 50%,
      rgba(15, 22, 40, 1) 75%);
  background-size: 200% 100%;
  animation: shim 1.5s infinite;
}

@keyframes shim {
  0% {
    background-position: 200%;
  }

  100% {
    background-position: -200%;
  }
}

.shim-grid-card {
  border-radius: var(--r);
  overflow: hidden;
}

.shim-gp {
  aspect-ratio: 2/3;
}

.shim-gi {
  padding: 11px;
}

.shim-gp,
.shim-gi .shim-title,
.shim-gi .shim-meta {
  background: linear-gradient(90deg,
      rgba(15, 22, 40, 1) 25%,
      rgba(35, 48, 72, 0.7) 50%,
      rgba(15, 22, 40, 1) 75%);
  background-size: 200% 100%;
  animation: shim 1.5s infinite;
}

.shim-gp {
  display: block;
}

/* ── CAT TABS ── */
.cat-tabs {
  display: flex;
  gap: 9px;
  flex-wrap: nowrap;           /* keep on one line, scroll horizontally */
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  margin-bottom: 26px;
  padding-bottom: 4px;         /* small breathing room for any overflow shadow */
}

.cat-tabs::-webkit-scrollbar {
  display: none;
}

.cat-tab {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 18px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

.cat-tab:hover,
.cat-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

/* ── GRID ── */
.movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
}

.grid-card {
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  background: var(--surface2);
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1);
  position: relative;
}

.grid-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent2);
  box-shadow: 0 18px 36px -6px rgba(59, 130, 246, 0.22);
}

.grid-rank {
  position: absolute;
  top: 8px;
  left: 10px;
  font-family: "Syne", sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.07);
  line-height: 1;
  pointer-events: none;
}

/* ── PAGINATION ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.pg-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pg-btn:hover,
.pg-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.pg-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.pg-ellipsis {
  color: var(--muted);
  padding: 0 4px;
  font-size: 0.85rem;
}

.pg-info {
  font-size: 0.78rem;
  color: var(--muted);
  margin-left: 4px;
}

/* ── SEARCH OVERLAY ── */
#searchOverlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(5, 7, 15, 0.97);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 70px 28px 28px;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#searchOverlay.open {
  opacity: 1;
  pointer-events: all;
}

.srch-top {
  width: 100%;
  max-width: 720px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 14px;
  margin-bottom: 28px;
}

.srch-ico {
  color: var(--muted);
  flex-shrink: 0;
}

#searchInput {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: "Syne", sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
}

#searchInput::placeholder {
  color: var(--muted2);
}

.srch-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  flex-shrink: 0;
}

.srch-close:hover {
  background: var(--red);
  border-color: var(--red);
}

.srch-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 28px;
  width: 100%;
  max-width: 720px;
}

.flt-sel {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text);
  padding: 8px 18px;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.flt-sel:hover {
  border-color: var(--accent2);
}

.srch-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 1100px;
}

.srch-msg {
  grid-column: 1/-1;
  text-align: center;
  color: var(--muted);
  padding: 52px 0;
  font-size: 0.9rem;
}

/* ── DETAIL MODAL ── */
#detailModal {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: rgba(5, 7, 15, 0.97);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#detailModal.open {
  opacity: 1;
  pointer-events: all;
}

.dt-inner {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 0 80px;
  animation: slideUp 0.4s cubic-bezier(0.2, 0.9, 0.4, 1) both;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(36px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.dt-backdrop {
  position: relative;
  height: 500px;
  overflow: hidden;
  background: #0a1020;
}

.dt-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}

.dt-backdrop-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
      rgba(5, 7, 15, 0.15) 0%,
      rgba(5, 7, 15, 0.88) 78%,
      var(--bg) 100%);
}

.dt-close {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 5;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(5, 7, 15, 0.82);
  border: 1px solid var(--border);
  color: #fff;
  font-size: 1.15rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: 0.2s;
}

.dt-close:hover {
  background: var(--red);
  border-color: var(--red);
}

.dt-body {
  padding: 0 36px;
}

.dt-top {
  display: flex;
  gap: 30px;
  margin-top: -110px;
  position: relative;
  z-index: 2;
}

.dt-poster {
  flex-shrink: 0;
  width: 190px;
  height: 285px;
  border-radius: var(--r2);
  overflow: hidden;
  box-shadow: 0 30px 60px -8px rgba(0, 0, 0, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.09);
}

.dt-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dt-meta {
  flex: 1;
  padding-top: 72px;
}

.dt-title {
  font-family: "Syne", sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  line-height: 1.1;
}

.dt-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.dt-badge {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 100px;
  padding: 4px 13px;
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--muted);
}

.dt-badge.gold {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.28);
  color: var(--gold);
}

.dt-syn {
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.88rem;
  max-width: 580px;
  margin-bottom: 22px;
}

.dt-actions {
  display: flex;
  gap: 11px;
  flex-wrap: wrap;
}

.btn-trailer {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 11px 22px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-trailer:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.dt-section {
  margin-top: 36px;
}

.dt-sec-title {
  font-family: "Syne", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* ── TRAILER EMBED (inline) ── */
.trailer-box {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--r2);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
  position: relative;
}

.trailer-box iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ── CAST ── */
.cast-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.cast-row::-webkit-scrollbar {
  display: none;
}

.cast-card {
  flex: 0 0 86px;
  text-align: center;
}

.cast-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 7px;
  border: 2px solid var(--border);
  display: block;
}

.cast-img-ph {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 7px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(59, 130, 246, 0.1);
}

.cast-name {
  font-size: 0.68rem;
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cast-role {
  font-size: 0.62rem;
  color: var(--muted);
}

/* ── EPISODE PANEL ── */
.ep-panel {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  overflow: hidden;
  margin-top: 40px;
}

.ep-hdr {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.ep-show-title {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 1rem;
  flex: 1;
}

.ep-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-wrap: nowrap;
}

.ep-tabs::-webkit-scrollbar {
  display: none;
}

.ep-tab {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--muted);
  padding: 5px 13px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: 0.2s;
}

.ep-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.ep-list {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 480px;
  overflow-y: auto;
}

.ep-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 11px;
  cursor: pointer;
  transition: 0.2s;
}

.ep-item:hover {
  background: rgba(59, 130, 246, 0.06);
}

.ep-num {
  font-family: "Syne", sans-serif;
  font-size: 0.73rem;
  font-weight: 800;
  color: var(--muted2);
  min-width: 26px;
}

.ep-thumb {
  width: 96px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(59, 130, 246, 0.08);
}

.ep-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ep-info {
  flex: 1;
  min-width: 0;
}

.ep-title {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ep-desc {
  font-size: 0.72rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ep-dur {
  font-size: 0.68rem;
  color: var(--muted2);
  flex-shrink: 0;
}

.ep-loading {
  text-align: center;
  padding: 32px;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ── FOOTER ── */
footer {
  position: relative;
  z-index: 2;
  background: rgba(5, 7, 15, 0.99);
  border-top: 1px solid var(--border);
  padding: 52px 0 26px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 44px;
  margin-bottom: 44px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.footer-logo span {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
}

.footer-tag {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 250px;
}

.app-btns {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.app-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 9px 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text);
}

.app-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border2);
}

.app-l {
  font-size: 0.58rem;
  color: var(--muted);
}

.app-n {
  font-family: "Syne", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
}

.fc-title {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  margin-bottom: 16px;
  color: #fff;
}

.fc-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.fc-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  transition: 0.2s;
}

.fc-links a:hover {
  color: var(--text);
}

.footer-btm {
  border-top: 1px solid var(--border);
  padding-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.copyright {
  font-size: 0.76rem;
  color: var(--muted2);
}

/* ── ERROR ── */
.err-msg {
  text-align: center;
  padding: 64px 20px;
  color: var(--muted);
}

.err-msg h3 {
  font-family: "Syne", sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text);
}

.err-msg p {
  font-size: 0.85rem;
  line-height: 1.6;
}

.retry-btn {
  margin-top: 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 10px 24px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: 0.2s;
}

.retry-btn:hover {
  background: var(--accent2);
}

.anim-sec::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg,
      transparent,
      rgba(59, 130, 246, 0.03) 50%,
      transparent);
  background-size: 200% 200%;
  animation: gAnim 10s ease infinite;
}

@keyframes gAnim {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
}

@media (max-width: 768px) {
  nav {
    padding: 0 18px;
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
    height: 58px;
  }

  .nav-logo {
    width: 30px;
    height: 30px;
  }

  .nav-name {
    font-size: 0.95rem;
  }

  .nav-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .nav-cta {
    padding: 7px 14px;
    font-size: 0.75rem;
  }

  .hero {
    min-height: 80vh;
  }

  .hero h1 {
    font-size: 2rem;
    line-height: 1.2;
  }

  .hero-sub {
    font-size: 0.9rem;
  }

  .hero-badge {
    font-size: 0.6rem;
  }

  .hero-actions {
    flex-direction: column;
    gap: 10px;
  }

  .btn-pri,
  .btn-out {
    width: 100%;
    justify-content: center;
    min-height: 48px; /* accessible touch target */
  }

  .hero-stats {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
  }

  .h-stat {
    flex: 1;
    min-width: 70px;
  }

  .h-stat .n {
    font-size: 1.3rem;
  }

  .h-stat .l {
    font-size: 0.6rem;
  }

  .sec-hdr {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .see-all {
    align-self: flex-start;
  }

  .sec-title {
    font-size: 1.2rem;
  }

  .cat-tabs {
    gap: 6px;
  }

  .cat-tab {
    padding: 6px 14px;
    font-size: 0.75rem;
    flex-shrink: 0; /* prevent tab squishing in horizontal scroll */
  }

  /* Slider buttons: stay inside viewport on mobile */
  .sl-btn.prev {
    left: 0;
  }

  .sl-btn.next {
    right: 0;
  }

  .dt-backdrop {
    height: 300px;
  }

  .dt-close {
    width: 44px;
    height: 44px;
    top: 16px;
    right: 16px;
  }

  .dt-top {
    flex-direction: column;
    gap: 20px;
    margin-top: -60px;
  }

  .dt-poster {
    width: 130px;
    height: 195px;
    margin: 0 auto;
  }

  .dt-meta {
    padding-top: 0;
  }

  .dt-body {
    padding: 0 18px;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .dt-title {
    font-size: 1.5rem;
  }

  .dt-syn {
    font-size: 0.8rem;
  }

  .dt-actions {
    gap: 8px;
    flex-wrap: wrap;
  }

  .btn-trailer {
    font-size: 0.8rem;
    padding: 10px 18px;
    min-height: 44px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-tag {
    max-width: 100%;
  }

  .container {
    padding: 0 18px;
  }

  .movies-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
  }

  .mc {
    flex: 0 0 130px;
  }

  .sl-btn {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
  }

  .srch-top {
    padding: 0 18px;
    max-width: 100%;
  }

  #searchInput {
    font-size: 1.3rem;
  }

  .srch-filters {
    padding: 0 18px;
    max-width: 100%;
  }

  .srch-results {
    padding: 0 18px;
    max-width: 100%;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  #searchOverlay {
    padding: 60px 0 28px;
  }

  .ep-hdr {
    padding: 14px;
    flex-wrap: wrap;
  }

  .ep-tabs {
    width: 100%;
    margin-top: 8px;
  }

  .ep-item {
    gap: 10px;
    padding: 8px;
  }

  .ep-thumb {
    width: 70px;
    height: 40px;
  }

  .cast-card {
    flex: 0 0 70px;
  }

  .cast-img,
  .cast-img-ph {
    width: 50px;
    height: 50px;
  }

  .cast-name {
    font-size: 0.6rem;
  }

  .cast-role {
    font-size: 0.55rem;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  nav {
    height: 52px;
    padding: 0 12px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .nav-logo {
    width: 26px;
    height: 26px;
  }

  .nav-name {
    font-size: 0.85rem;
  }

  .nav-search-btn {
    width: 34px;
    height: 34px;
  }

  .nav-cta {
    padding: 6px 12px;
    font-size: 0.7rem;
  }

  .hero {
    min-height: 70vh;
  }

  .hero h1 {
    font-size: 1.5rem;
    line-height: 1.15;
  }

  .hero-sub {
    font-size: 0.8rem;
    margin-bottom: 20px;
  }

  .hero-badge {
    font-size: 0.55rem;
    padding: 4px 12px;
    margin-bottom: 16px;
  }

  .hero-actions {
    gap: 8px;
  }

  .btn-pri,
  .btn-out {
    font-size: 0.8rem;
    padding: 10px 16px;
  }

  .hero-stats {
    gap: 12px;
  }

  .h-stat .n {
    font-size: 1.1rem;
  }

  .h-stat .l {
    font-size: 0.5rem;
  }

  .scroll-hint {
    font-size: 0.6rem;
  }

  .sec-hdr {
    gap: 10px;
  }

  .sec-title {
    font-size: 1rem;
  }

  .sec-sub {
    font-size: 0.7rem;
  }

  .cat-tabs {
    gap: 4px;
    margin-bottom: 16px;
  }

  .cat-tab {
    padding: 5px 12px;
    font-size: 0.7rem;
  }

  .movies-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
  }

  .mc {
    flex: 0 0 100px;
  }

  .mc-info {
    padding: 8px;
  }

  .mc-title {
    font-size: 0.7rem;
  }

  .mc-meta {
    font-size: 0.6rem;
  }

  .sl-btn {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
  }

  .sl-btn.prev {
    left: -12px;
  }

  .sl-btn.next {
    right: -12px;
  }

  .dt-backdrop {
    height: 220px;
  }

  .dt-inner {
    padding: 0 0 60px;
  }

  .dt-body {
    padding: 0 14px;
  }

  .dt-close {
    width: 36px;
    height: 36px;
    top: 12px;
    right: 12px;
    font-size: 1rem;
  }

  .dt-poster {
    width: 100px;
    height: 150px;
    margin: 0 auto;
  }

  .dt-title {
    font-size: 1.2rem;
    margin-bottom: 8px;
  }

  .dt-badges {
    gap: 6px;
    margin-bottom: 12px;
  }

  .dt-badge {
    padding: 3px 10px;
    font-size: 0.65rem;
  }

  .dt-syn {
    font-size: 0.75rem;
    margin-bottom: 16px;
    max-width: 100%;
  }

  .dt-actions {
    gap: 6px;
  }

  .btn-trailer {
    font-size: 0.75rem;
    padding: 8px 14px;
  }

  .dt-section {
    margin-top: 24px;
  }

  .dt-sec-title {
    font-size: 0.75rem;
    margin-bottom: 10px;
  }

  #searchOverlay {
    padding: 50px 0 20px;
  }

  .srch-top {
    padding: 0 14px;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 10px;
  }

  .srch-ico {
    width: 20px;
    height: 20px;
  }

  #searchInput {
    font-size: 1.1rem;
  }

  .srch-close {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }

  .srch-filters {
    padding: 0 14px;
    gap: 8px;
    margin-bottom: 16px;
  }

  .flt-sel {
    padding: 6px 14px;
    font-size: 0.75rem;
  }

  .srch-results {
    padding: 0 14px;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .srch-msg {
    padding: 32px 14px;
    font-size: 0.8rem;
  }

  .pagination {
    gap: 5px;
    margin-top: 28px;
  }

  .pg-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 0.75rem;
  }

  .pg-info {
    font-size: 0.7rem;
  }

  .ep-panel {
    margin-top: 28px;
  }

  .ep-hdr {
    padding: 12px;
    gap: 8px;
  }

  .ep-show-title {
    font-size: 0.9rem;
  }

  .ep-tab {
    padding: 4px 10px;
    font-size: 0.7rem;
  }

  .ep-list {
    padding: 10px;
    gap: 6px;
    max-height: 400px;
  }

  .ep-item {
    gap: 8px;
    padding: 6px;
  }

  .ep-num {
    font-size: 0.65rem;
    min-width: 22px;
  }

  .ep-thumb {
    width: 60px;
    height: 35px;
  }

  .ep-title {
    font-size: 0.75rem;
  }

  .ep-desc {
    font-size: 0.65rem;
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }

  .ep-dur {
    font-size: 0.6rem;
  }

  footer {
    padding: 32px 0 16px;
  }

  .footer-grid {
    gap: 20px;
    margin-bottom: 24px;
  }

  .footer-logo img {
    width: 28px;
    height: 28px;
  }

  .footer-logo span {
    font-size: 0.95rem;
  }

  .footer-tag {
    font-size: 0.75rem;
    line-height: 1.5;
  }

  .app-btns {
    gap: 6px;
  }

  .app-btn {
    padding: 7px 10px;
  }

  .app-l {
    font-size: 0.52rem;
  }

  .app-n {
    font-size: 0.75rem;
  }

  .fc-title {
    font-size: 0.75rem;
    margin-bottom: 12px;
  }

  .fc-links {
    gap: 6px;
  }

  .fc-links a {
    font-size: 0.7rem;
  }

  .footer-btm {
    padding-top: 16px;
    gap: 6px;
  }

  .copyright {
    font-size: 0.7rem;
  }

  #mobileMenu {
    gap: 20px;
  }

  #mobileMenu a,
  #mobileMenu button {
    font-size: 1.4rem;
  }

  .err-msg {
    padding: 40px 14px;
  }

  .err-msg h3 {
    font-size: 1rem;
  }

  .err-msg p {
    font-size: 0.8rem;
  }

  .retry-btn {
    padding: 8px 18px;
    font-size: 0.8rem;
  }
}
/* ── VERY SMALL PHONES (Galaxy Fold, older iPhones in landscape, etc.) ── */
@media (max-width: 360px) {
  html {
    font-size: 13px;
  }

  nav {
    height: 50px;
    padding: 0 10px;
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }

  .nav-name {
    font-size: 0.78rem;
  }

  .nav-cta {
    display: none; /* too cramped — hide CTA, hamburger still shows */
  }

  .hero h1 {
    font-size: 1.35rem;
  }

  .hero-stats {
    gap: 8px;
  }

  .h-stat .n {
    font-size: 1rem;
  }

  .movies-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .mc {
    flex: 0 0 88px;
  }

  .srch-results {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .container {
    padding: 0 12px;
  }

  section {
    padding: 36px 0;
  }

  .dt-poster {
    width: 80px;
    height: 120px;
  }

  .dt-title {
    font-size: 1.1rem;
  }

  .btn-pri,
  .btn-out,
  .btn-trailer {
    font-size: 0.75rem;
    padding: 10px 14px;
  }

  .ep-thumb {
    width: 52px;
    height: 30px;
  }
}

/* ── LANDSCAPE MOBILE ── */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: 100vw; /* fill width instead of viewport height */
  }

  #mobileMenu {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px 28px;
    overflow-y: auto;
    padding: 16px;
  }

  #mobileMenu a,
  #mobileMenu button {
    font-size: 1.2rem;
  }

  .dt-backdrop {
    height: 180px;
  }
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}