:root {
  --bg: #08090b;
  --panel: #121419;
  --panel-raised: #1a1d23;
  --text: #f7f7f5;
  --muted: #b9bbc2;
  --faint: #747780;
  --accent: #e50914;
  --focus: #ffffff;
  --safe-x: clamp(1.5rem, 3.8vw, 4.8rem);
  --safe-y: clamp(1.25rem, 3.2vh, 3rem);
  --card-radius: .55rem;
  color-scheme: dark;
  font-size: clamp(16px, 1.03vw, 24px);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
html { width: 100%; min-height: 100%; background: var(--bg); scroll-behavior: smooth; }
body { width: 100%; min-height: 100%; margin: 0; overflow-x: hidden; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { display: block; }
[hidden] { display: none !important; }
.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; }

.boot {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  background: var(--bg);
}
.boot-mark, .brand-mark {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-weight: 900;
  line-height: 1;
}
.boot-mark { width: 4.5rem; height: 4.5rem; font-size: 2.4rem; box-shadow: 0 0 3rem rgba(229, 9, 20, .24); }
.boot-copy { display: flex; flex-direction: column; gap: .3rem; }
.boot-copy strong { font-size: 1.2rem; letter-spacing: .22em; }
.boot-copy span { color: var(--muted); font-size: .78rem; }
.boot.is-leaving { opacity: 0; transition: opacity 180ms linear; }

.app { min-height: 100vh; background: var(--bg); }
.masthead {
  position: fixed;
  z-index: 20;
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 5.4rem;
  padding: var(--safe-y) var(--safe-x) 2rem;
  background: linear-gradient(180deg, rgba(8, 9, 11, .9), rgba(8, 9, 11, .34) 64%, transparent);
  pointer-events: none;
}
.masthead > * { pointer-events: auto; }
.brand { display: inline-flex; width: max-content; align-items: center; gap: .75rem; color: white; text-decoration: none; }
.brand-mark { width: 2.35rem; height: 2.35rem; font-size: 1.25rem; transition: transform 120ms ease, box-shadow 120ms linear; }
.brand-name { font-size: .88rem; font-weight: 900; letter-spacing: .18em; }
.nav { display: flex; align-items: center; gap: .18rem; padding: .25rem; border: 1px solid rgba(255, 255, 255, .08); border-radius: 2rem; background: rgba(12, 13, 16, .58); box-shadow: 0 .5rem 2rem rgba(0, 0, 0, .18); backdrop-filter: blur(12px); }
.nav-item {
  display: inline-flex;
  align-items: center;
  gap: .48rem;
  min-height: 2.7rem;
  padding: .55rem .88rem;
  border: 0;
  border-radius: 1.6rem;
  background: transparent;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 120ms linear, color 120ms linear, transform 120ms ease;
}
.nav-item.is-active { background: rgba(255, 255, 255, .15); color: white; }
.nav-icon { font-size: 1.05rem; line-height: 1; }
.nav-tv { font-size: .92rem; }
.status-cluster { justify-self: end; display: flex; align-items: center; gap: 1rem; color: var(--muted); }
.signal { display: flex; align-items: center; gap: .45rem; font-size: .7rem; font-weight: 700; }
.signal-dot { width: .48rem; height: .48rem; border-radius: 50%; background: #6c7078; }
.signal-dot.is-live { background: #46d369; box-shadow: 0 0 .7rem rgba(70, 211, 105, .48); }
.clock { min-width: 3.2rem; color: #d7d8db; font-size: .82rem; font-variant-numeric: tabular-nums; text-align: right; }

.hero { position: relative; height: min(86vh, 61rem); min-height: 38rem; overflow: hidden; background: #111318; contain: layout paint; }
.hero-artwork, .detail-artwork, .hero-shade, .detail-shade { position: absolute; inset: 0; }
.hero-shade, .detail-shade { z-index: 2; }
.hero-image, .detail-image { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.015); transition: opacity 320ms linear, transform 7s ease-out; }
.hero-image.is-loaded, .detail-image.is-loaded { opacity: 1; transform: scale(1); }
.artwork-fallback {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: grid;
  place-items: center;
  background: #151820;
  color: rgba(255, 255, 255, .06);
}
.artwork-fallback span { font-size: min(38vw, 28rem); font-weight: 900; }
.hero-shade {
  background:
    linear-gradient(90deg, rgba(8, 9, 11, .98) 0%, rgba(8, 9, 11, .74) 38%, rgba(8, 9, 11, .12) 72%),
    linear-gradient(0deg, var(--bg) 0%, rgba(8, 9, 11, .16) 38%, rgba(8, 9, 11, .22) 100%);
}
.hero-content { position: absolute; z-index: 3; left: var(--safe-x); bottom: clamp(8rem, 19vh, 13rem); width: min(43rem, 54vw); }
.hero-kicker, .eyebrow { margin: 0 0 .8rem; color: #e8e8e8; font-size: .72rem; font-weight: 850; letter-spacing: .17em; text-transform: uppercase; }
.hero-kicker::before, .eyebrow::before { display: inline-block; width: .32rem; height: .9rem; margin-right: .55rem; background: var(--accent); content: ""; vertical-align: -.1rem; }
.hero-title { max-width: 100%; margin: 0; font-size: clamp(2.9rem, 4.8vw, 5.4rem); font-weight: 900; line-height: .94; letter-spacing: -.055em; text-wrap: balance; text-shadow: 0 .15rem 1.3rem rgba(0, 0, 0, .38); }
.hero-meta { display: flex; flex-wrap: wrap; gap: .7rem 1rem; align-items: center; min-height: 1.4rem; margin-top: 1.25rem; color: #ececee; font-size: .88rem; font-weight: 650; }
.hero-meta span + span::before { margin-right: 1rem; color: #81848b; content: "•"; }
.hero-meta .rating { display: inline-flex; align-items: center; gap: .35rem; }
.hero-meta .rating::after { padding: .08rem .32rem; border-radius: .16rem; background: #f5c518; color: #111; content: "IMDb"; font-size: .52rem; font-weight: 900; order: -1; }
.hero-overview { display: -webkit-box; max-width: 39rem; margin: 1rem 0 0; overflow: hidden; color: #d1d2d6; font-size: 1rem; line-height: 1.48; text-wrap: pretty; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.hero-actions, .detail-actions { display: flex; gap: .75rem; margin-top: 1.55rem; }
.button, .control-button, .icon-button { border: 0; cursor: pointer; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .65rem; min-width: 7.8rem; min-height: 3.2rem; padding: .75rem 1.25rem; border-radius: .4rem; font-size: .9rem; font-weight: 850; transition: transform 120ms ease, background-color 120ms linear, color 120ms linear; }
.button:disabled { cursor: default; opacity: .38; }
.button-primary { background: white; color: #08090b; }
.button-secondary { background: rgba(109, 109, 110, .72); color: white; backdrop-filter: blur(8px); }
.button-icon { font-size: 1rem; line-height: 1; }
.button-info { display: grid; width: 1.12rem; height: 1.12rem; place-items: center; border: 2px solid currentColor; border-radius: 50%; font-family: Georgia, serif; font-size: .72rem; }
.hero-count { position: absolute; z-index: 3; right: var(--safe-x); bottom: clamp(8rem, 19vh, 13rem); display: flex; align-items: center; gap: .6rem; color: rgba(255, 255, 255, .72); font-size: .72rem; font-variant-numeric: tabular-nums; }
.hero-count i { width: 2.6rem; height: 2px; background: rgba(255, 255, 255, .28); }

.shelves { position: relative; z-index: 4; min-height: 30vh; margin-top: clamp(-8rem, -11vh, -5rem); padding: 0 0 6rem; }
.media-shelf { position: relative; margin-bottom: 2.1rem; padding-left: var(--safe-x); }
.shelf-heading { display: flex; align-items: center; justify-content: space-between; gap: 2rem; min-height: 2.2rem; padding-right: var(--safe-x); }
.shelf-heading h2 { margin: 0; font-size: 1.35rem; line-height: 1.2; letter-spacing: -.025em; }
.shelf-heading-actions { display: flex; align-items: center; gap: 1rem; }
.freshness { margin: 0; color: var(--muted); font-size: .68rem; }
.shelf-view-all {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: .5rem;
  min-height: 2.25rem;
  padding: .25rem .2rem .25rem .65rem;
  border: 0;
  border-radius: 1.4rem;
  background: transparent;
  color: #b9bbc2;
  font-size: .7rem;
  font-weight: 800;
  cursor: pointer;
  transition: color 120ms linear, background-color 120ms linear, transform 120ms ease;
}
.shelf-view-all b { display: grid; width: 1.65rem; height: 1.65rem; place-items: center; border: 1px solid rgba(255, 255, 255, .32); border-radius: 50%; color: white; font-size: 1.25rem; font-weight: 500; line-height: 1; }
.shelf-view-all.is-focused, .shelf-view-all:focus-visible { outline: 3px solid white; outline-offset: 3px; background: white; color: #08090b; transform: scale(1.04); }
.shelf-view-all.is-focused b, .shelf-view-all:focus-visible b { border-color: #08090b; color: #08090b; }
.media-row { display: flex; gap: .72rem; overflow-x: auto; overflow-y: visible; padding: .75rem var(--safe-x) 1.1rem 0; scrollbar-width: none; scroll-snap-type: x proximity; contain: layout; }
.media-row::-webkit-scrollbar { display: none; }
.shelves.is-grid-view { margin-top: 0; padding-top: 7.2rem; }
.shelves.is-grid-view .media-shelf { margin-bottom: 0; padding-right: var(--safe-x); }
.media-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
  overflow: visible;
  padding: 1rem 0 2rem;
  scroll-snap-type: none;
  contain: layout;
}
.media-grid .movie-card { width: 100%; min-width: 0; }
.catalog-more-wrap { display: flex; justify-content: center; padding: .6rem 0 3rem; }
.catalog-more {
  min-width: 18rem;
  min-height: 3.2rem;
  padding: .75rem 1.4rem;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 2rem;
  background: rgba(255, 255, 255, .08);
  color: white;
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
}
.catalog-more.is-focused, .catalog-more:focus-visible { outline: 3px solid white; outline-offset: 3px; background: white; color: #08090b; transform: scale(1.035); }
.movie-card {
  position: relative;
  flex: 0 0 clamp(14.4rem, 20.5vw, 24rem);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 0;
  border-radius: var(--card-radius);
  outline: 0 solid transparent;
  background: var(--panel-raised);
  color: white;
  text-align: left;
  scroll-snap-align: start;
  transform: translateZ(0);
  transition: transform 140ms ease, outline-color 100ms linear, box-shadow 140ms ease;
  contain: layout paint;
}
.movie-card-art { position: absolute; inset: 0; background: #20232a; }
.movie-card-art::after { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5, 6, 8, .95), transparent 58%); content: ""; }
.movie-card img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 180ms linear; }
.movie-card img.is-loaded { opacity: 1; }
.movie-card-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .08); font-size: 5rem; font-weight: 900; }
.movie-card-copy { position: absolute; z-index: 1; right: .8rem; bottom: .68rem; left: .8rem; display: flex; align-items: end; justify-content: space-between; gap: .7rem; }
.movie-card-title { min-width: 0; }
.movie-card h3 { max-width: 100%; margin: 0; overflow: hidden; font-size: .9rem; font-weight: 780; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.movie-card p { margin: .23rem 0 0; overflow: hidden; color: #c5c7cc; font-size: .64rem; text-overflow: ellipsis; white-space: nowrap; }
.movie-card-badge { flex: none; padding: .18rem .38rem; border-radius: .22rem; background: rgba(8, 9, 11, .78); color: #f5c518; font-size: .58rem; font-weight: 850; }
.genre-rows:empty { display: none; }

.empty-state { display: flex; align-items: center; gap: 1.5rem; margin: 2rem var(--safe-x); padding: 2rem; border: 1px solid rgba(255, 255, 255, .09); border-radius: .6rem; background: var(--panel); }
.empty-mark { display: grid; flex: none; width: 4rem; height: 4rem; place-items: center; border-radius: 50%; background: var(--accent); font-size: 2rem; font-weight: 900; }
.empty-state h2 { margin: 0; font-size: 1.35rem; }
.empty-state p { max-width: 40rem; margin: .45rem 0 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }

.remote-hints { position: fixed; z-index: 15; right: 0; bottom: 0; left: 0; display: flex; gap: 1.5rem; align-items: center; padding: .55rem var(--safe-x); background: rgba(8, 9, 11, .84); color: var(--faint); font-size: .6rem; backdrop-filter: blur(10px); }
.remote-hints span:last-child { margin-left: auto; }
kbd { padding: .12rem .28rem; border: 1px solid rgba(255, 255, 255, .2); border-radius: .18rem; color: #d7d8dc; font-family: inherit; }

.focusable:focus { outline: none; }
.focusable.is-focused, .focusable:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.brand.is-focused, .brand:focus-visible { outline: none; }
.brand.is-focused .brand-mark, .brand:focus-visible .brand-mark { transform: scale(1.1); box-shadow: 0 0 1.15rem rgba(229, 9, 20, .72); }
.nav-item.is-focused, .nav-item:focus-visible { background: white; color: #08090b; transform: scale(1.035); }
.button.is-focused, .button:focus-visible, .control-button.is-focused, .control-button:focus-visible { transform: scale(1.055); }
.movie-card.is-focused, .movie-card:focus-visible { z-index: 5; outline-color: var(--focus); box-shadow: 0 .7rem 2rem rgba(0, 0, 0, .58); transform: scale(1.065) translateZ(0); }

.overlay { position: fixed; z-index: 40; inset: 0; overflow: auto; padding: var(--safe-y) var(--safe-x) 5rem; background: var(--bg); }
.overlay-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; }
.overlay-head h2 { max-width: 55rem; margin: 0; font-size: clamp(2rem, 3.4vw, 3.7rem); line-height: 1.04; letter-spacing: -.045em; }
.icon-button { display: grid; flex: none; width: 3rem; height: 3rem; place-items: center; border: 1px solid rgba(255, 255, 255, .3); border-radius: 50%; background: rgba(12, 13, 16, .72); color: white; font-size: 1.65rem; line-height: 1; backdrop-filter: blur(8px); }
.search-box { display: flex; align-items: center; gap: 1rem; max-width: 62rem; margin-top: 2.5rem; border: 2px solid rgba(255, 255, 255, .2); border-radius: .72rem; background: var(--panel); padding: 0 1.15rem; transition: border-color 120ms linear, box-shadow 120ms linear, background-color 120ms linear; }
.search-box:focus-within { border-color: rgba(255, 255, 255, .92); background: #15181e; box-shadow: 0 0 0 2px rgba(255, 255, 255, .12), 0 .65rem 2rem rgba(0, 0, 0, .34); }
.search-symbol { color: var(--muted); font-size: 1.7rem; }
.search-box input { width: 100%; border: 0; background: transparent; padding: 1rem 0; color: white; font-size: 1.25rem; outline: 0; }
.search-box input.focusable.is-focused, .search-box input.focusable:focus-visible { outline: none; outline-offset: 0; }
.search-box input::placeholder { color: #777a82; }
.search-filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: .65rem; margin-top: 1rem; }
.search-filter {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 3.7rem;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: .15rem .65rem;
  align-content: center;
  padding: .65rem .8rem .68rem .9rem;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: .58rem;
  background: rgba(255, 255, 255, .045);
  color: white;
  text-align: left;
  cursor: pointer;
  transition: background-color 110ms linear, border-color 110ms linear, box-shadow 110ms linear, transform 110ms ease;
}
.search-filter::before { position: absolute; top: .55rem; bottom: .55rem; left: 0; width: 3px; border-radius: 0 3px 3px 0; background: transparent; content: ""; }
.search-filter-label { color: var(--faint); font-size: .55rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.search-filter strong { overflow: hidden; font-size: .76rem; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.search-filter-arrow { grid-row: 1 / 3; grid-column: 2; align-self: center; color: var(--muted); font-size: 1.1rem; }
.search-filter.is-active { border-color: rgba(229, 9, 20, .58); background: rgba(229, 9, 20, .09); }
.search-filter.is-active::before { background: var(--accent); }
.search-filter.is-focused, .search-filter:focus-visible,
.search-filter-reset.is-focused, .search-filter-reset:focus-visible {
  z-index: 2;
  border-color: white;
  outline: none;
  box-shadow: 0 0 0 3px white;
  background: rgba(255, 255, 255, .13);
  transform: scale(1.035);
}
.search-filter-reset { min-height: 3.7rem; padding: .65rem 1rem; border: 1px solid rgba(229, 9, 20, .64); border-radius: .58rem; background: rgba(229, 9, 20, .11); color: #fff; font-size: .68rem; font-weight: 850; white-space: nowrap; cursor: pointer; }
.search-summary { min-height: 1rem; margin: 1rem 0 0; color: var(--muted); font-size: .72rem; }
.search-results { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 1.25rem; padding-bottom: 3rem; }
.search-results .movie-card { width: 100%; min-width: 0; }

.search-filter-overlay {
  position: fixed;
  z-index: 48;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: var(--safe-y) var(--safe-x);
  background:
    radial-gradient(circle at 22% 14%, rgba(229, 9, 20, .14), transparent 30rem),
    rgba(3, 4, 6, .9);
  backdrop-filter: blur(18px);
}
.search-filter-dialog {
  position: relative;
  width: min(76rem, 92vw);
  max-height: calc(100vh - 2 * var(--safe-y));
  overflow: auto;
  padding: clamp(1.6rem, 3vw, 3rem);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 1rem;
  background: linear-gradient(145deg, rgba(28, 30, 36, .99), rgba(10, 11, 14, .99));
  box-shadow: 0 2rem 7rem rgba(0, 0, 0, .74);
}
.search-filter-dialog::before { position: absolute; top: 0; right: 3rem; left: 3rem; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); content: ""; }
.search-filter-dialog .overlay-head h2 { font-size: clamp(2.2rem, 3.6vw, 4.2rem); }
.search-filter-intro { max-width: 40rem; margin: .8rem 0 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.search-filter-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin-top: 2rem; }
.search-filter-option {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 5rem;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  overflow: hidden;
  padding: .85rem 1rem .85rem 1.15rem;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: .58rem;
  background: rgba(255, 255, 255, .045);
  color: white;
  text-align: left;
  cursor: pointer;
  transition: background-color 110ms linear, border-color 110ms linear, box-shadow 110ms linear, transform 110ms ease;
}
.search-filter-option::before { position: absolute; top: 0; bottom: 0; left: 0; width: .25rem; background: transparent; content: ""; }
.search-filter-option.is-selected { border-color: rgba(229, 9, 20, .64); background: rgba(229, 9, 20, .1); }
.search-filter-option.is-selected::before { background: var(--accent); }
.search-filter-option-copy { display: flex; min-width: 0; flex-direction: column; gap: .32rem; }
.search-filter-option strong { overflow: hidden; font-size: .88rem; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.search-filter-option-copy > span { color: var(--muted); font-size: .6rem; font-weight: 650; }
.search-filter-check { flex: none; color: var(--faint); font-size: 1.2rem; }
.search-filter-option.is-selected .search-filter-check { color: #ff5360; }
.search-filter-option.is-focused, .search-filter-option:focus-visible { z-index: 2; border-color: white; outline: none; box-shadow: 0 0 0 3px white; background: rgba(255, 255, 255, .13); transform: scale(1.035); }
.search-filter-status { min-height: 1rem; margin: 1.15rem 0 0; color: var(--faint); font-size: .64rem; }

.genre-overlay {
  position: fixed;
  z-index: 45;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: var(--safe-y) var(--safe-x);
  background:
    radial-gradient(circle at 78% 14%, rgba(229, 9, 20, .13), transparent 34rem),
    rgba(3, 4, 6, .88);
  backdrop-filter: blur(18px);
}
.genre-dialog {
  position: relative;
  width: min(76rem, 92vw);
  max-height: calc(100vh - 2 * var(--safe-y));
  overflow: auto;
  padding: clamp(1.6rem, 3vw, 3rem);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 1rem;
  background: linear-gradient(145deg, rgba(28, 30, 36, .98), rgba(10, 11, 14, .99));
  box-shadow: 0 2rem 7rem rgba(0, 0, 0, .72);
}
.genre-dialog::before {
  position: absolute;
  top: 0;
  right: 3rem;
  left: 3rem;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  content: "";
}
.genre-dialog .overlay-head h2 { font-size: clamp(2.2rem, 3.6vw, 4.2rem); }
.genre-intro { max-width: 40rem; margin: .8rem 0 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.genre-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin-top: 2rem; }
.genre-option {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 5.2rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  overflow: hidden;
  padding: .9rem 1rem .9rem 1.15rem;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: .55rem;
  background: rgba(255, 255, 255, .045);
  color: white;
  text-align: left;
  cursor: pointer;
  transition: background-color 110ms linear, border-color 110ms linear, color 110ms linear, transform 110ms ease;
}
.genre-option::before { position: absolute; top: 0; bottom: 0; left: 0; width: .25rem; background: transparent; content: ""; }
.genre-option.is-selected { border-color: rgba(229, 9, 20, .62); background: rgba(229, 9, 20, .1); }
.genre-option.is-selected::before { background: var(--accent); }
.genre-option-copy { display: flex; min-width: 0; flex-direction: column; gap: .3rem; }
.genre-option strong { overflow: hidden; font-size: .92rem; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.genre-option-copy > span { color: var(--muted); font-size: .62rem; font-weight: 650; }
.genre-option-arrow { color: var(--faint); font-size: 1.7rem; line-height: 1; }
.genre-option.is-focused, .genre-option:focus-visible {
  z-index: 2;
  border-color: white;
  outline: 3px solid white;
  outline-offset: 3px;
  background: white;
  color: #08090b;
  transform: scale(1.035);
}
.genre-option.is-focused .genre-option-copy > span, .genre-option:focus-visible .genre-option-copy > span,
.genre-option.is-focused .genre-option-arrow, .genre-option:focus-visible .genre-option-arrow { color: #4e5158; }
.genre-status { min-height: 1rem; margin: 1.15rem 0 0; color: var(--faint); font-size: .64rem; }

.detail-overlay { overflow: hidden; padding: 0; background: var(--bg); }
.detail-shade { background: linear-gradient(90deg, rgba(8, 9, 11, .99) 0%, rgba(8, 9, 11, .84) 42%, rgba(8, 9, 11, .16) 80%), linear-gradient(0deg, rgba(8, 9, 11, .86), transparent 52%); }
.detail-close { position: absolute; z-index: 4; top: var(--safe-y); right: var(--safe-x); }
.detail-content { position: absolute; z-index: 3; left: var(--safe-x); bottom: 8vh; width: min(44rem, 55vw); }
.detail-content h2 { margin: 0; font-size: clamp(3rem, 5.3vw, 6.2rem); font-weight: 900; line-height: .92; letter-spacing: -.055em; text-wrap: balance; }
.detail-overview { display: -webkit-box; max-width: 39rem; margin: 1rem 0 0; overflow: hidden; color: #d4d5d8; font-size: .96rem; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.detail-credits { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; max-width: 38rem; margin: 1.15rem 0 0; font-size: .72rem; line-height: 1.4; }
.detail-credits dt { color: #92959d; }
.detail-credits dd { margin: 0; color: #d3d4d7; }

.player { position: fixed; z-index: 60; inset: 0; overflow: hidden; background: #000; }
.player-topbar { position: absolute; z-index: 3; top: 0; right: 0; left: 0; display: flex; align-items: center; justify-content: space-between; padding: 1.5rem var(--safe-x) 4rem; background: linear-gradient(180deg, rgba(0, 0, 0, .92), transparent); }
.player-topbar h2 { margin: 0; font-size: 1.35rem; }
.player-actions { display: flex; align-items: center; gap: .75rem; }
.player-verify { color: white; text-decoration: none; }
.player-stage { position: absolute; inset: 0; display: grid; place-items: center; }
.player-stage iframe, .player-stage video { width: 100%; height: 100%; border: 0; background: #000; }
.player-controls { position: absolute; z-index: 3; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; gap: .65rem; padding: 5.5rem var(--safe-x) 1.25rem; background: linear-gradient(0deg, rgba(0, 0, 0, .98) 0%, rgba(0, 0, 0, .78) 48%, transparent 100%); }
.player-topbar, .player-controls { transition: opacity 260ms linear; }

/* pointer-events matters as much as opacity here. A faded-but-present bar still swallows
   every tap in the region it covers, which on a phone meant the embedded player's own
   seek bar and fullscreen button were unreachable even when our chrome looked gone. */
.player.is-idle .player-topbar,
.player.is-idle .player-controls { opacity: 0; pointer-events: none; }

/* Embedded players draw their own controls along the bottom edge. Ours must not sit on top
   of them, so for embeds the source switcher moves to the top of the screen instead. For
   HLS we own the <video> and there is nothing underneath to collide with. */
.player.is-embed .player-controls {
  top: 5.6rem;
  bottom: auto;
  padding: .9rem var(--safe-x) 1.4rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, .82), transparent);
}
.player.is-embed .media-buttons { display: none; }
.player.is-embed .player-source-panel { margin-left: auto; }
.player-timeline-row { display: flex; align-items: center; gap: 1rem; width: 100%; }
.player-scrubber { position: relative; display: block; flex: 1; height: 2rem; margin: 0; padding: 0; border: 0; outline: none; background: transparent; cursor: pointer; }
.player-track { position: absolute; top: 50%; right: 0; left: 0; height: .3rem; overflow: visible; border-radius: 999px; background: rgba(255, 255, 255, .3); transform: translateY(-50%); transition: height 100ms ease; }
.player-track-buffered, .player-track-progress { position: absolute; inset: 0; border-radius: inherit; transform: scaleX(0); transform-origin: left center; }
.player-track-buffered { background: rgba(255, 255, 255, .46); }
.player-track-progress { background: var(--accent); }
.player-track-thumb { position: absolute; top: 50%; left: 0; width: .85rem; height: .85rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 .18rem rgba(229, 9, 20, .22); transform: translate(-50%, -50%) scale(.72); transition: transform 100ms ease; }
.player-scrubber.is-focused .player-track, .player-scrubber:focus-visible .player-track { height: .52rem; }
.player-scrubber.is-focused .player-track-thumb, .player-scrubber:focus-visible .player-track-thumb { box-shadow: 0 0 0 .24rem rgba(255, 255, 255, .95); transform: translate(-50%, -50%) scale(1); }
.player-scrubber.is-focused, .player-scrubber:focus-visible { outline: none; }
.player-time { min-width: 8.5rem; color: #f7f7f7; font-size: .72rem; font-variant-numeric: tabular-nums; font-weight: 750; text-align: right; }
.player-control-deck { display: flex; align-items: center; justify-content: space-between; gap: 2rem; min-height: 4rem; }
.source-buttons, .media-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.media-buttons { margin-left: -.55rem; }
.player-control-button { display: inline-grid; min-width: 4.7rem; padding: .28rem .35rem; border: 0; outline: none; background: transparent; color: #d9dade; place-items: center; gap: .18rem; font-family: inherit; font-size: .52rem; font-weight: 750; cursor: pointer; }
.player-control-glyph { display: inline-flex; width: 2.7rem; height: 2.7rem; align-items: center; justify-content: center; gap: .08rem; border: 1px solid rgba(255, 255, 255, .18); border-radius: 50%; background: rgba(28, 30, 35, .88); color: white; font-size: 1.18rem; line-height: 1; box-shadow: 0 .3rem .9rem rgba(0, 0, 0, .28); transition: transform 120ms ease, background-color 120ms linear, color 120ms linear, box-shadow 120ms linear; }
.player-control-glyph small { font-size: .48rem; font-weight: 900; }
.player-control-word { font-size: .47rem; font-weight: 950; letter-spacing: .04em; }
.player-control-button.is-focused, .player-control-button:focus-visible { color: white; outline: none; }
.player-control-button.is-focused .player-control-glyph, .player-control-button:focus-visible .player-control-glyph { background: white; color: #08090b; box-shadow: 0 0 0 .18rem rgba(255, 255, 255, .22), 0 .45rem 1.2rem rgba(0, 0, 0, .4); transform: scale(1.16); }
.player-source-panel { display: flex; align-items: center; gap: .6rem; }
.player-source-label { color: #9b9da4; font-size: .5rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.source-button { min-height: 2.35rem; padding: .45rem .75rem; border: 1px solid rgba(255, 255, 255, .25); border-radius: .35rem; outline: none; background: rgba(20, 22, 27, .82); color: #d8d9dc; font-family: inherit; font-size: .58rem; font-weight: 800; cursor: pointer; }
.source-button.is-active { border-color: rgba(229, 9, 20, .9); box-shadow: inset 3px 0 0 var(--accent); color: white; }
.source-button.is-focused, .source-button:focus-visible { border-color: white; background: white; color: #08090b; box-shadow: 0 0 0 3px rgba(255, 255, 255, .2); transform: scale(1.05); }
.player-remote-guide { margin: 0; color: #85888f; font-size: .48rem; font-weight: 650; letter-spacing: .02em; }
.player-remote-guide span { padding: 0 .28rem; color: #55585f; }
.player-remote-guide kbd { color: #bfc1c6; }
.control-button { min-width: 5.5rem; padding: .65rem .9rem; border: 1px solid rgba(255, 255, 255, .45); border-radius: .35rem; background: rgba(0, 0, 0, .75); font-size: .72rem; font-weight: 800; }
.control-button.is-active { border-color: white; background: white; color: #08090b; }
.player.is-buffering .player-stage video { opacity: .86; }
.player-message { position: absolute; z-index: 4; top: 50%; left: 50%; margin: 0; transform: translate(-50%, -50%); color: white; font-size: .9rem; }
.toast { position: fixed; z-index: 80; right: var(--safe-x); bottom: 3.5rem; max-width: 32rem; padding: .85rem 1rem; border-left: 4px solid var(--accent); border-radius: .25rem; background: #24262c; color: white; font-size: .78rem; box-shadow: 0 .8rem 2rem rgba(0, 0, 0, .45); }

@media (max-width: 1100px) {
  :root { --safe-x: 1.4rem; --safe-y: 1.15rem; }
  .masthead { grid-template-columns: auto 1fr auto; }
  .brand-name, .signal span:last-child { display: none; }
  .nav { justify-self: center; }
  .hero-content { width: 64vw; }
  .movie-card { flex-basis: 27vw; }
  .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .search-results { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .search-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .search-filter-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .genre-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  :root { font-size: 16px; }
  .masthead { display: flex; justify-content: space-between; }
  .status-cluster { display: none; }
  .nav-item { min-width: 2.7rem; padding: .55rem .8rem; }
  .nav-item > span:last-child { display: none; }
  .hero { height: 82vh; min-height: 37rem; }
  .hero-shade { background: linear-gradient(0deg, var(--bg) 0%, rgba(8, 9, 11, .5) 52%, rgba(8, 9, 11, .22) 100%); }
  .hero-content { bottom: 7rem; width: calc(100% - 3rem); }
  .hero-title { font-size: 2.8rem; }
  .hero-overview { font-size: .9rem; -webkit-line-clamp: 3; }
  .hero-count { display: none; }
  .shelves { margin-top: -4rem; }
  .movie-card { flex-basis: 76vw; }
  .media-grid { grid-template-columns: 1fr; }
  .freshness { display: none; }
  .remote-hints { display: none; }
  .search-results { grid-template-columns: 1fr; }
  .search-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-filter-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-filter-dialog { width: 100%; }
  .genre-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .genre-dialog { width: 100%; }
  .detail-shade { background: linear-gradient(0deg, rgba(8, 9, 11, .98) 0%, rgba(8, 9, 11, .65) 72%, rgba(8, 9, 11, .18)); }
  .detail-content { bottom: 3rem; width: calc(100% - 3rem); }
  .detail-content h2 { font-size: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
}
