/* WishFlow — a river of stars at night: deep indigo sky, champagne-gold light, lavender glow. Phone first. */

:root {
  --bg-0: #05061a;
  --glass: rgba(22, 24, 62, 0.5);
  --glass-2: rgba(30, 32, 78, 0.62);
  --field: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --line-3: rgba(255, 255, 255, 0.24);
  --text: #f2f1fb;
  --soft: #d7d7ec;
  --muted: #a6a8c8;
  --faint: #6f739c;
  /* the logo's colors (2026-11: the design is built round the logo): aqua, light blue, lavender, mint, white */
  --accent: #b5a8ff;        /* lavender: focus, glow */
  --accent-soft: rgba(181, 168, 255, 0.16);
  --star: #a8ecf8;          /* aqua white: the star, selections, the words that stand out */
  --aqua: #7fdcf0;
  --mint: #a6f0d6;
  --star-soft: rgba(140, 222, 244, 0.12);
  --error: #ff9c9c;
  --radius: 18px;
  --radius-s: 14px;
  --gutter: 20px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font: "Inter", "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", system-ui, sans-serif;
  --display: "Cormorant Garamond", "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sparkle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-10 -10 20 20'%3E%3Cpath d='M0-10Q.8-.8 10 0Q.8.8 0 10Q-.8.8-10 0Q-.8-.8 0-10Z' fill='white'/%3E%3C/svg%3E");
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { background: var(--bg-0); overscroll-behavior: none; } /* what shows behind Safari's bars and on overscroll */
/* no screen but the notes scrolls, and a finger must not drag the page about either (user, 2026-11-17: on an iPhone a
   page that fits still followed the finger and sprang back). The script sets .scrolls on the notes; it also holds the
   finger's drag itself (lockScroll in app.js), which is what older iPhones need. */
html:not(.scrolls), html:not(.scrolls) body { overflow: hidden; }
body {
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
/* the sky's base colour: fixed layer (background-attachment: fixed does not work on iOS) */
/* the sky layers cover the LARGE viewport (100lvh): on an iPhone the area behind Safari's top and bottom bars is part of
   the page too, and inset: 0 / 100% only covered the small one (user, 2026-11-10: the sky was cut off at the top and
   bottom) */
body::before {
  content: ""; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: -1; pointer-events: none;
  background:
    radial-gradient(80% 42% at 88% -6%, rgba(104, 112, 236, 0.34), transparent 70%),
    radial-gradient(110% 55% at 6% -4%, rgba(40, 132, 204, 0.30), transparent 66%),
    radial-gradient(130% 70% at 50% 118%, rgba(34, 52, 140, 0.50), transparent 62%),
    linear-gradient(180deg, #0a1030 0%, #070b25 52%, #04071a 100%);   /* the logo's blues (violet until 2026-11-16) */
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

#sky { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: 0; pointer-events: none; transition: opacity 0.8s; }
body[data-screen="form"] #sky, body[data-screen="notes"] #sky { opacity: 0.7; }

#app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden; overflow: clip; /* a screen sliding in (translateY) must not make the page scroll for a moment */
}

/* every screen fits the phone exactly and never scrolls (user, 2026-11-10); only the notes (terms) may scroll.
   The big pieces (the star image, the send card, the tap star, the constellation) shrink to the space left: they sit
   in a .fit-slot and take the largest square that fits it (container query units). */
.screen {
  display: none;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding: calc(env(safe-area-inset-top) + 16px) var(--gutter) calc(env(safe-area-inset-bottom) + 24px);
}
.screen-notes { height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible; }
.fit-slot { flex: 1 1 0; min-height: 0; container-type: size; display: grid; place-items: center; }
.screen.active { display: flex; animation: screen-in 0.6s var(--ease-out) both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- buttons ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.04);
  font-size: 15px; font-weight: 500; letter-spacing: 0.05em;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, opacity 0.2s, transform 0.12s, color 0.2s;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.98); }
.btn-wide { width: 100%; }
.btn-primary {
  border-color: transparent;
  color: #0b1a3c; font-weight: 600;
  background: linear-gradient(100deg, #b9f3ff 0%, #a9dcff 38%, #c9c2ff 72%, #b8f2dd 100%);
  box-shadow:
    0 12px 32px -10px rgba(110, 200, 240, 0.65),
    0 0 26px -4px rgba(140, 222, 244, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 -1px 0 rgba(40, 70, 130, 0.25);
}
/* a glint of light that sweeps across the main button now and then */
.btn-primary::after {
  content: ""; position: absolute; top: -30%; bottom: -30%; left: -35%; width: 28%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  transform: skewX(-20deg) translateX(0);
  animation: sheen 5.2s 1.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sheen { 0% { transform: skewX(-20deg) translateX(0); } 22%, 100% { transform: skewX(-20deg) translateX(620%); } }
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:disabled {
  color: rgba(242, 241, 251, 0.4); background: rgba(255, 255, 255, 0.06);
  border-color: var(--line-2); box-shadow: none; cursor: not-allowed; transform: none; filter: none;
}
.btn-primary:disabled::after { display: none; }
.btn-secondary { color: var(--text); background: rgba(255, 255, 255, 0.045); border-color: var(--line-3); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.08); }
html[lang="ja"] .btn-spaced { letter-spacing: 0.32em; text-indent: 0.32em; }
html[lang="en"] .btn-spaced { letter-spacing: 0.14em; text-indent: 0.14em; text-transform: uppercase; font-size: 14px; }
.btn:focus-visible, .icon-btn:focus-visible, .back:focus-visible, .link-btn:focus-visible,
.lang-switch button:focus-visible, .send-card:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.04); color: var(--muted);
  display: grid; place-items: center;
}
.link-btn {
  background: none; border: 0; color: var(--muted); font-size: 13px;
  text-decoration: underline; text-underline-offset: 3px; padding: 10px; align-self: center;
}

/* ---------- app bar ---------- */
.app-bar {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 44px; margin-bottom: 16px;
}
.brand, .brand-name {
  font-family: var(--display); font-size: 23px; font-weight: 600; letter-spacing: 0.01em; line-height: 1;
  color: var(--text);
}
.brand em, .brand-name em { font-style: italic; font-weight: 500; margin-left: 0.02em; }
/* the name at the top of the screens, in the logo's manner: its star beside it, the letters in its pale colors */
.brand, .brand-name {
  display: inline-flex; align-items: center; padding: 3px 2px;
  background: linear-gradient(100deg, #ffffff 0%, #c9f4ff 30%, #cfd2ff 62%, #c3f5e2 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 7px rgba(110, 215, 245, 0.55));
}
.brand::before, .brand-name::before {
  content: ""; flex: none; width: 24px; height: 24px; margin-right: 5px;
  background: url("../assets/logo/star.webp") center / contain no-repeat;
}
.app-bar .back {
  display: inline-flex; align-items: center; gap: 2px; margin-left: -8px; padding: 6px 8px 6px 4px;
  background: none; border: 0; border-radius: 10px; color: var(--muted);
}
/* step indicator (app.js): "3/6 ニックネーム" over a thin bar of how far along */
.step { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.step-text { display: inline-flex; align-items: baseline; white-space: nowrap; font-size: 12.5px; letter-spacing: 0.04em; }
.step-text b { font-size: 17px; font-weight: 600; color: var(--star); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.step-of { margin: 0 8px 0 1px; color: var(--faint); font-variant-numeric: tabular-nums; }
.step-name { color: var(--soft); }
.step-bar { display: block; width: 92px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.step-bar i { display: block; height: 100%; border-radius: 2px; background: var(--star); box-shadow: 0 0 8px rgba(140, 222, 244, 0.7); }

/* ---------- glass language switch ---------- */
.lang-switch {
  align-self: flex-end;
  display: inline-flex; padding: 3px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: rgba(14, 16, 44, 0.55);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.lang-switch button {
  border: 0; background: transparent; color: var(--muted);
  font-size: 12.5px; padding: 6px 14px; border-radius: 999px; min-height: 32px;
}
.lang-switch button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.12); color: var(--text); }

/* ---------- 01 top ---------- */
.screen-top, .screen-closed { position: relative; }
.top-body {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 0 4px 4vh;
}
.top-copy { display: flex; flex-direction: column; align-items: center; }

/* the logo: the designer's picture (assets/logo/base.webp) with the parts that move laid over it (the logo's own
   pixels, so at rest it is the designer's logo exactly). Places and sizes are per cent of the picture. The dot of the i hops, the two pearls float
   like bubbles, sparkles run over the three gems on the ring and the star's tips, a flare breathes behind the dot. */
.logo { position: relative; width: min(100%, 372px, 50dvh); aspect-ratio: 1200 / 655; margin: 0 0 min(20px, 2.4dvh); font-size: 0; }
.logo.small { width: min(84%, 264px, 34dvh); margin-bottom: 10px; }
.logo-art { position: absolute; inset: 0; animation: logo-float 7s ease-in-out infinite; }
.logo-art > * { position: absolute; pointer-events: none; }
.logo-base { inset: 0; width: 100%; height: 100%; }
.logo-anchor { left: 25.99%; top: 62.26%; width: 1px; height: 1px; }   /* the star's centre: the start flash opens here */
/* Each moving part: --x / --y = its centre and --w = its width (per cent of the picture's width / height / width, the
   numbers the asset build prints), --r = its picture's height / width. The box is placed by its corner and
   has its proportions before the picture arrives, and at rest the transform is nothing at all. (Until 2026-11-17 the parts
   were centred with translate(-50%, -50%) inside the keyframes: iPhone Safari worked the per cent out once, when the
   animation started and the picture had not arrived (height 0), so on a real phone the dot of the i sat half its own
   height too low, on the i. A page with the animations off, as in ?shot, did not show it.) */
.logo-flare, .logo-gem, .logo-pearl, .logo-spark {
  left: calc((var(--x) - var(--w) / 2) * 1%);
  top: calc((var(--y) - var(--w) * var(--r) * 0.916031) * 1%);   /* 0.916031 = 1200 / 655 / 2: half the height, in per cent of the picture's height */
  width: calc(var(--w) * 1%); height: auto; aspect-ratio: 1 / var(--r);
}
.logo-flare { --x: 54.83; --y: 32.22; --w: 24; --r: 1.084375; opacity: 0.85; animation: logo-flare 5.2s ease-in-out infinite; }
.logo-gem { --x: 54.83; --y: 32.22; --w: 5.21; --r: 1.108434; transform-origin: 50% 100%; animation: logo-hop 5.2s cubic-bezier(0.3, 0, 0.3, 1) infinite; }
.logo-pearl.p1 { --x: 17.64; --y: 47.18; --w: 3.14; --r: 1; animation: logo-bubble-a 6.4s ease-in-out infinite; }
.logo-pearl.p2 { --x: 21.41; --y: 44.59; --w: 2.01; --r: 0.96875; animation: logo-bubble-b 5s ease-in-out infinite; }
.logo-spark {
  --w: 7; --r: 1; opacity: 0;
  background: var(--sparkle) center / contain no-repeat;
  filter: drop-shadow(0 0 4px rgba(170, 236, 252, 1));
  animation: logo-twinkle 5.2s ease-in-out infinite;
}
.logo-spark.s1 { --x: 8.29; --y: 57.31; animation-delay: 0.2s; }
.logo-spark.s2 { --x: 17.89; --y: 70.54; animation-delay: 0.55s; }
.logo-spark.s3 { --x: 33.33; --y: 79.40; animation-delay: 0.9s; }
.logo-spark.s4 { --x: 27.87; --y: 37.17; --w: 9; animation-delay: 2.6s; }
.logo-spark.s5 { --x: 40.30; --y: 59.84; --w: 6; animation-delay: 3.5s; }
@keyframes logo-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.8%); } }
@keyframes logo-hop {   /* it gathers itself, hops, lands and settles. It turns and squashes about its foot (transform-origin),
                           so it never sinks below where the designer put it: sinking toward the i read as "too low" */
  0%, 60%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
  64% { transform: translate(0, 0) rotate(0deg) scale(1.07, 0.92); }
  73% { transform: translate(0, -100%) rotate(-12deg) scale(0.96, 1.06); }
  82% { transform: translate(0, 0) rotate(4deg) scale(1.07, 0.93); }
  88% { transform: translate(0, -14%) rotate(0deg) scale(1); }
  94% { transform: translate(0, 0) rotate(0deg) scale(1.02, 0.98); }
}
@keyframes logo-flare {   /* a slow breath, and a burst when the dot lands */
  0%, 58%, 100% { transform: scale(0.9) rotate(0deg); opacity: 0.7; }
  30% { transform: scale(1.02) rotate(8deg); opacity: 0.9; }
  72% { transform: scale(0.7) rotate(14deg); opacity: 0.45; }
  82% { transform: scale(1.3) rotate(24deg); opacity: 1; }
}
@keyframes logo-bubble-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  30% { transform: translate(-22%, -42%) scale(1.06); }
  60% { transform: translate(16%, -68%) scale(0.97); }
  82% { transform: translate(6%, -16%) scale(1.02); }
}
@keyframes logo-bubble-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  35% { transform: translate(60%, -100%) scale(1.12); }
  70% { transform: translate(-60%, -60%) scale(0.92); }
}
@keyframes logo-twinkle {
  0%, 16%, 100% { transform: scale(0.2) rotate(0deg); opacity: 0; }
  8% { transform: scale(1) rotate(45deg); opacity: 1; }
}

.lead { margin: 0; white-space: pre-line; color: var(--soft); font-size: 15px; line-height: 2.05; letter-spacing: 0.1em; }
html[lang="en"] .lead { letter-spacing: 0.01em; line-height: 1.8; }
.lead em { font-style: normal; color: var(--star); text-shadow: 0 0 12px rgba(140, 222, 244, 0.5); }
.top-cta { position: relative; width: 100%; margin-top: min(40px, 4.5dvh); }
/* two small stars that twinkle by the button */
.top-cta::before, .top-cta::after {
  content: ""; position: absolute; width: 16px; height: 16px; pointer-events: none; z-index: 1;
  background: var(--sparkle) center / contain no-repeat;
  filter: drop-shadow(0 0 5px rgba(170, 236, 252, 1));
  animation: twinkle 2.8s ease-in-out infinite;
}
.top-cta::before { left: 14px; top: -6px; }
.top-cta::after { right: 22px; bottom: -5px; width: 11px; height: 11px; animation-delay: 1.4s; }
@keyframes twinkle { 0%, 100% { transform: scale(0.2) rotate(0deg); opacity: 0; } 50% { transform: scale(1) rotate(45deg); opacity: 1; } }

/* ---------- start transition: the star twinkles and the next screen opens out of its light ---------- */
.screen-top.leaving .top-copy, .screen-top.leaving .top-cta, .screen-top.leaving .lang-switch {
  animation: copy-out 0.45s ease-in forwards;
}
.screen-top.leaving .logo { animation: hero-flare 0.6s cubic-bezier(0.5, 0, 0.7, 0.4) forwards; }
@keyframes copy-out { to { opacity: 0; transform: translateY(16px); filter: blur(6px); } }
@keyframes hero-flare { to { transform: scale(1.22); filter: brightness(2.2); opacity: 0.25; } }

.fx-layer { position: fixed; inset: 0; z-index: 12; pointer-events: none; overflow: hidden; }
.fx-flash {
  position: absolute; inset: 0;
  background: radial-gradient(circle at var(--x) var(--y),
    rgba(255, 251, 238, 0.97) 0, rgba(178, 238, 252, 0.66) 5%, rgba(186, 172, 255, 0.3) 19%,
    rgba(120, 108, 255, 0.1) 36%, transparent 58%);
  transform-origin: var(--x) var(--y);
  opacity: 0; animation: fx-flash 1.05s 0.3s var(--ease-out) forwards;
}
@keyframes fx-flash { 0% { opacity: 0; transform: scale(0.4); } 26% { opacity: 1; } 100% { opacity: 0; transform: scale(1.7); } }
.fx-flare, .fx-core, .fx-spark { position: absolute; left: var(--x); top: var(--y); opacity: 0; }
/* the twinkle itself: a cross of thin rays (and a fainter diagonal one) that flashes out of the star */
.fx-flare {
  width: 520px; height: 520px; margin: -260px 0 0 -260px;
  background:
    linear-gradient(90deg, transparent 0%, rgba(214, 245, 255, 0.5) 30%, #fffdf6 50%, rgba(214, 245, 255, 0.5) 70%, transparent 100%) center / 100% 3px no-repeat,
    linear-gradient(0deg, transparent 0%, rgba(214, 245, 255, 0.5) 30%, #fffdf6 50%, rgba(214, 245, 255, 0.5) 70%, transparent 100%) center / 3px 100% no-repeat;
  filter: drop-shadow(0 0 6px rgba(170, 236, 252, 1)) drop-shadow(0 0 18px rgba(190, 178, 255, 0.9));
  animation: fx-flare 0.9s 0.08s cubic-bezier(0.3, 0.6, 0.3, 1) forwards;
}
.fx-flare.b { width: 300px; height: 300px; margin: -150px 0 0 -150px; animation-name: fx-flare-b; animation-delay: 0.16s; }
@keyframes fx-flare { 0% { opacity: 0; transform: scale(0.05) rotate(-8deg); } 30% { opacity: 1; transform: scale(1) rotate(0deg); } 60% { opacity: 0.9; } 100% { opacity: 0; transform: scale(1.5, 1.3) rotate(6deg); } }
@keyframes fx-flare-b { 0% { opacity: 0; transform: rotate(45deg) scale(0.05); } 36% { opacity: 0.7; transform: rotate(45deg) scale(0.9); } 100% { opacity: 0; transform: rotate(52deg) scale(1.3); } }
.fx-core {
  width: 150px; height: 150px; margin: -75px 0 0 -75px; border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, rgba(232, 250, 255, 0.95) 12%, rgba(170, 236, 252, 0.45) 32%, rgba(180, 168, 255, 0.15) 55%, transparent 70%);
  animation: fx-core 0.95s 0.05s ease-out forwards;
}
@keyframes fx-core { 0% { opacity: 0; transform: scale(0.2); } 28% { opacity: 1; transform: scale(0.9); } 45% { opacity: 0.85; transform: scale(0.75); } 100% { opacity: 0; transform: scale(2.2); } }
.fx-spark { background: var(--sparkle) center / contain no-repeat; }
.fx-ring {
  position: absolute; left: var(--x); top: var(--y); width: 80px; height: 80px; margin: -40px 0 0 -40px; border-radius: 50%;
  border: 1.5px solid rgba(170, 236, 252, 0.9);
  box-shadow: 0 0 18px rgba(160, 232, 250, 0.6), inset 0 0 18px rgba(190, 180, 255, 0.4);
  opacity: 0; animation: fx-ring 1s 0.24s ease-out forwards;
}
@keyframes fx-ring { 0% { opacity: 0.95; transform: scale(0.2); } 100% { opacity: 0; transform: scale(9); } }
.fx-spark {
  width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  filter: drop-shadow(0 0 4px rgba(170, 236, 252, 0.95));
  animation: fx-spark 0.95s var(--d) var(--ease-out) forwards;
}
@keyframes fx-spark {
  0% { opacity: 0; transform: translate(0, 0) scale(0.2); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1) rotate(90deg); }
}
.screen.active.enter-twinkle { animation: twinkle-in 0.85s cubic-bezier(0.25, 0.7, 0.2, 1) both; }
.screen.active.entered { animation: none; }
@keyframes twinkle-in {
  from { clip-path: circle(0 at var(--ox) var(--oy)); filter: brightness(1.7); }
  60% { filter: brightness(1.08); }
  to { clip-path: circle(150% at var(--ox) var(--oy)); filter: none; }
}
.enter-twinkle .modal { animation: modal-in 0.8s 0.05s var(--ease-out) both; }
@keyframes modal-in { from { transform: scale(0.94) translateY(10px); opacity: 0.2; } to { transform: none; opacity: 1; } }

/* ---------- 02 notes ---------- */
.screen-notes { justify-content: center; }
.modal {
  border: 1px solid var(--line-2); border-radius: 24px;
  background: linear-gradient(180deg, rgba(32, 33, 84, 0.86), rgba(15, 17, 48, 0.92));
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 60px -20px rgba(171, 159, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  max-height: calc(100dvh - 48px);
  display: flex; flex-direction: column;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px 14px 24px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-family: var(--display); font-size: 21px; font-weight: 600; letter-spacing: 0.08em; }
.modal-body { padding: 6px 24px 18px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.modal-body h3 { margin: 16px 0 4px; font-size: 13.5px; font-weight: 500; color: var(--star); letter-spacing: 0.03em; }
.modal-body p { margin: 0; font-size: 13.5px; color: #c9cadf; line-height: 1.8; }
.modal-foot { padding: 16px 24px 22px; border-top: 1px solid var(--line); display: grid; gap: 16px; background: rgba(0, 0, 0, 0.12); }
.check { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; min-height: 32px; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box {
  width: 22px; height: 22px; flex: none; border-radius: 7px;
  border: 1.5px solid rgba(140, 222, 244, 0.7); background: rgba(140, 222, 244, 0.06);
  display: grid; place-items: center; transition: background 0.15s, box-shadow 0.15s;
}
.check input:checked + .box { background: var(--star); border-color: var(--star); box-shadow: 0 0 14px rgba(140, 222, 244, 0.55); }
.check input:checked + .box::after {
  content: ""; width: 10px; height: 5px; border: 2px solid #2a1c08; border-top: 0; border-right: 0;
  transform: translateY(-1px) rotate(-45deg);
}
.check input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- 03 form ---------- */
.page-title { margin: 2px 0 22px; font-family: var(--display); font-size: 25px; font-weight: 600; letter-spacing: 0.08em; line-height: 1.45; }
html[lang="en"] .page-title { font-size: 31px; letter-spacing: 0.005em; line-height: 1.15; }
.form-summary {
  margin: -6px 0 16px; padding: 10px 14px; border-radius: var(--radius-s);
  background: rgba(255, 120, 120, 0.1); border: 1px solid rgba(255, 156, 156, 0.35);
  color: var(--error); font-size: 13px;
}
.field { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
.field > label, .field > legend {
  display: block; padding: 0; margin: 0 0 8px; font-size: 13.5px; font-weight: 500; color: var(--soft); letter-spacing: 0.03em;
}
.field small { color: var(--faint); font-size: 11.5px; font-weight: 400; margin-left: 6px; letter-spacing: 0; }
.field input[type="text"], .field select, .field textarea {
  width: 100%; min-height: 52px;
  padding: 13px 16px;
  border-radius: var(--radius-s); border: 1px solid var(--line-2);
  background: var(--field);
  font-size: 16px; /* >= 16px: no zoom-on-focus on iOS */
  outline: none; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field textarea { resize: none; min-height: 100px; line-height: 1.65; }
.field input::placeholder, .field textarea::placeholder { color: #6c7098; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(171, 159, 255, 0.8); background: rgba(171, 159, 255, 0.07); box-shadow: 0 0 0 4px rgba(171, 159, 255, 0.14);
}
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 7px; height: 7px; margin-top: -6px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg);
  pointer-events: none;
}
.field select { appearance: none; -webkit-appearance: none; padding-right: 42px; }
.field select:invalid, .field select.placeholder { color: #6c7098; }
.field select option { color: #111; }
.field-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; }
.field-foot:not(:has(.counter)):has(.error:empty) { display: none; }
.error { margin: 0; color: var(--error); font-size: 12px; line-height: 1.5; }
.error:empty { display: none; }
.counter { margin-left: auto; color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.counter.over { color: var(--error); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: rgba(255, 156, 156, 0.7); }
#btn-submit { margin-top: 12px; }

/* ---------- 03a birthday: the zodiac wheel ---------- */
.birth-body { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; padding-bottom: 3vh; }
.page-title.center { text-align: center; margin-bottom: 6px; }
.page-lead { margin: 0 0 22px; font-size: 13.5px; color: var(--muted); letter-spacing: 0.04em; }
.wheel-wrap { position: relative; width: min(250px, 64vw, 33vh); aspect-ratio: 1; margin: 0 auto 24px; }
.wheel-wrap::before { /* soft light behind the dial */
  content: ""; position: absolute; inset: 14%; border-radius: 50%;
  background: radial-gradient(circle, rgba(171, 159, 255, 0.2), rgba(140, 222, 244, 0.06) 55%, transparent 72%);
  filter: blur(6px);
}
.zodiac-wheel { position: relative; display: block; width: 100%; height: 100%; overflow: visible; }
.zw-ring { fill: none; stroke: rgba(140, 222, 244, 0.38); stroke-width: 0.7; transition: stroke 0.4s; }
.zw-ring.in { stroke: rgba(255, 255, 255, 0.13); }
.zw-ring.core { stroke: rgba(171, 159, 255, 0.28); stroke-width: 0.6; stroke-dasharray: 0.8 3.2; }
.zw-tick { stroke: rgba(255, 255, 255, 0.2); stroke-width: 0.5; }
.zw-div { stroke: rgba(140, 222, 244, 0.2); stroke-width: 0.6; }
.zw-sym {
  fill: rgba(215, 215, 236, 0.74); font-size: 15px; text-anchor: middle; dominant-baseline: central;
  font-family: "Hiragino Sans", "Apple Symbols", "Segoe UI Symbol", "Noto Sans Symbols 2", sans-serif;
  transition: fill 0.3s, filter 0.3s;
}
.zw-sym.hit { fill: var(--star); filter: drop-shadow(0 0 3px rgba(140, 222, 244, 1)) drop-shadow(0 0 8px rgba(140, 222, 244, 0.7)); }
.zw-mark { fill: var(--star); filter: drop-shadow(0 0 3px rgba(140, 222, 244, 0.9)); }
.wheel-date {
  position: absolute; inset: 0; margin: 0; display: grid; place-items: center; pointer-events: none;
  font-family: var(--display); font-size: 21px; font-weight: 600; color: var(--star); letter-spacing: 0.06em;
  text-shadow: 0 0 14px rgba(140, 222, 244, 0.45); font-variant-numeric: lining-nums;
}
html[lang="en"] .wheel-date { font-size: 23px; font-style: italic; letter-spacing: 0.01em; }
.wheel-date:empty::before {
  content: ""; width: 20px; height: 20px; background: var(--sparkle) center / contain no-repeat;
  animation: twinkle 2.8s ease-in-out infinite;
}
.birth-field { margin-bottom: 10px; }
.birthday { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.birth-field select { text-align: center; text-align-last: center; padding: 13px 34px 13px 16px; font-size: 17px; }
.birth-note { margin: 0 0 22px; font-size: 11.5px; color: var(--faint); line-height: 1.6; }
.screen-birth.spinning .zw-ring { stroke: rgba(140, 222, 244, 0.75); }
.screen-birth.spinning .birth-body > :not(.wheel-wrap) { opacity: 0.25; transition: opacity 0.4s; pointer-events: none; }
.screen-birth.spinning .wheel-date { opacity: 0; transition: opacity 0.3s; }

/* ---------- 03b sign x birthstone ---------- */
.screen-sign { text-align: center; --cc: #a8ecf8; }
.sign-hero { flex: 1 1 0; min-height: 70px; container-type: size; display: grid; place-items: center; margin: -4px 0 0; }
.sign-hero > * { grid-area: 1 / 1; }
.constellation { display: block; width: min(214px, 57vw, 100cqh); aspect-ratio: 1; overflow: visible; }
/* the designer's zodiac figure over the constellation (user, 2026-11-16: "lay the zodiac picture on top, then it is easy to
   see where my star will appear": it is the picture the LED shows). Screened on, so the stars and lines still shine through */
.constellation { position: relative; z-index: 0; }
.sign-figure { position: relative; z-index: 1; display: block; width: min(214px, 57vw, 100cqh); aspect-ratio: 1; mix-blend-mode: screen; filter: drop-shadow(0 0 14px rgba(120, 215, 245, 0.35)); }
.sign-figure:not([src]) { visibility: hidden; }
.reveal .sign-figure { animation: figure-in 1.6s 0.2s ease-out both; }
@keyframes figure-in { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
.cst-line {
  fill: none; stroke: var(--cc); stroke-opacity: 0.72; stroke-width: 0.55; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke 0.9s;
}
.cst-g0 { stop-color: #fff; stop-opacity: 0.85; }
.cst-g1 { stop-color: var(--cc); stop-opacity: 0.34; transition: stop-color 0.9s; }
.cst-g2 { stop-color: var(--cc); stop-opacity: 0; transition: stop-color 0.9s; }
.cst-glow { fill: url(#cst-g); }
.cst-core { fill: #fff; }
.cst-spark {
  fill: color-mix(in srgb, var(--cc) 30%, #fff); transform-box: fill-box; transform-origin: center;
  animation: cst-twinkle 3.6s var(--t, 0s) ease-in-out infinite;
}
.cst-pop { transform-box: fill-box; transform-origin: center; }
.cst-dust { fill: #dfe3ff; opacity: var(--o); animation: dust-tw 4.4s var(--t) ease-in-out infinite; }
.cst-cl { fill: #eef0ff; opacity: 0.85; }
@keyframes cst-twinkle { 0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.95; } 50% { transform: scale(0.62) rotate(12deg); opacity: 0.55; } }
@keyframes dust-tw { 50% { opacity: calc(var(--o) * 0.25); } }

.sign-head { margin: 2px 0 20px; }
.sign-your { margin: 0 0 2px; font-size: 13px; color: var(--muted); letter-spacing: 0.22em; text-indent: 0.22em; }
html[lang="en"] .sign-your { font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; }
.sign-name {
  margin: 0; font-family: var(--display); font-size: 38px; font-weight: 600; line-height: 1.3;
  letter-spacing: 0.16em; text-indent: 0.16em;
  background: linear-gradient(100deg, #fff 18%, var(--star) 50%, #fff 82%) 0 0 / 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: wm-shimmer 7s ease-in-out infinite;
}
html[lang="en"] .sign-name { font-size: 50px; font-style: italic; line-height: 1.05; letter-spacing: 0.01em; text-indent: 0; }
.sign-range { margin: 6px 0 0; font-size: 12.5px; color: var(--soft); letter-spacing: 0.06em; }
.sign-range .sym { color: var(--star); margin-right: 6px; }
.sign-range .latin { font-family: var(--display); font-style: italic; font-size: 15px; color: var(--star); letter-spacing: 0.02em; }
.sign-range .sep { margin: 0 4px; color: var(--faint); }

.stone-pick { margin: 0 0 14px; }
.stone-title { margin: 0 0 10px; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.stone-title span { font-size: 15px; font-weight: 500; letter-spacing: 0.06em; }
.stone-title small { font-size: 11.5px; color: var(--muted); }
.stone-cards { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 8px; }
.stone-cards.single { grid-template-columns: minmax(0, 200px); justify-content: center; }
.stone-cards.four { gap: 6px; }
.stone-cards.four .sc-body { padding-inline: 2px; }
.stone-cards.four .sc-name { font-size: 11px; letter-spacing: -0.02em; }
.stone-card { position: relative; margin: 0; cursor: pointer; }
.stone-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sc-body {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  height: 100%; min-height: 88px; padding: 12px 6px 10px; border-radius: var(--radius-s);
  border: 1px solid var(--line-2); background: var(--field);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.25s;
}
.sc-name { font-size: 12.5px; line-height: 1.35; color: var(--soft); overflow-wrap: anywhere; text-wrap: balance; }
html[lang="en"] .sc-name { font-size: 12px; }
.gem-ico { width: 30px; height: 30px; flex: none; overflow: visible; filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.4)); transition: transform 0.35s cubic-bezier(0.2, 1.4, 0.4, 1), filter 0.35s; }
.gm-base { fill: var(--g); }
.gm-hi { fill: #fff; opacity: 0.6; }
.gm-mid { fill: #fff; opacity: 0.28; }
.gm-soft { fill: #fff; opacity: 0.1; }
.gm-lo { fill: #000; opacity: 0.16; }
.gm-lo2 { fill: #000; opacity: 0.32; }
.gm-table { fill: #fff; opacity: 0.34; }
.gm-edge { fill: none; stroke: rgba(255, 255, 255, 0.6); stroke-width: 0.45; stroke-linejoin: round; }
.stone-card input:checked + .sc-body {
  border-color: var(--star);
  background: linear-gradient(170deg, color-mix(in srgb, var(--g) 24%, transparent), rgba(140, 222, 244, 0.05));
  box-shadow: 0 0 0 1px rgba(140, 222, 244, 0.35) inset, 0 8px 24px -12px var(--g);
}
.stone-card input:checked + .sc-body .gem-ico { transform: scale(1.14) translateY(-1px); filter: drop-shadow(0 0 9px var(--g)); }
.stone-card input:checked + .sc-body .sc-name { color: #fff; }
.stone-card input:focus-visible + .sc-body { outline: 2px solid var(--accent); outline-offset: 2px; }
.stone-cards.single .stone-card { cursor: default; }

.combo {
  display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 10px 16px 10px 8px; text-align: left;
  border-radius: var(--radius); border: 1px solid rgba(140, 222, 244, 0.3);
  background: linear-gradient(150deg, rgba(140, 222, 244, 0.1), rgba(171, 159, 255, 0.07));
}
.combo-star { width: 76px; height: 76px; flex: none; }
.combo-text { min-width: 0; }
.combo-label { margin: 0; font-size: 11px; letter-spacing: 0.16em; color: var(--star); }
html[lang="en"] .combo-label { text-transform: uppercase; letter-spacing: 0.12em; }
.combo-title { margin: 1px 0 3px; font-size: 16px; line-height: 1.4; color: #fff; overflow-wrap: anywhere; }
.combo-title .sym, .combo-chip .sym { color: var(--star); margin-right: 4px; }
.combo-title .x, .combo-chip .x { font-style: normal; font-weight: 300; color: var(--star); margin: 0 0.4em; }
.combo-title .q { color: var(--faint); }
.combo-color { margin: 0; display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--soft); }
.combo.empty .combo-star { opacity: 0.4; filter: saturate(0.3); }
.combo.empty .combo-color { color: var(--muted); }
.combo.pulse { animation: combo-glow 1s ease-out; }
.combo.pulse .combo-star { animation: combo-pop 0.75s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
@keyframes combo-pop { 0% { transform: scale(0.5); filter: brightness(2.4); } 100% { transform: none; filter: none; } }
@keyframes combo-glow { 0% { box-shadow: 0 0 0 0 rgba(140, 222, 244, 0.45); } 100% { box-shadow: 0 0 0 16px rgba(140, 222, 244, 0); } }

/* the drawing-in: base styles are the end state; .reveal plays it (removing the class = done) */
.reveal .cst-pop { animation: cst-pop 0.6s var(--d) cubic-bezier(0.2, 0.9, 0.3, 1.4) both; }
.reveal .cst-cl { animation: fade-in 0.6s var(--d) both; }
.reveal .cst-line { animation: cst-draw 0.5s var(--d) ease-out both; }
.reveal .cst-dusts { animation: fade-in 1.4s 0.1s both; }
.reveal .constellation { animation: cst-flash 1.3s calc(var(--cap) - 0.3s) ease-out both; }
.reveal .sign-your { animation: rise-in 0.6s calc(var(--cap) - 0.1s) var(--ease-out) both; }
.reveal .sign-name { animation: name-in 1s var(--cap) var(--ease-out) both, wm-shimmer 7s ease-in-out infinite; }
.reveal .sign-range { animation: rise-in 0.6s calc(var(--cap) + 0.3s) var(--ease-out) both; }
.reveal .stone-pick { animation: rise-in 0.7s calc(var(--cap) + 0.55s) var(--ease-out) both; }
.reveal .combo { animation: rise-in 0.7s calc(var(--cap) + 0.7s) var(--ease-out) both; }
.reveal #btn-sign-next { animation: rise-in 0.7s calc(var(--cap) + 0.8s) var(--ease-out) both; }
@keyframes cst-pop { 0% { transform: scale(0); opacity: 0; } 55% { transform: scale(1.7); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes cst-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes cst-flash { 0% { filter: none; } 22% { filter: brightness(1.9) drop-shadow(0 0 6px var(--cc)); } 100% { filter: none; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes name-in { from { opacity: 0; letter-spacing: 0.6em; filter: blur(8px); } to { opacity: 1; filter: blur(0); } }

/* ---------- 03c form: the chosen sign x birthstone ---------- */
.combo-chip {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0; max-width: 100%;
  margin: -10px 0 22px; padding: 7px 10px 7px 12px; border-radius: 999px;
  border: 1px solid rgba(140, 222, 244, 0.3); background: rgba(140, 222, 244, 0.07);
  font-size: 13px; color: #fff; text-align: left;
}
.combo-chip .gem-mini {
  width: 10px; height: 10px; margin-right: 6px; transform: rotate(45deg); border-radius: 2px;
  background: linear-gradient(135deg, #fff, var(--g) 40%, color-mix(in srgb, var(--g) 60%, #000));
}
.combo-chip .br-dot { width: 10px; height: 10px; margin-left: 8px; }
.combo-chip .chip-edit { width: 14px; height: 14px; margin-left: 6px; color: var(--muted); }
.combo-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* the star's color (a dot) */
.br-dot {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.75), transparent 45%), var(--c);
  box-shadow: 0 0 10px 1px var(--c), 0 0 0 1px rgba(255, 255, 255, 0.25) inset;
}
/* the wish is optional: no empty line when it was left blank */
.wish-card .wish-text:empty, .img-wish:empty { display: none; }
.wish-card:has(.wish-text:empty) .owner { margin: 0; font-size: 13px; }

/* ---------- shared cards ---------- */
.wish-card {
  position: relative; padding: 14px 18px 14px 20px; border-radius: var(--radius);
  border: 1px solid var(--line-2); background: var(--glass);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.wish-card::before { /* thin gold rule at the left: a quote of the wish */
  content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 2px; border-radius: 2px;
  background: linear-gradient(180deg, transparent, var(--star), transparent);
}
.wish-card .owner { margin: 0 0 3px; font-size: 11.5px; color: var(--star); letter-spacing: 0.06em; }
.wish-card .wish-text { margin: 0; font-size: 15.5px; overflow-wrap: anywhere; color: #fff; }

/* ---------- 04 generating ---------- */
.gen-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-bottom: 10vh; text-align: center; }
.spinner { position: relative; width: min(148px, 21dvh); height: min(148px, 21dvh); margin-bottom: min(28px, 3dvh); }
.spinner::before, .spinner::after { /* two small stars circling the star being made */
  content: ""; position: absolute; inset: -12px; pointer-events: none;
  background: var(--sparkle) top center / 13px 13px no-repeat;
  filter: drop-shadow(0 0 5px rgba(170, 236, 252, 1));
  animation: spin 5.5s linear infinite;
}
.spinner::after { inset: 4px; background-size: 9px 9px; background-position: bottom center; animation: spin 8s linear infinite reverse; }
.spinner-ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.spinner-ring .arc { transform-origin: 60px 60px; animation: spin 1.8s linear infinite; filter: drop-shadow(0 0 4px rgba(140, 222, 244, 0.9)); }
.spin-star { position: absolute; inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); animation: breathe 2.4s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { transform: scale(0.94); opacity: 0.85; } 50% { transform: scale(1.04); opacity: 1; } }
.gen-status { margin: 0 0 6px; font-family: var(--display); font-size: 19px; font-weight: 600; letter-spacing: 0.06em; }
html[lang="en"] .gen-status { font-size: 23px; letter-spacing: 0.005em; }
.gen-sub { margin: 0; font-size: 12.5px; color: var(--muted); }
.gen-error { margin-top: auto; display: grid; gap: 14px; text-align: center; color: var(--error); font-size: 14px; }
.gen-center:has(+ .gen-lore:not([hidden])) { padding-bottom: 2vh; }
.gen-center[hidden] + .gen-lore { display: none; }
/* the notes about the sign and birthstone at the bottom (one at a time, a tap shows the next) */
.gen-lore { display: grid; gap: 10px; justify-items: center; }
.lore-card {
  position: relative; width: 100%; min-height: 118px; padding: 13px 18px 14px; border-radius: var(--radius);
  border: 1px solid var(--line-2); background: var(--glass); cursor: pointer;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.lore-card.in { animation: lore-in 0.7s var(--ease-out); }
@keyframes lore-in { from { opacity: 0; transform: translateY(8px); filter: blur(3px); } }
.lore-kicker { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 12px; color: var(--star); letter-spacing: 0.08em; }
html[lang="en"] .lore-kicker { letter-spacing: 0.02em; }
.lore-kicker .sym { font-size: 13px; }
.lore-gem {
  width: 10px; height: 10px; flex: none; transform: rotate(45deg); border-radius: 2px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), transparent 55%), var(--c);
  box-shadow: 0 0 8px 1px var(--c);
}
.lore-text { margin: 0; font-size: 13px; line-height: 1.75; color: var(--soft); letter-spacing: 0.02em; }
html[lang="en"] .lore-text { line-height: 1.55; letter-spacing: 0; }
.lore-dots { display: flex; gap: 6px; }
.lore-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--line-3); transition: background 0.4s, transform 0.4s; }
.lore-dots i.on { background: var(--star); transform: scale(1.3); }

/* ---------- 05 confirm ---------- */
.frame-slot { margin: 12px 0 10px; }
.star-frame {
  position: relative; margin: 0; width: min(100cqw, 100cqh);
  border-radius: 22px; border: 1px solid var(--line-2);
  overflow: hidden; aspect-ratio: 1 / 1; background: #12143a;
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.7), 0 0 50px -16px rgba(171, 159, 255, 0.45);
}
.star-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.corner { position: absolute; width: 20px; height: 20px; border-color: rgba(140, 222, 244, 0.8); border-style: solid; border-width: 0; }
.corner.tl { top: 14px; left: 14px; border-top-width: 1.5px; border-left-width: 1.5px; border-top-left-radius: 6px; }
.corner.br { right: 14px; bottom: 14px; border-bottom-width: 1.5px; border-right-width: 1.5px; border-bottom-right-radius: 6px; }
/* wish written over a generated image that has no text in it (hasText = false) */
.img-wish {
  position: absolute; left: 8%; right: 8%; bottom: 7%; margin: 0;
  text-align: center; color: #fff; font-weight: 500; line-height: 1.45;
  font-size: clamp(13px, 4.2vw, 17px); text-wrap: balance; overflow-wrap: anywhere;
  text-shadow: 0 0 10px rgba(10, 12, 40, 0.95), 0 1px 3px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}
.send-card { position: relative; }
.note { margin: 0 4px 16px; font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.6; text-wrap: balance; }
.actions { display: grid; gap: 12px; }

/* ---------- 06 send ---------- */
.screen-send { overflow-x: clip; padding-bottom: calc(env(safe-area-inset-bottom) + 12px); user-select: none; -webkit-user-select: none; }
.send-guide { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 2vh; }
.target-sign {
  display: inline-block; margin: 0 0 14px; padding: 5px 14px; border-radius: 999px;
  border: 1px solid rgba(140, 222, 244, 0.35); background: var(--star-soft);
  font-size: 12.5px; letter-spacing: 0.06em; color: var(--star);
}
.target-sign:empty { display: none; }
/* the visitor's zodiac figure, as the LED shows it: "your star goes to this one" */
.sign-target { display: block; width: min(104px, 13dvh); aspect-ratio: 1; margin: 0 auto min(8px, 1dvh); filter: drop-shadow(0 0 12px rgba(120, 215, 245, 0.45)); }
.sign-target:not([src]) { display: none; }
.guide-line {
  position: relative; width: 1.5px; height: min(64px, 6dvh); margin-bottom: min(16px, 2dvh);
  background: linear-gradient(180deg, rgba(140, 222, 244, 0), rgba(140, 222, 244, 0.8));
  border-radius: 1px;
}
.guide-line i {
  position: absolute; left: 50%; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 10px 3px rgba(170, 236, 252, 0.85);
  animation: rise 1.9s ease-in infinite;
}
@keyframes rise { 0% { top: 100%; opacity: 0; } 15% { opacity: 1; } 100% { top: -4px; opacity: 0; } }
.guide { margin: 0; white-space: pre-line; font-family: var(--display); font-size: 19px; font-weight: 600; line-height: 1.75; letter-spacing: 0.06em; color: #f3f2fb; }
html[lang="en"] .guide { font-size: 22px; letter-spacing: 0.005em; line-height: 1.35; }
.send-zone { flex: 1 1 0; min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 14px 0 6px; }
.card-slot { width: 100%; }
.chevrons { display: grid; justify-items: center; margin-bottom: 8px; color: rgba(160, 228, 246, 0.8); }
.chevrons svg { width: 26px; height: 18px; animation: chev 1.6s ease-in-out infinite; }
.chevrons svg:first-child { animation-delay: 0.2s; }
@keyframes chev { 0%, 100% { opacity: 0.2; transform: translateY(4px); } 50% { opacity: 1; transform: translateY(-2px); } }
.send-card {
  width: min(78cqw, 330px, 100cqh); aspect-ratio: 1 / 1;
  border-radius: 22px; overflow: hidden;
  border: 1px solid var(--line-3);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.55), 0 0 46px -6px rgba(171, 159, 255, 0.4), 0 0 0 1px rgba(140, 222, 244, 0.12);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  cursor: grab; will-change: transform;
}
.send-card.dragging { cursor: grabbing; }
.send-card.returning { transition: transform 0.45s cubic-bezier(0.2, 1.4, 0.4, 1); }
.send-card img { display: block; width: 100%; height: 100%; pointer-events: none; }
.send-error { margin: 10px 0 0; text-align: center; color: var(--error); font-size: 13px; }
.footer { margin: 6px 0 0; text-align: center; font-size: 11px; color: var(--faint); }

/* flying star (drawn above everything) */
.fly-layer { position: fixed; inset: 0; pointer-events: none; z-index: 10; overflow: hidden; }
.fly-star {
  position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px 4px var(--c), 0 0 36px 12px var(--c), 0 0 80px 24px color-mix(in srgb, var(--c) 50%, transparent);
}
.fly-trail {
  position: absolute; width: 3px; margin-left: -1.5px; border-radius: 2px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), var(--c) 30%, transparent);
  filter: blur(0.6px);
}
.fly-spark {
  position: absolute; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 6px 2px var(--c);
}

/* ---------- done (sent / locked) ---------- */
.done-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding-bottom: 8vh; }
/* the star circling the visitor's zodiac figure, as on the LED */
.orbit-show { position: relative; width: min(188px, 24dvh); aspect-ratio: 1; margin: 0 0 10px; }
.orbit-figure { position: absolute; inset: 14%; width: 72%; height: 72%; filter: drop-shadow(0 0 14px rgba(120, 215, 245, 0.4)); }
.orbit-figure:not([src]) { visibility: hidden; }
.orbit-path { position: absolute; inset: 0; animation: orbit-turn 11s linear infinite; }
.done-star { position: absolute; left: 50%; top: -6%; width: 36%; height: 36%; margin-left: -18%; filter: drop-shadow(0 0 12px rgba(140, 222, 244, 0.5)); animation: orbit-turn 11s linear infinite reverse; }
@keyframes orbit-turn { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.done-title { margin: 0 0 16px; white-space: pre-line; font-family: var(--display); font-size: 27px; font-weight: 600; line-height: 1.5; letter-spacing: 0.06em; }
html[lang="en"] .done-title { font-size: 33px; line-height: 1.12; letter-spacing: 0.005em; }
.done-text { margin: 0 0 10px; font-size: 14.5px; line-height: 1.85; color: var(--soft); white-space: pre-line; }
.done-text.muted { color: var(--muted); font-size: 13px; margin-bottom: 30px; }

/* ---------- 05 confirm: two designs, one regeneration ---------- */
.designs:not([hidden]) { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0 0 12px; }
.design { position: relative; margin: 0; cursor: pointer; }
.design input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.design img {
  display: block; width: 100%; aspect-ratio: 3 / 1; object-fit: cover; object-position: 50% 41%; background: #12143a;
  border-radius: 12px; border: 1px solid var(--line-2); opacity: 0.55; transition: opacity 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.design span { display: block; margin-top: 4px; text-align: center; font-size: 11.5px; color: var(--muted); }
.design input:checked + img { opacity: 1; border-color: var(--star); box-shadow: 0 0 16px rgba(140, 222, 244, 0.4); }
.design input:checked ~ span { color: var(--star); }
.design input:focus-visible + img { outline: 2px solid var(--accent); outline-offset: 2px; }
.confirm-notice { margin: -6px 4px 14px; text-align: center; font-size: 12.5px; color: #ecd7a6; text-wrap: balance; }
.regen-rule { margin: -4px 0 0; text-align: center; font-size: 11.5px; color: var(--faint); }

/* ---------- 07 sent: the 3D model is being made ---------- */
.making {
  display: flex; align-items: center; gap: 14px; width: 100%; margin: 8px 0 22px; padding: 15px 18px;
  text-align: left;
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--glass);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.making-ring {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid rgba(171, 159, 255, 0.28); border-top-color: var(--star);
  animation: spin 1.4s linear infinite; filter: drop-shadow(0 0 3px rgba(140, 222, 244, 0.6));
}
.making.settled .making-ring { animation: none; border-color: var(--star); background: radial-gradient(circle, rgba(140, 222, 244, 0.9) 0 18%, transparent 22%); }
.making-title { margin: 0; font-size: 14.5px; }
.making-sub { margin: 2px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ---------- 08 tap ---------- */
.screen-tap { user-select: none; -webkit-user-select: none; }
.tap-head { text-align: center; padding-top: 2vh; }
.tap-title { margin: 0 0 6px; white-space: pre-line; font-family: var(--display); font-size: 25px; font-weight: 600; letter-spacing: 0.06em; line-height: 1.5; }
html[lang="en"] .tap-title { font-size: 30px; line-height: 1.15; letter-spacing: 0.005em; }
.tap-sub { margin: 0; font-size: 13px; color: var(--muted); }
.tap-zone { flex: 1 1 0; min-height: 0; container-type: size; display: grid; place-items: center; padding: 14px 0; }
.tap-star {
  position: relative; width: min(72cqw, 290px, 76cqh); aspect-ratio: 1 / 1; padding: 0; border: 0; border-radius: 50%;
  background: none; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.tap-star img {
  position: relative; display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 41%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 40px rgba(130, 120, 255, 0.35);
  transition: transform 0.15s;
  -webkit-mask-image: radial-gradient(circle, #000 62%, transparent 71%); mask-image: radial-gradient(circle, #000 62%, transparent 71%);
}
.tap-star:active img { transform: scale(0.97); }
.tap-halo {
  position: absolute; inset: -14%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(140, 222, 244, 0.3), rgba(171, 159, 255, 0.1) 45%, transparent 68%);
  animation: breathe 3.2s ease-in-out infinite;
}
.tap-star.glow .tap-halo { animation: tap-glow 1.1s ease-out; }
@keyframes tap-glow { 0% { transform: scale(0.9); opacity: 1; filter: brightness(2.2); } 100% { transform: scale(1.35); opacity: 0.9; filter: brightness(1); } }
.tap-ring { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); transform: rotate(-90deg); pointer-events: none; }
.tap-ring circle { fill: none; stroke: var(--star); stroke-width: 0.8; stroke-dasharray: 302 302; stroke-dashoffset: 302; opacity: 0; }
.tap-star.cooling .tap-ring circle { opacity: 0.9; animation: tap-cool var(--cool, 3000ms) linear forwards; }
@keyframes tap-cool { from { stroke-dashoffset: 0; } to { stroke-dashoffset: 302; } }
.tap-star:focus-visible { outline: 2px solid var(--accent); outline-offset: 8px; }
.tap-hint { min-height: 3.4em; margin: 0 8px 8px; text-align: center; white-space: pre-line; font-size: 14px; color: #e4e4f3; line-height: 1.7; text-wrap: balance; }

/* ---------- 09 locked ---------- */
.locked-star { width: 128px; height: 128px; margin: 0 0 22px; }
.locked-star img {
  display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 41%;
  opacity: 0.55; filter: saturate(0.7);
  -webkit-mask-image: radial-gradient(circle, #000 55%, transparent 71%); mask-image: radial-gradient(circle, #000 55%, transparent 71%);
}

/* ---------- closed ---------- */
.closed-title { margin: 0 0 18px; font-family: var(--display); font-size: 21px; font-weight: 600; letter-spacing: 0.06em; }
html[lang="en"] .closed-title { font-size: 25px; letter-spacing: 0.005em; }
.closed-card {
  width: 100%; margin: 0 0 14px; padding: 15px 18px; border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.closed-label { margin: 0 0 2px; font-size: 12px; color: var(--muted); }
.closed-time { margin: 0; font-size: 17px; color: var(--star); letter-spacing: 0.02em; }
.closed-hours { margin: 0 0 24px; font-size: 13px; color: var(--muted); }

/* ---------- Turnstile sheet (only when Cloudflare asks for an interaction) ---------- */
.human-box:not([hidden]) {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 16px); transform: translateX(-50%); z-index: 30;
  padding: 12px; border-radius: var(--radius); background: var(--glass-2); border: 1px solid var(--line-2);
}

@media (min-height: 760px) {
  .page-title { margin-bottom: 26px; }
}

/* screenshots: no entry animations, the moving lights stopped at a calm frame */
html.shot .screen.active, html.shot .lore-card.in, html.shot .wheel-date::before, html.shot .cst-spark, html.shot .cst-dust, html.shot .sign-name,
html.shot .btn-primary::after, html.shot .logo-art, html.shot .logo-art > *, html.shot .orbit-path, html.shot .done-star,
html.shot .top-cta::before, html.shot .top-cta::after { animation: none; }
html.shot .btn-primary::after { display: none; }
html.shot .top-cta::before, html.shot .top-cta::after { opacity: 1; transform: rotate(45deg); }

@media (prefers-reduced-motion: reduce) {
  .screen.active { animation: none; }
  .btn-primary::after { display: none; }
  .logo-art, .logo-art > *, .orbit-path, .done-star,
  .top-cta::before, .top-cta::after, .wheel-date::before, .cst-spark, .cst-dust, .sign-name, .combo, .combo-star { animation: none; }
  .top-cta::before, .top-cta::after { opacity: 0.8; transform: none; }
  .spinner-ring .arc, .spin-star, .spinner::before, .spinner::after, .guide-line i, .chevrons svg, .making-ring, .tap-halo { animation-duration: 6s; }
  .lore-card.in { animation-name: lore-fade; }
  @keyframes lore-fade { from { opacity: 0; } }
}

/* ---------- short phones (Safari with its bars, small iPhones): tighter spacing so nothing scrolls ---------- */
@media (max-height: 720px) {
  .app-bar { margin-bottom: 10px; }
  .screen { padding-top: calc(env(safe-area-inset-top) + 10px); padding-bottom: calc(env(safe-area-inset-bottom) + 14px); }
  .screen-notes { padding-top: calc(env(safe-area-inset-top) + 16px); padding-bottom: calc(env(safe-area-inset-bottom) + 24px); }
  .sign-head { margin: 0 0 12px; }
  .sign-name { font-size: 32px; line-height: 1.25; }
  html[lang="en"] .sign-name { font-size: 42px; }
  .stone-title { margin-bottom: 8px; }
  .stone-pick { margin-bottom: 10px; }
  .sc-body { min-height: 70px; gap: 5px; padding: 9px 6px 8px; }
  .gem-ico { width: 26px; height: 26px; }
  .combo { margin-bottom: 12px; padding: 6px 14px 6px 6px; }
  .combo-star { width: 58px; height: 58px; }
  .frame-slot { margin: 10px 0 8px; }
  .designs:not([hidden]) { margin-bottom: 8px; }
  .note { margin-bottom: 10px; }
  .actions { gap: 8px; }
  .btn { min-height: 48px; padding-block: 10px; }
  .page-title { margin-bottom: 14px; }
  .page-lead { margin-bottom: 14px; }
  .wheel-wrap { width: min(250px, 64vw, 30dvh); margin-bottom: 16px; }
  .birth-note { margin-bottom: 14px; }
  .field { margin-bottom: 14px; }
  .done-title { margin-bottom: 10px; font-size: 25px; }
  .making { margin: 6px 0 14px; padding: 12px 16px; }
  .done-text.muted { margin-bottom: 12px; }
  .guide { font-size: 17.5px; line-height: 1.6; }
}
@media (max-height: 600px) {
  .wish-card { padding: 10px 16px 10px 18px; }
  .wish-card .wish-text { font-size: 14.5px; }
  .sign-your { font-size: 12px; }
  .sign-name { font-size: 27px; }
  html[lang="en"] .sign-name { font-size: 34px; }
  .sign-range { margin-top: 2px; }
  .sc-body { min-height: 58px; padding: 7px 4px 6px; }
  .gem-ico { width: 22px; height: 22px; }
  .combo-star { width: 46px; height: 46px; }
  .combo-title { font-size: 15px; margin-bottom: 1px; }
  .btn { min-height: 46px; }
  .lead { line-height: 1.8; }
  .done-title { font-size: 23px; }
  .done-text { font-size: 13.5px; line-height: 1.7; }
  .tap-title { font-size: 22px; }
}
