/* Dramamora: flat streaming dark (iQIYI-style layout), one pink-to-purple accent for actions,
   gold only for Premium. Corners are small and square-ish (4px); decoration stays minimal. */

:root {
  --bg: #111319;
  --bg-2: #1a1c24;
  --bg-3: #23252b;
  --bg-4: #2d3039;
  --line: #2a2d36;
  --line-2: #3a3d48;
  --text: #f5f5f7;
  --text-2: #a9a9ac;
  --text-3: #9a9aa2;
  --red: #d6246f;
  --red-press: #b51e5e;
  --red-text: #ff6fae;
  --warn: #fb923c;
  --gold: #e8c08a;
  --accent-2: #9b3cf0;
  --grad: linear-gradient(90deg, #d6246f, #9b3cf0);
  --grad-press: linear-gradient(90deg, #b51e5e, #8331cf);
  --ph: #303440; /* poster placeholder */

  --top-h: 60px;
  --tab-h: 0px;
  --gutter: clamp(16px, 3.4vw, 56px);
  --card-w: clamp(132px, 13.6vw, 228px);
  --card-gap: clamp(8px, 1.1vw, 16px);
  --r: 4px;

  /* titles are plain bold sans (no condensed display face) */
  --f-display: "Plus Jakarta Sans", "SF Pro Display", -apple-system, Roboto, "Noto Sans", sans-serif;
  --f-ui: "Plus Jakarta Sans", "SF Pro Text", -apple-system, Roboto, "Noto Sans", system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (max-width: 768px) {
  :root {
    --top-h: 52px;
    --tab-h: 58px;
    --card-w: clamp(102px, 29vw, 150px);
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--top-h) + 12px);
  scroll-padding-bottom: calc(var(--tab-h) + 12px);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.5 var(--f-ui);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
}

img, svg, video { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  border-radius: 2px;
}
#app:focus { outline: none; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: fixed;
  inset-inline-start: 12px; top: -64px;
  z-index: 100;
  padding: 12px 18px;
  background: #fff;
  color: var(--bg);
  font-weight: 700;
  border-radius: var(--r);
  transition: top 0.15s;
}
.skip:focus { top: 12px; }

.ico {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.ico--fill { fill: currentColor; stroke: none; }

.dot { margin-inline: 0.5em; color: var(--text-3); }

#app { flex: 1; display: block; }
.view { min-height: 60vh; }

/* ---------- Top bar ---------- */

/* Transparent over the home/detail billboard (a soft top fade keeps the links legible),
   solid blurred dark once the page scrolls or on pages without a billboard. */
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--top-h);
  background-color: transparent;
  background-image: linear-gradient(180deg, rgba(17, 19, 25, 0.82) 0%, rgba(17, 19, 25, 0) 100%);
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}
.topbar.is-scrolled,
body:not([data-route="home"]):not([data-route="drama"]) .topbar {
  background-color: rgba(17, 19, 25, 0.94);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .topbar.is-scrolled,
  body:not([data-route="home"]):not([data-route="drama"]) .topbar {
    background-color: rgba(17, 19, 25, 0.82);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    backdrop-filter: blur(14px) saturate(1.2);
  }
}

.topbar__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-inline: var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  flex: none;
}
/* Wordmark (icons/logo-header.png, transparent, about 5:1). Height drives the size. */
.brand__logo { display: block; width: auto; height: 32px; max-width: none; }

.nav { display: flex; gap: 2px; margin-inline-start: 32px; }
.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.15s;
}
.nav__link:hover { color: #fff; }
.nav__link[aria-current="page"] { color: #fff; font-weight: 700; }
.nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset-inline: 12px;
  bottom: 6px;
  height: 3px;
  border-radius: 2px;
  background: var(--grad);
}

/* min-width 0: when long labels (fr, de, es) do not fit, the source picker gives way (ellipsis) instead of the header overflowing */
.tools { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }

.iconbtn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  color: #fff;
  border-radius: var(--r);
}
/* icon above a small label, like the History / Language / Me cluster on iQIYI */
.iconbtn__label { display: none; }
.lng__btn {
  width: auto;
  min-width: 48px;
  padding: 0 4px;
  align-content: center;
  gap: 2px;
  color: #e3e3e6;
  transition: color 0.15s;
}
.lng__btn .ico { width: 20px; height: 20px; }
.lng__btn .iconbtn__label { display: block; font-size: 11px; font-weight: 500; line-height: 1.2; white-space: nowrap; }
.lng__btn:hover, .lng__btn[aria-expanded="true"] { color: var(--red-text); }

/* Desktop: the search box is always on screen; the magnifier sits inside at the end. */
.search {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  height: 36px;
  border: 1px solid transparent;
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.16);
  transition: background-color 0.2s, border-color 0.2s;
}
.search .iconbtn { height: 34px; width: 40px; color: rgba(255, 255, 255, 0.85); }
.search .iconbtn:hover { color: #fff; }
.search input {
  width: 196px;
  min-width: 0;
  height: 100%;
  padding-block: 0;
  padding-inline: 12px 0;
  border: 0;
  background: none;
  font-size: 14px;
  outline: none;
}
.search input::placeholder { color: rgba(255, 255, 255, 0.66); }
.search:hover { background: rgba(255, 255, 255, 0.22); }
.search.is-open,
.search:focus-within { background: rgba(17, 19, 25, 0.9); border-color: rgba(255, 255, 255, 0.55); }
.search:focus-within { border-color: #fff; }
.search input::-webkit-search-cancel-button { filter: invert(1); }
body[data-route="search"] .search { display: none; }

/* source dropdown */
.src { position: relative; min-width: 0; }
.src__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 36px;
  padding-block: 0; padding-inline: 12px 8px;
  border: 0;
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.12);
  font-size: 14px;
  white-space: nowrap;
  transition: background-color 0.15s;
}
.src__btn:hover, .src__btn[aria-expanded="true"] { background: rgba(255, 255, 255, 0.2); }
.src__label { color: var(--text-2); }
.src__current { font-weight: 700; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.src__chev { margin-inline-start: auto; transition: transform 0.2s var(--ease); }
.src__btn[aria-expanded="true"] .src__chev { transform: rotate(180deg); }
.src__btn.is-down .src__current::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-inline-end: 6px;
  border-radius: 50%;
  background: var(--warn);
  vertical-align: 2px;
}

.src__pop {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 10px);
  width: 264px;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: 8px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--r);
  /* elevation: the only floating surface in the header, it must read above the hero */
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.src__title { padding: 6px 10px 8px; font-size: 13px; color: var(--text-3); }
.src__opt {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r);
  background: none;
  text-align: start;
  font-size: 14px;
}
.src__opt:hover { background: var(--bg-4); }
.src__check { width: 18px; color: var(--red-text); visibility: hidden; }
.src__opt[aria-current="true"] .src__check { visibility: visible; }
.src__opt[aria-current="true"] .src__name { font-weight: 700; color: #fff; }
.src__name { flex: 1; }
/* "Semua sumber" is a different kind of choice from one provider: set it apart with a rule */
.src__sep { padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.src__status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--warn); }
.src__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
/* sources without content in the UI language: listed after a label, each with its content language */
.src__group { margin-top: 6px; padding: 12px 10px 6px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--text-3); }
.src__lang { margin-inline-start: 8px; font-size: 12.5px; font-weight: 400; color: var(--text-3); }

/* Premium shortcut: the gold "VIP" button of the header */
.vip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--r);
  background: linear-gradient(90deg, #f3d5ad, #e8c08a);
  color: #3a2810;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: filter 0.15s;
}
.vip:hover { filter: brightness(1.07); }
body.is-premium .vip { display: none; }

/* language menu: globe button beside the source picker, list reuses the source menu styles */
.lng { position: relative; }
.lng__pop { width: 232px; }
.foot__lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-2);
  font: inherit;
  text-decoration: none;
}
.foot__lang:hover { color: #fff; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding-block: 0; padding-inline: 18px 22px;
  border: 0;
  border-radius: var(--r);
  font: 700 15px/1 var(--f-ui);
  white-space: nowrap;
  transition: background-color 0.15s, filter 0.15s, transform 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn--white { background: #fff; color: #111319; }
.btn--white:hover { background: #dcdcdf; }
.btn--grey { background: rgba(255, 255, 255, 0.14); color: #fff; }
.btn--grey:hover { background: rgba(255, 255, 255, 0.22); }
/* primary: the brand gradient (white text passes 4.8:1 on both ends) */
.btn--red { background: var(--red) var(--grad); color: #fff; }
.btn--red:hover { background: var(--red-press) var(--grad-press); }
/* Facebook: Meta's #166FE5 shade keeps white text at 4.7:1 (#1877F2 is only 4.2:1). */
.btn--fb { background: #166fe5; color: #fff; }
.btn--fb:hover { background: #1259bd; }
.fbmark { flex: none; }
/* Google: gaya tombol resmi (tema terang) — putih, garis #747775, teks #1F1F1F, logo G empat warna. */
.btn--google { background: #fff; color: #1f1f1f; border: 1px solid #747775; font-weight: 600; }
.btn--google:hover { background: #f2f2f2; }
.btn--google:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.gmark { flex: none; }
.btn--sm { min-height: 40px; padding-block: 0; padding-inline: 12px 14px; font-size: 14px; gap: 6px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
/* full-width buttons may carry long labels ("Berlangganan lewat lynk.id"): let them wrap, never overflow */
.btn--block { width: 100%; min-height: 46px; white-space: normal; text-align: center; line-height: 1.25; padding-block: 10px; }

.textbtn {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(169, 169, 172, 0.5);
}
.textbtn:hover { color: #fff; text-decoration-color: #fff; }
.textbtn:disabled { opacity: 0.55; cursor: not-allowed; }
.textbtn--danger { color: var(--red-text); text-decoration-color: rgba(255, 111, 174, 0.5); }
.textbtn--danger:hover { color: #ff93c2; text-decoration-color: #ff93c2; }

/* ---------- Poster art ---------- */

.art {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--ph);
}
.art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.35s var(--ease);
}
.art.is-loaded img { opacity: 1; }
.art__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #5b5f6d;
}

/* ---------- Hero billboard ----------
   Full-bleed like iQIYI: the cover fills the end side of the screen, sharp, and fades into the page;
   a blurred copy of it tints the rest. Copy sits at the start side; the first row overlaps the bottom. */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: clamp(560px, 88vh, 820px);
  display: flex;
  align-items: flex-end;
}
.hero__backdrop { position: absolute; inset: -48px; z-index: -3; background: var(--bg-2); }
.hero__backdrop img,
.detail__backdrop img,
.stage__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(40px) saturate(1.2) brightness(0.42);
  transform: scale(1.12);
}
/* fades the art into the page; also keeps the start-side copy column dark enough for text */
.hero__shade,
.detail__hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(17, 19, 25, 0.97) 0%, rgba(17, 19, 25, 0.82) 28%, rgba(17, 19, 25, 0.25) 52%, rgba(17, 19, 25, 0) 66%),
    linear-gradient(0deg, var(--bg) 0%, rgba(17, 19, 25, 0.72) 16%, rgba(17, 19, 25, 0) 42%),
    linear-gradient(180deg, rgba(17, 19, 25, 0.55) 0%, rgba(17, 19, 25, 0) 18%);
}

.hero__inner {
  width: 100%;
  padding: calc(var(--top-h) + 40px) var(--gutter) clamp(170px, 22vh, 210px);
}
.hero__card { display: block; }
.hero__copy {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
/* the cover as the billboard image: end side, full height, at its own 3:4 shape so faces are not
   cropped away; the blurred backdrop fills the rest. Narrow screens trim its sides instead. */
.hero__poster {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  z-index: -2;
  aspect-ratio: 3 / 4;
  max-width: 56%;
}
.hero__poster .art {
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
  /* placeholder while the first cover loads */
  background: linear-gradient(160deg, #2c2f3a 0%, #1d1f27 70%);
  -webkit-mask: linear-gradient(90deg, transparent 0%, #000 34%);
  mask: linear-gradient(90deg, transparent 0%, #000 34%);
}
/* the next slide's cover loads on top of the current one and fades in over it (app.js swapIn) */
.hero__poster > .art + .art { position: absolute; inset: 0; background: transparent; }
.hero__backdrop img + img { position: absolute; inset: 0; }
.hero__poster .art img { object-position: 50% 22%; }
.hero__poster .art__fallback { display: none; }

/* order follows iQIYI: title, then the accent tag, meta, synopsis, round buttons */
.hero__title { order: 0; }
.hero__kicker { order: 1; }
.hero__meta { order: 2; }
.hero__syn { order: 3; }
.hero__actions { order: 4; }

.hero__kicker {
  max-width: 100%;
  margin-top: 14px;
  padding: 3px 8px;
  border-radius: 2px;
  background: var(--red) var(--grad);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero__title {
  font: 800 clamp(32px, 3.5vw, 54px)/1.12 var(--f-display);
  letter-spacing: -0.02em;
  text-wrap: balance;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}
.hero__meta { margin-top: 12px; font-size: 13.5px; font-weight: 500; color: #d2d2d6; }
.hero__syn {
  margin-top: 12px;
  max-width: 54ch;
  font-size: 14px;
  line-height: 1.6;
  color: #c9c9ce;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero__syn.is-loading {
  width: min(440px, 100%);
  height: 3.2em;
  border-radius: var(--r);
  background: linear-gradient(rgba(255, 255, 255, 0.08) 0 1.2em, transparent 1.2em 1.9em, rgba(255, 255, 255, 0.08) 1.9em 3.1em, transparent 3.1em);
  -webkit-mask: linear-gradient(90deg, #000 70%, transparent);
  mask: linear-gradient(90deg, #000 70%, transparent);
}

/* round icon buttons with the label beside them: gradient play, translucent info */
.hero__actions { margin-top: 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.hero__actions .btn {
  min-height: 56px;
  padding: 0;
  gap: 12px;
  background: none;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.hero__actions .btn .ico {
  box-sizing: border-box;
  width: 56px;
  height: 56px;
  padding: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  transition: transform 0.2s var(--ease), filter 0.15s, background-color 0.15s;
}
.hero__actions .btn--white .ico {
  padding: 16px 14px 16px 18px;
  background: var(--red) var(--grad);
  color: #fff;
  box-shadow: 0 8px 24px rgba(214, 36, 111, 0.35);
}
.hero__actions .btn--white .ico path { fill: currentColor; }
.hero__actions .btn:hover { background: none; }
.hero__actions .btn:hover .ico { transform: scale(1.06); }
.hero__actions .btn--white:hover .ico { filter: brightness(1.1); }
.hero__actions .btn--grey:hover .ico { background: rgba(255, 255, 255, 0.26); }

.hero__dots {
  position: absolute;
  inset-inline-end: var(--gutter);
  bottom: clamp(176px, 22vh, 216px);
  display: flex;
  align-items: center;
}
.hero__dot {
  width: 30px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  padding: 0;
}
.hero__dot i {
  position: relative;
  display: block;
  width: 8px;
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.4);
  transition: width 0.25s var(--ease);
}
.hero__dot.is-on i { width: 26px; }
.hero__dot b {
  position: absolute;
  inset: 0;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
}
.hero__dot.is-on b { animation: kd-fill 8s linear forwards; }
.hero.is-paused .hero__dot.is-on b,
.hero.is-user-paused .hero__dot.is-on b { animation-play-state: paused; }
.hero__pause {
  width: 36px;
  height: 44px;
  margin-inline-end: 4px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r);
  background: none;
  color: var(--text-2, #a9a9ac);
  padding: 0;
  cursor: pointer;
}
.hero__pause:hover, .hero__pause[aria-pressed="true"] { color: #fff; }
.hero__pause:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (hover: hover) {
  .hero:hover .hero__dot.is-on b { animation-play-state: paused; }
}
.hero:has(:focus-visible) .hero__dot.is-on b { animation-play-state: paused; }

.hero.is-swap .hero__copy { animation: kd-in 0.45s var(--ease); }
/* only the incoming backdrop fades; the poster crossfades through .art.is-loaded */
.hero.is-swap .hero__backdrop img:last-child { animation: kd-fade 0.6s ease; }

.hero--sk .hero__copy { width: min(560px, 100%); }

/* ---------- Rows ---------- */

/* the first rows ride up over the bottom of the billboard */
.home__rows { position: relative; z-index: 1; margin-top: calc(-1 * clamp(130px, 17vh, 168px)); padding-bottom: 40px; }
.row { margin-top: 30px; }
.row:first-child { margin-top: 0; }
.row__head {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 32px;
  padding-inline: var(--gutter);
}
.row__title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
.row__body { position: relative; }
.row__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--card-w);
  gap: var(--card-gap);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  /* vertical padding reserves room for the hover lift so nothing gets clipped */
  padding: 12px var(--gutter) 14px;
  scrollbar-width: none;
}
.row__track::-webkit-scrollbar { display: none; }
.row__item { scroll-snap-align: start; min-width: 0; }

/* chevron bands at the row edges, over the poster area only */
.row__arrow {
  position: absolute;
  top: 12px;
  z-index: 4;
  width: max(44px, var(--gutter));
  height: calc(var(--card-w) * 4 / 3);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  color: #fff;
  background: rgba(17, 19, 25, 0.62);
  opacity: 0;
  transition: opacity 0.2s ease, background-color 0.2s;
}
.row__arrow--prev { inset-inline-start: 0; border-radius: 0 var(--r) var(--r) 0; }
.row__arrow--next { inset-inline-end: 0; border-radius: var(--r) 0 0 var(--r); }
.row__arrow:hover { background: rgba(17, 19, 25, 0.86); }
.row__arrow:hover .ico { transform: scale(1.15); }
.row__arrow .ico { transition: transform 0.15s; }
.row__arrow:disabled { visibility: hidden; }
.row__arrow:focus-visible { opacity: 1; outline-offset: -4px; }
@media (hover: hover) and (pointer: fine) {
  .row__body:hover .row__arrow { opacity: 1; }
}
@media (hover: none) {
  .row__arrow { display: none; }
}

/* ---------- Cards ---------- */

.card {
  position: relative;
  transition: transform 0.25s var(--ease);
  transform-origin: 50% 40%;
}
.row__item:first-child .card { transform-origin: 0 40%; }
.row__item:last-child .card { transform-origin: 100% 40%; }
.card__link { position: relative; display: block; border-radius: var(--r); }
.card__link .art { transition: box-shadow 0.25s var(--ease); }
.card__title {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* episode count / source sits on the poster's bottom edge over a fade, like "30 Episodes" on iQIYI.
   Top padding = poster height (4/3 of the width) minus one line, so the text lands on the bottom edge. */
.card__meta {
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  display: block;
  height: 18px;
  padding: calc(133.333% - 26px) 8px 0;
  box-sizing: content-box;
  line-height: 18px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.card__link .art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.55) 82%, rgba(0, 0, 0, 0.85) 100%);
}
/* history cards carry a 2-line meta higher up the poster: darker fade so it stays readable */
.card__link:has(.card__progress) .art::after {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.7) 70%, rgba(0, 0, 0, 0.9) 100%);
}
.card__meta > * { vertical-align: baseline; }
.card__meta .dot { color: rgba(255, 255, 255, 0.7); margin-inline: 0.35em; }

.card__over {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  aspect-ratio: 3 / 4;
  display: grid;
  place-items: center;
  border-radius: var(--r);
  background: rgba(17, 19, 25, 0.38);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.card:focus-within .card__over { opacity: 1; }
.card__play {
  pointer-events: auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red) var(--grad);
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  transform: scale(0.85);
  transition: transform 0.25s var(--ease), filter 0.15s;
}
.card:hover .card__play,
.card:focus-within .card__play { transform: none; }
.card__play .ico { margin-inline-start: 3px; }
.card__play:hover { filter: brightness(1.12); }
.card__play--static { pointer-events: none; }
/* first genre, a small chip in the top-start corner while the card is lifted */
.card__tag {
  position: absolute;
  top: 6px;
  inset-inline-start: 6px;
  max-width: calc(100% - 12px);
  padding: 3px 6px;
  border-radius: 2px;
  background: rgba(17, 19, 25, 0.78);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: translateY(-4px) scale(1.05); z-index: 3; }
  .card:hover .art { box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08); }
  .card:hover .card__over { opacity: 1; }
  .card:hover .card__title { color: var(--red-text); }
}

/* corner flag, top-end, like iQIYI's "Free" / "TOP 10" */
.card__badge {
  position: absolute;
  inset-inline-end: 0;
  top: 0;
  z-index: 1;
  padding: 4px 7px;
  border-end-start-radius: var(--r);
  background: var(--red) var(--grad);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.card__progress {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  height: 3px;
  background: rgba(255, 255, 255, 0.28);
}
.card__progress span { display: block; height: 100%; background: var(--red) var(--grad); }
/* history cards carry a progress bar on the bottom edge: the meta sits above it, and may wrap to a second
   line (growing upward over the poster's bottom fade) so the source name after "Ep. 4 dari 70 ·" is not cut off */
.card__link:has(.card__progress) .card__meta {
  display: grid;
  align-content: end;
  box-sizing: border-box;
  height: auto;
  aspect-ratio: 3 / 4;
  padding: 0 8px 11px;
  white-space: normal;
}

/* Top 10: big gradient rank numerals tucked behind the poster */
/* columns size to their item (rank room + card) so rank 10 can take the extra room its two digits need */
.row--top .row__track { grid-auto-columns: max-content; }
.top { position: relative; padding-inline-start: calc(var(--card-w) * 0.46); }
.top__num {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  height: calc(var(--card-w) * 4 / 3);
  display: flex;
  align-items: flex-end;
  font: italic 800 calc(var(--card-w) * 0.7)/0.8 var(--f-display);
  letter-spacing: -0.02em;
  /* the italic is synthesized and leans past the glyph box to the right; background-clip:text only
     paints inside the box, so give the slant room (physical side: the slant is physical too) */
  padding-right: 0.22em;
  color: var(--red-text);
  background: linear-gradient(180deg, #ff6fae 45%, #b56cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  user-select: none;
  padding-bottom: 2px;
}
.top .card { z-index: 1; width: var(--card-w); }
.row--top .row__item:nth-child(10) .top { padding-inline-start: calc(var(--card-w) * 0.78); }
/* RTL: the physical padding-right on .top__num pushes the numeral toward its own poster; reserve more room. */
[dir="rtl"] .top { padding-inline-start: calc(var(--card-w) * 0.61); }
[dir="rtl"] .row--top .row__item:nth-child(10) .top { padding-inline-start: calc(var(--card-w) * 0.93); }
.row--top .row__item:first-child .card { transform-origin: 50% 40%; }

/* Mixed-source rows: the provider name leads the meta line */
.card__src { font-weight: 700; }

/* "Lihat semua" on per-source rows: switches the whole home to that source */
.row__more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 32px;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
}
.row__more:hover { color: var(--red-text); }
.row__more .ico { transition: transform 0.15s var(--ease); }
.row__more:hover .ico { transform: translateX(2px); }

/* Aggregated home: chips that jump to each source's row */
.srcjump__count { color: var(--text-3); font-size: 14px; }
.row--srcjump .row__track {
  grid-auto-columns: max-content;
  gap: 10px;
  scroll-snap-type: x proximity;
  padding-block: 10px 4px;
}
.row--srcjump .row__arrow { top: 10px; height: 44px; }
/* category chips: flat rectangles, grey text, white on hover (iQIYI's genre buttons) */
.srcjump__chip {
  /* containing block for the .sr-only hint, so it stays inside the scroller instead of widening the page */
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding-block: 4px; padding-inline: 4px 14px;
  border: 0;
  border-radius: var(--r);
  background: var(--bg-3);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
.srcjump__chip:hover { background: var(--bg-4); color: #fff; }
.srcjump__thumb { flex: none; width: 27px; }
.srcjump__thumb .art { border-radius: 2px; }
.srcjump__thumb .art__fallback .ico { width: 14px; height: 14px; }
.row__title[tabindex="-1"]:focus { outline: none; }

/* lazy rows: the sentinel shows a skeleton row while more rows are queued */
.home__sentinel { margin-top: 26px; }

/* aggregated home while the server is still probing sources */
.hero__wait { font-size: 15px; font-weight: 600; color: var(--text-2); }

/* ---------- Generic page ---------- */

.page {
  padding: calc(var(--top-h) + 32px) var(--gutter) 64px;
  max-width: 1680px;
  margin-inline: auto;
  width: 100%;
}
.page--flush { padding-top: calc(var(--top-h) + 56px); padding-bottom: 24px; }
.page__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.page__title {
  font: 800 clamp(26px, 2.4vw, 36px)/1.15 var(--f-display);
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.page__title q { quotes: "“" "”"; color: var(--text-2); }
.page__sub { margin-top: 8px; color: var(--text-2); font-size: 15px; }
.sec-title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(128px, 12.5vw, 210px), 1fr));
  gap: 24px var(--card-gap);
}

/* ---------- State boxes ---------- */

.state {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 10px;
  padding: 48px 16px;
  max-width: 560px;
  margin-inline: auto;
}
.state__mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-3);
  color: var(--red-text);
  margin-bottom: 6px;
}
.state--error .state__mark { color: var(--red-text); }
.state__title { font-size: 22px; font-weight: 700; }
.state__msg { color: var(--text-2); max-width: 48ch; }
.state__actions { margin-top: 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* ---------- Skeletons ---------- */

.sk {
  border-radius: 4px;
  background: linear-gradient(90deg, #20232b 0%, #2c2f38 50%, #20232b 100%) 0 0 / 200% 100%;
  animation: kd-shimmer 1.4s linear infinite;
}
.sk-line { height: 12px; margin-top: 10px; }
.sk-line--short { width: 55%; }
.sk-title { width: 200px; height: 22px; }
.sk-kicker { width: 150px; height: 14px; }
.sk-htitle { width: min(520px, 90%); height: 64px; margin-top: 14px; }
.sk-btns { width: min(280px, 100%); height: 50px; margin-top: 22px; }
.sk-ep { height: 48px; border-radius: var(--r); }
.hero--sk { min-height: clamp(560px, 88vh, 820px); }

/* ---------- Search ---------- */

.bigsearch {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 760px;
  padding-block: 4px; padding-inline: 16px 4px;
  background: var(--bg-3);
  border: 1px solid transparent;
  border-radius: var(--r);
  transition: border-color 0.15s;
}
.bigsearch:focus-within { border-color: var(--red-text); }
.bigsearch__ico { color: var(--text-2); }
.bigsearch__input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 8px;
  border: 0;
  background: none;
  font-size: 18px;
  outline: none;
}
.bigsearch__input::placeholder { color: var(--text-3); }
.bigsearch__input::-webkit-search-cancel-button { filter: invert(1); }
.bigsearch__go { min-height: 44px; padding-inline: 22px; }

.searchbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  max-width: 760px;
  margin: 10px 0 30px;
}
.searchbar .page__sub { margin: 0; }

.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.toggle input {
  position: absolute;
  opacity: 0;
  width: 44px;
  height: 26px;
  margin: 0;
  cursor: pointer;
}
.toggle__track {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: #74747d; /* 3.7:1 on the panels, so the "off" track is still seen */
  transition: background-color 0.2s;
}
.toggle__track::after {
  content: "";
  position: absolute;
  inset-inline-start: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s var(--ease);
}
.toggle input:checked + .toggle__track { background: var(--red) var(--grad); }
.toggle input:checked + .toggle__track::after { transform: translateX(18px); }
.toggle input:focus-visible + .toggle__track { outline: 2px solid #fff; outline-offset: 3px; }
.toggle input:disabled, .toggle:has(input:disabled) { cursor: progress; }
.toggle input:disabled + .toggle__track { opacity: 0.55; }

.results__count { margin-bottom: 16px; color: var(--text-2); font-size: 15px; }

.recent { max-width: 760px; }
.recent__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.recent__list { border-top: 1px solid var(--line); }
.recent__item { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.recent__link {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-inline: 4px;
  font-size: 16px;
}
.recent__link .ico { color: var(--text-3); }
.recent__link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent__link:hover { color: var(--text-2); }
.recent__x {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r);
  background: none;
  color: var(--text-2);
}
.recent__x:hover { color: #fff; background: var(--bg-3); }

.group + .group { margin-top: 36px; }
.group__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.group__count { color: var(--text-3); font-size: 14px; }
.group.is-empty .group__head { margin-bottom: 4px; }
.group__note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  color: var(--text-2);
  font-size: 15px;
}
.group__note--error .ico { color: var(--red-text); }

/* ---------- Detail ---------- */

.detail__hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: min(72vh, 680px);
  display: flex;
  align-items: flex-end;
  padding: calc(var(--top-h) + 48px) var(--gutter) 36px;
}
.detail__backdrop { position: absolute; inset: -48px; z-index: -2; background: var(--bg-2); }
/* wide screens: the cover itself, sharp, fills the end side and fades into the page (iQIYI album page).
   Narrower screens keep the blurred copy: there the sharp cover's printed title would sit behind the synopsis. */
@media (min-width: 1101px) {
  .detail__backdrop { inset: 0; inset-inline-start: auto; width: min(66%, 1060px); background: none; }
  .detail__hero::after {
    background:
      linear-gradient(90deg, rgba(17, 19, 25, 0.98) 0%, rgba(17, 19, 25, 0.92) 58%, rgba(17, 19, 25, 0.7) 70%, rgba(17, 19, 25, 0) 84%),
      linear-gradient(0deg, var(--bg) 0%, rgba(17, 19, 25, 0) 40%),
      linear-gradient(180deg, rgba(17, 19, 25, 0.55) 0%, rgba(17, 19, 25, 0) 18%);
  }
  [dir="rtl"] .detail__hero::after {
    background:
      linear-gradient(270deg, rgba(17, 19, 25, 0.98) 0%, rgba(17, 19, 25, 0.92) 58%, rgba(17, 19, 25, 0.7) 70%, rgba(17, 19, 25, 0) 84%),
      linear-gradient(0deg, var(--bg) 0%, rgba(17, 19, 25, 0) 40%),
      linear-gradient(180deg, rgba(17, 19, 25, 0.55) 0%, rgba(17, 19, 25, 0) 18%);
  }
  .detail__backdrop img {
    filter: saturate(1.05) brightness(0.82);
    transform: none;
    object-position: 50% 22%;
    -webkit-mask: linear-gradient(90deg, transparent 0%, #000 55%);
    mask: linear-gradient(90deg, transparent 0%, #000 55%);
  }
  [dir="rtl"] .detail__backdrop img {
    -webkit-mask: linear-gradient(270deg, transparent 0%, #000 55%);
    mask: linear-gradient(270deg, transparent 0%, #000 55%);
  }
}
.detail__head {
  width: 100%;
  max-width: 1400px;
  display: grid;
  grid-template-columns: clamp(180px, 17vw, 260px) minmax(0, 1fr);
  gap: clamp(24px, 3vw, 48px);
  align-items: end;
}
.detail__poster .art { box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55); }
.detail__info { min-width: 0; max-width: 660px; }
.detail__info > .sk + .sk { margin-top: 14px; }
.detail__title {
  font: 800 clamp(28px, 3vw, 46px)/1.15 var(--f-display);
  letter-spacing: -0.02em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.detail__meta { margin-top: 12px; font-size: 13.5px; font-weight: 500; color: #d2d2d6; }
.detail__actions { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 12px; }
.detail__actions .btn { min-height: 48px; font-size: 16px; padding-inline: 22px 26px; }
.synopsis { margin-top: 18px; }
.synopsis__text { max-width: 70ch; font-size: 14.5px; line-height: 1.65; color: #c9c9ce; white-space: pre-line; }
.synopsis__text.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.synopsis .textbtn { margin-inline-start: -4px; }
/* titles/synopses carry dir="auto" (correct bidi for Latin text on an Arabic page); keep the page's alignment */
.detail__title, .synopsis__text, .hud__title { text-align: left; }
[dir="rtl"] :is(.detail__title, .synopsis__text, .hud__title) { text-align: right; }
.synopsis__none { margin-top: 18px; color: var(--text-3); font-size: 14.5px; }
/* genre chips: small flat translucent rectangles */
.tags { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  padding: 4px 9px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 12.5px;
  line-height: 1.3;
  color: #dcdce0;
}

.detail__eps { padding: 24px var(--gutter) 64px; max-width: 1400px; box-sizing: content-box; }
.eps__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.eps__count { color: var(--text-3); font-size: 14px; }

/* ---------- Episode list ----------
   iQIYI-style number grid: small flat tiles. The visible number lives in the decorative thumb;
   the "Episode N" name and flags stay in the link text for screen readers. */

.eplist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
}
.epi {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--r);
  background: var(--bg-3);
  color: var(--text);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.epi:hover { background: var(--bg-4); color: var(--red-text); }
/* ring inside the tile: scrolling lists (player panel) would clip an outer one */
.epi:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
/* locked: dimmed tile, the gold lock corner stays at full strength */
.epi.is-locked:not([aria-current="true"]):not(:hover) { background: var(--bg-2); color: var(--text-3); }
.epi.is-locked:not([aria-current="true"]):not(.is-last) { border-color: var(--line); }
.epi__thumb { position: static; display: contents; }
.epi__thumb .art { display: none; }
.epi__thumb::after { content: none; }
.epi__num {
  position: static;
  display: block;
  font: 600 15px/1 var(--f-ui);
  font-variant-numeric: tabular-nums;
}
/* name and flags: visually hidden, still read out */
.epi__text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.epi__name, .epi__sub, .epi__flag { display: block; }
.epi__flag--now { display: none; }
.epi__lock {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  display: grid;
  place-items: center;
  width: 20px;
  height: 18px;
  border-end-start-radius: var(--r);
  background: linear-gradient(90deg, #f3d5ad, #e8c08a);
  color: #3a2810;
}
.epi__lock .ico { width: 11px; height: 11px; }
@media (pointer: coarse) {
  .epi__lock { width: 24px; height: 22px; }
  .epi__lock .ico { width: 13px; height: 13px; }
}
/* last watched: accent ring and a small corner mark */
.epi.is-last { border-color: rgba(214, 36, 111, 0.85); }
.epi.is-last::before {
  content: "";
  position: absolute;
  top: 5px;
  inset-inline-start: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red-text);
}
.epi[aria-current="true"] { background: var(--red) var(--grad); border-color: transparent; color: #fff; }
.epi[aria-current="true"]::before { content: none; }
.epi[aria-current="true"] .epi__flag--now { display: block; }
.epi[aria-current="true"] .epi__flag:not(.epi__flag--now) { display: none; }

/* ---------- Watch ---------- */

body[data-route="watch"] #app { padding-top: var(--top-h); }
body[data-route="watch"] .foot { display: none; }

.watch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(300px, 25vw, 400px);
  height: calc(100vh - var(--top-h));
  height: calc(100dvh - var(--top-h));
  background: #000;
}
.stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 0;
  background: #000;
  container-type: size; /* the HUD sizes itself to the 9:16 video inside */
}
.stage__bg { position: absolute; inset: -60px; z-index: -1; }
.stage__bg img { filter: blur(44px) saturate(1.2) brightness(0.36); }
.stage__frame { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.stage__video {
  height: 100%;
  width: auto;
  max-width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  background: #000;
}
.stage__video::cue { font-family: var(--f-ui); font-size: 1.05em; background: rgba(0, 0, 0, 0.62); }

.stage__hud {
  position: absolute;
  inset: 0 0 auto;
  z-index: 4; /* di atas overlay error/selesai supaya tautan kembali tetap bisa diklik */
  padding: 14px 24px 72px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
  transition: opacity 0.3s ease;
}
/* same width as the video (9:16, centred), so the title never straddles its edge */
@supports (width: 1cqh) {
  .stage__hud { left: 50%; right: auto; width: min(100cqw, 100cqh * 9 / 16); transform: translateX(-50%); }
}
.stage__hud > * { pointer-events: auto; width: fit-content; }
.stage.is-idle .stage__hud { opacity: 0; }
.stage.is-idle .stage__hud > * { pointer-events: none; }
.hud__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-inline-start: -4px;
  padding-inline: 4px;
  font-size: 15px;
  font-weight: 600;
  color: #e3e3e6;
}
.hud__back:hover { color: #fff; }
.hud__title {
  margin-top: 2px;
  max-width: min(40ch, 100%);
  font: 800 clamp(20px, 1.7vw, 28px)/1.2 var(--f-display);
  letter-spacing: -0.01em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}
.hud__ep { margin-top: 4px; font-size: 14px; font-weight: 600; color: #e3e3e6; }

.stage__overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.72);
}
/* a subtitle line left on the last frame must not show through the card */
.stage:has(> .stage__overlay:not([hidden]):not([data-kind="loading"])) .stage__video::cue { visibility: hidden; }
.stage__overlay[data-kind="loading"] { background: rgba(0, 0, 0, 0.35); pointer-events: none; }
.ov {
  width: min(380px, 100%);
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  padding: 26px 22px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-2);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}
.stage__overlay[data-kind="loading"] .ov { background: none; border: 0; }
.ov .ico--alert { color: var(--red-text); }
.ov .ico--crown { color: var(--red-text); }
.ov__title { font-size: 20px; font-weight: 700; }
.stage__overlay[data-kind="next"] .ov__title { font: 800 26px/1.2 var(--f-display); letter-spacing: -0.01em; }
.ov__msg { color: var(--text-2); font-size: 15px; }
.ov__kicker { color: var(--text-2); font-size: 15px; }
.ov__num { font-weight: 800; color: #fff; }
.ov__actions { margin-top: 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.ov__bar {
  width: 100%;
  height: 4px;
  margin-top: 8px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
}
.ov__bar i {
  display: block;
  height: 100%;
  background: var(--red) var(--grad);
  transform-origin: left;
  animation: kd-drain linear forwards;
}

.spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: var(--red-text);
  animation: kd-spin 0.8s linear infinite;
}
.spinner--sm { flex: none; width: 18px; height: 18px; border-width: 2px; }
.stage.is-buffering::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: var(--red-text);
  animation: kd-spin 0.8s linear infinite;
  pointer-events: none;
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: 16px;
  background: var(--bg-2);
  border-inline-start: 1px solid var(--line);
}
.panel__ctrls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-inline: 16px; }
.ctrl {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r);
  background: var(--bg-3);
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.15s, color 0.15s;
}
.ctrl:hover:not(:disabled) { background: var(--bg-4); color: var(--red-text); }
.ctrl:disabled { opacity: 0.45; cursor: not-allowed; }
.panel > .toggle { padding: 6px 16px 0; font-size: 14px; }
/* Unduhan khusus admin: tombol membagi lebar sama rata, berapa pun yang tampil. */
.panel__admin { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.panel__kicker { margin: 0 16px 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.panel__admin .panel__ctrls { display: flex; }
.panel__admin .ctrl { flex: 1 1 0; min-width: 0; text-align: center; }
.panel__admin .ctrl[aria-busy="true"] { opacity: 1; cursor: progress; font-variant-numeric: tabular-nums; }
.panel__head { display: flex; align-items: baseline; gap: 10px; padding: 14px 16px 10px; border-top: 1px solid var(--line); margin-top: 10px; }
.panel__toggle { display: none; }
.panel__list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 16px 24px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.eplist--panel { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.eplist--panel .epi { min-height: 44px; }

/* ---------- Account: header menu ----------
   Gold stays the crown's colour: here it marks Premium (badge, avatar ring, status), nothing else. */

.acct { position: relative; display: flex; }
.acct:empty { display: none; }
/* sign-in: outlined, like iQIYI's "APP" button; the gold Premium button stays the louder one */
.acct__login {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--r);
  background: rgba(17, 19, 25, 0.2);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.acct__login:hover { border-color: var(--red-text); color: var(--red-text); }
/* a block box so a long sign-in label (other languages) ends in an ellipsis instead of widening the header */
.acct__login { display: block; max-width: 150px; line-height: 34px; overflow: hidden; text-overflow: ellipsis; }
.acct__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding-block: 0; padding-inline: 4px 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: none;
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.15s, background-color 0.15s;
}
.acct__btn:hover { background: rgba(255, 255, 255, 0.1); }
.acct__name { max-width: 128px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct__chev { transition: transform 0.2s var(--ease); }
.acct__btn[aria-expanded="true"] .acct__chev { transform: rotate(180deg); }

.avatar {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red) var(--grad);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}
.avatar.is-premium { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--gold); }
.avatar--lg { width: 56px; height: 56px; font-size: 22px; }
.avatar--tab { width: 24px; height: 24px; font-size: 11.5px; }
.avatar--tab.is-premium { box-shadow: 0 0 0 1.5px var(--bg), 0 0 0 3px var(--gold); }

/* real status label, not decoration; slight tracking keeps 11px caps legible */
.pbadge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-block: 4px; padding-inline: 6px 7px;
  border-radius: 3px;
  background: rgba(232, 192, 138, 0.15);
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

.acct__pop {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  width: 272px;
  padding: 8px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--r);
  /* elevation: floats above the hero like the source menu */
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}
.acct__who { padding: 8px 10px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.acct__whoName { font-weight: 700; overflow-wrap: anywhere; }
.acct__whoMail { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.acct__whoPlan { margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--gold); }
.acct__whoPlan.is-free { color: var(--text-3); }
.acct__opt {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: none;
  text-align: start;
  font-size: 15px;
}
.acct__opt .ico { color: var(--text-2); }
.acct__opt:hover { background: var(--bg-4); }
.acct__sep { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }

.tabbar__ico { display: grid; place-items: center; height: 24px; }

/* ---------- Toasts ---------- */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 16px);
  z-index: 60;
  width: min(460px, calc(100vw - 32px));
  display: grid;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-block: 6px; padding-inline: 14px 4px;
  border: 1px solid var(--line-2);
  border-inline-start: 3px solid var(--red);
  border-radius: var(--r);
  background: var(--bg-3);
  /* elevation: must read above any page content, including the player */
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
  animation: kd-in 0.22s var(--ease);
}
.toast--error { border-color: rgba(255, 111, 174, 0.55); }
.toast--error .toast__ico { color: var(--red-text); }
.toast__msg { flex: 1; min-width: 0; padding-block: 8px; font-size: 14.5px; line-height: 1.4; overflow-wrap: anywhere; }
.toast__x {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--text-2);
}
.toast__x:hover { color: #fff; background: var(--bg-4); }

/* Tawaran pasang aplikasi (PWA): menumpang di tumpukan toast supaya tidak saling tutup. */
.installbar { gap: 12px; padding-inline-start: 10px; }
.installbar__ico { flex: none; width: 40px; height: 40px; border-radius: 9px; }
.installbar__txt { flex: 1; min-width: 0; padding-block: 6px; }
.installbar__title { font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.installbar__sub { margin-top: 2px; color: var(--text-2); font-size: 13px; line-height: 1.35; }
.installbar .btn { flex: none; }
@media (max-width: 380px) {
  .installbar__sub { display: none; }
}

/* Tawaran aplikasi Android (APK): lembar bawah di ponsel, kotak di tengah pada layar lebar. */
.apkdlg {
  position: fixed;
  width: min(440px, 100%);
  max-width: 100%;
  max-height: calc(100dvh - 24px);
  margin: auto auto 0;
  padding: 22px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--line-2);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: var(--bg-2);
  color: var(--text);
  box-shadow: 0 -14px 40px rgba(0, 0, 0, 0.55);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: kd-in 0.22s var(--ease);
}
.apkdlg::backdrop { background: rgba(0, 0, 0, 0.62); }
.apkdlg:focus { outline: none; }
.apkdlg__x { position: absolute; inset-block-start: 8px; inset-inline-end: 8px; }
.apkdlg__head { display: flex; align-items: center; gap: 14px; padding-inline-end: 44px; }
.apkdlg__ico { flex: none; width: 56px; height: 56px; border-radius: 13px; }
.apkdlg__title { font-size: 18px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.apkdlg__sub { margin-top: 14px; color: var(--text-2); font-size: 14.5px; line-height: 1.5; }
.apkdlg__actions { display: grid; gap: 8px; margin-top: 20px; }
.apkdlg__steps:not(:empty) { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.apkdlg__stepsTitle { font-size: 14.5px; font-weight: 700; }
.apkdlg__list { display: grid; gap: 6px; margin-top: 8px; padding-inline-start: 22px; list-style: decimal; color: var(--text-2); font-size: 14.5px; line-height: 1.45; }
@media (min-width: 600px) {
  .apkdlg { margin: auto; padding-bottom: 22px; border-bottom: 1px solid var(--line-2); border-radius: 8px; }
}
body.has-modal { overflow: hidden; }
.apkbox .btn { margin-top: 14px; }

/* ---------- Forms ---------- */

.form { display: grid; gap: 16px; }
.form--tight { gap: 12px; }
.form__pair { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 12px; }
.form--inline { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; margin-top: 16px; }
.form--inline > .form__alert { flex-basis: 100%; }
.form--inline > .field { flex: 1 1 240px; min-width: 0; }
/* lines the button up with the input under its label (label line 21px + 6px gap) */
.form--inline > .btn { margin-top: 27px; }
.form--row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; align-items: start; gap: 12px; margin-top: 14px; }
.form--row > .form__alert { grid-column: 1 / -1; }
.form--row > .btn { margin-top: 27px; }

.field { display: grid; gap: 6px; min-width: 0; }
.field__label { font-size: 14px; font-weight: 600; }
.field__hint { font-size: 13px; line-height: 1.45; color: var(--text-3); }
.field__err { font-size: 13.5px; font-weight: 600; color: var(--red-text); }
.input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--bg-3);
  color: var(--text);
  font-size: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: var(--text-3); }
.input:placeholder-shown { text-overflow: ellipsis; }
/* focus: the outline is replaced by a white border + ring, brighter than the idle border */
.input:focus { outline: none; border-color: var(--red-text); box-shadow: 0 0 0 1px var(--red-text); }
.input[aria-invalid="true"] { border-color: var(--red-text); }
.input:disabled { opacity: 0.6; }
textarea.input { min-height: 96px; padding-block: 12px; line-height: 1.5; resize: vertical; }
.select {
  appearance: none;
  padding-inline-end: 40px;
  background: var(--bg-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a9a9ac' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 18px;
  cursor: pointer;
}
.input::-webkit-search-cancel-button { filter: invert(1); }
.mono, .input.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.02em; }
.input.mono { font-size: 15px; }

.field__pw { position: relative; }
.field__pw .input { padding-inline-end: 124px; }
.field__reveal {
  position: absolute;
  top: 2px;
  inset-inline-end: 2px;
  bottom: 2px;
  min-width: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 700;
}
.field__reveal:hover { color: #fff; }

.form__alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 111, 174, 0.5);
  border-radius: var(--r);
  background: rgba(214, 36, 111, 0.1);
  font-size: 14.5px;
  line-height: 1.45;
}
.form__alert .ico { margin-top: 1px; color: var(--red-text); }
.form__alert--info { border-color: var(--line-2); background: var(--bg-3); }
.form__alert--info .ico { color: var(--text-2); }
.form__note { font-size: 13.5px; line-height: 1.5; color: var(--text-2); }

.btnrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.btnrow--text { gap: 4px 14px; flex-wrap: nowrap; }

.loading { display: flex; align-items: center; gap: 10px; padding: 18px 0; color: var(--text-2); font-size: 15px; }
.empty-note {
  padding: 22px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--text-2);
  font-size: 15px;
  text-align: center;
}

/* ---------- Auth pages ---------- */

.auth { display: grid; justify-items: center; }
.auth__card {
  width: min(440px, 100%);
  padding: 30px 28px 28px;
  background: var(--grad) top / 100% 3px no-repeat, var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.auth__mark { display: block; color: var(--red-text); }
.auth__title { margin-top: 12px; font: 800 30px/1.15 var(--f-display); letter-spacing: -0.02em; }
.auth__sub { margin-top: 6px; color: var(--text-2); font-size: 15px; }
.auth__body { margin-top: 24px; display: grid; gap: 16px; }
.auth__alt { text-align: center; color: var(--text-2); font-size: 14.5px; }
.auth__alt a, .steps a, .stat__link, .tlink {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 255, 255, 0.45);
}
.auth__alt a { display: inline-flex; align-items: center; min-height: 44px; }
.auth__alt a:hover, .steps a:hover, .stat__link:hover, .tlink:hover { text-decoration-color: #fff; }
.or { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.social { display: grid; gap: 12px; }
/* 320px phones: keep "Masuk dengan Facebook" on one line */
@media (max-width: 359px) {
  .social .btn { gap: 6px; padding-inline: 10px; font-size: 13.5px; }
}

/* ---------- Account page ---------- */

.acct-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 24px 40px;
  align-items: start;
}
.acct-main, .acct-side { display: grid; gap: 20px; min-width: 0; }

.box {
  min-width: 0;
  padding: 22px 22px 24px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.box__title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.box__title--gap { margin-bottom: 14px; }
.box__title + .form, .box__sub + .form:not(.form--inline) { margin-top: 16px; }
.box__title[tabindex="-1"]:focus, .apanel__title:focus { outline: none; }
.box__sub { margin-top: 4px; color: var(--text-2); font-size: 14.5px; line-height: 1.5; max-width: 70ch; }
.box__kicker { font-size: 14px; font-weight: 700; color: var(--text-2); }

/* the status card is the page's focal point: the one big line on the page */
.status { padding-block: 22px 26px; }
.status.is-premium { border-color: rgba(232, 192, 138, 0.5); background: linear-gradient(135deg, rgba(232, 192, 138, 0.1), rgba(232, 192, 138, 0) 55%), var(--bg-2); }
.status__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; }
.status__top .textbtn { margin-inline-end: -4px; }
.status__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.status__line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  font: 800 clamp(24px, 2.2vw, 32px)/1.2 var(--f-display);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.status__crown { color: var(--gold); margin-top: -0.1em; }
.status__note { margin-top: 10px; color: var(--text-2); font-size: 15px; max-width: 62ch; }

.paynote {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 16px;
  padding-block: 10px; padding-inline: 14px 10px;
  border-radius: var(--r);
  background: var(--bg-3);
}
.paynote__text { font-size: 14.5px; line-height: 1.45; min-width: 0; }
.paynote__text strong { overflow-wrap: anywhere; }

.plans-slot { margin-top: 16px; }
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.plan {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 18px;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  transition: border-color 0.15s;
}
.plan:hover { border-color: rgba(232, 192, 138, 0.55); }
.plan__name { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.plan__price { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; font: 800 30px/1.1 var(--f-display); letter-spacing: -0.02em; color: var(--gold); }
.plan__cur { font: 700 15px/1 var(--f-ui); letter-spacing: 0; color: var(--text-2); }
.plan__days { color: var(--text-2); font-size: 14px; font-weight: 600; }
.plan__desc { margin-top: 6px; color: var(--text-2); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.plan__buy { margin-top: auto; }
.plan__desc + .plan__buy, .plan__days + .plan__buy { margin-top: 14px; }
.plan__na { margin-top: 14px; color: var(--text-3); font-size: 13.5px; }

.profile__id { display: flex; align-items: center; gap: 14px; }
.profile__text { min-width: 0; }
.profile__name { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.profile__mail { color: var(--text-2); font-size: 14.5px; overflow-wrap: anywhere; }
.facts { margin: 18px 0 0; display: grid; gap: 0; }
.facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.facts dt { color: var(--text-2); }
.facts dd { margin: 0; font-weight: 600; text-align: end; }
.profile .btn { margin-top: 16px; }

/* ---------- Tables ---------- */

.tbl-wrap {
  /* containing block for .sr-only hints in cells, so they scroll with the table instead of widening the page */
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overscroll-behavior-x: contain;
}
.tbl-wrap:focus-visible { outline-offset: 2px; }
/* a table wider than the screen fades out at its end edge until scrolled there (no fade when it fits) */
@supports (animation-timeline: scroll()) {
  .tbl-wrap { animation: tbl-fade linear both; animation-timeline: scroll(self inline); }
  [dir="rtl"] .tbl-wrap { animation-name: tbl-fade-rtl; }
  .tbl-wrap:focus-visible { animation: none; } /* the mask would clip the focus ring */
  @keyframes tbl-fade {
    0%, 96% { mask-image: linear-gradient(to left, transparent, #000 40px); }
    100% { mask-image: none; }
  }
  @keyframes tbl-fade-rtl {
    0%, 96% { mask-image: linear-gradient(to right, transparent, #000 40px); }
    100% { mask-image: none; }
  }
}
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  padding: 10px 12px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 700;
  text-align: start;
  white-space: nowrap;
}
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.45; }
.tbl tbody tr:hover > td { background: rgba(255, 255, 255, 0.025); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl .nowrap { white-space: nowrap; }
.tbl .textbtn { min-height: 32px; font-size: 13.5px; }
.tbl .toggle { min-height: 32px; }
.tbl .tlink { display: inline-flex; align-items: center; min-height: 24px; padding-block: 2px; }
.cell-strong { font-weight: 600; overflow-wrap: anywhere; }
.cell-plan { min-width: 180px; }
.cell-sub { display: block; margin-top: 2px; color: var(--text-3); font-size: 12.5px; }
.cell-ref { max-width: 160px; overflow-wrap: anywhere; font-size: 12.5px; }
.cell-wide { min-width: 220px; }
.tbl__edit > td { padding: 16px 12px 20px; background: var(--bg); }
/* editor rows sit inside a scrolling table: pin their content to the visible width */
.sticky-cell { position: sticky; inset-inline-start: 12px; width: min(100%, calc(100vw - 2 * var(--gutter) - 26px)); }
.t-gold { color: var(--gold); font-weight: 700; }
.t-muted { color: var(--text-3); }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 2px;
  background: var(--bg-4);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}
.chip--gold { background: rgba(232, 192, 138, 0.15); color: var(--gold); }
.chip--ok { background: rgba(74, 222, 128, 0.13); color: #6ee7a0; }
.chip--warn { background: rgba(251, 146, 60, 0.14); color: var(--warn); }
.chip--bad { background: rgba(214, 36, 111, 0.16); color: var(--red-text); }
.chip--muted { background: none; border: 1px solid var(--line-2); color: var(--text-2); padding-block: 2px; }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: 12px; }
.pager__at { color: var(--text-2); font-size: 14px; }
.acount { margin-bottom: 10px; color: var(--text-2); font-size: 14px; }

/* ---------- Admin ---------- */

.atabs {
  margin: -8px 0 24px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.atabs::-webkit-scrollbar { display: none; }
.atabs ul { display: flex; gap: 2px; min-width: max-content; }
.atabs__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.15s;
}
.atabs__link:hover { color: #fff; }
.atabs__link[aria-current="page"] { color: #fff; }
.atabs__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset-inline: 10px;
  bottom: -1px;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--red) var(--grad);
}
.atabs__link:focus-visible { outline-offset: -4px; }

.apanel__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 18px; }
.apanel__text { min-width: 0; max-width: 78ch; }
.apanel__title { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.apanel__sub { margin-top: 4px; color: var(--text-2); font-size: 14.5px; line-height: 1.5; }
.asub { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 28px 0 12px; }
h3.asub { display: block; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 12px; }
.stat { padding: 18px 20px 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); }
.stat__num { font: 800 36px/1.1 var(--f-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat__label { margin-top: 2px; color: var(--text-2); font-size: 14.5px; font-weight: 600; }
.stat__link { display: inline-flex; align-items: center; min-height: 36px; margin-top: 6px; font-size: 14px; }
.stat.is-warn { border-color: rgba(251, 146, 60, 0.55); }
.stat.is-warn .stat__num { color: var(--warn); }

.atool { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; max-width: 560px; margin-bottom: 16px; }
.atool > .input { flex: 1 1 220px; min-width: 0; }
.atool > .field { flex: 0 1 300px; }

.split { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 24px; align-items: start; }
.split__list { min-width: 0; }

.manage { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 20px 28px; }
.manage__group { display: grid; gap: 10px; align-content: start; min-width: 0; }
.manage__title { font-size: 14px; font-weight: 700; }
.manage__now { color: var(--text-2); font-size: 14px; }

.result { margin-top: 16px; }
.result .apanel__head { margin-bottom: 12px; align-items: center; }
.codes {
  margin: 0;
  max-height: 280px;
  overflow: auto;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  font-size: 14.5px;
  line-height: 1.75;
  white-space: pre;
}
.codebox {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 10px;
  padding-block: 10px; padding-inline: 14px 10px;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
}
.codebox code { flex: 1 1 260px; min-width: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.steps { list-style: decimal; margin: 16px 0 12px; padding-inline-start: 1.4em; display: grid; gap: 6px; color: var(--text-2); font-size: 14.5px; line-height: 1.5; }
.steps strong { color: var(--text); }
.raw {
  margin: 0;
  max-height: 420px;
  overflow: auto;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre;
}
.pick { margin-top: 4px; }
.pick__list { display: grid; gap: 6px; max-width: 640px; }
.pick__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-block: 8px; padding-inline: 12px 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.pick__who { display: grid; min-width: 0; font-size: 14px; }
.pick__who strong { overflow-wrap: anywhere; }
.pick__who span { color: var(--text-2); font-size: 13px; }
.settings { max-width: 760px; }
.settings .box { display: grid; gap: 14px; }

/* admin > Iklan: satu baris per unit, teks di sisi awal, sakelar di sisi akhir */
.adpanel { display: grid; gap: 16px; max-width: 760px; }
.adpanel .box { display: grid; gap: 4px; }
.adunits__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; min-height: 44px; }
.adunits__status { font-size: 15px; font-weight: 600; }
.adunit { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; border-top: 1px solid var(--line); }
.adunit:first-child { border-top: 0; padding-top: 10px; }
.adunit:last-child { padding-bottom: 0; }
.adunit__text { flex: 1 1 auto; min-width: 0; }
.adunit__name { font-size: 15.5px; font-weight: 700; overflow-wrap: anywhere; }
.adunit__desc { margin-top: 3px; max-width: 62ch; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.adunit .toggle { flex: none; }

/* ---------- Footer & tab bar ---------- */

.foot { margin-top: 32px; background: #0c0e13; border-top: 1px solid var(--line); }
.foot__inner { max-width: 1680px; margin-inline: auto; padding: 32px var(--gutter) 36px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 24px; }
.foot__brand {
  font: 800 20px/1.2 var(--f-display);
  letter-spacing: -0.02em;
  color: var(--red-text);
  background: linear-gradient(90deg, #ff6fae, #b56cff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.foot__note { color: var(--text-3); font-size: 13px; line-height: 1.6; max-width: 70ch; }
.foot__links { display: flex; flex-wrap: wrap; gap: 0 24px; width: 100%; margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); font-size: 13px; }
.foot__links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-2); text-decoration: none; }
.foot__links a:hover { color: #fff; }

.tabbar { display: none; }

.noscript { padding: calc(var(--top-h) + 40px) var(--gutter); color: var(--text-2); }

/* ---------- Mobile ---------- */

@media (max-width: 768px) {
  .brand__logo { height: 26px; }
  .nav { display: none; }
  .tools { gap: 4px; }
  .vip { display: none; }
  .search { border: 0; height: 44px; background: none; }
  .search:hover, .search:focus-within, .search.is-open { background: none; border: 0; }
  .search .iconbtn { width: 40px; height: 44px; color: #fff; }
  .search input { display: none; }
  .lng__btn { min-width: 40px; width: 40px; height: 44px; }
  .lng__btn .ico { width: 22px; height: 22px; }
  .lng__btn .iconbtn__label { display: none; }
  .src__label { display: none; }
  .src__btn { min-height: 40px; padding-block: 0; padding-inline: 10px 6px; font-size: 13px; }
  /* fits "Toutes les sources" / "Todas las fuentes" at this size; on narrow phones the picker shrinks to the room left (ellipsis) */
  .src__current { max-width: 128px; }
  .src__pop { position: fixed; inset-inline-start: 12px; inset-inline-end: 12px; top: calc(var(--top-h) + 4px); width: auto; }

  .tabbar {
    position: fixed;
    inset: auto 0 0;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(17, 19, 25, 0.96);
    border-top: 1px solid var(--line);
  }
  @supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .tabbar { background: rgba(17, 19, 25, 0.86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
  }
  .tabbar__link {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-3);
  }
  .tabbar__link[aria-current="page"] { color: var(--red-text); font-weight: 700; }
  .tabbar__link[aria-current="page"]::before {
    content: "";
    position: absolute;
    top: -1px;
    inset-inline-start: 32%;
    inset-inline-end: 32%;
    height: 3px;
    border-radius: 0 0 2px 2px;
    background: var(--red) var(--grad);
  }
  .tabbar__link:focus-visible { outline-offset: -4px; }

  body[data-route="watch"] { --tab-h: 0px; }
  body[data-route="watch"] .tabbar { display: none; }

  /* hero: the cover runs edge to edge under the transparent header, copy over its faded bottom */
  .hero { min-height: 0; display: block; padding: 0; }
  .hero__backdrop { display: none; }
  /* only a top fade remains, so the logo and header icons stay readable over bright covers */
  .hero__shade {
    inset: 0 0 auto;
    height: 120px;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(17, 19, 25, 0.75) 0%, rgba(17, 19, 25, 0) 100%);
  }
  .hero__inner { padding: 0; }
  .hero__card { position: relative; display: grid; grid-template-columns: 1fr; }
  .hero__poster, .hero__copy { grid-area: 1 / 1; }
  .hero__poster { position: relative; inset: auto; z-index: auto; width: 100%; max-width: none; aspect-ratio: auto; }
  .hero__poster .art {
    height: auto;
    aspect-ratio: 4 / 5;
    -webkit-mask: linear-gradient(180deg, #000 55%, transparent 100%);
    mask: linear-gradient(180deg, #000 55%, transparent 100%);
  }
  .hero__poster .art img { object-position: 50% 15%; }
  .hero__copy {
    align-self: end;
    z-index: 1;
    max-width: none;
    padding: 120px var(--gutter) 4px;
    /* near-opaque by the time the title starts (after the 120px lead-in), so a cover's baked-in title does not ghost through */
    background: linear-gradient(180deg, rgba(17, 19, 25, 0) 0%, rgba(17, 19, 25, 0.86) 30%, rgba(17, 19, 25, 0.97) 44%, var(--bg) 100%);
  }
  .hero__kicker { margin-top: 10px; font-size: 12px; }
  .hero__title { font-size: clamp(22px, 6.6vw, 30px); -webkit-line-clamp: 2; }
  .hero__meta { margin-top: 8px; font-size: 12.5px; }
  .hero__syn { display: none; }
  .hero__actions { margin-top: 14px; gap: 10px 22px; }
  .hero__actions .btn { min-height: 48px; font-size: 14px; gap: 10px; }
  .hero__actions .btn .ico { width: 46px; height: 46px; padding: 13px; }
  .hero__actions .btn--white .ico { padding: 13px 11px 13px 15px; }
  .hero__dots { position: static; justify-content: center; margin-top: 2px; }
  .hero--sk .hero__copy { background: none; }
  .hero--sk { min-height: 0; }

  .home__rows { margin-top: 8px; padding-bottom: 24px; }
  .row { margin-top: 20px; }
  .row__head { min-height: 28px; gap: 10px; }
  .row__title { font-size: 17px; }
  .row__track { padding: 8px var(--gutter) 10px; }
  .card__title { margin-top: 6px; font-size: 13px; }
  .card__meta { font-size: 11px; padding-top: calc(133.333% - 23px); line-height: 16px; height: 16px; padding-inline: 6px; }
  .card__link:has(.card__progress) .card__meta { padding: 0 6px 10px; }
  /* "Hapus riwayat" wraps under the title: line its text up with the title's edge */
  .page__head > .textbtn { margin-inline-start: -4px; }
  .card__badge { font-size: 11px; padding: 3px 6px; }
  /* narrow mixed-row cards: the source name matters more than the episode count */
  .card__src ~ .dot, .card__src ~ .card__eps { display: none; }
  .home__sentinel { margin-top: 18px; }
  .srcjump__chip { min-height: 40px; font-size: 13px; padding-inline-end: 12px; }
  .srcjump__thumb { width: 24px; }
  .row--srcjump .row__track { padding-block: 8px 2px; gap: 8px; }

  .page { padding-top: calc(var(--top-h) + 20px); padding-bottom: 32px; }
  .page__head { flex-wrap: wrap; align-items: flex-start; margin-bottom: 20px; }
  .page__title { font-size: 24px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 8px; }
  .bigsearch { padding-inline-start: 12px; }
  .bigsearch__input { font-size: 16px; }
  .bigsearch__go { padding-inline: 16px; }

  .detail__hero { min-height: 0; display: block; padding: calc(var(--top-h) + 16px) var(--gutter) 20px; }
  .detail__hero::after { background: linear-gradient(0deg, var(--bg) 6%, rgba(17, 19, 25, 0.55) 55%, rgba(17, 19, 25, 0.75) 100%); }
  .detail__head { grid-template-columns: 1fr; gap: 18px; }
  .detail__poster { width: min(44vw, 200px); }
  .detail__title { font-size: clamp(22px, 6.4vw, 30px); }
  .detail__actions { display: grid; grid-template-columns: 1fr; }
  .detail__eps { padding: 12px var(--gutter) 32px; }
  .eplist:not(.eplist--panel) { grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; }
  .epi { min-height: 44px; }

  .watch { display: block; height: auto; background: var(--bg); }
  .stage { height: min(calc(100vw * 16 / 9), calc(100vh - var(--top-h) - 64px)); }
  .stage { height: min(calc(100vw * 16 / 9), calc(100svh - var(--top-h) - 64px)); }
  .stage__hud { padding: 8px 16px 48px; }
  .hud__back span { font-size: 14px; }
  .hud__title { font-size: 19px; max-width: 100%; }
  .hud__ep { font-size: 13.5px; margin-top: 2px; }
  .ov { padding: 20px 16px 16px; }
  .panel { border-inline-start: 0; padding-top: 12px; background: var(--bg); }
  .panel__head { display: none; }
  .panel__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    margin: 12px 16px 0;
    padding: 0 14px;
    border: 0;
    border-radius: var(--r);
    background: var(--bg-3);
    font-size: 15px;
    font-weight: 600;
    text-align: start;
  }
  .panel__toggle span { flex: 1; }
  .panel__chev { transition: transform 0.2s var(--ease); }
  .panel__toggle[aria-expanded="true"] .panel__chev { transform: rotate(180deg); }
  .panel:not(.is-open) .panel__list { display: none; }
  .panel__list { max-height: 62svh; padding: 10px 16px 24px; }

  /* account lives in the bottom tab bar on phones; the header keeps brand, search and source */
  .acct { display: none; }
  .auth { padding-top: calc(var(--top-h) + 16px); }
  .auth__card { padding: 24px 18px 22px; }
  .auth__title { font-size: 26px; }
  .box { padding: 18px 16px 20px; }
  .status__line { font-size: clamp(22px, 6.4vw, 28px); gap: 10px; }
  .form__pair { grid-template-columns: 1fr; }
  .form--row { grid-template-columns: 1fr; }
  .form--row > .btn, .form--inline > .btn { margin-top: 0; width: 100%; }
  .apanel__title { font-size: 21px; }
  .stat__num { font-size: 30px; }
  .atool { max-width: none; }
  .atool > .field { flex: 1 1 100%; }
  .atabs { margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .tbl { font-size: 13.5px; }
  .tbl__edit > td { padding-inline: 8px; }
  .sticky-cell { inset-inline-start: 8px; width: min(100%, calc(100vw - 2 * var(--gutter) - 18px)); }
  .paynote { padding: 12px; }
  .paynote .btn { width: 100%; }
}

/* narrow phones: the bottom tab bar already has Search, so the header drops its magnifier for room */
@media (max-width: 420px) {
  .search { display: none; }
  .brand__logo { height: 24px; }
}

/* account and admin columns stack before they get cramped */
@media (max-width: 1000px) {
  .acct-grid { grid-template-columns: minmax(0, 1fr); }
}
/* admin plans: the plan table needs ~760px beside the 300-400px form, or its actions fall off-screen */
@media (max-width: 1280px) {
  .split { grid-template-columns: minmax(0, 1fr); }
}

/* phones held sideways: the player takes the full height, the episode panel sits beside it */
@media (max-height: 500px) and (orientation: landscape) {
  .watch {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(220px, 36vw, 320px);
    height: calc(100vh - var(--top-h) - var(--tab-h));
    height: calc(100dvh - var(--top-h) - var(--tab-h));
    background: #000;
  }
  .stage { height: auto; }
  /* the 9:16 video is narrow here: the HUD spans the stage, its title stays in the dark bar beside the video */
  .stage__hud { left: 0; width: 100%; transform: none; padding: 4px 12px 24px; }
  .hud__back { min-height: 40px; }
  .hud__title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: auto; max-width: max(120px, calc(50cqw - 100cqh * 9 / 32 - 16px)); }
  .hud__ep { font-size: 12.5px; margin-top: 0; }
  /* an open card (error, ended, next) needs the room: the HUD keeps only its back link */
  .stage:has(> .stage__overlay:not([hidden]):not([data-kind="loading"])) :is(.hud__title, .hud__ep) { display: none; }
  .stage__overlay { padding: 48px 12px 8px; }
  .ov { gap: 6px; padding: 12px 14px; }
  .ov > .ico { display: none; }
  .ov__title { font-size: 17px; }
  .stage__overlay[data-kind="next"] .ov__title { font-size: 20px; }
  .ov__msg, .ov__kicker { font-size: 13px; line-height: 1.4; }
  .ov__actions { margin-top: 4px; }
  .panel { overflow-y: auto; padding-top: 8px; border-inline-start: 1px solid var(--line); background: var(--bg-2); }
  .panel__toggle { display: none; }
  .panel__head { display: flex; padding: 10px 16px 6px; }
  .panel:not(.is-open) .panel__list, .panel__list { display: block; max-height: none; overflow: visible; padding: 6px 12px 16px; }
  .panel__ctrls { padding-inline: 12px; }
  .panel > .toggle { padding-inline: 12px; font-size: 13px; }
}

@media (max-width: 359px) {
  .brand__logo { height: 20px; }
  .tools { gap: 2px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* a floor for the source picker, so switching between short and long source names does not shift the header */
@media (min-width: 901px) {
  .src__btn { min-width: 146px; } /* "Semua sumber" without its label */
}
@media (min-width: 1321px) {
  .src__btn { min-width: 210px; } /* "Sumber: Semua sumber" */
}
/* long labels (fr, de, es): the always-on search box gives up width first, the source name only after it */
@media (min-width: 1201px) {
  .search { min-width: 150px; }
  .search .iconbtn { flex-shrink: 0; }
  /* near-zero: the source picker only shrinks once the search box has reached its minimum */
  .src { flex-shrink: 0.001; }
}
/* small desktop: a narrower always-on search box */
@media (min-width: 1201px) and (max-width: 1320px) {
  .search input { width: 140px; }
  .nav { margin-inline-start: 20px; }
  .nav__link { padding-inline: 10px; }
  .src__label { display: none; }
  .acct__name { display: none; }
  .lng__btn .iconbtn__label { display: none; }
  .lng__btn { min-width: 44px; }
}
/* tablet band: the search box folds back into its magnifier (it opens on click), labels drop away */
@media (min-width: 769px) and (max-width: 1200px) {
  .brand__logo { height: 28px; }
  .nav { margin-inline-start: 16px; }
  .src__label { display: none; }
  .acct__name { display: none; }
  .lng__btn .iconbtn__label { display: none; }
  .lng__btn { min-width: 44px; }
  .search { background: none; }
  .search input { width: 0; padding-inline: 0; }
  .search.is-open input { width: 180px; padding-inline: 12px 0; }
  /* no room for both: while the box is open it takes the source picker's place, and narrows if it must */
  .search.is-open { min-width: 0; }
  .search.is-open ~ .src { display: none; }
  .search:not(.is-open):focus-within { background: none; border-color: transparent; }
  .vip { padding-inline: 10px; }
  .vip span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  /* copy and the sharp cover each keep their own half, so the cover's baked-in title never sits under the hero title */
  .hero__copy { max-width: 460px; }
  .hero__poster { max-width: 50%; }
  .hero__shade {
    background:
      linear-gradient(90deg, rgba(17, 19, 25, 0.97) 0%, rgba(17, 19, 25, 0.88) 40%, rgba(17, 19, 25, 0.35) 62%, rgba(17, 19, 25, 0) 78%),
      linear-gradient(0deg, var(--bg) 0%, rgba(17, 19, 25, 0.72) 16%, rgba(17, 19, 25, 0) 42%),
      linear-gradient(180deg, rgba(17, 19, 25, 0.55) 0%, rgba(17, 19, 25, 0) 18%);
  }
  html[dir="rtl"] .hero__shade {
    background:
      linear-gradient(270deg, rgba(17, 19, 25, 0.97) 0%, rgba(17, 19, 25, 0.88) 40%, rgba(17, 19, 25, 0.35) 62%, rgba(17, 19, 25, 0) 78%),
      linear-gradient(0deg, var(--bg) 0%, rgba(17, 19, 25, 0.72) 16%, rgba(17, 19, 25, 0) 42%),
      linear-gradient(180deg, rgba(17, 19, 25, 0.55) 0%, rgba(17, 19, 25, 0) 18%);
  }
}
/* narrowest desktop header: long labels (fr "Toutes les sources", "Se connecter") plus the language button */
@media (min-width: 769px) and (max-width: 900px) {
  .brand__logo { height: 26px; }
  .nav { margin-inline-start: 8px; }
  .nav__link { padding-inline: 6px; }
  .tools { gap: 4px; }
  .acct__login { padding-inline: 12px; }
}
/* the Premium shortcut costs too much room here; it stays reachable from the account menu and #/akun */
@media (min-width: 769px) and (max-width: 1000px) {
  .vip { display: none; }
}

/* ---------- Motion ---------- */

@keyframes kd-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes kd-drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes kd-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes kd-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes kd-spin { to { transform: rotate(360deg); } }
@keyframes kd-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero__dot.is-on b { animation: none; transform: scaleX(1); }
  .hero.is-swap .hero__copy,
  .hero.is-swap .hero__poster img,
  .hero.is-swap .hero__backdrop img { animation: none; }
  .sk { animation: none; }
  .ov__bar i { animation: none; }
  .toast, .apkdlg { animation: none; }
  .spinner, .stage.is-buffering::after { animation-duration: 2.4s; }
  .card:hover { transform: none; }
  .hero__actions .btn:hover .ico { transform: none; }
}

/* ---- iklan ---- */
.adslot { margin: 8px var(--gutter, 16px) 24px; padding: 10px 12px 12px; border: 1px solid var(--line, #2a2d36); border-radius: 4px; background: var(--bg-2, #1a1c24); max-width: 100%; overflow: hidden; }
.adslot__label { margin: 0 0 6px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2, #a9a9ac); }
.adslot iframe, .adslot img { max-width: 100%; }
.adlink { padding-inline: 16px; margin-top: 4px; }
.adlink__btn { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border: 1px dashed var(--line, #2a2d36); border-radius: 6px; color: var(--text, #f5f5f7); text-decoration: none; font-size: 14px; }
.adlink__btn:hover { background: var(--bg-3, #23252b); }
.adlink__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.adlink__tag { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2, #a9a9ac); border: 1px solid currentColor; border-radius: 3px; padding: 1px 5px; }

/* iklan video pre-roll */
.vastad { position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; background: #000; }
.vastad__video { width: 100%; height: 100%; object-fit: contain; cursor: pointer; }
.vastad__bar { position: absolute; top: 12px; inset-inline-start: 12px; inset-inline-end: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vastad__label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; background: rgba(0, 0, 0, 0.7); border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 3px; padding: 2px 6px; }
.vastad__sound, .vastad__visit { min-height: 36px; padding: 6px 12px; border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 4px; background: rgba(0, 0, 0, 0.7); color: #fff; font: 600 13px/1.2 var(--f-ui, inherit); text-decoration: none; cursor: pointer; }
.vastad__foot { position: absolute; inset-inline-start: 12px; inset-inline-end: 12px; bottom: 72px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.vastad__status { margin: 0; padding: 8px 12px; border-radius: 4px; background: rgba(0, 0, 0, 0.8); color: #fff; font: 700 14px/1.2 var(--f-ui, inherit); }
.vastad__skip { min-height: 44px; padding: 10px 16px; border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 4px; background: rgba(0, 0, 0, 0.8); color: #fff; font: 700 14px/1.2 var(--f-ui, inherit); cursor: pointer; }
.vastad__premium { min-height: 44px; display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 4px; background: rgba(0, 0, 0, 0.8); color: #f3d5ad; font: 600 13px/1.2 var(--f-ui, inherit); text-decoration: underline; text-underline-offset: 3px; }
.vastad__premium:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.vastad__skip:focus-visible, .vastad__sound:focus-visible, .vastad__visit:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---- right-to-left (Arabic): logical properties above cover spacing and anchoring; these mirror the rest ---- */
[dir="rtl"] .ico--dir { transform: scaleX(-1); }
[dir="rtl"] .row__more:hover .ico { transform: scaleX(-1) translateX(2px); }
[dir="rtl"] .row__arrow:hover .ico--dir { transform: scaleX(-1) scale(1.15); }
/* side shade only where the copy sits beside the art; phones keep their bottom fade */
@media (min-width: 769px) {
  [dir="rtl"] .hero__shade {
    background:
      linear-gradient(270deg, rgba(17, 19, 25, 0.97) 0%, rgba(17, 19, 25, 0.82) 28%, rgba(17, 19, 25, 0.25) 52%, rgba(17, 19, 25, 0) 66%),
      linear-gradient(0deg, var(--bg) 0%, rgba(17, 19, 25, 0.72) 16%, rgba(17, 19, 25, 0) 42%),
      linear-gradient(180deg, rgba(17, 19, 25, 0.55) 0%, rgba(17, 19, 25, 0) 18%);
  }
  [dir="rtl"] .hero__poster .art {
    -webkit-mask: linear-gradient(270deg, transparent 0%, #000 34%);
    mask: linear-gradient(270deg, transparent 0%, #000 34%);
  }
}
[dir="rtl"] .hero__syn.is-loading {
  -webkit-mask: linear-gradient(270deg, #000 70%, transparent);
  mask: linear-gradient(270deg, #000 70%, transparent);
}
[dir="rtl"] .hero__dot b,
[dir="rtl"] .ov__bar i { transform-origin: right; }
[dir="rtl"] .row__arrow--prev { border-radius: var(--r) 0 0 var(--r); }
[dir="rtl"] .row__arrow--next { border-radius: 0 var(--r) var(--r) 0; }
[dir="rtl"] .row__item:first-child .card { transform-origin: 100% 40%; }
[dir="rtl"] .row__item:last-child .card { transform-origin: 0 40%; }
[dir="rtl"] .row--top .row__item:first-child .card { transform-origin: 50% 40%; }
[dir="rtl"] .toggle input:checked + .toggle__track::after { transform: translateX(-18px); }
[dir="rtl"] .select { background-position: left 12px center; }
/* the video timeline and native controls stay left-to-right */
[dir="rtl"] .stage__video { direction: ltr; }
/* addresses are typed left-to-right; keep them aligned with the Arabic labels */
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="url"] { direction: ltr; text-align: right; }
