/* LingBling landing pages: shared layout and a fantasy card-game UI
   (chunky outlined buttons, gold-trimmed panels, ribbon badges).
   Each variant overrides the scene tokens (--bg, --bg-2, --aura, --panel). */

:root {
  color-scheme: dark;

  --bg: #0c0a10;
  --bg-2: #1a1420;
  --aura: rgba(232, 184, 74, 0.26);
  --panel: #18141e;

  --fg: #fbf3e2;
  --fg-dim: rgba(251, 243, 226, 0.78);
  --fg-faint: rgba(251, 243, 226, 0.58);
  --line: rgba(251, 243, 226, 0.16);
  --gold: #f2c75c;
  --gold-hi: #ffe2a0;
  --ink: #1c0f05;
  --danger: #ff9a8a;

  --r-btn: 14px;
  --r-card: 18px;

  --font-display: "Lilita One", "Outfit", sans-serif;
  --font-body: "Cormorant Garamond", Georgia, serif;
  --font-ui: "Outfit", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* z-index scale */
  --z-page: 1;
  --z-result: 30;
  --z-fx: 40;
  --z-grain: 60;
}

:root:lang(zh) {
  --font-display: "ZCOOL QingKe HuangYou", "PingFang SC", sans-serif;
  --font-body: "Noto Serif SC", "Songti SC", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ambient light behind the stage + edge vignette */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 55%, transparent 55%, rgba(0, 0, 0, 0.55) 100%),
    radial-gradient(60% 42% at 50% 66%, var(--aura), transparent 72%),
    radial-gradient(120% 70% at 50% 70%, var(--bg-2), transparent 72%);
}

/* film grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.08;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Gold game lettering: gradient fill with a hard dark outline and a ledge. */
.brand,
h1 {
  background: linear-gradient(180deg, #fffbe8 0%, #ffe6a3 45%, #f6b93b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter:
    drop-shadow(1.5px 0 0 var(--ink))
    drop-shadow(-1.5px 0 0 var(--ink))
    drop-shadow(0 1.5px 0 var(--ink))
    drop-shadow(0 -1.5px 0 var(--ink))
    drop-shadow(0 4px 0 var(--ink))
    drop-shadow(0 10px 18px rgba(0, 0, 0, 0.5));
}

/* ------------------------------------------------------------------ */
/* Layout                                                              */
/* ------------------------------------------------------------------ */

.page {
  position: relative;
  z-index: var(--z-page);
  min-height: 100dvh;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  /* scenes may overflow sideways (a pulled card); never let that widen the page */
  overflow-x: hidden;
  overflow-x: clip;
}

.top {
  flex-shrink: 0;
  height: 62px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "Lilita One", "Outfit", sans-serif;
  font-size: 25px;
  letter-spacing: 0.01em;
  line-height: 1;
  padding: 4px 2px;
}

.brand svg {
  width: 20px;
  height: 20px;
  color: #f6c34a;
}

/* a small engraved tag with a diamond pinned to each end */
.soon {
  position: relative;
  padding: 3px 14px;
  border: 1px solid rgba(255, 226, 160, 0.5);
  color: #ffe2a0;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.soon::before,
.soon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 6px;
  height: 6px;
  background: #ffe2a0;
  transform: translate(-50%, -50%) rotate(45deg);
}

.soon::after {
  left: 100%;
}

.lang {
  --cut: 9px;
  position: relative;
  isolation: isolate;
  margin-left: auto;
  min-width: 50px;
  height: 36px;
  padding: 0 15px;
  border: 0;
  background: rgba(255, 226, 160, 0.6);
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% 50%, calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 50%);
  color: #ffe2a0;
  font: 14px var(--font-display);
  letter-spacing: 0.06em;
  cursor: pointer;
}

.lang::before {
  content: "";
  position: absolute;
  inset: 1.5px;
  z-index: -1;
  clip-path: polygon(calc(var(--cut) - 1px) 0, calc(100% - var(--cut) + 1px) 0, 100% 50%, calc(100% - var(--cut) + 1px) 100%, calc(var(--cut) - 1px) 100%, 0 50%);
  background: #0f1230;
  transition: background 0.2s;
}

.lang:hover::before {
  background: #1b2052;
}

/* sound on / off: the same angled outline as the language switch, icon only */
.sound {
  --cut: 9px;
  position: relative;
  isolation: isolate;
  margin-left: auto;
  width: 46px;
  height: 36px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: rgba(255, 226, 160, 0.6);
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% 50%, calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 50%);
  color: #ffe2a0;
  cursor: pointer;
}

.sound::before {
  content: "";
  position: absolute;
  inset: 1.5px;
  z-index: -1;
  clip-path: polygon(calc(var(--cut) - 1px) 0, calc(100% - var(--cut) + 1px) 0, 100% 50%, calc(100% - var(--cut) + 1px) 100%, calc(var(--cut) - 1px) 100%, 0 50%);
  background: #0f1230;
  transition: background 0.2s;
}

.sound:hover::before {
  background: #1b2052;
}

.sound svg {
  width: 19px;
  height: 19px;
}

.sound[aria-pressed="true"] .sound-off,
.sound[aria-pressed="false"] .sound-on {
  display: none;
}

.sound[aria-pressed="false"] {
  color: rgba(255, 226, 160, 0.6);
}

.sound + .lang {
  margin-left: 0;
}

/* phones: the header carries brand, tag, sound and language in one row */
@media (max-width: 420px) {
  .top {
    gap: 7px;
    padding: 0 12px;
  }

  .soon {
    padding: 3px 9px;
    letter-spacing: 0.05em;
  }

  .sound {
    width: 40px;
  }

  .lang {
    min-width: 44px;
    padding: 0 11px;
  }
}

.hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(260px, 1fr) auto;
  grid-template-areas:
    "copy"
    "ask"
    "stage"
    "cta";
  padding: 0 16px;
}

.copy {
  grid-area: copy;
}

h1 {
  margin: 6px 0 10px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(33px, 9.2vw, 46px);
  line-height: 1.04;
  letter-spacing: 0.005em;
  text-wrap: balance;
  padding-bottom: 4px;
}

:lang(zh) h1 {
  word-break: keep-all; /* only break at punctuation, never inside a phrase */
  font-size: clamp(32px, 9vw, 44px);
  line-height: 1.18;
  letter-spacing: 0.03em;
}

.sub {
  margin: 0;
  max-width: 40ch;
  color: var(--fg-dim);
  font-size: 15px;
  line-height: 1.5;
  text-wrap: pretty;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.ask {
  grid-area: ask;
  display: grid;
  gap: 6px;
  margin-top: 16px;
}

/* The question: no box at all. A line of copy surfaces first, then a softly lit, breathing
   pool of light under it says "write here"; focusing it brightens the pool and draws a
   seam of light beneath the words. */
.ask-prompt {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: var(--gold-hi);
  text-shadow: 0 0 18px rgba(255, 196, 100, 0.45), 0 1px 2px rgba(0, 0, 0, 0.7);
  animation: ask-surface 1.1s var(--ease-out) 0.35s both;
}

.ask-field {
  position: relative;
  display: block;
  cursor: text;
  animation: ask-surface 1.1s var(--ease-out) 0.85s both;
}

/* the pool: a blurred slab of warm light, so its edges melt away instead of forming a border */
.ask-field::before {
  content: "";
  position: absolute;
  inset: 6px -6px;
  border-radius: 40px;
  background: radial-gradient(farthest-side, rgba(255, 228, 180, 0.3), rgba(255, 228, 180, 0.17));
  filter: blur(9px);
  pointer-events: none;
  animation: ask-breathe 4.2s ease-in-out infinite;
  transition: background 0.35s, inset 0.35s;
}

/* a slow glint drifting across the pool while it waits for words */
.ask-field::after {
  content: "";
  position: absolute;
  inset: 4px 0;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 38%, rgba(255, 244, 220, 0.16) 50%, transparent 62%) no-repeat;
  background-size: 260% 100%;
  filter: blur(4px);
  animation: ask-glint 5.5s ease-in-out 1.6s infinite;
  transition: opacity 0.3s;
}

.ask-field:hover::before {
  background: radial-gradient(farthest-side, rgba(255, 228, 180, 0.36), rgba(255, 228, 180, 0.21));
}

.ask-field:focus-within::before {
  inset: 2px -10px;
  background: radial-gradient(farthest-side, rgba(255, 230, 185, 0.42), rgba(255, 230, 185, 0.24));
  animation: none;
}

.ask-field:focus-within::after,
.ask-field:has(input:not(:placeholder-shown))::after {
  opacity: 0;
}

.ask input {
  position: relative;
  display: block;
  width: 100%;
  height: 54px;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  outline: none;
  background: linear-gradient(90deg, transparent, rgba(255, 226, 160, 0.85), transparent) no-repeat 50% calc(100% - 9px) / 0% 1px;
  color: var(--fg);
  caret-color: var(--gold-hi);
  font: 400 17px var(--font-ui);
  letter-spacing: 0.01em;
  text-align: inherit;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  transition: background-size 0.5s var(--ease-out);
}

.ask input::placeholder {
  color: rgba(251, 243, 226, 0.56);
  transition: color 0.3s;
}

.ask input:focus {
  background-size: 72% 1px;
}

.ask input:focus::placeholder {
  color: rgba(251, 243, 226, 0.32);
}

@keyframes ask-surface {
  from {
    opacity: 0;
    transform: translateY(8px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes ask-breathe {
  0%,
  100% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
}

@keyframes ask-glint {
  0% {
    background-position: 120% 0;
  }
  45%,
  100% {
    background-position: -20% 0;
  }
}

/* flat inputs: a gold rule with a fainter second line engraved just inside it */
.field input {
  width: 100%;
  height: 50px;
  padding: 0 18px;
  border: 1px solid rgba(255, 226, 160, 0.5);
  border-radius: 0;
  outline: 1px solid rgba(255, 226, 160, 0.16);
  outline-offset: -5px;
  background: rgba(8, 9, 28, 0.72);
  color: var(--fg);
  font: 400 16px var(--font-ui);
  transition: border-color 0.2s, outline-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.field input::placeholder {
  color: var(--fg-faint);
}

.field input:focus {
  border-color: #ffe2a0;
  outline-color: rgba(255, 226, 160, 0.45);
  background: rgba(14, 16, 44, 0.85);
  box-shadow: 0 0 24px -6px rgba(255, 210, 120, 0.55);
}

.field input[aria-invalid="true"] {
  border-color: var(--danger);
}

.stage-wrap {
  grid-area: stage;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  outline: none;
}

.stage:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(255, 226, 160, 0.5);
  border-radius: var(--r-card);
}

.scene {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: 50% 50%;
}

.hint {
  min-height: 20px;
  margin: 0 0 4px;
  text-align: center;
  color: var(--fg-dim);
  font-size: 13px;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  transition: opacity 0.3s;
}

.hint.is-hidden {
  opacity: 0;
}

.cta-row {
  grid-area: cta;
  padding: 10px 0 calc(20px + env(safe-area-inset-bottom));
}

/* ------------------------------------------------------------------ */
/* Buttons: flat, angular plates with engraved lines (no bevels)       */
/* ------------------------------------------------------------------ */

.cta,
.btn,
.ghost {
  --cut: 18px; /* depth of the pointed ends */
  --edge: #3a2208; /* shows as a thin outline around the inner plate */
  --plate: linear-gradient(180deg, #f8d475 0%, #e3a842 100%);
  --rule: rgba(58, 34, 8, 0.42); /* engraved hairlines */
  --lattice: rgba(255, 255, 255, 0.13);
  --mark: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><path d='M5 0L10 5 5 10 0 5Z' fill='%233a2208'/></svg>");
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 56px;
  padding: 0 34px;
  border: 0;
  border-radius: 0;
  background: var(--edge);
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% 50%, calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 50%);
  color: #2a1606;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s var(--ease-out), filter 0.2s;
}

:lang(zh) .cta,
:lang(zh) .btn,
:lang(zh) .ghost {
  letter-spacing: 0.14em;
}

/* the plate inside the outline: a diamond in each point, two hairlines and a faint lattice */
.cta::before,
.btn::before,
.ghost::before {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: -1;
  clip-path: polygon(calc(var(--cut) - 1px) 0, calc(100% - var(--cut) + 1px) 0, 100% 50%, calc(100% - var(--cut) + 1px) 100%, calc(var(--cut) - 1px) 100%, 0 50%);
  background:
    var(--mark) no-repeat left calc(var(--cut) - 10px) center / 8px 8px,
    var(--mark) no-repeat right calc(var(--cut) - 10px) center / 8px 8px,
    linear-gradient(var(--rule), var(--rule)) no-repeat center 5px / calc(100% - 2 * var(--cut) - 8px) 1px,
    linear-gradient(var(--rule), var(--rule)) no-repeat center calc(100% - 5px) / calc(100% - 2 * var(--cut) - 8px) 1px,
    repeating-linear-gradient(60deg, var(--lattice) 0 1px, transparent 1px 14px),
    repeating-linear-gradient(-60deg, var(--lattice) 0 1px, transparent 1px 14px),
    var(--plate);
}

/* a slow sheen keeps the single CTA findable without shouting */
.cta::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, 0.42) 50%, transparent 62%);
  transform: translateX(-120%);
  animation: cta-sheen 5s 1.5s infinite var(--ease-out);
  pointer-events: none;
}

@keyframes cta-sheen {
  0%,
  72% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

/* secondary: dark indigo plate, gold outline and gold text */
.btn,
.ghost {
  --cut: 14px;
  --edge: #c9a24d;
  --plate: linear-gradient(180deg, #1c2152 0%, #0e1131 100%);
  --rule: rgba(255, 226, 160, 0.3);
  --lattice: rgba(255, 226, 160, 0.06);
  --mark: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><path d='M5 0L10 5 5 10 0 5Z' fill='%23ffe2a0'/></svg>");
  height: 50px;
  padding: 0 24px;
  color: #ffe2a0;
  font-size: 18px;
}

.btn svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.cta:hover,
.btn:hover,
.ghost:hover {
  filter: brightness(1.1);
}

.cta:active,
.btn:active,
.ghost:active {
  transform: scale(0.98);
}

.cta:disabled,
.btn:disabled {
  filter: saturate(0.4) brightness(0.75);
  cursor: progress;
}

/* outlines would be cut off by the angled shape, so focus brightens the button's own edge */
.cta:focus-visible,
.btn:focus-visible,
.ghost:focus-visible,
.lang:focus-visible {
  --edge: #ffffff;
  outline: none;
  background: #ffffff;
}

.close-x:focus-visible {
  outline: 2px solid var(--gold-hi);
  outline-offset: 3px;
}

/* ------------------------------------------------------------------ */
/* Answer card (rendered to an image by card.js)                       */
/* ------------------------------------------------------------------ */

.result {
  position: fixed;
  inset: 0;
  z-index: var(--z-result);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  background: rgba(6, 5, 9, 0.7);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.result[hidden] {
  display: none;
}

.result.is-in {
  opacity: 1;
}

/* Light rays behind the card, the "you got a card" moment. Three layers turn at their own pace:
   the main wheel of rays, a finer wheel turning the other way (the two shimmer where they cross),
   and a pair of soft beams sweeping round like a lighthouse. */
.result-rays {
  --rays-mask: radial-gradient(closest-side, #000 8%, transparent 62%);
  position: fixed;
  left: 50%;
  top: 40%;
  width: 180vmax;
  height: 180vmax;
  margin: -90vmax 0 0 -90vmax;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s 0.3s;
}

.result-rays > i,
.drawn-rays > i {
  position: absolute;
  inset: 0;
  -webkit-mask-image: var(--rays-mask);
  mask-image: var(--rays-mask);
  will-change: transform;
}

.result-rays > i:nth-child(1),
.drawn-rays > i:nth-child(1) {
  background: repeating-conic-gradient(from 0deg, rgba(255, 214, 120, 0.2) 0deg 5deg, transparent 5deg 14deg);
  animation: rays-spin 26s linear infinite;
}

.result-rays > i:nth-child(2),
.drawn-rays > i:nth-child(2) {
  background: repeating-conic-gradient(from 2deg, rgba(255, 236, 196, 0.13) 0deg 1.4deg, transparent 1.4deg 8deg);
  animation: rays-spin 38s linear infinite reverse;
}

.result-rays > i:nth-child(3),
.drawn-rays > i:nth-child(3) {
  background: conic-gradient(
    from 0deg,
    transparent 0deg 120deg,
    rgba(255, 220, 140, 0.16) 160deg,
    rgba(255, 244, 214, 0.42) 178deg,
    transparent 182deg 300deg,
    rgba(255, 220, 140, 0.16) 340deg,
    rgba(255, 244, 214, 0.42) 358deg,
    transparent 360deg
  );
  mix-blend-mode: screen;
  animation: rays-spin 7s linear infinite, rays-pulse 3.5s ease-in-out infinite;
}

@keyframes rays-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.result.is-in .result-rays {
  opacity: 1;
}

@keyframes rays-spin {
  to {
    transform: rotate(360deg);
  }
}

.result-inner {
  position: relative;
  width: min(380px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.card-slot {
  position: relative;
  width: min(100%, calc((100dvh - 236px) * 0.75));
  aspect-ratio: 3 / 4;
  margin: 0;
  outline: none;
  perspective: 1200px;
}

.card-img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.85), 0 0 60px -10px var(--aura);
  opacity: 0;
  -webkit-touch-callout: default;
}

.card-slot.is-revealed:not(.is-loading) .card-img {
  animation: card-reveal 1s var(--ease-out) both;
}

@keyframes card-reveal {
  0% {
    opacity: 0;
    transform: rotateY(-110deg) scale(0.6);
  }
  45% {
    opacity: 1;
  }
  65% {
    transform: rotateY(14deg) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

/* while the image is being drawn: a shimmering card-shaped placeholder */
.card-slot.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background:
    linear-gradient(110deg, transparent 30%, rgba(255, 230, 170, 0.18) 50%, transparent 70%) 0 0 / 250% 100%,
    linear-gradient(180deg, var(--bg-2), var(--bg));
  box-shadow: inset 0 0 0 3px rgba(242, 199, 92, 0.5);
  animation: shimmer 1.2s linear infinite;
}

@keyframes shimmer {
  from {
    background-position: 100% 0, 0 0;
  }
  to {
    background-position: -150% 0, 0 0;
  }
}

.card-fallback {
  display: none;
  position: absolute;
  inset: 0;
  place-content: center;
  padding: 24px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  box-shadow: inset 0 0 0 3px rgba(242, 199, 92, 0.6);
  text-align: center;
  white-space: pre-line;
  font-family: var(--font-body);
  font-size: 24px;
  line-height: 1.4;
}

.card-slot.is-error .card-fallback {
  display: grid;
}

.save-tip {
  display: none;
  margin: -4px 0 0;
  color: var(--fg-faint);
  font-size: 12px;
}

.is-touch .save-tip {
  display: block;
}

.result-actions {
  width: 100%;
  display: grid;
  gap: 14px;
}

.result-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ------------------------------------------------------------------ */
/* Waitlist sheet: a gold-framed game panel                            */
/* ------------------------------------------------------------------ */

.sheet {
  width: 100%;
  max-width: 100%;
  max-height: 100dvh;
  margin: auto 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  overflow: visible;
}

.sheet::backdrop {
  background: rgba(5, 4, 8, 0.65);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.sheet-panel {
  position: relative;
  padding: 32px 20px calc(26px + env(safe-area-inset-bottom));
  border: 3px solid var(--ink);
  border-bottom: 0;
  border-radius: var(--r-card) var(--r-card) 0 0;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(255, 226, 160, 0.12), transparent 60%),
    linear-gradient(180deg, var(--panel), var(--bg));
  box-shadow:
    inset 0 0 0 3px #d9a441,
    inset 0 0 0 5px var(--ink),
    inset 0 0 0 6px rgba(255, 226, 160, 0.2),
    0 -20px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(100%);
  transition: transform 0.42s var(--ease-out);
}

.sheet.is-in .sheet-panel {
  transform: none;
}

.sheet h2 {
  margin: 0 44px 10px 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
  color: #fff3d0;
  text-shadow: 0 3px 0 var(--ink), 1.5px 0 0 var(--ink), -1.5px 0 0 var(--ink), 0 -1.5px 0 var(--ink);
}

:lang(zh) .sheet h2 {
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: 0.03em;
}

.sheet p {
  margin: 0 0 22px;
  color: var(--fg-dim);
  font-size: 15px;
  line-height: 1.55;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 14px;
  font-weight: 500;
}

.sheet .field-error {
  min-height: 20px;
  margin: 2px 0 8px;
  color: var(--danger);
  font-size: 13px;
}

.sheet .fine {
  margin: 14px 0 0;
  text-align: center;
  color: var(--fg-faint);
  font-size: 12px;
}

/* a diamond-shaped close button */
.close-x {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 226, 160, 0.55);
  background: rgba(8, 9, 28, 0.6);
  color: #ffe2a0;
  cursor: pointer;
  transform: rotate(45deg);
}

.close-x svg {
  width: 16px;
  height: 16px;
  transform: rotate(-45deg);
}

.success-mark {
  width: 60px;
  height: 60px;
  margin-bottom: 12px;
  color: var(--gold);
  filter: drop-shadow(0 3px 0 var(--ink)) drop-shadow(0 0 16px rgba(242, 199, 92, 0.7));
}

/* ------------------------------------------------------------------ */
/* Sparkles                                                            */
/* ------------------------------------------------------------------ */

.fx {
  position: fixed;
  inset: 0;
  z-index: var(--z-fx);
  pointer-events: none;
  overflow: hidden;
}

.fx i {
  position: absolute;
  display: block;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
  will-change: transform, opacity;
}

.fx i.star {
  border-radius: 0;
  box-shadow: none;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
}

/* ------------------------------------------------------------------ */
/* Desktop                                                             */
/* ------------------------------------------------------------------ */

@media (min-width: 640px) {
  .sheet {
    width: min(460px, calc(100% - 32px));
    margin: auto;
  }

  .sheet-panel {
    padding: 36px 32px 32px;
    border-bottom: 3px solid var(--ink);
    border-radius: var(--r-card);
    opacity: 0;
    transform: translateY(24px) scale(0.97);
    transition: transform 0.42s var(--ease-out), opacity 0.3s;
  }

  .sheet.is-in .sheet-panel {
    opacity: 1;
    transform: none;
  }
}

@media (min-width: 960px) {
  body::before {
    background:
      radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%),
      radial-gradient(34% 50% at 72% 56%, var(--aura), transparent 72%),
      radial-gradient(70% 90% at 72% 50%, var(--bg-2), transparent 72%);
  }

  .top {
    height: 80px;
    padding: 0 48px;
  }

  .brand {
    font-size: 30px;
  }

  .hero {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    grid-template-rows: 1fr auto auto auto 1.3fr;
    grid-template-areas:
      ".    stage"
      "copy stage"
      "ask  stage"
      "cta  stage"
      ".    stage";
    column-gap: 40px;
    padding: 0 48px 32px;
  }

  h1 {
    font-size: clamp(50px, 5vw, 72px);
    margin-bottom: 18px;
  }

  :lang(zh) h1 {
    font-size: clamp(46px, 4.4vw, 64px);
  }

  .sub {
    font-size: 18px;
  }

  .ask {
    max-width: 440px;
    margin-top: 30px;
  }

  .ask-prompt {
    font-size: 21px;
  }

  .cta-row {
    padding: 22px 0 0;
  }

  .cta-row .cta {
    width: auto;
  }

  .stage-wrap {
    min-height: min(640px, calc(100dvh - 120px));
  }

  .hint {
    font-size: 14px;
  }

  .result-inner {
    width: min(420px, 100%);
  }
}

/* ------------------------------------------------------------------ */
/* Reduced motion                                                      */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
