/* ==========================================================================
   Block or Bestie — design system
   Chunky "sticker" style: ink outlines, offset solid shadows, bright candy colours.
   ========================================================================== */

:root {
  --ink: #24173f;
  --ink-2: #5d5480;
  --ink-3: #9a92b8;
  --paper: #fffaf2;
  --white: #ffffff;

  --pink: #ff4f9a;
  --pink-2: #ff8cc0;
  --pink-d: #d9327a;
  --red: #ff3d57;
  --red-d: #cf1f3a;
  --yellow: #ffd23f;
  --yellow-2: #ffe792;
  --mint: #25d9a3;
  --mint-d: #0fa77a;
  --sky: #5cc8ff;
  --sky-d: #2f9fe0;
  --violet: #8f6bff;
  --violet-d: #6845e0;
  --orange: #ff8c42;

  --line: 3px solid var(--ink);
  --r: 22px;
  --r-sm: 14px;
  --sh: 0 6px 0 var(--ink);
  --sh-sm: 0 4px 0 var(--ink);
  --sh-lg: 0 8px 0 var(--ink);

  /* --f-script is set per language (Baloo for Indic/Arabic, Kosugi Maru, Jua, Mali…) by i18n.js */
  --f-script: system-ui;
  --f-display: 'Fredoka', var(--f-script), 'Nunito', system-ui, sans-serif;
  --f-body: 'Nunito', var(--f-script), system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif, 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji';
  --f-emoji: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);

  --topbar-h: 68px;
  --gutter: 16px;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: #bfe1ff;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: var(--pink-d); }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 700; line-height: 1.1; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
.emo { font-family: var(--f-emoji); font-weight: 400; line-height: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }

/* ------------------------------------------------------------------ background */

#bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-layer { position: absolute; inset: 0; opacity: 0; transition: opacity .9s ease; }
.bg-sky { background: linear-gradient(180deg, #9cd7ff 0%, #c9d4ff 48%, #ffd4ea 100%); }
.bg-stage { background: radial-gradient(120% 80% at 50% 0%, #5a46b0 0%, #2d1f63 55%, #170e33 100%); }
.bg-sunset { background: linear-gradient(180deg, #ffb6cf 0%, #ffd2ad 55%, #fff0bf 100%); }
.bg-mint { background: linear-gradient(180deg, #aef3dc 0%, #c4e5ff 55%, #e6dcff 100%); }
body[data-bg="sky"] .bg-sky,
body[data-bg="stage"] .bg-stage,
body[data-bg="sunset"] .bg-sunset,
body[data-bg="mint"] .bg-mint { opacity: 1; }
body[data-bg="stage"] .bg-clouds { opacity: .18; }

.bg-clouds { position: absolute; inset: 0; transition: opacity .9s ease; }
.cloud {
  position: absolute;
  left: 0;
  background: url(../img/cloud.svg) no-repeat center / contain;
  animation: drift linear infinite;
  will-change: transform;
}
@keyframes drift { from { transform: translateX(-35vw); } to { transform: translateX(110vw); } }

.spark {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  animation: twinkle 3.4s ease-in-out infinite;
  opacity: 0;
}
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(.3) rotate(0); }
  50% { opacity: .95; transform: scale(1) rotate(90deg); }
}

/* ------------------------------------------------------------------ loader */

#loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: linear-gradient(180deg, #9cd7ff 0%, #ffd4ea 100%);
  transition: opacity .55s ease, visibility .55s ease, transform .55s var(--ease-in);
}
#loader.is-done { opacity: 0; visibility: hidden; transform: scale(1.08); }
.loader-scene { position: relative; width: 170px; height: 170px; display: grid; place-items: center; }
.loader-halo {
  position: absolute; inset: 10px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, 0) 70%);
  animation: haloPulse 1.6s ease-in-out infinite;
}
.loader-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 4px dashed rgba(36, 23, 63, .35);
  animation: spin 6s linear infinite;
}
.loader-logo { position: relative; width: 110px; height: 110px; animation: loaderBounce .9s var(--ease-spring) infinite alternate; }
.loader-title { font: 700 26px var(--f-display); }
.loader-dots { display: flex; gap: 8px; }
.loader-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--pink); border: 2px solid var(--ink); animation: dot 1s ease-in-out infinite; }
.loader-dots i:nth-child(2) { animation-delay: .15s; background: var(--yellow); }
.loader-dots i:nth-child(3) { animation-delay: .3s; background: var(--mint); }
@keyframes haloPulse { 50% { transform: scale(1.15); opacity: .6; } }
@keyframes loaderBounce { from { transform: translateY(6px) rotate(-6deg); } to { transform: translateY(-10px) rotate(6deg); } }
@keyframes dot { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-10px); } }
@keyframes spin { to { transform: rotate(360deg); } }

#topprog {
  position: fixed; top: 0; left: 0; z-index: 150;
  height: 4px; width: 0;
  background: linear-gradient(90deg, var(--pink), var(--yellow), var(--mint));
  box-shadow: 0 0 12px rgba(255, 79, 154, .7);
  opacity: 0;
  transition: width .4s var(--ease-out), opacity .3s;
}
#topprog.is-on { opacity: 1; }

/* ------------------------------------------------------------------ top bar */

.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
  max-width: 1100px; margin: 0 auto;
  transition: background .3s, box-shadow .3s;
}
body.is-scrolled .topbar { background: rgba(255, 250, 242, .78); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 2px 0 rgba(36, 23, 63, .12); max-width: none; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); direction: ltr; }
.brand img { width: 40px; height: 40px; transition: transform .4s var(--ease-spring); }
.brand:hover img { transform: rotate(-12deg) scale(1.1); }
.brand-word { font: 700 21px/1 var(--f-display); display: flex; align-items: baseline; gap: 4px; }
.brand-word b { color: var(--red); font-weight: 700; }
.brand-word i { font-style: normal; font-size: 14px; color: var(--ink-2); }
.brand-word em { font-style: normal; color: var(--pink); }
body[data-bg="stage"] .brand-word, body[data-bg="stage"] .brand { color: #fff; }
body[data-bg="stage"] .brand-word i { color: #d8ccff; }
body[data-bg="stage"].is-scrolled .topbar { background: rgba(23, 14, 51, .7); }

.topbar-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border: var(--line); border-radius: 14px;
  background: var(--white);
  box-shadow: var(--sh-sm);
  cursor: pointer;
  font-size: 20px;
  transition: transform .12s var(--ease-out), box-shadow .12s;
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.icon-btn .ico-sound-off { display: none; }
.icon-btn[aria-pressed="false"] .ico-sound-on { display: none; }
.icon-btn[aria-pressed="false"] .ico-sound-off { display: inline; }
.burger { display: grid; gap: 4px; }
.burger i { display: block; width: 20px; height: 3px; border-radius: 3px; background: var(--ink); transition: transform .3s var(--ease-out), opacity .2s; }
#btn-menu[aria-expanded="true"] .burger i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#btn-menu[aria-expanded="true"] .burger i:nth-child(2) { opacity: 0; }
#btn-menu[aria-expanded="true"] .burger i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ------------------------------------------------------------------ drawer */

.drawer { position: fixed; inset: 0; z-index: 120; pointer-events: none; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(36, 23, 63, .45); opacity: 0; transition: opacity .3s; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(320px, 86vw);
  padding: 22px 18px;
  background: var(--paper);
  border-left: var(--line);
  transform: translateX(105%);
  transition: transform .45s var(--ease-out);
  display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto;
}
.drawer.is-open { pointer-events: auto; }
.drawer.is-open .drawer-scrim { opacity: 1; }
.drawer.is-open .drawer-panel { transform: none; }
.drawer-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font: 700 20px var(--f-display); }
.drawer-panel a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--ink); text-decoration: none;
  font: 600 18px var(--f-display);
  opacity: 0; transform: translateX(24px);
  transition: background .2s, opacity .4s var(--ease-out), transform .4s var(--ease-out);
}
.drawer.is-open .drawer-panel a { opacity: 1; transform: none; }
.drawer.is-open .drawer-panel a:nth-of-type(2) { transition-delay: .04s; }
.drawer.is-open .drawer-panel a:nth-of-type(3) { transition-delay: .08s; }
.drawer.is-open .drawer-panel a:nth-of-type(4) { transition-delay: .12s; }
.drawer.is-open .drawer-panel a:nth-of-type(5) { transition-delay: .16s; }
.drawer.is-open .drawer-panel a:nth-of-type(6) { transition-delay: .2s; }
.drawer.is-open .drawer-panel a:nth-of-type(7) { transition-delay: .24s; }
.drawer.is-open .drawer-panel a:nth-of-type(8) { transition-delay: .28s; }
.drawer-panel a:hover { background: #ffe6f1; }
.drawer-panel a span { font-family: var(--f-emoji); font-size: 20px; width: 28px; text-align: center; }
.drawer-panel hr { border: 0; border-top: 2px dashed rgba(36, 23, 63, .2); margin: 10px 0; width: 100%; }

/* ------------------------------------------------------------------ layout */

#app { position: relative; padding: 6px var(--gutter) 56px; min-height: calc(100dvh - var(--topbar-h)); outline: none; overflow-x: clip; }
.view { max-width: 500px; margin: 0 auto; }
.view.is-wide { max-width: 1040px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.row-c { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.center { text-align: center; }
.mt-s { margin-top: 10px; } .mt { margin-top: 18px; } .mt-l { margin-top: 28px; }
.muted { color: var(--ink-2); font-weight: 700; }
.small { font-size: 14px; }

.page-head { text-align: center; padding: 8px 0 18px; }
.page-head h1 { font-size: clamp(30px, 8vw, 40px); }
.page-head p { margin-top: 8px; color: var(--ink-2); }
.kicker {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; margin-bottom: 10px;
  border: 2px solid var(--ink); border-radius: 99px;
  background: var(--yellow);
  font: 700 13px var(--f-display); letter-spacing: .04em; text-transform: uppercase;
  box-shadow: 0 3px 0 var(--ink);
}

/* hand-drawn style highlight */
.hl { position: relative; white-space: nowrap; z-index: 0; }
.hl::after {
  content: ""; position: absolute; z-index: -1;
  left: -4px; right: -4px; bottom: .04em; height: .42em;
  background: var(--hl, var(--yellow));
  border-radius: 6px;
  transform: rotate(-1.5deg) scaleX(0); transform-origin: left;
  animation: hlDraw .7s .45s var(--ease-out) forwards;
}
@keyframes hlDraw { to { transform: rotate(-1.5deg) scaleX(1); } }
mark.nm { background: none; color: var(--pink-d); position: relative; white-space: nowrap; }
mark.nm::after { content: ""; position: absolute; left: -2px; right: -2px; bottom: 0; height: 6px; border-radius: 4px; background: var(--yellow); z-index: -1; }

/* ------------------------------------------------------------------ cards */

.card {
  position: relative;
  background: var(--paper);
  border: var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-lg);
  padding: 20px;
}
.card-title { font-size: 22px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card--tape::before {
  content: ""; position: absolute; top: -15px; left: 50%;
  width: 116px; height: 30px;
  transform: translateX(-50%) rotate(-3deg);
  background: repeating-linear-gradient(45deg, rgba(255, 210, 63, .92) 0 10px, rgba(255, 231, 146, .92) 10px 20px);
  border-radius: 5px;
  box-shadow: 0 2px 0 rgba(36, 23, 63, .18);
}
.card--pink { background: #ffe3ef; }
.card--sky { background: #e2f4ff; }
.card--mint { background: #dcfbef; }
.card--yellow { background: #fff6d1; }

/* ------------------------------------------------------------------ buttons */

.btn {
  --bg: var(--white);
  --fg: var(--ink);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 56px;
  padding: 14px 22px;
  border: var(--line);
  border-radius: 18px;
  background: var(--bg);
  color: var(--fg);
  font: 700 19px/1.1 var(--f-display);
  letter-spacing: .01em;
  text-decoration: none;
  box-shadow: var(--sh);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
  transition: transform .14s var(--ease-out), box-shadow .14s var(--ease-out), filter .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--ink); }
.btn:active, .btn.is-pressed { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.btn[disabled], .btn.is-disabled { filter: grayscale(.7); opacity: .6; pointer-events: none; }
.btn .emo { font-size: 1.15em; }
.btn--pink { --bg: linear-gradient(180deg, #ff74b0 0%, #ff3d8f 100%); --fg: #fff; text-shadow: 0 2px 0 rgba(120, 10, 60, .35); }
.btn--red { --bg: linear-gradient(180deg, #ff6b7f 0%, #ff2e4c 100%); --fg: #fff; text-shadow: 0 2px 0 rgba(120, 10, 30, .35); }
.btn--yellow { --bg: linear-gradient(180deg, #ffe066 0%, #ffc61a 100%); }
.btn--mint { --bg: linear-gradient(180deg, #5ef0c1 0%, #19cf97 100%); }
.btn--sky { --bg: linear-gradient(180deg, #8ad9ff 0%, #45b8f5 100%); }
.btn--violet { --bg: linear-gradient(180deg, #a98bff 0%, #7c55ff 100%); --fg: #fff; text-shadow: 0 2px 0 rgba(40, 10, 120, .35); }
.btn--ghost { --bg: rgba(255, 255, 255, .7); }
.btn--block { display: flex; width: 100%; }
.btn--lg { min-height: 66px; font-size: 22px; border-radius: 20px; }
.btn--sm { min-height: 44px; padding: 9px 14px; font-size: 16px; border-radius: 14px; box-shadow: var(--sh-sm); }
.btn--sm:hover { box-shadow: 0 6px 0 var(--ink); }
.btn--sm:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }

.btn--shine::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .55) 45%, transparent 60%);
  transform: translateX(-130%);
  animation: shine 3.4s ease-in-out infinite;
}
@keyframes shine { 0%, 55% { transform: translateX(-130%); } 85%, 100% { transform: translateX(130%); } }

.btn--pulse { animation: pulseGlow 2.2s ease-in-out infinite; }
@keyframes pulseGlow {
  0%, 100% { box-shadow: var(--sh), 0 0 0 0 rgba(255, 79, 154, .55); }
  50% { box-shadow: var(--sh), 0 0 0 14px rgba(255, 79, 154, 0); }
}

.ripple {
  position: absolute; border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  transform: scale(0);
  animation: ripple .6s var(--ease-out) forwards;
  pointer-events: none;
  z-index: -1;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }

.link-btn { background: none; border: 0; padding: 6px; cursor: pointer; color: var(--ink-2); font: 700 15px var(--f-display); text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--pink-d); }

/* ------------------------------------------------------------------ forms */

.field { display: block; text-align: left; }
.field > span { display: block; font: 600 15px var(--f-display); margin: 0 0 8px 4px; color: var(--ink-2); }
.input, .textarea, .select {
  width: 100%;
  padding: 15px 18px;
  border: var(--line);
  border-radius: 16px;
  background: var(--white);
  color: var(--ink);
  font: 800 19px var(--f-body);
  box-shadow: inset 0 4px 0 rgba(36, 23, 63, .07);
  outline: none;
  transition: box-shadow .2s, border-color .2s, transform .2s;
  -webkit-appearance: none;
  appearance: none;
}
.textarea { min-height: 140px; resize: vertical; font-size: 17px; line-height: 1.4; }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); font-weight: 700; }
.input:focus, .textarea:focus, .select:focus { box-shadow: 0 0 0 5px rgba(255, 79, 154, .28); }
.input.is-error { border-color: var(--red); animation: shake .45s; box-shadow: 0 0 0 5px rgba(255, 61, 87, .2); }
.input-xl { font: 700 26px var(--f-display); text-align: center; padding: 18px; }
.input-wrap { position: relative; }
.input-count { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font: 700 13px var(--f-display); color: var(--ink-3); }
.form-error { color: var(--red-d); font-size: 14px; min-height: 20px; margin-top: 6px; text-align: center; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.seg button {
  padding: 12px 6px;
  border: var(--line); border-radius: 16px;
  background: var(--white);
  box-shadow: var(--sh-sm);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: transform .15s var(--ease-out), box-shadow .15s, background .2s;
}
.seg button b { font: 700 22px var(--f-display); }
.seg button small { font-size: 12px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--yellow); transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }

/* ------------------------------------------------------------------ chips & pills */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border: 2px solid var(--ink); border-radius: 99px;
  background: var(--white);
  font: 600 14px var(--f-display);
  white-space: nowrap;
}
.chip .emo { font-size: 15px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border: var(--line); border-radius: 99px;
  background: var(--white);
  box-shadow: var(--sh-sm);
  font: 700 17px var(--f-display);
  white-space: nowrap;
}
.vchip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px;
  border: 2px solid var(--ink); border-radius: 99px;
  font: 700 11px var(--f-display); letter-spacing: .04em; text-transform: uppercase;
  white-space: nowrap;
}
.v-blocked { background: #ffd1d8; }
.v-thin_ice { background: #d4efff; }
.v-friend { background: #fff2b8; }
.v-trusted { background: #c9f7e6; }
.v-bestie { background: #ffd0e6; }

/* ------------------------------------------------------------------ avatar */

.av { display: block; width: 100%; height: auto; overflow: visible; }
.av-wrap { position: relative; display: inline-block; }
.av-ring { border-radius: 50%; border: var(--line); box-shadow: var(--sh-sm); background: var(--white); overflow: hidden; }
.av-xs { width: 40px; height: 40px; }
.av-sm { width: 48px; height: 48px; }
.av-md { width: 72px; height: 72px; }
.av-lg { width: 120px; height: 120px; }
.av-xl { width: 160px; height: 160px; }

.av-editor { display: grid; gap: 14px; }
.av-stage { position: relative; display: grid; place-items: center; padding: 6px 0 4px; }
.av-stage .av-ring { width: 150px; height: 150px; animation: avIdle 3s ease-in-out infinite; }
.av-stage .av-ring.is-changed { animation: avChange .45s var(--ease-spring); }
.av-dice {
  position: absolute; right: calc(50% - 112px); bottom: 2px;
  width: 52px; height: 52px; border-radius: 50%;
  font-size: 24px;
}
.av-dice:active .emo { transform: rotate(180deg); }
.av-dice .emo { transition: transform .4s var(--ease-spring); }
@keyframes avIdle { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
@keyframes avChange { 0% { transform: scale(.85) rotate(-8deg); } 100% { transform: scale(1) rotate(0); } }
.av-rows { display: grid; gap: 8px; }
.av-row { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; }
.av-row .lbl { text-align: center; font: 600 16px var(--f-display); }
.av-row .lbl small { display: block; font: 700 11px var(--f-body); color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; }
.av-arrow { width: 44px; height: 40px; border-radius: 12px; font-size: 18px; }

/* ------------------------------------------------------------------ progress */

.progress {
  position: relative;
  height: 20px;
  border: var(--line); border-radius: 99px;
  background: var(--white);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}
.progress > i {
  display: block; height: 100%;
  width: var(--p, 0%);
  background: repeating-linear-gradient(-45deg, var(--pink) 0 12px, var(--pink-2) 12px 24px);
  background-size: 34px 34px;
  border-right: 3px solid var(--ink);
  animation: stripes 1s linear infinite;
  transition: width .55s var(--ease-out);
}
.progress.is-empty > i { border-right: 0; }
@keyframes stripes { to { background-position: 34px 0; } }

.qhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.qcount {
  position: relative;
  padding: 8px 18px 8px 16px;
  background: var(--violet);
  color: #fff;
  border: var(--line); border-radius: 12px;
  font: 700 18px var(--f-display);
  box-shadow: var(--sh-sm);
  transform: rotate(-2deg);
}
.qcount b { font-size: 24px; }
.qcount.is-bump { animation: bump .4s var(--ease-spring); }
@keyframes bump { 40% { transform: rotate(-2deg) scale(1.18); } }
.dots { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin-top: 10px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink); background: var(--white); transition: background .3s, transform .3s var(--ease-spring); }
.dots i.is-done { background: var(--mint); }
.dots i.is-now { background: var(--yellow); transform: scale(1.35); }
.dots i.is-right { background: var(--mint); }
.dots i.is-wrong { background: var(--red); }

/* ------------------------------------------------------------------ question card + options */

.qstage { position: relative; perspective: 1400px; margin-top: 22px; }
.qcard {
  position: relative;
  background: var(--paper);
  border: var(--line);
  border-radius: 26px;
  box-shadow: var(--sh-lg);
  padding: 34px 16px 18px;
  transform-style: preserve-3d;
  will-change: transform;
}
.qcard::before {
  content: ""; position: absolute; top: -16px; left: 50%;
  width: 118px; height: 32px;
  transform: translateX(-50%) rotate(-3deg);
  background: repeating-linear-gradient(45deg, rgba(255, 143, 192, .92) 0 10px, rgba(255, 186, 216, .92) 10px 20px);
  border-radius: 5px;
  box-shadow: 0 2px 0 rgba(36, 23, 63, .18);
}
.qmeta { display: flex; justify-content: center; gap: 8px; margin-bottom: 10px; }
.qtext {
  font: 700 clamp(21px, 5.6vw, 26px)/1.22 var(--f-display);
  text-align: center;
  margin: 0 4px 18px;
  text-wrap: balance;
}
.qtext mark.nm::after { z-index: -1; }
.qtext { position: relative; z-index: 0; }

.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opts[data-n="3"] .opt:last-child { grid-column: 1 / -1; min-height: 98px; }
.opt {
  --tint: #fff;
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 128px;
  padding: 14px 10px 12px;
  border: var(--line); border-radius: 20px;
  background: var(--tint);
  box-shadow: 0 5px 0 var(--ink);
  color: var(--ink);
  font: 800 16px/1.2 var(--f-body);
  text-align: center;
  cursor: pointer;
  transition: transform .16s var(--ease-out), box-shadow .16s var(--ease-out), background .25s, color .25s, opacity .3s, filter .3s;
  -webkit-user-select: none; user-select: none;
}
.opt:nth-child(1) { --tint: #ffe3ef; }
.opt:nth-child(2) { --tint: #dff3ff; }
.opt:nth-child(3) { --tint: #dcfbef; }
.opt:nth-child(4) { --tint: #fff4cc; }
.opt .emo { font-size: 48px; transition: transform .35s var(--ease-spring); filter: drop-shadow(0 3px 0 rgba(36, 23, 63, .14)); }
.opt .lbl { text-wrap: balance; }
@media (hover: hover) {
  .opt:hover { transform: translateY(-3px); box-shadow: 0 8px 0 var(--ink); }
  .opt:hover .emo { transform: scale(1.14) rotate(-7deg); }
}
.opt:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.opts.is-locked .opt { pointer-events: none; }
.opt.is-picked { background: var(--pink); color: #fff; transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); animation: pickPop .4s var(--ease-spring); }
.opt.is-picked .emo { transform: scale(1.15); }
.opt.is-correct { background: var(--mint); color: var(--ink); animation: pickPop .45s var(--ease-spring); }
.opt.is-wrong { background: var(--red); color: #fff; animation: shake .45s; }
.opt.is-reveal { background: var(--mint); animation: revealGlow 1s ease-in-out 2; }
.opt.is-dim { opacity: .45; filter: grayscale(.5); }
.opt.is-removed { animation: crumble .55s var(--ease-in) forwards; pointer-events: none; }
.opt-badge {
  position: absolute; top: -12px; right: -10px;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  border: var(--line);
  background: var(--white);
  color: var(--ink);
  font: 700 18px var(--f-display);
  box-shadow: 0 3px 0 var(--ink);
  animation: popIn .4s var(--ease-spring) both;
}
@keyframes pickPop { 0% { transform: scale(.94); } 55% { transform: translateY(2px) scale(1.05); } 100% { transform: translateY(3px) scale(1); } }
@keyframes revealGlow { 50% { box-shadow: 0 5px 0 var(--ink), 0 0 0 8px rgba(37, 217, 163, .45); } }
@keyframes crumble {
  0% { transform: none; opacity: 1; }
  30% { transform: rotate(-4deg) scale(1.03); }
  100% { transform: translateY(30px) rotate(10deg) scale(.6); opacity: 0; filter: blur(3px); }
}

.qtools { display: flex; justify-content: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ playing HUD */

/* The HUD sticks under the top bar so the timer stays visible while reaching the lower answers. */
.hud {
  position: sticky; top: var(--topbar-h); z-index: 30;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  margin: 2px -8px 6px; padding: 4px 8px;
  border-radius: 0 0 22px 22px;
  transition: background .3s, box-shadow .3s;
}
body.is-scrolled .hud { background: rgba(255, 250, 242, .9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 3px 0 rgba(36, 23, 63, .12); }
.hud > :last-child { justify-self: end; }
@media (max-height: 760px) {
  .opt { min-height: 104px; padding: 10px 8px; }
  .opt .emo { font-size: 40px; }
  .qcard { padding-top: 28px; }
}
.timer { position: relative; width: 78px; height: 78px; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.timer .t-bg { fill: var(--white); stroke: var(--ink); stroke-width: 3; }
.timer .t-arc { fill: none; stroke: var(--mint); stroke-width: 9; stroke-linecap: round; transition: stroke .3s; }
.timer .t-num { position: absolute; inset: 0; display: grid; place-items: center; font: 700 26px var(--f-display); }
.timer.is-warn .t-arc { stroke: var(--yellow); }
.timer.is-low .t-arc { stroke: var(--red); }
.timer.is-low { animation: heartbeat .6s ease-in-out infinite; }
.timer.is-frozen .t-arc { stroke: var(--sky); }
.timer.is-frozen .t-bg { fill: #e3f6ff; }
.timer.is-frozen::after { content: "❄️"; position: absolute; top: -10px; right: -10px; font: 22px var(--f-emoji); animation: popIn .4s var(--ease-spring); }
@keyframes heartbeat { 50% { transform: scale(1.08); } }

.streak { display: inline-flex; align-items: center; gap: 4px; font: 700 18px var(--f-display); transition: transform .3s var(--ease-spring); }
.streak .emo { font-size: 22px; transition: transform .3s var(--ease-spring), filter .3s; }
.streak.is-off .emo { filter: grayscale(1) opacity(.45); }
.streak.is-hot .emo { animation: flame .5s ease-in-out infinite alternate; }
.streak.is-bump { animation: bump2 .45s var(--ease-spring); }
@keyframes flame { from { transform: scale(1) rotate(-6deg); } to { transform: scale(1.25) rotate(6deg); } }
@keyframes bump2 { 40% { transform: scale(1.35); } }
.points.is-bump { animation: bump2 .45s var(--ease-spring); }

.lifelines { display: flex; justify-content: center; gap: 12px; margin-top: 18px; }
.lifeline { gap: 6px; }
.lifeline.is-used { filter: grayscale(1); opacity: .5; pointer-events: none; text-decoration: line-through; }

.banner {
  position: absolute; left: 50%; top: 44%; z-index: 20;
  padding: 10px 20px;
  border: var(--line); border-radius: 18px;
  background: var(--yellow);
  font: 700 26px var(--f-display);
  white-space: nowrap;
  box-shadow: var(--sh);
  pointer-events: none;
  animation: bannerIn 1.3s var(--ease-out) forwards;
}
.banner--fire { background: linear-gradient(180deg, #ffb347, #ff6a3d); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.banner--time { background: var(--red); color: #fff; }
.banner--cool { background: var(--sky); }
@keyframes bannerIn {
  0% { transform: translate(-50%, -50%) scale(.3) rotate(-10deg); opacity: 0; }
  18% { transform: translate(-50%, -50%) scale(1.12) rotate(3deg); opacity: 1; }
  30% { transform: translate(-50%, -50%) scale(1) rotate(-2deg); }
  80% { transform: translate(-50%, -50%) scale(1) rotate(-2deg); opacity: 1; }
  100% { transform: translate(-50%, -90%) scale(.9) rotate(-2deg); opacity: 0; }
}

.pop-text {
  position: fixed; z-index: 90;
  font: 700 28px var(--f-display);
  color: var(--white);
  -webkit-text-stroke: 1.5px var(--ink);
  text-shadow: 0 3px 0 var(--ink);
  pointer-events: none;
  animation: floatUp 1.1s var(--ease-out) forwards;
}
@keyframes floatUp {
  0% { transform: translate(-50%, 0) scale(.5); opacity: 0; }
  20% { transform: translate(-50%, -16px) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -80px) scale(1); opacity: 0; }
}

/* countdown overlay */
.countdown { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; background: rgba(36, 23, 63, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fadeIn .25s; }
.countdown b {
  font: 700 150px/1 var(--f-display);
  color: var(--yellow);
  -webkit-text-stroke: 4px var(--ink);
  text-shadow: 0 10px 0 var(--ink);
  animation: countPop .8s var(--ease-out) both;
}
.countdown b.is-go { color: var(--mint); font-size: 120px; }
@keyframes countPop {
  0% { transform: scale(2.4); opacity: 0; }
  30% { transform: scale(.9); opacity: 1; }
  45% { transform: scale(1.05); }
  80% { transform: scale(1); opacity: 1; }
  100% { transform: scale(.6); opacity: 0; }
}

/* ------------------------------------------------------------------ boards */

.board { display: flex; flex-direction: column; gap: 10px; }
.brow {
  display: grid; grid-template-columns: 34px 48px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--white);
  border: var(--line); border-radius: 18px;
  box-shadow: var(--sh-sm);
  color: var(--ink); text-decoration: none;
  transition: transform .15s var(--ease-out), box-shadow .15s;
}
a.brow:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.brow.is-you { background: #fff3c2; }
.brow.is-new { animation: rowNew 1.8s var(--ease-out); }
.brow.is-leaving { animation: rowOut .45s var(--ease-in) forwards; }
.brow .rank { font: 700 20px var(--f-display); text-align: center; }
.brow .rank .emo { font-size: 24px; }
.brow .who { min-width: 0; }
.brow .name { font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brow .sub { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 2px; font-size: 12px; color: var(--ink-2); }
.brow .score { font: 700 22px var(--f-display); text-align: right; white-space: nowrap; }
.brow .score small { font-size: 14px; color: var(--ink-2); }
.brow .actions { display: flex; gap: 6px; }
.brow-del { width: 38px; height: 38px; border-radius: 12px; font-size: 16px; box-shadow: 0 3px 0 var(--ink); }
.brow.has-actions { grid-template-columns: 34px 48px minmax(0, 1fr) auto auto; }
@keyframes rowNew { 0% { background: var(--yellow); transform: scale(1.04); } 100% { background: var(--white); transform: none; } }
@keyframes rowOut { to { transform: translateX(110%) rotate(6deg); opacity: 0; } }

.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 10px; margin: 6px 0 4px; }
.podium .pd { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.podium .pd .nm { font: 600 15px var(--f-display); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .pd .blk {
  width: 100%;
  display: grid; place-items: center;
  border: var(--line); border-bottom-width: 0;
  border-radius: 16px 16px 0 0;
  font: 700 28px var(--f-display);
  transform-origin: bottom;
  animation: rise .9s var(--ease-spring) both;
}
.podium .pd:nth-child(1) .blk { height: 92px; background: linear-gradient(#e7ecf5, #c3cbdb); animation-delay: .25s; }
.podium .pd:nth-child(2) .blk { height: 124px; background: linear-gradient(#ffe680, #ffc21a); animation-delay: .05s; }
.podium .pd:nth-child(3) .blk { height: 70px; background: linear-gradient(#ffc9a3, #f09a62); animation-delay: .4s; }
.podium .pd .av-ring { animation: popIn .6s var(--ease-spring) both; }
.podium .pd:nth-child(2) .av-ring { width: 76px; height: 76px; animation-delay: .5s; }
.podium .pd:nth-child(1) .av-ring { width: 60px; height: 60px; animation-delay: .65s; }
.podium .pd:nth-child(3) .av-ring { width: 60px; height: 60px; animation-delay: .8s; }
.podium-floor { height: 10px; border: var(--line); border-radius: 0 0 10px 10px; background: var(--ink); margin-bottom: 14px; }
@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat {
  padding: 10px 4px;
  text-align: center;
  background: var(--white);
  border: var(--line); border-radius: 16px;
  box-shadow: var(--sh-sm);
}
.stat b { display: block; font: 700 24px var(--f-display); }
.stat span { font-size: 11px; color: var(--ink-2); letter-spacing: .03em; text-transform: uppercase; }

.empty { text-align: center; padding: 22px 10px; }
.empty .emo { font-size: 56px; display: inline-block; animation: floaty 3s ease-in-out infinite; }
.empty h3 { margin-top: 10px; font-size: 22px; }
.empty p { color: var(--ink-2); margin-top: 6px; }

.live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(255, 61, 87, .6); animation: live 1.4s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 9px rgba(255, 61, 87, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 61, 87, 0); } }

/* answers review */
.review { display: flex; flex-direction: column; gap: 12px; }
.rv { padding: 14px; background: var(--white); border: var(--line); border-radius: 18px; box-shadow: var(--sh-sm); }
.rv-q { display: flex; gap: 10px; align-items: flex-start; font: 600 17px/1.25 var(--f-display); }
.rv-q .n { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--ink); font-size: 14px; }
.rv.is-right .rv-q .n { background: var(--mint); }
.rv.is-wrong .rv-q .n { background: var(--red); color: #fff; }
.rv-a { display: grid; gap: 6px; margin-top: 10px; }
.rv-a div { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 12px; border: 2px solid rgba(36, 23, 63, .15); font-size: 15px; }
.rv-a div .emo { font-size: 20px; }
.rv-a .is-ans { background: #d6f9ec; border-color: var(--mint-d); }
.rv-a .is-bad { background: #ffe0e4; border-color: var(--red); }
.rv-a .tag { margin-left: auto; font: 700 11px var(--f-display); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }

/* ------------------------------------------------------------------ share */

.link-box {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 16px;
  background: var(--white);
  border: var(--line); border-radius: 18px;
  box-shadow: var(--sh-sm);
}
.link-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 16px var(--f-body); }
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.share-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 2px 8px;
  border: 0; background: none;
  font: 600 13px var(--f-display);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.share-btn i {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border: var(--line); border-radius: 18px;
  background: var(--c, var(--white));
  box-shadow: var(--sh-sm);
  font: 26px var(--f-emoji);
  font-style: normal;
  transition: transform .2s var(--ease-spring), box-shadow .15s;
}
.share-btn:hover i { transform: translateY(-3px) rotate(-6deg); box-shadow: 0 7px 0 var(--ink); }
.share-btn:active i { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }

.hero-rays { position: relative; display: grid; place-items: center; height: 190px; }
.hero-rays::before {
  content: ""; position: absolute; width: 330px; height: 330px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .75) 0 10deg, rgba(255, 255, 255, 0) 10deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 25%, transparent 68%);
  mask: radial-gradient(circle, #000 25%, transparent 68%);
  animation: spin 18s linear infinite;
}
.hero-rays .av-ring { position: relative; width: 140px; height: 140px; animation: popIn .7s var(--ease-spring) both, floaty 3.5s 1s ease-in-out infinite; }

.qr-box { display: grid; place-items: center; padding: 12px; background: var(--white); border: var(--line); border-radius: 18px; }
.qr-box img, .qr-box canvas, .qr-box svg { width: 220px; height: 220px; image-rendering: pixelated; }

/* ------------------------------------------------------------------ home */

.hero { display: grid; gap: 24px; align-items: center; padding: 8px 0 18px; }
.hero h1 { font-size: clamp(38px, 10vw, 66px); line-height: 1.02; }
.hero h1 .b { color: var(--red); }
.hero h1 .p { color: var(--pink); }
.hero .lead { font-size: clamp(17px, 4.4vw, 20px); color: var(--ink-2); margin-top: 14px; max-width: 34ch; }
.hero-cta { display: grid; gap: 12px; margin-top: 22px; max-width: 420px; }
.hero-art { position: relative; height: 380px; max-width: 420px; width: 100%; margin: 0 auto; }
@media (min-width: 880px) {
  .hero { grid-template-columns: 1.05fr .95fr; padding-top: 30px; }
  .hero-art { height: 460px; }
}

.ticker { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; }
.ticker .pill b { color: var(--pink-d); }

.section { margin-top: 44px; }
.section-head { text-align: center; margin-bottom: 20px; }
.section-head h2 { font-size: clamp(28px, 7vw, 40px); }
.section-head p { color: var(--ink-2); margin-top: 8px; }
.steps { display: grid; gap: 16px; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { text-align: center; padding-top: 30px; }
.step .num {
  position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  border: var(--line); background: var(--yellow);
  font: 700 20px var(--f-display);
  box-shadow: 0 3px 0 var(--ink);
}
.step .emo { font-size: 52px; display: inline-block; margin: 4px 0 10px; }
.step:hover .emo { animation: wiggle .6s ease-in-out; }
.step h3 { font-size: 22px; }
.step p { color: var(--ink-2); margin-top: 6px; }

.features { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .features { grid-template-columns: repeat(4, 1fr); } }
.feature { padding: 16px 12px; text-align: center; }
.feature .emo { font-size: 36px; display: inline-block; }
.feature h4 { font-size: 17px; margin-top: 8px; }
.feature p { font-size: 13px; color: var(--ink-2); margin-top: 4px; }

.verdict-strip { display: flex; gap: 10px; overflow-x: auto; padding: 6px 2px 14px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.verdict-strip::-webkit-scrollbar { display: none; }
.vcard {
  flex: 0 0 150px; scroll-snap-align: center;
  padding: 14px 10px; text-align: center;
  border: var(--line); border-radius: 18px; box-shadow: var(--sh-sm);
}
.vcard .emo { font-size: 34px; }
.vcard b { display: block; font: 700 17px var(--f-display); margin-top: 6px; }
.vcard small { display: block; color: var(--ink-2); font-size: 12px; }
@media (min-width: 760px) { .verdict-strip { justify-content: center; } }

.faq { display: grid; gap: 10px; max-width: 760px; margin: 0 auto; }
.faq details { background: var(--white); border: var(--line); border-radius: 18px; box-shadow: var(--sh-sm); overflow: hidden; }
.faq summary { list-style: none; cursor: pointer; padding: 16px 48px 16px 18px; font: 600 18px var(--f-display); position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font: 700 26px var(--f-display); transition: transform .3s var(--ease-spring); }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 18px 16px; color: var(--ink-2); animation: fadeDown .35s var(--ease-out); }

.my-quiz { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; }
.my-quiz .av-ring { width: 64px; height: 64px; }
.my-quiz h3 { font-size: 20px; }
.my-quiz .btns { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.footer { margin-top: 56px; padding: 22px 0 8px; text-align: center; color: var(--ink-2); font-size: 14px; }
.footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-bottom: 10px; }
.footer a { color: var(--ink); font-family: var(--f-display); font-weight: 600; text-decoration: none; }
.footer a:hover { color: var(--pink-d); }

/* phone illustration (home + invite) */
.phone {
  position: absolute;
  width: 196px; height: 360px;
  background: var(--ink);
  border-radius: 38px;
  padding: 10px;
  box-shadow: 0 10px 0 rgba(36, 23, 63, .25);
}
.phone-screen {
  position: relative; height: 100%;
  border-radius: 30px;
  background: linear-gradient(180deg, #fff 0%, #ffeef6 100%);
  overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
  padding: 34px 12px 14px;
}
.phone-screen::before { content: ""; position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 64px; height: 16px; border-radius: 10px; background: var(--ink); }
.phone-screen .av-ring { width: 78px; height: 78px; }
.phone-name { font: 700 18px var(--f-display); margin-top: 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-sub { font-size: 11px; color: var(--ink-2); }
.phone-btns { display: grid; gap: 8px; width: 100%; margin-top: auto; }
.pbtn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 6px;
  border: 2.5px solid var(--ink); border-radius: 14px;
  font: 700 15px var(--f-display);
  box-shadow: 0 3px 0 var(--ink);
  transition: transform .12s, box-shadow .12s, background .3s;
}
.pbtn--block { background: var(--red); color: #fff; }
.pbtn--keep { background: var(--white); }
.pbtn.is-press { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.pbtn--keep.is-press { background: var(--pink); color: #fff; }
.finger {
  position: absolute; z-index: 5;
  font: 52px var(--f-emoji);
  filter: drop-shadow(0 4px 0 rgba(36, 23, 63, .3));
  transition: transform .5s var(--ease-out), left .6s var(--ease-out), top .6s var(--ease-out);
  pointer-events: none;
}

.art-phone { left: 50%; top: 20px; transform: translateX(-50%) rotate(6deg); animation: phoneFloat 5s ease-in-out infinite; }
.art-av { position: absolute; }
.art-av .av-ring { width: 100px; height: 100px; }
.art-av--a { left: 0; top: 56px; animation: floaty 4s ease-in-out infinite; }
.art-av--b { right: 0; top: 196px; animation: floaty 4.6s .6s ease-in-out infinite; }
.art-bubble {
  position: absolute; z-index: 3;
  padding: 8px 14px;
  background: var(--white);
  border: var(--line); border-radius: 18px;
  font: 700 min(16px, 4.2vw) var(--f-display);
  box-shadow: var(--sh-sm);
  width: max-content; max-width: 78%; text-wrap: balance;
}
.art-bubble--a { left: 2%; top: 4px; animation: bubbleBob 3.4s ease-in-out infinite; }
.art-bubble--b { right: 0; top: 150px; animation: bubbleBob 3.8s .4s ease-in-out infinite; }
.art-stamp {
  position: absolute; z-index: 6; left: 50%; top: 160px;
  padding: 4px 14px;
  border: 5px solid currentColor; border-radius: 12px;
  background: rgba(255, 255, 255, .92);
  font: 700 clamp(20px, 7vw, 34px)/1.05 var(--f-display); letter-spacing: .04em;
  width: max-content; max-width: 84%; text-align: center; text-wrap: balance;
  transform: translate(-50%, -50%) rotate(-14deg);
  opacity: 0;
}
.art-stamp.is-on { animation: stampSlam .5s cubic-bezier(.2, 1.5, .4, 1) forwards; }
.art-stamp.is-off { animation: fadeOut .4s forwards; }
@keyframes phoneFloat { 0%, 100% { transform: translateX(-50%) rotate(6deg) translateY(0); } 50% { transform: translateX(-50%) rotate(3deg) translateY(-12px); } }
@keyframes bubbleBob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-7px) rotate(2deg); } }

/* invite landing */
.invite { text-align: center; }
.invite-scene { position: relative; height: 300px; margin: 0 auto; max-width: 380px; }
/* Centred with margins, not transforms, because the entrance/bob animations own `transform`. */
.invite-scene .think {
  position: absolute; left: 0; right: 0; top: 0;
  width: max-content; max-width: 100%; margin: 0 auto;
  padding: 12px 18px;
  background: var(--white);
  border: var(--line); border-radius: 26px;
  box-shadow: var(--sh-sm);
  font: 700 min(19px, 4.6vw) var(--f-display);
  text-align: center; text-wrap: balance;
  animation: bubbleBob 3.4s ease-in-out infinite;
}
.invite-scene .think::before, .invite-scene .think::after {
  content: ""; position: absolute; border: var(--line); border-radius: 50%; background: var(--white);
}
.invite-scene .think::before { width: 18px; height: 18px; bottom: -24px; left: 46%; }
.invite-scene .think::after { width: 10px; height: 10px; bottom: -40px; left: 52%; }
.invite-scene .av-ring { position: absolute; left: 0; right: 0; top: 106px; width: 160px; height: 160px; margin: 0 auto; animation: popIn .7s var(--ease-spring) both; }
.invite h1 { font-size: clamp(28px, 8vw, 38px); margin-top: 8px; }
.rules { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }

/* ------------------------------------------------------------------ cinematic result */

.cine {
  position: relative;
  height: 430px;
  border: var(--line); border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--sh-lg);
  background: radial-gradient(130% 90% at 50% 100%, #ffcf7a 0%, #ff8fb8 30%, #7a5be0 66%, #2c1d5c 100%);
  transition: height .7s var(--ease-out);
}
.cine.is-final { height: 360px; }
.cine::before {
  content: ""; position: absolute; left: 50%; top: -40px; width: 380px; height: 520px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, .5) 0%, rgba(255, 255, 255, 0) 60%);
  clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%);
  opacity: .7;
  animation: spotlight 4s ease-in-out infinite;
}
@keyframes spotlight { 50% { opacity: .35; transform: translateX(-50%) rotate(4deg); } }
.cine-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 74px; background: linear-gradient(#3b2a7a, #24173f); border-top: var(--line); }
.cine-floor::before { content: ""; position: absolute; inset: 10px 0 auto; height: 2px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .25) 0 18px, transparent 18px 36px); }
.cine-curtain { position: absolute; top: 0; bottom: 0; width: 52%; z-index: 30; background: repeating-linear-gradient(90deg, #d9264f 0 22px, #b3133b 22px 44px); border-bottom: var(--line); transition: transform 1s var(--ease-out); }
.cine-curtain--l { left: 0; border-right: var(--line); }
.cine-curtain--r { right: 0; border-left: var(--line); }
.cine.is-open .cine-curtain--l { transform: translateX(-102%); }
.cine.is-open .cine-curtain--r { transform: translateX(102%); }

.actor { position: absolute; bottom: 44px; width: 116px; z-index: 4; }
.actor--a { left: 6%; transform: translateX(-200%); }
.actor--b { right: 6%; transform: translateX(200%); }
.actor.is-in { transition: transform 1.3s var(--ease-out); transform: none; }
.actor .av-ring { width: 104px; height: 104px; margin: 0 auto; position: relative; z-index: 2; background: var(--white); }
.actor .legs { display: flex; justify-content: center; gap: 16px; margin-top: -6px; }
.actor .legs i { width: 14px; height: 32px; border: var(--line); border-radius: 0 0 10px 10px; background: var(--ink-2); transform-origin: top; }
.actor.is-walking .av-ring { animation: walkBob .32s ease-in-out infinite alternate; }
.actor.is-walking .legs i:nth-child(1) { animation: legSwing .32s ease-in-out infinite alternate; }
.actor.is-walking .legs i:nth-child(2) { animation: legSwing .32s ease-in-out infinite alternate-reverse; }
.actor.is-sad { filter: saturate(.4) brightness(.9); }
.actor.is-sad .av-ring { animation: sadDrop .8s var(--ease-out) forwards; }
.actor.is-happy .av-ring { animation: jump .55s var(--ease-out) infinite alternate; }
@keyframes walkBob { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(-8px) rotate(4deg); } }
@keyframes legSwing { from { transform: rotate(-22deg); } to { transform: rotate(22deg); } }
@keyframes sadDrop { to { transform: translateY(10px) rotate(-8deg) scale(.95); } }
@keyframes jump { from { transform: translateY(0); } to { transform: translateY(-22px) rotate(4deg); } }

.cine-bubble {
  position: absolute; z-index: 8;
  max-width: 62%;
  padding: 10px 14px;
  background: var(--white);
  border: var(--line); border-radius: 18px;
  box-shadow: var(--sh-sm);
  font: 600 16px/1.25 var(--f-display);
  transform-origin: bottom left;
  animation: bubbleIn .4s var(--ease-spring) both;
}
.cine-bubble::after { content: ""; position: absolute; bottom: -12px; left: 22px; width: 18px; height: 18px; background: var(--white); border-right: var(--line); border-bottom: var(--line); transform: rotate(45deg) skew(10deg, 10deg); }
.cine-bubble--a { left: 6%; bottom: 196px; }
.cine-bubble--b { right: 6%; bottom: 196px; transform-origin: bottom right; }
.cine-bubble--b::after { left: auto; right: 22px; }
.cine-bubble.is-out { animation: bubbleOut .25s var(--ease-in) forwards; }
.cine-bubble .typing { display: inline-flex; gap: 4px; }
.cine-bubble .typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-2); animation: dot 1s ease-in-out infinite; }
.cine-bubble .typing i:nth-child(2) { animation-delay: .15s; }
.cine-bubble .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bubbleIn { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes bubbleOut { to { transform: scale(.4); opacity: 0; } }

.cine-score {
  position: absolute; z-index: 9; top: 16px; left: 50%;
  transform: translate(-50%, -140%);
  padding: 6px 18px;
  background: var(--white);
  border: var(--line); border-radius: 18px;
  box-shadow: var(--sh-sm);
  font: 700 36px/1 var(--f-display);
  white-space: nowrap;
  transition: transform .6s var(--ease-spring);
}
.cine-score small { font-size: 20px; color: var(--ink-2); }
.cine-score.is-in { transform: translate(-50%, 0); }
.cine-score.is-tick b { display: inline-block; animation: tick .18s var(--ease-out); }
@keyframes tick { 50% { transform: scale(1.35); color: var(--pink); } }

.cine .phone { left: 50%; bottom: -380px; width: 150px; height: 230px; padding: 7px; border-radius: 28px; z-index: 10; transform: translateX(-50%); transition: bottom .7s var(--ease-spring); }
.cine .phone.is-up { bottom: 36px; }
.cine .phone-screen { padding: 26px 9px 10px; border-radius: 22px; }
.cine .phone-screen::before { width: 44px; height: 11px; top: 7px; }
.cine .phone-screen .av-ring { width: 56px; height: 56px; }
.cine .phone-name { font-size: 15px; margin-top: 5px; }
.cine .pbtn { padding: 7px 4px; font-size: 13px; border-radius: 11px; }
.cine .finger { z-index: 12; font-size: 40px; left: 60%; top: 260px; opacity: 0; transition: left .55s var(--ease-out), top .55s var(--ease-out), opacity .3s, transform .15s; }
.cine .finger.is-in { opacity: 1; }
.cine .finger.is-press { transform: scale(.82) translateY(4px); }
.cine.is-final .phone.is-up { bottom: -380px; }

.stamp {
  position: absolute; z-index: 20; left: 50%; top: 46%;
  padding: 6px 18px;
  border: 6px solid currentColor; border-radius: 16px;
  background: rgba(255, 255, 255, .94);
  font: 700 clamp(28px, 8.4vw, 46px)/1 var(--f-display);
  letter-spacing: .04em;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-12deg) scale(3);
  pointer-events: none;
}
.stamp.is-on { animation: stampSlam .5s cubic-bezier(.2, 1.4, .4, 1) forwards; }
/* After the show, the stamp settles higher and smaller so both faces stay visible. */
.cine.is-final .stamp.is-on { animation: stampSlam .5s cubic-bezier(.2, 1.4, .4, 1) forwards, stampSettle .7s .6s var(--ease-out) forwards; }
@keyframes stampSettle {
  from { opacity: 1; top: 46%; transform: translate(-50%, -50%) rotate(-12deg) scale(1); }
  to { opacity: 1; top: 36%; transform: translate(-50%, -50%) rotate(-8deg) scale(.74); }
}
.stamp small { display: block; font-size: 15px; letter-spacing: 0; margin-top: 4px; text-align: center; }
@keyframes stampSlam {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-12deg) scale(3); }
  60% { opacity: 1; transform: translate(-50%, -50%) rotate(-12deg) scale(.9); }
  100% { opacity: 1; transform: translate(-50%, -50%) rotate(-12deg) scale(1); }
}
.cine[data-tier="blocked"].is-decided::after { content: ""; position: absolute; inset: 0; z-index: 15; box-shadow: inset 0 0 120px 30px rgba(255, 30, 60, .55); animation: fadeIn .4s; pointer-events: none; }
.cine[data-tier="bestie"].is-decided::after, .cine[data-tier="trusted"].is-decided::after { content: ""; position: absolute; inset: 0; z-index: 15; box-shadow: inset 0 0 120px 30px rgba(255, 215, 80, .55); animation: fadeIn .4s; pointer-events: none; }
.cine-skip { position: absolute; z-index: 40; top: 12px; right: 12px; min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 12px; box-shadow: 0 3px 0 var(--ink); }
.cine.is-final .cine-skip { display: none; }
.crack { position: absolute; inset: 0; z-index: 11; pointer-events: none; opacity: 0; }
.crack.is-on { opacity: 1; animation: fadeIn .15s; }

/* result body */
.result-body { opacity: 0; transform: translateY(30px); pointer-events: none; transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
.result-body.is-shown { opacity: 1; transform: none; pointer-events: auto; }
.verdict-head { text-align: center; }
.verdict-head .vt { font-size: clamp(30px, 8vw, 40px); }
.verdict-head .vl { margin-top: 6px; color: var(--ink-2); font-size: 17px; }
.score-ring { position: relative; width: 150px; height: 150px; margin: 0 auto 6px; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring .sr-bg { fill: var(--white); stroke: var(--ink); stroke-width: 3; }
.score-ring .sr-track { fill: none; stroke: #efe8ff; stroke-width: 12; }
.score-ring .sr-arc { fill: none; stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset 1.4s var(--ease-out); }
.score-ring .sr-num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.score-ring .sr-num b { font: 700 40px/1 var(--f-display); }
.score-ring .sr-num span { font-size: 13px; color: var(--ink-2); }
.result-chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.badge {
  width: 92px;
  padding: 10px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--white);
  border: var(--line); border-radius: 18px;
  box-shadow: var(--sh-sm);
  text-align: center;
  animation: popIn .55s var(--ease-spring) both;
  animation-delay: calc(var(--i, 0) * 140ms + 200ms);
}
.badge .emo { font-size: 32px; animation: wiggle 2.6s ease-in-out infinite; animation-delay: calc(var(--i, 0) * 300ms); }
.badge b { font: 600 13px/1.1 var(--f-display); }
.badge small { font-size: 10px; color: var(--ink-2); line-height: 1.2; }

/* ------------------------------------------------------------------ ads */

.ad { margin: 26px auto; text-align: center; width: 100%; }
.ad-label { display: block; margin-bottom: 6px; font: 800 10px var(--f-body); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); opacity: .75; }
.ad-box { margin: 0 auto; overflow: hidden; }
.ad--small .ad-box { width: 100%; max-width: 320px; height: 100px; }
.ad--small:has(ins.adsbygoogle) .ad-box { height: auto; min-height: 100px; overflow: visible; }
.ad--big .ad-box { width: 100%; max-width: 336px; min-height: 280px; }
.privacy-banner { position: fixed; bottom: 12px; inset-inline: 12px; z-index: 1000; max-width: 520px; margin: 0 auto; padding: 16px; background: #fff; color: #24173f; border: 2px solid #24173f; border-radius: 18px; box-shadow: 0 4px 18px #24173f33; font: 600 14px/1.5 system-ui, sans-serif; }
.privacy-banner p { margin: 0 0 8px; }
.privacy-banner .row-c { margin-top: 12px; flex-wrap: wrap; }
.ad-demo {
  display: grid; place-items: center; gap: 2px;
  border: 2px dashed rgba(36, 23, 63, .3); border-radius: 14px;
  background: rgba(255, 255, 255, .55);
  color: var(--ink-2);
  font: 700 13px var(--f-body);
}
.ad-demo b { font: 700 16px var(--f-display); color: var(--ink); }
.ad--top { margin-top: 4px; margin-bottom: 18px; }
body[data-bg="stage"] .ad-label { color: #d8ccff; }

/* ------------------------------------------------------------------ toasts & modal */

#toasts { position: fixed; z-index: 160; top: calc(var(--topbar-h) + 6px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  background: var(--ink); color: #fff;
  border: 3px solid var(--ink); border-radius: 16px;
  box-shadow: 0 5px 0 rgba(36, 23, 63, .35);
  font: 600 16px var(--f-display);
  animation: toastIn .45s var(--ease-spring) both;
  pointer-events: auto;
}
.toast .emo { font-size: 20px; }
.toast--ok { background: var(--mint); color: var(--ink); }
.toast--err { background: var(--red); }
.toast.is-out { animation: toastOut .3s var(--ease-in) forwards; }
@keyframes toastIn { from { transform: translateY(-30px) scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(-20px) scale(.9); opacity: 0; } }

.modal { position: fixed; inset: 0; z-index: 140; display: grid; place-items: center; padding: 16px; }
.modal-scrim { position: absolute; inset: 0; background: rgba(36, 23, 63, .5); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); animation: fadeIn .25s; }
.modal-card {
  position: relative;
  width: min(100%, 440px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 24px 20px 20px;
  background: var(--paper);
  border: var(--line); border-radius: 26px;
  box-shadow: var(--sh-lg);
  animation: modalIn .45s var(--ease-spring) both;
}
.modal-card h2 { font-size: 26px; text-align: center; padding-inline: 40px; text-wrap: balance; }
.modal-card .modal-body { margin-top: 12px; }
.modal-card .modal-actions { display: grid; gap: 10px; margin-top: 18px; }
.modal-close { position: absolute; top: 10px; inset-inline-end: 10px; width: 38px; height: 38px; border-radius: 12px; font-size: 16px; }
.modal.is-out .modal-scrim { animation: fadeOut .25s forwards; }
.modal.is-out .modal-card { animation: modalOut .25s var(--ease-in) forwards; }
@keyframes modalIn { from { transform: translateY(40px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes modalOut { to { transform: translateY(30px) scale(.94); opacity: 0; } }

/* custom question editor */
.cq-opts { display: grid; gap: 8px; }
.cq-opt { display: grid; grid-template-columns: 52px 1fr 40px; gap: 8px; align-items: center; }
.cq-emoji { width: 52px; height: 52px; border-radius: 14px; font: 26px var(--f-emoji); padding: 0; }
.cq-opt .input { padding: 12px 14px; font-size: 16px; }
.cq-del { width: 40px; height: 40px; border-radius: 12px; font-size: 14px; }
.emoji-pick { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-top: 8px; padding: 8px; background: var(--white); border: 2px solid var(--ink); border-radius: 14px; animation: fadeDown .25s var(--ease-out); }
.emoji-pick button { border: 0; background: none; font: 24px var(--f-emoji); padding: 4px 0; border-radius: 8px; cursor: pointer; transition: transform .15s var(--ease-spring); }
.emoji-pick button:hover { transform: scale(1.25); background: #ffe6f1; }

/* ------------------------------------------------------------------ prose pages */

.prose { font-weight: 600; }
.prose h2 { font-size: 24px; margin: 26px 0 8px; }
.prose p, .prose li { color: var(--ink-2); margin: 0 0 10px; }
.prose ul { padding-left: 20px; margin: 0 0 10px; }
.prose strong { color: var(--ink); }

/* ------------------------------------------------------------------ fx canvas */

#fx { position: fixed; inset: 0; z-index: 95; width: 100%; height: 100%; pointer-events: none; }

/* ------------------------------------------------------------------ shared keyframes */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes popIn { 0% { transform: scale(0) rotate(-12deg); opacity: 0; } 70% { transform: scale(1.1) rotate(3deg); opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-12deg); } 40% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(4deg); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px) rotate(-2deg); } 40% { transform: translateX(8px) rotate(2deg); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
.is-shaking { animation: screenShake .5s cubic-bezier(.36, .07, .19, .97); }
@keyframes screenShake {
  10%, 90% { transform: translate3d(-2px, 1px, 0); }
  20%, 80% { transform: translate3d(5px, -2px, 0); }
  30%, 50%, 70% { transform: translate3d(-8px, 3px, 0) rotate(-1deg); }
  40%, 60% { transform: translate3d(8px, -3px, 0) rotate(1deg); }
}

.noscript { max-width: 520px; margin: 40px auto; text-align: center; }

@media (max-width: 380px) {
  :root { --gutter: 12px; }
  .brand-word { font-size: 16px; }
  .brand { gap: 6px; }
  .brand img { width: 34px; height: 34px; }
  .topbar-actions { gap: 6px; }
  .icon-btn { width: 42px; height: 42px; }
  .topbar .lang-btn { padding: 0 8px; }
  .opt { min-height: 116px; }
  .opt .emo { font-size: 42px; }
  .share-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .share-btn i { width: 50px; height: 50px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .cloud, .spark { display: none; }
}

/* ==========================================================================
   Phase 2: languages, gender, reveal show, extra motion
   ========================================================================== */

/* Scripts whose Latin-script fallback would mix fonts mid-word (e.g. Vietnamese) use the script font first. */
html.script-first { --f-display: var(--f-script), 'Nunito', system-ui, sans-serif; --f-body: var(--f-script), 'Nunito', system-ui, sans-serif; }
html[dir="rtl"] .field { text-align: right; }
html[dir="rtl"] .field > span { margin: 0 4px 8px 0; }
html[dir="rtl"] .input-count { right: auto; left: 14px; }
html[dir="rtl"] .opt-badge { right: auto; left: -10px; }

/* language button + picker */
.lang-btn { width: auto; padding: 0 10px; gap: 4px; display: inline-flex; align-items: center; font: 700 14px var(--f-display); }
.lang-btn .emo { font-size: 18px; }
.kicker--lang { cursor: pointer; background: var(--white); text-transform: none; letter-spacing: 0; transition: transform .2s var(--ease-spring); }
.kicker--lang:hover { transform: translateY(-2px) rotate(-2deg); }
.hero-chips { gap: 8px; margin-bottom: 10px; }
.hero-chips .kicker { margin-bottom: 0; }
.modal-card--wide { width: min(100%, 560px); }
.lang-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; max-height: 60vh; overflow-y: auto; padding: 4px 4px 8px; }
@media (min-width: 520px) { .lang-grid { grid-template-columns: repeat(3, 1fr); } }
.lang-opt {
  position: relative; display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center;
  padding: 10px 12px; text-align: start;
  border: var(--line); border-radius: 16px; background: var(--white); box-shadow: var(--sh-sm);
  cursor: pointer;
  animation: popIn .45s var(--ease-spring) both; animation-delay: calc(var(--i) * 22ms);
  transition: transform .15s var(--ease-out), box-shadow .15s, background .25s;
}
.lang-opt .emo { grid-row: 1 / span 2; font-size: 24px; }
.lang-opt b { font: 700 15px/1.12 var(--f-display); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lang-opt small { font-size: 11px; color: var(--ink-2); }
.lang-opt:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.lang-opt.is-on { background: var(--yellow); }
.lang-opt.is-on::after { content: "✓"; position: absolute; top: -9px; right: -7px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--ink); background: var(--mint); font: 700 13px var(--f-display); animation: popIn .35s var(--ease-spring); }
.lang-opt.is-picking { animation: langPick .5s var(--ease-spring); }
@keyframes langPick { 50% { transform: scale(1.08) rotate(-2deg); } }

.drawer-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; background: none; border-radius: 14px; color: var(--ink); font: 600 18px var(--f-display); cursor: pointer; text-align: start; opacity: 0; transform: translateX(24px); transition: background .2s, opacity .4s var(--ease-out) .3s, transform .4s var(--ease-out) .3s; }
.drawer.is-open .drawer-link { opacity: 1; transform: none; }
.drawer-link:hover { background: #ffe6f1; }
.drawer-link span { font-family: var(--f-emoji); font-size: 20px; width: 28px; text-align: center; }
.drawer-panel a i, .drawer-link i { font-style: normal; }
.chip.is-on { background: var(--yellow); }

/* gender cards */
.gpick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gcard {
  --c1: #9fdcff; --c2: #5cb6ff;
  position: relative; isolation: isolate;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 8px 12px;
  border: var(--line); border-radius: 22px;
  background: linear-gradient(160deg, var(--c1), var(--c2));
  box-shadow: var(--sh);
  cursor: pointer;
  transition: transform .3s var(--ease-spring), box-shadow .2s, filter .35s, opacity .35s;
}
.gcard--f { --c1: #ffc1dd; --c2: #ff7ab6; }
.gcard b { font: 700 19px var(--f-display); color: var(--ink); }
.gcard-art { width: 86px; height: 86px; border-radius: 50%; border: var(--line); overflow: hidden; background: var(--white); box-shadow: 0 3px 0 var(--ink); }
.gcard-sym { position: absolute; top: 8px; left: 12px; font: 700 26px/1 var(--f-display); color: rgba(255, 255, 255, .9); text-shadow: 0 2px 0 rgba(36, 23, 63, .35); }
.gcard-check { position: absolute; top: -12px; right: -10px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: var(--line); background: var(--mint); font: 700 18px var(--f-display); box-shadow: 0 3px 0 var(--ink); transform: scale(0); transition: transform .35s var(--ease-spring); }
.gcard-glow { position: absolute; inset: -8px; z-index: -1; border-radius: 28px; opacity: 0; background: radial-gradient(circle, rgba(255, 255, 255, .9), transparent 70%); transition: opacity .3s; }
.gcard:hover { transform: translateY(-3px) rotate(-1deg); }
.gcard:hover .gcard-art { animation: wiggle .6s ease-in-out; }
.gcard.is-on { transform: scale(1.04); box-shadow: 0 8px 0 var(--ink), 0 0 0 5px rgba(255, 255, 255, .8); }
.gcard.is-on .gcard-check { transform: scale(1); }
.gcard.is-on .gcard-glow { opacity: 1; animation: glowPulse 1.6s ease-in-out infinite; }
.gcard.is-off { transform: scale(.95); filter: saturate(.35); opacity: .75; }
@keyframes glowPulse { 50% { transform: scale(1.06); opacity: .5; } }
.gtint { transition: background .6s ease; }
.gtint-m { background: linear-gradient(180deg, #eef8ff, var(--paper) 45%); }
.gtint-f { background: linear-gradient(180deg, #fff0f7, var(--paper) 45%); }

/* avatars blink */
.av-eyes { transform-box: fill-box; transform-origin: center; animation: blink 5s infinite; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 95.5% { transform: scaleY(.08); } }

/* headline shimmer */
.shimmer {
  background: linear-gradient(100deg, var(--pink) 0%, var(--pink) 35%, #ffb3d6 50%, var(--pink) 65%, var(--pink) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 3.2s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 120% 0; } 60%, 100% { background-position: -30% 0; } }

/* scroll reveal: hidden until the observer animates it in */
.pre-reveal { opacity: 0; }

/* words of a question entering one by one */
.qtext .w { display: inline-block; }

/* tilt */
[data-tilt] { transition: transform .25s var(--ease-out); transform-style: preserve-3d; }
[data-tilt].is-tilting { transition: transform .08s linear; }

/* phase wipe */
.wipe {
  position: fixed; inset: 0; z-index: 145;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #ff6fae 0%, #8f6bff 100%);
  clip-path: circle(0 at 50% 50%);
  pointer-events: all;
}
.wipe-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; color: #fff; text-align: center; padding: 20px; animation: fadeIn .3s .25s both; }
.wipe-emo { font-size: 74px; animation: wipeBob .9s ease-in-out infinite alternate; }
.wipe-label { font: 700 26px var(--f-display); text-shadow: 0 3px 0 rgba(36, 23, 63, .35); }
@keyframes wipeBob { from { transform: translateY(0) rotate(-6deg) scale(1); } to { transform: translateY(-12px) rotate(6deg) scale(1.08); } }

/* screen-edge flashes */
.edge-flash { position: fixed; inset: 0; z-index: 94; pointer-events: none; animation: edgeFlash .75s ease-out forwards; }
.edge-flash--good { box-shadow: inset 0 0 90px 24px rgba(37, 217, 163, .75); }
.edge-flash--bad { box-shadow: inset 0 0 90px 24px rgba(255, 61, 87, .75); }
.edge-flash--warn { box-shadow: inset 0 0 70px 14px rgba(255, 61, 87, .55); animation-duration: .5s; }
.edge-flash--cool { box-shadow: inset 0 0 90px 24px rgba(92, 200, 255, .8); }
@keyframes edgeFlash { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }

/* countdown ring */
.countdown-ring { position: absolute; width: 230px; height: 230px; border-radius: 50%; border: 10px solid var(--yellow); box-shadow: 0 0 0 6px var(--ink), inset 0 0 0 6px var(--ink); animation: ringPulse .72s var(--ease-out) both; }
@keyframes ringPulse { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }

/* stats + verdict tags */
.stat--real b { color: var(--mint-d); }
.stat--fake b { color: var(--red-d); }
.vcard { position: relative; animation: floaty 4s ease-in-out infinite; animation-delay: calc(var(--i) * -.6s); }
.vcard-tag { display: inline-block; margin-bottom: 6px; padding: 2px 8px; border: 2px solid var(--ink); border-radius: 99px; font: 700 10px var(--f-display); letter-spacing: .06em; }
.vcard-tag.is-real, .rf-tag.is-real { background: #c9f7e6; }
.vcard-tag.is-fake, .rf-tag.is-fake { background: #ffd1d8; }
.rf-tag { display: inline-block; margin-top: 6px; padding: 4px 12px; border: 2px solid var(--ink); border-radius: 99px; font: 700 14px var(--f-display); }

/* ------------------------------------------------------------------ results hero */
.rf-hero {
  position: relative; overflow: hidden; isolation: isolate;
  text-align: center;
  padding: 24px 16px 20px;
  border: var(--line); border-radius: 28px;
  box-shadow: var(--sh-lg);
  color: #fff;
}
.rf-hero.is-real { background: radial-gradient(120% 100% at 50% 0%, #4ff0b8 0%, #10a97b 55%, #0b7a59 100%); }
.rf-hero.is-fake { background: radial-gradient(120% 100% at 50% 0%, #ff7385 0%, #d81f3d 55%, #8f0f25 100%); }
.rf-rays { position: absolute; inset: -60%; z-index: -1; background: repeating-conic-gradient(rgba(255, 255, 255, .14) 0 10deg, transparent 10deg 20deg); animation: spin 22s linear infinite; }
.is-fake .rf-rays { background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .08) 0 2px, transparent 2px 6px); animation: scan 3s linear infinite; inset: 0; }
@keyframes scan { to { background-position: 0 60px; } }
.rf-link { font-size: 34px; animation: heartbeat .9s ease-in-out infinite; }
.rf-badge {
  display: inline-block; margin-top: 14px;
  padding: 10px 20px;
  border: var(--line); border-radius: 18px;
  background: var(--white); color: var(--ink);
  box-shadow: var(--sh-sm);
  font: 700 clamp(24px, 7vw, 34px)/1.05 var(--f-display);
  letter-spacing: .02em;
}
.rf-sub { margin-top: 10px; font: 600 17px var(--f-display); text-shadow: 0 2px 0 rgba(36, 23, 63, .3); }

/* glitch text for FAKE */
.glitch { position: relative; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; inset: 0; padding: inherit; border-radius: inherit; pointer-events: none; }
.glitch::before { color: #00e5ff; clip-path: inset(0 0 58% 0); animation: glitchA 1.6s steps(1) infinite; mix-blend-mode: multiply; }
.glitch::after { color: #ff2bd6; clip-path: inset(58% 0 0 0); animation: glitchB 1.9s steps(1) infinite; mix-blend-mode: multiply; }
@keyframes glitchA { 0%, 86%, 100% { transform: none; opacity: 0; } 88% { transform: translate(-4px, -1px); opacity: .9; } 92% { transform: translate(3px, 1px); opacity: .9; } }
@keyframes glitchB { 0%, 80%, 100% { transform: none; opacity: 0; } 82% { transform: translate(4px, 1px); opacity: .9; } 86% { transform: translate(-3px, 0); opacity: .9; } }

/* The reveal show (full-screen film after each game) lives in scene.css. */
/* Landing and discovery refresh: motion stays out of the game screens. */
[data-view="home"] .hero{padding:32px 0 24px;gap:32px}
[data-view="home"] .hero h1{font-size:clamp(44px,7.3vw,82px);letter-spacing:-.035em;text-wrap:balance;max-width:12ch}
[data-view="home"] .hero .lead{font-size:18px;max-width:30ch;text-wrap:balance}
[data-view="home"] .hero-cta{gap:10px;margin-top:26px}
[data-view="home"] .hero-cta .btn--ghost{border-color:transparent;box-shadow:none;background:transparent;font-size:15px}
[data-view="home"] .hero-art{isolation:isolate}
[data-view="home"] .hero-art::before{content:"";position:absolute;inset:12% 0 4%;z-index:-2;border-radius:50%;background:radial-gradient(ellipse,#fff9 0%,#ffe2f5aa 40%,#d9ccff44 65%,transparent 72%);filter:blur(12px);animation:landingAura 8s ease-in-out infinite alternate}
.art-orbit{position:absolute;inset:10% 4%;border:1px solid #fff9;border-radius:50%;z-index:-1;transform:rotate(-25deg)}
.art-orbit--two{inset:18% -1%;transform:rotate(25deg);border-style:dashed;border-color:#8f6bff44}
.art-spark{position:absolute;font-size:40px;color:#6845e0;animation:landingSpark 4s ease-in-out infinite;z-index:2}
.art-spark--one{right:12%;top:5%}.art-spark--two{left:10%;bottom:4%;color:#d9327a;animation-delay:1.5s}
[data-view="home"] .art-phone{box-shadow:0 12px 0 #24173f26,0 28px 55px #6845e033;transition:filter .6s}
[data-view="home"] .hero-art[data-verdict="keep"] .phone-screen{background:linear-gradient(180deg,#fff,#defbf0)}
[data-view="home"] .phone-screen{transition:background .7s}
[data-view="home"] .hero-art[data-verdict="block"] .art-av--b{filter:saturate(.45)}
[data-view="home"] .art-av{transition:filter .7s}
.home-intro{position:relative;text-align:center;padding:38px clamp(20px,5vw,72px);background:linear-gradient(125deg,#ffffffc9,#fff5fbd9);border:1px solid #fff;border-radius:32px;box-shadow:0 20px 60px #6845e012;overflow:hidden}
.home-intro h2{font-size:clamp(28px,5vw,42px);text-wrap:balance}
.home-intro>p{max-width:58ch;margin:14px auto 0;color:var(--ink-2);font-size:18px;line-height:1.7}
.intro-mark{display:block;color:var(--pink-d);font-size:30px;margin-bottom:8px}
.intro-pills{display:flex;justify-content:center;flex-wrap:wrap;gap:10px;margin-top:22px}
.intro-pills span{background:#ffffffb3;border:1px solid #e6d8f0;padding:8px 14px;border-radius:99px;font-size:13px}
[data-view="home"] .section{margin-top:64px}
[data-view="home"] .section-head{margin-bottom:30px}
[data-view="home"] .step,[data-view="home"] .feature{background:#fffc;border-width:2px;box-shadow:0 5px 0 #24173f,0 14px 28px #6845e012;transition:box-shadow .35s,background .35s}
[data-view="home"] .feature{padding:24px 12px;border-radius:24px}
[data-view="home"] .vcard{transition:transform .35s,box-shadow .35s}
[data-view="home"] .faq details{border-width:2px;background:#fffdfd;transition:background .35s,box-shadow .35s}
[data-view="home"] .faq details[open]{background:#fff1f8;box-shadow:0 5px 0 var(--ink),0 15px 30px #ff4f9a15}
:is([data-view="create"],[data-view="find"],[data-view="about"],[data-view="contact"]) .page-head{padding:24px 0 28px}
:is([data-view="find"],[data-view="about"],[data-view="contact"]) .card{box-shadow:0 6px 0 var(--ink),0 22px 45px #6845e018}
@media(hover:hover){[data-view="home"] .vcard:hover{transform:translateY(-8px) rotate(-2deg)}[data-view="home"] .feature:hover,[data-view="home"] .step:hover{background:#fff;box-shadow:0 8px 0 var(--ink),0 24px 40px #6845e024}}
@media(max-width:879px){[data-view="home"] .hero{text-align:center;padding-top:18px;gap:16px}[data-view="home"] .hero h1{margin-inline:auto;max-width:13ch;font-size:clamp(44px,10vw,64px)}[data-view="home"] .hero-chips{justify-content:center!important}[data-view="home"] .hero .lead,[data-view="home"] .hero-cta{margin-inline:auto}[data-view="home"] .hero-art{height:395px}[data-view="home"] .section{margin-top:42px}}
@media(max-width:380px){[data-view="home"] .hero-art{max-width:320px}.art-av .av-ring{width:80px;height:80px}.art-bubble{max-width:72%;font-size:13px}}
[dir="rtl"] .faq summary{padding-inline:18px 48px}[dir="rtl"] .faq summary::after{right:auto;left:18px}
@keyframes landingAura{to{transform:scale(1.12) rotate(8deg);opacity:.65}}
@keyframes landingSpark{50%{transform:translateY(-12px) rotate(20deg) scale(.8);opacity:.55}}
@media(prefers-reduced-motion:reduce){.hero-art *,.hero-art::before{animation:none!important;transition:none!important}.pre-reveal{opacity:1!important}[data-view="home"] .vcard:hover{transform:none}}
@media(prefers-reduced-motion:no-preference){
[data-view="home"] .art-orbit--one{animation:landingOrbit 20s linear infinite}
[data-view="home"] .art-orbit--two{animation:landingOrbit 28s linear reverse infinite}
[data-view="home"] .step .emo{animation:landingIcon 5s ease-in-out infinite}
[data-view="home"] .step:nth-child(2) .emo{animation-delay:1.2s}
[data-view="home"] .step:nth-child(3) .emo{animation-delay:2.4s}
[data-view="home"] .home-intro::before{content:"";position:absolute;inset:-60%;z-index:-1;background:conic-gradient(from 45deg,transparent,#ff4f9a12,transparent,#8f6bff15,transparent);animation:landingOrbit 24s linear infinite}
[data-view="home"] .home-intro{isolation:isolate}
}
@media(hover:hover){[data-view="home"] .feature .emo{transition:transform .4s var(--ease-spring)}[data-view="home"] .feature:hover .emo{transform:translateY(-5px) scale(1.15) rotate(-8deg)}}
@keyframes landingOrbit{to{transform:rotate(335deg)}}
@keyframes landingIcon{0%,75%,100%{transform:translateY(0)}85%{transform:translateY(-7px) rotate(-5deg)}92%{transform:translateY(-3px) rotate(3deg)}}
@media(prefers-reduced-motion:reduce){[data-view="home"] .feature .emo{transition:none}[data-view="home"] .feature:hover .emo{transform:none}}
