/* ═══════════════════════════════════════════════════════════════
   FLICKA PLAYER v3 — 100% flicka.id/player clone
   Immersive h-dvh stage + blurred poster + centered 9:16 card + 18px insets
   Based on browser snapshot + desktop-player.js + index-BJliwdaq.css tokens
   ═══════════════════════════════════════════════════════════════ */

/* ── Immersive stage (flicka: relative h-dvh w-full bg-background-deep + radial gradients) ── */
.watch-section--flicka {
  padding: 0 !important;
  overflow: clip;
  --stage-pad: max(12px, env(safe-area-inset-top, 0px));
}
.watch-section--flicka > .container {
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  overflow: visible;
}
.watch-section--flicka .watch-layout {
  display: block !important;
  max-width: none !important;
}
.watch-section--flicka .watch-player {
  max-width: none !important;
}
.watch-section--flicka .breadcrumb {
  display: none !important; /* flicka has no breadcrumb — immersive */
}
@media (min-width: 768px) {
  .watch-section--flicka .breadcrumb { display: none !important; }
}

.flicka-stage {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  min-height: 100svh;
  background: #060810; /* fallback to --background-deep */
  background: var(--bg-deep, #060810);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  padding: 0;
}
@media (min-width: 768px) {
  .flicka-stage {
    min-height: calc(100dvh - var(--navbar-height, 56px));
    min-height: calc(100svh - var(--navbar-height, 56px));
    padding: 24px 16px;
  }
}
@media (max-width: 767px) {
  .flicka-stage {
    min-height: 100dvh;
    min-height: 100svh;
    align-items: stretch;
    padding: 0;
  }
}

/* blurred poster bg like flicka: radial + poster blur */
.flicka-stage-bg {
  position: absolute; inset: 0;
  background-color: #060810;
  background-size: cover;
  background-position: center 30%;
  filter: blur(28px) brightness(0.55) saturate(1.15);
  transform: scale(1.08);
  opacity: 1;
  pointer-events: none;
}
.flicka-stage-bg::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 50% 38%, color-mix(in oklab, var(--accent, #ff3b30) 16%, transparent), transparent 68%),
    radial-gradient(85% 62% at 50% 100%, color-mix(in oklab, var(--accent, #ff3b30) 10%, transparent), transparent 72%);
  opacity: .95;
}
.flicka-stage-bg::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.18) 0%, rgba(0,0,0,.05) 28%, rgba(0,0,0,.42) 82%, rgba(0,0,0,.58) 100%);
}
.flicka-stage-dim {
  position: absolute; inset: 0;
  background: rgba(6,8,16,.38);
  pointer-events: none;
}

/* ── Centered card (flicka desktop: aspect-[9/16] h-[82vh] max-h-[82vh] rounded-2xl ring-1) ── */
.flicka-root {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-width: 100%;
  margin: 0 auto;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.08);
  isolation: isolate;
  touch-action: manipulation;
  flex-shrink: 0;
}
@media (min-width: 768px) {
  .flicka-root {
    width: min(100%, 44vh); /* 82vh * 9/16 ≈ 46vh, keep 44vh for safe */
    max-height: 82vh;
    max-height: 82dvh;
    border-radius: 16px;
  }
}
@media (max-width: 767px) {
  .flicka-root {
    border-radius: 0;
    width: 100%;
    height: 100dvh;
    height: 100svh;
    max-height: 100dvh;
    max-height: 100svh;
    aspect-ratio: auto;
    box-shadow: none;
    border-radius: 0;
  }
  /* keep 9:16 but fill height: cover strategy */
  .flicka-stage .flicka-root {
    border-radius: 0;
  }
}
/* flicka desktop card ring */
@media (min-width: 768px) {
  .flicka-root { border: 1px solid rgba(255,255,255,.08); }
}

/* immersive gradients inside card (subtle) */
.flicka-bg {
  pointer-events: none;
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 50% 40%, color-mix(in oklab, var(--accent, #ff3b30) 12%, transparent), transparent 70%),
    radial-gradient(80% 60% at 50% 100%, color-mix(in oklab, var(--accent, #ff3b30) 7%, transparent), transparent 75%);
  opacity: .9;
}

/* ── Video element ── */
.flicka-video {
  width: 100%; height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}
@media (max-width: 767px) {
  .flicka-video { object-fit: cover; }
}
.flicka-iframe {
  width: 100%; height: 100%;
  border: none; background: #000; display: block;
}

/* ── Top bar ── flicka: p-4 top-0 inset-x-0, back 40px, badge pill ── */
.flicka-topbar {
  position: absolute; inset: 0 0 auto 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 12px;
  padding-top: max(12px, env(safe-area-inset-top, 0px));
  z-index: 30;
  background: linear-gradient(to bottom, rgba(0,0,0,.62) 0%, rgba(0,0,0,.18) 58%, transparent 100%);
  transition: opacity .3s ease;
}
@media (min-width: 768px) { .flicka-topbar { padding: 14px; padding-top: 14px; } }
.flicka-topbar.hidden { opacity: 0; pointer-events: none; }
.flicka-back {
  width: 40px; height: 40px;
  min-width: 40px; min-height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(15,15,20,.5);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  font-size: 13px; font-weight: 600;
  padding: 0 14px 0 10px;
  width: auto;
  transition: background .15s, transform .12s;
  flex-shrink: 0;
  line-height: 1;
}
.flicka-back--iconOnly { width: 40px; padding: 0; }
.flicka-back:hover { background: rgba(15,15,20,.68); }
.flicka-back:active { transform: scale(.96); }
.flicka-back svg { width: 18px; height: 18px; flex-shrink: 0; }
@media (max-width: 380px) { .flicka-back { height: 38px; min-height: 38px; font-size: 12.5px; } }

.flicka-ep-badge {
  display: inline-flex; align-items: baseline; gap: 5px;
  white-space: nowrap;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(15,15,20,.55);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-size: 12.5px; line-height: 1;
  border: 1px solid rgba(255,255,255,.09);
  font-variant-numeric: tabular-nums;
}
.flicka-ep-badge strong { font-weight: 700; color: #fff; }
.flicka-ep-badge span { font-weight: 600; color: rgba(255,255,255,.58); }
.flicka-top-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ── Center play button — flicka: size-[66px] bg-black/30 border-white/30 ── */
.flicka-center-play {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  width: 66px; height: 66px;
  border-radius: 999px;
  background: rgba(0,0,0,.3);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1.5px solid rgba(255,255,255,.3);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .3s, transform .2s;
  touch-action: manipulation;
}
@media (max-width: 767px) { .flicka-center-play { width: 60px; height: 60px; } }
.flicka-center-play.hidden { opacity: 0; pointer-events: none; }
.flicka-center-play:active { transform: translate(-50%, -50%) scale(.9); }
.flicka-center-play svg { width: 26px; height: 26px; fill: currentColor; }

/* ── Title overlay — flicka: left-[18px] right-[84px] bottom-[78px] line-clamp-2 ── */
.flicka-title-wrap {
  position: absolute;
  left: 18px; right: 84px; bottom: 78px;
  z-index: 25;
  transition: opacity .3s;
  pointer-events: none;
}
@media (max-width: 767px) {
  .flicka-title-wrap { left: 14px; right: 14px; bottom: 96px; }
}
@media (max-width: 380px) {
  .flicka-title-wrap { left: 12px; right: 12px; bottom: 92px; }
}
.flicka-title-wrap.hidden { opacity: 0; }
.flicka-title {
  margin: 0 0 5px;
  font-size: 16px; font-weight: 700; line-height: 1.3;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,.62);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
  pointer-events: auto;
  font-family: var(--font-display, inherit);
}
@media (max-width: 767px) { .flicka-title { font-size: 15px; } }
.flicka-desc {
  font-size: 12px; line-height: 1.45;
  color: rgba(255,255,255,.82);
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
  max-height: 2.8em; overflow: hidden;
  position: relative;
  transition: max-height .4s cubic-bezier(.4,0,.2,1);
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent);
  mask-image: linear-gradient(to bottom, black 60%, transparent);
  cursor: pointer;
  pointer-events: auto;
}
.flicka-desc.expanded {
  max-height: 220px;
  -webkit-mask-image: linear-gradient(to bottom, black 100%, black 100%);
  mask-image: linear-gradient(to bottom, black 100%, black 100%);
}
.flicka-desc p { margin: 0; }

/* ── Progress + time — flicka: inset-x-[18px] bottom-[30px] h-[3px] 10px tabular ── */
.flicka-progress-wrap {
  position: absolute;
  left: 18px; right: 18px; bottom: 30px;
  z-index: 30;
  transition: opacity .3s, transform .3s;
  padding-bottom: max(0px, env(safe-area-inset-bottom, 0px));
}
@media (max-width: 767px) {
  .flicka-progress-wrap { left: 14px; right: 14px; bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
}
.flicka-progress-wrap.hidden { opacity: 0; pointer-events: none; transform: translateY(8px); }
.flicka-time-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; font-weight: 500; font-variant-numeric: tabular-nums;
  color: rgba(255,255,255,.6);
  margin-bottom: 6px;
  letter-spacing: .02em;
}
.flicka-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 28px;
  background: transparent;
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  margin: 0; display: block;
  background-image: linear-gradient(to right, #fff var(--pct, 0%), rgba(255,255,255,.22) var(--pct, 0%));
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 3px;
}
.flicka-slider::-webkit-slider-runnable-track { height: 3px; background: transparent; border-radius: 999px; }
.flicka-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px; height: 11px;
  border-radius: 999px;
  background: #fff;
  border: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent, #ff3b30) 40%, transparent), 0 1px 6px rgba(0,0,0,.4);
  cursor: pointer;
  transition: transform .15s;
  margin-top: -4px;
}
.flicka-slider::-moz-range-track { height: 3px; background: rgba(255,255,255,.22); border-radius: 999px; border: none; }
.flicka-slider::-moz-range-progress { height: 3px; background: #fff; border-radius: 999px; }
.flicka-slider::-moz-range-thumb {
  width: 11px; height: 11px; border-radius: 999px; background: #fff; border: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent, #ff3b30) 40%, transparent), 0 1px 6px rgba(0,0,0,.4);
}

/* ── Bottom action row — flicka: prev/next + 5 icons with label under (Simpan etc) ── */
.flicka-bottom-row {
  position: absolute;
  left: 10px; right: 10px; bottom: 52px;
  z-index: 30;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 8px;
  transition: opacity .3s;
  padding-bottom: max(0px, env(safe-area-inset-bottom, 0px));
}
@media (min-width: 768px) { .flicka-bottom-row { left: 12px; right: 12px; bottom: 56px; } }
.flicka-bottom-row.hidden { opacity: 0; pointer-events: none; }

/* EP pill centered top of bottom row area — flicka shows EP 1 / 41 inline? we keep in topbar + also show here if needed */
.flicka-ep-row {
  position: absolute;
  left: 50%; top: -28px; transform: translateX(-50%);
  pointer-events: none;
}

/* Prev / Next side buttons */
.flicka-nav-btn {
  width: 44px; height: 44px;
  border-radius: 999px;
  background: rgba(0,0,0,.36);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform .12s, opacity .15s;
}
.flicka-nav-btn:disabled { opacity: .32; pointer-events: none; }
.flicka-nav-btn:active { transform: scale(.94); }
.flicka-nav-btn svg { width: 18px; height: 18px; }

/* Center icon group */
.flicka-action-group {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 12px;
  flex: 1;
}
@media (max-width: 380px) { .flicka-action-group { gap: 8px; } }
.flicka-action {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: rgba(255,255,255,.92);
  background: none; border: none; padding: 0;
  cursor: pointer;
  min-width: 52px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.flicka-action:active { transform: scale(.96); }
.flicka-action-icon {
  width: 30px; height: 30px;
  border-radius: 999px;
  background: rgba(0,0,0,.34);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.16);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s, color .15s;
}
.flicka-action.active .flicka-action-icon { background: rgba(255,255,255,.96); border-color: var(--accent, #ff3b30); color: var(--accent, #ff3b30); }
.flicka-action-icon svg { width: 15px; height: 15px; }
.flicka-action-label {
  font-size: 10px; font-weight: 500; line-height: 1;
  color: rgba(255,255,255,.82);
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
  white-space: nowrap;
}
@media (max-width: 380px) { .flicka-action-label { font-size: 9.5px; } .flicka-action { min-width: 46px; } }

/* ── Gesture layers ── */
.flicka-gesture { position: absolute; inset: 0; z-index: 15; display: flex; }
.flicka-gesture-half { flex: 1; position: relative; touch-action: manipulation; }

/* Seek feedback */
.flicka-seek-feedback { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 35; }
.flicka-seek-feedback.left { left: 0; right: 50%; }
.flicka-seek-feedback.right { left: 50%; right: 0; }
.flicka-seek-inner { display: flex; flex-direction: column; align-items: center; gap: 5px; opacity: 0; transform: scale(.82); transition: opacity .16s ease, transform .16s ease; }
.flicka-seek-inner.show { opacity: 1; transform: scale(1); }
.flicka-seek-circle { width: 52px; height: 52px; border-radius: 999px; background: rgba(255,255,255,.2); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; color: #fff; }
.flicka-seek-circle svg { width: 28px; height: 28px; }
.flicka-seek-text { font-size: 13px; font-weight: 700; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.8); }

/* Speed indicator */
.flicka-speed-ind { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 2px; color: #fff; pointer-events: none; opacity: 0; transition: opacity .15s; }
.flicka-speed-ind.show { opacity: 1; }
.flicka-speed-ind strong { font-size: 18px; font-weight: 600; letter-spacing: -.01em; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.flicka-speed-ind .chev { animation: flickaChevronPulse .8s ease-in-out infinite; }
@keyframes flickaChevronPulse { 0%,100%{opacity:.4} 50%{opacity:1} }

/* Loading */
.flicka-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.38); z-index: 20; pointer-events: none; opacity: 0; transition: opacity .3s; }
.flicka-loading.show { opacity: 1; }
.flicka-loading-inner { position: relative; }
.flicka-loading-blur { position: absolute; inset: 0; background: color-mix(in oklab, var(--accent, #ff3b30) 30%, transparent); filter: blur(20px); border-radius: 999px; transform: scale(1.5); }
.flicka-spinner { width: 44px; height: 44px; border: 2.5px solid rgba(255,255,255,.22); border-top-color: #fff; border-radius: 999px; animation: spin .8s linear infinite; position: relative; z-index: 1; }

/* Episode drawer */
.flicka-drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.52); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .28s ease; }
.flicka-drawer-backdrop.show { opacity: 1; pointer-events: auto; }
.flicka-drawer { position: fixed; left: 0; right: 0; bottom: 0; max-height: 72dvh; max-height: 72svh; background: #0f0f12; border-radius: 20px 20px 0 0; z-index: 61; transform: translateY(100%); transition: transform .34s cubic-bezier(.32,.72,0,1); display: flex; flex-direction: column; overflow: hidden; padding-bottom: env(safe-area-inset-bottom, 0px); }
.flicka-drawer.show { transform: translateY(0); }
.flicka-drawer-handle { width: 36px; height: 5px; border-radius: 999px; background: rgba(255,255,255,.22); margin: 12px auto 10px; flex-shrink: 0; }
.flicka-drawer-head { display: flex; align-items: center; gap: 10px; padding: 0 14px 12px; border-bottom: 1px solid rgba(255,255,255,.07); flex-shrink: 0; }
.flicka-drawer-head h3 { font-size: 15px; font-weight: 700; color: #fff; margin: 0; }
.flicka-drawer-head span { font-size: 13px; color: rgba(255,255,255,.52); }
.flicka-drawer-head button[data-drawer-close] { margin-left: auto; width: 36px; height: 36px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); color: rgba(255,255,255,.9); font-size: 20px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.flicka-drawer-grid { overflow-y: auto; padding: 12px 12px 18px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
@media (min-width: 768px) { .flicka-drawer-grid { grid-template-columns: repeat(8, 1fr); padding: 14px 16px 20px; } }
@media (max-width: 380px) { .flicka-drawer-grid { grid-template-columns: repeat(4, 1fr); gap: 7px; } }
.flicka-ep-btn { aspect-ratio: 1; min-height: 44px; border-radius: 11px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.065); color: rgba(255,255,255,.88); font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; transition: background .15s, border-color .15s, transform .1s; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.flicka-ep-btn.active { background: var(--accent, #ff3b30); border-color: var(--accent, #ff3b30); color: #fff; font-weight: 700; box-shadow: 0 2px 10px color-mix(in oklab, var(--accent, #ff3b30) 35%, transparent); }
.flicka-ep-btn:active { transform: scale(.96); }

/* Lock */
.flicka-lock-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); z-index: 30; width: 40px; height: 40px; border-radius: 999px; background: rgba(0,0,0,.45); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.22); color: rgba(255,255,255,.85); display: none; align-items: center; justify-content: center; }
.flicka-lock-btn.show { display: flex; }

/* Error */
.flicka-error { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #000; color: #fff; z-index: 25; padding: 24px; text-align: center; }
.flicka-error p { color: rgba(255,255,255,.72); font-size: 13px; margin: 0 0 16px; line-height: 1.5; }
.flicka-error button { padding: 11px 22px; border-radius: 999px; background: var(--accent, #ff3b30); color: #fff; border: none; font-size: 13px; font-weight: 600; min-height: 44px; }

/* Subtitle cue */
.flicka-video::cue { background: rgba(0,0,0,.72); color: #fff; font-size: 14px; line-height: 1.45; }
@media (max-width: 767px) { .flicka-video::cue { font-size: 13px; } }
.flicka-video::-webkit-media-controls { display: none !important; }

/* Watch info below immersive stage (desktop) */
.flicka-watch-info { margin-top: 16px; }
@media (max-width: 767px) { .flicka-watch-info { margin-top: 14px; padding: 0 2px; } }

/* Completion dialog — flicka shows "Serial Selesai!" centered */
.flicka-complete {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  z-index: 35;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  text-align: center;
}
.flicka-complete.show { display: flex; }
.flicka-complete-card {
  background: #14141a;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 22px 18px;
  max-width: 320px; width: 100%;
  color: #fff;
}
.flicka-complete-card h3 { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.flicka-complete-card p { font-size: 12.5px; color: rgba(255,255,255,.62); margin: 0 0 14px; line-height: 1.45; }
.flicka-complete-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.flicka-complete-actions a, .flicka-complete-actions button {
  flex: 1; min-height: 40px; border-radius: 999px; border: none; font-size: 12.5px; font-weight: 600; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.flicka-complete-primary { background: var(--accent, #ff3b30); color: #fff; }
.flicka-complete-ghost { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.12) !important; }
