/* ==========================================================================
   PurrCine 3.0 — "NOCTURNE" redesign
   A complete visual rebuild loaded after every legacy layer. Warm cinematic
   gold + violet, floating glass navigation, an organised featured hero,
   readable filters, and a TikTok-style AI Drama feed.
   ========================================================================== */

:root {
  --ink: #07070c;
  --ink-2: #0b0b13;
  --ink-3: #111119;
  --surface: #12121b;
  --surface-2: #181822;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .17);
  --text: #f7f4ee;
  --muted: #a5a1b0;
  --muted-2: #716d80;
  --gold: #f8c14e;
  --gold-deep: #f0a52e;
  --coral: #ff7a59;
  --violet: #8b7bff;
  --teal: #45e0c0;
  --grad: linear-gradient(115deg, #f8c14e 0%, #ff7a59 46%, #8b7bff 100%);
  --grad-soft: linear-gradient(115deg, rgba(248,193,78,.16), rgba(139,123,255,.14));
  --radius: 22px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --shadow: 0 40px 100px -40px rgba(0, 0, 0, .9);
  --shadow-soft: 0 18px 50px -24px rgba(0, 0, 0, .8);
  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Fraunces', 'Outfit', Georgia, serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --header-h: 74px;
}

/* ------------------------------------------------------------------ base */
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  background: var(--ink) !important;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -.005em;
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: hidden;
}
body::before {
  background:
    radial-gradient(1200px 760px at 84% -14%, rgba(139,123,255,.16), transparent 62%),
    radial-gradient(1000px 680px at -6% 6%, rgba(248,193,78,.10), transparent 60%),
    radial-gradient(900px 600px at 50% 120%, rgba(255,122,89,.07), transparent 60%),
    linear-gradient(180deg, #08080f 0%, #07070c 55%, #07070c 100%) !important;
}
body::after { opacity: .07 !important; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 650; letter-spacing: -.03em; }
h1 { font-size: clamp(32px, 4.6vw, 60px); line-height: 1.02; }
h2 { font-size: clamp(24px, 2.8vw, 36px); line-height: 1.06; }
h3 { font-size: 19px; }
p { margin: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.container { width: min(1320px, calc(100% - 56px)); }
.section { padding: 56px 0; }
.section-tight { padding: 26px 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.eyebrow {
  color: var(--gold); font-size: 10.5px; font-weight: 800;
  letter-spacing: .22em; text-transform: uppercase;
}
.eyebrow::before { background: var(--grad); width: 26px; height: 2px; border-radius: 2px; }
::selection { background: rgba(248,193,78,.28); color: #fff; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------------------------------------------------------------- header */
.site-header {
  background: linear-gradient(180deg, rgba(7,7,12,.94), rgba(7,7,12,.42) 72%, transparent) !important;
  border-bottom: 1px solid transparent !important;
  padding-top: env(safe-area-inset-top);
}
.site-header.is-scrolled {
  background: rgba(8,8,14,.82) !important;
  backdrop-filter: blur(26px) saturate(150%);
  border-color: var(--line) !important;
  box-shadow: 0 18px 50px -30px rgba(0,0,0,.9);
}
.nav-wrap {
  height: var(--header-h) !important;
  width: min(1360px, calc(100% - 44px)) !important;
  gap: 22px !important;
}
.brand { gap: 10px !important; }
.brand img {
  width: 44px !important; height: 44px !important;
  border-radius: 0 !important; box-shadow: none !important;
  background: transparent !important;
  filter: drop-shadow(0 6px 16px rgba(248,193,78,.22));
}
.brand-word {
  font-family: var(--display) !important;
  font-size: 23px !important; font-weight: 650 !important;
  letter-spacing: -.045em !important; color: var(--text);
}
.brand-word span {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.main-nav {
  gap: 2px !important;
  padding: 5px !important;
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.main-nav a {
  padding: 8px 14px !important; border-radius: 999px !important;
  font-size: 12.5px !important; font-weight: 600 !important;
  color: var(--muted) !important; letter-spacing: .01em;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.main-nav a:hover { color: var(--text) !important; background: rgba(255,255,255,.06) !important; }
.main-nav a.active {
  color: #0a0a10 !important;
  background: var(--grad) !important;
  box-shadow: 0 8px 22px -10px rgba(248,193,78,.6) !important;
  font-weight: 700 !important;
}
.nav-actions { gap: 8px !important; }
.icon-btn {
  width: 40px !important; height: 40px !important; border-radius: 12px !important;
  border: 1px solid var(--line) !important;
  background: rgba(255,255,255,.04) !important; color: var(--text) !important;
}
.icon-btn:hover { background: rgba(255,255,255,.09) !important; border-color: var(--line-strong) !important; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.install-btn { border-radius: 999px !important; }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  font-family: var(--font); font-size: 13px; font-weight: 600; letter-spacing: .005em;
  white-space: nowrap; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), filter .2s var(--ease);
}
.btn-sm { height: 34px; padding: 0 14px; font-size: 12px; }
.btn-lg { height: 50px; padding: 0 26px; font-size: 14px; }
.btn-primary {
  background: var(--grad) !important; color: #0a0a10 !important; font-weight: 800 !important;
  box-shadow: 0 14px 34px -12px rgba(248,193,78,.7), inset 0 1px 0 rgba(255,255,255,.4) !important;
  position: relative; overflow: hidden;
}
.btn-primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,.45) 50%, transparent 80%);
  transform: translateX(-130%); transition: transform .6s var(--ease);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 22px 46px -14px rgba(248,193,78,.85) !important; filter: brightness(1.04); }
.btn-primary:hover::after { transform: translateX(130%); }
.btn-ghost, .btn-glass {
  background: rgba(255,255,255,.055) !important; border-color: var(--line) !important;
  color: var(--text) !important; backdrop-filter: blur(12px);
}
.btn-ghost:hover, .btn-glass:hover { background: rgba(255,255,255,.11) !important; border-color: var(--line-strong) !important; transform: translateY(-1px); }
.btn-ghost.is-saved { border-color: rgba(69,224,192,.5) !important; color: var(--teal) !important; background: rgba(69,224,192,.08) !important; }
.btn-violet { background: rgba(139,123,255,.16) !important; border-color: rgba(139,123,255,.42) !important; color: #ded8ff !important; }
.btn-violet:hover { background: rgba(139,123,255,.26) !important; }
.link-btn { background: none; border: 0; color: var(--gold); font-size: 12px; font-weight: 700; padding: 0; }

/* ---------------------------------------------------------------- chips */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex; align-items: center; height: 29px; padding: 0 13px;
  border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.04);
  color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  transition: .18s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--line-strong); background: rgba(255,255,255,.09); transform: translateY(-1px); }
.rating-pill {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px;
  border-radius: 8px; background: rgba(248,193,78,.15); color: #ffd27a;
  font-size: 11px; font-weight: 800; letter-spacing: .02em;
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(69,224,192,.16); animation: pulseDot 2.4s infinite; }
@keyframes pulseDot { 50% { box-shadow: 0 0 0 7px rgba(69,224,192,0); } }

/* --------------------------------------------------------------- panels */
.panel {
  background: rgba(18,18,27,.72) !important; border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important; padding: 24px !important;
  backdrop-filter: blur(18px); box-shadow: var(--shadow-soft);
  min-width: 0; max-width: 100%;
}
.panel-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-head h2, .panel-head h3 { margin-top: 6px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-title { margin-top: 6px; }
.section-title span { color: var(--gold); }
.section-link {
  color: var(--muted); font-size: 12.5px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  transition: color .18s var(--ease), gap .18s var(--ease);
}
.section-link:hover { color: var(--text); gap: 10px; }

/* ============================================================== HERO 3.0 */
.hero-v3 {
  position: relative;
  width: 100%;
  min-height: clamp(640px, 90vh, 920px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background: var(--ink);
  isolation: isolate;
}
.hero-v3-slides { position: absolute; inset: 0; }
.hero-v3-slide {
  position: absolute; inset: 0;
  display: flex; align-items: center;
  opacity: 0; visibility: hidden; z-index: 1;
  transition: opacity .7s var(--ease), visibility .7s;
}
.hero-v3-slide.is-active { opacity: 1; visibility: visible; z-index: 2; }
.hero-v3-media { position: absolute; inset: 0; z-index: 0; }
.hero-v3-media img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 26%;
  transform: scale(1.06);
  transition: transform 9s linear;
}
.hero-v3-slide.is-active .hero-v3-media img { transform: scale(1); }
.hero-v3-scrim {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(90deg, rgba(7,7,12,.98) 0%, rgba(7,7,12,.86) 30%, rgba(7,7,12,.32) 62%, rgba(7,7,12,.66) 100%),
    linear-gradient(0deg, var(--ink) 0%, rgba(7,7,12,.6) 26%, transparent 58%),
    radial-gradient(900px 500px at 18% 70%, rgba(139,123,255,.16), transparent 60%);
}
.hero-v3-grid {
  position: relative; z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(240px, 360px);
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
  padding: calc(var(--header-h) + 46px) 0 150px;
}
.hero-v3-copy { min-width: 0; max-width: 680px; }
.hero-v3-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.hero-v3-badge {
  display: inline-flex; align-items: center; height: 27px; padding: 0 12px;
  border-radius: 8px; background: var(--grad); color: #0a0a10;
  font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
}
.hero-v3-rating {
  display: inline-flex; align-items: center; gap: 5px; height: 27px; padding: 0 10px;
  border-radius: 8px; background: rgba(248,193,78,.14); border: 1px solid rgba(248,193,78,.28);
  color: #ffd27a; font-size: 11.5px; font-weight: 800;
}
.hero-v3-year, .hero-v3-type {
  color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em;
}
.hero-v3-type {
  padding-left: 10px; border-left: 1px solid var(--line-strong); text-transform: uppercase;
  font-size: 10.5px; letter-spacing: .16em;
}
.hero-v3-title {
  font-size: clamp(40px, 6vw, 82px) !important;
  line-height: .94 !important;
  letter-spacing: -.045em !important;
  margin: 0 0 12px !important;
  max-width: 15ch;
  text-shadow: 0 24px 70px rgba(0,0,0,.6);
}
.hero-v3-tag {
  font-family: var(--display); font-style: italic;
  color: #e6c79a; font-size: 17px; margin-bottom: 12px;
}
.hero-v3-overview {
  color: #cfcbdb; font-size: 14.5px; line-height: 1.72;
  max-width: 54ch; margin-bottom: 26px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-v3-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-bottom: 26px; }
.hero-v3-actions .btn { min-height: 50px; }
.hero-v3-facts {
  display: flex; flex-wrap: wrap; gap: 10px 26px;
  padding-top: 20px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 11.5px;
}
.hero-v3-facts span { display: inline-flex; align-items: center; gap: 7px; }
.hero-v3-facts b {
  color: var(--text); font-weight: 800; font-size: 11px; letter-spacing: .06em;
  padding: 2px 7px; border-radius: 5px; background: rgba(255,255,255,.07); border: 1px solid var(--line);
}
.hero-v3-poster { position: relative; justify-self: end; width: 100%; max-width: 340px; }
.hero-v3-poster-card {
  position: relative; border-radius: 20px; overflow: hidden;
  aspect-ratio: 2/3;
  box-shadow: 0 40px 90px -24px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.12);
  transform: perspective(1000px) rotateY(-6deg) rotateX(2deg);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.hero-v3-poster:hover .hero-v3-poster-card {
  transform: perspective(1000px) rotateY(0deg) rotateX(0deg) translateY(-6px);
  box-shadow: 0 54px 110px -24px rgba(0,0,0,.95), 0 0 0 1px rgba(248,193,78,.3);
}
.hero-v3-poster-card img { width: 100%; height: 100%; object-fit: cover; }
.hero-v3-poster-card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(7,7,12,.7), transparent 45%);
}
.hero-v3-poster-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.16); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.4); color: #fff; font-size: 18px; padding-left: 4px;
  z-index: 2; transition: .25s var(--ease);
}
.hero-v3-poster-play:hover { background: var(--grad); color: #0a0a10; border-color: transparent; transform: translate(-50%,-50%) scale(1.08); }
.hero-v3-poster-glow {
  position: absolute; inset: 12% 8% -8%;
  background: var(--grad); filter: blur(60px); opacity: .28; z-index: -1; border-radius: 50%;
}
.hero-v3-rail {
  position: absolute; left: 0; right: 0; bottom: 30px; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.hero-v3-dots {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 999px;
  background: rgba(10,10,16,.6); border: 1px solid var(--line); backdrop-filter: blur(14px);
}
.hero-v3-dot {
  width: 9px; height: 9px; padding: 0; border: 0; border-radius: 999px;
  background: rgba(255,255,255,.28); cursor: pointer; transition: width .3s var(--ease), background .3s;
}
.hero-v3-dot.is-active { width: 30px; background: var(--grad); }
.hero-v3-controls { display: flex; align-items: center; gap: 10px; }
.hero-v3-controls button {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(10,10,16,.6);
  color: var(--text); font-size: 20px; line-height: 1;
  backdrop-filter: blur(14px); transition: .2s var(--ease);
}
.hero-v3-controls button:hover { background: var(--grad); color: #0a0a10; border-color: transparent; transform: translateY(-2px); }
.hero-v3-count {
  font-size: 11.5px; font-weight: 700; letter-spacing: .1em; color: var(--muted);
  min-width: 56px; text-align: center;
}
.hero-v3-count b { color: var(--text); }

/* ------------------------------------------------------------ section rows */
.movie-row {
  display: grid !important;
  grid-auto-flow: column !important;
  grid-auto-columns: 190px !important;
  gap: 18px !important;
  overflow-x: auto !important;
  padding: 6px 2px 22px !important;
  scroll-snap-type: x proximity;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent;
}
.movie-row::-webkit-scrollbar { height: 6px; }
.movie-row::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 99px; }
.movie-card { scroll-snap-align: start; position: relative; }
.card-poster {
  position: relative; display: block; aspect-ratio: 2/3;
  border-radius: var(--radius-sm); overflow: hidden; background: var(--ink-3);
  box-shadow: 0 16px 36px -18px rgba(0,0,0,.85);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), outline-color .3s;
  outline: 1px solid transparent;
}
.card-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), filter .3s; }
.movie-card:hover .card-poster { transform: translateY(-8px); box-shadow: 0 32px 60px -20px rgba(0,0,0,.95); outline-color: rgba(248,193,78,.4); }
.movie-card:hover .card-poster img { transform: scale(1.06); }
.card-shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(7,7,12,.85) 0%, transparent 48%); opacity: .65; transition: opacity .3s; }
.movie-card:hover .card-shade { opacity: 1; }
.card-badge {
  position: absolute; top: 10px; left: 10px; height: 23px; padding: 0 9px;
  display: inline-flex; align-items: center; border-radius: 7px;
  background: rgba(7,7,12,.72); backdrop-filter: blur(8px);
  color: var(--text); font-size: 9.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid rgba(255,255,255,.14);
}
.card-badge-tv { background: rgba(139,123,255,.3); border-color: rgba(139,123,255,.45); color: #e2ddff; }
.card-play {
  position: absolute; inset: 0; margin: auto; width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255,255,255,.16); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.34); color: #fff; font-size: 14px; padding-left: 3px;
  opacity: 0; transform: scale(.8); transition: .3s var(--ease);
}
.movie-card:hover .card-play { opacity: 1; transform: scale(1); }
.card-body { padding: 10px 2px 0; position: relative; }
.card-meta { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.card-meta .rating-pill { height: 20px; padding: 0 6px; font-size: 10px; }
.card-body h3 {
  font-family: var(--font) !important; font-size: 13.5px !important; font-weight: 600 !important;
  letter-spacing: -.01em; margin-top: 4px; line-height: 1.32;
}
.card-body h3 a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.watchlist-mini {
  position: absolute; top: 8px; right: 0; width: 27px; height: 27px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(10,10,18,.72); color: var(--text);
  font-size: 14px; line-height: 1; display: grid; place-items: center; opacity: 0; transition: .2s;
}
.movie-card:hover .watchlist-mini, .watchlist-mini.is-saved { opacity: 1; }
.watchlist-mini.is-saved { color: var(--teal); border-color: rgba(69,224,192,.45); }

/* continue */
.continue-row {
  display: grid !important; grid-auto-flow: column !important; grid-auto-columns: 320px !important;
  gap: 18px !important; overflow-x: auto !important; padding: 6px 2px 18px !important;
  scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent;
}
.continue-row::-webkit-scrollbar { height: 6px; }
.continue-row::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 99px; }
.continue-card {
  scroll-snap-align: start; display: block; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-soft);
  transition: transform .3s var(--ease), border-color .3s;
}
.continue-card:hover { transform: translateY(-5px); border-color: rgba(248,193,78,.35); }
.continue-art { position: relative; display: block; aspect-ratio: 16/9; overflow: hidden; background: var(--ink-3); }
.continue-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.continue-card:hover .continue-art img { transform: scale(1.06); }
.continue-shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(7,7,12,.75), transparent 60%); }
.continue-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.16); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.34);
  color: #fff; font-size: 14px; padding-left: 3px; transition: .25s var(--ease);
}
.continue-card:hover .continue-play { background: var(--grad); color: #0a0a10; border-color: transparent; transform: translate(-50%,-50%) scale(1.08); }
.continue-badge {
  position: absolute; top: 10px; left: 10px; height: 22px; padding: 0 8px; display: inline-flex; align-items: center;
  border-radius: 6px; background: rgba(7,7,12,.72); backdrop-filter: blur(8px); font-size: 9.5px;
  font-weight: 800; letter-spacing: .1em; text-transform: uppercase; border: 1px solid rgba(255,255,255,.14);
}
.continue-body, .continue-copy { display: block; padding: 13px 15px 15px; }
.continue-body strong, .continue-copy strong { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.continue-body small, .continue-copy small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.continue-bar { display: block; height: 4px; border-radius: 99px; background: rgba(255,255,255,.1); margin-top: 10px; overflow: hidden; }
.continue-bar i { display: block; height: 100%; border-radius: 99px; background: var(--grad); }
.continue-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0,0,0,.45); }
.continue-progress i { display: block; height: 100%; background: var(--grad); }

/* genre strip */
.genre-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.genre-strip::-webkit-scrollbar { display: none; }
.genre-chip {
  flex: none; height: 36px; padding: 0 17px; display: inline-flex; align-items: center;
  border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.035);
  color: var(--muted); font-size: 12.5px; font-weight: 600; transition: .18s var(--ease);
}
.genre-chip:hover { color: var(--text); border-color: var(--line-strong); background: rgba(255,255,255,.08); transform: translateY(-1px); }
.genre-chip:first-child { background: var(--grad); color: #0a0a10; border-color: transparent; font-weight: 800; }

/* ------------------------------------------------------------ filter panel */
.filter-panel {
  display: grid !important;
  grid-template-columns: minmax(200px, 1.1fr) minmax(0, 2.2fr) minmax(160px, auto);
  align-items: end;
  gap: 14px;
  padding: 18px !important;
  border: 1px solid var(--line) !important;
  background: rgba(18,18,27,.82) !important;
  border-radius: 18px !important;
  margin: 22px 0 26px !important;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
}
.filter-panel .field { display: grid; gap: 6px; min-width: 0; }
.filter-form { display: contents; }
.filter-panel .type-toggle { grid-column: 1 / -1; justify-self: start; margin-top: 2px; }
.filter-panel .field > span {
  font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted-2);
}
.filter-panel .filter-fields {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
}
.filter-search-wrap {
  position: relative; display: flex; align-items: center;
}
.filter-search-wrap svg {
  position: absolute; left: 14px; width: 17px; height: 17px;
  fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; pointer-events: none;
}
.filter-search-wrap .input { padding-left: 42px !important; }
.filter-panel .input,
.filter-panel .select {
  width: 100% !important; max-width: none !important; height: 46px !important;
  background-color: rgba(255,255,255,.055) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  border-radius: 11px !important;
  font-size: 13px !important;
}
.filter-panel .input::placeholder { color: var(--muted-2); }
.filter-panel .select { padding-right: 34px !important; }
.filter-panel .filter-actions { display: flex; gap: 8px; }
.filter-panel .filter-actions .btn { height: 46px; }
.filter-panel .btn-ghost { background: rgba(255,255,255,.05) !important; }

/* readable native selects everywhere */
select, .select {
  color: var(--text) !important;
  color-scheme: dark;
}
select option, .select option, select.select option {
  background-color: #12121b !important;
  color: #f7f4ee !important;
}
select optgroup, .select optgroup { background-color: #12121b; color: #a5a1b0; }

/* type toggle */
.type-toggle {
  display: inline-flex !important; gap: 3px !important; padding: 4px !important;
  border-radius: 999px !important; background: rgba(255,255,255,.04) !important;
  border: 1px solid var(--line) !important;
}
.type-pill {
  height: 34px; padding: 0 16px; display: inline-flex; align-items: center;
  border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted);
  transition: .18s var(--ease);
}
.type-pill:hover { color: var(--text); }
.type-pill.active { background: var(--grad) !important; color: #0a0a10 !important; font-weight: 800; }

/* page hero */
.page-hero {
  padding: calc(var(--header-h) + 44px) 0 8px;
  position: relative;
}
.page-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(900px 420px at 16% 0%, rgba(139,123,255,.16), transparent 62%);
}
.page-hero h1 { margin: 8px 0 10px; }
.page-hero > .container > p { color: var(--muted); max-width: 560px; font-size: 13.5px; }

/* movie grid */
.movie-grid { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important; gap: 22px 16px !important; }

/* ---------------------------------------------------------------- footer */
.site-footer {
  position: relative;
  margin-top: 60px !important;
  padding: 0 !important;
  border-top: 1px solid var(--line) !important;
  background:
    radial-gradient(900px 380px at 12% 0%, rgba(139,123,255,.12), transparent 60%),
    radial-gradient(700px 320px at 88% 10%, rgba(248,193,78,.08), transparent 60%),
    #09090f !important;
}
.footer-grid {
  display: grid !important;
  grid-template-columns: 1.7fr repeat(3, 1fr) !important;
  gap: 36px !important;
  padding: 54px 0 40px !important;
}
.footer-brand .brand img { width: 40px !important; height: 40px !important; }
.footer-brand p { color: var(--muted) !important; font-size: 12.5px !important; line-height: 1.75 !important; max-width: 330px !important; margin-top: 14px !important; }
.footer-small { color: var(--muted-2) !important; font-size: 10.5px !important; margin-top: 14px !important; }
.site-footer h4 {
  font-family: var(--font) !important; font-size: 10.5px !important; font-weight: 800 !important;
  letter-spacing: .16em !important; text-transform: uppercase !important;
  color: var(--gold) !important; margin-bottom: 14px !important;
}
.site-footer .footer-grid > div:not(.footer-brand) { display: grid !important; align-content: start !important; gap: 9px !important; }
.site-footer .footer-grid a { color: var(--muted) !important; font-size: 12.5px !important; transition: color .18s, transform .18s; }
.site-footer .footer-grid a:hover { color: var(--text) !important; transform: translateX(3px); }
.footer-bottom {
  display: flex !important; justify-content: space-between !important; gap: 12px !important;
  padding: 20px 0 30px !important; border-top: 1px solid var(--line) !important;
  color: var(--muted-2) !important; font-size: 11px !important; flex-wrap: wrap;
}
.footer-bottom a { color: var(--muted); }
.footer-bottom a:hover { color: var(--text); }

/* --------------------------------------------------------- mobile nav/dock */
.mobile-nav {
  display: none;
  position: fixed;
  top: calc(var(--header-h) + env(safe-area-inset-top) + 8px);
  right: 12px;
  left: auto;
  width: min(330px, calc(100% - 24px));
  z-index: 260;
  padding: 12px;
  border-radius: 18px;
  background: rgba(12,12,19,.96);
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.9);
  backdrop-filter: blur(24px);
  grid-template-columns: 1fr;
  gap: 3px;
  transform-origin: top right;
  animation: menuIn .22s var(--ease);
}
.mobile-nav.open { display: grid !important; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-8px) scale(.97); } to { opacity: 1; transform: none; } }
.mobile-nav a {
  padding: 12px 14px; border-radius: 11px; color: var(--text);
  font-size: 13.5px; font-weight: 600;
}
.mobile-nav a:hover, .mobile-nav a:focus { background: rgba(255,255,255,.06); }
.mobile-nav a:first-child { background: rgba(248,193,78,.1); }
.mobile-dock { display: none; }

/* --------------------------------------------------------------- anime page */
.anime-hero {
  position: relative;
  padding: calc(var(--header-h) + 54px) 0 20px;
  overflow: hidden;
}
.anime-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(800px 380px at 18% 0%, rgba(255,122,89,.16), transparent 62%),
    radial-gradient(700px 360px at 82% 8%, rgba(139,123,255,.18), transparent 62%);
}
.anime-hero .container { position: relative; }
.anime-hero h1 { font-size: clamp(38px, 6vw, 72px); margin: 10px 0 12px; }
.anime-hero h1 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.anime-hero p { color: var(--muted); max-width: 620px; font-size: 14px; }
/* media-backed anime spotlight */
.anime-hero { min-height: 560px; display: flex; align-items: flex-end; }
.anime-hero-media { position: absolute; inset: 0; z-index: 0; }
.anime-hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 24%; }
.anime-hero-scrim {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(90deg, rgba(7,7,12,.97) 0%, rgba(7,7,12,.8) 40%, rgba(7,7,12,.3) 78%, rgba(7,7,12,.6) 100%),
    linear-gradient(0deg, var(--ink) 0%, rgba(7,7,12,.55) 34%, transparent 70%);
}
.anime-hero-inner { position: relative; z-index: 2; padding-bottom: 44px; }
.anime-hero-copy { max-width: 660px; }
.anime-hero-kicker {
  display: inline-flex; align-items: center; height: 28px; padding: 0 13px;
  border-radius: 8px; background: var(--grad); color: #0a0a10;
  font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
}
.anime-hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 14px 0 22px; color: var(--muted); font-size: 12.5px; }
.section-sub { color: var(--muted); font-size: 13px; margin-top: 6px; max-width: 60ch; }
.anime-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.anime-tab {
  height: 40px; padding: 0 18px; display: inline-flex; align-items: center;
  border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.04);
  color: var(--muted); font-size: 12.5px; font-weight: 600; transition: .18s var(--ease);
}
.anime-tab:hover { color: var(--text); background: rgba(255,255,255,.08); }
.anime-tab.active { background: var(--grad); color: #0a0a10; border-color: transparent; font-weight: 800; }
.anime-spotlight {
  display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 24px;
  margin-top: 34px;
}
.anime-spotlight-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  min-height: 300px; border: 1px solid var(--line);
  display: flex; align-items: flex-end;
}
.anime-spotlight-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.anime-spotlight-card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(7,7,12,.96) 0%, rgba(7,7,12,.5) 46%, transparent 80%);
}
.anime-spotlight-copy { position: relative; z-index: 2; padding: 26px; }
.anime-spotlight-copy h2 { font-size: clamp(24px, 3vw, 38px); margin: 8px 0; }
.anime-spotlight-copy p { color: #cfcbdb; font-size: 13px; max-width: 520px; }
.anime-spotlight-side { display: grid; gap: 12px; }
.anime-mini {
  display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center;
  padding: 10px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255,255,255,.03); transition: .2s var(--ease);
}
.anime-mini:hover { background: rgba(255,255,255,.07); border-color: var(--line-strong); transform: translateX(3px); }
.anime-mini img { width: 64px; aspect-ratio: 2/3; object-fit: cover; border-radius: 8px; }
.anime-mini strong { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.anime-mini small { color: var(--muted); font-size: 11px; }

/* ------------------------------------------------------------- AI drama feed */
.drama-feed-shell { padding: calc(var(--header-h) + 20px) 0 30px; }
.drama-feed-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 22px;
}
.drama-feed-head h1 { font-size: clamp(30px, 4.6vw, 52px); margin: 8px 0 8px; }
.drama-feed-head h1 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.drama-feed-head p { color: var(--muted); max-width: 560px; font-size: 13.5px; }
.drama-feed {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}
.drama-tile {
  position: relative; border-radius: 18px; overflow: hidden; border: 1px solid var(--line);
  background: var(--surface); aspect-ratio: 9/14; display: flex; align-items: flex-end;
  transition: transform .35s var(--ease), border-color .3s, box-shadow .35s;
}
.drama-tile:hover { transform: translateY(-6px); border-color: rgba(248,193,78,.4); box-shadow: 0 30px 60px -20px rgba(0,0,0,.9); }
.drama-tile-bg { position: absolute; inset: 0; }
.drama-tile-bg img { width: 100%; height: 100%; object-fit: cover; }
.drama-tile-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(7,7,12,.96) 0%, rgba(7,7,12,.42) 46%, rgba(7,7,12,.1) 100%);
}
.drama-tile-top {
  position: absolute; top: 12px; left: 12px; right: 12px; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.drama-tile-tag {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
  border-radius: 7px; background: rgba(7,7,12,.7); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.16); font-size: 9.5px; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
}
.drama-tile-play {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.18); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.36); font-size: 12px; padding-left: 2px;
  transition: .25s var(--ease);
}
.drama-tile:hover .drama-tile-play { background: var(--grad); color: #0a0a10; border-color: transparent; transform: scale(1.08); }
.drama-tile-copy { position: relative; z-index: 2; padding: 16px; width: 100%; }
.drama-tile-copy h3 { font-size: 17px; margin-bottom: 5px; line-height: 1.15; }
.drama-tile-copy p { color: var(--muted); font-size: 11.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.drama-tile-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.drama-tile-meta span {
  font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px; background: rgba(255,255,255,.08); border: 1px solid var(--line);
}
.drama-vertical {
  display: grid; grid-auto-flow: column; grid-auto-columns: 300px; gap: 16px;
  overflow-x: auto; padding: 4px 2px 18px; scroll-snap-type: x mandatory;
}
.drama-vertical .drama-tile { scroll-snap-align: start; }

/* feed extras */
.drama-tile-bg { background: linear-gradient(160deg, var(--tile-a, #8b5cf6), var(--tile-b, #e9b85c)); }
.drama-tile-bg::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 20% 0%, rgba(255,255,255,.28), transparent 55%),
    radial-gradient(90% 70% at 90% 100%, rgba(0,0,0,.5), transparent 60%);
}
.drama-tile-emoji { font-size: 26px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.5)); }
.drama-tile-copy strong { display: block; font-family: var(--display); font-size: 17px; line-height: 1.15; margin-bottom: 6px; }
.drama-tile-meta { display: block; color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.drama-tile-line { display: block; color: #cfcbdb; font-size: 11.5px; line-height: 1.5; margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.drama-feed-stats { display: flex; gap: 10px; }
.drama-feed-stats div {
  display: grid; gap: 2px; padding: 12px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(255,255,255,.04); min-width: 92px;
}
.drama-feed-stats b { font-family: var(--display); font-size: 22px; line-height: 1; }
.drama-feed-stats span { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.drama-spotlight {
  position: relative; display: flex; align-items: center; gap: 18px; overflow: hidden;
  border-radius: 20px; border: 1px solid var(--line); padding: 20px 24px; margin-bottom: 22px;
  background: rgba(255,255,255,.03); transition: border-color .25s, transform .25s;
}
.drama-spotlight:hover { border-color: rgba(248,193,78,.4); transform: translateY(-2px); }
.drama-spotlight-bg { position: absolute; inset: 0; opacity: .22; filter: blur(6px); }
.drama-spotlight-emoji { position: relative; z-index: 2; font-size: 54px; line-height: 1; }
.drama-spotlight-copy { position: relative; z-index: 2; display: grid; gap: 5px; flex: 1; min-width: 0; }
.drama-spotlight-copy strong { font-family: var(--display); font-size: clamp(20px, 2.4vw, 30px); line-height: 1.1; }
.drama-spotlight-copy small { color: var(--muted); font-size: 12px; }
.drama-spotlight-play {
  position: relative; z-index: 2; height: 46px; padding: 0 22px; display: inline-flex; align-items: center;
  border-radius: 999px; background: var(--grad); color: #0a0a10; font-weight: 800; font-size: 13px;
  white-space: nowrap;
}
.drama-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.drama-filter {
  height: 38px; padding: 0 16px; display: inline-flex; align-items: center; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--muted);
  font-size: 12px; font-weight: 600; transition: .18s var(--ease);
}
.drama-filter:hover { color: var(--text); background: rgba(255,255,255,.08); }
.drama-filter.active { background: var(--grad); color: #0a0a10; border-color: transparent; font-weight: 800; }

/* legacy drama detail bits */
.drama-hero { padding: 10px 0 6px; }
.drama-badge {
  display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 7px;
  background: rgba(248,193,78,.14); border: 1px solid rgba(248,193,78,.3);
  color: #ffd27a; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
.drama-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.drama-card { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); transition: .25s var(--ease); }
.drama-card:hover { transform: translateY(-5px); border-color: rgba(248,193,78,.4); }
.drama-poster { aspect-ratio: 2/3; display: grid; place-items: center; background: var(--drama-bg, #8b7bff); font-size: 54px; }
.drama-card-body { padding: 12px 14px 15px; }
.drama-card-body h3 { font-size: 15px; }
.drama-card-body p { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.drama-watch-layout { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 22px; align-items: start; }
.drama-stage { aspect-ratio: 16/9; border-radius: 18px; overflow: hidden; display: grid; place-items: center; padding: 30px; text-align: center; border: 1px solid var(--line); }
.drama-scene-text { font-family: var(--display); font-size: clamp(20px, 3vw, 34px); line-height: 1.25; max-width: 780px; }
.drama-scene-kicker { color: var(--gold); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; margin-bottom: 12px; }
.drama-scene-speaker { color: var(--muted); margin-top: 14px; font-size: 12px; }
.drama-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 12px; }
.drama-progress { flex: 1; min-width: 120px; height: 5px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.drama-progress span { display: block; height: 100%; width: 0; background: var(--grad); }
.drama-scene-list { display: grid; gap: 6px; max-height: 380px; overflow-y: auto; }
.drama-scene-row { display: flex; gap: 10px; padding: 9px; border-radius: 10px; border: 1px solid transparent; }
.drama-scene-row:hover { background: rgba(255,255,255,.05); }
.drama-scene-row .num { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: rgba(255,255,255,.07); font-size: 10px; font-weight: 700; flex: none; }
.drama-scene-row strong { font-size: 12px; }
.drama-scene-row p { color: var(--muted); font-size: 11px; line-height: 1.45; }

/* --------------------------------------------------------- watch page polish */
.watch-body { background: #05050a !important; }
.watch-shell { padding: calc(var(--header-h) + 18px) 0 60px; }
.player-card { border-radius: 18px !important; }
.player-toolbar { background: linear-gradient(180deg, #0c0c15, #08080f) !important; }
.tool-btn-accent { background: var(--grad) !important; color: #0a0a10 !important; }
.sheet-card { background: #0c0c15 !important; }
.sheet-server.is-active { border-color: rgba(248,193,78,.5) !important; background: rgba(248,193,78,.08) !important; }
.sheet-server.is-active .sheet-server-state { color: var(--gold) !important; }

/* --------------------------------------------------------------- forms */
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], textarea, .input {
  background: rgba(255,255,255,.045) !important; border: 1px solid var(--line) !important;
  border-radius: 11px !important; color: var(--text) !important; padding: 11px 13px !important;
  font-size: 13px !important; width: 100%;
}
input:focus, textarea:focus, .input:focus { outline: none !important; border-color: rgba(248,193,78,.6) !important; box-shadow: 0 0 0 3px rgba(248,193,78,.14) !important; }
.input::placeholder, input::placeholder, textarea::placeholder { color: var(--muted-2) !important; }

/* --------------------------------------------------------------- misc */
.empty-state { text-align: center; padding: 64px 20px; border-radius: var(--radius); border: 1px dashed var(--line-strong); background: rgba(255,255,255,.015); }
.empty-state h1, .empty-state h2 { margin: 10px 0 8px; }
.empty-state p { color: var(--muted); font-size: 13.5px; max-width: 440px; margin: 0 auto; }
.empty-actions { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 34px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0 10px;
  border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.04);
  color: var(--muted); font-size: 12.5px; font-weight: 600;
}
.pagination a:hover { color: var(--text); background: rgba(255,255,255,.09); }
.pagination .current { background: var(--grad); color: #0a0a10; border-color: transparent; font-weight: 800; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  z-index: 9000; padding: 12px 20px; border-radius: 999px;
  background: rgba(18,18,27,.96); border: 1px solid var(--line-strong);
  color: var(--text); font-size: 12.5px; font-weight: 600;
  box-shadow: 0 20px 50px -16px rgba(0,0,0,.9); opacity: 0; pointer-events: none;
  transition: .25s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* search overlay */
.search-overlay { position: fixed; inset: 0; z-index: 400; display: grid; place-items: start center; padding: 90px 20px 20px; background: rgba(4,4,8,.82); backdrop-filter: blur(16px); opacity: 0; visibility: hidden; transition: .25s var(--ease); }
.search-overlay.open { opacity: 1; visibility: visible; }
.search-panel { width: min(720px, 100%); background: rgba(16,16,24,.96); border: 1px solid var(--line-strong); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); }
.search-head { display: flex; gap: 10px; align-items: center; }
.search-form { flex: 1; display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 50px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.search-form svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.search-form input { border: 0 !important; background: none !important; padding: 0 !important; }
.search-results { margin-top: 14px; display: grid; gap: 7px; max-height: 60vh; overflow-y: auto; }
.search-result-item { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 11px; }
.search-result-item:hover { background: rgba(255,255,255,.06); }
.search-result-item img { width: 46px; height: 69px; object-fit: cover; border-radius: 7px; }
.search-result-item strong { display: block; font-size: 13px; }
.search-result-item span { color: var(--muted); font-size: 11px; }
.search-hint { color: var(--muted); font-size: 12.5px; padding: 12px; }

/* flash */
.flash-stack { position: fixed; top: 84px; right: 16px; z-index: 500; display: grid; gap: 8px; max-width: 340px; }
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: rgba(18,18,27,.97); border: 1px solid var(--line-strong); font-size: 12.5px; box-shadow: var(--shadow-soft); }
.flash button { background: none; border: 0; color: var(--muted); margin-left: auto; }

/* ============================================================= RESPONSIVE */
@media (max-width: 1120px) {
  .hero-v3-grid { grid-template-columns: minmax(0,1fr) minmax(200px, 300px); gap: 34px; }
  .hero-v3-poster { max-width: 300px; }
  .filter-panel { grid-template-columns: 1fr; }
  .filter-panel .filter-fields { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1.5fr repeat(3, 1fr) !important; gap: 26px !important; }
  .anime-spotlight { grid-template-columns: minmax(0,1fr) 300px; }
}

@media (max-width: 980px) {
  .main-nav { display: none !important; }
  .mobile-toggle { display: inline-grid !important; }
  .hero-v3-grid { grid-template-columns: minmax(0,1fr) minmax(180px, 250px); }
  .hero-v3-poster { max-width: 250px; }
  .hero-v3-title { font-size: clamp(36px, 5.4vw, 58px) !important; }
  .footer-grid { grid-template-columns: 1fr 1fr !important; }
  .anime-spotlight { grid-template-columns: 1fr; }
  .anime-spotlight-side { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --header-h: 62px; --radius: 18px; }
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .container { width: calc(100% - 28px); }
  .section { padding: 40px 0; }
  .section-tight { padding: 20px 0; }

  /* --- organised mobile top bar: bigger logo + evenly sized controls --- */
  .nav-wrap {
    width: calc(100% - 24px) !important;
    height: var(--header-h) !important;
    gap: 10px !important;
  }
  .brand { gap: 9px !important; }
  .brand img { width: 42px !important; height: 42px !important; }
  .brand-word { font-size: 20px !important; }
  .main-nav, .user-trigger-name, .notif-menu { display: none !important; }
  /* Install stays reachable on mobile as a compact 44px icon button */
  .install-btn {
    display: inline-flex !important; width: 44px !important; height: 44px !important;
    min-width: 44px !important; padding: 0 !important; border-radius: 13px !important;
    align-items: center !important; justify-content: center !important;
  }
  .install-btn span { display: none !important; }
  .install-btn svg { width: 20px !important; height: 20px !important; }
  .mobile-toggle { display: inline-grid !important; }
  .nav-actions { margin-left: auto !important; display: flex !important; align-items: center !important; gap: 8px !important; flex: none; }
  .nav-actions .icon-btn { width: 44px !important; height: 44px !important; border-radius: 13px !important; }
  .nav-actions .icon-btn svg { width: 21px !important; height: 21px !important; }
  .nav-actions .btn-sm { height: 42px !important; padding: 0 15px !important; font-size: 13px !important; }
  .nav-actions .btn-sm svg { width: 16px; height: 16px; }

  /* --- hero --- */
  .hero-v3 { min-height: auto; }
  .hero-v3-slide { position: relative; display: none; }
  .hero-v3-slide.is-active { display: flex; }
  .hero-v3-slides { position: relative; }
  .hero-v3-grid {
    grid-template-columns: 1fr !important;
    padding: calc(var(--header-h) + 34px) 0 104px !important;
    gap: 0;
  }
  .hero-v3-copy { max-width: none; }
  .hero-v3-title { font-size: clamp(34px, 10.5vw, 48px) !important; max-width: none; }
  .hero-v3-overview { font-size: 13px; -webkit-line-clamp: 3; margin-bottom: 20px; }
  .hero-v3-poster { display: none !important; }
  .hero-v3-actions { gap: 8px; margin-bottom: 20px; }
  .hero-v3-actions .btn { flex: 1 1 auto; min-width: 0; height: 46px; }
  .hero-v3-actions .btn:first-child { flex-basis: 100%; }
  .hero-v3-facts { gap: 8px 16px; padding-top: 16px; }
  .hero-v3-rail { bottom: 16px; }
  .hero-v3-dots { padding: 8px 12px; }
  .hero-v3-controls button { width: 38px; height: 38px; }
  .hero-v3-count { min-width: 48px; font-size: 10.5px; }

  /* --- rows/cards --- */
  .movie-row { grid-auto-columns: 140px !important; gap: 12px !important; }
  .continue-row { grid-auto-columns: 270px !important; gap: 12px !important; }
  .movie-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 16px 10px !important; }
  .section-head { margin-bottom: 16px; }
  .section-link { font-size: 11.5px; }

  /* --- filters --- */
  .filter-panel { grid-template-columns: 1fr !important; padding: 14px !important; gap: 12px; }
  .filter-panel .filter-fields { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .filter-panel .filter-fields .field:last-child { grid-column: 1 / -1; }
  .filter-panel .filter-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .filter-panel .filter-actions .btn { width: 100%; }
  .type-toggle { width: 100%; }
  .type-pill { flex: 1; justify-content: center; }

  /* --- page hero --- */
  .page-hero { padding-top: calc(var(--header-h) + 26px); }
  .page-hero h1 { font-size: clamp(30px, 9vw, 44px); }

  /* --- footer --- */
  .footer-grid { grid-template-columns: 1fr !important; gap: 24px !important; padding: 36px 0 26px !important; }
  .site-footer { margin-top: 40px !important; }
  .footer-bottom { flex-direction: column !important; gap: 6px !important; }

  /* --- anime --- */
  .anime-hero { padding-top: calc(var(--header-h) + 30px); }
  .anime-hero h1 { font-size: clamp(34px, 10vw, 48px); }
  .anime-spotlight-side { grid-template-columns: 1fr; }
  .anime-spotlight-card { min-height: 240px; }

  /* --- drama --- */
  .drama-feed { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .drama-tile-copy h3 { font-size: 14px; }
  .drama-tile-copy p { display: none; }
  .drama-vertical { grid-auto-columns: 240px; }
  .drama-watch-layout { grid-template-columns: 1fr; }

  /* --- mobile dock --- */
  .mobile-dock {
    display: grid !important; grid-template-columns: repeat(5, 1fr); align-items: end;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 300;
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    background: rgba(8,8,14,.94); backdrop-filter: blur(26px) saturate(150%);
    border-top: 1px solid var(--line);
  }
  .mobile-dock a {
    display: grid; justify-items: center; gap: 4px;
    padding: 6px 2px; border-radius: 12px;
    color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .01em;
  }
  .mobile-dock a.active { color: var(--text); }
  .mobile-dock a.active svg { color: var(--gold); }
  .mobile-dock svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-dock .dock-fab { position: relative; }
  .mobile-dock .dock-fab span {
    position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
    width: 50px; height: 50px; border-radius: 50%;
    background: var(--grad); display: grid; place-items: center;
    box-shadow: 0 14px 30px -8px rgba(248,193,78,.8);
  }
  .mobile-dock .dock-fab svg { width: 22px; height: 22px; color: #0a0a10; stroke-width: 2.1; }

  /* --- watch --- */
  .watch-shell { padding: calc(var(--header-h) + 6px) 0 30px; }
  .player-card { border-radius: 12px !important; margin-inline: -14px; border-left: 0 !important; border-right: 0 !important; }
  .watch-heading h1 { font-size: 15px; }
  .drama-stage { aspect-ratio: 4/3; }

  .hide-mobile { display: none !important; }
}

@media (max-width: 430px) {
  .movie-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .movie-row { grid-auto-columns: 128px !important; }
  .continue-row { grid-auto-columns: 240px !important; }
  .brand-word { font-size: 18px !important; }
  .brand img { width: 38px !important; height: 38px !important; }
  .nav-actions .icon-btn { width: 44px !important; height: 44px !important; }
  .drama-feed { grid-template-columns: 1fr 1fr; }
  .filter-panel .filter-fields { grid-template-columns: 1fr !important; }
  .filter-panel .filter-fields .field:last-child { grid-column: auto; }
}

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

/* ------------------------------------------------- AI Drama player + episodes */
.drama-detail { padding-top: 26px; }
.drama-watch-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 22px; align-items: start; }
.drama-watch-main { min-width: 0; }
.drama-player {
  position: relative; border-radius: 20px; overflow: hidden; background: #05060a;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 24px 60px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.02) inset;
  aspect-ratio: 16 / 9;
}
.drama-player-video, .drama-player-frame { width: 100%; height: 100%; display: block; border: 0; background: #000; object-fit: contain; }
.drama-player-empty { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 14px; }
.drama-now { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 16px 0 22px; }
.drama-now-copy { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.drama-now-copy strong { font-size: 17px; }
.drama-now-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.drama-episodes h3 { margin: 0 0 12px; font-size: 16px; }
.drama-episode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.drama-episode {
  display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 14px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07);
  color: inherit; text-decoration: none; transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.drama-episode:hover { transform: translateY(-2px); background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.16); }
.drama-episode.is-active { border-color: var(--gold); background: rgba(248,193,78,.1); }
.drama-episode-thumb {
  flex: none; width: 76px; height: 46px; border-radius: 9px; display: grid; place-items: center;
  color: rgba(255,255,255,.9); font-size: 15px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
.drama-episode-meta { display: flex; flex-direction: column; min-width: 0; }
.drama-episode-meta strong { font-size: 12px; letter-spacing: .08em; color: var(--gold); }
.drama-episode-meta span { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drama-episode-meta small { color: var(--muted); font-size: 11.5px; }
.drama-outline { margin-top: 22px; border-radius: 16px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); padding: 4px 16px; }
.drama-outline summary { cursor: pointer; padding: 12px 0; font-weight: 700; }
.drama-outline .drama-scene-list { padding-bottom: 12px; }
.drama-side { position: sticky; top: calc(var(--header-h) + 16px); }
@media (max-width: 900px) {
  .drama-watch-layout { grid-template-columns: 1fr; }
  .drama-side { position: static; }
}
@media (max-width: 520px) {
  .drama-episode-grid { grid-template-columns: 1fr; }
  .drama-player { border-radius: 14px; }
}

/* --------------------------------------------------- smooth page animations */
@keyframes pc-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pc-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
html { scroll-behavior: smooth; }
body > main { animation: pc-fade-in .45s var(--ease) both; }
.section-head, .page-hero, .admin-topbar { animation: pc-fade-up .5s var(--ease) both; }
.movie-row > *, .continue-row > *, .drama-feed > *, .drama-episode-grid > * {
  animation: pc-fade-up .5s var(--ease) both;
}
.movie-row > *:nth-child(1), .continue-row > *:nth-child(1), .drama-feed > *:nth-child(1) { animation-delay: .02s; }
.movie-row > *:nth-child(2), .continue-row > *:nth-child(2), .drama-feed > *:nth-child(2) { animation-delay: .05s; }
.movie-row > *:nth-child(3), .continue-row > *:nth-child(3), .drama-feed > *:nth-child(3) { animation-delay: .08s; }
.movie-row > *:nth-child(4), .continue-row > *:nth-child(4), .drama-feed > *:nth-child(4) { animation-delay: .11s; }
.movie-row > *:nth-child(5), .continue-row > *:nth-child(5), .drama-feed > *:nth-child(5) { animation-delay: .14s; }
.movie-row > *:nth-child(6), .continue-row > *:nth-child(6), .drama-feed > *:nth-child(6) { animation-delay: .17s; }
.movie-row > *:nth-child(n+7), .continue-row > *:nth-child(n+7), .drama-feed > *:nth-child(n+7) { animation-delay: .2s; }

/* Softer, springier interactions everywhere */
.movie-card, .drama-tile, .continue-card, .panel, .content-card, .episode-card {
  transition: transform .32s cubic-bezier(.22,1,.36,1), box-shadow .32s ease, border-color .32s ease, background .32s ease;
}
.btn, .icon-btn, .genre-chip, .drama-filter, .drama-episode {
  transition: transform .22s cubic-bezier(.22,1,.36,1), background .22s ease, color .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.btn:active, .icon-btn:active { transform: scale(.96); }
.movie-card:hover, .drama-tile:hover { transform: translateY(-6px); }
.hero-v3-slide.is-active .hero-v3-copy > * { animation: pc-fade-up .6s var(--ease) both; }
.hero-v3-slide.is-active .hero-v3-copy > *:nth-child(2) { animation-delay: .06s; }
.hero-v3-slide.is-active .hero-v3-copy > *:nth-child(3) { animation-delay: .12s; }
.hero-v3-slide.is-active .hero-v3-copy > *:nth-child(4) { animation-delay: .18s; }
.hero-v3-slide.is-active .hero-v3-poster { animation: pc-fade-up .7s var(--ease) .1s both; }

/* View Transitions where supported (silky page changes) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: pc-fade-in .25s ease reverse; }
::view-transition-new(root) { animation: pc-fade-in .3s ease; }

/* =================================================================
   AI DRAMA — TikTok-style vertical posters (real video frames)
   ================================================================= */
.drama-feed {
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 16px;
}
.drama-tile {
  aspect-ratio: 9 / 16;
  border-radius: 16px;
  background: #0d0d14;
  isolation: isolate;
}
.drama-tile-media {
  position: absolute; inset: 0; z-index: 0; overflow: hidden;
  background: #0d0d14;
}
.drama-tile-media img,
.drama-tile-media video,
.drama-tile-media iframe {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border: 0; display: block;
  transition: transform .6s var(--ease), filter .4s;
}
.drama-tile-media iframe { transform: scale(1.02); pointer-events: none; }
.drama-tile:hover .drama-tile-media img,
.drama-tile:hover .drama-tile-media video { transform: scale(1.06); }
.drama-tile-shade {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(0deg, rgba(6,6,11,.97) 0%, rgba(6,6,11,.72) 26%, rgba(6,6,11,.08) 62%, rgba(6,6,11,.35) 100%);
}
.drama-tile-eps {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: 7px; background: var(--grad); color: #0a0a10;
  font-size: 9.5px; font-weight: 900; letter-spacing: .1em;
}
.drama-tile-play {
  position: absolute; z-index: 3; top: 50%; left: 50%;
  width: 46px; height: 46px; margin: -23px 0 0 -23px;
  opacity: 0; transform: scale(.8);
  transition: .3s var(--ease);
}
.drama-tile:hover .drama-tile-play,
.drama-tile:focus-visible .drama-tile-play { opacity: 1; transform: scale(1); }
.drama-tile-copy { position: relative; z-index: 3; padding: 14px; }
.drama-tile-copy strong {
  font-size: 14.5px; line-height: 1.2; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.drama-tile-meta { font-size: 9.5px; letter-spacing: .07em; }

/* fallback (no media available) — layered, never a flat colour */
.drama-poster-fallback {
  position: absolute; inset: 0; display: grid; place-items: center;
  background:
    radial-gradient(120% 80% at 18% 0%, color-mix(in srgb, var(--fa) 55%, transparent), transparent 60%),
    radial-gradient(100% 80% at 92% 100%, color-mix(in srgb, var(--fb) 60%, transparent), transparent 62%),
    linear-gradient(160deg, #14141f, #0a0a12);
}
.drama-poster-fallback span { font-size: 46px; opacity: .55; filter: drop-shadow(0 8px 22px rgba(0,0,0,.6)); }

/* ---- spotlight ---- */
.drama-spotlight {
  position: relative; overflow: hidden; min-height: 168px;
  align-items: center; gap: 20px;
}
.drama-spotlight-media {
  position: absolute; inset: 0; z-index: 0; overflow: hidden;
}
.drama-spotlight-media img,
.drama-spotlight-media video {
  width: 100%; height: 100%; object-fit: cover; object-position: center 32%;
  filter: saturate(1.05);
}
.drama-spotlight-media iframe {
  position: absolute; top: 50%; left: 50%; width: 320px; height: 100%;
  transform: translate(-50%, -50%) scale(1.1); border: 0; pointer-events: none;
}
.drama-spotlight-shade {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(6,6,11,.96) 0%, rgba(6,6,11,.82) 42%, rgba(6,6,11,.3) 100%);
}
.drama-spotlight-copy, .drama-spotlight-play { position: relative; z-index: 2; }
.drama-spotlight-line {
  display: block; color: #cfcbdb; font-size: 12.5px; line-height: 1.5; max-width: 52ch;
  margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---- detail: vertical TikTok stage ---- */
.drama-vertical-stage {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: radial-gradient(80% 60% at 50% 0%, #1a1a28, #07070c 70%);
  padding: 10px;
}
.drama-tiktok-frame {
  width: auto; height: 100%; max-width: 100%; aspect-ratio: 9 / 16;
  max-height: min(78vh, 760px); border: 0; border-radius: 14px;
  background: #000; box-shadow: 0 24px 60px -18px rgba(0,0,0,.9);
}
.drama-player:has(.drama-vertical-stage) { aspect-ratio: auto; min-height: 420px; }
.drama-player:has(.drama-vertical-stage) .drama-vertical-stage { min-height: min(78vh, 760px); }

/* ---- detail: side poster ---- */
.drama-poster {
  position: relative; aspect-ratio: 9 / 16; border-radius: 16px;
  overflow: hidden; margin-bottom: 16px; background: #0d0d14;
}
.drama-poster-img, .drama-poster-video, .drama-poster-frame {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border: 0; display: block;
}
.drama-poster-frame { pointer-events: none; transform: scale(1.02); }
.drama-poster-shade {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(6,6,11,.92), transparent 55%);
}
.drama-poster-tag {
  position: absolute; top: 10px; left: 10px;
  padding: 4px 9px; border-radius: 7px; background: rgba(6,6,11,.72);
  border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(8px);
  font-size: 9.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
}
.drama-poster-handle {
  position: absolute; bottom: 10px; left: 10px; right: 10px;
  font-size: 11px; font-weight: 700; color: #e9e7f2; opacity: .85;
}

/* ---- detail: episode cards with real stills ---- */
.drama-episode-thumb {
  position: relative; overflow: hidden; background: #0d0d14;
}
.drama-episode-img, .drama-episode-frame, .drama-episode-fallback {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border: 0; display: block;
}
.drama-episode-frame { pointer-events: none; transform: scale(1.03); }
.drama-episode-fallback {
  display: grid; place-items: center; font-size: 14px;
  background: linear-gradient(135deg, var(--fa), var(--fb));
}
.drama-episode-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(6,6,11,.35); color: #fff; font-size: 11px;
  opacity: 0; transition: .25s;
}
.drama-episode:hover .drama-episode-play,
.drama-episode.is-active .drama-episode-play { opacity: 1; }

@media (max-width: 720px) {
  .drama-feed { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .drama-tile-copy strong { font-size: 13px; }
  .drama-spotlight { min-height: 190px; }
  .drama-spotlight-line { display: none; }
  .drama-tiktok-frame { max-height: 72vh; border-radius: 12px; }
}

/* --- TikTok stage: centre the vertical frame, drop the empty black slab --- */
.drama-player:has(.drama-vertical-stage) {
  aspect-ratio: auto;
  min-height: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  display: flex;
  justify-content: center;
}
.drama-vertical-stage {
  width: auto;
  min-height: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: transparent;
}
.drama-tiktok-frame {
  height: min(74vh, 720px);
  width: calc(min(74vh, 720px) * 9 / 16);
  max-width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.1);
}
.drama-player:has(.drama-vertical-stage) .drama-vertical-stage { min-height: 0; }

@media (max-width: 900px) {
  .drama-tiktok-frame { height: min(68vh, 620px); width: calc(min(68vh, 620px) * 9 / 16); }
}

/* keep the tile chips from colliding on narrow cards */
.drama-tile-top { gap: 6px; align-items: flex-start; }
.drama-tile-tag {
  max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 9px; height: 22px; padding: 0 7px;
}
.drama-tile-eps { flex: 0 0 auto; height: 22px; padding: 0 7px; font-size: 9px; }
@media (max-width: 420px) {
  .drama-feed { gap: 10px; }
  .drama-tile-copy { padding: 11px; }
  .drama-tile-copy strong { font-size: 12.5px; }
  .drama-tile-meta { font-size: 8.5px; }
}

/* =================================================================
   MOBILE DOCK — centre the search FAB on the dock's top edge
   (it used to overflow 14px below the bar and read as "too low")
   ================================================================= */
@media (max-width: 820px) {
  .mobile-dock {
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    overflow: visible;
  }
  .mobile-dock .dock-fab {
    position: static;            /* let the circle anchor to the dock itself */
    align-self: stretch;
    display: grid;
    place-items: center;
    padding: 0;
  }
  .mobile-dock .dock-fab span {
    position: absolute;
    top: -26px;                  /* straddles the dock's top edge */
    left: 50%;
    transform: translateX(-50%);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--grad);
    display: grid;
    place-items: center;
    box-shadow:
      0 0 0 5px rgba(8,8,14,.94),
      0 16px 34px -10px rgba(248,193,78,.85);
    transition: transform .3s var(--ease), box-shadow .3s;
  }
  .mobile-dock .dock-fab:active span { transform: translateX(-50%) scale(.92); }
  .mobile-dock .dock-fab:hover span,
  .mobile-dock .dock-fab:focus-visible span {
    transform: translateX(-50%) scale(1.06);
    box-shadow: 0 0 0 5px rgba(8,8,14,.94), 0 20px 40px -10px rgba(248,193,78,1);
  }
  .mobile-dock .dock-fab svg { width: 23px; height: 23px; color: #0a0a10; stroke-width: 2.2; }
  /* keep page content clear of the floating circle */
  body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* =================================================================
   AI DRAMA — motion layer
   ================================================================= */
@keyframes pc-rise {
  from { opacity: 0; transform: translate3d(0, 26px, 0) scale(.985); }
  to   { opacity: 1; transform: none; }
}
@keyframes pc-pop {
  0%   { opacity: 0; transform: scale(.9); }
  60%  { opacity: 1; transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes pc-kenburns {
  0%   { transform: scale(1.04) translate3d(0, 0, 0); }
  50%  { transform: scale(1.11) translate3d(-1.2%, -1.6%, 0); }
  100% { transform: scale(1.04) translate3d(0, 0, 0); }
}
@keyframes pc-shimmer {
  from { transform: translateX(-120%); }
  to   { transform: translateX(220%); }
}
@keyframes pc-sheen {
  0%   { background-position: -160% 0; }
  100% { background-position: 260% 0; }
}
@keyframes pc-pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(248,193,78,.55); }
  70%  { box-shadow: 0 0 0 16px rgba(248,193,78,0); }
  100% { box-shadow: 0 0 0 0 rgba(248,193,78,0); }
}

/* ---- scroll reveal (JS adds .pc-in) ---- */
.pc-reveal { opacity: 0; transform: translate3d(0, 26px, 0) scale(.985); }
.pc-reveal.pc-in {
  animation: pc-rise .62s var(--ease) both;
  animation-delay: var(--pc-delay, 0ms);
}

/* ---- feed ---- */
.drama-feed-head > * { animation: pc-fade-up .6s var(--ease) both; }
.drama-feed-head > *:nth-child(2) { animation-delay: .1s; }

.drama-filters { animation: pc-fade-up .55s var(--ease) .12s both; }
.drama-filter { transition: transform .28s var(--ease), background .25s, color .25s, border-color .25s; }
.drama-filter:hover { transform: translateY(-2px); }
.drama-filter.active { animation: pc-pop .4s var(--ease) both; }

.drama-spotlight {
  animation: pc-rise .7s var(--ease) both;
  transition: transform .45s var(--ease), border-color .3s, box-shadow .45s;
}
.drama-spotlight:hover { transform: translateY(-4px); box-shadow: 0 34px 70px -26px rgba(0,0,0,.95); }
.drama-spotlight-media img,
.drama-spotlight-media video { animation: pc-kenburns 22s ease-in-out infinite; }
.drama-spotlight-play { transition: transform .3s var(--ease), box-shadow .3s; }
.drama-spotlight:hover .drama-spotlight-play { transform: scale(1.05); box-shadow: 0 16px 36px -12px rgba(248,193,78,.9); }

/* tiles: lift + poster drift + sheen sweep */
.drama-tile {
  transition: transform .45s var(--ease), border-color .3s, box-shadow .45s;
  will-change: transform;
}
.drama-tile:hover { transform: translateY(-8px) scale(1.012); }
.drama-tile-media img,
.drama-tile-media video { transition: transform .7s var(--ease), filter .45s; }
.drama-tile:hover .drama-tile-media img,
.drama-tile:hover .drama-tile-media video { transform: scale(1.08); filter: saturate(1.12) contrast(1.04); }
.drama-tile-shade { transition: opacity .4s; }
.drama-tile:hover .drama-tile-shade { opacity: .92; }
.drama-tile::after {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.16) 48%, transparent 58%);
  transform: translateX(-120%); opacity: 0;
}
.drama-tile:hover::after { animation: pc-shimmer .85s var(--ease) forwards; opacity: 1; }
.drama-tile-play { transition: opacity .3s var(--ease), transform .35s var(--ease); }
.drama-tile:hover .drama-tile-play { animation: pc-pulse-ring 1.8s ease-out infinite; }
.drama-tile-eps { transition: transform .3s var(--ease); }
.drama-tile:hover .drama-tile-eps { transform: translateY(-1px) scale(1.04); }

/* ---- detail ---- */
.drama-detail .section-head { animation: pc-fade-up .5s var(--ease) both; }
.drama-player { animation: pc-rise .7s var(--ease) .05s both; }
.drama-player-video, .drama-player-frame, .drama-tiktok-frame {
  transition: box-shadow .45s var(--ease);
}
.drama-player:hover .drama-player-video,
.drama-player:hover .drama-tiktok-frame { box-shadow: 0 30px 70px -24px rgba(0,0,0,.95); }

.drama-now { animation: pc-fade-up .55s var(--ease) .16s both; }
.drama-now .drama-badge { animation: pc-pop .45s var(--ease) .3s both; }

.drama-episodes { animation: pc-fade-up .55s var(--ease) .22s both; }
.drama-episode {
  transition: transform .35s var(--ease), border-color .3s, background .3s, box-shadow .35s;
}
.drama-episode:hover { transform: translateY(-4px); box-shadow: 0 22px 44px -22px rgba(0,0,0,.9); }
.drama-episode.is-active { animation: pc-pop .45s var(--ease) both; }
.drama-episode-thumb img,
.drama-episode-thumb video { transition: transform .55s var(--ease); }
.drama-episode:hover .drama-episode-thumb img,
.drama-episode:hover .drama-episode-thumb video { transform: scale(1.1); }
.drama-episode-play { transition: opacity .3s, background .3s; }

.drama-side { animation: pc-fade-up .6s var(--ease) .12s both; }
.drama-poster { transition: transform .5s var(--ease), box-shadow .5s; }
.drama-side:hover .drama-poster { transform: translateY(-3px); box-shadow: 0 28px 60px -26px rgba(0,0,0,.95); }
.drama-poster-img, .drama-poster-video { transition: transform .8s var(--ease); }
.drama-side:hover .drama-poster-img,
.drama-side:hover .drama-poster-video { transform: scale(1.06); }

.drama-outline { animation: pc-fade-up .5s var(--ease) .28s both; }
.drama-outline[open] .drama-scene-row { animation: pc-fade-up .45s var(--ease) both; }
.drama-outline[open] .drama-scene-row:nth-child(2) { animation-delay: .04s; }
.drama-outline[open] .drama-scene-row:nth-child(3) { animation-delay: .08s; }
.drama-outline[open] .drama-scene-row:nth-child(4) { animation-delay: .12s; }
.drama-outline[open] .drama-scene-row:nth-child(5) { animation-delay: .16s; }
.drama-outline[open] .drama-scene-row:nth-child(6) { animation-delay: .2s; }
.drama-outline[open] .drama-scene-row:nth-child(7) { animation-delay: .24s; }
.drama-outline[open] .drama-scene-row:nth-child(8) { animation-delay: .28s; }

/* skeleton shimmer while a poster/player loads */
.drama-tile-media::after,
.drama-poster::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(100deg, #101018 20%, #1b1b28 40%, #101018 60%);
  background-size: 220% 100%;
  animation: pc-sheen 1.6s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .pc-reveal, .pc-reveal.pc-in,
  .drama-feed-head > *, .drama-spotlight, .drama-player, .drama-now,
  .drama-episodes, .drama-side, .drama-outline,
  .drama-filters, .drama-filter.active, .drama-episode.is-active,
  .drama-tile:hover::after, .drama-spotlight-media img,
  .drama-spotlight-media video, .drama-tile-media::after,
  .drama-poster::before, .drama-tile:hover .drama-tile-play {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* --- header on small phones: stop the action cluster overflowing --- */
@media (max-width: 430px) {
  .site-header .container,
  .site-header .header-inner { padding-inline: 12px !important; gap: 8px !important; }
  .nav-actions { gap: 6px !important; }
  .nav-actions .icon-btn { width: 40px !important; height: 40px !important; border-radius: 12px !important; }
  .nav-actions .icon-btn svg { width: 19px !important; height: 19px !important; }
  .nav-actions .btn-sm { height: 40px !important; padding: 0 11px !important; font-size: 12px !important; }
  .brand-mark, .brand-logo { max-width: 132px; }
}
@media (max-width: 360px) {
  .nav-actions .btn-sm { display: none !important; }
}

/* --- ambient backdrop behind the vertical TikTok player --- */
.drama-vertical-stage { position: relative; isolation: isolate; }
.drama-vertical-stage::before {
  content: ""; position: absolute; inset: -10% -6%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 55% at 50% 45%, color-mix(in srgb, var(--drama-accent, #8b5cf6) 42%, transparent), transparent 70%),
    radial-gradient(40% 40% at 20% 80%, rgba(248,193,78,.18), transparent 70%);
  filter: blur(46px) saturate(1.2);
  opacity: .75;
  animation: pc-glow 9s ease-in-out infinite;
}
@keyframes pc-glow {
  0%, 100% { opacity: .6; transform: scale(1); }
  50%      { opacity: .9; transform: scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .drama-vertical-stage::before { animation: none !important; }
}

/* Premium download button */
.btn-download { gap: 6px; }
.btn-download:not(.is-locked) { background: var(--grad) !important; color: #0a0a10 !important; border-color: transparent !important; font-weight: 800; }
.btn-download.is-locked { opacity: .85; }
.btn-download.is-locked:hover { opacity: 1; }
