:root {
  --bg: #141414;
  --panel: #1b1b1b;
  --panel-2: #262626;
  --line: #333;
  --text: #e5e5e5;
  --muted: #9a9a9a;
  --red: #e50914;
  --green: #46d369;
  --radius: 8px;
  --sidebar: 340px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body.noscroll { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { display: block; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: linear-gradient(#000c, #0000);
  backdrop-filter: blur(6px);
}
.brand { font-weight: 900; font-size: 22px; letter-spacing: 1px; color: var(--red); }
.brand span { color: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 6px; border: 0;
  background: #6d6d6eb3; color: #fff; font-weight: 600; text-decoration: none;
}
.btn:hover { background: #6d6d6e; }
.btn.primary { background: #fff; color: #000; }
.btn.primary:hover { background: #ddd; }
.btn.red { background: var(--red); color: #fff; }
.btn.block { width: 100%; padding: 13px; font-size: 16px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 0;
  background: #0009; color: #fff; font-size: 16px;
}
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 4px; }
.link.small { font-size: 13px; margin-top: 6px; }
.count {
  background: var(--red); color: #fff; border-radius: 10px;
  font-size: 12px; min-width: 20px; padding: 0 6px; line-height: 20px;
}

/* ---------- layout ---------- */
.layout { display: flex; align-items: flex-start; }
.results { flex: 1; min-width: 0; padding: 0 16px 40px; }

/* ---------- filters: bottom sheet on mobile ---------- */
.filters {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  background: var(--panel);
  transform: translateY(100%);
  transition: transform .28s ease;
}
.filters.open { transform: none; }
.sheet-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
}
.sheet-head h2 { margin: 0; flex: 1; font-size: 18px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 4px 16px 24px; overscroll-behavior: contain; }
.sheet-foot { padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }

@media (min-width: 900px) {
  .filter-btn, #closeFilters, .sheet-foot { display: none !important; }
  .filters {
    position: sticky; top: 60px; transform: none; transition: none;
    width: var(--sidebar); flex-shrink: 0;
    height: calc(100vh - 60px);
    margin-left: 16px; border-radius: var(--radius);
    z-index: 1;
  }
  .results { padding: 0 24px 40px; }
}

details { border-bottom: 1px solid var(--line); padding: 4px 0 14px; }
summary {
  list-style: none; cursor: pointer;
  padding: 12px 0 8px; font-weight: 700; font-size: 15px;
  display: flex; justify-content: space-between; align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "▾"; color: var(--muted); transition: transform .2s; }
details:not([open]) summary::after { transform: rotate(-90deg); }

.field { display: block; margin: 10px 0; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.hint { color: var(--muted); font-size: 12px; margin: 0 0 8px; }
.row { display: flex; gap: 10px; }
.row .field { flex: 1; }
select, input[type=search], input[type=number] {
  width: 100%; padding: 10px 12px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px;
  outline: none; font-size: 16px; /* 16px prevents iOS zoom */
}
select:focus, input:focus { border-color: #777; }
input[type=range] { width: 100%; accent-color: var(--red); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--panel-2);
  border-radius: 999px; padding: 6px 12px; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip[aria-pressed=true], .chip[data-state="1"] { background: #fff; color: #000; border-color: #fff; }
.chip[data-state="-1"] { background: #3a0d10; color: #ff8a8f; border-color: #7a1d22; text-decoration: line-through; }
.chip img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; margin-left: -6px; }
.chip .x { opacity: .6; font-size: 12px; }

/* segmented control */
.seg { display: inline-flex; margin-top: 10px; background: var(--panel-2); border-radius: 6px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 4px; font-size: 13px; color: var(--muted); }
.seg button[aria-pressed=true] { background: #444; color: #fff; }

/* providers */
.providers { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; margin-top: 10px; }
.prov { border: 0; background: none; padding: 0; text-align: center; position: relative; }
.prov img { width: 100%; aspect-ratio: 1; border-radius: 12px; border: 2px solid transparent; opacity: .75; transition: .15s; }
.prov small { display: block; font-size: 10px; color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prov[aria-pressed=true] img { border-color: #fff; opacity: 1; transform: scale(1.04); }
.prov[aria-pressed=true]::after {
  content: "✓"; position: absolute; top: -4px; right: -4px;
  width: 20px; height: 20px; border-radius: 50%; background: var(--red); color: #fff;
  font-size: 12px; line-height: 20px; font-weight: 700;
}

/* pickers */
.picker input { margin-top: 8px; }
.picked { display: flex; flex-wrap: wrap; gap: 8px; }
.picked:empty { display: none; }
.suggest-title { font-size: 12px; color: var(--muted); margin: 12px 0 8px; text-transform: uppercase; letter-spacing: .5px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px 10px; }
.person { border: 0; background: none; padding: 0; text-align: center; position: relative; }
.person .ph {
  width: 100%; aspect-ratio: 1; border-radius: 50%; object-fit: cover;
  background: var(--panel-2); border: 3px solid transparent; transition: .15s;
  display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--muted);
}
.person b { display: block; font-size: 12px; font-weight: 600; margin-top: 6px; line-height: 1.2; }
.person small { display: block; font-size: 11px; color: var(--muted); }
.person[aria-pressed=true] .ph { border-color: var(--red); }
.person[aria-pressed=true]::after {
  content: "✓"; position: absolute; top: 0; right: 6px;
  width: 22px; height: 22px; border-radius: 50%; background: var(--red); color: #fff;
  font-size: 13px; line-height: 22px; font-weight: 700;
}
.sug-list { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.sug-row {
  display: flex; align-items: center; gap: 10px; text-align: left;
  border: 0; background: none; padding: 8px; border-radius: 6px;
}
.sug-row:hover { background: var(--panel-2); }
.sug-row img { width: 40px; height: 28px; object-fit: contain; background: #fff; border-radius: 4px; padding: 2px; }
.sug-row small { color: var(--muted); margin-left: auto; }
.sug-row[aria-pressed=true] { background: #333; }
.sug-row[aria-pressed=true]::after { content: "✓"; color: var(--red); font-weight: 700; }

/* ---------- hero ---------- */
.hero {
  position: relative; margin: -60px -16px 16px; min-height: 62vw; max-height: 80vh;
  background-size: cover; background-position: center top;
  display: flex; align-items: flex-end;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(77deg, #000a 0%, #0000 60%), linear-gradient(#0000 50%, var(--bg) 100%);
}
.hero-content { position: relative; padding: 0 16px 24px; max-width: 640px; }
.hero h2 { margin: 0 0 8px; font-size: clamp(26px, 6vw, 56px); line-height: 1.05; text-shadow: 0 2px 12px #000; }
.hero p { margin: 0 0 14px; color: #ddd; font-size: clamp(13px, 1.6vw, 17px); text-shadow: 0 1px 6px #000;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero .meta { color: var(--green); font-weight: 700; margin-bottom: 8px; font-size: 14px; }
@media (min-width: 900px) {
  .hero { margin: 0 -24px 16px 0; min-height: 36vw; max-height: 70vh; border-radius: 0 0 0 var(--radius); overflow: hidden; }
  .hero-content { padding: 0 32px 40px; }
}

/* ---------- active filters & toolbar ---------- */
.active { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.active::-webkit-scrollbar { display: none; }
.active .chip { flex-shrink: 0; background: #2b2b2b; }
.active .clear { flex-shrink: 0; }
.toolbar { display: flex; align-items: center; gap: 10px; margin: 8px 0 14px; }
.result-count { flex: 1; color: var(--muted); font-size: 14px; }
.toolbar select { width: auto; padding: 7px 10px; font-size: 14px; }
.view-toggle { margin-top: 0; }

/* ---------- grid ---------- */
.grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; } }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.card {
  position: relative; border: 0; padding: 0; background: var(--panel-2);
  border-radius: 6px; overflow: hidden; aspect-ratio: 2 / 3;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card img { width: 100%; height: 100%; object-fit: cover; }
.card .noimg { height: 100%; display: flex; align-items: center; justify-content: center; padding: 10px; text-align: center; font-weight: 700; color: var(--muted); }
.card .rating {
  position: absolute; top: 6px; left: 6px; background: #000b; color: #ffd76a;
  font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px;
}
.card-info {
  position: absolute; inset: auto 0 0 0; padding: 30px 8px 8px; text-align: left;
  background: linear-gradient(#0000, #000e); opacity: 0; transition: opacity .2s;
}
.card-info b { display: block; font-size: 13px; line-height: 1.2; }
.card-info small { color: var(--muted); font-size: 11px; }
.card:hover, .card:focus-visible { transform: scale(1.06); z-index: 2; box-shadow: 0 10px 30px #000c; outline: none; }
.card:hover .card-info, .card:focus-visible .card-info { opacity: 1; }
@media (hover: none) { .card-info { opacity: 1; } .card:hover { transform: none; } }

.card.wide { aspect-ratio: 16 / 9; }
.card.wide .card-info { opacity: 1; padding: 40px 12px 10px; }
.card.wide .card-info b { font-size: 16px; }
.card.wide .noimg { background: linear-gradient(135deg, #2a2a2a, #1a1a1a); }

.skeleton { aspect-ratio: 2 / 3; border-radius: 6px; background: linear-gradient(90deg, #222 0%, #2c2c2c 50%, #222 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.grid.wide .skeleton { aspect-ratio: 16 / 9; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 60px 20px; }
.empty b { display: block; color: var(--text); font-size: 18px; margin-bottom: 6px; }

.loader { display: flex; justify-content: center; padding: 24px; }
.spinner { width: 34px; height: 34px; border: 3px solid #444; border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
.loader .spinner { margin: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

.credit { color: #666; font-size: 12px; text-align: center; margin-top: 40px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: #000b; }
.modal-card {
  position: relative; width: 100%; max-width: 860px; max-height: 94vh; overflow-y: auto;
  background: #181818; border-radius: 12px 12px 0 0; box-shadow: 0 20px 60px #000;
  animation: up .25s ease;
}
@media (min-width: 700px) { .modal { align-items: center; padding: 24px; } .modal-card { border-radius: 12px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.modal-close { position: absolute; top: 12px; right: 12px; z-index: 3; }
.m-hero { position: relative; aspect-ratio: 16 / 9; background: #000 center / cover; }
.m-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(#0000 40%, #181818 100%); pointer-events: none; }
.m-hero iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 2; }
.m-hero-content { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 20px 16px; z-index: 1; }
.m-hero h2 { margin: 0 0 10px; font-size: clamp(22px, 5vw, 38px); text-shadow: 0 2px 10px #000; }
.m-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.m-body { padding: 8px 20px 28px; }
.m-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 14px; }
.m-meta .score { color: var(--green); font-weight: 700; }
.tagline { font-style: italic; color: var(--muted); margin: 12px 0 0; }
.m-body h3 { font-size: 16px; margin: 22px 0 10px; }
.wp-group { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.wp-group > span { width: 100px; font-size: 13px; color: var(--muted); }
.wp-group img { width: 44px; height: 44px; border-radius: 10px; }
.m-cast { display: grid; grid-auto-flow: column; grid-auto-columns: 84px; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.m-cast .person .ph { border-radius: 50%; }
.pick-tip { font-size: 12px; color: var(--muted); margin: -4px 0 10px; }
.yt-fallback {
  position: absolute; inset: 0; z-index: 2; background: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 20px; text-align: center; color: #ccc;
}
.yt-fallback p { margin: 0; max-width: 420px; }

/* ---------- install / PWA ---------- */
.top-actions { display: flex; gap: 8px; align-items: center; }
.install-btn { background: var(--red); }
.install-btn:hover { background: #f6121d; }
@media (max-width: 420px) { .install-btn { padding: 9px 12px; font-size: 14px; } }
.install-card { padding: 28px 22px 26px; text-align: center; max-width: 440px; }
.install-icon { width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 16px; }
.install-card h2 { margin: 0 0 6px; }
.install-card ol { text-align: left; margin: 18px 0 0; padding-left: 22px; line-height: 1.6; }
.install-card li { margin-bottom: 8px; }
.install-card .kbd { display: inline-block; background: #333; border-radius: 4px; padding: 0 6px; }
#regionHint { display: block; margin: 6px 0 0; }
/* installed app: respect the phone notch / home indicator */
@media (display-mode: standalone) {
  .results { padding-bottom: max(40px, env(safe-area-inset-bottom)); }
}

/* ---------- SEO content: headings, breadcrumbs, link hubs ---------- */
a.brand { text-decoration: none; }
.page-title { font-size: clamp(20px, 3.4vw, 28px); line-height: 1.2; margin: 8px 0 6px; }
.page-intro { color: var(--muted); font-size: 14px; margin: 0 0 14px; max-width: 760px; }
.crumbs { font-size: 13px; color: var(--muted); margin-top: 8px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.crumbs span { margin: 0 6px; opacity: .6; }
.seo-links { margin-top: 48px; border-top: 1px solid var(--line); padding-top: 8px; }
.seo-links h2 { font-size: 16px; margin: 22px 0 10px; }
.seo-links ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.seo-links a { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; text-decoration: none; color: var(--text); background: var(--panel); }
.seo-links a:hover { border-color: #777; }
.credit a { color: #888; }
.static-page { max-width: 760px; margin: 0 auto; padding: 24px 16px 60px; }
.static-page h1 { margin-top: 8px; }
.static-page h2 { font-size: 18px; margin-top: 28px; }
.static-page p, .static-page li { color: #ccc; }

/* ---------- consent banner ---------- */
.consent {
  position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 70;
  max-width: 560px; margin: 0 auto; padding: 14px 16px; border-radius: 10px;
  background: #222; border: 1px solid var(--line); box-shadow: 0 10px 40px #000a;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 14px;
}
.consent p { margin: 0; flex: 1 1 260px; }
.consent-actions { display: flex; gap: 8px; }
.more-btn { margin: 20px auto 0; max-width: 360px; display: flex; }

/* ---------- brand: "MOVIE TO WATCH" ---------- */
.brand { white-space: nowrap; }
.brand span { margin-left: .28em; }
@media (max-width: 430px) {
  .brand { font-size: 17px; letter-spacing: .5px; }
  .top-actions { gap: 6px; }
}
@media (max-width: 480px) { .install-label { display: none; } .install-btn { padding: 9px 11px; } }
.topbar .btn { white-space: nowrap; }
@media (max-width: 345px) { .brand { font-size: 15px; letter-spacing: 0; } .topbar { padding-left: 12px; padding-right: 12px; } .topbar .btn { padding: 8px 10px; } }

/* ---------- answer content: ranked list + FAQ ---------- */
.seo-content { margin-top: 40px; max-width: 860px; }
.seo-content h2 { font-size: 20px; margin: 28px 0 6px; }
.seo-content .updated { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.ranked { margin: 0; padding-left: 26px; }
.ranked li { margin-bottom: 12px; line-height: 1.45; }
.ranked li::marker { color: var(--red); font-weight: 700; }
.ranked span { color: var(--muted); font-size: 14px; }
.faq h3 { font-size: 16px; margin: 20px 0 6px; }
.faq p { color: #ccc; margin: 0; }
.faq a { color: var(--text); }
