/* Shared library surfaces and playback controls. */
:root {
  --canvas: #101112;
  --surface: #1c1d20;
  --line: #ffffff20;
  --ink: #f6f4f0;
  --amber: #ffbe77;
}
::selection {
  background: #ffe2b5;
  color: #1b1714;
}
button,
select {
  user-select: none;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
video:focus-visible {
  outline: 2px solid #fff6e8;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px #1b1b1d;
}
header {
  border-bottom: 1px solid #ffffff10;
  background: #101113f5;
  min-height: 4.35rem;
  gap: clamp(1rem, 3vw, 3rem);
}
button.brand {
  color: var(--ink);
  font:
    700 1.24rem/1.15 "Segoe UI Variable Display",
    "Segoe UI",
    system-ui,
    sans-serif;
  letter-spacing: -0.055em;
}
.brand img {
  width: 1.67rem;
  height: 1.67rem;
}
nav {
  gap: 0.15rem;
  padding: 0.2rem;
  scrollbar-width: none;
}
nav button {
  position: relative;
  padding: 0.68rem 0.7rem;
  color: #bfc0c4;
  border-radius: 0.38rem;
  font-weight: 550;
}
nav button:hover,
nav button[aria-current="page"]:hover {
  color: white;
  background: #ffffff0d;
}
nav button[aria-current="page"] {
  background: transparent;
  color: white;
  font-weight: 700;
}
nav button[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0.72rem;
  right: 0.72rem;
  bottom: 0.12rem;
  height: 2px;
  border-radius: 2px;
  background: var(--amber);
}
nav button:focus-visible {
  outline-offset: -2px;
  box-shadow: none;
}
#profile {
  border: 1px solid var(--line);
  border-radius: 2rem;
  background: #ffffff08;
  padding: 0.48rem 0.85rem;
  font-size: 0.86rem;
}
#profile::before {
  content: "";
  display: inline-block;
  vertical-align: 0.04em;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.45rem;
  background: #e3ad7b;
  border-radius: 50%;
}
h1,
.detailhero h2 {
  font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.055em;
  text-wrap: balance;
}
.hero {
  gap: 0.8rem;
  min-height: clamp(26rem, 59svh, 49rem);
  padding-block: clamp(2.4rem, 6vw, 6rem);
  background-position: center 31%;
}
.hero h1 {
  max-width: min(15ch, 100%);
  font-size: clamp(2.8rem, 5.6vw, 6.5rem);
}
.hero p {
  color: #e6e5e3;
  max-width: min(55ch, 100%);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero small,
.detailhero small {
  font-weight: 600;
  color: #e4dfd8;
  letter-spacing: 0.02em;
}
.actions {
  gap: 0.65rem;
}
.actions button,
.primary {
  border-radius: 0.65rem;
  padding: 0.72rem 1.17rem;
}
.primary {
  background: #f6f4ef;
  color: #151617;
}
.primary:hover {
  background: white;
}
#heroplay::before,
#dplay::before {
  content: "";
  display: inline-block;
  margin-right: 0.55em;
  border-left: 0.58em solid currentColor;
  border-top: 0.35em solid transparent;
  border-bottom: 0.35em solid transparent;
}
.hero .actions button:not(.primary),
.title-view .actions button:not(.primary) {
  background: #292b2ee8;
  border: 1px solid #ffffff28;
}
.section {
  padding-block: clamp(1.1rem, 2.1vw, 2.2rem);
}
.section > h2,
.season-heading h3 {
  font-size: clamp(1.18rem, 1.55vw, 1.65rem);
  font-weight: 650;
  letter-spacing: -0.035em;
}
.section > .rail {
  margin: 0 -0.35rem;
  padding: 0.4rem 0.35rem 0.8rem;
  scrollbar-color: #ffffff36 transparent;
}
.wide-rail {
  grid-auto-columns: clamp(13.5rem, 22vw, 24rem);
}
.card {
  gap: 0.32rem;
  line-height: 1.32;
}
.card strong {
  font-size: 0.98rem;
  font-weight: 620;
}
.card small {
  font-size: 0.82rem;
  color: #b3b3b8;
}
.poster {
  border-radius: 0.62rem;
}
.poster.landscape {
  aspect-ratio: 16/9;
}
.poster.landscape img {
  object-position: center 30%;
}
.poster.landscape::after {
  content: "";
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, #0006);
  pointer-events: none;
}
.resume-action,
.tile-play,
.watched-badge {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  background: #151517cf;
  color: white;
}
.resume-action,
.tile-play {
  left: 0.55rem;
  bottom: 0.6rem;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 100%;
  font-size: 0.7rem;
}
.watched-badge {
  right: 0.35rem;
  top: 0.35rem;
  border-radius: 0.35rem;
  width: 1.45rem;
  height: 1.45rem;
  font-size: 0.84rem;
}
.poster img,
.episode-still img {
  transition: transform 140ms ease-out;
}
.card:hover,
.card:focus-visible {
  color: var(--ink);
}
.card:hover .poster img,
.take:hover .episode-still img {
  transform: scale(1.025);
}
.card:hover .poster,
.take:hover .episode-still {
  outline: 1px solid #ffffff60;
  outline-offset: -1px;
}
progress {
  appearance: none;
  border: 0;
  height: 0.25rem;
  background: #383638;
  color: var(--amber);
  z-index: 2;
}
progress::-webkit-progress-bar {
  background: #302d2fe6;
}
progress::-webkit-progress-value {
  background: var(--amber);
}
progress::-moz-progress-bar {
  background: var(--amber);
}
.filters {
  padding-bottom: 0.3rem;
}
input,
select {
  background: #202124;
  border-color: #ffffff26;
  border-radius: 0.55rem;
}
select {
  cursor: pointer;
  accent-color: var(--amber);
}
@supports (appearance: base-select) {
  select,
  select::picker(select) {
    appearance: base-select;
  }
  select::picker(select) {
    background: #232427;
    color: var(--ink);
    border: 1px solid #ffffff30;
    border-radius: 0.62rem;
    padding: 0.28rem;
    box-shadow: 0 0.8rem 2rem #0006;
  }
  option {
    border-radius: 0.35rem;
    padding: 0.46rem 0.65rem;
  }
  option:checked {
    background: #38393d;
    color: white;
  }
  option:hover,
  option:focus-visible {
    background: #46464a;
    color: white;
  }
}
.profiles .choice:hover {
  background: transparent;
  color: white;
}
.choice:hover .tile,
.choice:focus-visible .tile {
  outline: 2px solid #f8f3e9;
  outline-offset: 4px;
}
.tile {
  font-family: inherit;
  font-weight: 650;
  border-radius: 1rem;
}
.profiles .actions button {
  background: transparent;
  color: #c6c6ca;
  border: 1px solid var(--line);
}
#detail:has(.title-view) {
  width: min(68rem, 95vw);
  background: #191a1d;
  border-color: var(--line);
  box-shadow: 0 2rem 8rem #0008;
}
dialog::backdrop {
  background: #08090ad6;
}
.title-view {
  --pad: clamp(1rem, 3vw, 2rem);
  gap: 1rem;
}
.body:has(.title-view) {
  padding: 0;
}
.title-view > p,
.title-view > .actions,
.title-view > .season-heading,
.title-view > .episodes {
  margin-inline: var(--pad);
}
.title-view > p {
  max-width: 75ch;
  color: #d1d1d4;
  font-size: 0.97rem;
}
.detailhero {
  padding: clamp(5.5rem, 16vw, 12rem) var(--pad) 1.5rem;
  border-radius: 0;
  min-width: 0;
}
.detailhero h2 {
  font-size: clamp(2rem, 4.4vw, 4.2rem);
  margin-top: 0.32rem;
}
.season-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}
.season-heading small {
  color: #aaaab0;
  font-weight: 450;
  font-size: 0.8em;
  margin-left: 0.2rem;
}
.season-heading select {
  max-width: 55%;
  font-size: 0.89rem;
}
.season-choices {
  max-width: 65%;
}
.season-choices select {
  max-width: 100%;
}
.season-tabs {
  display: none;
}
.season-progress {
  display: block;
  margin: 0.2rem 0 0;
  color: #b0b0b6;
  font-size: 0.82rem;
}
@media (min-width: 44rem) {
  .season-tabs {
    display: flex;
    gap: 0.2rem;
    flex-wrap: wrap;
    padding: 0.22rem;
    background: #101113;
    border: 1px solid var(--line);
    border-radius: 0.55rem;
  }
  .season-tabs button {
    padding: 0.47rem 0.68rem;
    font-size: 0.85rem;
    background: transparent;
    color: #bfc0c4;
  }
  .season-tabs button[aria-pressed="true"] {
    background: #38393d;
    color: white;
  }
  .season-tabs + select {
    display: none;
  }
}
.episodes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(12rem, 100%), 1fr));
  gap: 1rem 0.8rem;
  padding-bottom: var(--pad);
}
.episode {
  position: relative;
  display: block;
  border: 0;
  padding: 0;
  min-width: 0;
}
.episode .take {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.28rem;
  padding: 0;
  border-radius: 0.55rem;
  line-height: 1.35;
  background: transparent;
}
.episode .take strong {
  font-size: 0.95rem;
  text-align: left;
  overflow-wrap: anywhere;
}
.episode .take small {
  font-size: 0.78rem;
  text-align: left;
}
.episode-still {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 0.5rem;
  background: linear-gradient(130deg, #33363b, #28292c 68%, #202124);
  margin-bottom: 0.16rem;
}
.episode-still img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.episode-still img:not([src]) {
  display: none;
}
.still-number {
  font-size: 1.7rem;
  font-weight: 600;
  color: #b7b4b2;
}
.episode .tile-play {
  opacity: 0;
}
.take:hover .tile-play,
.take:focus-visible .tile-play,
.current-episode .tile-play {
  opacity: 1;
}
.episode-still progress {
  position: absolute;
  inset: auto 0 0;
  width: 100%;
}
.episode .mark {
  position: absolute;
  right: 0.32rem;
  top: 0.32rem;
  padding: 0;
  color: #fff;
  background: #141415cf;
  border: 1px solid #ffffff36;
  border-radius: 0.34rem;
  width: 1.7rem;
  height: 1.7rem;
  font-size: 1rem;
}
.episode .mark[aria-pressed="false"] {
  opacity: 0;
}
.episode:hover .mark,
.episode .mark:focus-visible,
.episode:focus-within .mark {
  opacity: 1;
}
.current-episode .take small {
  color: #ffcb93;
}
.movie-state {
  grid-template-columns: 1fr;
}
.movie-state .take {
  padding-right: 3rem;
}
.movie-state .mark {
  opacity: 1 !important;
}
#screen .screen-tools {
  position: absolute;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem;
  background: linear-gradient(#000c, transparent);
}
#screen .close {
  position: static;
  float: none;
  margin: 0;
}
#playing-title {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: clamp(0.86rem, 2vw, 1.15rem);
}
#screen.idle .screen-tools:not(:focus-within):not(:hover) {
  opacity: 0;
  pointer-events: none;
}
#play-menu {
  position: absolute;
  top: 4.4rem;
  right: 1rem;
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  background: #222327;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  width: min(18rem, 90vw);
}
#screen #play-menu select {
  max-width: none;
}
#screen #next-episode {
  position: absolute;
  bottom: 5.5rem;
  right: 1rem;
  max-width: min(27rem, 90vw);
}
#playerinfo:not(:empty) {
  padding: 0.55rem 0.8rem;
}
@media (max-width: 48rem) {
  header {
    gap: 0.3rem 1rem;
  }
  .hero {
    min-height: 24rem;
  }
  .episodes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .movie-state {
    grid-template-columns: 1fr;
  }
  .episode .mark[aria-pressed="false"] {
    opacity: 0.85;
  }
}
@media (prefers-reduced-motion: reduce) {
  .poster img,
  .episode-still img {
    transition: none;
  }
  .card:hover .poster img,
  .take:hover .episode-still img {
    transform: none;
  }
}
@media (forced-colors: active) {
  nav button[aria-current="page"] {
    border-bottom: 2px solid Highlight;
  }
  .current-episode .episode-still {
    outline: 1px solid Highlight;
  }
}

#handoff[open] { position:fixed; inset:0; width:100%; height:100%; max-width:none; max-height:none; margin:0; border:0; border-radius:0; background:#101113; color:#f4f2ef; display:grid; place-items:center; }
#handoff div { display:grid; gap:.55rem; max-width:42rem; padding:2rem; text-align:center; }
#handoff small { color:#bebbc1; }
#handoff strong { font-size:clamp(1.2rem,3vw,2rem); }
@media (prefers-reduced-motion:no-preference) {
  #handoff[open], #screen[open] { animation:enter-screen .16s ease-out; }
  @keyframes enter-screen { from { opacity:.2; } to { opacity:1; } }
}
.discovery-tabs { display:flex; flex-wrap:wrap; gap:.5rem; margin-block:1.2rem; }
.discovery-tabs [aria-pressed=true] { background:#e8e4df; color:#17181b; }
.discovery-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(9rem,42%),1fr)); gap:1.4rem .9rem; margin-block:1rem; }
.discover-card { display:grid; align-content:start; gap:.35rem; min-width:0; padding:0; border:0; text-align:start; background:transparent; }
.discover-poster { display:block; width:100%; aspect-ratio:2/3; overflow:hidden; border-radius:.5rem; background:#28292c; }
.discover-poster img { width:100%; height:100%; object-fit:cover; }
.discover-card small { color:#bbbcc1; }
#discover { display:flex; gap:.6rem; align-items:end; }
#discover label { width:min(100%,28rem); }
#screen.idle .screen-tools { opacity:0; pointer-events:none; }

.web-transport { position:absolute; inset:auto 0 0; padding:2rem clamp(.75rem,3vw,3rem) 1rem; background:linear-gradient(transparent,#101113ed); transition:opacity .18s; }
.web-transport div { display:flex; gap:.35rem; align-items:center; }
.web-transport input { width:100%; accent-color:#ffc182; }
.web-transport button { background:#25262bd9; color:#fff; }
#web-full { margin-inline-start:auto; }
#web-time { font-variant-numeric:tabular-nums; font-size:.83rem; }
#screen.idle .web-transport { opacity:0; pointer-events:none; }
#screen.idle video { cursor:none; }
