:root {
  color-scheme: dark;
  --bg: #111;
  --panel: #1c1c20;
  --text: #f5f5f6;
  --muted: #b6b5bb;
  --line: #323237;
  --accent: #ee418c;
  --width: 1200px;
  --gap: 24px;
  --radius: 9px;
}

body {
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow-wrap: anywhere;
}

a {
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

h1,
h2,
h3,
p {
  margin: 0;
}

.wrap {
  width: min(var(--width), calc(100% - 2 * var(--gap)));
  margin-inline: auto;
}

.topbar {
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 12;
  border-bottom: 1px solid var(--line);
}

.top-inner,
.top-nav,
.tools,
.wordmark,
.shelf-head,
.switches,
.site-foot nav,
.facts,
.stores,
.trail {
  display: flex;
  align-items: center;
}

.top-inner {
  justify-content: space-between;
  gap: 22px;
  min-height: var(--head, 64px);
}

.top-nav,
.tools {
  gap: clamp(8px, 1.8vw, 28px);
}

.top-nav,
.wordmark,
.tools {
  flex-shrink: 0;
}

.wordmark {
  gap: 9px;
  line-height: 1;
}

.wordmark img {
  width: auto;
  height: var(--logo, 36px);
  object-fit: contain;
  display: block;
}

.wordmark strong {
  font-size: 21px;
  letter-spacing: .02em;
}

.wordmark small {
  display: block;
  letter-spacing: .2em;
  margin-top: 5px;
  font-size: 9px;
}

.top-nav {
  font-size: 15px;
  font-weight: 600;
}

.tools {
  margin-inline-start: auto;
  gap: 12px;
}

.tools .catalog-search {
  max-width: clamp(100px, 13vw, 190px);
}

.catalog-search {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1px 5px 1px 8px;
}

.catalog-search input {
  border: 0;
  background: transparent;
  padding: 6px;
}

.catalog-search button {
  display: grid;
  place-items: center;
}

.catalog-language select {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  max-width: 110px;
}

.nav-menu {
  display: none;
  position: relative;
}

.nav-menu summary {
  list-style: none;
  padding: 5px 7px;
  font-size: 21px;
  line-height: 1;
}

.nav-menu summary::-webkit-details-marker {
  display: none;
}

.nav-menu>div {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 13px);
  width: min(270px, calc(100vw - 28px));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 10px 28px #0004;
}

.nav-menu nav {
  display: grid;
  margin: 8px 0;
}

.nav-menu nav a {
  padding: 5px 0;
}

.shelf {
  margin: 32px 0 44px;
  min-width: 0;
}

.shelf-head {
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.shelf-head h2 {
  font-size: clamp(19px, 2vw, 29px);
  line-height: 1.3;
}

.shelf-head>a,
.catalog-meta,
.trail,
.engagement {
  color: var(--muted);
  font-size: 14px;
}

.catalog-cover {
  border-radius: var(--radius);
  background: var(--panel);
}

.catalog-cover img {
  object-position: center top;
}

.catalog-title {
  font-size: 16px;
  line-height: 1.36;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.facts,
.filter-row,
.site-foot nav,
.stores,
.trail {
  flex-wrap: wrap;
  gap: 8px 12px;
}

.facts,
.filter-row {
  font-size: 14px;
  color: var(--muted);
}

.filter-row {
  display: flex;
  margin-block: 18px 24px;
}

.facts a,
.filter-row a {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2px 10px;
}

.trail {
  padding: 16px 0;
}

.action,
.stores a {
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  padding: 8px 17px;
  display: inline-block;
}

.action:hover,
.stores a:hover {
  color: #fff;
  filter: brightness(1.1);
}

.synopsis {
  color: var(--muted);
  line-height: 1.75;
  white-space: pre-line;
}

.engagement span a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.series-gallery,
.episode-picker {
  margin-block: 25px;
  min-width: 0;
}

.series-gallery h2,
.episode-picker h2 {
  margin-bottom: 14px;
  font-size: 22px;
}

.episode {
  color: var(--text);
  background: var(--panel);
  border-color: var(--line);
  min-width: 43px;
  justify-content: center;
}

.episode.active {
  border-color: var(--accent);
  color: var(--accent);
}

.trail a,
.engagement a {
  color: inherit;
}

.site-foot {
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.site-foot>div {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 30px;
  align-items: center;
  justify-content: space-between;
  padding-block: 30px;
}

.site-foot nav,
.site-foot small {
  color: var(--muted);
  font-size: 13px;
}

.app-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(20px, 6vw, 80px);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: clamp(22px, 4vw, 60px);
  background: var(--panel);
}

.app-info p {
  margin: 10px 0 20px;
  color: var(--muted);
}

.switches {
  justify-content: center;
  gap: 8px;
}

.switches button {
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: 24px;
  line-height: 1;
}

.switches .pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #98989d;
}

.switches .pip[aria-pressed=true] {
  background: var(--accent);
}

.title-link {
  display: inline-block;
  color: var(--accent);
  font-weight: 650;
}

.quiet-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

@media(max-width:1080px) {
  .top-nav {
    display: none;
  }

  .nav-menu {
    display: block;
  }
}

@media(max-width:620px) {
  :root {
    --gap: 14px;
  }

  .top-inner {
    gap: 9px;
  }

  .tools {
    gap: 6px;
  }

  .tools>.catalog-language {
    display: none;
  }

  .tools .catalog-search {
    max-width: 115px;
  }

  .shelf {
    margin-block: 22px 30px;
  }

  .catalog-meta,
  .shelf-head>a {
    font-size: 12px;
  }

  .catalog-title {
    font-size: 14px;
  }

  .site-foot>div {
    flex-direction: column;
    align-items: flex-start;
  }

  .series-gallery>div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .player-wrap video {
    height: clamp(220px, 48vh, 460px);
  }
}

@media(prefers-reduced-motion:no-preference) {

  .action,
  .filter-row a,
  .top-nav a,
  .episode,
  .catalog-title,
  .stores a {
    transition: color .18s, background .18s, filter .18s, border-color .18s;
  }

  .catalog-card .catalog-cover img {
    transition: transform .3s ease-out;
  }
}

:root {
  --width: 1520px;
  --gap: clamp(18px, 4vw, 56px);
  --head: 76px;
  --bg: #101113;
  --panel: #171619;
  --line: #302a30;
  --accent: #ee647d;
  --muted: #aca6ac;
  --radius: 12px;
}

.topbar {
  background: #100d0f;
}

.wordmark img {
  border-radius: 11px;
  width: 43px;
  height: 43px;
}

.genre-band {
  background: #151316;
  border-bottom: 1px solid var(--line);
}

.ribbon {
  display: flex;
  gap: 23px;
  height: 52px;
  align-items: center;
  white-space: nowrap;
  overflow: auto;
  scrollbar-width: none;
}

.ribbon a {
  color: var(--muted);
  font-size: 14px;
}

.ribbon a:first-child {
  color: #fff;
  font-weight: bold;
}

.announcement {
  padding-top: 14px;
}

.announcement a {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 48px;
  padding: 0 18px;
  background: linear-gradient(95deg, #30191f, #1a1519);
  border: 1px solid #6f343e;
  border-radius: 12px;
  font-weight: 600;
}

.announcement i {
  width: 9px;
  height: 9px;
  flex: none;
  background: var(--accent);
  border-radius: 50%;
}

.announcement span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.announcement b {
  margin-inline-start: auto;
  color: var(--accent);
  font-size: 21px;
}

.deck {
  text-align: center;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 42%, #3c252e 0%, #171518 47%, var(--bg) 74%);
  padding: 46px 0 22px;
}

.deck-art {
  position: relative;
  height: 400px;
  --w: 300px;
  --near: 205px;
  --far: 342px;
  perspective: 1000px;
}

.deck-art a {
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  width: var(--w);
  margin-left: calc(var(--w) / -2);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 14px 45px #000a;
  transform: translateX(0);
  z-index: 4;
}

.deck-art img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

.deck-art a[data-offset="1"] {
  transform: translateX(var(--near)) scale(.86) rotateY(-16deg);
}

.deck-art a[data-offset="-1"] {
  transform: translateX(calc(-1 * var(--near))) scale(.86) rotateY(16deg);
}

.deck-art a[data-offset="2"] {
  transform: translateX(var(--far)) scale(.71) rotateY(-21deg);
}

.deck-art a[data-offset="-2"] {
  transform: translateX(calc(-1 * var(--far))) scale(.71) rotateY(21deg);
}

.deck-art a:not([data-offset="0"]) {
  filter: brightness(.55);
  z-index: 2;
}

.deck-art a:is([data-offset="-2"], [data-offset="2"]) {
  z-index: 1;
  filter: brightness(.36);
}

.deck-copy {
  min-height: 68px;
  margin: 10px 12px 3px;
}

.deck-copy h2 {
  font-size: clamp(20px, 2vw, 29px);
  line-height: 1.35;
}

.deck-copy p {
  font-size: 14px;
  color: var(--muted);
}

.switches .pip[aria-pressed=true] {
  width: 19px;
  border-radius: 8px;
}

.film-rows .shelf {
  margin: 12px 0 32px;
  padding-top: 6px;
}

.film-rows .catalog-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: none;
  grid-auto-columns: calc((100% - 5 * 16px) / 6);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  padding-bottom: 7px;
  gap: 16px;
}

.portrait-panel {
  display: grid;
  grid-template-columns: 200px minmax(0, 750px);
  gap: 28px;
  min-height: 390px;
  padding: 32px;
  align-items: center;
  border-radius: 17px;
  background: radial-gradient(ellipse at 15% 25%, #382a31, #211e21 65%);
  border: 1px solid #42343c;
}

.portrait-art img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

.portrait-panel h1 {
  font-size: clamp(24px, 3.3vw, 46px);
}

.portrait-panel .facts {
  margin: 12px 0;
}

.portrait-panel .action {
  margin-top: 17px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 2.65fr) minmax(0, 1fr);
  gap: 28px;
  margin: 24px 0 36px;
}

.side-index {
  align-self: start;
  background: var(--panel);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.side-index li {
  margin-bottom: 12px;
  padding-inline-start: 6px;
}

.side-index li::marker {
  color: var(--accent);
}

.split .episode-picker {
  margin-top: 0;
}

.directory {
  margin-bottom: 55px;
}

.app-panel {
  background: radial-gradient(ellipse at 15% 25%, #43242f, #221d22 65%);
}

@media(max-width:850px) {
  .film-rows .catalog-grid {
    grid-auto-columns: calc((100% - 28px) / 3.2);
    gap: 12px;
  }

  .split {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media(max-width:600px) {
  :root {
    --head: 64px;
    --gap: 18px;
  }

  .wordmark img {
    width: 34px;
    height: 34px;
  }

  .wordmark strong {
    font-size: 17px;
  }

  .ribbon {
    height: 46px;
    gap: 18px;
  }

  .announcement {
    padding-top: 12px;
  }

  .announcement a {
    height: 47px;
    font-size: 13px;
  }

  .deck {
    padding: 26px 0 16px;
  }

  .deck-art {
    height: clamp(230px, 74.6vw, 300px);
    --w: clamp(172px, 56vw, 225px);
    --near: 104px;
    --far: 162px;
  }

  .deck-copy {
    min-height: 59px;
    margin-top: 9px;
  }

  .film-rows .catalog-grid {
    grid-auto-columns: calc((100% - 18px) / 2.6);
    gap: 9px;
  }

  .portrait-panel {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
    padding: 15px;
    align-items: start;
  }

  .portrait-panel .synopsis {
    font-size: 13px;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .portrait-panel .engagement {
    font-size: 12px;
  }
}

@media(prefers-reduced-motion:no-preference) {
  .deck-art a {
    transition: transform .52s cubic-bezier(.22, .7, .25, 1), filter .52s;
  }

  .switches .pip {
    transition: width .23s, background .23s;
  }
}

.portrait-screen {
  width: min(848px, calc(100% - 32px));
  margin: 24px auto 52px;
}

.portrait-screen .player-wrap {
  width: min(420px, 100%);
  border-radius: 10px;
  margin: auto;
}

.portrait-screen video {
  width: 100%;
  height: auto;
  aspect-ratio: 9/16;
  max-height: 720px;
}

.portrait-screen .trail {
  padding-block: 20px;
}

@media(max-width:550px) {
  body[data-route="watch"] .topbar {
    display: none;
  }

  .portrait-screen .player-wrap {
    border-radius: 8px;
  }
}

.wordmark img[src="/assets/site-fruit.svg"] { width: 36px; height: 36px; object-fit: contain; }
.wordmark strong { white-space: nowrap; }
