:root {
  --bg: #000;
  --surface: #0e0e0e;
  --surface-2: #181818;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f5f5f5;
  --muted: #a3a3a3;
  --faint: #6b6b6b;
  --amber: #e50914;
  --amber-deep: #b20710;
  --green: #8be07a;
  --red: #ff7a6b;
  --serif: 'Google Sans', system-ui, sans-serif;
  --sans: 'Google Sans', system-ui, sans-serif;
  --mono: 'Google Sans Code', ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* film grain */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------- header ---------------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  padding: 14px var(--gutter);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0));
  transition: background 0.3s;
}
.top.solid { background: rgba(0, 0, 0, 0.94); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.logo {
  display: inline-flex; align-items: center; gap: 0.32em;
  font-family: var(--sans); font-weight: 700; font-size: 24px; line-height: 1;
  color: var(--text); letter-spacing: -0.045em;
}
.logo-icon { width: 1.2em; height: 1.2em; flex: none; }
.logo-icon, .logo-icon * { stroke: none; }
.logo.big { font-size: clamp(56px, 12vw, 96px); }
.top nav { display: flex; gap: 20px; font-weight: 600; font-size: 14px; }
.top nav a { color: var(--muted); transition: color 0.2s; }
.top nav a.active, .top nav a:hover { color: var(--text); }
.search {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 14px; width: min(320px, 40vw);
}
.search:focus-within { border-color: rgba(229, 9, 20, 0.5); }
.search svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.search input { background: none; border: 0; outline: 0; color: var(--text); font: inherit; width: 100%; }
/* ---------------- profile menu ---------------- */
.profile { position: relative; flex: none; }
.avatar {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); transition: color .2s, border-color .2s;
}
.avatar:hover, .avatar[aria-expanded="true"] { color: var(--text); border-color: rgba(255, 255, 255, 0.25); }
.avatar svg { width: 18px; height: 18px; }
.avatar.sm { width: 28px; height: 28px; }
.avatar.sm svg { width: 15px; height: 15px; }
.profile-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; min-width: 200px; padding: 6px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8);
}
.profile-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.profile-menu a, .profile-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; color: var(--text);
  background: none; border: 0; border-radius: 8px; padding: 9px 10px; font: inherit; font-size: 14px; font-weight: 500;
}
.profile-menu a:hover, .profile-menu button:hover, .profile-menu a.active { background: rgba(255, 255, 255, 0.07); }
.profile-menu svg { width: 17px; height: 17px; color: var(--muted); }

/* No page scrollbar (wheel/trackpad/keys still scroll, like a TV app); thin quiet ones for inner panels. */
html { scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }
/* Safari/WebKit and Chrome draw these only when `scrollbar-width` is NOT set, so it's Firefox-only below. */
::-webkit-scrollbar { width: 6px; height: 6px; background: transparent; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner, ::-webkit-scrollbar-button { background: transparent; display: none; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
}
/* back button in the header (outside Home) */
.nav-back { flex: none; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; margin-right: -12px; border-radius: 50%; color: var(--text); }
.nav-back svg { stroke-width: 2.4; }
.nav-back[hidden] { display: none; }

.icon-btn {
  background: none; border: 0; padding: 6px; color: var(--muted); border-radius: 6px;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; display: block; }

@media (max-width: 640px) {
  .top { flex-wrap: wrap; gap: 10px 16px; }
  .top nav { margin-left: auto; }
  .search { order: 5; width: 100%; margin: 0; }
}

#app { min-height: 100vh; padding-bottom: 80px; }
.page { padding: 96px var(--gutter) 0; }
@media (max-width: 640px) { .page { padding-top: 130px; } }

/* ---------------- hero ---------------- */
.hero {
  position: relative; min-height: min(78vh, 720px);
  display: flex; align-items: flex-end;
  padding: 120px var(--gutter) 56px;
  isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; animation: drift 30s ease-in-out infinite alternate; }
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--bg) 2%, rgba(0, 0, 0, 0.55) 45%, rgba(0, 0, 0, 0.2) 100%),
    linear-gradient(to right, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0) 65%);
}
@keyframes drift { from { transform: scale(1.04); } to { transform: scale(1.12) translateX(-1.5%); } }
.hero-content { max-width: 640px; }
.eyebrow {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.22em;
  color: var(--amber); display: flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ''; width: 22px; height: 1px; background: var(--amber); }
.hero h1, .detail h1 {
  font-family: var(--sans); font-weight: 600; line-height: 1; letter-spacing: -0.035em;
  font-size: clamp(44px, 7vw, 92px); margin: 14px 0 16px;
}
.hero p.overview { color: #d4d4d4; max-width: 56ch; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 13px; font-weight: 500; }
.meta .rating { color: var(--amber); }
.actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.08);
  padding: 11px 20px; border-radius: 999px; font-weight: 600; font-size: 14px;
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
}
.btn:hover { background: rgba(255, 255, 255, 0.14); }
.btn:active { transform: scale(0.97); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--amber); color: #fff; border-color: transparent;  }
.btn.primary:hover { background: #f6121d; }
.btn.small { padding: 7px 14px; font-size: 13px; }
.btn.on { border-color: rgba(255, 255, 255, 0.22); color: var(--text); }
.btn.on svg { color: var(--amber); }

/* ---------------- rows ---------------- */
.row { margin-top: 40px; }
.row-head { display: flex; align-items: baseline; gap: 14px; padding: 0 var(--gutter); margin-bottom: 14px; }
.row-head h2 { font-family: var(--sans); font-weight: 600; font-size: 22px; letter-spacing: -0.02em; margin: 0; }
.row-head .count { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.scroller {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(130px, 15vw, 190px);
  gap: 14px; overflow-x: auto; padding: 6px var(--gutter) 18px;
  scroll-snap-type: x proximity; scroll-padding: 0 var(--gutter); scrollbar-width: none;
}
.scroller::-webkit-scrollbar { display: none; }
.scroller.wide { grid-auto-columns: clamp(240px, 26vw, 340px); }

.card { scroll-snap-align: start; position: relative; }
.card .poster {
  aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden;
  background: var(--surface-2); position: relative;
  outline: 1px solid var(--line); outline-offset: -1px;
  transition: transform 0.25s cubic-bezier(.2,.8,.2,1), box-shadow 0.25s, outline-color 0.25s;
}
.card .poster img { width: 100%; height: 100%; object-fit: cover; }
.card:hover .poster { transform: translateY(-4px); outline-color: rgba(229, 9, 20, 0.65); box-shadow: 0 18px 40px -16px rgba(229, 9, 20, 0.35); }
.card .name { margin-top: 9px; font-weight: 600; font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .sub { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-top: 3px; }
.card .noimg { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center; font-size: 16px; font-weight: 600; color: var(--muted); }
.card.landscape .poster { aspect-ratio: 16 / 9; }
.bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(0, 0, 0, 0.5); }
.bar i { display: block; height: 100%; background: var(--amber); }
.card .remove {
  position: absolute; top: 6px; right: 6px; z-index: 2; opacity: 0;
  background: rgba(0, 0, 0, 0.8); border: 0; border-radius: 50%; width: 28px; height: 28px;
  display: grid; place-items: center; color: var(--text); transition: opacity 0.2s;
}
.card .remove svg { width: 14px; height: 14px; }
.card:hover .remove, .card .remove:focus-visible { opacity: 1; }
@media (hover: none) { .card .remove { opacity: 1; } }

.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(130px, 14vw, 180px), 1fr));
  gap: 26px 16px;
}
.page-title { font-family: var(--sans); font-weight: 600; letter-spacing: -0.03em; font-size: clamp(36px, 5vw, 56px); margin: 0 0 26px; }
.page-title em { color: var(--amber); font-style: normal; }

/* ---------------- detail ---------------- */
.detail { padding-bottom: 20px; }
.detail .hero { min-height: min(70vh, 640px); }
.detail .tagline { font-size: 18px; color: #d4d4d4; margin: 0 0 10px; }
.detail .overview { max-width: 62ch; color: #d4d4d4; }
.genres { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.chip { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }

.section { padding: 0 var(--gutter); margin-top: 36px; }
.section h2 { font-family: var(--sans); font-weight: 600; font-size: 26px; letter-spacing: -0.02em; margin: 0 0 16px; display: flex; align-items: baseline; gap: 14px; }

.seasons {
  position: relative; display: flex; gap: 10px; overflow-x: auto;
  padding: 4px 3px 8px; margin: 0 -3px 18px; scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.seasons::-webkit-scrollbar { display: none; }
.seasons button {
  flex: none; min-height: 44px; background: #080808;
  border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 999px;
  padding: 10px 22px; font-weight: 600; font-size: 15px; line-height: 1.4;
  white-space: nowrap; color: var(--muted);
  transition: background-color 150ms, border-color 150ms, color 150ms, transform 150ms;
}
.seasons button:hover { background: #1c1c1c; color: var(--text); border-color: rgba(255, 255, 255, 0.4); }
.seasons button.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.seasons button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.seasons button:active { transform: scale(0.96); }
@media (prefers-reduced-motion: reduce) { .seasons button { transition: none; transform: none; } }

.episodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.ep {
  display: grid; grid-template-columns: 132px 1fr; gap: 12px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; text-align: left; transition: border-color 0.2s, background 0.2s;
}
.ep:hover { border-color: rgba(229, 9, 20, 0.45); }
.ep.active { border-color: var(--amber); background: var(--surface-2); }
.ep .thumb { aspect-ratio: 16/9; border-radius: 5px; overflow: hidden; background: var(--surface-2); position: relative; }
.ep .thumb img { width: 100%; height: 100%; object-fit: cover; }
.ep .t { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.ep .n { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; color: rgba(255, 255, 255, 0.6); margin-bottom: 4px; }
.ep-tag {
  font-family: var(--sans); font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; line-height: 1;
  padding: 3px 7px; border-radius: 999px; color: rgba(255, 255, 255, 0.78); background: rgba(255, 255, 255, 0.09);
}
.ep-tag.next { color: #fff; background: var(--amber); }
.ep .d { color: var(--muted); font-size: 12px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------------- streams ---------------- */
.streams-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button {
  background: none; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.filters button.active { color: var(--bg); background: var(--amber); border-color: transparent; }
.play-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; user-select: none; }
.play-toggle input { accent-color: var(--amber); margin: 0; }
.streams { display: flex; flex-direction: column; gap: 6px; }
.stream {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
  width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; transition: border-color 0.2s, background 0.2s;
}
.stream:hover { border-color: rgba(229, 9, 20, 0.5); background: var(--surface-2); }
.res {
  font-family: var(--mono); font-weight: 500; font-size: 12px; text-align: center;
  border: 1px solid var(--line); border-radius: 5px; padding: 5px 0; line-height: 1.2;
}
.res.k4 { color: var(--amber); border-color: rgba(229, 9, 20, 0.4); }
.res small { display: block; font-size: 9.5px; color: var(--faint); }
.stream .fn { font-size: 13.5px; font-weight: 600; word-break: break-word; line-height: 1.35; }
.stream .info { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 5px; color: var(--muted); font-family: var(--mono); font-size: 11.5px; }
.badge { font-family: var(--mono); font-size: 11px; font-weight: 500; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.badge.cached { color: var(--green); background: rgba(155, 227, 122, 0.1); border: 1px solid rgba(155, 227, 122, 0.3); }
.badge.uncached { color: var(--muted); border: 1px solid var(--line); }
@media (max-width: 560px) {
  .stream { grid-template-columns: 52px 1fr; }
  .stream .badge { grid-column: 2; justify-self: start; }
}

/* ---------------- player ---------------- */
.watch { padding: 84px var(--gutter) 0; max-width: 1400px; margin: 0 auto; }
@media (max-width: 640px) { .watch { padding-top: 124px; } }
.watch-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 14px; }
.watch-title h1 { font-family: var(--sans); font-weight: 600; letter-spacing: -0.02em; font-size: clamp(28px, 4vw, 44px); margin: 0; }
.screen {
  position: relative; aspect-ratio: 16/9; background: #000; border-radius: 10px; overflow: hidden;
  box-shadow: 0 0 0 1px var(--line);
}
.screen video { width: 100%; height: 100%; display: block; background: #000; }
video::cue { background: rgba(0, 0, 0, 0.55); font-family: var(--sans); font-size: clamp(13px, 1.5vw, 24px); line-height: 1.35; }
.overlay {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px;
  background: #000;
}
.overlay .box { max-width: 460px; width: 100%; }
.overlay h3 { font-weight: 600; font-size: 24px; margin: 0 0 6px; }
.progress { height: 4px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 18px 0 10px; }
.progress i { display: block; height: 100%; background: var(--amber); transition: width 0.6s; box-shadow: 0 0 12px var(--amber); }
.projector { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--amber); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.toolbar .spacer { flex: 1; }
select {
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 12px; font: 600 13px var(--sans); max-width: 260px;
}
.resume-toast {
  position: absolute; left: 16px; bottom: 70px; z-index: 3; display: flex; gap: 8px; align-items: center;
  background: rgba(0, 0, 0, 0.9); border: 1px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 16px; font-size: 13px;
}
.err { color: var(--red); font-size: 13px; min-height: 1em; }

/* ---------------- misc ---------------- */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 200;
  background: var(--text); color: var(--bg); font-weight: 600; font-size: 13px;
  padding: 10px 18px; border-radius: 999px; transition: opacity 0.25s, transform 0.25s; pointer-events: none;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.empty { color: var(--muted); padding: 40px 0; font-size: 17px; }
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--amber); animation: spin 0.8s linear infinite; display: inline-block; vertical-align: middle; }

/* ---------------- login ---------------- */
.login-page { min-height: 100vh; display: grid; place-items: center; background: var(--bg); }
.login { text-align: center; padding: 24px; width: min(380px, 100%); }
.login form { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }
.login input {
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 999px;
  padding: 13px 20px; color: var(--text); font: inherit; outline: 0; text-align: center;
}
.login input:focus { border-color: rgba(229, 9, 20, 0.6); }
.login .btn { justify-content: center; }
.bulbs { height: 10px; margin: 0 auto 22px; width: 220px; background: radial-gradient(circle, var(--amber) 2.5px, transparent 3.5px) 0 0 / 20px 10px; animation: chase 1.2s steps(2) infinite; filter: drop-shadow(0 0 4px var(--amber)); }
@keyframes chase { 50% { background-position: 10px 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------- custom dropdown ---------------- */
.dropdown { position: relative; }
.dropdown .menu {
  position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 20; min-width: 260px; max-width: min(360px, 90vw);
  max-height: 320px; overflow-y: auto; padding: 6px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8);
}
.dropdown .menu button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left;
  background: none; border: 0; border-radius: 8px; padding: 8px 12px; font-size: 14px; font-weight: 500;
}
.dropdown .menu button:hover { background: rgba(255, 255, 255, 0.07); }
.dropdown .menu button.selected { color: var(--amber); }
.dropdown .menu small { color: var(--faint); font-size: 11.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown .menu p { margin: 8px 12px; font-size: 13px; }
.more { margin-top: 12px; }

/* ---------------- detail (Stremio-style split) ---------------- */
.detail2 { position: relative; min-height: 100vh; padding-bottom: 20px; }
.detail2 .backdrop { position: fixed; inset: 0; z-index: -1; }
.detail2 .backdrop img { width: 100%; height: 100%; object-fit: cover; }
.detail2 .backdrop::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,.92) 0%, rgba(0,0,0,.6) 45%, rgba(0,0,0,.75) 100%), linear-gradient(to top, #000 0%, transparent 40%);
}
.split {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 460px); gap: 40px;
  padding: 96px var(--gutter) 0; align-items: start; min-height: calc(100vh - 40px);
}
.d-info { padding-top: 6vh; max-width: 620px; }
.d-info h1 { font-weight: 700; font-size: clamp(40px, 5.5vw, 76px); line-height: 1; letter-spacing: -0.035em; margin: 0 0 18px; }
.title-logo { max-width: min(440px, 80%); max-height: 170px; object-fit: contain; object-position: left; margin-bottom: 22px; filter: drop-shadow(0 4px 24px rgba(0,0,0,.6)); }
.d-info .genres { margin: 12px 0 18px; }
.d-info .overview { color: #d4d4d4; line-height: 1.6; }
.side {
  position: sticky; top: 86px; max-height: calc(100vh - 106px); overflow-y: auto; overscroll-behavior: contain;
  background: rgba(14, 14, 14, 0.78); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--line); border-radius: 16px; padding: 16px;
}
.side-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.side-head h2 { font-size: 20px; font-weight: 600; margin: 0; letter-spacing: -0.02em; }
.side-head .mono { margin-left: auto; }
.side .seasons { margin-bottom: 12px; }
.side .episodes { grid-template-columns: 1fr; gap: 8px; }
.side .ep { grid-template-columns: 116px 1fr; padding: 8px; }
.side .streams-head { margin-bottom: 10px; }
.side .stream { grid-template-columns: 54px 1fr; gap: 12px; padding: 11px 12px; }
.side .stream .fn { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.side .stream .badge { grid-column: 2; justify-self: start; margin-top: 2px; }
.side .stream .info { gap: 10px; }
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; gap: 24px; }
  .d-info { padding-top: 0; }
  .side { position: static; max-height: none; }
}
@media (max-width: 640px) { .split { padding-top: 130px; } }

/* ---------------- immersive player ---------------- */
body.in-player { overflow: hidden; }
body.in-player .top { display: none; }
.player { position: fixed; inset: 0; z-index: 60; background: #000; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.loader { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: #000; overflow: hidden; }
.loader-bg { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(28px) brightness(0.35); transform: scale(1.05); }
.loader-center { position: relative; text-align: center; padding: 24px; width: min(560px, 100%); display: flex; flex-direction: column; align-items: center; }
.loader-logo { max-width: min(420px, 80vw); max-height: 180px; object-fit: contain; animation: breathe 2.4s ease-in-out infinite; filter: drop-shadow(0 6px 30px rgba(0,0,0,.6)); }
.loader-title { font-size: clamp(34px, 6vw, 64px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.loader.error .loader-logo, .loader.error .loader-title { animation: none; }
.loader-ep { margin-top: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0.04em; }
.loader .progress { width: 100%; max-width: 320px; margin: 22px 0 0; }
.loader.quiet .loader-status, .loader.quiet .loader-sub { display: none; }
/* a soft light sweeping across the title art while it loads */
.loader.quiet .loader-logo, .loader.quiet .loader-title {
  -webkit-mask-image: linear-gradient(105deg, #000 35%, rgba(0, 0, 0, 0.45) 50%, #000 65%);
  mask-image: linear-gradient(105deg, #000 35%, rgba(0, 0, 0, 0.45) 50%, #000 65%);
  -webkit-mask-size: 300% 100%; mask-size: 300% 100%;
  animation: breathe 2.4s ease-in-out infinite, sweep 2.2s linear infinite;
}
@keyframes sweep { from { -webkit-mask-position: 100% 0; mask-position: 100% 0; } to { -webkit-mask-position: 0 0; mask-position: 0 0; } }
.loader-status { display: flex; align-items: center; gap: 10px; margin-top: 22px; font-weight: 600; font-size: 15px; }
.loader-sub { margin: 8px 0 0; color: var(--muted); font-size: 13px; max-width: 460px; word-break: break-word; }
.loader-sub:empty { display: none; }
.pbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; gap: 8px;
  padding: 16px var(--gutter) 40px; background: linear-gradient(to bottom, rgba(0,0,0,.8), transparent);
  transition: opacity .35s;
}
.pbar .icon-btn { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border-radius: 50%; color: var(--text); }
.pbar .icon-btn:hover { background: rgba(255, 255, 255, 0.14); }
.pbar .icon-btn svg { width: 24px; height: 24px; stroke-width: 2.4; }
.pbar-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.pbar-title b { font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbar-title span { color: var(--muted); font-size: 14px; white-space: nowrap; }
.pbar .spacer { flex: 1; }
.pbar .btn { background: rgba(255,255,255,.1); backdrop-filter: blur(10px); }
.pbar .btn[aria-disabled="true"], .pbar .btn:disabled { opacity: .4; pointer-events: none; }
.file-info { position: absolute; top: 64px; left: var(--gutter); z-index: 3; margin: 0; color: var(--faint); font-family: var(--mono); font-size: 11px; transition: opacity .35s; }
.player.idle .pbar, .player.idle .file-info { opacity: 0; pointer-events: none; }
.player.idle { cursor: none; }
.dropdown.down .menu { bottom: auto; top: calc(100% + 8px); left: auto; right: 0; }
.player .resume-toast { bottom: 90px; z-index: 4; }
/* desktop app: mpv draws the video in a native view below this bar */
.player.native video, .player.native .file-info, .player.native #copyBtn, .player.native #vlcBtn, .player.native #iinaBtn { display: none; }
/* Windows app: mpv's view sits below this bar and has its own controls */
.player.native.inset .pbar { padding: 12px var(--gutter); background: #0a0a0a; opacity: 1 !important; pointer-events: auto !important; }
.player.native.inset { cursor: auto !important; }
.player.native.inset.fs .pbar { visibility: hidden; }
/* macOS app: mpv draws behind the transparent page; app-styled controls on top */
html.video-under, html.video-under body, .player.native.overlay { background: transparent !important; }
.player.native.overlay #subs { display: none; }
.nctl {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 70px var(--gutter) 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.45) 55%, transparent);
  transition: opacity 0.35s;
}
.player.idle .nctl { opacity: 0; pointer-events: none; }
.nseek { position: relative; height: 18px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.nseek .track { position: relative; width: 100%; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.18); transition: height 0.15s; }
.nseek:hover .track { height: 6px; }
.nseek .buf, .nseek .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; }
.nseek .buf { background: rgba(255, 255, 255, 0.28); }
.nseek .fill { background: var(--amber); }
.nseek .fill::after {
  content: ''; position: absolute; right: -7px; top: 50%; width: 14px; height: 14px; margin-top: -7px;
  border-radius: 50%; background: #fff; transform: scale(0); transition: transform 0.15s;
}
.nseek:hover .fill::after { transform: scale(1); }
.nseek .tip {
  position: absolute; bottom: 22px; transform: translateX(-50%); padding: 3px 8px; border-radius: 6px;
  background: rgba(20, 20, 20, 0.92); font: 12px var(--mono); pointer-events: none; white-space: nowrap;
}
.nrow { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.nbtn { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text); }
.nbtn:hover { background: rgba(255, 255, 255, 0.12); }
.nbtn svg { width: 24px; height: 24px; }
.nvol { display: flex; align-items: center; }
.nvol input { width: 0; opacity: 0; margin: 0; accent-color: #fff; transition: width 0.2s, opacity 0.2s, margin 0.2s; }
.nvol:hover input, .nvol input:focus-visible { width: 90px; opacity: 1; margin: 0 8px 0 2px; }
.ntime { margin-left: 10px; font: 13px var(--mono); color: rgba(255, 255, 255, 0.85); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nrow .spacer { flex: 1; }
.ntracks { position: relative; }
.npop {
  position: absolute; right: 0; bottom: calc(100% + 10px); min-width: 280px; max-width: min(380px, 90vw); max-height: 60vh; overflow-y: auto;
  padding: 6px; background: rgba(20, 20, 20, 0.96); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8);
}
.npop h4 { margin: 10px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.npop h4:first-child { margin-top: 4px; }
.npop button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left;
  background: none; border: 0; border-radius: 8px; padding: 8px 10px; font-size: 13.5px; font-weight: 500; color: var(--text);
}
.npop button:hover { background: rgba(255, 255, 255, 0.07); }
.npop button.selected { color: var(--amber); }
.npop small { color: var(--faint); font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbuffering { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; pointer-events: none; }
.nbuffering[hidden] { display: none; }
.nbuffering .spinner { width: 44px; height: 44px; border-width: 3px; }
@media (max-width: 640px) {
  .pbar { flex-wrap: wrap; }
  .pbar-title { flex: 1; }
  .pbar .spacer { display: none; }
}

/* ---------------- stream rows v2 ---------------- */
.streams { gap: 4px; }
.stream {
  grid-template-columns: 58px minmax(0, 1fr) 28px !important; gap: 14px !important; align-items: center;
  padding: 12px 14px !important; border-color: transparent; background: rgba(255,255,255,.035);
}
.stream:hover { background: rgba(255,255,255,.08); border-color: transparent; }
.stream .q { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.stream .q b { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.stream .q.k4 b { color: var(--amber); }
.stream .q small { font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: .02em; line-height: 1.2; }
.s-main { min-width: 0; }
.s-tags { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-meta { margin-top: 3px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-tags i, .s-meta i { font-style: normal; color: var(--faint); margin: 0 6px; }
.s-meta em { font-style: normal; color: #f5a524; }
.s-state { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--faint); background: rgba(255,255,255,.05); }
.s-state svg { width: 15px; height: 15px; }
.s-state.instant { color: var(--green); background: rgba(139, 224, 122, .12); }
.filters button { padding: 6px 14px; font-size: 13px; }

/* ---------------- audio notice ---------------- */
.audio-notice {
  position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 4;
  display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px);
  background: rgba(20,20,20,.92); backdrop-filter: blur(14px); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 12px 12px 18px; font-size: 14px;
}
.audio-notice > div { display: flex; flex-direction: column; }
.audio-notice span { color: var(--muted); font-size: 13px; }
@media (max-width: 640px) { .audio-notice { flex-wrap: wrap; } }

/* ---------------- stats ---------------- */
.stats { max-width: 1200px; margin: 0 auto; }
.import-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; max-width: 560px; }
.import-card h2 { margin: 0 0 8px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.import-card .btn { margin-top: 16px; }
.hero-stat { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.big-time { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 10px 0 6px; }
.big-time b { font-size: clamp(48px, 8vw, 88px); font-weight: 700; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.big-time span { color: var(--muted); font-size: 18px; margin-right: 12px; }
.split-bar { display: flex; gap: 2px; height: 12px; margin-top: 22px; border-radius: 4px; overflow: hidden; }
.split-bar i { display: block; min-width: 4px; cursor: default; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.legend b { color: var(--text); font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.tile span { color: var(--muted); font-size: 13px; font-weight: 500; }
.tile b { font-size: 34px; font-weight: 700; letter-spacing: -.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile small { color: var(--faint); font-size: 12.5px; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 12px; margin-top: 12px; }
.chart { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.chart h2 { font-size: 16px; font-weight: 600; margin: 0 0 14px; }
.chart h2 small { color: var(--faint); font-weight: 500; font-size: 12.5px; margin-left: 6px; }
.hbars { display: flex; flex-direction: column; gap: 2px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr 52px; align-items: center; gap: 10px; padding: 4px 0; border-radius: 6px; }
.hbar:hover { background: rgba(255,255,255,.04); }
.hbar-label { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-label a:hover { text-decoration: underline; }
.hbar-track { height: 10px; }
.hbar-track i { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.hbar-value { font-size: 12.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.wall { margin-top: 36px; }
.wall-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 18px; }
.wall-head h2 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.tip { position: fixed; z-index: 90; pointer-events: none; background: var(--text); color: var(--bg); font-size: 12.5px; font-weight: 600; padding: 6px 10px; border-radius: 8px; max-width: 280px; }

/* watched episodes */
.ep { position: relative; }
.ep-check {
  position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; border: 1.5px solid rgba(255,255,255,.35); color: transparent;
  background: rgba(0,0,0,.4); opacity: 0; transition: opacity .15s, background .15s; cursor: pointer;
}
.ep-check svg { width: 13px; height: 13px; stroke-width: 3; }
.ep:hover .ep-check { opacity: 1; color: rgba(255,255,255,.7); }
.ep.seen .ep-check { opacity: 1; background: var(--amber); border-color: var(--amber); color: #fff; }
.ep.seen .thumb img { opacity: .5; }
.ep.seen .t { color: var(--muted); }
@media (hover: none) { .ep-check { opacity: 1; color: rgba(255,255,255,.7); } }

.ep.next { border-color: var(--amber); background: rgba(229, 9, 20, .08); }
.side { scroll-behavior: auto; }

/* ---------------- avatars & settings ---------------- */
.ava {
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, var(--a), var(--b)); font-size: 1.05em; line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
#profileBtn { padding: 0; overflow: hidden; font-size: 21px; border-color: transparent; }
#profileBtn:hover, #profileBtn[aria-expanded="true"] { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35); }
.profile-head { gap: 12px; }
.profile-head > .ava { width: 40px; height: 40px; font-size: 22px; flex: none; }
.profile-head div { min-width: 0; flex: 1; }
.profile-head b { display: block; font-size: 14px; }
.profile-head small { display: block; color: var(--faint); font-size: 11.5px; line-height: 1.35; }
.profile-head .icon-btn { flex: none; font-size: 16px; width: 32px; height: 32px; padding: 0; border-radius: 50%; }
.profile-menu { min-width: 260px; }

.settings { max-width: 860px; margin: 0 auto; box-sizing: content-box; }
.set-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; margin-bottom: 16px; }
.set-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.set-card h2 { margin: 0 0 4px; font-size: 17px; font-weight: 600; }
.set-card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.ava-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; margin-top: 18px; }
.ava-pick {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px 12px;
  background: none; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); font-size: 12px; font-weight: 500;
  transition: border-color .2s, background .2s, transform .2s;
}
.ava-pick .ava { width: 60px; height: 60px; font-size: 36px; }
.set-head .btn { white-space: nowrap; flex: none; }
.ava-pick:hover { background: rgba(255, 255, 255, 0.04); transform: translateY(-2px); color: var(--text); }
.ava-pick.on { border-color: var(--amber); color: var(--text); background: rgba(229, 9, 20, 0.08); }
.seg { display: inline-flex; gap: 4px; margin-top: 16px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; }
.seg button { background: none; border: 0; border-radius: 999px; padding: 8px 16px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--text); color: #000; }
@media (max-width: 560px) { .set-head { flex-direction: column; } }

/* ---------------- profiles: who's watching ---------------- */
body.picking { overflow: hidden; }
body.picking .top { visibility: hidden; }
.who { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 40px var(--gutter);
  background: radial-gradient(ellipse at 50% 0%, #1a0607 0%, #000 60%); overflow-y: auto; animation: whoIn .35s ease; }
.who[hidden] { display: none; }
@keyframes whoIn { from { opacity: 0; transform: scale(1.03); } }
.who-in { display: flex; flex-direction: column; align-items: center; text-align: center; width: min(900px, 100%); }
.who h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 600; letter-spacing: -0.03em; margin: 0 0 40px; }
.who h2 { font-size: 26px; font-weight: 600; margin: 18px 0 4px; }
.who-sub { color: var(--muted); margin: 0 0 22px; }
.who-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; }
.who-p { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; width: 140px;
  background: none; border: 0; color: var(--muted); font-size: 16px; font-weight: 500; cursor: pointer; }
.who-p .ava { width: 130px; height: 130px; font-size: 68px; border-radius: 28px; transition: transform .2s, box-shadow .2s; }
.who-p:hover { color: var(--text); }
.who-p:hover .ava, .who-p:focus-visible .ava { transform: translateY(-4px); box-shadow: 0 0 0 3px #fff, 0 20px 40px -12px rgba(0,0,0,.8); }
.who-lock { position: absolute; top: 104px; right: 10px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,.75); color: #fff; }
.who-lock svg { width: 14px; height: 14px; }
.add-ava { background: transparent !important; border: 2px dashed rgba(255,255,255,.25); box-shadow: none !important; font-size: 54px !important; color: var(--muted); font-weight: 300; }
.ava.big { width: 110px; height: 110px; font-size: 60px; border-radius: 26px; }
.ava.inline { display: inline-grid; width: 22px; height: 22px; font-size: 13px; vertical-align: -5px; }
.pin { display: flex; gap: 12px; }
.pin input { width: 56px; height: 64px; text-align: center; font-size: 28px; font-weight: 600; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; outline: none; caret-color: var(--amber); }
.pin input:focus { border-color: var(--amber); }
.pin.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.who-err { color: #ff6b6b; margin: 14px 0 0; font-size: 14px; }
.who .btn.ghost { margin-top: 24px; }
.who-form { display: flex; flex-direction: column; gap: 16px; width: min(520px, 100%); text-align: left; }
.who-preview { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; margin-bottom: 4px; }
.who-preview b { margin-top: 8px; font-size: 16px; }
.who-preview small { color: var(--faint); }
.who-form label, .set-row label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.who-form label small { font-weight: 400; color: var(--faint); }
.who-form input, .set-row input { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px;
  color: var(--text); font: inherit; font-size: 15px; outline: none; }
.who-form input:focus, .set-row input:focus { border-color: rgba(229, 9, 20, 0.6); }
.who-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.who-actions .btn.ghost { margin-top: 0; }
.ava-grid.small { grid-template-columns: repeat(6, 1fr); margin-top: 0; }
.ava-grid.small .ava-pick { padding: 8px; }
.ava-grid.small .ava-pick .ava { width: 48px; height: 48px; font-size: 28px; }
.btn.ghost { background: transparent; }
.btn.danger { color: #ff6b6b; border-color: rgba(255, 107, 107, 0.35); }
.btn.danger:hover { background: rgba(255, 107, 107, 0.12); }
.set-card.danger { border-color: rgba(255, 107, 107, 0.18); }
.set-row { display: flex; align-items: flex-end; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.set-row label { flex: 1; min-width: 180px; }
@media (max-width: 560px) { .who-p { width: 110px; } .who-p .ava { width: 100px; height: 100px; font-size: 52px; } .who-lock { top: 76px; } .ava-grid.small { grid-template-columns: repeat(4, 1fr); } }
.cache-meter { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.cache-bar { flex: 1; height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.cache-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #ff7a3c, var(--amber)); transition: width .6s ease; }
.cache-bar i.high { background: #ff4d4d; }
.cache-meter span { font: 13px var(--mono); color: var(--muted); white-space: nowrap; }

/* ---------------- cast & person ---------------- */
.cast { margin-top: 34px; max-width: 100%; }
.cast h3 { margin: 0 0 12px; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.cast-row { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; scrollbar-width: none; mask-image: linear-gradient(90deg, #000 85%, transparent); }
.cast-row::-webkit-scrollbar { display: none; }
.cast-p { flex: none; width: 96px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; scroll-snap-align: start; color: var(--text); }
.cast-face { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; margin-bottom: 6px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--faint); box-shadow: 0 0 0 1px var(--line); transition: transform .2s, box-shadow .2s; }
.cast-face { position: relative; }
.cast-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.cast-face svg { width: 38px; height: 38px; }
.cast-p:hover .cast-face { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--amber); }
.cast-p b { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.cast-p small { font-size: 11.5px; color: var(--muted); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cast-p small.eps { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.person-head { display: grid; grid-template-columns: 260px 1fr; gap: 40px; align-items: start; margin-bottom: 44px; }
.person-photo { aspect-ratio: 2/3; border-radius: 18px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--faint); box-shadow: 0 30px 60px -30px rgba(0,0,0,.9); }
.person-photo img { width: 100%; height: 100%; object-fit: cover; }
.person-photo svg { width: 40%; height: 40%; }
.person .eyebrow { margin: 0 0 6px; font: 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.person h1 { margin: 0 0 14px; font-size: clamp(36px, 5vw, 60px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.02; }
.person .meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.person .bio { color: rgba(255,255,255,.82); font-size: 15px; line-height: 1.7; max-width: 780px; margin: 0 0 12px; }
.person .bio.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.person .grid { margin-bottom: 60px; }
@media (max-width: 760px) { .person-head { grid-template-columns: 1fr; } .person-photo { width: 200px; } }
.person .row-head { padding-left: 0; padding-right: 0; }
.cast-p small.job { color: var(--amber); font-weight: 600; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.cast-p.crew .cast-face { box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.55); }
.cast-sep { flex: none; width: 1px; margin: 8px 4px 40px; background: var(--line); }
