:root {
  color-scheme: dark;
  --bg: #131414;
  --bg-deep: #0b0c0c;
  --panel: #181a1a;
  --panel-soft: rgba(255, 255, 255, 0.055);
  --panel-strong: rgba(24, 26, 26, 0.92);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.64);
  --faint: rgba(255, 255, 255, 0.42);
  --accent: #ff7e0d;
  --accent-bright: #ff9233;
  --accent-hot: #f24f22;
  --accent-soft: #ffd3a3;
  --accent-ink: #20100a;
  --danger: #ffb26b;
  --shadow: 0 22px 64px rgba(0, 0, 0, 0.32);
  --deep-shadow: 0 34px 100px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% -12%, rgba(255, 126, 13, 0.18), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, #101212 48%, var(--bg-deep) 100%);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 28%),
    radial-gradient(circle at 80% 10%, rgba(255, 146, 51, 0.12), transparent 30%);
}

body.is-booting .app-shell {
  opacity: 0;
}

body.is-ready .app-shell {
  animation: app-ready 180ms ease both;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(255, 126, 13, 0.9);
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1920px, 100%);
  margin: 0 auto;
}

.home-stage {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  background: #131414;
}

.watch-stage {
  display: none;
  min-height: 100vh;
  flex-direction: column;
  gap: 22px;
  padding: 28px;
  background:
    radial-gradient(circle at 76% 0%, rgba(255, 126, 13, 0.16), transparent 31%),
    radial-gradient(circle at 12% 100%, rgba(255, 146, 51, 0.1), transparent 24%),
    linear-gradient(180deg, #171818 0%, #0b0c0c 100%);
}

body.is-watching .home-stage {
  display: none;
}

body.is-watching .watch-stage {
  display: flex;
}

.topbar,
.topbar-actions,
.home-nav,
.brand-lockup,
.hero-actions,
.section-heading,
.episode-meta,
.series-card,
.purchase-strip,
.episodes-header,
.store-grid,
.diamond-pack,
.drama-card-foot {
  display: flex;
}

.home-nav {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 20;
  width: min(1280px, calc(100% - 64px));
  height: 72px;
  transform: translateX(-50%);
  align-items: center;
  justify-content: space-between;
  gap: 26px;
}

.brand-lockup {
  align-items: center;
  gap: 10px;
  min-width: max-content;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-mark {
  position: relative;
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background-image: url("./assets/app-logo.png");
  background-position: center;
  background-size: cover;
  box-shadow: 0 10px 24px rgba(255, 126, 13, 0.28);
}

.brand-mark::after {
  content: none;
}

.home-nav nav {
  display: flex;
  gap: clamp(24px, 3.6vw, 48px);
  margin-right: auto;
}

.home-nav a {
  position: relative;
  color: rgba(255, 255, 255, 0.56);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 160ms ease;
}

.home-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: 16px;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  opacity: 0;
  transform: translateX(-50%) scaleX(0.7);
  transition: opacity 160ms ease, transform 160ms ease;
}

.home-nav a:hover,
.home-nav a.is-active {
  color: #fff;
}

.home-nav a:hover::after,
.home-nav a.is-active::after {
  opacity: 1;
  transform: translateX(-50%) scaleX(1);
}

.account-button {
  min-height: 36px;
  max-width: 168px;
  overflow: hidden;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(16px);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.account-button:hover {
  border-color: rgba(255, 126, 13, 0.62);
  background: rgba(255, 126, 13, 0.16);
  transform: translateY(-1px);
}

.topbar {
  width: min(1500px, 100%);
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.08;
}

.topbar-actions {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-actions .account-button {
  border-radius: 12px;
}

.eyebrow,
.episode-kicker {
  margin: 0 0 8px;
  color: var(--accent-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.hero-banner {
  position: relative;
  min-height: 848px;
  overflow: hidden;
  background: #131414;
  touch-action: pan-y;
}

.hero-banner::before,
.hero-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-banner::before {
  z-index: 2;
  background:
    linear-gradient(90deg, #131414 0%, rgba(19, 20, 20, 0.84) 20%, rgba(19, 20, 20, 0.24) 50%, rgba(19, 20, 20, 0.4) 75%, #131414 100%),
    linear-gradient(180deg, rgba(19, 20, 20, 0.32) 0%, rgba(19, 20, 20, 0.08) 35%, #131414 100%);
}

.hero-banner::after {
  z-index: 3;
  background:
    linear-gradient(180deg, transparent 0%, transparent 78%, #131414 100%),
    radial-gradient(ellipse at 68% 30%, rgba(255, 146, 51, 0.12), transparent 30%);
  mix-blend-mode: screen;
  animation: light-breathe 10s ease-in-out infinite alternate;
}

.hero-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--hero-cover-current, url("./assets/reference-hero.png"));
  background-position: center top;
  background-size: cover;
  filter: saturate(1.04) contrast(1.02);
  transform: translate3d(calc(var(--hero-drag, 0) * 18px), 0, 0) scale(1.01);
  transition: background-image 240ms ease, filter 240ms ease, opacity 240ms ease;
  animation: poster-drift 18s ease-in-out infinite alternate;
  will-change: transform, background-position;
}

.hero-image::before,
.hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background-position: center top;
  background-size: cover;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.hero-image::before {
  background: var(--hero-cover-prev, var(--hero-cover-current, url("./assets/reference-hero.png")));
  background-position: center top;
  background-size: cover;
}

.hero-image::after {
  background: var(--hero-cover-next, var(--hero-cover-current, url("./assets/reference-hero.png")));
  background-position: center top;
  background-size: cover;
}

.hero-image.is-sliding-next,
.hero-image.is-sliding-prev {
  background: transparent;
}

.hero-image.is-sliding-next::before,
.hero-image.is-sliding-next::after,
.hero-image.is-sliding-prev::before,
.hero-image.is-sliding-prev::after {
  opacity: 1;
}

.hero-image.is-sliding-next::before {
  animation: hero-cover-exit-left 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero-image.is-sliding-next::after {
  animation: hero-cover-enter-right 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero-image.is-sliding-prev::before {
  animation: hero-cover-exit-right 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero-image.is-sliding-prev::after {
  animation: hero-cover-enter-left 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero-banner.is-slide-next .hero-copy,
.hero-banner.is-slide-prev .hero-copy {
  animation: hero-copy-swap 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero-motion {
  position: absolute;
  inset: 70px 8% 110px 42%;
  z-index: 4;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 18%, rgba(255, 126, 13, 0.16) 43%, transparent 62%),
    radial-gradient(ellipse at 52% 45%, rgba(255, 211, 163, 0.12), transparent 32%);
  filter: blur(28px);
  mix-blend-mode: screen;
  opacity: 0.65;
  transform: translate3d(-4%, 0, 0) rotate(-2deg);
  animation: light-river 15s ease-in-out infinite alternate;
}

.hero-copy {
  position: absolute;
  left: max(32px, calc((100% - 1280px) / 2));
  bottom: 166px;
  z-index: 6;
  width: min(560px, 43vw);
}

.hero-copy::before {
  content: "HOT DRAMA";
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  margin-bottom: 18px;
  padding: 0 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  font-weight: 500;
}

.hero-title-image {
  display: block;
  width: min(480px, 100%);
  max-height: 320px;
  margin: 0 0 20px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 16px 44px rgba(0, 0, 0, 0.56));
  user-select: none;
}

.hero-title-image.is-hidden {
  display: none;
}

.hero-copy h1 {
  max-width: 560px;
  margin: 0 0 20px;
  color: #fff;
  font-size: clamp(46px, 5.3vw, 84px);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.04;
  text-shadow: 0 16px 44px rgba(0, 0, 0, 0.52);
  text-wrap: balance;
}

.hero-copy h1.has-title-image {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.hero-copy h1 span {
  display: inline-block;
  white-space: nowrap;
}

.hero-copy h1.is-long-title {
  max-width: 620px;
  font-size: clamp(42px, 4.35vw, 70px);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.hero-tags span {
  display: inline-flex;
  min-height: 32px;
  max-width: 166px;
  align-items: center;
  overflow: hidden;
  padding: 0 12px;
  border-radius: 6px;
  background: rgba(224, 224, 224, 0.08);
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

.hero-copy p {
  display: -webkit-box;
  max-width: 560px;
  margin: 0 0 28px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.58);
  font-size: 15px;
  line-height: 1.72;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.hero-actions {
  gap: 12px;
  flex-wrap: wrap;
}

.primary-button,
.ghost-button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0;
  transition: transform 160ms ease, filter 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.primary-button {
  padding: 0 22px;
  background: linear-gradient(92.27deg, var(--accent) 0.32%, var(--accent-bright) 100%);
  color: #fff;
  box-shadow: 0 16px 34px rgba(255, 126, 13, 0.28);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button:hover {
  filter: brightness(1.04);
  box-shadow: 0 18px 46px rgba(255, 126, 13, 0.34);
}

.primary-button:disabled {
  cursor: default;
  filter: grayscale(0.25);
  opacity: 0.62;
  transform: none;
}

.primary-button.compact {
  min-width: 86px;
}

.ghost-button {
  padding: 0 17px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}

.ghost-button:hover {
  border-color: rgba(255, 126, 13, 0.55);
  background: rgba(255, 126, 13, 0.12);
}

.play-button {
  display: flex;
  width: 192px;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 600;
}

.play-button span {
  width: 0;
  height: 0;
  border-left: 13px solid #fff;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
}

.featured-strip {
  position: absolute;
  right: max(32px, calc((100% - 1280px) / 2));
  bottom: 72px;
  z-index: 6;
  display: flex;
  width: min(708px, 50vw);
  height: 146px;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 16px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 2px 2px 10px;
  scroll-padding-inline: 2px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}

.featured-strip::-webkit-scrollbar {
  display: none;
}

.featured-card {
  width: 98px;
  flex: 0 0 98px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  scroll-snap-align: start;
  text-align: left;
  transition: opacity 180ms ease, transform 180ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.featured-card:not(.is-active) {
  opacity: 0.72;
}

.featured-card:hover,
.featured-card.is-active {
  opacity: 1;
  transform: translateY(-4px) scale(1.06);
}

.mini-cover {
  position: relative;
  display: block;
  width: 100%;
  height: 136px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--cover);
  background-position: center;
  background-size: cover;
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.42);
}

.featured-card.is-active .mini-cover {
  box-shadow:
    0 0 0 2px rgba(255, 126, 13, 0.9),
    0 24px 62px rgba(0, 0, 0, 0.5);
}

.featured-card.is-active .mini-cover::before {
  background:
    linear-gradient(180deg, rgba(255, 126, 13, 0.02), rgba(0, 0, 0, 0.38)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 34%);
}

.mini-cover::before,
.drama-cover::before,
.poster::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.42)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent 34%);
}

.mini-cover::after,
.drama-cover::after,
.poster::after {
  content: "";
  position: absolute;
  left: 35%;
  top: 24%;
  width: 30%;
  height: 42%;
  border-radius: 999px 999px 42% 42%;
  background: linear-gradient(#ffd8b4, rgba(90, 35, 25, 0.9));
}

.has-image-cover .mini-cover::after,
.has-image-cover .drama-cover::after,
.poster.has-image-cover::after {
  display: none;
}

.mini-rank {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 1;
  display: grid;
  min-width: 30px;
  min-height: 24px;
  place-items: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.46);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.featured-card strong {
  display: none;
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 6;
  display: grid;
  justify-items: center;
  gap: 6px;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.38);
  font-size: 12px;
}

.scroll-hint i,
.scroll-hint i::after {
  width: 10px;
  height: 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.46);
  border-bottom: 1px solid rgba(255, 255, 255, 0.46);
  transform: rotate(45deg);
}

.scroll-hint i::after {
  content: "";
  display: block;
  margin: 5px 0 0 5px;
}

@keyframes poster-drift {
  0% {
    transform: scale(1.01) translate3d(-0.35%, -0.2%, 0);
    background-position: center top;
  }

  100% {
    transform: scale(1.045) translate3d(0.45%, 0.3%, 0);
    background-position: 51% 2%;
  }
}

@keyframes light-river {
  0% {
    opacity: 0.42;
    transform: translate3d(-6%, -2%, 0) rotate(-3deg);
  }

  100% {
    opacity: 0.78;
    transform: translate3d(6%, 2%, 0) rotate(3deg);
  }
}

@keyframes light-breathe {
  0% {
    opacity: 0.62;
  }

  100% {
    opacity: 0.92;
  }
}

@keyframes app-ready {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes store-attention {
  0%,
  100% {
    filter: none;
  }

  35% {
    filter: drop-shadow(0 0 24px rgba(255, 126, 13, 0.38));
  }
}

@keyframes hero-cover-enter-right {
  0% {
    opacity: 0.92;
    transform: translate3d(34%, 0, 0) scale(1.035);
  }

  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes hero-cover-enter-left {
  0% {
    opacity: 0.92;
    transform: translate3d(-34%, 0, 0) scale(1.035);
  }

  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes hero-cover-exit-left {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }

  100% {
    opacity: 0.72;
    transform: translate3d(-24%, 0, 0) scale(1.035);
  }
}

@keyframes hero-cover-exit-right {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }

  100% {
    opacity: 0.72;
    transform: translate3d(24%, 0, 0) scale(1.035);
  }
}

@keyframes hero-copy-swap {
  0% {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
  }

  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.content-rail {
  width: min(1280px, calc(100% - 64px));
  margin: 0 auto;
  padding: 22px 0 96px;
}

.section-heading {
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 24px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.08;
}

.section-heading > span {
  color: var(--muted);
  font-size: 14px;
}

.drama-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 24px 18px;
}

.drama-card {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: transform 180ms ease;
}

.drama-card:hover,
.drama-card.is-active {
  transform: translateY(-7px);
}

.drama-cover {
  position: relative;
  aspect-ratio: 98 / 136;
  overflow: hidden;
  border-radius: 12px;
  background: var(--cover);
  background-position: center;
  background-size: cover;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
  transition: box-shadow 160ms ease, filter 160ms ease;
}

.drama-card:hover .drama-cover,
.drama-card.is-active .drama-cover {
  filter: saturate(1.08) contrast(1.03);
  box-shadow:
    0 0 0 2px rgba(255, 126, 13, 0.7),
    0 26px 62px rgba(0, 0, 0, 0.45);
}

.drama-badge,
.drama-count {
  position: absolute;
  z-index: 1;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  font-size: 11px;
  font-weight: 800;
}

.drama-badge {
  top: 10px;
  left: 10px;
  padding: 5px 8px;
  color: #fff;
}

.drama-count {
  right: 10px;
  bottom: 10px;
  padding: 5px 8px;
  color: #fff;
}

.drama-play {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 1;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(92.27deg, var(--accent) 0.32%, var(--accent-bright) 100%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.drama-play::before {
  content: "";
  margin-left: 3px;
  border-left: 10px solid #fff;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}

.drama-card:hover .drama-play,
.drama-card.is-active .drama-play {
  opacity: 1;
  transform: translateY(0);
}

.drama-card:hover .drama-count,
.drama-card.is-active .drama-count {
  opacity: 0;
}

.drama-info {
  padding-top: 12px;
}

.drama-card h3 {
  margin: 0 0 6px;
  overflow: hidden;
  color: var(--text);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drama-card p {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drama-card-foot {
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
  margin-top: 9px;
  color: var(--faint);
  font-size: 12px;
}

.drama-card-foot strong {
  color: var(--accent-soft);
  font-size: 13px;
}

.store-section {
  padding-top: 0;
  scroll-margin-top: 18px;
}

.store-section.is-attention {
  animation: store-attention 900ms ease both;
}

.store-grid {
  align-items: stretch;
  gap: 16px;
  margin-bottom: 14px;
}

.store-balance-tile,
.diamond-pack {
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 126, 13, 0.14), transparent 46%),
    rgba(255, 255, 255, 0.045);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.24);
}

.store-balance-tile {
  display: grid;
  min-width: 210px;
  flex: 0 0 260px;
  gap: 8px;
  padding: 20px;
}

.store-balance-tile span,
.diamond-pack span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.store-balance-tile strong {
  font-size: clamp(46px, 6vw, 76px);
  line-height: 0.95;
}

.store-balance-tile p,
.diamond-pack p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.diamond-pack {
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  padding: 20px;
}

.diamond-pack h3 {
  margin: 6px 0 7px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.05;
}

.diamond-pack > strong {
  color: var(--accent-soft);
  font-size: clamp(24px, 3vw, 34px);
  white-space: nowrap;
}

.diamond-pack .primary-button {
  min-width: 126px;
  flex: 0 0 auto;
}

.store-section .wallet-checkout {
  max-width: 520px;
  margin: 14px 0 0 auto;
}

.recharge-options {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.recharge-option {
  display: grid;
  min-height: 92px;
  gap: 4px;
  align-content: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.recharge-option:hover,
.recharge-option.is-active {
  border-color: rgba(255, 126, 13, 0.76);
  background:
    linear-gradient(145deg, rgba(255, 126, 13, 0.18), transparent 56%),
    rgba(255, 255, 255, 0.055);
  transform: translateY(-1px);
}

.recharge-option strong {
  font-size: 22px;
  line-height: 1;
}

.recharge-option span,
.recharge-option small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.recharge-option.is-active small {
  color: var(--accent-soft);
}

.custom-recharge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.custom-recharge span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.custom-recharge input {
  min-width: 0;
  flex: 1;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.custom-recharge input:focus {
  border-color: rgba(255, 126, 13, 0.76);
  box-shadow: 0 0 0 3px rgba(255, 126, 13, 0.14);
}

.player-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 408px);
  width: min(1500px, 100%);
  margin: 0 auto;
  flex: 1;
  gap: 18px;
  align-items: start;
}

.player-panel,
.playlist-panel {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 32%),
    rgba(24, 26, 26, 0.9);
  box-shadow: var(--deep-shadow);
  backdrop-filter: blur(18px);
}

.player-panel {
  min-width: 0;
  overflow: hidden;
  border-radius: 14px;
}

.video-frame {
  position: relative;
  min-height: min(54vh, 640px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 126, 13, 0.08), transparent 42%),
    #050505;
}

video,
.stream-player {
  display: block;
  width: 100%;
  height: 100%;
  background: #050505;
}

video {
  object-fit: contain;
}

.stream-player {
  border: 0;
}

.stream-player.is-hidden,
#videoPlayer.is-hidden {
  display: none;
}

.lock-overlay,
.video-issue {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 13px;
  padding: 24px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 126, 13, 0.18), transparent 28%),
    rgba(5, 6, 6, 0.84);
  backdrop-filter: blur(12px);
}

.lock-overlay.is-hidden,
.video-issue.is-hidden {
  display: none;
}

.video-issue {
  z-index: 3;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 146, 51, 0.14), transparent 30%),
    rgba(5, 6, 6, 0.9);
}

.video-issue h2,
.lock-overlay h2 {
  margin: 0;
  font-size: clamp(22px, 4vw, 34px);
}

.video-issue p,
.lock-overlay p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.lock-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  color: #fff;
  font-size: 30px;
  font-weight: 900;
}

.episode-meta {
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 28px 8px;
}

.episode-meta h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.08;
}

.episode-summary {
  margin: 0;
  padding: 0 28px 28px;
  color: var(--muted);
  line-height: 1.8;
}

.status-pill {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid rgba(255, 126, 13, 0.26);
  border-radius: 999px;
  background: rgba(255, 126, 13, 0.14);
  color: var(--accent-soft);
  font-size: 13px;
  font-weight: 800;
}

.status-pill.is-paid {
  border-color: rgba(255, 178, 107, 0.28);
  background: rgba(255, 178, 107, 0.14);
  color: var(--danger);
}

.playlist-panel {
  position: sticky;
  top: 22px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: 14px;
  padding: 18px;
}

.series-card {
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.series-card h2 {
  margin-bottom: 6px;
  font-size: 22px;
  line-height: 1.18;
}

.series-card p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.58;
}

.poster {
  position: relative;
  display: grid;
  flex: 0 0 92px;
  height: 132px;
  place-items: end center;
  overflow: hidden;
  padding-bottom: 12px;
  border-radius: 12px;
  background:
    var(--cover),
    linear-gradient(160deg, rgba(255, 207, 106, 0.92), transparent 48%),
    linear-gradient(20deg, #47202d, #0c080b);
  background-position: center;
  background-size: cover;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
}

.poster span {
  position: relative;
  z-index: 1;
}

.purchase-strip {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0;
  padding: 15px;
  border: 1px solid rgba(255, 126, 13, 0.24);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 126, 13, 0.16), transparent 56%),
    rgba(255, 255, 255, 0.045);
}

.purchase-strip span,
.episodes-header span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.purchase-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.purchase-strip.needs-recharge {
  border-color: rgba(255, 178, 107, 0.36);
  background:
    linear-gradient(135deg, rgba(255, 178, 107, 0.14), transparent 58%),
    rgba(255, 255, 255, 0.045);
}

.wallet-checkout {
  display: grid;
  gap: 9px;
  margin: -4px 0 18px;
}

.wallet-checkout.is-hidden,
.wallet-button-slot.is-hidden,
.wallet-status.is-hidden {
  display: none;
}

.wallet-checkout.is-busy {
  pointer-events: none;
  opacity: 0.68;
}

.wallet-button-slot {
  min-height: 44px;
}

.wallet-button-slot apple-pay-button {
  display: block;
  width: 100%;
  height: 44px;
  --apple-pay-button-border-radius: 8px;
  --apple-pay-button-width: 100%;
  --apple-pay-button-height: 44px;
}

.wallet-button-slot iframe,
.wallet-button-slot div {
  max-width: 100%;
}

.wallet-status {
  margin: 0;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.55;
}

.episodes-header {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.episodes-header h2 {
  margin: 0;
  font-size: 18px;
}

.episodes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  max-height: min(42vh, 360px);
  overflow: auto;
  padding-right: 4px;
}

.episode-button {
  position: relative;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.episode-button:hover,
.episode-button.is-active {
  border-color: rgba(255, 126, 13, 0.76);
  background: rgba(255, 126, 13, 0.16);
  color: #fff;
}

.episode-button:hover {
  transform: translateY(-1px);
}

.episode-button.is-locked::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 8px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--danger);
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  box-shadow: inset 0 -4px 0 var(--danger);
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 6, 6, 0.68);
  backdrop-filter: blur(14px);
}

.auth-modal.is-hidden,
.auth-form.is-hidden,
.profile-panel.is-hidden,
#displayNameField.is-hidden {
  display: none;
}

.auth-panel {
  position: relative;
  width: min(430px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 126, 13, 0.14), transparent 36%),
    rgba(24, 26, 26, 0.97);
  box-shadow: var(--deep-shadow);
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.auth-panel h2 {
  margin: 0 36px 8px 0;
  font-size: 28px;
  line-height: 1.18;
}

.auth-copy {
  margin-bottom: 18px;
  color: var(--muted);
  line-height: 1.65;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.auth-tabs button {
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.auth-tabs button.is-active {
  background: linear-gradient(92.27deg, var(--accent) 0.32%, var(--accent-bright) 100%);
  color: #fff;
}

.auth-tabs button:disabled {
  cursor: default;
  opacity: 0.72;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.auth-field input:focus {
  border-color: rgba(255, 126, 13, 0.76);
  box-shadow: 0 0 0 3px rgba(255, 126, 13, 0.14);
}

.auth-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.45;
}

.auth-submit {
  width: 100%;
  min-height: 46px;
}

.profile-panel {
  display: grid;
  gap: 16px;
}

.profile-panel > div {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.profile-avatar {
  display: grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.profile-panel h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.profile-panel p {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 1120px) {
  .hero-copy {
    width: min(520px, 52vw);
  }

  .featured-strip {
    width: min(440px, 40vw);
  }

  .player-layout {
    grid-template-columns: 1fr;
  }

  .playlist-panel {
    position: static;
  }
}

@media (max-width: 900px) {
  .watch-stage,
  .home-stage {
    min-height: auto;
  }

  .topbar,
  .home-nav,
  .section-heading {
    align-items: flex-start;
  }

  .home-nav {
    width: calc(100% - 32px);
    height: auto;
    flex-wrap: wrap;
    gap: 14px 18px;
    padding-top: 16px;
  }

  .home-nav nav {
    margin-right: 0;
  }

  .hero-banner {
    min-height: 760px;
  }

  .hero-image {
    background-position: 60% top;
  }

  .hero-copy {
    left: 18px;
    right: 18px;
    bottom: 210px;
    width: auto;
    max-width: 560px;
  }

  .hero-copy h1 {
    font-size: clamp(40px, 9vw, 64px);
  }

  .hero-copy h1.is-long-title {
    max-width: 560px;
    font-size: clamp(38px, 8vw, 58px);
  }

  .featured-strip {
    left: 18px;
    right: auto;
    bottom: 54px;
    width: calc(100% - 36px);
    justify-content: flex-start;
  }

  .content-rail {
    width: calc(100% - 40px);
  }

  .drama-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .video-frame {
    min-height: auto;
  }

  .store-grid,
  .diamond-pack {
    flex-direction: column;
  }

  .store-balance-tile {
    flex-basis: auto;
  }

  .store-section .wallet-checkout {
    max-width: none;
    margin-left: 0;
  }

  .recharge-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .topbar,
  .topbar-actions,
  .home-nav,
  .hero-actions,
  .section-heading,
  .episode-meta {
    flex-direction: column;
  }

  .watch-stage {
    gap: 16px;
    padding: 14px;
  }

  .brand-lockup {
    font-size: 16px;
  }

  .home-nav nav {
    width: 100%;
    justify-content: space-between;
    gap: 16px;
  }

  .home-nav .account-button {
    width: 100%;
    max-width: none;
  }

  .hero-banner {
    min-height: 780px;
  }

  .hero-banner::before {
    background:
      linear-gradient(90deg, rgba(19, 20, 20, 0.96), rgba(19, 20, 20, 0.28) 58%, rgba(19, 20, 20, 0.72)),
      linear-gradient(180deg, rgba(19, 20, 20, 0.5) 0%, transparent 28%, rgba(19, 20, 20, 0.96) 76%, #131414 100%);
  }

  .hero-image {
    background-position: 62% top;
    background-size: auto 100%;
    background-repeat: no-repeat;
  }

  .hero-image::before,
  .hero-image::after {
    background-position: 62% top;
    background-size: auto 100%;
    background-repeat: no-repeat;
  }

  .hero-motion {
    inset: 92px -12% 180px 18%;
  }

  .hero-copy {
    left: 14px;
    right: 14px;
    bottom: 218px;
  }

  .hero-copy::before {
    min-height: 28px;
    margin-bottom: 12px;
    font-size: 12px;
  }

  .hero-title-image {
    width: min(320px, 92vw);
    max-height: 180px;
    margin-bottom: 14px;
  }

  .hero-copy h1 {
    margin-bottom: 14px;
    font-size: 40px;
  }

  .hero-copy h1.is-long-title {
    font-size: 36px;
  }

  .hero-copy p {
    margin-bottom: 18px;
    font-size: 13px;
    -webkit-line-clamp: 2;
  }

  .hero-tags {
    gap: 8px;
  }

  .hero-tags span {
    min-height: 28px;
    padding: 0 10px;
    font-size: 12px;
  }

  .play-button {
    width: 168px;
    min-height: 48px;
    font-size: 18px;
  }

  .topbar-actions .ghost-button,
  .topbar-actions .account-button {
    width: auto;
    max-width: none;
  }

  .featured-strip {
    left: 14px;
    bottom: 54px;
    width: calc(100% - 28px);
    gap: 12px;
  }

  .featured-card {
    width: 86px;
    flex-basis: 86px;
  }

  .mini-cover {
    height: 120px;
    border-radius: 11px;
  }

  .scroll-hint {
    display: none;
  }

  .content-rail {
    width: calc(100% - 32px);
    padding: 10px 0 56px;
  }

  .drama-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 14px;
  }

  .drama-card h3 {
    font-size: 15px;
  }

  .player-panel,
  .playlist-panel,
  .auth-panel {
    border-radius: 12px;
  }

  .episode-meta {
    gap: 10px;
    padding: 20px 18px 7px;
  }

  .episode-summary {
    padding: 0 18px 22px;
  }

  .series-card {
    align-items: flex-start;
  }

  .diamond-pack .primary-button {
    width: 100%;
  }

  .recharge-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .custom-recharge {
    align-items: stretch;
    flex-direction: column;
  }

  .poster {
    flex-basis: 76px;
    height: 106px;
  }

  .episodes-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .auth-modal {
    padding: 14px;
  }

  .auth-panel {
    padding: 22px;
  }
}

@media (max-width: 380px) {
  .home-nav a {
    font-size: 13px;
  }

  .hero-copy h1 {
    font-size: 36px;
  }

  .hero-copy h1.is-long-title {
    font-size: 32px;
  }

  .featured-card {
    width: 80px;
    flex-basis: 80px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
