:root {
  color-scheme: dark;
  --bg: #050505;
  --black: #000000;
  --surface: #141414;
  --surface-2: #1f1f1f;
  --surface-3: #2b2b2b;
  --line: rgba(255, 255, 255, 0.11);
  --text: #f5f5f1;
  --muted: #b3b3b3;
  --faint: #777777;
  --red: #e50914;
  --red-dark: #b20710;
  --header: rgba(5, 5, 5, 0.82);
  --shadow: 0 28px 84px rgba(0, 0, 0, 0.72);
  --billboard: url("https://image.tmdb.org/t/p/original/7RyHsO4yDXtBv1zUU3mTpHeQ0d5.jpg");
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

html {
  scrollbar-color: #555 var(--black);
}

body {
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.98), rgba(0, 0, 0, 0.74)),
    radial-gradient(circle at 72% 16%, rgba(229, 9, 20, 0.28), transparent 34rem),
    #050505;
}

.auth-card {
  width: min(440px, 100%);
  display: grid;
  gap: 28px;
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 12, 12, 0.92);
  box-shadow: var(--shadow);
}

.auth-brand {
  color: var(--red);
  font-size: 46px;
  font-weight: 950;
  line-height: 1;
}

.pin-form {
  display: grid;
  gap: 12px;
}

.pin-form label {
  color: #ffffff;
  font-size: 22px;
  font-weight: 850;
}

.pin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.pin-row input {
  min-width: 0;
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 3px;
  background: #050505;
  color: #ffffff;
  padding: 0 16px;
  outline: none;
  font-size: 24px;
  letter-spacing: 0;
}

.pin-row input:focus {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.64);
}

.pin-row button {
  min-height: 54px;
  border: 0;
  border-radius: 3px;
  background: var(--red);
  color: #ffffff;
  padding: 0 18px;
  font-weight: 850;
}

.pin-row button:hover {
  background: var(--red-dark);
}

#pinStatus {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
}

body.is-locked .site-header,
body.is-locked .page-shell,
body.is-locked .mobile-nav {
  visibility: hidden;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 0 4vw;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.98), var(--header) 74%, rgba(0, 0, 0, 0));
  backdrop-filter: blur(8px);
}

.brand {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--red);
  padding: 0;
  font-size: 32px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
}

.main-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.main-nav button,
.profile-button,
.link-button {
  border: 0;
  background: transparent;
  color: #d4d4d4;
  font-weight: 650;
}

.main-nav button {
  min-height: 40px;
  border-radius: 3px;
  padding: 0 13px;
  font-size: 14px;
}

.main-nav button:hover,
.main-nav button.active,
.link-button:hover,
.mobile-nav button.active {
  color: #ffffff;
}

.main-nav button.active {
  background: rgba(255, 255, 255, 0.1);
}

.profile-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  background: var(--red);
  color: #ffffff;
  font-weight: 900;
}

.page-shell {
  width: 100%;
  margin: 0;
  padding: 0 0 64px;
}

.search-panel {
  position: relative;
  min-height: 690px;
  display: grid;
  align-content: end;
  gap: 18px;
  margin-top: -68px;
  overflow: hidden;
  padding: 156px 4vw 128px;
  background: var(--black);
}

.billboard-art {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, #050505 0%, rgba(5, 5, 5, 0.88) 22%, rgba(5, 5, 5, 0.34) 58%, rgba(5, 5, 5, 0.72) 100%),
    linear-gradient(0deg, #050505 0%, rgba(5, 5, 5, 0.72) 18%, rgba(5, 5, 5, 0) 44%),
    var(--billboard);
  background-position: center;
  background-size: cover;
  transform: scale(1.01);
}

.search-copy,
.billboard-actions,
.search-form,
.search-status {
  position: relative;
  z-index: 1;
}

.search-copy {
  max-width: 760px;
  display: grid;
  gap: 10px;
}

.kicker {
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
}

.search-panel h1 {
  margin: 0;
  color: #ffffff;
  font-size: 76px;
  line-height: 0.95;
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.75);
}

.billboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-action,
.secondary-action {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 4px;
  padding: 0 24px;
  font-size: 16px;
  font-weight: 850;
}

.primary-action {
  background: #ffffff;
  color: #050505;
}

.primary-action:hover {
  background: rgba(255, 255, 255, 0.78);
}

.secondary-action {
  background: rgba(109, 109, 110, 0.72);
  color: #ffffff;
}

.secondary-action:hover {
  background: rgba(109, 109, 110, 0.5);
}

.primary-action svg,
.secondary-action svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-form {
  width: min(720px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.34);
}

.search-form:focus-within {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.7);
}

.search-form input {
  min-width: 0;
  min-height: 56px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0 18px;
  outline: none;
  font-size: 18px;
}

.search-form input::placeholder {
  color: #8f8f8f;
}

.search-form button {
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--red);
  color: #ffffff;
  display: grid;
  place-items: center;
}

.search-form button:hover {
  background: var(--red-dark);
}

.search-form svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.search-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.continue-section,
.featured-section,
.results-section,
.library-section {
  position: relative;
  z-index: 2;
  margin-top: 32px;
  padding: 0 4vw;
}

body[data-screen="home"] .featured-section {
  margin-top: 36px;
}

body[data-screen="home"] .continue-section[hidden] + .featured-section {
  margin-top: -66px;
}

.results-section h2,
.continue-section h2,
.featured-section h2,
.section-title h2,
.rail-section h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.results-section h2::before,
.continue-section h2 > span:first-child,
.featured-section h2 > span:first-child,
.section-title h2 > span:first-child,
.rail-section h2 > span:first-child {
  content: "";
  width: 4px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--red);
}

.featured-grid {
  display: grid;
  gap: 18px;
}

.rail-section {
  min-width: 0;
}

.continue-grid,
.rail-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0 28px;
  scroll-padding-left: 4vw;
  scroll-snap-type: x proximity;
}

.continue-grid::-webkit-scrollbar,
.rail-grid::-webkit-scrollbar {
  height: 8px;
}

.continue-grid::-webkit-scrollbar-thumb,
.rail-grid::-webkit-scrollbar-thumb {
  background: #555555;
  border-radius: 999px;
}

.rail-grid .media-card,
.continue-grid .media-card {
  flex: 0 0 286px;
  scroll-snap-align: start;
}

.media-card {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.card-poster {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 3px;
  background:
    linear-gradient(135deg, rgba(229, 9, 20, 0.34), rgba(0, 0, 0, 0.1)),
    var(--surface-2);
  background-image: var(--thumb);
  background-size: cover;
  background-position: center;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
}

.rail-grid .card-poster,
.continue-grid .card-poster {
  aspect-ratio: 16 / 9;
}

.library-section .card-poster,
.results-section .card-poster {
  aspect-ratio: 2 / 3;
  background-image: var(--poster);
}

.card-poster.missing-poster {
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    linear-gradient(160deg, rgba(229, 9, 20, 0.55), rgba(0, 0, 0, 0.86) 58%),
    var(--surface-2);
}

.poster-fallback {
  display: none;
}

.card-poster.missing-poster .poster-fallback {
  display: block;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

.media-card:hover .card-poster {
  transform: scale(1.045);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.68);
  filter: brightness(1.08);
}

.rating {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.78);
  color: #ffffff;
  font-size: 12px;
  font-weight: 850;
}

.rating.has-rating::before {
  content: "R ";
  color: var(--red);
}

.media-card strong,
.media-card > span:not(.card-poster) {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-card strong {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 760;
}

.media-card > span {
  margin-top: 3px;
  color: var(--faint);
  font-size: 13px;
}

.continue-card {
  position: relative;
}

.watch-progress {
  display: block;
  height: 4px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.watch-progress::before {
  content: "";
  display: block;
  width: var(--progress);
  height: 100%;
  background: var(--red);
}

.continue-label {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.link-button {
  min-height: 36px;
  border-radius: 3px;
  padding: 0 12px;
}

.library-section {
  padding-top: 96px;
}

.library-section .featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 26px 10px;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 180px;
  display: grid;
  place-items: center;
  margin: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.results-section {
  padding-top: 24px;
}

.results-list {
  display: grid;
  gap: 8px;
}

.result-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 134px;
  border: 0;
  border-radius: 3px;
  background: #181818;
  color: inherit;
  padding: 12px;
  text-align: left;
}

.result-row:hover {
  background: #262626;
}

.result-poster {
  width: 96px;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 3px;
  background:
    linear-gradient(135deg, rgba(229, 9, 20, 0.34), rgba(0, 0, 0, 0.1)),
    var(--surface-2);
  background-image: var(--poster);
  background-size: cover;
  background-position: center;
}

.result-title {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  margin-bottom: 9px;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 2px;
  color: #ffffff;
  background: var(--red);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.badge.tv {
  background: #8b0008;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.result-description {
  margin: 0;
  max-width: 1100px;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.player-section {
  padding: 86px 4vw 46px;
  background: var(--black);
}

.hero-backdrop {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000000;
  box-shadow: var(--shadow);
}

.hero-backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--backdrop);
  background-size: cover;
  background-position: center;
  opacity: 0.16;
  filter: saturate(0.75);
}

.hero-backdrop iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000000;
}

.stream-list {
  display: grid;
  background: #080808;
}

.stream-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px auto auto 1fr;
  align-items: center;
  gap: 12px;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: var(--text);
  padding: 0 24px;
  text-align: left;
}

.stream-row:hover {
  background: rgba(229, 9, 20, 0.18);
}

.play-dot {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
}

.play-dot::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 10px solid #050505;
}

.source {
  font-weight: 850;
}

.source.free {
  color: var(--red);
}

#streamRegion {
  justify-self: end;
  color: var(--muted);
}

.episode-controls {
  display: grid;
  grid-template-columns: auto minmax(96px, 130px) minmax(96px, 130px) auto auto;
  align-items: end;
  gap: 12px;
  padding: 16px 24px;
  background: #0f0f0f;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.episode-controls button {
  min-height: 42px;
  border: 0;
  border-radius: 3px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-weight: 760;
}

.episode-controls button:hover {
  background: var(--red);
}

.episode-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.episode-controls input {
  min-width: 0;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 3px;
  background: #050505;
  color: var(--text);
  padding: 0 10px;
  outline: none;
}

.episode-controls input:focus {
  border-color: var(--red);
}

.detail-panel {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 24px;
  padding: 28px 0 0;
  background: #000000;
}

.detail-poster {
  width: 128px;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 3px;
  background:
    linear-gradient(135deg, rgba(229, 9, 20, 0.34), rgba(0, 0, 0, 0.1)),
    var(--surface-2);
  background-image: var(--poster);
  background-size: cover;
  background-position: center;
}

.detail-copy {
  min-width: 0;
}

.detail-copy h2 {
  margin: 0 0 8px;
  font-size: 44px;
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.detail-copy p {
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
}

.detail-meta span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 3px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.1);
}

.mobile-nav {
  display: none;
}

body.modal-open {
  overflow: hidden;
}

.title-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
}

.modal-panel {
  position: relative;
  width: min(1060px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: hidden auto;
  border-radius: 8px;
  background: #111111;
  box-shadow: 0 34px 120px rgba(0, 0, 0, 0.9);
  animation: modalIn 180ms ease-out;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.98) translateY(16px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  color: #ffffff;
  font-size: 22px;
  font-weight: 850;
  line-height: 1;
}

.modal-backdrop-art {
  position: relative;
  min-height: 360px;
  background-image:
    linear-gradient(0deg, #111111 0%, rgba(17, 17, 17, 0.76) 24%, rgba(17, 17, 17, 0.06) 64%),
    var(--modal-backdrop);
  background-position: center;
  background-size: cover;
}

.modal-content {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr);
  gap: 24px;
  margin-top: -118px;
  padding: 0 30px 30px;
  position: relative;
}

.modal-poster {
  width: 178px;
  aspect-ratio: 2 / 3;
  border-radius: 5px;
  background:
    linear-gradient(135deg, rgba(229, 9, 20, 0.34), rgba(0, 0, 0, 0.1)),
    var(--surface-2);
  background-image: var(--poster);
  background-position: center;
  background-size: cover;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.64);
}

.modal-copy {
  min-width: 0;
  align-self: end;
}

.modal-eyebrow {
  color: var(--red);
  font-weight: 900;
}

.modal-copy h2 {
  margin: 8px 0 12px;
  font-size: 44px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.modal-meta span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.modal-copy p {
  max-width: 760px;
  color: #d5d5d5;
  line-height: 1.55;
}

.modal-episode-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 120px));
  gap: 10px;
  margin: 16px 0;
}

.modal-episode-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.modal-episode-controls input {
  min-width: 0;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  background: #050505;
  color: #ffffff;
  padding: 0 10px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1180px) {
  .rail-grid .media-card,
  .continue-grid .media-card {
    flex-basis: 244px;
  }

  .library-section .featured-grid {
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  }
}

@media (max-width: 850px) {
  body {
    padding-bottom: 74px;
  }

  .site-header {
    height: 58px;
    padding: 0 14px;
    gap: 12px;
  }

  .brand {
    font-size: 26px;
  }

  .main-nav {
    display: none;
  }

  .profile-button {
    margin-left: auto;
    width: 32px;
    height: 32px;
  }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    height: 68px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.96);
    backdrop-filter: blur(10px);
  }

  .mobile-nav button {
    min-width: 0;
    border: 0;
    background: transparent;
    color: #a8a8a8;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 750;
  }

  .mobile-nav svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .search-panel {
    min-height: 590px;
    margin-top: -58px;
    padding: 116px 16px 104px;
  }

  .billboard-art {
    background-image:
      linear-gradient(0deg, #050505 0%, rgba(5, 5, 5, 0.86) 22%, rgba(5, 5, 5, 0.2) 54%),
      linear-gradient(90deg, rgba(5, 5, 5, 0.94) 0%, rgba(5, 5, 5, 0.28) 100%),
      var(--billboard);
    background-position: center top;
  }

  .search-panel h1 {
    font-size: 46px;
  }

  .kicker {
    font-size: 13px;
  }

  .billboard-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .primary-action,
  .secondary-action {
    min-height: 44px;
    padding: 0 12px;
    font-size: 15px;
  }

  .search-form {
    grid-template-columns: minmax(0, 1fr) 50px;
  }

  .search-form input {
    min-height: 50px;
    font-size: 16px;
  }

  .continue-section,
  .featured-section,
  .results-section,
  .library-section {
    padding: 0 14px;
  }

  body[data-screen="home"] .featured-section {
    margin-top: 30px;
  }

  body[data-screen="home"] .continue-section[hidden] + .featured-section {
    margin-top: -58px;
  }

  .results-section h2,
  .continue-section h2,
  .featured-section h2,
  .section-title h2 {
    font-size: 19px;
  }

  .rail-grid .media-card,
  .continue-grid .media-card {
    flex-basis: 78vw;
  }

  .library-section {
    padding-top: 72px;
  }

  .library-section .featured-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 8px;
  }

  .library-section .media-card strong {
    font-size: 12px;
  }

  .library-section .media-card > span {
    font-size: 11px;
  }

  .result-row {
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 12px;
    min-height: 112px;
    padding: 10px;
  }

  .result-poster {
    width: 74px;
  }

  .result-title {
    font-size: 15px;
  }

  .result-description {
    display: none;
  }

  .player-section {
    padding: 58px 0 30px;
  }

  .hero-backdrop {
    border-radius: 0;
  }

  .stream-row {
    padding: 0 14px;
    grid-template-columns: 32px auto auto 1fr;
  }

  .episode-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 14px;
  }

  .episode-controls button,
  .episode-controls input {
    width: 100%;
  }

  .detail-panel {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 16px;
    padding: 18px 14px 0;
  }

  .detail-poster {
    width: 96px;
  }

  .detail-copy h2 {
    font-size: 28px;
  }

  .title-modal {
    align-items: end;
    padding: 0;
  }

  .modal-panel {
    width: 100%;
    max-height: 86vh;
    border-radius: 14px 14px 0 0;
  }

  .modal-backdrop-art {
    min-height: 230px;
  }

  .modal-content {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 14px;
    margin-top: -72px;
    padding: 0 16px 22px;
  }

  .modal-poster {
    width: 104px;
  }

  .modal-copy h2 {
    font-size: 28px;
  }

  .modal-copy p {
    grid-column: 1 / -1;
  }

  .modal-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 430px) {
  .search-panel h1 {
    font-size: 40px;
  }

  .rail-grid .media-card,
  .continue-grid .media-card {
    flex-basis: 82vw;
  }

  .library-section .featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-panel {
    grid-template-columns: 1fr;
  }

  .detail-poster {
    width: 132px;
  }

  .modal-content {
    grid-template-columns: 1fr;
  }

  .modal-poster {
    width: 132px;
  }
}

/* Riley+ premium revamp */
:root {
  --bg: #071225;
  --black: #020611;
  --surface: rgba(14, 27, 54, 0.82);
  --surface-2: #102044;
  --surface-3: #172f62;
  --line: rgba(177, 220, 255, 0.16);
  --text: #f8fbff;
  --muted: #b8c7dc;
  --faint: #7e90ab;
  --red: #62d9ff;
  --red-dark: #3b83ff;
  --accent: #62d9ff;
  --accent-2: #f4d06f;
  --header: rgba(7, 18, 37, 0.72);
  --shadow: 0 34px 110px rgba(0, 0, 0, 0.58);
}

html {
  scrollbar-color: #48617f #020611;
}

body {
  background:
    linear-gradient(180deg, #081831 0%, #071225 42%, #020611 100%);
}

.auth-gate {
  background:
    linear-gradient(110deg, rgba(2, 6, 17, 0.98), rgba(7, 18, 37, 0.92) 48%, rgba(13, 36, 72, 0.86)),
    #071225;
}

.auth-card {
  border-radius: 8px;
  border-color: rgba(142, 215, 255, 0.2);
  background: linear-gradient(145deg, rgba(10, 24, 49, 0.96), rgba(6, 14, 31, 0.96));
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.68), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.auth-brand-logo {
  width: 230px;
  max-width: 100%;
  height: auto;
}

.pin-row input,
.modal-episode-controls input,
.episode-controls input {
  border-radius: 8px;
  background: rgba(4, 11, 25, 0.94);
  border-color: rgba(177, 220, 255, 0.22);
}

.pin-row input:focus,
.modal-episode-controls input:focus,
.episode-controls input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(98, 217, 255, 0.28);
}

.pin-row button,
.search-form button {
  border-radius: 8px;
  background: linear-gradient(135deg, #68e0ff, #4f8dff);
  color: #031021;
}

.site-header {
  position: sticky;
  height: 76px;
  border-bottom: 1px solid rgba(177, 220, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(2, 6, 17, 0.96), rgba(7, 18, 37, 0.72) 82%, rgba(7, 18, 37, 0));
  backdrop-filter: blur(14px);
}

.brand {
  display: grid;
  place-items: center;
}

.brand-logo {
  width: 154px;
  height: auto;
  display: block;
}

.main-nav {
  gap: 8px;
}

.main-nav button {
  min-height: 38px;
  border-radius: 8px;
  color: #c2d2eb;
  padding: 0 16px;
}

.main-nav button:hover,
.main-nav button.active {
  color: #ffffff;
  background: rgba(98, 217, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(98, 217, 255, 0.22);
}

.profile-button {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, #244d9a, #62d9ff);
  color: #ffffff;
}

.search-panel {
  min-height: 720px;
  gap: 16px;
  margin-top: -76px;
  padding: 166px 5vw 122px;
  background: #071225;
}

.billboard-art {
  background-image:
    linear-gradient(90deg, #020611 0%, rgba(2, 6, 17, 0.93) 24%, rgba(7, 18, 37, 0.36) 62%, rgba(2, 6, 17, 0.82) 100%),
    linear-gradient(0deg, #071225 0%, rgba(7, 18, 37, 0.78) 18%, rgba(7, 18, 37, 0.04) 48%),
    var(--billboard);
  filter: saturate(1.12) contrast(1.04);
}

.search-copy {
  max-width: 700px;
  gap: 12px;
}

.kicker,
.modal-eyebrow {
  color: var(--accent-2);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.search-panel h1 {
  max-width: 900px;
  font-family: "Trebuchet MS", Inter, ui-sans-serif, system-ui, sans-serif;
  color: #ffffff;
  font-size: 72px;
  line-height: 0.96;
  font-weight: 900;
  text-shadow: 0 10px 34px rgba(0, 0, 0, 0.72);
  overflow-wrap: anywhere;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-meta span,
.detail-meta span,
.modal-meta span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 10px;
  background: rgba(11, 26, 55, 0.7);
  color: #e6f5ff;
  box-shadow: inset 0 0 0 1px rgba(177, 220, 255, 0.16);
  font-size: 12px;
  font-weight: 800;
}

.hero-description {
  max-width: 640px;
  margin: 0;
  color: #d9e7f7;
  font-size: 17px;
  line-height: 1.55;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.72);
}

.primary-action,
.secondary-action {
  min-height: 48px;
  border-radius: 8px;
}

.primary-action {
  background: linear-gradient(135deg, #ffffff, #c7f3ff);
  color: #041225;
  box-shadow: 0 16px 36px rgba(76, 153, 255, 0.22);
}

.primary-action:hover {
  background: linear-gradient(135deg, #ffffff, #9fe7ff);
}

.secondary-action {
  background: rgba(14, 31, 64, 0.76);
  color: #f8fbff;
  box-shadow: inset 0 0 0 1px rgba(177, 220, 255, 0.18);
}

.secondary-action:hover {
  background: rgba(22, 48, 94, 0.9);
}

.search-form {
  width: min(760px, 100%);
  border-radius: 8px;
  background: rgba(4, 11, 25, 0.72);
  border-color: rgba(177, 220, 255, 0.24);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.search-form:focus-within {
  border-color: rgba(98, 217, 255, 0.82);
  box-shadow: 0 0 0 2px rgba(98, 217, 255, 0.24);
}

.search-form input::placeholder {
  color: #9cb2cc;
}

.hub-strip {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: -68px 5vw 36px;
}

.hub-strip button {
  min-width: 0;
  min-height: 86px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(177, 220, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(24, 55, 111, 0.82), rgba(9, 20, 43, 0.9)),
    #0c1b38;
  color: #ffffff;
  padding: 0 22px;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-weight: 900;
  text-align: left;
}

.hub-strip button:hover {
  transform: translateY(-2px);
  border-color: rgba(98, 217, 255, 0.58);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(98, 217, 255, 0.16);
}

.hub-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(98, 217, 255, 0.24), rgba(244, 208, 111, 0.2));
  color: #dff7ff;
}

.continue-section,
.featured-section,
.results-section,
.library-section {
  padding: 0 5vw;
}

body[data-screen="home"] .featured-section {
  margin-top: 28px;
}

body[data-screen="home"] .continue-section[hidden] + .featured-section {
  margin-top: 8px;
}

.results-section h2,
.continue-section h2,
.featured-section h2,
.section-title h2,
.rail-section h2 {
  color: #eef7ff;
  font-size: 21px;
  letter-spacing: 0;
}

.results-section h2::before,
.continue-section h2 > span:first-child,
.featured-section h2 > span:first-child,
.section-title h2 > span:first-child,
.rail-section h2 > span:first-child {
  width: 5px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
}

.featured-grid {
  gap: 26px;
}

.rail-grid {
  gap: 14px;
  padding: 8px 0 30px;
}

.continue-grid {
  gap: 14px;
}

.rail-grid .media-card,
.continue-grid .media-card {
  flex-basis: 302px;
}

.media-card {
  border-radius: 8px;
}

.card-poster,
.result-poster,
.detail-poster,
.modal-poster {
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(98, 217, 255, 0.22), rgba(244, 208, 111, 0.1)),
    var(--surface-2);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
}

.library-section .card-poster,
.results-section .card-poster {
  background-image: var(--poster);
}

.rail-grid .card-poster,
.continue-grid .card-poster {
  background-image: var(--thumb);
}

.media-card:hover .card-poster {
  transform: translateY(-4px) scale(1.035);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(98, 217, 255, 0.22);
}

.rating {
  border-radius: 8px;
  background: rgba(3, 10, 24, 0.78);
  color: #f9fbff;
  box-shadow: inset 0 0 0 1px rgba(177, 220, 255, 0.16);
}

.rating.has-rating::before {
  content: "+ ";
  color: var(--accent-2);
}

.media-card strong {
  color: #f8fbff;
  font-weight: 820;
}

.media-card > span {
  color: #9fb0c9;
}

.watch-progress {
  height: 5px;
  background: rgba(177, 220, 255, 0.18);
}

.watch-progress::before {
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.library-section {
  padding-top: 106px;
}

.library-section .featured-grid {
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 30px 16px;
}

.empty-state,
.result-row,
.stream-list,
.episode-controls,
.detail-panel,
.modal-panel {
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(11, 25, 52, 0.92), rgba(4, 10, 24, 0.94));
  box-shadow: inset 0 0 0 1px rgba(177, 220, 255, 0.1);
}

.result-row:hover,
.stream-row:hover {
  background: rgba(31, 70, 133, 0.62);
}

.badge,
.badge.tv {
  border-radius: 8px;
  background: rgba(98, 217, 255, 0.18);
  color: #dff7ff;
  box-shadow: inset 0 0 0 1px rgba(98, 217, 255, 0.24);
}

.player-section {
  background: #020611;
}

.hero-backdrop {
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
}

.stream-list,
.detail-panel {
  background: #071225;
}

.source.free {
  color: var(--accent);
}

.detail-copy h2,
.modal-copy h2 {
  color: #ffffff;
}

.modal-backdrop {
  background: rgba(2, 6, 17, 0.78);
}

.modal-panel {
  background: #071225;
}

.modal-backdrop-art {
  background-image:
    linear-gradient(0deg, #071225 0%, rgba(7, 18, 37, 0.82) 24%, rgba(7, 18, 37, 0.08) 64%),
    var(--modal-backdrop);
}

.modal-close {
  background: rgba(7, 18, 37, 0.8);
  box-shadow: inset 0 0 0 1px rgba(177, 220, 255, 0.18);
}

.mobile-nav {
  background: rgba(3, 10, 24, 0.97);
  border-top-color: rgba(177, 220, 255, 0.16);
}

.mobile-nav button.active {
  color: var(--accent);
}

@media (max-width: 850px) {
  body {
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
  }

  .site-header {
    height: 64px;
    padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-left));
  }

  .brand-logo {
    width: 128px;
  }

  .search-panel {
    min-height: 640px;
    margin-top: -64px;
    padding: 118px 20px 120px;
  }

  .billboard-art {
    background-image:
      linear-gradient(0deg, #071225 0%, rgba(7, 18, 37, 0.92) 24%, rgba(7, 18, 37, 0.08) 58%),
      linear-gradient(90deg, rgba(2, 6, 17, 0.94) 0%, rgba(2, 6, 17, 0.24) 100%),
      var(--billboard);
    background-position: center top;
  }

  .search-panel h1 {
    font-size: 44px;
  }

  .hero-description {
    font-size: 15px;
  }

  .hub-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: -74px 14px 30px;
  }

  .hub-strip button {
    min-height: 72px;
    padding: 0 14px;
  }

  .hub-icon {
    width: 32px;
    height: 32px;
  }

  .continue-section,
  .featured-section,
  .results-section,
  .library-section {
    padding: 0 14px;
  }

  body[data-screen="home"] .continue-section[hidden] + .featured-section {
    margin-top: 0;
  }

  .rail-grid .media-card,
  .continue-grid .media-card {
    flex-basis: 76vw;
  }

  .library-section {
    padding-top: 78px;
  }

  .library-section .featured-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px 10px;
  }

  .hero-backdrop {
    border-radius: 0;
  }

  .mobile-nav {
    height: calc(68px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
  }
}

@media (max-width: 430px) {
  .search-panel h1 {
    font-size: 38px;
  }

  .library-section .featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
