/* ═══════════════════════════════════════════════════════════
   TEROUSD — style.css
   Base stylesheet (theme colours live in themes.css)
   ═══════════════════════════════════════════════════════════ */

/* ── Base variables (non-colour) ──────────────────────────── */
:root {
  --red:        #e50914;
  --red-h:      #f40612;
  --hh:         68px;
  --pad:        4%;
}

/* ── Reset ─────────────────────────────────────────────────── */
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth}
body{font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;background:var(--bg);color:var(--t1);overflow-x:hidden;min-height:100vh}
.page-transition-overlay {
  position: fixed; inset: 0; background: var(--bg);
  z-index: 99999; pointer-events: none;
  opacity: 0; transition: opacity 0.25s cubic-bezier(.4,0,1,1);
}
.page-transition-overlay.fade-out { opacity: 1; }
body { animation: page-in 0.4s ease both; }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
::-webkit-scrollbar{width:5px;height:5px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:#444;border-radius:3px}
a{text-decoration:none;color:inherit}
button{font-family:inherit;cursor:pointer;border:none;outline:none}
img{display:block;max-width:100%}
input,select{font-family:inherit}

/* ════════════════════════════════════════════════════════════
   HEADER
   ════════════════════════════════════════════════════════════ */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--hh);
  z-index: 900;
  transition: background-color .4s;
  background: linear-gradient(180deg,rgba(0,0,0,.7) 0%,transparent 100%);
}
.header.scrolled {
  background: var(--bg) !important;
}

.header-content {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 var(--pad);
  gap: 0;
}

/* ── Logo ───────────────────────────────────────────────────── */
.logo { display: flex; align-items: center; flex-shrink: 0; margin-right: 25px; }
.logo-icon { display: none }
.logo-wordmark { display: flex; flex-direction: column; justify-content: center; }
.logo-main {
  font-family: Arial Black, Arial, sans-serif;
  font-size: 1.7rem; font-weight: 900;
  color: var(--red);
  letter-spacing: -0.03em; text-transform: uppercase; line-height: 1;
}
.logo-sub { display: none }

/* ── Primary Nav ──────────────────────────────────────────── */
.nav-menu { display: flex; align-items: center; height: var(--hh); gap: 0; }
.nav-link {
  color: var(--t2); font-size: .85rem; font-weight: 400;
  padding: 0 10px; line-height: var(--hh); white-space: nowrap; transition: color .15s;
}
.nav-link:hover { color: var(--t1) }
.nav-link.active { color: var(--t1); font-weight: 700 }

/* ── Right-side controls ────────────────────────────────────── */
.nav-controls { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.auth-actions { display: flex; align-items: center; gap: 8px; }
.auth-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 34px; padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--t1); font-size: .78rem; font-weight: 700;
}
.auth-pill-user { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Header search (desktop) */
.header-search { position: relative }
.search-box-small {
  display: flex; align-items: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px; height: 34px;
  transition: all .2s; gap: 4px; padding: 0 4px 0 10px;
}
.search-box-small:focus-within { background: rgba(255,255,255,0.13); border-color: rgba(255,255,255,0.5); }
[data-theme="light"] .search-box-small { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.18); }
[data-theme="light"] .search-box-small:focus-within { background: rgba(0,0,0,0.1); border-color: rgba(0,0,0,0.4); }
.search-input-small {
  background: transparent; border: none; color: var(--t1);
  outline: none; font-size: .85rem; width: 180px; padding: 0;
}
.search-input-small::placeholder { color: rgba(255,255,255,.4) }
[data-theme="light"] .search-input-small::placeholder { color: rgba(0,0,0,.35) }
.search-icon-small {
  background: none; color: var(--t1); opacity: 0.55;
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 4px; transition: opacity .15s; flex-shrink: 0;
}
.search-icon-small:hover { opacity: 0.9; }
.search-results-container-small {
  display: none;
  position: absolute; top: 42px; left: 0; right: 0;
  min-width: 300px;
  background: rgba(14,18,28,0.98);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px; max-height: 380px; overflow-y: auto;
  z-index: 1200; box-shadow: 0 12px 40px rgba(0,0,0,.7);
}
.search-results-container-small.active { display: block }

/* Theme toggle (kept for backwards compat — now hidden when switcher used) */
.theme-toggle {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 6px; color: var(--t1);
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.8; transition: opacity .2s, background .2s, border-color .2s;
}
.theme-toggle:hover { opacity: 1; background: rgba(255,255,255,0.13); border-color: rgba(255,255,255,0.3); }
[data-theme="light"] .theme-toggle { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.15); }
[data-theme="light"] .theme-toggle:hover { background: rgba(0,0,0,0.11); border-color: rgba(0,0,0,0.3); }

/* Mobile search button */
.mobile-search-btn {
  display: none;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.14);
  border-radius: 6px; color: var(--t1); width: 34px; height: 34px;
  align-items: center; justify-content: center; opacity: 0.8; transition: opacity .2s, background .2s;
}
.mobile-search-btn:hover { opacity: 1; background: rgba(255,255,255,0.13); }
[data-theme="light"] .mobile-search-btn { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.15); }

/* 3-dot dropdown */
.three-dot-menu-container { position: relative; display: none }
.three-dot-btn {
  background: transparent; color: var(--t1); font-size: 1.5rem;
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
}
.three-dot-dropdown {
  display: none; flex-direction: column;
  position: absolute; top: 48px; right: 0; min-width: 200px;
  background: rgba(0,0,0,.97); border: 1px solid rgba(255,255,255,.12);
  z-index: 1200; box-shadow: 0 8px 30px rgba(0,0,0,.8);
}
.three-dot-dropdown.open { display: flex }
.dropdown-item {
  padding: 12px 18px; color: var(--t2); font-size: .875rem; font-weight: 500;
  border-bottom: 1px solid rgba(255,255,255,.06); transition: background .15s;
}
.dropdown-item:last-child { border-bottom: none }
.dropdown-item:hover { background: rgba(255,255,255,.08); color: #fff }
.dropdown-item.active-item { color: #fff; font-weight: 700 }

/* ════════════════════════════════════════════════════════════
   HERO
   ════════════════════════════════════════════════════════════ */
.hero {
  position: relative; width: 100%;
  height: 56.25vw; max-height: 95vh; min-height: 460px;
  overflow: hidden; background: #000;
}
.hero-backdrop-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 15%;
}
.hero::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(77deg, rgba(0,0,0,.8) 0%, transparent 50%),
    linear-gradient(to top, #141414 0%, transparent 40%),
    linear-gradient(to bottom, rgba(0,0,0,.5) 0%, transparent 15%);
  z-index: 1;
}
.hero-content {
  position: absolute; bottom: 35%; left: var(--pad); z-index: 2;
  max-width: 36%; min-width: 280px;
}
.hero-eyebrow { display: none }
.hero-title {
  font-family: Arial Black, Arial, sans-serif;
  font-size: clamp(1.8rem, 3.5vw, 3.2rem); font-weight: 900; line-height: 1.1;
  color: #fff; text-shadow: 2px 2px 4px rgba(0,0,0,.5);
  margin-bottom: 1.1rem; letter-spacing: -.02em;
}
.hero-title span { color: var(--red) }
.hero-subtitle {
  font-size: clamp(.8rem, 1.15vw, 1.05rem); line-height: 1.55;
  color: rgba(255,255,255,.9); text-shadow: 1px 1px 3px rgba(0,0,0,.5);
  margin-bottom: 1.4rem; font-weight: 400;
}
.hero-btns { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero-btn-play {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; color: #000; padding: 8px 22px;
  border-radius: 4px; font-size: 1rem; font-weight: 700;
  border: none; cursor: pointer; white-space: nowrap; transition: background .15s;
}
.hero-btn-play:hover { background: rgba(255,255,255,.75) }
.hero-btn-play svg { width: 22px; height: 22px; flex-shrink: 0 }
.hero-btn-info {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(109,109,110,.7); color: #fff; padding: 8px 22px;
  border-radius: 4px; font-size: 1rem; font-weight: 700;
  border: none; cursor: pointer; white-space: nowrap; transition: background .15s;
}
.hero-btn-info:hover { background: rgba(109,109,110,.4) }
.hero-btn-info svg { width: 22px; height: 22px; flex-shrink: 0 }
.hero-maturity {
  position: absolute; right: var(--pad); bottom: 35%; z-index: 2;
  display: flex; align-items: center; gap: 14px;
}
.hero-rating-badge {
  border: 1px solid rgba(255,255,255,.55); color: #fff;
  padding: 3px 10px; font-size: .85rem; font-weight: 600;
}
.hero-search,.hero-search * { display: none !important }

/* ════════════════════════════════════════════════════════════
   CONTENT ROW SECTIONS
   ════════════════════════════════════════════════════════════ */
.explore-section {
  position: relative; z-index: 2; margin-top: -80px;
  padding: 0 var(--pad) 60px;
}
#continue-watching-grid,#watchlist-grid {
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px;
}
.home-row-section {
  margin-bottom: 34px;
}
.home-row-section-watchlist {
  margin-bottom: 42px;
}
#continue-watching-section,#watchlist-section {
  margin-bottom: 32px;
}
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; margin-top: 40px;
}
.section-header:first-child { margin-top: 0 }
.section-title-group { display: flex; align-items: center; gap: 20px; }
.section-title { font-size: 1.3rem; font-weight: 700; color: var(--t1); line-height: 1; }
.tab-group { display: flex; border-bottom: 2px solid rgba(255,255,255,.15); }
.tab-btn {
  background: none; color: var(--t2); font-size: .78rem; font-weight: 700;
  letter-spacing: .03em; padding: 5px 14px; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px; transition: color .15s; cursor: pointer;
}
.tab-btn.active { color: #fff; border-bottom-color: #fff }
.tab-btn:hover { color: #fff }
.refresh-trending-btn {
  background: transparent; color: var(--t3); font-size: 1.1rem;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: color .2s, transform .3s;
}
.refresh-trending-btn:hover { color: #fff; transform: rotate(90deg) }
.clear-history-btn {
  background: transparent; border: 1px solid rgba(255,255,255,.25);
  color: var(--t2); padding: 4px 12px; font-size: .72rem; font-weight: 600;
  border-radius: 2px; transition: all .15s;
}
.history-card-wrap { position: relative; }
.history-item-delete {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 15;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(10, 12, 18, 0.84);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  display: grid;
  place-items: center;
}
.history-item-delete:hover { background: rgba(229, 9, 20, 0.9); }
.clear-history-btn:hover { border-color: #e05555; color: #e05555 }

/* ════════════════════════════════════════════════════════════
   CONTENT CARDS
   ════════════════════════════════════════════════════════════ */
.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 8px; }
.content-grid-updating {
  opacity: .78;
  transition: opacity .2s ease;
}
.content-card {
  background: linear-gradient(180deg, rgba(255,255,255,.02) 0%, rgba(255,255,255,0) 100%), var(--bg2); border-radius: 3px; overflow: hidden;
  cursor: pointer; position: relative; z-index: 1;
  transition: transform .42s cubic-bezier(.22,1,.36,1), box-shadow .42s ease, border-color .42s ease, filter .42s ease;
  border: 1px solid rgba(255,255,255,.04); transform-origin: center bottom; will-change: transform;
  user-select: none;
  -webkit-user-select: none;
}
.content-card::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.14) 0%, rgba(255,255,255,0) 35%);
  opacity: 0; transition: opacity .42s ease;
}
.content-card:hover { transform: translateY(-8px) scale(1.04); z-index: 10; box-shadow: 0 24px 50px rgba(0,0,0,.42); border-color: rgba(255,255,255,.14); filter: saturate(1.08); }
.content-card:hover::before { opacity: 1; }
.content-card-poster {
  position: relative; aspect-ratio: 2/3; background: #222; overflow: hidden;
}
.content-card-poster-link {
    display: block;
    width: 100%;
    height: 100%;
    -webkit-user-drag: element;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
  }
.content-card-poster-link:active { cursor: grabbing; }
.content-card-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .55s cubic-bezier(.22,1,.36,1), filter .55s ease; }
.content-card:hover .content-card-poster img { transform: scale(1.06); filter: saturate(1.06); }
.content-card-poster::after {
  content: ''; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: #fff; background: rgba(0,0,0,.3);
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.content-card:hover .content-card-poster::after { opacity: 1 }
.content-card-placeholder {
  width: 100%; height: 100%; background: #1e1e1e;
  display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: #444;
}
.content-card-badge {
  position: absolute; top: 5px; right: 5px;
  background: rgba(0,0,0,.75); color: #f5c518;
  padding: 1px 5px; border-radius: 2px; font-size: .62rem; font-weight: 700;
}
.content-card-user-badge {
  position: absolute; bottom: 5px; left: 5px;
  background: rgba(0,0,0,.75); color: #f5c518;
  padding: 1px 5px; border-radius: 2px; font-size: .6rem; font-weight: 700;
}
.content-card-resume-badge {
  position: absolute; bottom: 5px; right: 5px;
  background: rgba(229,9,20,.85); color: #fff;
  padding: 2px 6px; border-radius: 2px; font-size: .58rem; font-weight: 700;
  letter-spacing: .03em;
}
.content-card-info { padding: 8px 9px 10px }
.content-card-title {
  font-size: .78rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--t1);
  user-select: none;
  -webkit-user-select: none;
}
.content-card-meta { display: flex; justify-content: space-between; font-size: .65rem; color: var(--t3); margin-top: 3px; user-select: none; -webkit-user-select: none; }
.content-loading { grid-column: 1/-1; text-align: center; padding: 3rem 1rem; color: var(--t3); font-size: .9rem; }

/* ════════════════════════════════════════════════════════════
   BROWSE PAGES
   ════════════════════════════════════════════════════════════ */
.browse-hero { padding: calc(var(--hh) + 40px) var(--pad) 28px; }
.hero-eyebrow {
  display: block; font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .15em; color: var(--red); margin-bottom: 8px;
}
.browse-hero-title {
  font-size: clamp(1.5rem, 3vw, 2.4rem); font-weight: 900;
  letter-spacing: -.02em; margin-bottom: 6px;
}
.browse-hero-sub { color: var(--t2); font-size: .9rem; margin-bottom: 20px; }
.browse-search-bar { max-width: 480px; position: relative }
.browse-search-bar .search-box {
  display: flex !important; align-items: center;
  background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.2);
  border-radius: 3px; overflow: hidden; transition: border-color .2s;
}
.browse-search-bar .search-box:focus-within { border-color: rgba(255,255,255,.7) }
.browse-search-bar .search-input {
  flex: 1; background: transparent; border: none;
  color: #fff; outline: none; font-size: .9rem; padding: 10px 14px;
}
.browse-search-bar .search-input::placeholder { color: rgba(255,255,255,.38) }
.browse-search-bar .search-icon {
  display: flex !important; background: none; color: var(--t2);
  font-size: 1rem; padding: 0 14px; align-items: center; height: 100%;
}
.browse-search-bar .search-results-container {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: rgba(0,0,0,.97); border: 1px solid rgba(255,255,255,.1);
  border-radius: 3px; max-height: 400px; overflow-y: auto; z-index: 300;
  box-shadow: 0 8px 30px rgba(0,0,0,.8);
}
.browse-search-bar .search-results-container.active { display: block }
.search-result-item {
  display: flex; gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06); cursor: pointer; transition: background .15s;
}
.search-result-item:hover { background: rgba(255,255,255,.07) }
.result-poster img { width: 36px; height: 52px; object-fit: cover; border-radius: 2px }
.result-info .result-title { font-size: .875rem; font-weight: 600 }
.result-info .result-meta { font-size: .72rem; color: var(--t2); margin-top: 2px }
.search-loading, .search-empty { padding: 18px; text-align: center; color: var(--t2); font-size: .875rem }
.search-result-item-small {
  display: flex; gap: 10px; padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06); cursor: pointer; transition: background .15s;
}
.search-result-item-small:hover { background: rgba(255,255,255,.07) }
.result-poster-small img { width: 32px; height: 48px; object-fit: cover; border-radius: 2px }
.result-info-small { display: flex; flex-direction: column; justify-content: center }
.result-title-small { font-size: .875rem; font-weight: 600 }
.result-meta-small { font-size: .72rem; color: var(--t2); margin-top: 2px }
.browse-section { padding: 8px var(--pad) 80px }
.genre-filter-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px }
.genre-btn {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.15);
  color: var(--t2); padding: 6px 16px; border-radius: 2px;
  font-size: .8rem; font-weight: 500; transition: all .15s; white-space: nowrap;
}
.genre-btn:hover { background: rgba(255,255,255,.14); color: #fff }
.genre-btn.active { background: var(--red); border-color: var(--red); color: #fff; font-weight: 700 }
.load-more-container { text-align: center; margin-top: 36px }
.load-more-btn {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2);
  color: #fff; padding: 12px 48px; border-radius: 3px;
  font-size: .875rem; font-weight: 600; transition: background .2s;
}
.load-more-btn:hover { background: rgba(255,255,255,.15) }

/* ════════════════════════════════════════════════════════════
   DETAIL / TITLE PAGE
   ════════════════════════════════════════════════════════════ */
.detail-backdrop {
  display: none; position: absolute; top: 0; left: 0; right: 0;
  height: 500px; background-size: cover; background-position: center 15%; z-index: 0;
}
.detail-backdrop.visible { display: block }
.detail-backdrop::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(14,17,26,.97) 0%, rgba(14,17,26,.82) 55%, rgba(14,17,26,.55) 100%),
    linear-gradient(to top, var(--bg) 0%, transparent 40%);
}
.detail-hero {
  position: relative; z-index: 2;
  padding: calc(var(--hh) + 32px) var(--pad) 48px;
  min-height: unset; display: flex; align-items: flex-start;
}
.detail-hero-inner { display: flex; gap: 40px; align-items: flex-start; width: 100%; max-width: 980px; }
.detail-poster-col { flex-shrink: 0; width: 220px }
.detail-poster-wrap {
  border-radius: 3px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.75); position: relative;
}
.detail-poster-img { width: 100%; display: block }
.detail-poster-placeholder {
  aspect-ratio: 2/3; background: #1a1a1a;
  display: flex; align-items: center; justify-content: center; font-size: 3rem; color: #444;
}
.detail-poster-user-rating {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,.95) 0%, transparent 100%);
  padding: 24px 10px 10px; text-align: center; color: #f5c518; font-size: 1rem; letter-spacing: .06em;
}
.detail-poster-user-rating em {
  display: block; font-style: normal; font-size: .58rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--t3); margin-top: 2px;
}
.detail-info-col { flex: 1; min-width: 0; overflow: hidden }
.detail-title {
  font-family: Arial Black, Arial, sans-serif;
  font-size: clamp(1.6rem, 3.2vw, 2.8rem); font-weight: 900; line-height: 1.05;
  margin-bottom: 8px; letter-spacing: -.02em; text-shadow: 2px 2px 6px rgba(0,0,0,.5);
}
.detail-tagline { font-size: .95rem; font-style: italic; color: var(--t2); margin-bottom: 14px; }
.detail-meta-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px; font-size: .875rem;
}
.detail-hd-badge {
  border: 1px solid rgba(255,255,255,.4); color: rgba(255,255,255,.7);
  padding: 1px 7px; font-size: .67rem; font-weight: 800; letter-spacing: .06em;
}
.detail-imdb-label { color: #f5c518; font-size: .72rem; font-weight: 700 }
.detail-imdb-val { color: #f5c518; font-weight: 700 }
.detail-meta-dot { color: var(--t2) }
.detail-meta-sep { display: flex; align-items: center; gap: 4px }
.detail-tv-picker { margin-bottom: 14px }
.detail-picker-row { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-end }
.detail-picker-group { display: flex; flex-direction: column; gap: 4px }
.detail-picker-label { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--t3); }
.detail-picker-controls { display: flex; align-items: center; gap: 6px }
.detail-picker-btn {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15);
  color: #fff; width: 28px; height: 28px; border-radius: 2px; font-size: 1rem;
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.detail-picker-btn:hover { background: rgba(255,255,255,.2) }
.detail-picker-val { font-size: .875rem; font-weight: 700; min-width: 22px; text-align: center }
.detail-season-select {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.15);
  color: #fff; padding: 6px 32px 6px 10px; border-radius: 2px;
  font-size: .875rem; font-weight: 600; min-width: 120px; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23b3b3b3' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}
.detail-season-select option { background: #181818 }
.detail-server-play-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.detail-server-play-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(109,109,110,.6); color: #fff; padding: 8px 18px;
  border-radius: 4px; font-size: .875rem; font-weight: 700;
  border: none; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.detail-server-play-btn.active { background: #fff; color: #000 }
.detail-server-play-btn:hover:not(.active) { background: rgba(109,109,110,.4) }
.dsp-icon { font-size: .8rem }
.detail-action-btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.detail-watchlist-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 2px solid rgba(255,255,255,.5);
  color: #fff; width: 42px; height: 42px; border-radius: 50%;
  font-size: 1.35rem; font-weight: 700; transition: all .15s;
}
.detail-watchlist-btn:hover { border-color: #fff }
.detail-watchlist-btn.in-watchlist { background: rgba(255,255,255,.12); border-color: #fff }
.detail-watchlist-btn #detail-watchlist-label { display: none }
.detail-trailer-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(109,109,110,.5); border: none;
  color: #fff; padding: 8px 18px; border-radius: 4px;
  font-size: .875rem; font-weight: 600; transition: background .15s;
}
.detail-trailer-btn:hover { background: rgba(109,109,110,.35) }
.detail-overview-block { margin-bottom: 14px; max-width: 520px }
.detail-overview-label { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--t3); margin-bottom: 5px; }
.detail-overview { font-size: .9rem; line-height: 1.65; color: var(--t2) }
.detail-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 32px; }
.detail-info-full { grid-column: 1/-1 }
.detail-info-item { font-size: .8rem }
.detail-info-label { color: var(--t3); font-weight: 700; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; margin-right: 4px; }
.detail-info-value { color: var(--t2) }
.detail-star-rating { margin-bottom: 14px }
.star-rating-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap }
.star-label { font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--t3) }
.star-btns { display: flex; gap: 1px }
.star-btn { background: none; color: rgba(255,255,255,.2); font-size: 1.3rem; padding: 0 2px; transition: color .1s, transform .1s; line-height: 1 }
.star-btn:hover, .star-btn.hover { color: #f5c518; transform: scale(1.15) }
.star-btn.active { color: #f5c518 }
.star-current-val { font-size: .75rem; font-weight: 700; color: #f5c518; background: rgba(245,197,24,.1); border: 1px solid rgba(245,197,24,.25); padding: 2px 7px; border-radius: 2px }

/* ════════════════════════════════════════════════════════════
   EPISODES SECTION
   ════════════════════════════════════════════════════════════ */
.detail-episodes-section { position: relative; z-index: 2; padding: 0 var(--pad) 28px; }
.detail-episodes-inner { max-width: 1280px; margin: 0 auto }
.detail-episodes-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 14px }
.detail-episodes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 5px; }
.detail-ep-card {
  background: var(--bg2); border-radius: 3px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; transition: border-color .2s, background .2s;
}
.detail-ep-card:hover { background: var(--bg3) }
.detail-ep-card.active { border-color: var(--red) }
.detail-ep-thumb { aspect-ratio: 16/9; background: #222; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.detail-ep-thumb img { width: 100%; height: 100%; object-fit: cover }
.detail-ep-thumb-placeholder { font-size: 1.2rem; color: #444 }
.detail-ep-thumb-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); opacity: 0; font-size: 1.4rem; color: #fff; transition: opacity .2s; }
.detail-ep-card:hover .detail-ep-thumb-play { opacity: 1 }
.detail-ep-info { padding: 7px 8px }
.detail-ep-num { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--red); margin-bottom: 2px }
.detail-ep-name { font-size: .73rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.detail-ep-rating { font-size: .63rem; color: #f5c518; margin-top: 2px }
.detail-ep-loading { grid-column: 1/-1; text-align: center; padding: 28px; color: var(--t3) }
.detail-related-section { position: relative; z-index: 2; padding: 8px var(--pad) 60px }
.detail-related-inner { max-width: 1280px; margin: 0 auto }

/* ════════════════════════════════════════════════════════════
   WATCH / PLAYER PAGE
   ════════════════════════════════════════════════════════════ */
.player-backdrop {
  display: none; position: absolute; top: var(--hh); left: 0; right: 0;
  height: 480px; background-size: cover; background-position: center top; z-index: 0;
}
.player-backdrop.visible { display: block }
.player-backdrop::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(20,20,20,.5) 0%, rgba(20,20,20,.8) 55%, #141414 100%);
}
.player-section { padding: calc(var(--hh) + 14px) 2.5% 0; max-width: 1080px; margin: 0 auto; position: relative; z-index: 1; }
.player-container { border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 24px 60px rgba(0,0,0,.8); }
.player-content { position: relative; height: 560px; background: #000 }
.player-iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none }
.player-content video.player-iframe { object-fit: contain; background: #000 }
.tv-controls { display: none; max-width: 1080px; margin: 10px auto 0; padding: 0 2.5%; position: relative; z-index: 1; }
.tv-controls.active { display: block }
.tv-controls-inner {
  background: var(--bg2); border: 1px solid rgba(255,255,255,.08); border-radius: 3px;
  padding: 14px 24px; display: flex; align-items: center; justify-content: center; gap: 32px; flex-wrap: wrap;
}
.control-group { display: flex; flex-direction: column; align-items: center; gap: 5px }
.control-label { font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--t3) }
.control-buttons { display: flex; align-items: center; gap: 5px; background: rgba(255,255,255,.06); padding: 3px; border-radius: 3px; border: 1px solid rgba(255,255,255,.08) }
.control-btn { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.08); color: #fff; width: 28px; height: 28px; border-radius: 2px; font-size: .9rem; font-weight: 700; display: flex; align-items: center; justify-content: center; transition: background .15s }
.control-btn:hover { background: rgba(255,255,255,.16) }
.control-display { font-size: .875rem; font-weight: 700; min-width: 24px; text-align: center }
.episode-details { border-left: 1px solid rgba(255,255,255,.08); padding-left: 28px }
.episode-name { font-size: .875rem; color: var(--t2) }
.server-selection-outer { max-width: 1080px; margin: 8px auto 0; padding: 0 2.5%; position: relative; z-index: 1; }
.server-selection {
  background: var(--bg2); border: 1px solid rgba(255,255,255,.08); border-radius: 3px;
  padding: 12px 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.server-label { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--t3); flex-shrink: 0 }
.server-list { display: flex; gap: 6px; flex-wrap: wrap; flex: 1 }
.server-btn {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  color: var(--t2); padding: 5px 14px; border-radius: 2px; font-size: .78rem; font-weight: 600; transition: all .15s
}
.server-btn:hover { background: rgba(255,255,255,.13); color: #fff }
.server-btn.active { background: var(--red); border-color: var(--red); color: #fff }
.action-btn { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); color: var(--t2); width: 30px; height: 30px; border-radius: 2px; font-size: .9rem; display: flex; align-items: center; justify-content: center; transition: all .15s }
.action-btn:hover { color: #fff; background: rgba(255,255,255,.13) }
.player-watchlist-btn { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); color: var(--t2); padding: 5px 14px; border-radius: 2px; font-size: .78rem; font-weight: 600; transition: all .15s; white-space: nowrap }
.player-watchlist-btn:hover { background: rgba(255,255,255,.13); color: #fff }
.player-watchlist-btn.in-list { background: var(--red); border-color: var(--red); color: #fff }
.movie-details-section { max-width: 1080px; margin: 20px auto 0; padding: 0 2.5% 24px; position: relative; z-index: 1 }
.movie-details-inner { display: flex; gap: 24px; background: var(--bg2); border-radius: 3px; padding: 24px; border: 1px solid rgba(255,255,255,.06) }
.movie-details-poster { flex-shrink: 0; width: 105px }
.movie-details-poster img { width: 100%; border-radius: 3px }
.movie-details-info { flex: 1; min-width: 0 }
.details-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 8px }
.details-badges { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 12px }
.badge { padding: 2px 8px; border-radius: 2px; font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em }
.badge-hd { background: rgba(255,255,255,.12); color: #fff }
.badge-imdb { background: #f5c518; color: #000 }
.badge-runtime, .badge-year { background: rgba(255,255,255,.07); color: var(--t2) }
.details-overview { color: var(--t2); font-size: .875rem; line-height: 1.65; margin-bottom: 14px }
.details-meta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 5px }
.details-meta-item { font-size: .8rem; color: var(--t2) }
.meta-label { font-weight: 700; color: var(--t3); margin-right: 4px }
.related-section { max-width: 1080px; margin: 0 auto; padding: 0 2.5% 60px; position: relative; z-index: 1 }

/* ════════════════════════════════════════════════════════════
   404 PAGE
   ════════════════════════════════════════════════════════════ */
.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem }
.error-content { text-align: center; max-width: 480px }
.error-code { font-size: 8rem; font-weight: 900; color: var(--red); line-height: 1; margin-bottom: .5rem }
.error-title { font-size: 2rem; font-weight: 800; margin-bottom: 1rem }
.error-sub { color: var(--t2); font-size: 1rem; margin-bottom: 2rem }
.error-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap }
.btn-primary { background: var(--red); color: #fff; padding: 10px 28px; border-radius: 4px; font-size: .95rem; font-weight: 700; transition: background .15s }
.btn-primary:hover { background: var(--red-h) }
.btn-ghost { background: transparent; border: 1px solid rgba(255,255,255,.3); color: #fff; padding: 10px 28px; border-radius: 4px; font-size: .95rem; font-weight: 600; transition: all .15s }
.btn-ghost:hover { border-color: #fff }

/* ════════════════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════════════════ */
.footer {
  background: var(--black, #000);
  padding: 36px var(--pad);
  border-top: 1px solid rgba(255,255,255,.06);
}
.footer-content { max-width: 1280px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center; }
.footer-logo { font-family: Arial Black, Arial, sans-serif; font-size: 1.4rem; font-weight: 900; color: var(--red); letter-spacing: -.02em; text-transform: uppercase; margin-bottom: 6px; }
.footer-logo svg { display: none }
.footer-developer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: var(--t2);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.footer-developer-link:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.2);
  color: var(--t1);
  transform: translateY(-1px);
}
[data-theme="light"] .footer-developer-link {
  background: rgba(0,0,0,.03);
  border-color: rgba(0,0,0,.1);
}
[data-theme="light"] .footer-developer-link:hover {
  background: rgba(0,0,0,.07);
  border-color: rgba(0,0,0,.16);
}
.footer-section p { font-size: .8rem; color: var(--t3); line-height: 1.6 }
.footer-bottom { display: none }

/* ════════════════════════════════════════════════════════════
   TOASTS
   ════════════════════════════════════════════════════════════ */
#notification-container, #toast-container { position: fixed; bottom: 28px; right: 28px; z-index: 9999; display: flex; flex-direction: column; gap: 8px }
.notification, .toast, .toast-item { background: rgba(25,25,25,.97); border: 1px solid rgba(255,255,255,.12); color: #fff; padding: 12px 18px; border-radius: 3px; font-size: .875rem; font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,.6); opacity: 0; transform: translateX(20px); transition: opacity .3s, transform .3s; max-width: 300px }
.toast-item.show { opacity: 1; transform: translateX(0) }

/* ════════════════════════════════════════════════════════════
   TRAILER MODAL
   ════════════════════════════════════════════════════════════ */
.trailer-modal { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity .3s }
.trailer-modal.open { opacity: 1; pointer-events: all }
.trailer-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.92) }
.trailer-modal-inner { position: relative; z-index: 1; width: min(82vw, 880px, calc((78vh - 58px) * 16 / 9)); max-width: 880px; background: #141414; border: 1px solid rgba(255,255,255,.1); border-radius: 3px; overflow: hidden; transform: scale(.95); transition: transform .3s cubic-bezier(.22,.68,0,1.2); box-shadow: 0 32px 80px rgba(0,0,0,.9) }
.trailer-modal.open .trailer-modal-inner { transform: scale(1) }
.trailer-modal-header { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 72px 12px 16px; border-bottom: 1px solid rgba(255,255,255,.07) }
.trailer-modal-title { font-size: .95rem; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 8px }
.trailer-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 3;
  background: rgba(10,12,18,.92);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
  transition: background .15s, border-color .15s, transform .15s;
}
.trailer-modal-close:hover {
  background: rgba(229,9,20,.95);
  border-color: rgba(255,255,255,.3);
  color: #fff;
  transform: scale(1.05);
}
.trailer-modal-frame { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; overflow: hidden }
.trailer-modal-frame iframe { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: none }

/* ════════════════════════════════════════════════════════════
   MOBILE SEARCH OVERLAY
   ════════════════════════════════════════════════════════════ */
.mobile-search-overlay { display: none; position: fixed; inset: 0; z-index: 5000; background: rgba(0,0,0,.98); flex-direction: column; padding: 14px }
.mobile-search-overlay.open { display: flex }
.mobile-search-inner { display: flex; gap: 10px; align-items: center; margin-bottom: 14px }
.mobile-search-input { flex: 1; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); border-radius: 8px; padding: 12px 16px; color: #fff; font-size: 1rem; outline: none }
.mobile-search-input:focus { border-color: rgba(255,255,255,.5) }
.mobile-search-close { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); color: var(--t2); width: 40px; height: 40px; border-radius: 8px; font-size: 1rem; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.mobile-search-close:hover { background: rgba(255,255,255,.14); }
.mobile-search-results { flex: 1; overflow-y: auto }
.mobile-search-result-item { display: flex; gap: 14px; align-items: center; padding: 10px 6px; border-bottom: 1px solid rgba(255,255,255,.06); cursor: pointer; transition: background .15s }
.mobile-search-result-item:hover { background: rgba(255,255,255,.05) }
.mobile-search-result-item img { width: 40px; height: 58px; object-fit: cover; border-radius: 2px; flex-shrink: 0 }
.mobile-result-title { font-weight: 600; font-size: .9rem }
.mobile-result-meta { font-size: .72rem; color: var(--t2); margin-top: 2px }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) { :root { --pad: 3.5% } }

@media (max-width: 768px) {
  .nav-menu { display: none }
  .mobile-search-btn { display: flex; order: 1 }
  .three-dot-menu-container { display: block; order: 3 }
  .theme-switcher, .theme-toggle { order: 2 }
  .header-search { display: none }
  .header-content { padding: 0 4%; gap: 10px }
  .logo-main { font-size: 1.35rem }
  .hero {
    margin-top: calc(var(--hh) + env(safe-area-inset-top, 0px));
    height: 72vw;
    min-height: 300px;
    max-height: none;
  }
  .hero-content { bottom: 16%; max-width: 75%; min-width: 0; left: 4% }
  .hero-title { font-size: clamp(1.2rem, 4.5vw, 1.8rem); margin-bottom: .6rem }
  .hero-subtitle { display: none }
  .hero-maturity { display: none }
  .hero-btns { gap: 8px }
  .hero-btn-play, .hero-btn-info { font-size: .8rem; padding: 7px 14px; gap: 6px }
  .hero-btn-play svg, .hero-btn-info svg { width: 18px; height: 18px }
  .explore-section { padding: 0 4% 48px; margin-top: -30px }
  .section-title { font-size: 1rem }
  .section-header { margin-bottom: 8px; margin-top: 28px }
  .content-grid { grid-template-columns: repeat(3, 1fr); gap: 7px }
  #continue-watching-grid,#watchlist-grid { grid-template-columns: repeat(3, 1fr); gap: 7px }
  .home-row-section { margin-bottom: 28px }
  .home-row-section-watchlist { margin-bottom: 34px }
  .content-card-title { font-size: .7rem }
  .content-card-meta { font-size: .58rem }
  .tab-btn { font-size: .78rem; padding: 4px 10px }
  .clear-history-btn { font-size: .72rem }
  .browse-hero { padding: calc(var(--hh) + 16px) 4% 14px }
  .browse-hero-title { font-size: clamp(1.4rem, 5vw, 2rem) }
  .browse-hero-sub { font-size: .82rem; margin-bottom: 12px }
  .browse-section { padding: 6px 4% 60px }
  .genre-filter-bar { gap: 5px; margin-bottom: 14px }
  .genre-btn { font-size: .72rem; padding: 5px 11px }
  .detail-hero { padding: calc(var(--hh) + 14px) 4% 24px }
  .detail-hero-inner { flex-direction: row; gap: 12px; align-items: flex-start }
  .detail-poster-col { width: 100px; flex-shrink: 0 }
  .detail-poster-wrap { border-radius: 4px }
  .detail-title { font-size: clamp(1.1rem, 4vw, 1.7rem); margin-bottom: 5px }
  .detail-tagline { font-size: .8rem }
  .detail-meta-row { gap: 6px; font-size: .75rem; margin-bottom: 10px }
  .detail-server-play-row { gap: 5px; margin-bottom: 10px }
  .detail-server-play-btn { padding: 7px 12px; font-size: .75rem; gap: 5px }
  .detail-action-btns { gap: 6px; margin-bottom: 12px }
  .detail-watchlist-btn { width: 36px; height: 36px; font-size: 1.1rem }
  .detail-overview-block { max-width: 100%; margin-bottom: 10px }
  .detail-overview { font-size: .82rem; line-height: 1.55 }
  .detail-overview-label { font-size: .58rem }
  .detail-info-grid { grid-template-columns: 1fr; gap: 4px }
  .detail-info-full { grid-column: 1 }
  .detail-info-item { font-size: .75rem }
  .detail-episodes-section { padding: 0 4% 20px }
  .detail-episodes-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 5px }
  .detail-related-section { padding: 8px 4% 40px }
  .detail-backdrop { height: 320px }
  .player-section { padding: calc(var(--hh) + 4px) 0 0 }
  .player-container { border-radius: 0 }
  .player-content { height: 56vw; min-height: 200px }
  .server-selection-outer { padding: 0 3%; margin-top: 6px }
  .server-selection { padding: 8px 12px; gap: 8px }
  .server-label { display: none }
  .server-btn { font-size: .75rem; padding: 5px 10px }
  .tv-controls { padding: 0 3% }
  .tv-controls-inner { padding: 10px 14px; gap: 20px }
  .episode-details { display: none }
  .player-watchlist-btn { display: none }
  .movie-details-section { padding: 0 4% }
  .movie-details-inner { flex-direction: column; gap: 14px }
  .movie-details-poster { width: 80px }
  .related-section { padding: 8px 4% 40px }
  .trailer-modal { padding: 14px }
  .trailer-modal-inner { width: min(94vw, calc((72vh - 58px) * 16 / 9)); max-width: none }
  .trailer-modal-header { padding: 12px 64px 12px 14px }
  .trailer-modal-close { right: 14px }
}

@media (max-width: 480px) {
  .logo-main { font-size: 1.2rem }
  .hero {
    margin-top: calc(var(--hh) + env(safe-area-inset-top, 0px));
    height: 80vw;
    min-height: 260px;
  }
  .hero-content { bottom: 14%; left: 4%; max-width: 80% }
  .hero-title { font-size: clamp(1.1rem, 4vw, 1.5rem) }
  .hero-btn-play, .hero-btn-info { font-size: .75rem; padding: 6px 12px }
  .explore-section { margin-top: -20px }
  .content-grid { grid-template-columns: repeat(3, 1fr); gap: 6px }
  #continue-watching-grid,#watchlist-grid { grid-template-columns: repeat(3, 1fr); gap: 6px }
  .home-row-section { margin-bottom: 24px }
  .home-row-section-watchlist { margin-bottom: 30px }
  .content-card-title { font-size: .65rem }
  .content-card-info { padding: 5px 6px 7px }
  .detail-poster-col { width: 85px }
  .detail-title { font-size: clamp(1rem, 3.5vw, 1.4rem) }
  .detail-server-play-btn { padding: 6px 10px; font-size: .7rem }
  .detail-backdrop { height: 260px }
  .browse-hero-title { font-size: 1.4rem }
  .genre-btn { font-size: .68rem; padding: 4px 9px }
  .detail-episodes-grid { grid-template-columns: repeat(3, 1fr) }
  .details-meta-grid { grid-template-columns: 1fr }
  .browse-loading-inline {
    max-width: calc(100% - 20px);
    margin-top: 14px;
    margin-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    padding: 9px 14px;
    font-size: .76rem;
  }
  .detail-related-loading-grid {
    min-height: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ═══════════════════════════════════════════════════════════════
   SKELETON LOADING CARDS
   ═══════════════════════════════════════════════════════════════ */
@keyframes card-reveal { from { opacity: 0; transform: translateY(22px) scale(.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes section-fade-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.card-animate { opacity: 0; animation: card-reveal 0.68s cubic-bezier(.16,1,.3,1) forwards; }
.section-animate { opacity: 0; animation: section-fade-in 0.5s ease forwards; }
.loading-panel {
  grid-column: 1 / -1;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.05) 0%, rgba(255,255,255,.02) 100%);
  color: var(--t2);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .01em;
  backdrop-filter: blur(12px);
  animation: premium-content-rise .5s cubic-bezier(.16,1,.3,1);
}
.loading-panel-wide { min-height: 180px; }
.loading-panel-inline { margin-top: 16px; min-height: 96px; }
.loading-panel-soft {
  min-height: 120px;
  background: linear-gradient(180deg, rgba(255,255,255,.035) 0%, rgba(255,255,255,.015) 100%);
  color: rgba(255,255,255,.72);
}
.loading-panel-spinner {
  flex-direction: column;
  gap: 14px;
}
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: grid;
  place-items: center;
}
.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
}
.auth-modal-panel {
  position: relative;
  z-index: 1;
  width: min(92vw, 420px);
  padding: 24px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(24,28,36,0.98), rgba(14,18,26,0.98));
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
}
.auth-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.auth-modal-header h2 { font-size: 1.2rem; }
.auth-modal-close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 1.2rem;
}
.auth-form { display: grid; gap: 14px; }
.auth-field { display: grid; gap: 6px; font-size: .82rem; color: var(--t2); }
.auth-field input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: #fff;
  padding: 12px 14px;
}
.auth-submit-btn {
  min-height: 42px;
  border-radius: 12px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  margin-top: 6px;
}
.auth-submit-btn:disabled { opacity: 0.6; }
.auth-switch-btn {
  margin-top: 14px;
  background: transparent;
  color: var(--t2);
  font-size: .82rem;
}
.loading-spinner-ring {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid rgba(255,255,255,.14);
  border-top-color: var(--red);
  animation: loading-spinner-rotate .9s linear infinite;
}
.detail-related-loading-grid.loading-panel-spinner {
  min-height: 220px;
}
@keyframes loading-spinner-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.browse-loading-inline {
  min-height: auto;
  width: fit-content;
  max-width: min(100%, 280px);
  margin: 16px auto 0;
  padding: 10px 16px;
  border-radius: 999px;
  gap: 10px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .01em;
  background: rgba(20,22,18,.88);
  box-shadow: 0 12px 28px rgba(0,0,0,.28);
  backdrop-filter: blur(12px);
}
.browse-loading-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(229,9,20,.5);
  animation: browse-loading-pulse 1.1s ease-in-out infinite;
}
@keyframes browse-loading-pulse {
  0% { transform: scale(.9); box-shadow: 0 0 0 0 rgba(229,9,20,.45); opacity: .85; }
  70% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(229,9,20,0); opacity: 1; }
  100% { transform: scale(.92); box-shadow: 0 0 0 0 rgba(229,9,20,0); opacity: .85; }
}
.detail-loading-shell {
  position: relative;
  z-index: 2;
  padding: calc(var(--hh) + 34px) var(--pad) 28px;
}
.detail-loading-spinner-panel {
  min-height: 300px;
  width: min(980px, 100%);
  margin: 0 auto;
}
.detail-loading-related {
  padding-top: 0;
}
.detail-related-loading-grid {
  min-height: 320px;
  align-content: start;
}
.page-shell { position: relative; isolation: isolate; }
.page-shell::before {
  content: ""; position: fixed; inset: 0 0 auto; height: min(36vh, 320px); z-index: 0; pointer-events: none;
  background: radial-gradient(circle at top center, rgba(255,255,255,.08), rgba(255,255,255,0) 65%);
  opacity: .45;
}
.cinematic-panel {
  opacity: 1; transform: translate3d(0, 0, 0) scale(1);
  transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1), filter .7s ease;
  will-change: transform, opacity;
}
.cinematic-panel.is-switching { opacity: 0; transform: translate3d(0, 46px, 0) scale(.985); filter: blur(12px); }
.cinematic-panel-delay { transition-delay: .08s; }
.cinematic-panel-delay-2 { transition-delay: .16s; }
.cinematic-panel-delay-3 { transition-delay: .24s; }
.page-shell-detail .detail-backdrop,
.page-shell-watch .player-backdrop { animation: premium-backdrop-in 1s cubic-bezier(.16,1,.3,1); }
.page-shell-watch .player-content,
.page-shell-detail .detail-poster-wrap { animation: premium-surface-in .82s cubic-bezier(.16,1,.3,1); }
.page-shell-watch .movie-details-info,
.page-shell-detail .detail-info-col { animation: premium-content-rise .88s cubic-bezier(.16,1,.3,1); }
@keyframes premium-backdrop-in {
  from { opacity: 0; transform: scale(1.04); filter: blur(16px); }
  to { opacity: 1; transform: scale(1); filter: blur(0); }
}
@keyframes premium-surface-in {
  from { opacity: 0; transform: translate3d(0, 36px, 0) scale(.96); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes premium-content-rise {
  from { opacity: 0; transform: translate3d(0, 52px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .cinematic-panel,
  .content-card,
  .content-card::before,
  .content-card-poster img,
  .page-shell-watch .player-content,
  .page-shell-detail .detail-poster-wrap,
  .page-shell-watch .movie-details-info,
  .page-shell-detail .detail-info-col,
  .page-shell-detail .detail-backdrop,
  .page-shell-watch .player-backdrop,
  .card-animate,
  .section-animate {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    filter: none !important;
    opacity: 1 !important;
  }
}


/* ═══════════════════════════════════════════════════════════════
   SEARCH PAGE
   ═══════════════════════════════════════════════════════════════ */
.search-page-section { padding-top: 100px; padding-bottom: 60px; min-height: 80vh; }
.search-page-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.search-page-bar-wrap { margin-bottom: 32px; }
.search-page-bar { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,0.07); border: 1.5px solid rgba(255,255,255,0.12); border-radius: 50px; padding: 12px 20px; transition: border-color 0.2s; }
.search-page-bar:focus-within { border-color: var(--accent, #e50914); }
[data-theme="light"] .search-page-bar { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.15); }
.search-page-icon { display: flex; align-items: center; flex-shrink: 0; opacity: 0.5; }
.search-page-input { flex: 1; background: none; border: none; outline: none; color: var(--t1); font-size: 1.05rem; font-family: inherit; min-width: 0; }
.search-page-input::placeholder { color: var(--t3); }
.search-page-clear { background: none; border: none; color: var(--t3); cursor: pointer; font-size: 1rem; padding: 2px 6px; border-radius: 50%; transition: background 0.15s, color 0.15s; flex-shrink: 0; }
.search-page-clear:hover { background: rgba(255,255,255,0.1); color: var(--t1); }
.search-filter-bar { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.search-filter-btn { background: rgba(255,255,255,0.07); border: 1.5px solid rgba(255,255,255,0.12); color: var(--t2); border-radius: 20px; padding: 6px 16px; font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: all 0.2s; font-family: inherit; }
.search-filter-btn.active,.search-filter-btn:hover { background: var(--accent, #e50914); border-color: var(--accent, #e50914); color: #fff; }
[data-theme="light"] .search-filter-btn { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.15); color: var(--t2); }
.search-page-status { font-size: 0.85rem; color: var(--t3); margin-bottom: 16px; min-height: 1.2em; }
.search-empty-state { text-align: center; padding: 80px 20px; color: var(--t2); }
.search-empty-icon {
  width: 74px;
  height: 74px;
  margin: 0 auto 16px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(229,9,20,.14) 0%, rgba(255,255,255,.03) 100%);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 18px 40px rgba(0,0,0,.24);
}
.search-empty-icon svg {
  width: 38px;
  height: 38px;
  stroke: rgba(255,255,255,.88);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.search-empty-title { font-size: 1.2rem; font-weight: 600; color: var(--t1); margin-bottom: 6px; }
.search-empty-sub { font-size: 0.9rem; opacity: 0.7; }
.search-see-all,.mobile-search-see-all { display: block; text-align: center; padding: 10px 16px; color: var(--accent, #e50914); font-size: 0.85rem; font-weight: 600; text-decoration: none; border-top: 1px solid rgba(255,255,255,0.07); transition: background 0.15s; }
.search-see-all:hover,.mobile-search-see-all:hover { background: rgba(255,255,255,0.05); }
.mobile-search-see-all { margin-top: 8px; border-top: 1px solid rgba(255,255,255,0.08); }
@media (max-width: 600px) { .search-page-section { padding-top: 80px; } .search-page-input { font-size: 0.95rem; } .search-page-bar { padding: 10px 14px; } }

/* ═══════════════════════════════════════════════════════════════
   TRAILER FALLBACK
   ═══════════════════════════════════════════════════════════════ */
.trailer-fallback { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 40px 24px; text-align: center; color: var(--t2); background: #080c14; height: 100%; min-height: 200px; }
.trailer-fallback p { font-size: 0.95rem; max-width: 300px; line-height: 1.6; }
.trailer-yt-link { display: inline-flex; align-items: center; gap: 8px; background: #ff0000; color: #fff; padding: 10px 22px; border-radius: 6px; font-weight: 600; text-decoration: none; font-size: 0.9rem; transition: opacity 0.2s; }
.trailer-yt-link:hover { opacity: 0.85; }
.trailer-modal-frame { position: relative; }
.trailer-modal-frame iframe,.trailer-modal-frame .trailer-fallback { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ═══════════════════════════════════════════════════════════════
   PLAYER LOADING STATE
   ═══════════════════════════════════════════════════════════════ */
.player-loading-state { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 300px; gap: 16px; color: rgba(255,255,255,0.7); background: radial-gradient(circle at top, rgba(255,255,255,.06), rgba(255,255,255,0) 48%), rgba(0,0,0,0.42); border-radius: 8px; }
.player-loading-copy { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.player-loading-copy strong { font-size: .88rem; letter-spacing: .08em; text-transform: uppercase; }
.player-loading-copy span { font-size: .82rem; color: rgba(255,255,255,.46); }
.player-spinner { position: relative; width: 52px; height: 52px; }
.player-spinner::before,.player-spinner::after,.player-spinner span { content: ''; position: absolute; border-radius: 50%; border: 2.5px solid transparent; }
.player-spinner::before { inset: 0; border-top-color: var(--red); animation: spin .9s linear infinite; }
.player-spinner::after { inset: 8px; border-top-color: rgba(255,255,255,0.35); animation: spin .7s linear infinite reverse; }
.player-spinner span { display: block; inset: 16px; border-top-color: rgba(229,9,20,0.5); animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }


