/* ══════════════════════════════════════════════════════════════════
   Dracin — gaya tampilan
   Prinsip: gelap pekat, satu warna aksen (amber), sudut lembut,
   gerak halus. Tidak ada gradien ramai, tidak ada bayangan berlebih.
   ══════════════════════════════════════════════════════════════════ */

:root {
  --latar: #0a0a0c;
  --latar-2: #121216;
  --latar-3: #1a1a20;
  --garis: rgba(255, 255, 255, .07);
  --teks: #f4f4f5;
  --teks-2: #a1a1aa;
  --teks-3: #71717a;
  --aksen: #f5b544;
  --aksen-redup: rgba(245, 181, 68, .12);
  --merah: #ef4444;
  --r-kecil: 10px;
  --r: 14px;
  --r-besar: 20px;
  --tinggi-tab: 60px;
  --aman-atas: env(safe-area-inset-top, 0px);
  --aman-bawah: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--latar);
  color: var(--teks);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}

body { overflow: hidden; }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

#app { position: relative; height: 100%; }

/* ─────────────────────────────────────────────── layar */
.layar {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column;
  background: var(--latar);
}
.layar.aktif { display: flex; }
.layar.lapis { z-index: 20; }
.layar.gelap-penuh { z-index: 40; background: #000; }

/* ─────────────────────────────────────────────── kepala */
.kepala {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: calc(var(--aman-atas) + 14px) 18px 10px;
  background: linear-gradient(to bottom, var(--latar) 70%, transparent);
  position: relative; z-index: 2;
}
.merek { display: flex; align-items: center; gap: 9px; }
.merek h1 {
  margin: 0; font-size: 21px; font-weight: 750; letter-spacing: -.4px;
}
.merek-titik {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--aksen);
  box-shadow: 0 0 0 4px var(--aksen-redup);
}
.judul-layar { margin: 0; font-size: 24px; font-weight: 750; letter-spacing: -.5px; }

.ikon-tbl {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--latar-3); color: var(--teks-2);
  transition: background .15s, color .15s;
}
.ikon-tbl:active { background: #24242c; color: var(--teks); }

/* ─────────────────────────────────────────────── isi */
.isi {
  flex: 1 1 auto;
  overflow-y: auto; overflow-x: hidden;
  padding: 0 0 calc(var(--tinggi-tab) + var(--aman-bawah) + 18px);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.isi::-webkit-scrollbar { display: none; }
.isi.tanpa-atas { padding-top: var(--aman-atas); }

/* ─────────────────────────────────────────────── hero */
.hero {
  position: relative;
  margin: 4px 16px 0;
  border-radius: var(--r-besar);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  max-height: 62vh;
  background: var(--latar-3);
  isolation: isolate;
}
.hero-poster {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transform: scale(1.02);
}
.hero-tirai {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--latar) 2%, rgba(10,10,12,.92) 22%, rgba(10,10,12,.15) 62%, transparent 100%);
}
.hero-isi {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 20px;
}
.hero-lencana {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--aksen);
  background: var(--aksen-redup);
  padding: 5px 10px; border-radius: 999px;
  margin-bottom: 10px;
}
.hero-judul {
  margin: 0 0 6px;
  font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -.6px;
  text-wrap: balance;
}
.hero-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--teks-2);
  margin-bottom: 14px;
}
.hero-meta .bintang { color: var(--aksen); font-weight: 700; }
.hero-tombol {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 48px;
  border-radius: var(--r);
  background: var(--aksen); color: #1a1200;
  font-weight: 750; font-size: 15px;
  transition: transform .12s, filter .15s;
}
.hero-tombol:active { transform: scale(.98); filter: brightness(.94); }
.hero-tombol svg { stroke: currentColor; stroke-width: 2.2; }

/* ─────────────────────────────────────────────── baris */
.baris { margin-top: 26px; }
.baris-kepala {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 18px 12px;
}
.baris-judul { margin: 0; font-size: 16.5px; font-weight: 700; letter-spacing: -.2px; }
.baris-semua { font-size: 12.5px; color: var(--teks-3); }

.geser {
  display: flex; gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 18px 4px;
  scrollbar-width: none;
}
.geser::-webkit-scrollbar { display: none; }

/* kartu poster */
.kartu {
  flex: 0 0 auto;
  width: 116px;
  scroll-snap-align: start;
  text-align: left;
}
.kartu-poster {
  position: relative;
  width: 100%; aspect-ratio: 3 / 4;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--latar-3);
  transition: transform .16s;
}
.kartu:active .kartu-poster { transform: scale(.96); }
.kartu-poster .gambar {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.kartu-poster .tirai {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.72), transparent 55%);
}
.kartu-ep {
  position: absolute; left: 7px; bottom: 7px;
  font-size: 10.5px; font-weight: 700;
  background: rgba(0,0,0,.66);
  backdrop-filter: blur(6px);
  padding: 3px 7px; border-radius: 6px;
  color: #fff;
}
.kartu-rating {
  position: absolute; right: 7px; top: 7px;
  display: flex; align-items: center; gap: 3px;
  font-size: 10.5px; font-weight: 700;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(6px);
  padding: 3px 6px; border-radius: 6px;
  color: var(--aksen);
}
.kartu-judul {
  margin: 8px 0 2px;
  font-size: 12.5px; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.kartu-sub { font-size: 11px; color: var(--teks-3); }

/* poster gradien (tanpa gambar) */
.poster-gradien {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end;
  padding: 10px;
}
.poster-gradien span {
  font-size: 13px; font-weight: 800; line-height: 1.15;
  letter-spacing: -.3px;
  color: rgba(255,255,255,.94);
  text-shadow: 0 1px 12px rgba(0,0,0,.5);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─────────────────────────────────────────────── grid (jelajah/koleksi) */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 12px;
  padding: 8px 18px 0;
}
.grid .kartu { width: 100%; }

.pilih {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 4px 18px 14px;
  scrollbar-width: none;
}
.pilih::-webkit-scrollbar { display: none; }
.pil {
  flex: 0 0 auto;
  padding: 8px 15px; border-radius: 999px;
  background: var(--latar-3);
  font-size: 13px; font-weight: 600; color: var(--teks-2);
  border: 1px solid transparent;
  transition: .15s;
}
.pil.aktif { background: var(--aksen-redup); color: var(--aksen); border-color: rgba(245,181,68,.3); }

/* ─────────────────────────────────────────────── detail */
.detail-poster {
  position: relative;
  height: 44vh; min-height: 260px;
  background: var(--latar-3);
  overflow: hidden;
}
.detail-poster .gambar { position: absolute; inset: 0; background-size: cover; background-position: center top; }
.detail-poster .tirai {
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--latar) 1%, rgba(10,10,12,.85) 30%, rgba(10,10,12,.2) 70%, rgba(0,0,0,.5) 100%);
}
.detail-tutup {
  position: absolute; top: calc(var(--aman-atas) + 12px); left: 16px;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0,0,0,.45); backdrop-filter: blur(10px);
  z-index: 3;
}
.detail-isi { position: relative; z-index: 2; margin-top: -70px; padding: 0 18px 30px; }
.detail-judul { margin: 0 0 8px; font-size: 25px; font-weight: 800; line-height: 1.15; letter-spacing: -.6px; }
.detail-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 14px; font-size: 12.5px; color: var(--teks-2);
}
.lencana {
  padding: 4px 9px; border-radius: 6px;
  background: var(--latar-3); font-size: 11.5px; font-weight: 600;
}
.lencana.aksen { background: var(--aksen-redup); color: var(--aksen); }
.detail-aksi { display: flex; gap: 10px; margin-bottom: 18px; }
.tbl-utama {
  flex: 1; height: 46px; border-radius: var(--r);
  background: var(--aksen); color: #1a1200;
  font-weight: 750; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.tbl-utama:active { filter: brightness(.94); }
.tbl-kedua {
  width: 46px; height: 46px; border-radius: var(--r);
  background: var(--latar-3); color: var(--teks-2);
  display: grid; place-items: center;
}
.tbl-kedua.aktif { color: var(--aksen); background: var(--aksen-redup); }
.detail-sinopsis { font-size: 14px; color: var(--teks-2); line-height: 1.6; margin: 0 0 22px; }

.ep-kepala {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
}
.ep-kepala h3 { margin: 0; font-size: 15.5px; font-weight: 700; }
.ep-kepala span { font-size: 12px; color: var(--teks-3); }

.ep-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
}
.ep-tbl {
  aspect-ratio: 1; border-radius: var(--r-kecil);
  background: var(--latar-3); color: var(--teks-2);
  font-size: 13.5px; font-weight: 650;
  display: grid; place-items: center;
  position: relative;
  transition: .14s;
}
.ep-tbl:active { transform: scale(.94); }
.ep-tbl.kini { background: var(--aksen); color: #1a1200; }
.ep-tbl.terkunci { color: var(--teks-3); }
.ep-tbl.terkunci::after {
  content: ""; position: absolute; right: 5px; top: 5px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--aksen); opacity: .8;
}

/* ─────────────────────────────────────────────── pemutar */
.pemutar { position: absolute; inset: 0; background: #000; }
.pemutar video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.kendali {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0,0,0,.6), transparent 22%, transparent 62%, rgba(0,0,0,.85));
  transition: opacity .22s;
}
.kendali.sembunyi { opacity: 0; pointer-events: none; }
.tutup-pemutar {
  align-self: flex-start;
  margin: calc(var(--aman-atas) + 12px) 0 0 16px;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0,0,0,.5); backdrop-filter: blur(10px);
}
.tengah-pemutar { display: grid; place-items: center; }
.tombol-muter {
  width: 68px; height: 68px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0,0,0,.5); backdrop-filter: blur(10px);
  color: #fff;
}
.tombol-muter svg { width: 30px; height: 30px; }
.bawah-pemutar { padding: 0 18px calc(var(--aman-bawah) + 18px); }
.info-episode { font-size: 13.5px; font-weight: 650; margin-bottom: 10px; }
.bilah-waktu { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--teks-2); }
.bilah-waktu input[type=range] {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 3px; border-radius: 3px; background: rgba(255,255,255,.22);
}
.bilah-waktu input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%;
  background: var(--aksen); box-shadow: 0 0 0 4px rgba(245,181,68,.2);
}
.deret-episode {
  display: flex; gap: 8px; overflow-x: auto; margin-top: 16px;
  scrollbar-width: none;
}
.deret-episode::-webkit-scrollbar { display: none; }
.deret-episode .ep-tbl { flex: 0 0 auto; width: 42px; height: 42px; aspect-ratio: auto; }

/* ─────────────────────────────────────────────── pencarian */
.cari-kepala { gap: 10px; }
.kotak-cari {
  flex: 1; display: flex; align-items: center; gap: 9px;
  height: 42px; padding: 0 13px;
  border-radius: var(--r); background: var(--latar-3);
  color: var(--teks-3);
}
.kotak-cari input {
  flex: 1; background: none; border: 0; outline: 0;
  color: var(--teks); font-size: 14.5px;
}
.kotak-cari input::placeholder { color: var(--teks-3); }
.ikon-cari { width: 18px; height: 18px; flex: 0 0 auto; }
.teks-tbl { color: var(--aksen); font-size: 14.5px; font-weight: 600; }

/* ─────────────────────────────────────────────── tabbar */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: calc(var(--tinggi-tab) + var(--aman-bawah));
  padding-bottom: var(--aman-bawah);
  display: flex; align-items: center;
  background: rgba(12,12,15,.88);
  backdrop-filter: blur(18px) saturate(160%);
  border-top: 1px solid var(--garis);
  z-index: 30;
}
.tab {
  flex: 1; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--teks-3);
  font-size: 10.5px; font-weight: 600;
  transition: color .15s;
}
.tab.aktif { color: var(--aksen); }
.tab svg { width: 21px; height: 21px; }

/* ─────────────────────────────────────────────── kosong & kerangka */
.kosong {
  padding: 60px 30px; text-align: center; color: var(--teks-3);
}
.kosong strong { display: block; color: var(--teks-2); font-size: 15px; margin-bottom: 6px; }
.kosong p { margin: 0; font-size: 13px; line-height: 1.6; }

@keyframes denyut {
  0%, 100% { opacity: .45; }
  50% { opacity: .8; }
}
.kerangka-hero, .kerangka-baris {
  background: var(--latar-3); border-radius: var(--r-besar);
  animation: denyut 1.4s ease-in-out infinite;
}
.kerangka-hero { margin: 4px 16px 0; aspect-ratio: 3/4; max-height: 60vh; }
.kerangka-baris { margin: 26px 18px 0; height: 150px; border-radius: var(--r); }

/* ─────────────────────────────────────────────── toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tinggi-tab) + 24px);
  transform: translate(-50%, 14px);
  background: rgba(28,28,34,.96);
  border: 1px solid var(--garis);
  color: var(--teks);
  padding: 11px 18px; border-radius: 12px;
  font-size: 13.5px; font-weight: 550;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 90;
  max-width: 82vw; text-align: center;
}
.toast.tampil { opacity: 1; transform: translate(-50%, 0); }

/* ─────────────────────────────────────────────── profil */
.profil {
  display: flex; align-items: center; gap: 14px;
  margin: 4px 18px 22px; padding: 18px;
  border-radius: var(--r-besar);
  background: linear-gradient(135deg, #17171d, #101014);
  border: 1px solid var(--garis);
}
.profil-avatar {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--aksen-redup); color: var(--aksen);
  display: grid; place-items: center;
  font-size: 20px; font-weight: 750;
  overflow: hidden;
}
.profil-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profil-nama { font-size: 16px; font-weight: 700; margin: 0 0 2px; }
.profil-sub { font-size: 12.5px; color: var(--teks-3); margin: 0; }

.daftar-menu { margin: 0 18px; border-radius: var(--r); overflow: hidden; background: var(--latar-2); }
.menu-baris {
  display: flex; align-items: center; gap: 13px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--garis);
  width: 100%; text-align: left;
}
.menu-baris:last-child { border-bottom: 0; }
.menu-baris svg { color: var(--teks-3); width: 19px; height: 19px; }
.menu-baris span { flex: 1; font-size: 14.5px; }
.menu-baris .nilai { font-size: 13px; color: var(--teks-3); }

/* ─────────────────────────────────────────────── tangkapan layar kecil */
@media (max-width: 360px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .hero-judul { font-size: 23px; }
  .kartu { width: 104px; }
}
@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .hero { max-height: 420px; aspect-ratio: 16/10; }
  .hero-tirai {
    background: linear-gradient(to top, var(--latar) 2%, rgba(10,10,12,.9) 30%, transparent 85%);
  }
}
