/* ==========================================================================
   SAK ANIME — design tokens
   Mood: late-night shonen manga — ink-dark pages, electric cyan, series color
   panels with halftone and speed lines. Personality lives in the art; the
   controls stay calm.
   ========================================================================== */
:root {
  color-scheme: dark;

  --bg:        oklch(0.165 0.014 245);
  --surface:   oklch(0.205 0.016 245);
  --surface-2: oklch(0.245 0.018 245);
  --surface-3: oklch(0.29 0.02 245);
  --line:      oklch(0.33 0.02 245);
  --ink:       oklch(0.965 0.005 245);
  --ink-2:     oklch(0.83 0.014 245);
  --ink-3:     oklch(0.71 0.016 245);

  --brand:     oklch(0.82 0.13 200);
  --brand-hi:  oklch(0.88 0.12 200);
  --brand-ink: oklch(0.2 0.04 220);
  --brand-dim: oklch(0.82 0.13 200 / 0.14);
  --warn:      oklch(0.84 0.13 80);
  --warn-dim:  oklch(0.84 0.13 80 / 0.12);
  --done:      oklch(0.8 0.13 160);

  --font-ui: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --font-display: "Lalezar", "IBM Plex Sans Arabic", system-ui, sans-serif;

  --step--1: 0.8125rem;
  --step-0: 0.9375rem;
  --step-1: 1.0625rem;
  --step-2: 1.25rem;
  --step-3: 1.625rem;
  --step-4: 2.25rem;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;

  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1320px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 160ms;
  --t-med: 240ms;

  --z-sticky: 10;
  --z-skip: 50;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; outline: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img, svg { display: block; }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
kbd {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.85em;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
}
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; inset-inline-start: 16px; top: -60px; z-index: var(--z-skip);
  background: var(--brand); color: var(--brand-ink); padding: 10px 16px; border-radius: var(--r-sm);
  font-weight: 600; transition: top var(--t-fast) var(--ease-out);
}
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: oklch(0.165 0.014 245 / 0.86);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid oklch(0.33 0.02 245 / 0.6);
}
.topbar__inner {
  max-width: var(--maxw); margin-inline: auto; padding: 12px var(--gutter);
  display: flex; align-items: center; gap: 28px;
}
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo__mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--brand);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  position: relative;
}
.logo__mark::after {
  content: ""; position: absolute; inset: 8px 9px 8px 7px; background: var(--brand-ink);
  clip-path: polygon(100% 0, 100% 100%, 0 50%);
}
.logo__word { font-family: var(--font-display); font-size: 1.6rem; line-height: 1; letter-spacing: 0; }
.logo__word b { font-weight: 400; color: var(--brand); margin-inline-start: 2px; }

.mainnav { display: flex; gap: 4px; }
.mainnav a {
  padding: 8px 14px; border-radius: 999px; color: var(--ink-2); font-weight: 500;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.mainnav a:hover { color: var(--ink); background: var(--surface-2); }
.mainnav a[aria-current="page"] { color: var(--ink); background: var(--surface-3); }

.search { position: relative; margin-inline-start: auto; width: min(320px, 100%); }
.search__icon {
  position: absolute; inset-inline-start: 13px; top: 50%; translate: 0 -50%;
  width: 18px; height: 18px; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round;
  pointer-events: none;
}
.search input {
  width: 100%; height: 42px; padding-inline: 40px 14px;
  background: var(--surface); color: var(--ink); font: inherit;
  border: 1px solid var(--line); border-radius: 999px;
  transition: border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.search input::placeholder { color: var(--ink-3); }
.search input:hover { border-color: var(--surface-3); background: var(--surface-2); }
.search input:focus { outline: none; border-color: var(--brand); background: var(--surface-2); box-shadow: 0 0 0 3px var(--brand-dim); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding-inline: 22px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: var(--step-0); cursor: pointer; white-space: nowrap;
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out),
              transform var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.btn svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--brand); color: var(--brand-ink); }
.btn--primary:hover { background: var(--brand-hi); }
.btn--ghost { background: oklch(1 0 0 / 0.08); border-color: oklch(1 0 0 / 0.16); color: var(--ink); }
.btn--ghost:hover { background: oklch(1 0 0 / 0.14); }
.btn--quiet { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn--quiet:hover { background: var(--surface-3); }
.btn[aria-disabled="true"], .btn:disabled { opacity: 0.4; pointer-events: none; }
.btn--sm { height: 36px; padding-inline: 14px; font-size: var(--step--1); }
.btn[aria-pressed="true"] { background: oklch(0.8 0.13 160 / 0.16); border-color: oklch(0.8 0.13 160 / 0.5); color: var(--done); }

/* ---------- series art (typographic manga panel) ---------- */
.art {
  --h: 200;
  position: relative; overflow: hidden; isolation: isolate;
  background: oklch(0.58 0.16 var(--h));
  color: oklch(0.985 0.015 var(--h));
}
/* halftone */
.art::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(oklch(0.32 0.12 var(--h) / 0.55) 1.4px, transparent 1.7px);
  background-size: 9px 9px;
  mask-image: linear-gradient(135deg, black 0%, transparent 70%);
  -webkit-mask-image: linear-gradient(135deg, black 0%, transparent 70%);
}
/* speed lines */
.art::after {
  content: ""; position: absolute; inset: -40%; z-index: -1;
  background: repeating-conic-gradient(from 0deg at 72% 30%,
    oklch(1 0 0 / 0.16) 0deg 1.4deg, transparent 1.4deg 7deg);
  mask-image: radial-gradient(circle at 72% 30%, transparent 14%, black 60%);
  -webkit-mask-image: radial-gradient(circle at 72% 30%, transparent 14%, black 60%);
}
.art__ghost {
  position: absolute; inset-inline-end: -4%; bottom: -6%; z-index: -1;
  font-family: system-ui, sans-serif; font-weight: 900; font-size: 9rem; line-height: 0.8;
  letter-spacing: -0.03em; direction: ltr; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 2px oklch(1 0 0 / 0.22);
  text-transform: uppercase;
}
.art__title {
  font-family: var(--font-display); font-weight: 400; letter-spacing: 0;
  text-shadow: 3px 3px 0 oklch(0.22 0.08 var(--h));
}
.art__shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, oklch(0.16 0.04 var(--h) / 0.75), transparent 60%); }

/* ---------- character cut-outs that break out of the panel ----------
   .pop wraps a panel. The 'in' copy of the character lives inside the clipped
   panel, under the shade and title; the 'out' copy is the same image clipped to
   the strip above the panel's top edge, so the figure appears to step out. */
.pop { position: relative; }
.art--pop::after { z-index: -2; transition: rotate 900ms var(--ease-out); }
.art--pop .art__ghost { transition: translate 600ms var(--ease-out); }
.char { --cx: 50%; position: absolute; inset: 0; pointer-events: none; }
.char--in { z-index: -1; }
.char--out { z-index: 1; clip-path: inset(-60% 0 100% 0); }
.char > img {
  position: absolute; bottom: var(--cb); left: var(--cx); height: var(--ch);
  width: auto; max-width: none; translate: calc(-1 * var(--ax)) 0;
}
.char img {
  transform-origin: 50% 100%;
  filter: drop-shadow(0 14px 18px oklch(0.16 0.08 var(--h) / 0.55));
  animation: char-rise 760ms var(--ease-spring) calc(120ms + var(--i) * 80ms) backwards;
  transition: transform 520ms var(--ease-spring), filter 520ms var(--ease-out);
}
@keyframes char-rise {
  from { opacity: 0; translate: calc(-1 * var(--ax)) 16%; scale: 0.9; }
}
@keyframes char-float {
  50% { translate: calc(-1 * var(--ax)) -1.6%; }
}

/* ---------- hero ---------- */
.hero { padding-top: clamp(40px, 6vw, 72px); }
.pop--hero .char { --cx: 25%; }
.pop--hero .char img {
  transform: translate(calc(var(--px, 0) * -18px), calc(var(--py, 0) * -10px)) rotate(calc(var(--px, 0) * 3deg));
  transition: transform 600ms var(--ease-out);
  animation: char-rise 900ms var(--ease-spring) 80ms backwards, char-float 6s ease-in-out 1s infinite;
}
.hero__panel {
  border-radius: var(--r-lg); min-height: clamp(360px, 52vh, 520px);
  display: grid; align-content: end; gap: 16px; padding: clamp(24px, 5vw, 56px);
}
.hero__panel .art__ghost { font-size: clamp(7rem, 20vw, 16rem); }
.hero__kicker {
  display: inline-flex; align-items: center; gap: 8px; width: fit-content;
  padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: var(--step--1);
  background: oklch(0.18 0.05 var(--h) / 0.55); color: oklch(0.97 0.02 var(--h));
}
.hero__kicker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.hero__title { font-size: clamp(2.6rem, 7vw, 5.5rem); line-height: 1.05; }
.hero__en { direction: ltr; text-align: right; font-weight: 600; opacity: 0.9; font-size: var(--step-1); margin-top: -8px; }
.hero__desc { max-width: 56ch; font-size: var(--step-1); color: oklch(0.97 0.02 var(--h)); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.hero__actions .btn--primary { background: oklch(0.98 0.01 var(--h)); color: oklch(0.2 0.06 var(--h)); }
.hero__actions .btn--primary:hover { background: #fff; }

/* hero switcher */
.switcher { display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.switcher::-webkit-scrollbar { display: none; }
.switcher button {
  flex-shrink: 0; display: flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); cursor: pointer; font-weight: 500;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.switcher button::before { content: ""; width: 12px; height: 12px; border-radius: 4px; background: oklch(0.62 0.16 var(--h)); }
.switcher button:hover { background: var(--surface-2); color: var(--ink); }
.switcher button[aria-pressed="true"] { border-color: oklch(0.62 0.16 var(--h)); color: var(--ink); background: var(--surface-2); }

/* ---------- sections ---------- */
.section { padding-block: 44px 8px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section__title { font-size: var(--step-3); font-weight: 700; }
.section__link { color: var(--brand); font-weight: 600; font-size: var(--step--1); }
.section__link:hover { text-decoration: underline; text-underline-offset: 4px; }
.page-title { font-family: var(--font-display); font-weight: 400; font-size: var(--step-4); padding-top: 36px; }
.page-sub { color: var(--ink-2); margin-top: 6px; }

/* ---------- posters ---------- */
.posters {
  display: grid; gap: 48px 18px; padding-top: 28px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.poster { display: grid; gap: 10px; align-content: start; }
.poster__art {
  aspect-ratio: 2 / 3; border-radius: var(--r-md);
  display: grid; align-content: end; padding: 16px;
  transition: box-shadow var(--t-med) var(--ease-out);
}
.poster .pop { transition: transform var(--t-med) var(--ease-out); }
.poster__art .art__ghost { font-size: 5.5rem; bottom: auto; top: 10%; inset-inline-end: -12%; writing-mode: vertical-rl; }
.poster__title { font-size: 2rem; line-height: 1.1; }
.poster__en { direction: ltr; text-align: right; font-size: var(--step--1); font-weight: 600; opacity: 0.92; }
.poster__badge {
  position: absolute; top: 12px; inset-inline-start: 12px;
  padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700;
  background: oklch(0.16 0.04 var(--h) / 0.7); color: oklch(0.97 0.02 var(--h));
}
.poster__meta { display: flex; justify-content: space-between; gap: 8px; color: var(--ink-2); font-size: var(--step--1); }
.poster__meta strong { color: var(--ink); font-weight: 600; }
.poster:is(:hover, :focus-visible) .pop { transform: translateY(-4px); }
.poster:is(:hover, :focus-visible) .poster__art { box-shadow: 0 18px 40px -18px oklch(0.6 0.16 var(--h) / 0.7); }
.poster:is(:hover, :focus-visible) .char img {
  transform: translateY(-7%) scale(1.07) rotate(-2deg);
  filter: drop-shadow(0 22px 22px oklch(0.14 0.08 var(--h) / 0.6)) brightness(1.06);
}
.poster:is(:hover, :focus-visible) .art--pop::after { rotate: 8deg; }
.poster:is(:hover, :focus-visible) .art__ghost { translate: 0 -10%; }
.poster:active .pop { transform: translateY(-1px) scale(0.98); transition-duration: 90ms; }
.poster:active .char img { transform: translateY(-2%) scale(0.97); transition: transform 90ms var(--ease-out); }
.poster:focus-visible { outline: none; }
.poster:focus-visible .poster__art { outline: 2px solid var(--brand); outline-offset: 3px; }

/* progress bar */
.progress { height: 4px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: inherit; }

/* ---------- continue watching ---------- */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 340px); gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.resume {
  scroll-snap-align: start; display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: center;
  padding: 10px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line);
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.resume:hover { background: var(--surface-2); border-color: var(--surface-3); }
.resume__art { aspect-ratio: 1; border-radius: var(--r-sm); display: grid; place-items: center; }
.resume__art span { font-family: var(--font-display); font-size: 2rem; line-height: 1; }
.resume__body { display: grid; gap: 4px; min-width: 0; }
.resume__series { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resume__next { color: var(--ink-2); font-size: var(--step--1); }
.resume__next b { color: var(--brand); font-weight: 600; }

/* ---------- movies ---------- */
.movies { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.movie {
  display: grid; grid-template-columns: 56px 1fr; align-items: center; gap: 14px;
  padding: 10px 14px 10px 10px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line);
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.movie:hover { background: var(--surface-2); border-color: var(--surface-3); }
.movie__num { aspect-ratio: 1; border-radius: var(--r-sm); display: grid; place-items: center; font-family: var(--font-display); font-size: 1.6rem; }
.movie__title { font-weight: 600; direction: ltr; text-align: right; line-height: 1.35; }
.movie__series { color: var(--ink-3); font-size: var(--step--1); }

/* ---------- series page ---------- */
.series-hero { padding-top: clamp(40px, 6vw, 72px); }
.series-hero__panel {
  border-radius: var(--r-lg); padding: clamp(24px, 4vw, 44px); min-height: 300px;
  display: grid; align-content: end; gap: 12px;
}
.series-hero__panel .art__ghost { font-size: clamp(6rem, 16vw, 13rem); }
.series-hero__title { font-size: clamp(2.4rem, 6vw, 4.5rem); line-height: 1.05; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 18px; font-weight: 500; color: oklch(0.97 0.02 var(--h)); }
.facts span + span::before { content: "•"; margin-inline-end: 18px; opacity: 0.6; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex-shrink: 0; height: 36px; padding-inline: 14px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-weight: 500; font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.tabs button:hover { background: var(--surface-2); color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.jump { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.jump label { color: var(--ink-2); font-size: var(--step--1); }
.jump input {
  width: 92px; height: 36px; padding-inline: 12px; border-radius: 999px; font: inherit; text-align: center;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
}
.jump input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-dim); }

.note {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--warn-dim); color: var(--ink); margin-bottom: 18px; font-size: var(--step--1);
}
.note svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; fill: none; stroke: var(--warn); stroke-width: 2; stroke-linecap: round; }

/* episode grid */
.eps { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
.ep {
  position: relative; height: 52px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  font-weight: 600; font-variant-numeric: tabular-nums; font-size: var(--step-0);
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
a.ep:hover { background: var(--surface-3); border-color: oklch(0.45 0.03 245); transform: translateY(-2px); }
.ep--watched { color: var(--ink-3); background: var(--bg); }
.ep--watched::after {
  content: "✓"; position: absolute; top: 2px; inset-inline-end: 6px;
  font-size: 0.75rem; font-weight: 700; color: var(--done);
}
.ep--here::before {
  content: ""; position: absolute; bottom: 6px; inset-inline-start: 6px; width: 0; height: 0;
  border-block: 4px solid transparent; border-left: 6px solid var(--brand);
}
.eps--here-only .ep:not(.ep--here) { display: none; }
.eps--here-only:not(:has(.ep--here))::after { content: "لا توجد حلقات تعمل داخل الموقع في هذا النطاق. جرّب نطاقًا آخر."; grid-column: 1 / -1; color: var(--ink-2); padding: 12px 0; }
.ep--current { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.ep--current::after, .ep--current::before { display: none; }
.ep--missing { color: var(--ink-3); background: transparent; border-style: dashed; cursor: not-allowed; opacity: 0.55; }
.ep--next { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 16px; color: var(--ink-3); font-size: var(--step--1); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); }
.legend i.w { background: var(--bg); position: relative; }
.legend i.w::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 0.7rem; font-weight: 700; color: var(--done); }
.legend i.n { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.legend i.m { border-style: dashed; background: transparent; }
.legend i.h { position: relative; }
.legend i.h::before { content: ""; position: absolute; inset: 0; margin: auto; width: 0; height: 0; border-block: 4px solid transparent; border-left: 6px solid var(--brand); }
.note--info { background: var(--brand-dim); }
.note--info svg { fill: var(--brand); stroke: none; }
.note b { font-weight: 700; }
.here-tag { color: var(--brand); font-weight: 600; }

/* ---------- watch page ---------- */
.watch { display: grid; gap: 28px; padding-top: 24px; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.player {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden;
  background: #000;
}
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; object-fit: contain; cursor: pointer; }
.player__loading {
  position: absolute; inset: 0; display: grid; place-items: center; gap: 12px; align-content: center;
  color: var(--ink-2); font-size: var(--step--1);
  background: linear-gradient(100deg, oklch(0.2 0.016 245) 30%, oklch(0.26 0.02 245) 50%, oklch(0.2 0.016 245) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.6s linear infinite;
  transition: opacity var(--t-med) var(--ease-out);
}
.player.is-ready .player__loading { opacity: 0; pointer-events: none; }
@keyframes shimmer { to { background-position: -150% 0; } }

.now { display: grid; gap: 6px; margin-top: 18px; }
.now__series { color: var(--brand); font-weight: 600; width: fit-content; }
.now__series:hover { text-decoration: underline; text-underline-offset: 4px; }
.now__title { font-size: var(--step-3); font-weight: 700; }
.now__sub { color: var(--ink-2); font-size: var(--step--1); }
.controls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; align-items: center; }
.controls .spacer { flex: 1; }
.sources { display: flex; gap: 6px; align-items: center; color: var(--ink-2); font-size: var(--step--1); }
.help { color: var(--ink-3); font-size: var(--step--1); margin-top: 14px; }
.help a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.help a:hover { color: var(--ink); }

.side {
  position: sticky; top: 88px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  display: grid; grid-template-rows: auto auto 1fr; max-height: calc(100dvh - 112px); overflow: hidden;
}
.side__head { padding: 16px 16px 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.side__head h2 { font-size: var(--step-1); }
.side__head span { color: var(--ink-3); font-size: var(--step--1); }
.side .tabs { padding: 0 16px 12px; }
.side .eps { padding: 4px 16px 16px; overflow-y: auto; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); align-content: start; }
.side .ep { height: 44px; font-size: var(--step--1); }

/* ---------- player ----------
   Transport and timeline run left-to-right in every language (time is not text),
   labels stay Arabic. Native video: controls float over the picture and hide while playing.
   Facebook embed: the same controls dock under the video so Facebook's frame keeps its taps. */
.player-shell { position: relative; }
.pstage { position: relative; isolation: isolate; -webkit-tap-highlight-color: transparent; }
.player .fb-video,
.player .fb-video > span,
.player .fb-video iframe {
  position: absolute !important; inset: 0 !important;
  width: 100% !important; height: 100% !important; border: 0;
}
.player video { z-index: 0; }

.pbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; height: 44px; padding-inline: 8px; border: 0; border-radius: 12px;
  background: transparent; color: inherit; cursor: pointer; font: inherit;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), scale var(--t-fast) var(--ease-out);
}
.pbtn svg { width: 24px; height: 24px; fill: currentColor; flex-shrink: 0; }
.pbtn:active { scale: 0.9; }
.pbtn--txt { font-weight: 700; font-size: var(--step--1); font-variant-numeric: tabular-nums; min-width: 52px; }

/* buffering spinner */
.pspin { position: absolute; inset: 0; z-index: 1; display: none; place-items: center; pointer-events: none; }
.pspin i { width: 52px; height: 52px; border-radius: 50%; border: 3px solid oklch(1 0 0 / 0.22); border-top-color: var(--brand); animation: spin 800ms linear infinite; }
.pstage.is-buffering .pspin { display: grid; }
@keyframes spin { to { rotate: 1turn; } }

/* gesture layer: double-tap ripples, swipe-to-scrub bubble, hold-for-2x */
.pgest {
  position: absolute; inset: 0; z-index: 1; cursor: pointer;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.pripple {
  position: absolute; inset-block: 0; width: 40%; display: grid; place-items: center;
  color: #fff; opacity: 0; pointer-events: none;
}
.pripple--back { left: 0; border-radius: 0 50% 50% 0 / 0 70% 70% 0; background: linear-gradient(to right, oklch(1 0 0 / 0.16), oklch(1 0 0 / 0.05)); }
.pripple--fwd { right: 0; border-radius: 50% 0 0 50% / 70% 0 0 70%; background: linear-gradient(to left, oklch(1 0 0 / 0.16), oklch(1 0 0 / 0.05)); }
.pripple span { display: grid; justify-items: center; gap: 6px; font-size: var(--step--1); font-weight: 700; text-shadow: 0 1px 4px oklch(0 0 0 / 0.6); }
.pripple svg { width: 38px; height: 38px; fill: currentColor; filter: drop-shadow(0 1px 4px oklch(0 0 0 / 0.5)); }
.pripple.is-on { animation: ripple 700ms var(--ease-out) forwards; }
.pripple--back.is-on svg { animation: nudge-back 420ms var(--ease-out); }
.pripple--fwd.is-on svg { animation: nudge-fwd 420ms var(--ease-out); }
@keyframes ripple { 0% { opacity: 0; } 12%, 70% { opacity: 1; } 100% { opacity: 0; } }
@keyframes nudge-back { 40% { rotate: -45deg; } }
@keyframes nudge-fwd { 40% { rotate: 45deg; } }

.pbubble {
  position: absolute; left: 50%; top: 16%; translate: -50% 0; z-index: 2;
  display: flex; align-items: center; gap: 10px; padding: 8px 18px; border-radius: 999px;
  background: oklch(0.12 0.02 245 / 0.8); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap;
  opacity: 0; scale: 0.9; pointer-events: none;
  transition: opacity var(--t-fast) var(--ease-out), scale var(--t-med) var(--ease-spring);
}
.pbubble.is-on { opacity: 1; scale: 1; }
.pbubble b { font-size: var(--step-2); font-weight: 700; }
.pbubble span { color: var(--brand); font-weight: 700; }
.pbubble svg { width: 20px; height: 20px; fill: currentColor; }
.pbubble--boost { top: 14px; padding-block: 6px; }
.pbubble--boost b { font-size: var(--step-0); }

/* overlay */
.pov {
  position: absolute; inset: 0; z-index: 2; display: grid; grid-template-rows: auto 1fr auto;
  color: #fff; pointer-events: none; opacity: 0;
  transition: opacity 260ms var(--ease-out);
}
.pov::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, oklch(0 0 0 / 0.6), transparent 26%, transparent 52%, oklch(0 0 0 / 0.8));
}
.pstage.is-ui .pov { opacity: 1; }
.pstage.is-ui .pov :is(button, a, input, .pseek) { pointer-events: auto; }
.is-native .pstage.is-disabled .pov,
.pstage.is-end .pov { opacity: 0 !important; }
.is-native .pstage.is-disabled .pov *,
.pstage.is-end .pov * { pointer-events: none !important; }
.is-native .pstage.is-playing:not(.is-ui) { cursor: none; }
.is-native .pstage.is-playing:not(.is-ui) .pgest { cursor: none; }

.pov__top { padding: 14px 18px; }
.pov__title { display: grid; gap: 2px; text-shadow: 0 1px 4px oklch(0 0 0 / 0.6); max-width: 70%; }
.pov__title b { font-weight: 700; font-size: var(--step-0); }
.pov__title span { font-size: var(--step--1); color: oklch(1 0 0 / 0.78); }

.pov__center { display: flex; align-items: center; justify-content: center; gap: clamp(28px, 9vw, 80px); }
.pov__center .pbtn {
  border-radius: 50%; background: oklch(0 0 0 / 0.38);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.pov__center .pbtn--seek { width: 56px; height: 56px; }
.pov__center .pbtn--seek svg { width: 32px; height: 32px; }
.pov__center .pbtn--main {
  width: 76px; height: 76px; background: var(--brand); color: var(--brand-ink);
  box-shadow: 0 12px 34px -10px oklch(0.82 0.13 200 / 0.7);
}
.pov__center .pbtn--main svg { width: 36px; height: 36px; }
.pov__center .pbtn--main:hover { background: var(--brand-hi); }
.pstage.is-buffering .pov__center .pbtn--main { opacity: 0; }

.pov__bottom { display: grid; padding: 0 10px 6px; }
.pov__row { display: flex; align-items: center; gap: 2px; min-width: 0; }
.pov__gap { flex: 1; }
.pov__tx { display: contents; }
.is-native .pov .pbtn:hover { background: oklch(1 0 0 / 0.14); }

/* timeline */
.pseek {
  position: relative; height: 30px; margin-inline: 8px; display: flex; align-items: center;
  cursor: pointer; touch-action: none; outline: none;
}
.pseek__track {
  position: relative; flex: 1; height: 4px; border-radius: 999px; overflow: hidden;
  background: oklch(1 0 0 / 0.26); transition: height var(--t-fast) var(--ease-out);
}
.pseek__buf, .pseek__fill { position: absolute; inset-block: 0; left: 0; width: 0; border-radius: inherit; }
.pseek__buf { background: oklch(1 0 0 / 0.32); }
.pseek__fill { background: var(--brand); }
.pseek__thumb {
  position: absolute; top: 50%; left: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: var(--brand); pointer-events: none;
  transition: scale var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.pseek:hover .pseek__track, .pseek.is-drag .pseek__track, .pseek:focus-visible .pseek__track { height: 6px; }
.pseek.is-drag .pseek__thumb { scale: 1.4; box-shadow: 0 0 0 7px var(--brand-dim); }
.pseek:focus-visible .pseek__thumb { box-shadow: 0 0 0 3px #fff; }
.pseek__tip {
  position: absolute; bottom: calc(100% + 2px); left: 0; translate: -50% 0;
  padding: 4px 9px; border-radius: 7px; white-space: nowrap; pointer-events: none;
  background: oklch(0.12 0.02 245 / 0.92); color: #fff; font-size: var(--step--1); font-weight: 600; font-variant-numeric: tabular-nums;
  opacity: 0; transition: opacity var(--t-fast) var(--ease-out);
}
.pseek.is-drag .pseek__tip, .pseek.is-hover .pseek__tip { opacity: 1; }

.ptime {
  display: inline-flex; gap: 4px; padding: 8px; border: 0; border-radius: 10px; background: transparent; cursor: pointer;
  color: oklch(1 0 0 / 0.8); font: inherit; font-size: var(--step--1); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ptime [data-cur] { color: #fff; font-weight: 600; min-width: 4ch; text-align: end; }

/* volume (slider only where there is a mouse; phones use their hardware buttons) */
.pvol { display: inline-flex; align-items: center; }
.pvol input[type="range"] {
  --p: 0%;
  -webkit-appearance: none; appearance: none; width: 0; height: 28px; margin: 0; opacity: 0;
  background: transparent; cursor: pointer;
  transition: width var(--t-med) var(--ease-out), opacity var(--t-med) var(--ease-out);
}
.pvol:hover input[type="range"], .pvol:focus-within input[type="range"] { width: 84px; opacity: 1; margin-inline-end: 6px; }
.pvol input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 999px;
  background: linear-gradient(to right, currentColor var(--p), oklch(0.6 0 0 / 0.4) var(--p));
}
.pvol input[type="range"]::-moz-range-track { height: 4px; border-radius: 999px; background: oklch(0.6 0 0 / 0.4); }
.pvol input[type="range"]::-moz-range-progress { height: 4px; border-radius: 999px; background: currentColor; }
.pvol input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; margin-top: -4.5px; border-radius: 50%; background: currentColor;
}
.pvol input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: currentColor; }
.pvol input[type="range"]:focus-visible { outline: none; }
@media (hover: none) { .pvol input[type="range"] { display: none; } }

/* autoplay-next switch */
.pswitch {
  position: relative; width: 40px; height: 22px; margin-inline: 10px; border: 0; border-radius: 999px; cursor: pointer;
  background: oklch(0.6 0 0 / 0.45); transition: background var(--t-fast) var(--ease-out);
}
.pswitch::after { content: ""; position: absolute; inset: -11px -4px; } /* 44px touch target */
.pswitch i {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: oklch(0.35 0.02 245); transition: translate var(--t-med) var(--ease-spring);
}
.pswitch i svg { width: 10px; height: 10px; fill: currentColor; }
.pswitch[aria-checked="true"] { background: var(--brand); }
.pswitch[aria-checked="true"] i { translate: 18px 0; color: var(--brand-ink); }

/* floating chips: skip the opening, tap for sound */
.pchip {
  position: absolute; z-index: 3; display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding-inline: 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid oklch(1 0 0 / 0.28); background: oklch(0.12 0.02 245 / 0.74);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #fff; font: inherit; font-weight: 700; font-size: var(--step--1);
  animation: chip-in 320ms var(--ease-spring);
  transition: bottom var(--t-med) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.pchip[hidden] { display: none; }
.pchip svg { width: 18px; height: 18px; fill: currentColor; }
.pchip:hover { background: oklch(0.22 0.02 245 / 0.9); }
.pchip--skip { left: 14px; bottom: 16px; }
.pstage.is-ui .pchip--skip { bottom: 92px; }
.pchip--sound { left: 14px; top: 14px; background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.pchip--sound:hover { background: var(--brand-hi); }
.is-fb .pchip--skip { top: 14px; bottom: auto; }
@keyframes chip-in { from { opacity: 0; translate: 0 10px; } }

/* Facebook embed: controls docked under the video */
.is-fb .player { border-end-start-radius: 0; border-end-end-radius: 0; }
.is-fb .pov {
  position: static; display: block; opacity: 1; color: var(--ink); pointer-events: auto;
  background: var(--surface); border: 1px solid var(--line); border-top: 0;
  border-end-start-radius: var(--r-lg); border-end-end-radius: var(--r-lg);
  padding-top: 4px;
}
.is-fb .pov::before { display: none; }
.is-fb .pov :is(button, a, input, .pseek) { pointer-events: auto; }
.is-fb .pstage.is-disabled .pov { opacity: 0.45; }
.is-fb .pstage.is-disabled .pov * { pointer-events: none; }
.is-fb .pov .pbtn:hover { background: var(--surface-3); }
.is-fb .pov .pbtn--main { background: var(--brand); color: var(--brand-ink); border-radius: 50%; width: 44px; }
.is-fb .pov .pbtn--main:hover { background: var(--brand-hi); }
.is-fb .pseek__track { background: var(--surface-3); }
.is-fb .pseek__buf { display: none; }
.is-fb .pseek__thumb { background: var(--ink); }
.is-fb .ptime { color: var(--ink-2); }
.is-fb .ptime [data-cur] { color: var(--ink); }
.is-fb .pswitch { background: var(--surface-3); }
.is-fb .pswitch[aria-checked="true"] { background: var(--brand); }

.pbar__hint { min-height: 1.6em; margin-top: 8px; color: var(--ink-2); font-size: var(--step--1); }
.pbar__hint:empty { display: none; }
.pbar__hint.is-attention { color: var(--warn); font-weight: 600; }
.pbar__hint.flash { animation: hint-flash 600ms var(--ease-out); }
@keyframes hint-flash { 0%, 40% { opacity: 0.2; } 100% { opacity: 1; } }

/* end screen */
.endscreen {
  position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; text-align: center; padding: 20px;
  background: oklch(0.12 0.02 245 / 0.88); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: view-in var(--t-med) var(--ease-out);
}
.endscreen[hidden] { display: none; }
.endscreen__body { display: grid; gap: 10px; justify-items: center; max-width: 52ch; }
.endscreen__kicker { color: var(--ink-2); font-size: var(--step--1); font-weight: 600; }
.endscreen__title { font-size: var(--step-2); font-weight: 700; }
.endscreen__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }
.endscreen__ring { position: relative; width: 56px; height: 56px; display: grid; place-items: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.endscreen__ring svg { position: absolute; inset: 0; rotate: -90deg; fill: none; stroke-width: 3; }
.endscreen__ring circle { stroke: var(--surface-3); }
.endscreen__ring .endscreen__arc { stroke: var(--brand); stroke-linecap: round; stroke-dasharray: 107; stroke-dashoffset: 0; animation: ring 8s linear forwards; }
@keyframes ring { to { stroke-dashoffset: 107; } }

/* fullscreen (real, or a fixed overlay where the browser has no fullscreen API) */
html.is-locked { overflow: hidden; }
.player-shell.is-pseudo-fs { position: fixed; inset: 0; z-index: 1000; }
.player-shell:is(:fullscreen, :-webkit-full-screen, .is-pseudo-fs) { background: #000; display: flex; flex-direction: column; margin: 0; }
.player-shell:is(:fullscreen, :-webkit-full-screen, .is-pseudo-fs) .pstage { flex: 1; display: flex; flex-direction: column; min-height: 0; margin: 0; }
.player-shell:is(:fullscreen, :-webkit-full-screen, .is-pseudo-fs) .player { flex: 1; aspect-ratio: auto; border-radius: 0; margin: 0; }
.player-shell:is(:fullscreen, :-webkit-full-screen, .is-pseudo-fs) .pbar__hint { display: none; }
.player-shell:is(:fullscreen, :-webkit-full-screen, .is-pseudo-fs) .pov__top { padding: max(14px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 14px max(18px, env(safe-area-inset-left)); }
.player-shell:is(:fullscreen, :-webkit-full-screen, .is-pseudo-fs) .pov__bottom { padding: 0 max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
.player-shell:is(:fullscreen, :-webkit-full-screen, .is-pseudo-fs) .pov__center .pbtn--main { width: 88px; height: 88px; }
.player-shell:is(:fullscreen, :-webkit-full-screen, .is-pseudo-fs) .pov__title b { font-size: var(--step-1); }
.is-fb:is(:fullscreen, :-webkit-full-screen, .is-pseudo-fs) .pov { border-radius: 0; border-inline: 0; border-bottom: 0; }

/* blocked-by-Facebook panel */
.player.is-blocked { background: oklch(0.58 0.16 var(--h)); }
.blocked { position: absolute; inset: 0; display: grid; align-content: center; padding: clamp(20px, 5vw, 48px); }
.blocked .art__ghost { font-size: clamp(5rem, 14vw, 11rem); }
.blocked__body { display: grid; gap: 12px; max-width: 46ch; }
.blocked__title { font-size: clamp(1.25rem, 2.6vw, 1.75rem); font-weight: 700; }
.blocked__text { color: oklch(0.97 0.02 var(--h)); font-size: var(--step-0); }
.blocked__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.blocked .btn--primary { background: oklch(0.98 0.01 var(--h)); color: oklch(0.2 0.06 var(--h)); }
.blocked .btn--primary:hover { background: #fff; }

/* ---------- search ---------- */
.results { display: grid; gap: 10px; max-width: 720px; }
.result {
  display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
  transition: background var(--t-fast) var(--ease-out);
}
.result:hover { background: var(--surface-2); }
.result__art { width: 52px; height: 52px; border-radius: var(--r-sm); flex-shrink: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 1.3rem; }
.result__art svg { width: 22px; height: 22px; fill: currentColor; }
.result__body { display: grid; min-width: 0; }
.result__title { font-weight: 600; }
.result__sub { color: var(--ink-3); font-size: var(--step--1); }

.empty { padding: 48px 0; color: var(--ink-2); display: grid; gap: 14px; justify-items: start; max-width: 520px; }
.empty h2 { font-size: var(--step-2); color: var(--ink); }

/* ---------- footer ---------- */
.footer {
  max-width: var(--maxw); width: 100%; margin: 64px auto 0; padding: 24px var(--gutter) 40px;
  border-top: 1px solid var(--line); color: var(--ink-3); font-size: var(--step--1);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px;
}
.footer a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- install-as-app dialog (bottom sheet on phones, card on desktop) ---------- */
.install {
  width: min(440px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px);
  margin: auto; padding: 0; border: 0; background: transparent; color: var(--ink); overflow: visible;
}
.install::backdrop { background: oklch(0.08 0.02 245 / 0.62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.install[open] { animation: install-pop 320ms var(--ease-spring); }
.install[open]::backdrop { animation: install-fade 240ms var(--ease-out); }
.install__card {
  position: relative; display: grid; gap: 18px; padding: 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
  box-shadow: 0 30px 80px -30px oklch(0 0 0 / 0.8), 0 0 0 1px oklch(0.82 0.13 200 / 0.08);
  overflow: hidden;
}
.install__card::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 120px; z-index: 0; pointer-events: none;
  background: radial-gradient(120% 100% at 85% 0%, oklch(0.82 0.13 200 / 0.22), transparent 70%);
}
.install__card > * { position: relative; }
.install__x {
  position: absolute; top: 12px; inset-inline-end: 12px; width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); cursor: pointer;
}
.install__x:hover { background: var(--surface-3); color: var(--ink); }
.install__x svg { width: 20px; height: 20px; fill: currentColor; }
.install__head { display: flex; align-items: center; gap: 16px; padding-inline-end: 36px; }
.install__icon { width: 64px; height: 64px; border-radius: 16px; flex-shrink: 0; box-shadow: 0 10px 24px -10px oklch(0.82 0.13 200 / 0.7); }
.install__title { font-size: var(--step-2); font-weight: 700; line-height: 1.3; }
.install__sub { color: var(--ink-2); font-size: var(--step--1); margin-top: 2px; }
.install__perks { list-style: none; display: grid; gap: 10px; margin: 0; padding: 0; }
.install__perks li { display: flex; align-items: flex-start; gap: 10px; color: var(--ink-2); }
.install__perks svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; fill: var(--done); }
.install__steps {
  list-style: none; display: grid; gap: 12px; margin: 0; padding: 16px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md);
}
.install__steps li { display: flex; align-items: center; gap: 12px; line-height: 1.6; }
.install__steps b { color: var(--ink); font-weight: 700; }
.install__n {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: var(--brand-dim); color: var(--brand); font-weight: 700; font-size: var(--step--1);
}
.install__glyph {
  display: inline-grid; place-items: center; width: 28px; height: 28px; vertical-align: middle; margin-inline: 2px;
  border-radius: 8px; background: var(--surface-3); color: var(--brand);
}
.install__glyph svg { width: 18px; height: 18px; fill: currentColor; }
.install__actions { display: flex; gap: 10px; }
.install__actions .btn { flex: 1; height: 48px; }
@keyframes install-pop { from { opacity: 0; scale: 0.94; translate: 0 12px; } }
@keyframes install-fade { from { opacity: 0; } }

.footer__app {
  display: inline-flex; align-items: center; gap: 8px; width: fit-content; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: var(--step--1); font-weight: 600; cursor: pointer;
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.footer__app:hover { background: var(--surface-2); border-color: var(--brand); }
.footer__app img { border-radius: 5px; }

@media (max-width: 760px) {
  .install { width: 100%; margin: auto 0 0; max-height: 92dvh; }
  .install__card {
    border-radius: 24px 24px 0 0; border-bottom: 0;
    padding: 28px 20px max(20px, env(safe-area-inset-bottom));
  }
  .install__card::after {
    content: ""; position: absolute; top: 10px; left: 50%; translate: -50% 0;
    width: 40px; height: 4px; border-radius: 999px; background: var(--surface-3);
  }
  .install[open] { animation: install-up 360ms var(--ease-out); }
  @keyframes install-up { from { translate: 0 100%; } }
}

/* installed app: no browser chrome, so respect the notch */
@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top); }
}

/* ---------- view transition ---------- */
.view { animation: view-in var(--t-med) var(--ease-out); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .watch { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; }
  .side .eps { max-height: 360px; }
}
@media (max-width: 760px) {
  .pstage { margin-inline: calc(var(--gutter) * -1); }
  .pstage .player { margin-inline: 0; }
  .is-fb .pov { border-radius: 0; border-inline: 0; }
  .pov__top { padding: 10px 14px; }
  .pov__title b { font-size: var(--step--1); }
  .pov__title span { font-size: 0.75rem; }
  .pov__center { gap: clamp(22px, 11vw, 56px); }
  .pov__center .pbtn--seek { width: 50px; height: 50px; }
  .pov__center .pbtn--main { width: 66px; height: 66px; }
  .pov__row .pbtn { min-width: 40px; padding-inline: 6px; }
  .pswitch { margin-inline: 6px; }
  .is-fb .pov__row { flex-wrap: wrap; }
  .pov__bottom { padding-inline: 8px; }
  /* portrait phones: the picture is short, so the chip waits for the controls to hide */
  .is-native .pstage.is-ui .pchip--skip { opacity: 0; pointer-events: none; }
  .pchip--skip { transition: opacity var(--t-med) var(--ease-out); }
  .topbar__inner { flex-wrap: wrap; gap: 10px 16px; padding-block: 10px; }
  .search { order: 3; width: 100%; margin-inline-start: 0; }
  .mainnav { margin-inline-start: auto; }
  .mainnav a { padding: 6px 10px; font-size: var(--step--1); }
  .posters { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .poster__title { font-size: 1.6rem; }
  .poster__art { padding: 12px; }
  .hero__panel { min-height: 440px; }
  .posters { row-gap: 40px; }
  /* small screens: the figure stands behind the text on the opposite side, a little smaller */
  .pop--hero .char { --cx: 30%; }
  .pop--hero .char img { height: calc(var(--ch) * 0.8); opacity: 0.9; }
  .pop--hero .art__shade { background: linear-gradient(to top, oklch(0.16 0.04 var(--h) / 0.9), oklch(0.16 0.04 var(--h) / 0.35) 70%, transparent); }
  .player { border-radius: var(--r-md); margin-inline: calc(var(--gutter) * -1); border-radius: 0; }
  .jump { margin-inline-start: 0; }
  .controls .btn { flex: 1 1 auto; }
  .controls .spacer { display: none; }
  .footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .poster .pop, .poster .char img, .pop--hero .char img, a.ep:hover { transform: none !important; }
}
