/* ===== Lentera — gaya utama (tema gelap, responsif) ===== */

@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 400; font-display: swap; src: url('../fonts/pjs-400.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 500; font-display: swap; src: url('../fonts/pjs-500.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 600; font-display: swap; src: url('../fonts/pjs-600.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 700; font-display: swap; src: url('../fonts/pjs-700.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 800; font-display: swap; src: url('../fonts/pjs-800.woff2') format('woff2'); }

:root {
  --bg: #0b0d12;
  --bg-2: #10131a;
  --surface: #161a23;
  --surface-2: #1e2330;
  --surface-3: #262c3b;
  --border: rgba(255, 255, 255, 0.08);
  --text: #eef0f4;
  --text-2: #b7bdc9;
  --muted: #8a91a1;
  --accent: #ef5b4a;
  --accent-2: #ff7360;
  --accent-soft: rgba(239, 91, 74, 0.16);
  --gold: #f5c451;
  --radius: 14px;
  --radius-lg: 22px;
  --pad: 16px;
  --card-w: 148px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  --font: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: dark;
}
@media (min-width: 720px) { :root { --pad: 28px; --card-w: 172px; } }
@media (min-width: 1100px) { :root { --pad: 36px; --card-w: 184px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(66px + env(safe-area-inset-bottom));
}
@media (min-width: 720px) { body { padding-bottom: 0; } }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: min(1280px, 100% - 2 * var(--pad)); margin-inline: auto; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(11, 13, 18, 0.72);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.topbar__inner { display: flex; align-items: center; gap: 12px; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; margin-right: 4px; }
.brand__logo { width: 26px; height: 26px; color: var(--accent); stroke-width: 1.8; }
.nav { display: none; gap: 2px; }
.nav a { padding: 8px 13px; border-radius: 999px; color: var(--text-2); font-weight: 500; font-size: 14.5px; transition: background .15s, color .15s; }
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.nav a.active { color: var(--text); background: var(--surface-2); }
.search { position: relative; display: none; width: 100%; order: 3; }
.search__icon { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.search__input {
  width: 100%; height: 40px; padding: 0 14px 0 42px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; color: var(--text);
  transition: border-color .15s, background .15s;
}
.search__input::placeholder { color: var(--muted); }
.search__input:focus { outline: none; border-color: rgba(239, 91, 74, 0.6); background: var(--surface-2); }
.search__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.topbar.search-open .search { display: block; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: var(--text-2); transition: background .15s, color .15s; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.search-toggle { margin-left: auto; }
@media (min-width: 720px) {
  .topbar__inner { gap: 18px; height: 64px; flex-wrap: nowrap; padding-block: 0; }
  .nav { display: flex; }
  .search { display: block; order: 0; width: min(380px, 100%); margin-left: auto; }
  .search-toggle { display: none; }
}

/* ---------- Tab bar (HP) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; padding-bottom: env(safe-area-inset-bottom);
  background: rgba(13, 15, 21, 0.9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 0 9px; font-size: 11px; font-weight: 500; color: var(--muted); transition: color .15s; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.active { color: var(--accent-2); }
@media (min-width: 720px) { .tabbar { display: none; } }

/* ---------- Utilitas ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.3;
  background: rgba(255, 255, 255, 0.1); color: var(--text); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.chip--xs { padding: 2px 7px; font-size: 11px; }
.chip--accent { background: var(--accent); color: #fff; }
.chip--soft { background: var(--accent-soft); color: var(--accent-2); }
.chip--gold { color: var(--gold); }
.chip svg { width: 13px; height: 13px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 12px; font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: background .15s, transform .15s, color .15s;
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-2); }
.btn--ghost { background: rgba(255, 255, 255, 0.09); color: var(--text); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.15); }
.btn--sm { height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn--icon { width: 44px; padding: 0; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.is-on { background: var(--accent-soft); color: var(--accent-2); }
.btn.is-on svg { fill: currentColor; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); font-size: 13.5px; }
.meta .dot::before { content: '·'; margin-right: 10px; }
.rating { color: var(--gold); font-weight: 600; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.select {
  height: 38px; padding: 0 34px 0 14px; border-radius: 10px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a91a1' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 10px center / 18px;
  border: 1px solid var(--border); color: var(--text); appearance: none; -webkit-appearance: none;
}
.select:focus { outline: none; border-color: rgba(239, 91, 74, 0.6); }

/* ---------- Gambar & placeholder ---------- */
.img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s ease; }
.img.loaded { opacity: 1; }
.ph {
  position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 12px;
  background: linear-gradient(160deg, var(--ph-a, #2a3040), var(--ph-b, #161a23));
  color: rgba(255, 255, 255, 0.8); font-weight: 700; font-size: 14px; line-height: 1.25;
}
.card__poster .ph, .detail__poster .ph { padding-bottom: 34px; }
.ph::before { content: attr(data-initial); position: absolute; right: 8px; top: 2px; font-size: 64px; font-weight: 800; color: rgba(255, 255, 255, 0.08); letter-spacing: -0.04em; }

/* ---------- Hero ---------- */
.hero {
  position: relative; margin-top: 16px; border-radius: var(--radius-lg); overflow: hidden;
  min-height: 300px; height: min(62vw, 520px); background: var(--surface); box-shadow: var(--shadow);
  isolation: isolate;
}
@media (min-width: 720px) { .hero { margin-top: 22px; height: clamp(360px, 42vw, 540px); } }
.hero__slide { position: absolute; inset: 0; opacity: 0; transition: opacity .7s ease; }
.hero__slide.active { opacity: 1; z-index: 1; }
.hero__slide .img, .hero__slide .ph { position: absolute; inset: 0; }
.hero__slide .img { opacity: 1; }
.hero__shade {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(to top, rgba(11, 13, 18, 0.96) 0%, rgba(11, 13, 18, 0.62) 42%, rgba(11, 13, 18, 0.08) 100%),
    linear-gradient(to right, rgba(11, 13, 18, 0.72) 0%, rgba(11, 13, 18, 0) 65%);
}
.hero__content {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 20px; display: grid; gap: 10px; max-width: 640px;
}
@media (min-width: 720px) { .hero__content { padding: 34px 36px; gap: 12px; } }
.hero__chips { display: flex; gap: 8px; flex-wrap: wrap; }
.hero__title { margin: 0; font-size: clamp(1.45rem, 3.6vw, 2.6rem); line-height: 1.08; font-weight: 800; letter-spacing: -0.025em; text-wrap: balance; }
.hero__desc { margin: 0; color: var(--text-2); font-size: 14.5px; max-width: 560px; }
@media (max-width: 480px) { .hero__desc { -webkit-line-clamp: 2; } }
.hero__actions { display: flex; gap: 10px; margin-top: 4px; }
.hero__dots { position: absolute; right: 18px; bottom: 18px; z-index: 4; display: flex; gap: 6px; }
.hero__dots button { width: 7px; height: 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.35); transition: width .25s, background .25s; }
.hero__dots button.active { width: 22px; background: var(--accent); }
@media (max-width: 719px) { .hero__dots { top: 14px; bottom: auto; } }

/* ---------- Baris (row) & kartu ---------- */
.section { margin-top: 30px; }
@media (min-width: 720px) { .section { margin-top: 40px; } }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section__title { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
@media (min-width: 720px) { .section__title { font-size: 21px; } }
.section__more { color: var(--muted); font-size: 13.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 2px; transition: color .15s; }
.section__more:hover { color: var(--text); }
.section__more svg { width: 16px; height: 16px; }
.scroller {
  display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--pad);
  margin-inline: calc(-1 * var(--pad)); padding-inline: var(--pad); padding-bottom: 8px;
  scrollbar-width: none;
}
.scroller::-webkit-scrollbar { display: none; }
.scroller .card { flex: 0 0 var(--card-w); scroll-snap-align: start; }
@media (min-width: 720px) { .scroller { gap: 16px; } }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 20px 12px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(auto-fill, minmax(166px, 1fr)); gap: 26px 16px; } }

.card { display: block; min-width: 0; }
.card__poster {
  position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden;
  background: var(--surface-2); transition: transform .3s ease, box-shadow .3s ease;
}
.card__poster .img { transition: opacity .35s ease, transform .5s ease; }
.card:hover .card__poster { transform: translateY(-3px); box-shadow: var(--shadow); }
.card:hover .card__poster .img { transform: scale(1.05); }
.card__badge { position: absolute; top: 8px; left: 8px; }
.card__eps { position: absolute; bottom: 8px; right: 8px; background: rgba(0, 0, 0, 0.55); }
.card__progress { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); }
.card__title { margin-top: 9px; font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.card__meta { margin-top: 3px; font-size: 12px; color: var(--muted); }

/* ---------- Skeleton ---------- */
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 10px;
}
.skel-card .card__poster { border-radius: var(--radius); }
.skel-line { height: 12px; margin-top: 10px; width: 80%; }
.skel-line--short { width: 50%; margin-top: 6px; }

/* ---------- Halaman daftar ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 22px 0 16px; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.load-more { display: flex; justify-content: center; margin: 28px 0 8px; }

/* ---------- Detail ---------- */
.detail { margin-top: 16px; }
.detail__banner { position: relative; height: 200px; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
@media (min-width: 720px) { .detail__banner { height: 320px; } }
.detail__banner .img, .detail__banner .ph { position: absolute; inset: 0; }
.detail__banner::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, rgba(11, 13, 18, 0.35) 55%, rgba(11, 13, 18, 0.1) 100%);
}
.detail__body { display: grid; grid-template-columns: 112px 1fr; gap: 16px; margin-top: -56px; position: relative; z-index: 1; }
@media (min-width: 720px) { .detail__body { grid-template-columns: 220px 1fr; gap: 30px; margin-top: -110px; } }
.detail__poster { position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow); }
.detail__info { min-width: 0; padding-top: 58px; }
@media (min-width: 720px) { .detail__info { padding-top: 120px; } }
.detail__title { margin: 0; font-size: clamp(1.35rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.12; text-wrap: balance; }
.detail__alt { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.detail__meta { margin-top: 10px; }
.detail__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.detail__desc { margin: 16px 0 0; color: var(--text-2); line-height: 1.7; max-width: 760px; }
.detail__desc.collapsed { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.detail__more { margin-top: 6px; color: var(--accent-2); font-weight: 600; font-size: 14px; }
.genres { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.genres .chip { background: var(--surface-2); color: var(--text-2); font-weight: 500; }
@media (max-width: 719px) {
  .detail__body { grid-template-columns: 1fr; margin-top: -40px; }
  .detail__poster { width: 120px; }
  .detail__info { padding-top: 0; }
}

/* ---------- Episode ---------- */
.eps { margin-top: 30px; }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
@media (min-width: 720px) { .ep-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; } }
.ep { display: block; border-radius: 12px; overflow: hidden; background: var(--surface); transition: background .15s, transform .2s; }
.ep:hover { background: var(--surface-2); transform: translateY(-2px); }
.ep__thumb { position: relative; aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.ep__num { position: absolute; left: 8px; bottom: 8px; }
.ep__dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, 0.6); }
.ep__done { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; color: #fff; }
.ep__done svg { width: 14px; height: 14px; stroke-width: 2.6; }
.ep__progress { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); }
.ep__title { padding: 9px 10px 10px; font-size: 12.5px; color: var(--text-2); line-height: 1.35; }
.ep.current { outline: 2px solid var(--accent); outline-offset: 0; }

/* ---------- Tonton ---------- */
.watch { display: grid; gap: 20px; margin-top: 16px; }
@media (min-width: 1024px) { .watch { grid-template-columns: minmax(0, 1fr) 360px; gap: 26px; align-items: start; } }
.player {
  position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.player iframe, .player__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player__poster { position: absolute; inset: 0; display: grid; place-items: center; background: #000; }
.player__poster .img { position: absolute; inset: 0; opacity: .55; }
.player__poster .spinner { position: relative; z-index: 1; }
.player__msg { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; gap: 12px; text-align: center; padding: 20px; background: rgba(11, 13, 18, 0.85); }
.player__msg p { margin: 0; color: var(--text-2); }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.watch__info { margin-top: 14px; }
.watch__show { color: var(--accent-2); font-weight: 600; font-size: 14px; }
.watch__title { margin: 4px 0 0; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.watch__sub { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.watch__ctrl { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.eplist { position: relative; background: var(--surface); border-radius: var(--radius); padding: 6px; }
@media (min-width: 1024px) { .eplist { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: thin; } }
.eplist__head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 8px; font-weight: 700; font-size: 14px; }
.eplist__head span { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.eplist__item { display: flex; gap: 10px; padding: 7px 8px; border-radius: 10px; transition: background .15s; align-items: center; }
.eplist__item:hover { background: var(--surface-2); }
.eplist__item.active { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.eplist__thumb { position: relative; flex: 0 0 96px; aspect-ratio: 16 / 9; border-radius: 7px; overflow: hidden; background: var(--surface-3); }
.eplist__thumb .ph { padding: 6px; font-size: 10px; }
.eplist__thumb .ph::before { font-size: 28px; }
.eplist__body { min-width: 0; }
.eplist__label { font-weight: 700; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.eplist__label small { color: var(--muted); font-weight: 500; }
.eplist__title { color: var(--muted); font-size: 12px; line-height: 1.3; margin-top: 2px; }
@media (max-width: 1023px) { .eplist { max-height: 60vh; overflow-y: auto; } }

/* ---------- Lain-lain ---------- */
.empty { text-align: center; padding: 64px 20px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; margin: 0 auto 12px; color: var(--surface-3); stroke-width: 1.5; }
.empty h2 { margin: 0 0 6px; color: var(--text); font-size: 18px; }
.empty p { margin: 0; font-size: 14px; }
.notice {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding: 12px 14px;
  border-radius: 12px; background: var(--accent-soft); color: var(--text-2); font-size: 13.5px; line-height: 1.5;
}
.notice svg { color: var(--accent-2); margin-top: 2px; }
.notice strong { color: var(--text); }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; margin-top: 18px; transition: color .15s; }
.back:hover { color: var(--text); }
.back svg { width: 18px; height: 18px; }
.footer { margin: 60px auto 28px; color: var(--muted); font-size: 13px; line-height: 1.6; border-top: 1px solid var(--border); padding-top: 22px; }
.footer p { margin: 0 0 8px; max-width: 820px; }
.footer a { color: var(--text-2); text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.25); }
.footer__attrib { font-size: 12.5px; }
.toast {
  position: fixed; left: 50%; bottom: calc(78px + env(safe-area-inset-bottom)); translate: -50% 0; z-index: 60;
  padding: 11px 16px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--border);
  box-shadow: var(--shadow); font-size: 14px; max-width: min(92vw, 420px);
}
@media (min-width: 720px) { .toast { bottom: 24px; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page { animation: fadeUp .25s ease both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
