/* VOICE   a group-chat joke dressed as a premium app: dry, warm, quick
   IDEA    the iOS time picker, turned into a drum of eight names you flick
   PICTURE the name drum with its glass band; the band blushes Santa red on the reveal
   COLOUR+TYPE pure white by day, true black at night, one Santa red; Geist, tight titles
   LAYOUT  one 480px thumb column: title top-left, content, full-width button pinned low */

:root {
  --bg: #fff; --bg0: rgba(255,255,255,0); --ink: #0b0b0c; --mute: #6e6e73;
  --line: #e6e6e9; --soft: #f4f4f5; --soft2: #eaeaed; --red: #e3262f;
  --veil: rgba(255,255,255,.78); --shadow: 0 1px 3px rgba(0,0,0,.12);
  --ease: cubic-bezier(.2,.8,.2,1); --rh: 54px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #000; --bg0: rgba(0,0,0,0); --ink: #f5f5f7; --mute: #8e8e93;
    --line: #232327; --soft: #111113; --soft2: #1c1c1f; --red: #ff453a;
    --veil: rgba(0,0,0,.72); --shadow: 0 1px 3px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme=dark] {
  --bg: #000; --bg0: rgba(0,0,0,0); --ink: #f5f5f7; --mute: #8e8e93;
  --line: #232327; --soft: #111113; --soft2: #1c1c1f; --red: #ff453a;
  --veil: rgba(0,0,0,.72); --shadow: 0 1px 3px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; min-width: 0; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 16px/1.5 "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: clip; padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left);
}
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: 0 20px; }

/* top bar */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  margin: 0 -20px; padding: env(safe-area-inset-top) 20px 0; min-height: calc(60px + env(safe-area-inset-top));
  background: var(--veil); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
}
.brand { font-weight: 600; font-size: 16px; letter-spacing: -.02em; }
.brand b { color: var(--red); }
.seg { display: flex; padding: 3px; border-radius: 999px; background: var(--soft); }
.seg button {
  height: 34px; min-width: 46px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent;
  font-size: 13px; font-weight: 600; color: var(--mute); transition: background .3s var(--ease), color .3s var(--ease), box-shadow .3s;
}
.seg button[aria-pressed=true] { background: var(--bg); color: var(--ink); box-shadow: var(--shadow); }

main { flex: 1; padding-top: clamp(14px, 4.5vh, 44px); padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
.view { animation: rise .55s var(--ease) both; }
.rise { animation: rise .5s var(--ease) both; }
h1 {
  margin: 0; font-size: clamp(32px, 8.8vw, 40px); line-height: 1.05; letter-spacing: -.035em;
  font-weight: 650; text-wrap: balance;
}
.sub { margin: 12px 0 0; max-width: 34ch; color: var(--mute); font-size: 16px; text-wrap: pretty; }

/* login */
.names { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 28px; }
.name {
  display: flex; align-items: center; gap: 12px; height: 66px; padding: 0 14px; border: 0; border-radius: 20px;
  background: var(--soft); font-size: 17px; font-weight: 500; letter-spacing: -.01em; text-align: left;
  transition: background .3s var(--ease), color .3s var(--ease), transform .2s var(--ease);
  animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 40ms + 80ms);
}
.name:active { transform: scale(.97); }
.name .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg); font-size: 14px; font-weight: 600; transition: background .3s var(--ease), color .3s var(--ease);
}
.name.joined .av { background: var(--ink); color: var(--bg); }
.name[aria-checked=true] { background: var(--ink); color: var(--bg); }
.name[aria-checked=true] .av { background: var(--red); color: #fff; }

.elves { display: flex; align-items: center; gap: 12px; margin: 24px 0 8px; font-size: 13px; color: var(--mute); }
.stack { display: flex; padding-left: 6px; }
.stack i {
  width: 26px; height: 26px; margin-left: -6px; border: 2px solid var(--bg); border-radius: 50%;
  background: var(--soft2); color: var(--mute); font-style: normal; font-size: 10px; font-weight: 600;
  line-height: 22px; text-align: center; transition: background .4s var(--ease), color .4s var(--ease);
}
.stack i.on { background: var(--ink); color: var(--bg); }
.demo { margin: 4px 0 0; font-size: 13px; color: var(--mute); }
.demo::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--red); vertical-align: 2px; }

/* interests */
.back { display: grid; place-items: center; width: 44px; height: 44px; margin: -6px 0 6px -12px; border: 0; border-radius: 50%; background: transparent; }
.back:active { background: var(--soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.chip {
  display: inline-flex; align-items: center; height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; font-size: 15px; font-weight: 500; letter-spacing: -.01em;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .2s var(--ease);
}
.chip:active { transform: scale(.95); }
.chip[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.field { display: block; margin-top: 28px; }
.field-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 13px; color: var(--mute); }
textarea {
  display: block; width: 100%; resize: none; padding: 14px 16px; border: 1px solid transparent; border-radius: 16px;
  background: var(--soft); color: var(--ink); font: inherit; font-size: 16px; line-height: 1.45; transition: border-color .2s;
}
textarea::placeholder { color: var(--mute); }
textarea:focus { outline: 0; border-color: var(--ink); }

/* the drum */
.stage { position: relative; margin: 20px 0 4px; }
.wheel {
  position: relative; height: 300px; outline: 0; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 75%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 75%, transparent);
}
.wheel:active { cursor: grabbing; }
.band {
  position: absolute; left: 0; right: 0; top: 50%; height: var(--rh); transform: translateY(-50%);
  border-radius: 16px; background: var(--soft2); transition: background .6s var(--ease), box-shadow .3s;
}
.wheel:focus-visible .band { box-shadow: 0 0 0 2px var(--red); }
.won .band { background: color-mix(in srgb, var(--red) 15%, transparent); }
.item {
  position: absolute; left: 0; right: 0; top: 50%; height: var(--rh); margin-top: calc(var(--rh) / -2);
  display: flex; align-items: center; justify-content: center; white-space: nowrap;
  font-size: 30px; font-weight: 500; letter-spacing: -.025em; will-change: transform, opacity, filter; transition: color .45s var(--ease);
}
.item.hit { color: var(--red); font-weight: 600; }
.burst { position: absolute; left: 50%; top: 50%; pointer-events: none; }
.burst i {
  position: absolute; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--ink); opacity: 0;
  animation: pop .95s var(--ease) forwards;
}
.burst i.r { background: var(--red); }
.burst i.s { width: 4px; height: 4px; margin: -2px; }

/* result */
.result { margin-top: 18px; animation: rise .6s var(--ease) both; }
.card { padding: 20px; border-radius: 24px; background: var(--soft); }
.label { margin: 0 0 12px; font-size: 13px; color: var(--mute); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; height: 34px; padding: 0 13px; border-radius: 999px; background: var(--bg); font-size: 14px; font-weight: 500; }
.empty { margin: 0; text-wrap: pretty; }
.quote { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.quote .label { margin-bottom: 4px; }
.qt { margin: 0; font-size: 17px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.facts:empty { display: none; }
.fact { padding: 14px 16px; border-radius: 18px; background: var(--soft); }
.fact small { display: block; font-size: 13px; color: var(--mute); }
.fact b { font-weight: 600; white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pill {
  height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: transparent;
  font-size: 15px; font-weight: 500; transition: background .2s, transform .2s var(--ease);
}
.pill:active { transform: scale(.96); background: var(--soft); }

/* bottom button */
.cta {
  position: sticky; bottom: 0; z-index: 4; margin: 0 -20px; padding: 22px 20px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, var(--bg0), var(--bg) 30%);
}
.hint { margin: 0 0 10px; text-align: center; font-size: 13px; color: var(--mute); }
.btn {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 56px; border: 0; border-radius: 16px;
  background: var(--ink); color: var(--bg); font-size: 17px; font-weight: 600; letter-spacing: -.01em;
  transition: transform .2s var(--ease), opacity .3s var(--ease);
}
.btn:active:not(:disabled) { transform: scale(.975); }
.btn:disabled { opacity: .28; cursor: default; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 40; width: max-content; max-width: min(90vw, 420px);
  padding: 12px 18px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 500; text-align: center;
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* phone + code */
.phone {
  display: flex; align-items: center; gap: 12px; height: 64px; margin-top: 28px; padding: 0 18px; border: 1px solid transparent;
  border-radius: 20px; background: var(--soft); color: var(--mute); transition: border-color .2s, color .2s;
}
.phone:focus-within { border-color: var(--ink); color: var(--ink); }
.phone input {
  flex: 1; width: 100%; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 21px; font-weight: 500; letter-spacing: .01em; font-variant-numeric: tabular-nums;
}
.phone input::placeholder { color: var(--mute); opacity: .6; }
.err { min-height: 0; margin: 12px 0 0; color: var(--red); font-size: 14px; text-wrap: pretty; }
.err:empty { display: none; }
.fine { margin: 16px 0 0; font-size: 13px; color: var(--mute); text-wrap: pretty; }
.otp { position: relative; margin-top: 28px; }
.otp input {
  position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; border: 0; padding: 0; opacity: .01;
  background: transparent; color: transparent; caret-color: transparent; font-size: 16px; letter-spacing: 1em;
}
.cells { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.cells i {
  position: relative; display: grid; place-items: center; height: 64px; border: 1px solid transparent; border-radius: 16px;
  background: var(--soft); font-style: normal; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums;
  transition: border-color .2s, background .3s var(--ease), color .3s var(--ease), transform .25s var(--ease);
}
.cells i.on { animation: pop-in .22s var(--ease) both; }
.cells i.cur { border-color: var(--ink); }
.cells i.cur::after { content: ""; width: 2px; height: 26px; border-radius: 2px; background: var(--ink); animation: blink 1s steps(1) infinite; }
.otp.ok .cells i { background: var(--ink); color: var(--bg); transition-delay: calc(var(--n) * 40ms); }
.otp.bad .cells { animation: shake .42s var(--ease); }
.otp.bad .cells i { border-color: var(--red); color: var(--red); }
.links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin-top: 16px; }
.link {
  height: 40px; padding: 0; border: 0; background: transparent; font-size: 15px; font-weight: 500;
  text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px;
}
.link:disabled { color: var(--mute); text-decoration: none; cursor: default; font-variant-numeric: tabular-nums; }

/* "say hi first" (while codes go as plain WhatsApp text) */
.sayhi {
  display: flex; align-items: center; gap: 14px; margin-top: 12px; padding: 14px 16px; border-radius: 20px;
  background: color-mix(in srgb, #25d366 12%, var(--soft)); color: var(--ink); text-decoration: none;
  transition: transform .2s var(--ease); touch-action: manipulation;
}
.sayhi:active { transform: scale(.98); }
.sayhi > svg:first-child { flex: none; color: #1fa855; }
.sayhi span { flex: 1; display: grid; gap: 2px; }
.sayhi b { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.sayhi small { font-size: 13px; line-height: 1.4; color: var(--mute); }
.sayhi .go { flex: none; color: var(--mute); }
.inl { color: var(--ink); font-weight: 500; text-underline-offset: 3px; }

/* WhatsApp note under the result */
.wa-row { display: flex; align-items: center; gap: 8px; margin: 12px 4px 0; font-size: 13px; color: var(--mute); }
.wa-row svg { flex: none; }
.wa-row.bad { color: var(--red); }
.wa-row .link { height: auto; font-size: 13px; color: var(--ink); }

/* typewriter caret on the first title */
.typing::after { content: ""; display: inline-block; width: .07em; height: .9em; margin-left: .06em; vertical-align: -.08em; background: var(--red); animation: blink 1s steps(1) infinite; }

/* bottom button: on iPhone a transparent label over it toggles a real switch, which is what makes Safari buzz */
.btnwrap { position: relative; }
.btnwrap:active .btn:not(:disabled) { transform: scale(.975); }
#hxSwitch { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.hx { position: absolute; inset: 0; z-index: 2; border-radius: 16px; cursor: pointer; }
.btn, .name, .chip, .pill, .link, .seg button, .back { touch-action: manipulation; }

/* intro */
body.intro-on { overflow: hidden; }
.intro {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; overflow: hidden;
  background: #171817; color: #f2f2ee; cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.intro video {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: block; width: min(146vw, 1100px, 190vh); max-width: none; aspect-ratio: 16 / 9; height: auto; object-fit: cover; pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 98%); mask-image: radial-gradient(closest-side, #000 72%, transparent 98%);
}
.intro-tap {
  position: absolute; left: 0; right: 0; bottom: calc(14vh + env(safe-area-inset-bottom)); margin: 0;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 15px; font-weight: 500; letter-spacing: .01em; color: #defa7f; opacity: 0; transition: opacity .4s var(--ease);
}
.intro.ready .intro-tap { opacity: 1; animation: breathe 2.2s ease-in-out infinite; }
.intro-skip {
  position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 16px; margin: 0; padding: 10px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 500; color: rgba(242,242,238,.55); opacity: 0; transition: opacity .4s var(--ease) .6s;
}
.intro.playing .intro-skip { opacity: 1; }
.intro.out { opacity: 0; transform: scale(1.03); pointer-events: none; }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop-in { from { transform: scale(.86); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes breathe { 50% { opacity: .45; } }
@keyframes pop {
  0% { opacity: 1; transform: translate(0, 0) scale(.3); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(1); }
}

@media (min-width: 900px) { main { padding-top: 8vh; } }
@media (max-width: 350px) { .name { gap: 8px; padding: 0 10px; font-size: 15px; } .av { width: 30px; height: 30px; } .item { font-size: 26px; } .cells { gap: 6px; } .cells i { height: 56px; font-size: 22px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0s !important; transition-duration: 1ms !important; }
}
