/* nightmew.com buyer page — streaming title-page world (see index.html contract). */
:root {
  --ground: #0d0e12;
  --panel: #17181f;
  --panel-2: #1f2029;
  --line: #2a2c38;
  --text: #f4f4f7;
  --soft: #c9cad4;
  --mute: #9a9cab;
  --accent: #ff5a36;
  --accent-deep: #d9401f;
  --ok: #3ddc97;
  --err: #ff7a7a;
  --gold: #f5c14b;
  --radius: 14px;
  --font: "Sora", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--ground);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ── Top bar ─────────────────────────────── */
.topbar {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px;
  padding-top: max(14px, env(safe-area-inset-top));
}
.brand { font-weight: 800; font-size: 14px; letter-spacing: .08em; }
.brand span { color: var(--accent); }
.lang { display: flex; gap: 2px; background: rgba(255,255,255,.06); border-radius: 999px; padding: 3px; }
.lang button {
  border: 0; background: none; color: var(--mute);
  font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 999px;
  min-height: 34px;
}
.lang button[aria-pressed="true"] { background: var(--text); color: var(--ground); }

/* ── Stage (title page) ──────────────────── */
.stage {
  position: relative; overflow: hidden;
  display: flex; align-items: flex-end;
  min-height: min(62vh, 520px);
  padding: 96px 20px 28px;
  margin-top: -62px; /* slide under the top bar */
}
.stage-plain {
  background:
    radial-gradient(120% 80% at 85% 0%, rgba(255,90,54,.22), transparent 60%),
    radial-gradient(90% 70% at 0% 100%, rgba(80,90,255,.14), transparent 60%);
}
.backdrop {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  filter: blur(3px) saturate(1.25);
  transform: scale(1.1);
  opacity: .5;
}
.stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(13,14,18,.35) 0%, rgba(13,14,18,.72) 55%, var(--ground) 100%);
}
.stage-plain::after { background: linear-gradient(180deg, transparent 40%, var(--ground) 100%); }
.stage-in { position: relative; z-index: 1; width: 100%; max-width: 760px; margin: 0 auto; }
@media (min-width: 720px) { .stage-in { max-width: 736px; } }
.tag {
  display: inline-block;
  font-size: 11px; font-weight: 800; letter-spacing: .14em;
  background: var(--accent); color: #fff;
  padding: 5px 10px; border-radius: 5px;
}
.tag-err { background: #3a1c1c; color: var(--err); }
h1 {
  font-size: clamp(30px, 8.4vw, 56px);
  line-height: 1.04; font-weight: 800; letter-spacing: -.02em;
  margin: 14px 0 12px;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.lede { color: var(--soft); font-size: 15px; max-width: 58ch; }
.meta { margin-top: 14px; font-size: 13px; color: var(--mute); }
.meta b { color: var(--text); font-weight: 700; }
.meta .dot { margin: 0 8px; }
.safe { margin-top: 16px; font-size: 13px; color: var(--mute); max-width: 58ch; }

/* ── Order form ──────────────────────────── */
.order-form { margin-top: 24px; max-width: 520px; }
.order-form label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); margin-bottom: 8px; }
.field { display: flex; gap: 8px; }
.field input {
  flex: 1; min-width: 0;
  font: inherit; font-size: 17px; font-weight: 600; letter-spacing: .04em;
  color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; min-height: 54px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field input::placeholder { color: #6f7182; font-weight: 400; letter-spacing: 0; }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255,90,54,.18); }
.status { margin-top: 10px; font-size: 14px; color: var(--err); }

/* ── Buttons ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px;
  font-weight: 800; font-size: 15px;
  padding: 14px 20px; min-height: 54px;
  transition: transform .15s var(--ease), background .2s var(--ease), opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 8px 24px rgba(255,90,54,.28); }
.btn-accent:hover { background: var(--accent-deep); }
.btn-light { width: 100%; background: var(--text); color: var(--ground); }
.btn-block { width: 100%; margin-top: 16px; font-size: 17px; }
.btn-ghost { width: 100%; background: transparent; color: var(--soft); border: 1px solid var(--line); margin-top: 10px; }

/* ── Loading ─────────────────────────────── */
.spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.h-load { font-size: clamp(26px, 7vw, 40px); }
.steps { list-style: none; margin-top: 8px; display: grid; gap: 10px; }
.steps li {
  display: flex; align-items: center; gap: 12px;
  color: #6f7182; font-size: 15px;
  transition: color .3s var(--ease);
}
.steps li::before {
  content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%;
  background: var(--line); transition: background .3s, box-shadow .3s;
}
.steps li.active { color: var(--text); }
.steps li.active::before { background: var(--accent); box-shadow: 0 0 0 5px rgba(255,90,54,.2); }
.steps li.done { color: var(--soft); }
.steps li.done::before { background: var(--ok); }

/* ── Files (episodes) ────────────────────── */
.wrap { max-width: 800px; margin: 0 auto; padding: 0 20px 20px; }
.notes {
  white-space: pre-line;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; font-size: 14px; color: var(--soft); margin-bottom: 12px;
}
.episodes { display: grid; gap: 10px; }
.ep {
  display: grid; grid-template-columns: 40px 1fr 48px; align-items: center; gap: 14px;
  padding: 14px 14px 14px 10px;
  background: var(--panel); border-radius: var(--radius);
  transition: background .2s var(--ease), transform .2s var(--ease);
  animation: rise .5s var(--ease) both;
}
.ep:hover { background: var(--panel-2); }
.ep:active { transform: scale(.985); }
.ep .n { font-size: 24px; font-weight: 800; color: #4a4d5d; text-align: center; font-variant-numeric: tabular-nums; }
.ep .t { min-width: 0; }
.ep .t b { display: block; font-size: 15px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.ep .t span { display: block; font-size: 12px; color: var(--mute); margin-top: 3px; }
.ep .go {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--text); color: var(--ground);
  display: grid; place-items: center;
}
.ep .go svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.ep.guide .go { background: transparent; color: var(--text); border: 1.5px solid var(--line); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.tip { font-size: 13px; color: var(--mute); margin: 14px 2px 0; }

/* ── Premium vault ───────────────────────── */
.vault {
  display: grid; grid-template-columns: 52px 1fr 20px; align-items: center; gap: 14px;
  margin-top: 18px; padding: 16px;
  border-radius: var(--radius);
  background: linear-gradient(115deg, #3b2a0c 0%, #1d1a14 55%, var(--panel) 100%);
  border: 1px solid rgba(245,193,75,.28);
}
.vault-badge {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--gold); color: #1a1406; font-weight: 800; font-size: 15px;
  transform: rotate(-8deg);
}
.vault b { display: block; font-size: 15px; }
.vault span span { display: block; font-size: 13px; color: #e2cfa4; margin-top: 2px; }
.chev { width: 20px; height: 20px; fill: none; stroke: var(--gold); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* ── Recommendations rail ────────────────── */
.recs { margin-top: 34px; }
.recs h2 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.recs h2 small { display: block; font-size: 13px; font-weight: 400; color: var(--mute); margin-top: 4px; letter-spacing: 0; }
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: 44%;
  gap: 12px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding: 20px;
  padding: 16px 20px 26px; margin: 0 -20px;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.tile {
  scroll-snap-align: start;
  display: flex; flex-direction: column;
  border-radius: 12px; overflow: hidden; background: var(--panel);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), opacity .3s var(--ease);
}
.tile img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--panel-2); }
.tile .b { padding: 10px 11px 12px; display: flex; flex-direction: column; flex: 1; }
.tile h3 {
  font-size: 12.5px; font-weight: 600; line-height: 1.35; color: var(--soft);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.7em;
}
.tile .row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.tile .p { font-size: 16px; font-weight: 800; color: var(--text); }
.tile .p small { font-size: 11px; margin-right: 1px; color: var(--mute); }
.tile .shop { font-size: 11px; font-weight: 700; color: var(--accent); }
@media (hover: hover) {
  .tile:hover { transform: translateY(-4px) scale(1.03); box-shadow: 0 16px 34px rgba(0,0,0,.55), 0 0 0 2px var(--accent); }
  .rail:hover .tile:not(:hover) { opacity: .6; }
}
.again { margin-top: 8px; }

/* ── In-app sheet ────────────────────────── */
.sheet {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(5,5,8,.72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  padding: 16px;
}
.sheet-card {
  width: 100%; max-width: 460px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px; padding: 22px 20px 18px;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
  animation: rise .45s var(--ease) both;
}
.sheet-card h2 { font-size: 22px; font-weight: 800; }
.sheet-card p { color: var(--soft); font-size: 14px; margin-top: 8px; }
.sheet-steps { margin: 14px 0 6px 20px; display: grid; gap: 8px; font-size: 14px; color: var(--soft); }
.sheet-steps b { color: var(--text); }

/* ── Footer ──────────────────────────────── */
.foot {
  max-width: 800px; margin: 12px auto 0;
  padding: 22px 20px 36px;
  padding-bottom: max(36px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--mute);
}

@media (min-width: 720px) {
  .stage { padding: 120px 32px 36px; }
  .wrap { padding: 0 32px 24px; }
  .rail { grid-auto-columns: 180px; margin: 0 -32px; padding: 16px 32px 26px; scroll-padding: 32px; }
  .topbar { padding: 16px 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Come-back voucher (owner 26/9) ─────────── */
.cb-pill {
  display: inline-block; margin-top: 14px; padding: 8px 14px; border-radius: 999px;
  background: var(--gold); color: #1a1407; font-size: 14px; font-weight: 800;
  box-shadow: 0 6px 18px rgba(245,193,75,.3);
}
.cb {
  margin-top: 30px; padding: 22px 20px 18px; border-radius: var(--radius);
  background: linear-gradient(135deg, #2a1d08 0%, #1f2029 70%);
  border: 2px dashed var(--gold);
  box-shadow: 0 0 0 4px rgba(245,193,75,.08), 0 14px 38px rgba(0,0,0,.45);
  scroll-margin-top: 16px;
}
.cb-tag { font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--gold); }
.cb h2 { font-size: 26px; font-weight: 800; letter-spacing: -.01em; margin-top: 6px; line-height: 1.15; }
.cb-body { color: var(--soft); font-size: 14px; margin-top: 8px; }
.cb-code-row { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.cb-code {
  display: block; text-align: center; white-space: nowrap;
  padding: 14px 10px; border-radius: 10px; background: var(--ground); border: 1px solid var(--gold);
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: clamp(24px, 8vw, 34px); font-weight: 800;
  letter-spacing: .06em; color: var(--gold); user-select: all;
}
.cb-copy { width: 100%; }
@media (min-width: 560px) {
  .cb-code-row { flex-direction: row; align-items: stretch; }
  .cb-code { flex: 1 1 auto; }
  .cb-copy { width: auto; flex: 0 0 auto; }
}
.cb-copy.ok { background: var(--ok); color: #06140d; box-shadow: none; }
.cb-terms { font-size: 12px; color: var(--mute); margin-top: 10px; }
.cb-next { font-size: 13px; font-weight: 700; color: var(--gold); margin-top: 12px; }
.cb + .recs { margin-top: 18px; }
