/* Full-screen swipeable story player */

.player-body {
  margin: 0;
  background: #0b0d12;
  overflow: hidden;
  font-family: "Segoe UI", "Nirmala UI", system-ui, Arial, sans-serif;
}

.player-stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
}

/* blurred backdrop of the active slide (desktop letterboxing) */
.stage-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: blur(38px) brightness(.45);
  transform: scale(1.15);
  transition: background-image .35s ease;
}

.player {
  position: relative;
  width: min(100vw, calc(100vh * 9 / 16));
  height: min(100vh, calc(100vw * 16 / 9));
  background: #000;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  user-select: none;
  touch-action: pan-y;
}
@media (min-width: 760px) {
  .player { border-radius: 14px; }
}

/* -------------------------------------------------------------- slides */
.slide {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease;
}
.slide.active { opacity: 1; visibility: visible; }
.slide .pic {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transform: scale(1.06);
  transition: transform 8s linear;
}
.slide.active .pic { transform: scale(1); }
.slide::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 42%, rgba(0,0,0,.85) 100%);
}

.slide .content {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 24px 22px 34px;
  z-index: 2;
  color: #fff;
  transform: translateY(14px);
  opacity: 0;
  transition: transform .45s cubic-bezier(.2,.8,.2,1) .12s, opacity .45s ease .12s;
}
.slide.active .content { transform: none; opacity: 1; }
.slide[data-pos="top"] .content { bottom: auto; top: 84px; }
.slide[data-pos="center"] .content { bottom: auto; top: 50%; transform: translateY(-40%); }
.slide[data-pos="center"].active .content { transform: translateY(-50%); }

.slide h2 {
  margin: 0 0 10px;
  font-size: clamp(21px, 5.2vw, 30px);
  line-height: 1.25;
  font-weight: 800;
  text-shadow: 0 2px 14px rgba(0,0,0,.6);
}
.slide p {
  margin: 0;
  font-size: clamp(13.5px, 3.4vw, 16px);
  line-height: 1.55;
  opacity: .92;
  text-shadow: 0 1px 10px rgba(0,0,0,.6);
}
.slide .cta {
  display: inline-block;
  margin-top: 16px;
  background: #fff; color: #111;
  font-weight: 700; font-size: 14px;
  padding: 10px 20px; border-radius: 999px;
}

/* -------------------------------------------------------------- chrome */
.progress {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; gap: 4px;
  padding: 12px 12px 0;
  z-index: 6;
}
.progress i {
  flex: 1; height: 3px; border-radius: 2px;
  background: rgba(255,255,255,.32);
  overflow: hidden;
}
.progress i span {
  display: block; height: 100%; width: 0;
  background: #fff; border-radius: 2px;
}
.progress i.done span { width: 100%; }

.player-top {
  position: absolute; top: 26px; left: 0; right: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  z-index: 6; color: #fff;
}
.player-top .brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 13.5px;
  text-shadow: 0 1px 8px rgba(0,0,0,.6);
}
.player-top .brand .mark {
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--brand, #e11d48);
  display: grid; place-items: center; font-size: 12px;
}
.player-top .spacer { flex: 1; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,0,0,.34); border: 0; color: #fff;
  display: grid; place-items: center; cursor: pointer;
  font-size: 14px; backdrop-filter: blur(6px);
}
.icon-btn:hover { background: rgba(0,0,0,.6); }

/* tap zones */
.tap { position: absolute; top: 0; bottom: 0; width: 32%; z-index: 5; cursor: pointer; }
.tap.left { left: 0; }
.tap.right { right: 0; width: 68%; }

/* desktop side arrows */
.nav-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  color: #fff; font-size: 18px; cursor: pointer;
  display: none; place-items: center; z-index: 20;
  backdrop-filter: blur(8px);
}
.nav-arrow:hover { background: rgba(255,255,255,.28); }
.nav-arrow.prev { left: calc(50% - min(50vw, calc(50vh * 9 / 16)) - 62px); }
.nav-arrow.next { right: calc(50% - min(50vw, calc(50vh * 9 / 16)) - 62px); }
@media (min-width: 900px) { .nav-arrow { display: grid; } }

.paused-badge {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: rgba(0,0,0,.5); color: #fff; padding: 10px 18px;
  border-radius: 999px; font-size: 13px; z-index: 7;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.player.paused .paused-badge { opacity: 1; }

/* -------------------------------------------------------------- end card */
.end-card {
  position: absolute; inset: 0; z-index: 9;
  background: rgba(10, 12, 18, .94);
  color: #fff; padding: 26px 20px;
  display: none; flex-direction: column; justify-content: center; gap: 16px;
  overflow-y: auto;
}
.end-card.show { display: flex; }
.end-card h3 { margin: 0; font-size: 17px; }
.end-card .next-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.end-card .next-list a { display: block; }
.end-card .next-list .th {
  aspect-ratio: 9/16; border-radius: 10px; overflow: hidden; background: #222;
}
.end-card .next-list .th img { width: 100%; height: 100%; object-fit: cover; }
.end-card .next-list span {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 12.5px; line-height: 1.4; margin-top: 7px; color: #e6e8ec;
}
.end-card .replay {
  align-self: flex-start; background: #fff; color: #111; border: 0;
  padding: 10px 20px; border-radius: 999px; font-weight: 700; cursor: pointer; font-size: 14px;
}

/* share sheet */
.share-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 12;
  background: #16181f; color: #fff; border-radius: 16px 16px 0 0;
  padding: 18px; transform: translateY(110%); transition: transform .28s ease;
}
.share-sheet.open { transform: none; }
.share-sheet h4 { margin: 0 0 12px; font-size: 14px; }
.share-sheet .opts { display: flex; gap: 10px; flex-wrap: wrap; }
.share-sheet .opts a, .share-sheet .opts button {
  background: rgba(255,255,255,.1); color: #fff; border: 0;
  padding: 9px 16px; border-radius: 999px; font-size: 13px; cursor: pointer; font-family: inherit;
}
