:root {
  --bg: #050505;
  --bg-2: #101010;
  --panel: rgba(20, 20, 20, 0.88);
  --panel-soft: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.12);
  --text: #ffffff;
  --muted: #b3b3b3;
  --red: #e50914;
  --red-2: #b20710;
  --green: #46d369;
  --hero-image: none;
  --hero-a: #151515;
  --hero-b: #050505;
  --hero-c: #e50914;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.56);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Aptos Display", "Bahnschrift", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 72% 6%, color-mix(in srgb, var(--hero-c) 22%, transparent), transparent 26%),
    linear-gradient(180deg, #050505 0%, #0b0b0b 42%, #050505 100%);
  overflow-x: hidden;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr minmax(190px, 280px) auto;
  gap: 22px;
  align-items: center;
  min-height: 74px;
  padding: 0 clamp(18px, 4vw, 64px);
  background: rgba(0, 0, 0, 0.92);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(16px);
}

.brand {
  color: var(--red);
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  font-weight: 1000;
  letter-spacing: -0.08em;
  text-decoration: none;
  text-transform: uppercase;
  text-shadow: 0 0 22px rgba(229, 9, 20, 0.22);
}

.main-nav {
  display: flex;
  gap: 18px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.main-nav::-webkit-scrollbar {
  display: none;
}

.main-nav a {
  color: #e5e5e5;
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.95rem;
  transition: color 160ms ease;
}

.main-nav a:hover {
  color: #ffffff;
}

.header-search input {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
  outline: none;
  padding: 0 12px;
}

.header-search input:focus {
  border-color: #ffffff;
}

.profile-pill {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f9c66b, #ff5050 55%, #7d2cff);
  text-decoration: none;
}

.profile-pill span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  box-shadow: 0 12px 0 -5px rgba(0, 0, 0, 0.62);
}

.billboard {
  position: relative;
  min-height: 86vh;
  display: grid;
  align-items: end;
  overflow: hidden;
  padding: 124px clamp(18px, 4vw, 64px) 142px;
  isolation: isolate;
}

.billboard-backdrop,
.billboard-vignette {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.billboard-backdrop {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.62) 34%, rgba(0, 0, 0, 0.08) 68%),
    var(--hero-image),
    radial-gradient(circle at 70% 24%, color-mix(in srgb, var(--hero-c) 38%, transparent), transparent 30%),
    linear-gradient(135deg, var(--hero-a), var(--hero-b) 54%, var(--hero-c));
  background-position: center;
  background-size: cover;
  transform: scale(1.02);
}

.billboard-vignette {
  z-index: -1;
  background:
    linear-gradient(0deg, #050505 0%, rgba(5, 5, 5, 0.9) 8%, rgba(5, 5, 5, 0.14) 34%, transparent 60%),
    radial-gradient(circle at 80% 22%, transparent 0 28%, rgba(0, 0, 0, 0.22) 54%, rgba(0, 0, 0, 0.8) 100%);
}

.billboard-content {
  max-width: 760px;
}

.series-label,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.series-label::before {
  content: "N";
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 3px;
  background: var(--red);
  color: #fff;
  letter-spacing: -0.08em;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  max-width: 11ch;
  font-size: clamp(4rem, 10vw, 9.8rem);
  line-height: 0.84;
  letter-spacing: -0.095em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.65rem, 3vw, 3rem);
  letter-spacing: -0.05em;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 18px;
  color: #d8d8d8;
}

.meta-line span {
  display: inline-grid;
  min-height: 26px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.26);
  font-weight: 800;
}

.meta-line span:first-child {
  border-color: transparent;
  background: transparent;
  color: var(--green);
  padding-left: 0;
}

#heroOverview {
  max-width: 58ch;
  margin: 0 0 28px;
  color: #f1f1f1;
  font-size: clamp(1.02rem, 1.6vw, 1.26rem);
  line-height: 1.5;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.8);
}

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

.play-button,
.info-button,
.open-player-link,
.source-form button {
  display: inline-grid;
  place-items: center;
  min-height: 48px;
  border: 0;
  border-radius: 5px;
  padding: 0 24px;
  text-decoration: none;
  font-weight: 1000;
  cursor: pointer;
}

.play-button {
  color: #000;
  background: #ffffff;
}

.play-button::before {
  content: "";
  width: 0;
  height: 0;
  margin-right: 10px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid #000;
}

.info-button {
  color: #ffffff;
  background: rgba(109, 109, 110, 0.72);
  backdrop-filter: blur(10px);
}

.rating-card {
  position: absolute;
  right: clamp(18px, 4vw, 64px);
  bottom: 168px;
  display: grid;
  gap: 2px;
  min-width: 118px;
  border-left: 4px solid #ffffff;
  padding: 10px 12px;
  background: rgba(51, 51, 51, 0.72);
}

.rating-card span {
  font-size: 1.7rem;
  font-weight: 1000;
}

.rating-card strong {
  color: #d8d8d8;
  font-size: 0.82rem;
}

.theater-section,
.library-section,
.deploy-section {
  position: relative;
  z-index: 2;
  padding: 0 clamp(18px, 4vw, 64px) 54px;
  scroll-margin-top: 94px;
}

.library-section {
  margin-top: -112px;
}

.theater-section {
  padding-top: 46px;
}

.section-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.section-kicker {
  color: var(--red);
  margin-bottom: 6px;
}

.open-player-link {
  min-height: 40px;
  color: #fff;
  background: var(--red);
}

.cinema-frame {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}

iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 480px;
  border: 0;
  background: #000;
}

.player-note {
  position: absolute;
  inset: auto 16px 16px auto;
  max-width: 370px;
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.68);
  color: #d0d0d0;
  font-size: 0.86rem;
  line-height: 1.4;
  backdrop-filter: blur(14px);
}

.advanced-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.advanced-panel summary {
  cursor: pointer;
  padding: 14px 16px;
  color: #d8d8d8;
  font-weight: 900;
}

.source-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  padding: 0 16px 16px;
}

.source-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.source-form input,
.source-form select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0a0a0a;
  color: #fff;
  padding: 0 10px;
}

.source-form button {
  align-self: end;
  min-height: 42px;
  color: #fff;
  background: var(--red);
}

.library-section {
  margin-top: 0;
}

.filter-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 18px;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-button {
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 0 15px;
  background: rgba(255, 255, 255, 0.08);
  color: #e7e7e7;
  cursor: pointer;
  white-space: nowrap;
}

.filter-button.active,
.filter-button:hover {
  border-color: var(--red);
  background: var(--red);
  color: #ffffff;
}

.catalog-rows {
  display: grid;
  gap: 34px;
}

.search-status {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(229, 9, 20, 0.18), rgba(255, 255, 255, 0.06)),
    rgba(12, 12, 14, 0.76);
  color: #d8d8d8;
  padding: 14px 16px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.search-status strong {
  color: #ffffff;
}

.search-status-error {
  border-color: rgba(255, 70, 90, 0.38);
  color: #ffd3d8;
}

.row-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.row-heading h3 {
  font-size: clamp(1.1rem, 1.8vw, 1.55rem);
  letter-spacing: -0.03em;
}

.row-heading span {
  color: #8f8f8f;
  font-size: 0.9rem;
}

.poster-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(178px, 222px);
  gap: 9px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 4px 0 26px;
  scrollbar-width: none;
}

.poster-track::-webkit-scrollbar {
  display: none;
}

.load-row-button {
  justify-self: start;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
}

.load-row-button:hover {
  border-color: var(--red);
  background: var(--red);
}

.poster-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #fff;
  text-align: left;
  cursor: pointer;
  transform-origin: center left;
  transition: transform 180ms ease, filter 180ms ease;
}

.poster-card:hover {
  z-index: 8;
  transform: scale(1.08) translateY(-8px);
}

.poster-card.online-card .poster-art {
  outline: 1px solid rgba(255, 255, 255, 0.2);
}

.poster-art {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 5px;
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.25), transparent 16%),
    linear-gradient(135deg, var(--card-a, #451015), var(--card-b, #111) 54%, var(--card-c, #e50914));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
}

.poster-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 54%, rgba(0, 0, 0, 0.86)),
    linear-gradient(110deg, transparent 0 46%, rgba(255, 255, 255, 0.13) 47%, transparent 49%);
}

.poster-score {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  border-radius: 4px;
  padding: 4px 7px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 1000;
}

.poster-label {
  position: absolute;
  inset: auto 12px 14px;
  z-index: 2;
  color: #fff;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  font-weight: 1000;
  line-height: 0.95;
  letter-spacing: -0.08em;
  text-transform: uppercase;
}

.poster-card strong,
.poster-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poster-card strong {
  font-size: 0.96rem;
}

.poster-card small {
  color: var(--muted);
  font-size: 0.82rem;
}

.poster-tone-0 {
  --card-a: #704100;
  --card-b: #15100c;
  --card-c: #e50914;
}

.poster-tone-1 {
  --card-a: #e50914;
  --card-b: #120405;
  --card-c: #ff8a00;
}

.poster-tone-2 {
  --card-a: #0d1b5f;
  --card-b: #05050d;
  --card-c: #7d2cff;
}

.poster-tone-3 {
  --card-a: #ff8a22;
  --card-b: #120c1a;
  --card-c: #0571ff;
}

.poster-tone-4 {
  --card-a: #0094ff;
  --card-b: #06141f;
  --card-c: #00d4ff;
}

.poster-tone-5 {
  --card-a: #e50914;
  --card-b: #08080a;
  --card-c: #252b34;
}

.poster-tone-6 {
  --card-a: #ddb15a;
  --card-b: #063b50;
  --card-c: #e50914;
}

.poster-tone-7 {
  --card-a: #a98b68;
  --card-b: #101214;
  --card-c: #e50914;
}

.empty-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.details-section {
  display: grid;
  gap: 18px;
}

.details-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 92% 0%, rgba(229, 9, 20, 0.2), transparent 34%),
    rgba(255, 255, 255, 0.045);
  padding: clamp(16px, 2.5vw, 28px);
  box-shadow: var(--shadow);
}

.details-loading {
  color: var(--muted);
}

.details-hero {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 32px);
  align-items: start;
}

.details-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(135deg, #3c0b10, #080808 55%, #e50914);
}

.details-poster img,
.mini-card img,
.cast-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.details-poster span {
  position: absolute;
  inset: auto 12px 14px;
  color: #fff;
  font-weight: 1000;
  line-height: 0.95;
  text-transform: uppercase;
}

.details-copy {
  display: grid;
  gap: 14px;
}

.details-copy h3 {
  font-size: clamp(2rem, 5vw, 4.5rem);
  letter-spacing: -0.07em;
}

.details-copy p {
  max-width: 820px;
  color: #d7d7d7;
  line-height: 1.65;
}

.tagline {
  color: #fff !important;
  font-weight: 900;
}

.details-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.details-pills span {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 900;
}

.episode-panel {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.episode-controls {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(260px, 1.4fr) auto;
  gap: 12px;
}

.episode-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.episode-controls select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090909;
  color: #fff;
  padding: 0 10px;
}

.episode-controls button {
  align-self: end;
  min-height: 42px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-weight: 1000;
}

.cast-strip,
.recommendation-strip {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.cast-track,
.mini-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(132px, 168px);
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.cast-track::-webkit-scrollbar,
.mini-track::-webkit-scrollbar {
  display: none;
}

.cast-card,
.mini-card {
  position: relative;
  display: grid;
  gap: 7px;
  border: 0;
  background: transparent;
  color: #fff;
  text-align: left;
}

.cast-card img,
.mini-card img,
.mini-card > span,
.cast-card > span {
  position: relative;
  display: grid;
  align-items: end;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #26090d, #111, #e50914);
  color: #fff;
  font-weight: 1000;
  line-height: 0.95;
  padding: 10px;
  text-transform: uppercase;
}

.cast-card img,
.mini-card img {
  display: block;
  padding: 0;
}

.cast-card strong,
.mini-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cast-card small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-card {
  cursor: pointer;
}

.mini-card:hover {
  transform: translateY(-4px);
}

.deploy-section {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(260px, 0.6fr);
  align-items: center;
  gap: 22px;
  margin-top: 0;
  padding-top: 18px;
}

.deploy-section p {
  color: var(--muted);
  line-height: 1.65;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 4vw, 64px) 44px;
  color: #777;
}

.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 10%, rgba(229, 9, 20, 0.28), transparent 30%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.96), rgba(0, 0, 0, 0.72)),
    url("https://image.tmdb.org/t/p/w1280/7RyHsO4yDXtBv1zUU3mTpHeQ0d5.jpg");
  background-position: center;
  background-size: cover;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-card {
  width: min(440px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 34px;
  background: rgba(0, 0, 0, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-card h1 {
  color: var(--red);
  font-size: clamp(2.8rem, 12vw, 4.6rem);
  text-transform: uppercase;
}

.login-card p {
  color: #d6d6d6;
  line-height: 1.55;
}

.login-kicker {
  color: #fff !important;
  font-size: 0.78rem;
  font-weight: 1000;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: #d8d8d8;
  font-weight: 800;
}

.login-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  background: #111;
  color: #fff;
  outline: none;
  padding: 0 13px;
}

.login-form input:focus {
  border-color: #fff;
}

.login-form button {
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  font-weight: 1000;
}

.login-error {
  border-left: 4px solid var(--red);
  padding: 10px 12px;
  background: rgba(229, 9, 20, 0.18);
  color: #fff;
  font-weight: 800;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: auto 1fr auto;
  }

  .header-search {
    grid-column: 1 / -1;
  }

  .billboard {
    min-height: 78vh;
  }

  .source-form,
  .episode-controls,
  .deploy-section {
    grid-template-columns: 1fr 1fr;
  }

  .details-hero {
    grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  }
}

@media (max-width: 680px) {
  .site-header {
    min-height: 68px;
    gap: 12px;
    padding-inline: 14px;
  }

  .main-nav {
    order: 3;
    grid-column: 1 / -1;
    padding-bottom: 10px;
  }

  .header-search {
    display: none;
  }

  .brand {
    font-size: 1.65rem;
  }

  .billboard {
    min-height: 78vh;
    padding: 128px 14px 112px;
  }

  h1 {
    font-size: clamp(3.2rem, 18vw, 5.7rem);
  }

  .rating-card {
    display: none;
  }

  .theater-section,
  .library-section,
  .details-section,
  .deploy-section {
    padding-inline: 14px;
  }

  .section-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  iframe {
    min-height: 250px;
  }

  .player-note {
    position: static;
    max-width: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
  }

  .source-form,
  .episode-controls,
  .deploy-section {
    grid-template-columns: 1fr;
  }

  .details-hero {
    grid-template-columns: 1fr;
  }

  .details-poster {
    width: min(190px, 70vw);
  }

  .poster-track {
    grid-auto-columns: minmax(136px, 156px);
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding-inline: 14px;
  }
}
