:root {
  --bg: #0a0a0f;
  --bg-elev: #12121a;
  --surface: #181822;
  --text: #f5f5f8;
  --muted: #9a9aa8;
  --accent: #e5384f;
  --accent-hover: #ff5068;
  --accent-soft: #e5384f22;
  --border: rgba(255,255,255,.10);
  --radius: 10px;
  --ease: cubic-bezier(.2,.7,.2,1);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23c8c8d2' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M2 4.2 6 8l4-3.8'/%3E%3C/svg%3E");
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; transition: background .2s, border-color .2s, color .2s, transform .15s; }
button:active { transform: scale(.97); }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 3px;
}
::selection { background: var(--accent); color: #fff; }
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-color: var(--surface);
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 12px 12px;
  cursor: pointer;
}
select option { background: var(--surface); color: var(--text); }
.app-shell { min-height: 100vh; }

/* TOPBAR */
.topbar {
  min-height: 72px;
  padding: 12px 4%;
  display: grid;
  grid-template-columns: auto minmax(260px, 420px) 1fr;
  align-items: center;
  gap: 32px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, #0a0a0ffa 0%, #0a0a0fd9 100%);
  backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid #ffffff0b;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px;
  background: linear-gradient(135deg, #ff5068, #b51a31);
  box-shadow: 0 6px 20px #e5384f55;
  font-size: 20px; font-weight: 900;
}
.brand-name { font: 800 20px Manrope, sans-serif; letter-spacing: -.5px; }
.search-box {
  height: 40px; display: flex; overflow: hidden;
  border: 1px solid var(--border); border-radius: 999px;
  background: #ffffff0d; transition: border-color .2s, background .2s;
}
.search-box:focus-within { border-color: #ffffff55; background: #ffffff14; }
.search-box input {
  flex: 1; min-width: 0; padding: 0 16px; border: 0; background: transparent;
  color: #fff; font-size: 13px;
}
.search-box input:focus-visible { outline: none; }
.search-box select {
  max-width: 104px; padding: 0 26px 0 12px; border: 0; border-left: 1px solid var(--border);
  background-color: transparent; background-position: right 8px center; background-size: 11px 11px;
  color: #ccc; font-size: 12px;
}
.search-box button { width: 46px; border: 0; background: transparent; color: #ddd; font-size: 22px; }
.search-box button:hover { color: #fff; }
.main-nav { display: flex; justify-content: flex-end; gap: 4px; }
.nav-btn {
  position: relative; padding: 10px 14px; border: 0; border-radius: 6px;
  background: transparent; color: #a9a9b6; font-size: 13px; font-weight: 500; white-space: nowrap;
}
.nav-btn:hover { color: #fff; }
.nav-btn.active { color: #fff; font-weight: 700; }
.nav-btn.active:after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px;
  height: 2px; border-radius: 2px; background: var(--accent);
}
.main-content { padding: 0 4%; overflow: hidden; }

/* HERO */
.hero {
  min-height: min(760px, 82vh); margin: 0 -4% 20px; padding: 0 4%;
  display: flex; align-items: flex-end; position: relative; overflow: hidden;
  background: #1a1a24 center 22% / cover no-repeat; isolation: isolate;
}
.hero:before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, #0a0a0f 0%, #0a0a0fd0 26%, #0a0a0f4d 62%, #0a0a0f10 100%),
    linear-gradient(0deg, #0a0a0f 0%, #0a0a0f99 18%, transparent 48%),
    linear-gradient(180deg, #0a0a0f99 0%, transparent 22%);
}
.hero-content { width: min(640px, 58%); padding: 90px 0 110px; }
.hero-label {
  display: inline-flex; align-items: center; gap: 8px;
  color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 2.5px;
}
.hero-label:before {
  content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--accent);
}
.section-kicker { color: var(--accent-hover); font-size: 10px; font-weight: 800; letter-spacing: 2px; }
.hero-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.hero-meta span, .details-meta span {
  padding: 5px 10px; border: 1px solid #ffffff30; border-radius: 4px;
  background: #00000040; backdrop-filter: blur(6px); color: #eee; font-size: 12px; font-weight: 500;
}
.hero-meta span:first-child { border-color: var(--accent); color: #fff; background: var(--accent-soft); }
.hero h1, .details-content h1 {
  margin: 16px 0 14px;
  font: 800 clamp(40px, 6vw, 84px)/1 Manrope, sans-serif;
  letter-spacing: -2.5px; text-shadow: 0 4px 30px #000a;
}
.hero p {
  max-width: 540px; color: #dcdce3; font-size: 15px; line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 2px 12px #000a;
}
.hero-actions, .details-actions { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.primary-button, .secondary-button, .small-button {
  min-height: 44px; padding: 0 22px; border-radius: 6px; font-weight: 700; font-size: 14px;
}
.primary-button { border: 0; background: #fff; color: #0a0a0f; }
.primary-button:hover { background: #d8d8de; }
.secondary-button { border: 0; background: #6d6d7a66; color: #fff; backdrop-filter: blur(6px); }
.secondary-button:hover { background: #6d6d7a99; }
.hero-pagination { position: absolute; right: 4%; bottom: 36px; display: flex; gap: 6px; }
.hero-pagination button {
  width: 26px; height: 3px; padding: 0; border: 0;
  background: #ffffff40; border-radius: 3px;
  transition: background .3s, width .3s; cursor: pointer;
}
.hero-pagination button.active { width: 38px; background: #fff; }
.hero-pagination button:focus-visible {
  outline: 2px solid #fff; outline-offset: 5px;
}

/* SECTIONS & ROWS */
.content-section, .detail-block { margin: 34px 0; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 14px; gap: 15px; }
.section-heading h2 { margin: 4px 0 0; font: 700 21px Manrope, sans-serif; letter-spacing: -.3px; }
.content-section .section-kicker { display: none; }
.poster-row {
  display: flex; gap: 12px; overflow-x: auto; padding: 8px 4% 24px; margin: -8px -4% 0;
  scroll-snap-type: x proximity; scroll-padding: 0 4%;
  scrollbar-width: thin; scrollbar-color: transparent transparent;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 2%, #000 96%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 2%, #000 96%, transparent 100%);
}
.poster-row:hover { scrollbar-color: #ffffff30 transparent; }
.poster-row::-webkit-scrollbar { height: 6px; }
.poster-row::-webkit-scrollbar-thumb { background: transparent; border-radius: 6px; }
.poster-row:hover::-webkit-scrollbar-thumb { background: #ffffff30; }

/* CARDS */
.media-card {
  flex: 0 0 260px; min-width: 0; position: relative; overflow: hidden; aspect-ratio: 16/9;
  scroll-snap-align: start;
  border-radius: var(--radius); border: 1px solid #ffffff0f;
  background: linear-gradient(135deg, #14141c, #1e1e29);
  cursor: pointer; isolation: isolate;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.media-card:hover, .media-card:focus-within {
  transform: scale(1.07); z-index: 5; border-color: #ffffff55;
  box-shadow: 0 18px 40px #000c, 0 0 0 1px #ffffff22;
}
.media-card img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .5s var(--ease), opacity .3s; position: relative; z-index: 0; }
.media-card:hover img { transform: scale(1.05); }
.media-card:after {
  content: ""; position: absolute; inset: 30% 0 0; z-index: 1; pointer-events: none;
  background: linear-gradient(0deg, #050508f2, transparent);
}
.card-info { position: absolute; z-index: 2; right: 12px; bottom: 11px; left: 12px; }
.media-card h3 { margin: 0; overflow: hidden; font-size: 13px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.media-card p { margin: 3px 0 0; color: #c6c6d0; font-size: 11px; }
.card-favorite {
  position: absolute; top: 8px; right: 8px; z-index: 3; padding: 6px 10px;
  border: 1px solid #ffffff50; border-radius: 999px;
  background: #0a0a0fcc; backdrop-filter: blur(6px); color: #fff; font-size: 10px; font-weight: 600;
  opacity: 0; transform: translateY(-4px);
  transition: opacity .2s, transform .2s, background .2s;
}
.media-card:hover .card-favorite, .card-favorite:focus-visible, .card-favorite.saved { opacity: 1; transform: none; }
.card-favorite:hover { background: #fff; color: #0a0a0f; }
.card-favorite.saved { background: var(--accent); border-color: var(--accent); }
@media (hover: none) { .card-favorite { opacity: 1; transform: none; } }
.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px 14px; }
.poster-grid .media-card { width: 100%; flex: auto; }
.status-message, .empty-message { color: var(--muted); font-size: 13px; }

/* FILTERS */
.filter-panel {
  display: grid; grid-template-columns: repeat(6, minmax(100px, 1fr)) auto;
  gap: 12px; align-items: end; margin: 20px 0 26px; padding: 18px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elev);
}
.filter-field { display: flex; flex-direction: column; gap: 7px; }
.filter-field label { color: var(--muted); font-size: 11px; font-weight: 500; }
.filter-field input, .filter-field select, .episode-controls select,
.custom-list-add select, .custom-list-add input {
  width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; background-color: var(--surface); color: #eee; font-size: 12px;
}
.filter-field select, .episode-controls select, .custom-list-add select { padding-right: 32px; }
.custom-list-add input { background-image: none; }
.filter-field input:hover, .filter-field select:hover { border-color: #ffffff40; }
.load-more { display: block; margin: 30px auto; }

/* DETAILS */
.details-section { padding: 24px 0 20px; min-height: 60vh; }
.back-button {
  margin-bottom: 18px; padding: 9px 16px; border: 1px solid var(--border);
  border-radius: 999px; background: #ffffff0a; color: #fff; font-size: 12px; font-weight: 600;
}
.back-button:hover { background: #ffffff1c; }
.details-hero {
  min-height: 420px; padding: 44px; display: grid;
  grid-template-columns: minmax(170px, 250px) 1fr; align-items: center; gap: 42px;
  border: 1px solid #ffffff10; border-radius: 16px;
  background-size: cover; background-position: center;
  box-shadow: 0 30px 80px #0009;
}
.details-poster {
  width: 100%; max-width: 250px; aspect-ratio: 2/3; overflow: hidden;
  border-radius: var(--radius); background: var(--surface); box-shadow: 0 24px 60px #000b;
}
.details-poster img { width: 100%; height: 100%; object-fit: cover; }
.details-content { max-width: 780px; }
.details-content h1 { font-size: clamp(34px, 4.6vw, 62px); margin: 10px 0 15px; }
.details-meta, .details-genres { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.details-genres { margin-top: 14px; }
.details-genres span {
  padding: 5px 11px; border-radius: 999px; background: #ffffff16; color: #e6e6ee; font-size: 11px;
}
.details-content > p { max-width: 700px; color: #cfcfd8; font-size: 14px; line-height: 1.75; }
.custom-list-add { display: flex; align-items: center; gap: 10px; margin-top: 16px; max-width: 380px; }
.custom-list-add select { max-width: 190px; }
.small-button {
  min-height: 36px; padding: 0 14px; border: 1px solid #ffffff30;
  background: #ffffff12; color: #fff; font-size: 11px;
}
.small-button:hover { background: #ffffff24; }
.detail-block { padding-top: 5px; }
.section-heading select, .provider-filter-head select {
  width: auto; min-width: 150px; height: 38px; padding: 0 34px 0 16px;
  border: 1px solid #ffffff30; border-radius: 999px;
  background-color: #ffffff12; background-position: right 14px center;
  color: #fff; font-size: 13px; font-weight: 600;
  transition: background-color .2s, border-color .2s;
}
.section-heading select:hover, .provider-filter-head select:hover { background-color: #ffffff22; border-color: #ffffff60; }
.section-heading select:focus-visible, .provider-filter-head select:focus-visible { border-color: var(--accent-hover); }
.provider-group { margin: 14px 0; }
.provider-group h3 { font-size: 12px; color: #aaa; }
.provider-logos { display: flex; flex-wrap: wrap; gap: 12px; }
.provider-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 8px; background: #ffffff08; font-size: 11px;
}
.provider-item img { width: 28px; height: 28px; border-radius: 6px; }
.attribution { color: #777; font-size: 10px; }
.trailer-grid { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: thin; }
.trailer-card { flex: 0 0 280px; }
.trailer-card { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.trailer-card iframe { display: block; width: 100%; aspect-ratio: 16/9; border: 0; }
.trailer-card p { padding: 0 12px; font-size: 12px; }
.people-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: thin; }
.person-card { flex: 0 0 120px; cursor: pointer; transition: transform .25s var(--ease); }
.person-card:hover { transform: translateY(-4px); }
.person-card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 8px; background: var(--surface); }
.person-card strong, .person-card span { display: block; margin-top: 6px; font-size: 11px; }
.person-card span { color: var(--muted); font-size: 10px; margin-top: 2px; }

/* WATCH MODE */
.watch-section { width: min(1500px, 100%); margin: 0 auto; padding: 22px 0 50px; }
.watch-toolbar { display: flex; align-items: center; gap: 22px; margin-bottom: 18px; }
.watch-heading { min-width: 0; }
.watch-heading h1 { margin: 3px 0 3px; font: 800 clamp(22px, 2.4vw, 32px) Manrope, sans-serif; letter-spacing: -.7px; }
.watch-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.watch-server-picker {
  display: flex; align-items: center; gap: 9px; margin-left: auto; flex-shrink: 0;
  color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; white-space: nowrap;
}
.watch-server-picker select {
  min-width: 132px; height: 38px; padding: 0 34px 0 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background-color: #ffffff12; color: var(--text); font-size: 12px; font-weight: 600;
}
.watch-layout { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(300px, .9fr); align-items: start; gap: 22px; }
.watch-main-column { min-width: 0; }
.watch-player-wrap { width: 100%; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: #000; box-shadow: 0 16px 45px #0007; }
#watchPlayer { display: block; width: 100%; aspect-ratio: 16/9; border: 0; background: #000; }
.watch-side-panel { min-width: 0; min-height: 300px; max-height: min(72vh, 760px); overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elev); }
.watch-episode-controls { display: flex; flex-direction: column; min-height: 300px; max-height: inherit; }
.watch-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); }
.watch-panel-heading h2 { margin: 3px 0 0; font: 700 17px Manrope, sans-serif; }
.watch-season-picker { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.watch-season-picker select { min-width: 120px; max-width: 155px; height: 35px; padding: 0 28px 0 10px; border: 1px solid var(--border); border-radius: 7px; color: var(--text); font-size: 11px; }
.watch-episode-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #ffffff30 transparent; }
.watch-episode-card { display: grid; grid-template-columns: minmax(95px, 36%) minmax(0, 1fr); gap: 11px; width: 100%; padding: 11px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); text-align: left; }
.watch-episode-card:hover { background: #ffffff09; }
.watch-episode-card.selected { background: var(--accent-soft); box-shadow: inset 3px 0 var(--accent); }
.watch-episode-thumb { position: relative; display: block; overflow: hidden; aspect-ratio: 16/9; border-radius: 6px; background: #24242e; }
.watch-episode-thumb img { width: 100%; height: 100%; object-fit: cover; }
.watch-episode-no-image { display: grid; width: 100%; height: 100%; place-items: center; color: #aaa; font-size: 22px; font-weight: 800; }
.watch-episode-play { position: absolute; inset: 0; display: grid; place-items: center; background: #0007; color: white; font-size: 19px; opacity: 0; transition: opacity .2s; }
.watch-episode-card:hover .watch-episode-play, .watch-episode-card.selected .watch-episode-play { opacity: 1; }
.watch-episode-info { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.watch-episode-info strong { font-size: 11px; line-height: 1.4; }
.watch-episode-meta { color: var(--muted); font-size: 9px; }
.watch-episode-overview { display: -webkit-box; overflow: hidden; color: #aaaab5; font-size: 10px; line-height: 1.45; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.watch-movie-details { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: start; gap: 15px; max-height: inherit; overflow-y: auto; padding: 17px; }
.watch-movie-poster { display: block; width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 7px; background: var(--surface); }
.watch-movie-copy { min-width: 0; }
.watch-movie-copy h2 { margin: 4px 0 6px; font: 800 17px Manrope, sans-serif; line-height: 1.25; }
.watch-movie-meta { margin: 0 0 10px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.watch-movie-overview { margin: 0; color: #c4c4ce; font-size: 11px; line-height: 1.6; }
.watch-movie-genres { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.watch-movie-genres span { padding: 4px 7px; border: 1px solid var(--border); border-radius: 999px; color: #c8c8d2; font-size: 9px; }
#watchStatus { margin-top: 10px; }
@media (max-width: 900px) {
  .watch-layout { grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 14px; }
  .watch-episode-card { grid-template-columns: 95px minmax(0, 1fr); gap: 9px; padding: 9px; }
  .watch-episode-overview { -webkit-line-clamp: 2; }
  .watch-movie-details { grid-template-columns: 85px minmax(0, 1fr); gap: 11px; padding: 12px; }
}
@media (max-width: 650px) {
  .watch-section { padding: 14px 0 35px; }
  .watch-toolbar { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 14px; }
  .watch-server-picker { margin-left: 0; }
  .watch-layout { grid-template-columns: 1fr; gap: 13px; }
  .watch-player-wrap { border-radius: 8px; }
  .watch-side-panel { max-height: none; min-height: 0; }
  .watch-episode-controls { max-height: 440px; min-height: 0; }
  .watch-episode-list { max-height: 360px; }
  .watch-episode-card { grid-template-columns: 118px minmax(0, 1fr); padding: 10px; }
  .watch-episode-overview { -webkit-line-clamp: 2; }
  .watch-movie-details { grid-template-columns: 95px minmax(0, 1fr); }
}
/* PERSON, LISTS, FOOTER */
.person-header { display: grid; grid-template-columns: 180px 1fr; gap: 26px; margin: 20px 0 40px; }
.person-header img { width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: var(--radius); background: var(--surface); }
.person-header h1 { font: 800 40px Manrope, sans-serif; letter-spacing: -1px; }
.person-header p { max-width: 800px; color: #bbb; line-height: 1.7; font-size: 13px; }
.list-chip-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.list-chip {
  padding: 14px 18px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-elev); color: #eee; text-align: left; min-width: 150px;
}
.list-chip:hover { border-color: var(--accent); background: var(--accent-soft); }
.list-chip strong, .list-chip span { display: block; }
.list-chip span { color: var(--muted); font-size: 10px; margin-top: 3px; }
footer { margin-top: 70px; padding: 24px 0; border-top: 1px solid #ffffff0d; color: #6e6e7a; font-size: 10px; text-align: center; line-height: 1.8; }
[hidden] { display: none !important; }

/* REMOVE BUTTON, PEOPLE GRID, FOCUS */
.card-remove {
  position: absolute; top: 8px; left: 8px; z-index: 3; width: 26px; height: 26px; padding: 0;
  border: 1px solid #ffffff50; border-radius: 50%; background: #0a0a0fcc; color: #fff; font-size: 11px;
  opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .2s, background .2s;
}
.media-card:hover .card-remove, .card-remove:focus-visible { opacity: 1; transform: none; }
.card-remove:hover { background: var(--accent); border-color: var(--accent); }
@media (hover: none) { .card-remove { opacity: 1; transform: none; } }
.poster-grid.people-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.poster-grid.people-grid .person-card { flex: auto; }
.person-card:focus-visible, .media-card:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 3px; }

/* STREAMING FILTER */
.provider-filter { grid-column: 1 / -1; display: grid; gap: 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.provider-filter-head { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.provider-filter-head strong { display: block; font-size: 13px; }
.provider-filter-head span { color: var(--muted); font-size: 11px; }
.provider-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.provider-chip {
  display: flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px;
  border: 1px solid var(--border); border-radius: 999px; background: #ffffff0a;
  color: #d6d6de; font-size: 12px; font-weight: 600;
}
.provider-chip img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--surface); }
.provider-chip:hover { background: #ffffff18; border-color: #ffffff50; }
.provider-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: #fff; }
.provider-filter .small-button { justify-self: start; }

/* LIBRARY TOOLS */
.library-tools {
  display: grid; gap: 14px; margin: 34px 0 10px; padding: 20px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elev);
}
.library-tools h3 { margin: 0 0 4px; font-size: 14px; }
.library-tools p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.library-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* RESPONSIVE */
@media (max-width: 1100px) {
  .topbar { grid-template-columns: auto 1fr; gap: 12px 25px; }
  .search-box { grid-column: 2; grid-row: 1; }
  .main-nav { grid-column: 1 / -1; justify-content: center; }
  .filter-panel { grid-template-columns: repeat(3, 1fr); }
  .filter-panel > .primary-button { grid-column: 1 / -1; background: var(--accent); color: #fff; order: 3; }
  .provider-filter { order: 2; }
}
@media (max-width: 650px) {
  .topbar { display: flex; flex-wrap: wrap; gap: 12px; }
  .brand { flex: 1; }
  .search-box { order: 3; width: 100%; }
  .main-nav { order: 2; width: 100%; justify-content: space-between; gap: 0; }
  .nav-btn { padding: 8px 6px; font-size: 11px; }
  .nav-btn.active:after { left: 6px; right: 6px; }
  .hero { min-height: 560px; background-position: 62% center; }
  .hero:before { background: linear-gradient(0deg, #0a0a0f 0%, #0a0a0fcc 48%, #0a0a0f30 100%); }
  .hero-content { width: 100%; padding: 35px 0 70px; }
  .hero h1 { font-size: clamp(36px, 12vw, 56px); letter-spacing: -1.5px; }
  .hero p { font-size: 13px; }
  .hero-pagination { left: 4%; right: auto; }
  .media-card { flex-basis: 210px; }
  .media-card:hover { transform: none; }
  .poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .poster-grid .media-card { flex: auto; }
  .filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; }
  .details-hero { grid-template-columns: 95px 1fr; gap: 15px; padding: 17px; min-height: 0; }
  .details-poster { max-width: 95px; align-self: start; }
  .details-content h1 { font-size: clamp(26px, 8vw, 40px); letter-spacing: -1px; }
  .details-meta span { font-size: 9px; padding: 5px 7px; }
  .details-content > p { font-size: 12px; }
  .details-actions { margin-top: 15px; }
  .custom-list-add { flex-wrap: wrap; }
  .person-header { grid-template-columns: 105px 1fr; gap: 15px; }
  .person-header h1 { font-size: 25px; }
  .person-header p { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}


/* APPLE TV-INSPIRED VISUAL SYSTEM */
:root {
  --bg: #08090c;
  --bg-elev: #111319;
  --surface: #191c23;
  --text: #f5f5f7;
  --muted: #9296a1;
  --accent: #dfe1e7;
  --accent-hover: #ffffff;
  --accent-soft: rgba(255,255,255,.11);
  --border: rgba(255,255,255,.095);
  --radius: 13px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

html { background: var(--bg); }
body {
  background:
    radial-gradient(ellipse at 50% -24%, rgba(68,76,98,.17), transparent 48%),
    linear-gradient(180deg, #0b0c10 0%, #08090c 42%, #07080b 100%);
  color: var(--text);
  letter-spacing: -.01em;
}
::selection { background: #e5e6eb; color: #101116; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline-color: #f2f3f7;
}

/* GLASS NAVIGATION */
.topbar {
  min-height: 76px;
  padding: 12px clamp(22px, 4.2vw, 72px);
  display: grid;
  grid-template-columns: auto minmax(0,1fr) minmax(240px,340px);
  align-items: center;
  gap: clamp(18px, 3vw, 48px);
  background: rgba(9,10,14,.72);
  border-bottom: 1px solid rgba(255,255,255,.075);
  box-shadow: 0 8px 34px rgba(0,0,0,.16);
  -webkit-backdrop-filter: blur(28px) saturate(175%);
  backdrop-filter: blur(28px) saturate(175%);
}
.brand { grid-column: 1; gap: 11px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #f6f6f8 0%, #a5a8b2 100%);
  color: #101116;
  box-shadow: 0 4px 18px rgba(220,224,235,.16), inset 0 1px 1px #fff;
  font: 900 21px/1 Manrope, sans-serif;
}
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: -.75px; }
.search-box {
  grid-column: 3; grid-row: 1;
  height: 40px; border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px; background: rgba(255,255,255,.065);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.search-box:focus-within {
  border-color: rgba(255,255,255,.3);
  background: rgba(255,255,255,.095);
  box-shadow: 0 0 0 4px rgba(255,255,255,.035);
}
.search-box input { font-size: 12px; }
.search-box input::placeholder { color: #858994; }
.search-box select { color: #d8dae0; }
.search-box button { color: #c5c7cf; }
.main-nav {
  grid-column: 2; grid-row: 1;
  justify-content: center; gap: 5px;
}
.nav-btn {
  padding: 10px 13px; border-radius: 999px;
  color: #a1a4ae; font-size: 12px; font-weight: 600;
  transition: color .2s, background .2s;
}
.nav-btn:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-btn.active {
  color: #fff; font-weight: 700;
  background: rgba(255,255,255,.11);
}
.nav-btn.active:after { display: none; }
.main-content { padding: 0 clamp(22px, 4.2vw, 72px); }

/* CINEMATIC FEATURE */
.hero {
  min-height: min(700px, 78vh);
  margin: 0 calc(clamp(22px, 4.2vw, 72px) * -1) 34px;
  padding: 0 clamp(22px, 4.2vw, 72px);
  align-items: flex-end;
  background-color: #14161d;
  background-position: center 24%;
  background-size: cover;
  border-radius: 0 0 24px 24px;
  isolation: isolate;
}
.hero:before {
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(7,8,11,.96) 0%, rgba(7,8,11,.82) 24%, rgba(7,8,11,.30) 61%, rgba(7,8,11,.04) 100%),
    linear-gradient(0deg, #08090c 0%, rgba(8,9,12,.78) 13%, transparent 52%),
    linear-gradient(180deg, rgba(8,9,12,.34) 0%, transparent 24%);
}
.hero-content {
  position: relative; z-index: 1;
  width: min(620px, 54%);
  padding: 80px 0 92px;
}
.hero-label {
  color: #e5e6eb; font-size: 10px; letter-spacing: 2.6px;
}
.hero-label:before { background: #f2f3f6; height: 14px; }
.section-kicker { color: #aeb2bd; font-size: 9px; letter-spacing: 2.1px; }
.hero-meta { margin-top: 17px; gap: 7px; }
.hero-meta span, .details-meta span {
  padding: 5px 9px; border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px; background: rgba(10,11,15,.4);
  color: #e8e9ed; font-size: 11px;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.hero-meta span:first-child {
  border-color: rgba(255,255,255,.35);
  background: rgba(255,255,255,.13); color: #fff;
}
.hero h1, .details-content h1 {
  margin: 17px 0 13px;
  font-size: clamp(42px, 5.8vw, 78px);
  line-height: .98; letter-spacing: -3px;
  text-shadow: 0 5px 35px rgba(0,0,0,.55);
}
.hero p {
  max-width: 510px; color: #d0d2d9;
  font-size: 14px; line-height: 1.7;
  -webkit-line-clamp: 3;
}
.hero-actions, .details-actions { gap: 10px; margin-top: 23px; }
.primary-button, .secondary-button, .small-button {
  min-height: 42px; padding: 0 20px;
  border-radius: 999px; font-size: 12px; font-weight: 700;
}
.primary-button {
  background: #f3f4f6; color: #111318;
  box-shadow: 0 4px 18px rgba(0,0,0,.18);
}
.primary-button:hover { background: #d7d9df; }
.secondary-button {
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(255,255,255,.13); color: #f4f4f6;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.secondary-button:hover { background: rgba(255,255,255,.22); }
.hero-pagination { z-index: 1; bottom: 33px; }
.hero-pagination span { background: rgba(255,255,255,.35); }
.hero-pagination span.active { background: #fff; }

/* CINEMA CATALOG */
.content-section, .detail-block { margin: 42px 0 48px; }
.section-heading {
  align-items: center; margin-bottom: 16px; gap: 18px;
}
.section-heading h2 {
  margin: 0; color: #f4f4f6;
  font: 700 clamp(19px, 1.8vw, 23px)/1.2 Manrope, sans-serif;
  letter-spacing: -.55px;
}
.content-section .section-kicker { display: none; }
.poster-row {
  gap: 17px;
  overflow-x: auto; overflow-y: hidden;
  padding: 12px 4% 30px; margin: -10px -4% 0;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 4%;
  scrollbar-width: thin; scrollbar-color: transparent transparent;
  -webkit-mask-image: none; mask-image: none;
}
.poster-row:hover { scrollbar-color: rgba(255,255,255,.23) transparent; }
.poster-row::-webkit-scrollbar { height: 5px; }
.poster-row::-webkit-scrollbar-thumb { background: transparent; border-radius: 99px; }
.poster-row:hover::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); }
.media-card {
  flex: 0 0 clamp(148px, 14vw, 198px);
  min-width: 0; width: auto; height: auto;
  display: flex; flex-direction: column; gap: 10px;
  position: relative; overflow: visible;
  aspect-ratio: auto; border: 0; border-radius: 0;
  background: transparent; isolation: auto;
  scroll-snap-align: start;
  transition: transform .28s var(--ease);
}
.media-card:hover, .media-card:focus-within {
  transform: translateY(-4px); z-index: 5;
  border-color: transparent; box-shadow: none;
}
.media-card img {
  display: block; width: 100%; height: auto;
  aspect-ratio: 2 / 3; object-fit: cover; object-position: center top;
  border-radius: 11px;
  background: linear-gradient(145deg,#1c2029,#101116);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  transition: transform .4s var(--ease), box-shadow .3s, opacity .3s;
}
.media-card:hover img, .media-card:focus-within img {
  transform: scale(1.025);
  box-shadow: 0 16px 34px rgba(0,0,0,.48), 0 0 0 1px rgba(255,255,255,.13);
}
.media-card:after { display: none; }
.card-info {
  position: static; z-index: auto;
  min-width: 0; padding: 0 2px;
}
.media-card h3 {
  margin: 0; color: #f0f0f3;
  font-size: 12px; font-weight: 650; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.media-card p { margin: 3px 0 0; color: #90949f; font-size: 10px; }
.card-favorite {
  top: 9px; right: 9px; padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 999px; background: rgba(8,9,12,.76);
  color: #fff; font-size: 10px;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.card-favorite:hover { background: #fff; color: #111318; }
.card-favorite.saved {
  background: #f1f2f5; border-color: #f1f2f5; color: #111318;
}
.poster-grid {
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 28px 18px;
}
.poster-grid .media-card { width: 100%; flex: none; }
.status-message, .empty-message { color: #a0a4ae; }

/* REFINED SURFACES AND FORMS */
.filter-panel, .watch-side-panel, .library-tools {
  border-color: rgba(255,255,255,.085);
  border-radius: 16px;
  background: rgba(18,20,27,.78);
  box-shadow: 0 16px 45px rgba(0,0,0,.13);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.filter-panel { padding: 22px; gap: 14px; }
.filter-field label { color: #a5a8b2; font-size: 10px; letter-spacing: .025em; }
.filter-field input, .filter-field select, .episode-controls select,
.custom-list-add select, .custom-list-add input {
  border-color: rgba(255,255,255,.1); border-radius: 9px;
  background-color: rgba(255,255,255,.055); color: #f0f1f4;
}
.filter-field input:hover, .filter-field select:hover { border-color: rgba(255,255,255,.25); }
.back-button {
  border-color: rgba(255,255,255,.11); border-radius: 999px;
  background: rgba(255,255,255,.06); color: #e7e8ec;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.back-button:hover { background: rgba(255,255,255,.13); }
.details-section { padding: 30px 0 24px; }
.details-hero {
  min-height: 455px; padding: clamp(24px,4vw,52px);
  gap: clamp(24px,4vw,48px);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 22px; background-position: center;
  box-shadow: 0 28px 80px rgba(0,0,0,.35);
}
.details-poster {
  border-radius: 13px;
  box-shadow: 0 22px 55px rgba(0,0,0,.55);
}
.details-meta span { border-radius: 999px; }
.details-genres span {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px; background: rgba(255,255,255,.08);
  color: #dfe1e6; font-size: 10px;
}
.details-content > p { color: #c4c7d0; line-height: 1.75; }
.custom-list-add select { border-radius: 999px; }
.small-button {
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 999px; background: rgba(255,255,255,.07); color: #ebecf0;
}
.small-button:hover { background: rgba(255,255,255,.15); }
.section-heading select, .provider-filter-head select {
  border-color: rgba(255,255,255,.14); border-radius: 999px;
  background-color: rgba(255,255,255,.08); color: #e9eaf0;
}
.provider-item, .provider-chip {
  border-color: rgba(255,255,255,.1);
  background: rgba(255,255,255,.055);
}
.provider-chip[aria-pressed="true"] {
  border-color: rgba(255,255,255,.42);
  background: rgba(255,255,255,.15); color: #fff;
}
.watch-section { width: min(1560px, 100%); padding-top: 28px; }
.watch-player-wrap {
  border: 1px solid rgba(255,255,255,.11); border-radius: 16px;
  box-shadow: 0 22px 65px rgba(0,0,0,.42);
}
.watch-side-panel { border-radius: 16px; }
.watch-panel-heading { border-bottom-color: rgba(255,255,255,.08); }
.watch-episode-card { border-bottom-color: rgba(255,255,255,.065); }
.watch-episode-card.selected {
  background: rgba(255,255,255,.085);
  box-shadow: inset 3px 0 rgba(255,255,255,.72);
}
.watch-server-picker select, .watch-season-picker select {
  border-color: rgba(255,255,255,.13);
  background-color: rgba(255,255,255,.075);
  border-radius: 999px;
}
.person-card img { border-radius: 11px; }
.list-chip {
  border-color: rgba(255,255,255,.1); border-radius: 13px;
  background: rgba(255,255,255,.045);
}
.list-chip:hover { border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.09); }
.library-tools { padding: 24px; }
footer { border-top-color: rgba(255,255,255,.07); color: #70747e; }

/* RESPONSIVE APPLE TV-INSPIRED LAYOUT */
@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: auto minmax(0,1fr);
    gap: 10px 22px;
  }
  .brand { grid-column: 1; grid-row: 1; }
  .search-box { grid-column: 2; grid-row: 1; }
  .main-nav {
    grid-column: 1 / -1; grid-row: 2;
    justify-content: center; flex-wrap: wrap;
  }
  .hero { min-height: min(650px, 72vh); }
  .hero-content { width: min(600px, 68%); }
  .poster-grid { grid-template-columns: repeat(auto-fill, minmax(145px,1fr)); }
}
@media (max-width: 650px) {
  .topbar {
    display: flex; flex-wrap: wrap; gap: 12px;
    padding: 10px 18px 12px;
  }
  .brand { order: 1; flex: 1 0 auto; }
  .brand-name { font-size: 18px; }
  .search-box { order: 3; width: 100%; height: 39px; }
  .main-nav {
    order: 2; width: 100%; justify-content: space-between;
    gap: 2px; overflow-x: auto; flex-wrap: nowrap;
    padding: 2px 0 4px; scrollbar-width: none;
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .nav-btn { flex: 0 0 auto; padding: 8px 10px; font-size: 10px; }
  .main-content { padding: 0 18px; }
  .hero {
    min-height: 560px; margin: 0 -18px 28px; padding: 0 22px;
    border-radius: 0 0 18px 18px; background-position: 62% center;
  }
  .hero:before {
    background:
      linear-gradient(0deg, #08090c 0%, rgba(8,9,12,.88) 23%, rgba(8,9,12,.18) 76%, rgba(8,9,12,.12) 100%),
      linear-gradient(90deg, rgba(8,9,12,.35), transparent 90%);
  }
  .hero-content { width: 100%; padding: 30px 0 72px; }
  .hero h1 { font-size: clamp(37px, 11vw, 54px); letter-spacing: -1.8px; }
  .hero p { max-width: 100%; font-size: 12px; -webkit-line-clamp: 3; }
  .hero-pagination { left: 22px; right: auto; bottom: 28px; }
  .content-section, .detail-block { margin: 34px 0 40px; }
  .section-heading { margin-bottom: 12px; }
  .section-heading h2 { font-size: 19px; }
  .poster-row {
    gap: 13px; padding: 10px 18px 25px; margin: -8px -18px 0;
    scroll-padding: 0 18px;
  }
  .media-card { flex-basis: clamp(128px, 39vw, 164px); gap: 8px; }
  .media-card img { border-radius: 9px; }
  .media-card h3 { font-size: 11px; }
  .media-card p { font-size: 9px; }
  .poster-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px 12px; }
  .filter-panel { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 14px; border-radius: 14px; }
  .filter-panel > .primary-button { grid-column: 1 / -1; }
  .details-hero {
    grid-template-columns: 94px minmax(0,1fr);
    gap: 16px; padding: 18px; min-height: 0; border-radius: 16px;
  }
  .details-poster { max-width: 94px; align-self: start; border-radius: 9px; }
  .details-content h1 { font-size: clamp(25px,7.5vw,38px); letter-spacing: -1.2px; }
  .details-meta span { font-size: 9px; padding: 5px 7px; }
  .details-content > p { font-size: 11px; }
  .details-actions { gap: 8px; margin-top: 14px; }
  .details-actions button { min-height: 38px; padding: 0 14px; font-size: 11px; }
  .custom-list-add { flex-wrap: wrap; }
  .person-header { grid-template-columns: 100px minmax(0,1fr); gap: 14px; }
  .person-header h1 { font-size: 25px; }
  .person-header p { font-size: 11px; }
  .library-tools { padding: 17px; }
}
@media (min-width: 651px) and (max-width: 900px) {
  .media-card { flex-basis: 160px; }
  .poster-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .media-card, .media-card img, .nav-btn { transition: none !important; }
}


/* HOME HEADER + HERO COMPOSITION */
.brand-mark {
  position: relative;
  width: 31px; height: 34px; flex: 0 0 31px;
  display: block; border-radius: 0;
  background: transparent; box-shadow: none;
  font-size: 0;
}
.brand-mark::before {
  content: ""; position: absolute; inset: 2px 1px;
  background: #f3133f;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  filter: drop-shadow(0 2px 8px rgba(243,19,63,.18));
}
.topbar {
  grid-template-columns: minmax(190px,1fr) minmax(430px,auto) minmax(220px,1fr);
  gap: clamp(14px,2vw,30px);
  min-height: 78px;
  padding: 12px clamp(22px,4.2vw,72px);
  background: rgba(8,8,9,.84);
  border-bottom: 1px solid rgba(255,255,255,.075);
  -webkit-backdrop-filter: blur(24px) saturate(155%);
  backdrop-filter: blur(24px) saturate(155%);
}
.brand { grid-column: 1; grid-row: 1; min-width: 0; }
.brand-name { font-size: 20px; letter-spacing: -.7px; }
.main-nav {
  grid-column: 2; grid-row: 1;
  display: flex; justify-content: center; min-width: 0;
}
.nav-pill {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  gap: 3px; padding: 5px;
  border: 1px solid rgba(255,255,255,.105);
  border-radius: 999px;
  background: rgba(31,31,33,.7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 8px 28px rgba(0,0,0,.16);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
}
.nav-btn, .nav-more-toggle {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 clamp(11px,1.35vw,21px);
  border: 0; border-radius: 999px;
  background: transparent; color: rgba(245,245,247,.78);
  font-size: 12px; font-weight: 600; white-space: nowrap;
  transition: color .2s, background .2s, box-shadow .2s;
}
.nav-btn:hover, .nav-more-toggle:hover {
  color: #fff; background: rgba(255,255,255,.075);
}
.nav-btn.active, .nav-more-toggle.active {
  color: #fff; background: rgba(255,255,255,.19);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 2px 8px rgba(0,0,0,.12);
  font-weight: 700;
}
.nav-btn.active:after { display: none; }
.nav-more { position: relative; display: flex; align-items: center; }
.nav-more-toggle { gap: 6px; }
.nav-more-toggle .nav-chevron {
  display: inline-block;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
  transform: translateY(1px);
}
.nav-more-menu {
  position: absolute; top: calc(100% + 11px); right: 0; z-index: 60;
  min-width: 174px; padding: 7px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 14px;
  background: rgba(25,25,27,.94);
  box-shadow: 0 18px 48px rgba(0,0,0,.48);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  backdrop-filter: blur(28px) saturate(160%);
}
.nav-more-menu[hidden] { display: none !important; }
.nav-more-item {
  display: block; width: 100%; padding: 10px 12px;
  border: 0; border-radius: 8px; background: transparent;
  color: #d9dbe0; text-align: left; font-size: 12px;
}
.nav-more-item:hover, .nav-more-item.active {
  background: rgba(255,255,255,.1); color: #fff;
}
.search-box {
  grid-column: 3; grid-row: 1; justify-self: end;
  width: min(100%,310px); height: 42px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px; background: rgba(35,35,37,.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
}
.search-box input { padding: 0 15px; color: #fff; font-size: 12px; }
.search-box input::placeholder { color: #aaaab1; }
.search-box select {
  max-width: 66px; padding: 0 21px 0 7px;
  border-left: 1px solid rgba(255,255,255,.1);
  color: #c7c8cd; font-size: 10px;
}
.search-box button {
  width: 42px; flex: 0 0 42px;
  color: #e5e5e8; font-size: 21px;
}
.app-shell.home-view .topbar,
.app-shell.details-view .topbar {
  position: sticky; top: 0; z-index: 30;
  margin-bottom: -78px;
  background: linear-gradient(180deg, rgba(0,0,0,.76), rgba(0,0,0,.2));
  border-bottom-color: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  backdrop-filter: blur(18px) saturate(145%);
}
.app-shell.home-view .main-content { padding-top: 0; }
.app-shell.home-view .hero {
  min-height: min(740px, 88vh);
  margin: 0 calc(clamp(22px,4.2vw,72px) * -1) 34px;
  padding: 142px clamp(22px,4.2vw,72px) 104px;
  border-radius: 0;
  background-position: center 23%;
}
.app-shell.home-view .hero:before {
  background:
    linear-gradient(90deg, rgba(0,0,0,.91) 0%, rgba(0,0,0,.78) 25%, rgba(0,0,0,.28) 60%, rgba(0,0,0,.04) 100%),
    linear-gradient(0deg, #080808 0%, rgba(8,8,8,.82) 13%, transparent 51%),
    linear-gradient(180deg, rgba(0,0,0,.38) 0%, transparent 28%);
}
.hero-content {
  width: min(590px,55%);
  padding: 42px 0 28px;
}
.hero-label { color: #f2f2f3; letter-spacing: 2.3px; }
.hero-label:before { width: 3px; height: 15px; background: #f4f4f5; }
.hero-meta { margin-top: 17px; }
.hero-meta span:first-child {
  border-color: rgba(255,255,255,.32);
  background: rgba(255,255,255,.13);
}
.hero h1 {
  max-width: 680px; font-size: clamp(44px,6vw,82px);
  letter-spacing: -2.8px;
}
.hero-actions { align-items: center; gap: 10px; }
.hero-actions .primary-button {
  min-width: 142px; background: #f4f4f5; color: #101012;
}
.hero-actions .secondary-button {
  min-width: 132px; border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.13); color: #f5f5f6;
}
.hero-save-button {
  min-height: 38px; padding: 0 13px;
  border: 0; border-radius: 999px;
  background: transparent; color: rgba(255,255,255,.82);
  font-size: 11px; font-weight: 600;
}
.hero-save-button:hover { background: rgba(255,255,255,.1); color: #fff; }
.hero-save-button.saved { color: #fff; background: rgba(255,255,255,.15); }
.hero-pagination { bottom: 42px; }

/* SCREEN WIDTH ADAPTATION */
@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: auto minmax(0,1fr);
    min-height: 110px; gap: 8px 20px;
  }
  .brand { grid-column: 1; grid-row: 1; }
  .search-box { grid-column: 2; grid-row: 1; }
  .main-nav { grid-column: 1 / -1; grid-row: 2; justify-content: center; }
  .nav-btn, .nav-more-toggle { padding-inline: 15px; }
  .app-shell.home-view .topbar,
  .app-shell.details-view .topbar { margin-bottom: -110px; }
  .app-shell.home-view .hero { padding-top: 172px; }
}
@media (max-width: 650px) {
  .topbar {
    display: flex; flex-wrap: wrap; align-items: center;
    min-height: 0; gap: 8px 12px; padding: 10px 18px 11px;
  }
  .brand { order: 1; flex: 0 0 auto; }
  .brand-mark { width: 25px; height: 29px; flex-basis: 25px; }
  .brand-name { font-size: 17px; }
  .search-box {
    order: 2; flex: 1 1 135px; width: auto; min-width: 0;
    height: 38px;
  }
  .search-box select { max-width: 52px; font-size: 9px; }
  .search-box button { width: 34px; flex-basis: 34px; }
  .main-nav {
    order: 3; width: 100%; min-width: 0;
    justify-content: flex-start; overflow-x: auto;
    padding: 1px 0 2px; scrollbar-width: none;
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .nav-pill { width: max-content; min-width: max-content; }
  .nav-btn, .nav-more-toggle { min-height: 35px; padding-inline: 11px; font-size: 10px; }
  .nav-more-menu { right: 0; }
  .app-shell.home-view .topbar,
  .app-shell.details-view .topbar { margin-bottom: -99px; }
  .app-shell.home-view .hero {
    min-height: 610px; margin: 0 -18px 28px; padding: 153px 22px 90px;
    background-position: 62% center;
  }
  .app-shell.home-view .hero:before {
    background:
      linear-gradient(0deg, #080808 0%, rgba(8,8,8,.9) 22%, rgba(8,8,8,.2) 76%, rgba(8,8,8,.24) 100%),
      linear-gradient(90deg, rgba(0,0,0,.25), transparent 90%);
  }
  .hero-content { width: 100%; padding: 22px 0 18px; }
  .hero h1 { font-size: clamp(37px,11vw,54px); letter-spacing: -1.8px; }
  .hero p { max-width: 100%; font-size: 12px; }
  .hero-actions { gap: 7px; }
  .hero-actions .primary-button, .hero-actions .secondary-button { min-width: 0; padding-inline: 15px; }
  .hero-save-button { padding-inline: 8px; font-size: 10px; }
}


/* FINAL HEADER, SILVER BRAND AND COMPACT TYPOGRAPHY */
.topbar {
  background: rgba(8, 8, 12, .52) !important;
  border: 0 !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: blur(20px) saturate(145%) !important;
  backdrop-filter: blur(20px) saturate(145%) !important;
}
.app-shell.home-view .topbar,
.app-shell.details-view .topbar {
  background: linear-gradient(180deg, rgba(0,0,0,.32), rgba(0,0,0,.06)) !important;
  border: 0 !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: blur(12px) saturate(135%) !important;
  backdrop-filter: blur(12px) saturate(135%) !important;
}
.brand-mark {
  position: static;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(145deg, #f6f6f8 0%, #a5a8b2 100%);
  color: #101116;
  box-shadow: 0 4px 18px rgba(220,224,235,.16), inset 0 1px 1px #fff;
  font: 900 21px/1 Manrope, sans-serif;
}
.brand-mark::before {
  content: none !important;
  display: none !important;
}
.brand-name {
  font-size: 19px !important;
  font-weight: 800;
  letter-spacing: -.75px;
}
.nav-btn, .nav-more-toggle {
  font-size: 12px !important;
}
.search-box input {
  font-size: 12px !important;
}
.hero p {
  font-size: 14px;
}
.primary-button, .secondary-button, .small-button {
  font-size: 12px;
}
@media (max-width: 650px) {
  .brand-name { font-size: 18px !important; }
}


/* CATALOG LAYOUT */
.catalog-layout {
  display: grid;
  grid-template-columns: minmax(330px, 370px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(24px, 3vw, 42px);
  margin-top: 24px;
}
.filter-panel {
  position: sticky;
  top: 104px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px 12px;
  margin: 0;
  padding: 22px 18px;
  min-width: 0;
  max-height: calc(100vh - 128px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.16) transparent;
}
.filter-sidebar-heading,
.provider-filter,
.filter-panel > .primary-button {
  grid-column: 1 / -1;
}
.filter-sidebar-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.filter-sidebar-heading h3,
.catalog-toolbar h3 {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.35px;
}
.filter-eyebrow, .catalog-context {
  color: #9297a3;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
}
.filter-clear {
  border: 0;
  background: transparent;
  color: #b7bac4;
  font-size: 10px;
  cursor: pointer;
}
.filter-clear:hover { color: #fff; }
.filter-panel .filter-field { min-width: 0; }
.catalog-results { min-width: 0; }
.catalog-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  margin: 0 0 18px;
}
.catalog-toolbar h3 { font-size: 20px; }
.result-count { color: #999eaa; font-size: 11px; white-space: nowrap; }
.catalog-results .status-message { margin: 0 0 16px; min-height: 16px; }
.catalog-results .poster-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 26px 16px;
}
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: -4px 0 16px;
}
.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: #e4e6eb;
  font-size: 10px;
}
.active-filter-chip button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #aeb3bf;
  font-size: 13px;
  cursor: pointer;
}
.provider-filter {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.09);
}
.provider-filter-head { align-items: center; flex-direction: row; gap: 10px; }
.provider-filter-head select { width: auto; min-width: 112px; }
.provider-chips { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.provider-chip {
  width: 100%;
  justify-content: flex-start;
  min-width: 0;
  padding: 5px 9px;
  border-radius: 9px;
  font-size: 10px;
}
.provider-chip img { width: 24px; height: 24px; }
.filter-panel > .primary-button { width: 100%; margin-top: 2px; }
.catalog-layout:has(.filter-panel[hidden]) { grid-template-columns: minmax(0,1fr); }
@media (max-width: 1050px) {
  .catalog-layout { grid-template-columns: minmax(300px, 330px) minmax(0,1fr); gap: 20px; }
  .catalog-results .poster-grid { grid-template-columns: repeat(auto-fill,minmax(135px,1fr)); gap: 22px 12px; }
  .filter-panel { gap: 14px 10px; padding: 18px 14px; }
}
@media (max-width: 760px) {
  .catalog-layout { display: flex; flex-direction: column; gap: 18px; margin-top: 16px; }
  .filter-panel {
    position: static;
    width: 100%;
    max-height: none;
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    padding: 16px;
    gap: 14px;
  }
  .filter-sidebar-heading, .provider-filter, .filter-panel > .primary-button { grid-column: 1 / -1; }
  .provider-filter-head { flex-direction: row; align-items: center; }
  .provider-filter-head select { width: auto; min-width: 112px; }
  .provider-chips { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .catalog-results { width: 100%; }
  .catalog-toolbar { min-height: 0; margin-bottom: 14px; }
  .catalog-toolbar h3 { font-size: 18px; }
  .catalog-results .poster-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px 12px; }
}


/* CATALOG TOOLBAR CONTROLS */
.catalog-toolbar {
  display: flex; align-items: end; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.catalog-toolbar-title { min-width: 180px; }
.catalog-toolbar-controls {
  display: flex; align-items: end; justify-content: flex-end;
  gap: 12px; flex-wrap: wrap;
}
.toolbar-control {
  display: grid; gap: 6px; color: #a5a8b2; font-size: 10px;
}
.toolbar-control select {
  min-width: 132px; min-height: 38px; padding: 0 34px 0 12px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 9px;
  background: rgba(255,255,255,.055); color: #f0f1f4;
}
.catalog-toolbar-controls .result-count { align-self: center; white-space: nowrap; }
@media (max-width: 650px) {
  .catalog-toolbar { align-items: stretch; }
  .catalog-toolbar-controls { width: 100%; justify-content: flex-start; }
  .toolbar-control { flex: 1 1 0; min-width: 0; }
  .toolbar-control select { width: 100%; min-width: 0; }
  .catalog-toolbar-controls .result-count { flex-basis: 100%; }
}


/* FULL-BLEED DETAILS BACKDROP */
.details-hero {
  min-height: min(760px, 82vh);
  margin: 0 -4% 28px;
  padding: clamp(32px, 6vw, 88px) 4%;
  border: 0;
  border-radius: 0;
  background-position: center 22%;
  box-shadow: none;
}
@media (max-width: 650px) {
  .details-hero {
    min-height: min(720px, 82vh);
    padding: 28px 4%;
    border-radius: 0;
  }
}


/* DETAILS: ALIGN BACKDROP WITH HOME AND OVERLAY BACK BUTTON */
.details-section {
  position: relative;
  padding-top: 0;
}
.back-button {
  position: absolute;
  top: 18px;
  left: clamp(18px, 4.2vw, 72px);
  z-index: 5;
  margin: 0;
}
.details-hero {
  padding-top: clamp(96px, 10vw, 132px);
}
@media (max-width: 650px) {
  .back-button {
    top: 14px;
    left: 18px;
  }
  .details-hero {
    padding-top: 76px;
  }
}


/* WATCH EPISODE NAVIGATION */
.watch-episode-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.watch-episode-navigation[hidden] { display: none !important; }
.watch-episode-navigation button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 8px;
  background: rgba(255,255,255,.07);
  color: #f1f2f5;
  font-size: 11px;
  cursor: pointer;
}
.watch-episode-navigation button:hover:not(:disabled) {
  background: rgba(255,255,255,.14);
}
.watch-episode-navigation button:disabled {
  opacity: .38;
  cursor: not-allowed;
}


/* WATCH PLAYER RECOVERY ACTIONS */
.watch-player-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 10px;
}
.watch-player-actions button,
.watch-player-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  color: #dfe1e7;
  font-size: 11px;
  text-decoration: none;
  cursor: pointer;
}
.watch-player-actions button:hover,
.watch-player-actions a:hover {
  background: rgba(255,255,255,.13);
  color: #fff;
}


/* IMAGE FAILURE FALLBACK */
.media-card img.image-unavailable,
.person-card img.image-unavailable {
  opacity: 0;
  visibility: hidden;
}

/* ACCESSIBILITY: VISIBLE KEYBOARD FOCUS */
:where(button, a, input, select, textarea, [tabindex="0"]):focus-visible {
  outline: 2px solid #f4f4f5;
  outline-offset: 3px;
}


/* KEYBOARD SKIP NAVIGATION */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f4f4f5;
  color: #101116;
  font-size: 12px;
  font-weight: 700;
  transform: translateY(-160%);
}
.skip-link:focus {
  transform: translateY(0);
}


/* CINE LIBRARY REFINEMENT — VISUAL HIERARCHY */
:root {
  --accent: #d9dce5;
  --accent-hover: #ffffff;
  --accent-soft: rgba(224,228,238,.13);
  --surface-strong: #20232c;
  --focus-ring: #f4f5f8;
}
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}
.section-heading { align-items: end; }
.section-heading h2 { letter-spacing: -.65px; }
.content-section { scroll-margin-top: 24px; }
.primary-button, .secondary-button, .small-button, .back-button {
  transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}
.primary-button:active, .secondary-button:active, .small-button:active { transform: scale(.98); }
.media-card { contain: layout style; }
.media-card img { background-color: #171a21; }
.media-card h3 { letter-spacing: -.15px; }
.media-card p { line-height: 1.5; }
.hero { background-color: #11141b; }
.hero-content { text-wrap: pretty; }
.details-content > p { max-width: 760px; }
.details-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px 18px;
  max-width: 850px;
  margin-top: 18px;
}
.details-fact { display: grid; gap: 4px; min-width: 0; }
.details-fact span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.details-fact strong {
  color: #e6e7eb;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.details-actions { flex-wrap: wrap; }
.details-actions button { min-height: 40px; }
.search-box { position: relative; z-index: 30; }
.search-suggestions {
  position: absolute;
  top: calc(100% + 9px);
  left: 0;
  right: 0;
  z-index: 100;
  overflow: hidden;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(17,19,25,.97);
  box-shadow: 0 18px 48px rgba(0,0,0,.48);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}
.search-suggestion {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.search-suggestion:hover, .search-suggestion:focus-visible { background: rgba(255,255,255,.09); }
.search-suggestion img {
  width: 34px;
  height: 48px;
  flex: 0 0 34px;
  border-radius: 5px;
  object-fit: cover;
  background: var(--surface);
}
.search-suggestion span:nth-child(2) { display: grid; gap: 3px; min-width: 0; }
.search-suggestion strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.search-suggestion small { color: var(--muted); font-size: 9px; text-transform: capitalize; }
.search-suggestion-arrow { margin-left: auto; color: var(--muted); }
.search-suggestion-empty { padding: 14px 12px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.watch-player-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 9px;
}
.watch-active-server {
  padding: 5px 9px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #f0f1f4;
  font-size: 10px;
  font-weight: 700;
}
.watch-player-note { color: var(--muted); font-size: 10px; }
.watch-player-heading button {
  min-height: 28px;
  margin-left: auto;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  color: #dfe1e7;
  font-size: 10px;
  cursor: pointer;
}
.watch-player-heading button:hover { background: rgba(255,255,255,.12); }
@media (max-width: 650px) {
  .details-facts { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .search-suggestions { left: -4px; right: -4px; }
  .watch-player-heading { flex-wrap: wrap; }
  .watch-player-note { flex: 1; }
}

.search-suggestion-placeholder {
  display: grid;
  width: 34px;
  height: 48px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  font-size: 15px;
}


/* STABLE CINEMATIC HERO */
.hero {
  height: clamp(540px, 76vh, 700px);
  min-height: 0;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  background-image: none !important;
}
.hero-background {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-position: center 24%;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 650ms ease;
  will-change: opacity;
}
.hero-background.is-visible { opacity: 1; }
.hero-content { min-width: 0; max-height: 100%; }
.hero h1 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.hero p {
  min-height: 5.1em;
  max-height: 5.1em;
  -webkit-line-clamp: 3;
}
@media (max-width: 650px) {
  .hero { height: 600px; min-height: 0; }
  .hero-background { background-position: 62% center; }
  .hero-content { padding-top: 30px; padding-bottom: 72px; }
  .hero p { min-height: 5.1em; max-height: 5.1em; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-background { transition: none; }
}
