@property --accent {
  syntax: "<color>";
  inherits: true;
  initial-value: #2f3d99;
}
@property --orbit { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

:root {
  --magenta: #e21b72;
  --magenta-ink: #c61563;
  --cyan: #12a9e6;
  --cyan-ink: #0b78a6;
  --indigo: #2f3d99;
  --indigo-2: #3a4ab0;
  --yellow: #e8ae1a;
  --yellow-ink: #8a6505;

  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --hover: #f4f6f9;
  --border: #e5e7eb;
  --border-soft: #eef0f3;
  --text: #1f2937;
  --text-soft: #6b7280;
  --text-mute: #9ca3af;
  --disabled: #cfd4e1;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 999px;

  --e1: 0 1px 2px rgba(31, 41, 55, 0.04);
  --e2: 0 2px 6px rgba(31, 41, 55, 0.05), 0 1px 2px rgba(31, 41, 55, 0.03);
  --e3: 0 10px 28px rgba(47, 61, 153, 0.08), 0 2px 6px rgba(31, 41, 55, 0.04);
  --e4: 0 30px 70px rgba(47, 61, 153, 0.12), 0 8px 24px rgba(31, 41, 55, 0.06);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 160ms;
  --t: 240ms;
  --t-slow: 420ms;

  --font-display: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
  --font-body: Inter, system-ui, sans-serif;

  --accent: var(--indigo);
  --accent-ink: var(--indigo);
}

[data-role="student"] { --accent: #b61855; --accent-ink: #b61855; }
[data-role="educator"] { --accent: #e8af1b; --accent-ink: #8a6505; }
[data-role="university"] { --accent: #3792f2; --accent-ink: #1c6ccc; }
[data-role="parent"] { --accent: #17936a; --accent-ink: #0f7553; }
[data-role="lecturer"] { --accent: #12a9e6; --accent-ink: #0e86b8; }
[data-role="other"] { --accent: #2b398f; --accent-ink: #2b398f; }

[data-tone="1"] { --accent: #2b398f; --accent-ink: #2b398f; }
[data-tone="2"] { --accent: #e8af1b; --accent-ink: #8a6505; }
[data-tone="3"] { --accent: #b61855; --accent-ink: #b61855; }
[data-tone="4"] { --accent: #3792f2; --accent-ink: #1c6ccc; }

:root, [data-role], [data-tone] {
  --accent-soft: color-mix(in srgb, var(--accent) 10%, white);
  --accent-wash: color-mix(in srgb, var(--accent) 5%, white);
  --accent-line: color-mix(in srgb, var(--accent) 38%, transparent);
  --accent-glow: color-mix(in srgb, var(--accent) 30%, transparent);
  --accent-ring: color-mix(in srgb, var(--accent) 16%, transparent);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  transition: --accent var(--t-slow) var(--ease);
}
::selection { background: rgba(226, 27, 114, 0.18); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ico { width: 18px; height: 18px; flex: none; display: block; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
h1:focus-visible { outline: none; }

/* ---------- Backdrop ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(60% 70% at 0% 40%, #eb6101 0%, transparent 70%),
    radial-gradient(40% 40% at 25% 0%, #df1145 0%, transparent 70%),
    radial-gradient(50% 50% at 30% 30%, #f8b500 0%, transparent 75%),
    radial-gradient(60% 60% at 100% 100%, #f19aae 0%, transparent 70%),
    #f8f4e6;
}
.wave {
  --soften: 80px;
  /* Overscan by 2x the blur radius so the blurred edges stay off-screen. */
  position: absolute;
  inset: calc(var(--soften) * -2);
  width: calc(100% + var(--soften) * 4);
  height: calc(100% + var(--soften) * 4);
  filter: blur(var(--soften));
  opacity: 0; transition: opacity 1.2s var(--ease);
}
.backdrop.is-wave .wave { opacity: 1; }
.backdrop::after {
  content: ""; position: absolute; inset: 0; opacity: 0.06; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Top bar ---------- */
.topbar {
  height: 56px;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "logo lang";
  align-items: center;
  gap: 16px;
}
.progress { margin-top: 24px; display: flex; justify-content: center; }
.logo-wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--text);
  user-select: none;
}
.logo-wordmark .sep { color: var(--text-mute); margin: 0 5px; font-weight: 500; }
.logo-wordmark .e { color: var(--magenta); }
.logo-wordmark .d { color: var(--cyan); }
.logo-wordmark .u { color: var(--yellow); }

.logo-wordmark { grid-area: logo; justify-self: start; }

/* Progress: dots for every step, a numbered pill only on the active one */
.stepper { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.step {
  display: grid; place-items: center;
  min-width: 22px; height: 30px; padding: 0 3px;
  border: 0; background: transparent;
}
.step:disabled { cursor: default; }
.step-dot {
  width: 8px; height: 8px;
  display: grid; place-items: center;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--indigo) 22%, transparent);
  color: #fff;
  font: 700 13px/1 var(--font-display);
  overflow: hidden;
  transition: width var(--t-slow) var(--ease-pop), height var(--t-slow) var(--ease-pop), background var(--t) var(--ease), transform var(--t) var(--ease-pop), box-shadow var(--t) var(--ease);
}
.step-dot .n { white-space: nowrap; opacity: 0; transform: scale(0.5); transition: opacity var(--t-fast) var(--ease), transform var(--t-slow) var(--ease-pop); }
.step-dot .of { margin-left: 1px; font-size: 11px; font-weight: 600; opacity: 0.65; }
.step.is-done .step-dot { background: var(--indigo); }
.step.is-done:not(:disabled):hover .step-dot { transform: scale(1.6); box-shadow: 0 0 0 4px color-mix(in srgb, var(--indigo) 20%, transparent); }
.step.is-current .step-dot {
  width: 46px; height: 26px;
  background: var(--indigo);
  box-shadow: 0 6px 14px -6px rgba(47, 61, 153, 0.6);
}
.step.is-current .step-dot .n { opacity: 1; transform: none; transition-delay: 120ms; }

.lang { grid-area: lang; position: relative; justify-self: end; }
.flag {
  display: block; flex: none;
  width: 22px; height: 16px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(31, 41, 55, 0.1);
}
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 10px 0 8px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px; font-weight: 500; color: var(--text);
  transition: background var(--t) var(--ease), box-shadow var(--t) var(--ease), transform var(--t-fast) var(--ease);
}
.lang-btn .flag { width: 18px; height: 13px; border-radius: 3px; }
.lang-btn .ico { width: 14px; height: 14px; color: var(--text-soft); }
.lang-btn:hover { background: var(--surface); box-shadow: var(--e2); transform: translateY(-1px); }
.lang-btn .flag { transition: transform var(--t-slow) var(--ease-pop); }
.lang-btn:hover .flag { transform: rotate(-8deg) scale(1.1); }
.lang .chev .ico { width: 14px; height: 14px; transition: transform var(--t) var(--ease); }
.lang.open .chev .ico { transform: rotate(180deg); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20;
  min-width: 240px; padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--e4);
  opacity: 0; transform: translateY(-6px) scale(0.96); transform-origin: top right;
  pointer-events: none;
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.lang.open .lang-menu { opacity: 1; transform: none; pointer-events: auto; }
.lang-menu button {
  width: 100%; display: flex; align-items: center; gap: 12px;
  border: 0; background: transparent; border-radius: var(--radius-sm);
  padding: 9px 10px; font-size: 14px; text-align: left;
  transition: background var(--t-fast) var(--ease);
}
.lang-menu button:hover { background: var(--hover); }
.lang-menu .ico { width: 15px; height: 15px; color: var(--indigo); stroke-width: 2.5; opacity: 0; }
.lang-text { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.lang-text small { font-size: 12px; font-weight: 400; color: var(--text-soft); }
.lang-menu [aria-checked="true"] { font-weight: 600; background: var(--accent-wash); }
.lang-menu [aria-checked="true"] .ico { opacity: 1; }

/* ---------- Shell + card ---------- */
.shell {
  min-height: calc(100vh - 56px);
  padding: 4px 24px 40px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.card {
  width: min(1080px, 100%);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  box-shadow: var(--e4);
  position: relative;
  animation: card-in 640ms var(--ease) both;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.setup {
  display: grid;
  grid-template-columns: 392px 1fr;
  height: min(660px, calc(100vh - 158px));
  min-height: 560px;
  overflow: hidden;
}

/* ---------- Story panel ---------- */
.story {
  position: relative;
  display: flex; flex-direction: column;
  padding: 44px 40px 0;
  --story-tint: #eb6101;
  background: color-mix(in srgb, var(--story-tint) 9%, white);
  overflow: hidden;
  isolation: isolate;
  transition: background-color var(--t-slow) var(--ease);
}
body[data-role] .story { --story-tint: var(--accent); }
.story::after {
  content: ""; position: absolute; z-index: -1;
  width: 420px; height: 420px; right: -190px; bottom: -190px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--story-tint) 18%, transparent), transparent 68%);
}
.story-copy.swap > * { animation: rise var(--t-slow) var(--ease) both; }
.story-copy.swap > *:nth-child(2) { animation-delay: 50ms; }
.story-copy.swap > *:nth-child(3) { animation-delay: 100ms; }
.story-copy.swap > *:nth-child(4) { animation-delay: 150ms; }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
h1 {
  margin: 8px 0 0;
  max-width: 13ch;
  font: 800 36px/1.12 var(--font-display);
  letter-spacing: -0.035em;
  color: var(--text);
  outline: none;
  text-wrap: balance;
}

.blr-stage {
  position: relative;
  margin-top: auto;
  height: 182px;
  flex: none;
}
.setup[data-step="role"] .blr-stage { display: none; }
.setup[data-step="role"] .story h1 { margin-top: 0; }
.blr-slot img { display: block; width: 100%; height: auto; }

/* blr is layered so motions never fight:
   #blrStory (floor shadow) > .blr-fig (one-shot reactions) > .blr-pose (per-pose loop) > base + blink frame */
#blrStory {
  position: absolute; left: -6px; bottom: 0;
  width: 160px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#blrStory::before {
  content: ""; position: absolute; left: 24%; right: 24%; bottom: -2px; height: 12px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(43, 57, 143, 0.2), transparent);
}
.blr-fig {
  display: block;
  transform-origin: 50% 100%;
  filter: drop-shadow(0 10px 14px rgba(43, 57, 143, 0.14));
  transition: transform var(--t-slow) var(--ease);
}
.blr-pose { position: relative; display: block; transform-origin: 50% 100%; }
.blr-blink {
  position: absolute; inset: 0;
  opacity: 0;
  animation: blink 7s steps(1, end) infinite;
  pointer-events: none;
}
#blrStory:hover .blr-fig { transform: translateY(-4px) scale(1.04); }
#blrStory.is-looking .blr-fig { transform: rotate(5deg) translateX(6px); }
#blrStory.hop .blr-fig { animation: hop 620ms var(--ease-pop); }
#blrStory.swap .blr-fig { animation: pose 520ms var(--ease-pop); }
#blrStory.wink .blr-blink { animation: blink-once 300ms steps(1, end); }

/* one blink, then a double blink: reads as alive instead of mechanical */
@keyframes blink {
  0% { opacity: 0; } 30% { opacity: 1; } 32% { opacity: 0; }
  86% { opacity: 1; } 87.6% { opacity: 0; } 89.6% { opacity: 1; } 91.2% { opacity: 0; } 100% { opacity: 0; }
}
@keyframes blink-once { 0% { opacity: 1; } 100% { opacity: 0; } }

/* Pose loops, each tuned to what blr is saying on that step */
[data-pose="wave"] .blr-pose { animation: blr-wave 2.4s ease-in-out infinite; }
[data-pose="think"] .blr-pose { animation: blr-think 4.2s ease-in-out infinite; }
[data-pose="phone"] .blr-pose { animation: blr-walk 1.1s ease-in-out infinite; }
[data-pose="behind"] .blr-pose { animation: blr-rock 3.2s ease-in-out infinite; }
[data-pose="hello"] .blr-pose { animation: blr-hello 2.8s ease-in-out infinite; }
[data-pose="present"] .blr-pose { animation: blr-pose-off 3.4s ease-in-out infinite; }
[data-pose="tablet"] .blr-pose { animation: blr-read 3s ease-in-out infinite; }
[data-pose="laptop"] .blr-pose { animation: blr-type 2.4s ease-in-out infinite; }
@keyframes blr-wave {
  0%, 100% { transform: rotate(-3deg); }
  25% { transform: translateY(-7px) rotate(3deg); }
  50% { transform: rotate(-2deg); }
  75% { transform: translateY(-4px) rotate(4deg); }
}
@keyframes blr-think {
  0%, 100% { transform: none; }
  35%, 65% { transform: translateY(-3px) rotate(-4deg); }
}
@keyframes blr-walk {
  0%, 100% { transform: rotate(-1.5deg); }
  25% { transform: translateY(-5px) rotate(0.5deg); }
  50% { transform: rotate(1.5deg); }
  75% { transform: translateY(-5px) rotate(-0.5deg); }
}
@keyframes blr-hello {
  0%, 60%, 100% { transform: none; }
  12% { transform: rotate(-4deg); }
  24% { transform: rotate(1.5deg); }
  36% { transform: rotate(-3deg); }
  48% { transform: translateY(-2px) rotate(0.5deg); }
}
@keyframes blr-rock {
  0%, 100% { transform: rotate(-2.5deg); }
  22% { transform: translateY(-4px) rotate(0deg) scaleY(1.02); }
  45%, 55% { transform: rotate(2.5deg); }
  78% { transform: translateY(-4px) rotate(0deg) scaleY(1.02); }
}
@keyframes blr-pose-off {
  0%, 100% { transform: none; }
  30% { transform: rotate(-3deg) scale(1.03); }
  55% { transform: rotate(2deg) scale(1.01); }
}
@keyframes blr-read {
  0%, 100% { transform: none; }
  45% { transform: translateY(-4px) rotate(-1.5deg); }
  60% { transform: translateY(-4px) rotate(1deg); }
}
@keyframes blr-type {
  0%, 45%, 100% { transform: none; }
  6%, 18%, 30% { transform: translateY(-2.5px); }
  12%, 24%, 36% { transform: translateY(0); }
}
@keyframes idle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes hop {
  0% { transform: translateY(0) scale(1, 1); }
  20% { transform: translateY(0) scale(1.06, 0.92); }
  50% { transform: translateY(-22px) scale(0.96, 1.05); }
  80% { transform: translateY(0) scale(1.04, 0.96); }
  100% { transform: translateY(0) scale(1, 1); }
}
@keyframes pose {
  from { transform: scale(0.82) rotate(-6deg); opacity: 0.4; }
  to { transform: none; opacity: 1; }
}
.blr-react {
  position: absolute; left: 146px; bottom: 120px; z-index: 2;
  width: max-content; max-width: 190px;
  margin: 0; padding: 10px 14px;
  border-radius: 18px 18px 18px 4px;
  background: var(--surface);
  box-shadow: var(--e3);
  font: 600 14px/1.35 var(--font-display);
  color: var(--text);
  transform-origin: bottom left;
}
.blr-react:empty { display: none; }
.blr-react.talk { animation: talk 460ms var(--ease-pop); }
@keyframes talk {
  from { opacity: 0; transform: translateY(6px) scale(0.86); }
  to { opacity: 1; transform: none; }
}

/* ---------- Right panel ---------- */
.panel {
  position: relative;
  min-width: 0; min-height: 0;
  display: flex; flex-direction: column;
  padding: 36px 40px 28px;
}
.pane { display: none; flex: 1; min-height: 0; flex-direction: column; }
.pane.active { display: flex; animation: pane-in var(--t-slow) var(--ease) both; }
.pane.active[data-dir="back"] { animation-name: pane-in-back; }
@keyframes pane-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes pane-in-back { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
.scroll {
  flex: 1; min-height: 0;
  overflow-y: auto;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
  margin: 0 -12px; padding: 4px 12px 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ---------- Role step ---------- */
.role-area { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.tile {
  position: relative;
  height: 168px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 14px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  isolation: isolate;
  animation: rise var(--t-slow) var(--ease) both;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t-fast) var(--ease), background var(--t) var(--ease), opacity var(--t) var(--ease);
}
.tile:nth-child(2) { animation-delay: 60ms; }
.tile:nth-child(3) { animation-delay: 120ms; }
.tile:nth-child(4) { animation-delay: 180ms; }
.tile:nth-child(5) { animation-delay: 240ms; }
.tile::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(180px circle at var(--mx, 50%) var(--my, 50%), var(--accent-ring), transparent 70%);
  opacity: 0;
  transition: opacity var(--t) var(--ease);
}
.tile-icon {
  position: relative;
  width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink);
  transition: transform var(--t-slow) var(--ease-pop), background var(--t) var(--ease), color var(--t) var(--ease);
}
.tile-icon .ico { width: 27px; height: 27px; stroke-width: 1.75; }
.tile-icon::after {
  content: ""; position: absolute; inset: -7px; border-radius: 50%;
  border: 1.5px dashed var(--accent-line);
  opacity: 0; transform: scale(0.8);
  transition: opacity var(--t) var(--ease), transform var(--t-slow) var(--ease);
}
.tile-label { font: 600 14px/1.25 var(--font-display); color: var(--text); text-align: center; }
.tick {
  position: absolute; top: 12px; right: 12px;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  opacity: 0; transform: scale(0.3) rotate(-30deg);
  transition: opacity var(--t-fast) var(--ease), transform var(--t-slow) var(--ease-pop);
}
.tick .ico, .radio-dot .ico { width: 14px; height: 14px; stroke-width: 3; }
.tick .ico path, .radio-dot .ico path { stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset 380ms var(--ease) 120ms; }

.tile:hover {
  transform: translateY(-5px);
  border-color: var(--accent-line);
  box-shadow: 0 18px 36px -16px var(--accent-glow), var(--e2);
}
.tile:hover::before { opacity: 1; }
.tile:hover .tile-icon { transform: scale(1.08); }
.tile:hover .tile-icon::after { opacity: 1; transform: none; animation: orbit 6s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }
.tile[data-role="student"]:hover .tile-icon .ico { animation: toss 720ms var(--ease); }
.tile[data-role="educator"]:hover .tile-icon .ico { animation: nudge 720ms var(--ease); }
.tile[data-role="university"]:hover .tile-icon .ico { animation: toss 720ms var(--ease); }
.tile[data-role="parent"]:hover .tile-icon .ico,
.tile[data-role="lecturer"]:hover .tile-icon .ico { animation: glow 900ms var(--ease); }
@keyframes toss {
  0%, 100% { transform: none; }
  35% { transform: translateY(-6px) rotate(-14deg); }
  65% { transform: translateY(1px) rotate(4deg); }
}
@keyframes nudge {
  0%, 100% { transform: none; }
  30% { transform: translateX(-3px) rotate(-6deg); }
  60% { transform: translateX(3px) rotate(4deg); }
}
@keyframes glow {
  0%, 100% { transform: none; filter: none; }
  45% { transform: scale(1.14) translateY(-2px); filter: drop-shadow(0 0 6px var(--accent-glow)); }
}
.tile:active { transform: translateY(-2px) scale(0.97); transition-duration: 90ms; }

.tile[aria-checked="true"] {
  border-color: var(--accent);
  background: var(--accent-wash);
  box-shadow: 0 0 0 4px var(--accent-ring), 0 18px 36px -18px var(--accent-glow);
}
.tile[aria-checked="true"] .tile-icon { background: var(--accent); color: #fff; transform: scale(1.04); }
.tile[aria-checked="true"] .tick { opacity: 1; transform: none; }
.tile[aria-checked="true"] .tick .ico path { stroke-dashoffset: 0; }
.role-area.has-choice .tile[aria-checked="false"],
.role-area.has-choice .other-wrap:not(.is-selected) { opacity: 0.6; }
.role-area.has-choice .tile[aria-checked="false"]:hover,
.role-area.has-choice .other-wrap:not(.is-selected):hover { opacity: 1; }

.other-wrap {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  isolation: isolate;
  position: relative;
  animation: rise var(--t-slow) var(--ease) 180ms both;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t-fast) var(--ease), background var(--t) var(--ease), opacity var(--t) var(--ease);
}
.other-wrap::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), var(--accent-ring), transparent 70%);
  opacity: 0; transition: opacity var(--t) var(--ease);
}
.other-row {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 8px;
  border: 0; background: transparent; text-align: left;
}
.other-icon {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink);
  transition: transform var(--t-slow) var(--ease-pop), background var(--t) var(--ease), color var(--t) var(--ease);
}
.other-icon .ico { width: 16px; height: 16px; }
.other-text { flex: 1; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; }
.other-title { font: 600 14px/1.3 var(--font-display); }
.other-sub { font-size: 13px; color: var(--text-soft); }
.other-row .radio-dot { width: 20px; height: 20px; }
.radio-dot {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  border: 1.5px solid var(--border);
  color: #fff;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t-slow) var(--ease-pop);
}
.other-wrap:hover {
  transform: translateY(-2px);
  border-color: var(--accent-line);
  box-shadow: 0 10px 20px -14px var(--accent-glow), var(--e1);
}
.other-wrap:hover::before { opacity: 1; }
.other-wrap:hover .other-icon { transform: rotate(20deg) scale(1.08); }
.other-wrap.is-selected {
  border-color: var(--accent);
  background: var(--accent-wash);
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.other-wrap.is-selected .other-icon { background: var(--accent); color: #fff; }
.other-wrap.is-selected .radio-dot { background: var(--accent); border-color: var(--accent); transform: scale(1.06); }
.other-wrap.is-selected .radio-dot .ico path { stroke-dashoffset: 0; }

.reveal { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--t-slow) var(--ease); }
.reveal > .reveal-inner { min-height: 0; overflow: hidden; opacity: 0; visibility: hidden; transition: opacity var(--t) var(--ease), visibility 0s linear var(--t-slow); }
.reveal.open { grid-template-rows: 1fr; }
.reveal.open > .reveal-inner { opacity: 1; visibility: visible; transition: opacity var(--t) var(--ease) 80ms, visibility 0s; }

.other-form { display: flex; gap: 10px; padding: 2px 12px 12px 50px; }
.other-form input { flex: 1; font-size: 12px; }
.other-form input, .field {
  min-width: 0;
  height: 44px; padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 14px;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t) var(--ease);
}
.other-form input::placeholder, .field::placeholder { color: var(--text-mute); }
.other-form input:hover, .field:hover { border-color: #d1d5db; }
.other-form input:focus, .field:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(18, 169, 230, 0.12);
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px;
  border: 0; border-radius: var(--radius-full);
  font-size: 14px; font-weight: 600; letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease), background var(--t) var(--ease), color var(--t) var(--ease);
}
.btn .ico { width: 16px; height: 16px; transition: transform var(--t) var(--ease); }
.btn-primary {
  background: var(--indigo); color: #fff;
  box-shadow: 0 4px 14px -4px rgba(47, 61, 153, 0.45);
}
.btn-primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.32) 50%, transparent 70%);
  transform: translateX(-120%);
}
.btn-primary:hover { background: var(--indigo-2); transform: translateY(-1px); box-shadow: 0 12px 24px -10px rgba(47, 61, 153, 0.6); }
.btn-primary:hover::after { transform: translateX(120%); transition: transform 720ms var(--ease); }
.btn-primary:hover [data-icon="arrowRight"] .ico { transform: translateX(3px); }
.btn-primary:active { transform: translateY(0) scale(0.97); transition-duration: 90ms; }
.btn-primary[aria-disabled="true"] {
  background: var(--disabled); color: #fff; box-shadow: none; cursor: not-allowed; transform: none;
}
.btn-primary[aria-disabled="true"]::after { display: none; }
.btn-primary[aria-disabled="true"] [data-icon="arrowRight"] .ico { transform: none; }
.btn-primary.is-ready { animation: wake 900ms var(--ease); }
@keyframes wake {
  0% { box-shadow: 0 0 0 0 rgba(47, 61, 153, 0.45); transform: scale(1); }
  30% { transform: scale(1.05); }
  100% { box-shadow: 0 0 0 14px rgba(47, 61, 153, 0); transform: scale(1); }
}
.btn.shake,
.consent.shake { animation: shake 420ms var(--ease); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}
.btn-ghost {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--hover); transform: translateY(-1px); }
.btn-ghost:hover [data-icon="arrowLeft"] .ico { transform: translateX(-3px); }
.btn-ghost:hover [data-icon="pencil"] .ico { transform: rotate(-14deg); }
.btn-ghost:active { transform: scale(0.97); }
.btn-sm { height: 44px; padding: 0 16px; }

.actions {
  flex: none;
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding-top: 18px;
}
.action-hint {
  margin: 0 auto 0 0;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-mute);
  transition: color var(--t) var(--ease);
}
.action-hint .ico { width: 16px; height: 16px; }
.action-hint:not(.is-warn) { visibility: hidden; }
.action-hint.is-warn { color: var(--magenta-ink); animation: rise var(--t) var(--ease); }

/* ---------- Goal step ---------- */
.options { display: flex; flex-direction: column; gap: 10px; }
.opt-wrap {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  animation: rise var(--t-slow) var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t-fast) var(--ease), background var(--t) var(--ease);
}
.opt {
  width: 100%;
  display: grid; grid-template-columns: 40px 1fr 24px; align-items: center; gap: 14px;
  padding: 12px 16px 12px 12px;
  border: 0; background: transparent; text-align: left;
  font-size: 15px; line-height: 1.4; color: var(--text);
}
.opt-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--hover); color: var(--text-soft);
  transition: transform var(--t-slow) var(--ease-pop), background var(--t) var(--ease), color var(--t) var(--ease);
}
.opt-icon .ico { width: 19px; height: 19px; }
.opt-label { transition: transform var(--t) var(--ease); }
.opt-wrap:hover {
  transform: translateY(-2px);
  border-color: var(--accent-line);
  box-shadow: 0 14px 28px -18px var(--accent-glow), var(--e1);
}
.opt-wrap:hover .opt-icon { background: var(--accent-soft); color: var(--accent-ink); transform: rotate(-8deg) scale(1.08); }
.opt-wrap:hover .opt-label { transform: translateX(2px); }
.opt-wrap:hover .radio-dot { border-color: var(--accent-line); }
.opt:active .opt-icon { transform: scale(0.92); }
.opt-wrap.is-selected {
  border-color: var(--accent);
  background: var(--accent-wash);
  box-shadow: 0 0 0 4px var(--accent-ring);
  transform: none;
}
.opt-wrap.is-selected .opt-icon { background: var(--accent); color: #fff; transform: none; }
.opt-wrap.is-selected .opt-label { font-weight: 500; transform: none; }
.opt-wrap.is-selected .radio-dot { background: var(--accent); border-color: var(--accent); animation: pop 420ms var(--ease-pop); }
.opt-wrap.is-selected .radio-dot .ico path { stroke-dashoffset: 0; }
@keyframes pop { 0% { transform: scale(0.6); } 100% { transform: scale(1); } }

.follow-body { padding: 2px 16px 16px 66px; display: flex; flex-direction: column; gap: 8px; }
.follow-body .field { width: 100%; font-size: 12px; }
.follow-label { margin: 0; font-size: 13px; font-weight: 600; color: var(--text); }
.follow-hint { margin: -4px 0 2px; font-size: 12px; color: var(--text-soft); }
.follow-sub { margin: 6px 0 0; font-size: 12px; font-weight: 600; color: var(--text-soft); }
.mini-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mini-chip, .example {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  font-size: 13px; text-align: left; color: var(--text);
  transition: transform var(--t) var(--ease), border-color var(--t-fast) var(--ease), background var(--t) var(--ease), box-shadow var(--t) var(--ease), color var(--t) var(--ease);
}
.example { border-color: transparent; background: var(--surface); box-shadow: var(--e1); }
.mini-chip .ico, .example .ico { width: 13px; height: 13px; stroke-width: 2.5; }
.example .ico { color: var(--accent-ink); }
.mini-chip:hover, .example:hover {
  transform: translateY(-2px);
  border-color: var(--accent-line);
  background: var(--surface);
  box-shadow: 0 8px 16px -10px var(--accent-glow);
}
.mini-chip:active, .example:active { transform: scale(0.96); }
.mini-chip[aria-checked="true"], .example[aria-checked="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 500;
  animation: pop 360ms var(--ease-pop);
}
.own-answer {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 8px;
  max-width: 100%;
  padding: 7px 8px 7px 12px;
  border: 0; border-radius: var(--radius-full);
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 13px; font-weight: 500;
  animation: pop 360ms var(--ease-pop);
}
.own-answer .ico { width: 14px; height: 14px; }
.own-answer .edit {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: var(--radius-full);
  background: var(--surface); font-size: 12px; color: var(--text-soft);
  transition: color var(--t) var(--ease);
}
.own-answer:hover .edit { color: var(--accent-ink); }
.enter-hint { margin: -2px 0 0; font-size: 12px; color: var(--text-mute); }
.enter-hint kbd {
  font: 600 11px var(--font-body);
  padding: 1px 6px; border-radius: 6px;
  background: var(--hover); border: 1px solid var(--border);
}

/* ---------- Subject step ---------- */
.q-block { margin-bottom: 30px; }
.q-block:last-child { margin-bottom: 0; }
.q {
  margin: 0 0 14px;
  font: 600 15px/1.3 var(--font-display);
  letter-spacing: -0.01em;
  color: var(--text-soft);
}
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 16px 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  font-size: 14px; color: var(--text);
  animation: rise var(--t-slow) var(--ease) both;
  animation-delay: calc(var(--i, 0) * 25ms);
  transition: transform var(--t) var(--ease), border-color var(--t-fast) var(--ease), background var(--t) var(--ease), box-shadow var(--t) var(--ease), color var(--t) var(--ease);
}
.chip-ico {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--hover); color: var(--text-soft);
  transition: transform var(--t-slow) var(--ease-pop), background var(--t) var(--ease), color var(--t) var(--ease);
}
.chip-ico .ico { width: 15px; height: 15px; }
.chip:hover {
  transform: translateY(-2px);
  border-color: var(--accent-line);
  box-shadow: 0 10px 20px -12px var(--accent-glow);
}
.chip:hover .chip-ico { background: var(--accent-soft); color: var(--accent-ink); transform: rotate(-12deg) scale(1.1); }
.chip:active { transform: scale(0.95); transition-duration: 90ms; }
.chip[aria-checked="true"] {
  background: var(--accent-ink); border-color: var(--accent-ink); color: #fff;
  box-shadow: 0 10px 22px -12px var(--accent-glow);
  animation: pop 380ms var(--ease-pop);
}
.chip[aria-checked="true"] .chip-ico { background: rgba(255, 255, 255, 0.18); color: #fff; transform: none; }
#subjectOtherReveal .reveal-inner,
#gradeOtherReveal .reveal-inner { padding-top: 12px; }
#subjectOtherReveal .field,
#gradeOtherReveal .field { width: 100%; max-width: 320px; font-size: 12px; }
.q-max {
  display: inline-flex; align-items: center;
  margin-left: 4px; padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--hover);
  font: 600 11px/1.4 var(--font-body);
  color: var(--text-soft);
  vertical-align: 2px;
}
.chip.is-full { animation: shake 420ms var(--ease); }

#gradeGroups { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.grade-group-label {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.grade-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip.grade { width: 44px; padding: 0; justify-content: center; font: 600 15px/1 var(--font-display); }
.chip.grade-wide { width: auto; padding: 0 16px; font-size: 14px; }

/* ---------- Age step (students) ---------- */
.age-field {
  position: relative;
  display: flex; align-items: center;
  max-width: 220px; height: 54px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t) var(--ease);
}
.age-field:hover { border-color: #d1d5db; }
.age-field:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(18, 169, 230, 0.12); }
.age-field.is-error { border-color: var(--magenta); box-shadow: 0 0 0 4px rgba(226, 27, 114, 0.1); animation: shake 420ms var(--ease); }
.age-field input {
  width: 100%; height: 100%;
  border: 0; background: transparent; outline: none;
  padding: 0 96px 0 16px;
  font: 600 22px/1 var(--font-display);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.age-field input::placeholder { color: var(--text-mute); font-weight: 500; }
.age-unit {
  position: absolute; right: 16px;
  font-size: 14px; font-weight: 600; color: var(--text-soft);
  pointer-events: none;
}
#joinReveal .reveal-inner,
#guardianReveal .reveal-inner { padding-top: 26px; }
#minorReveal .reveal-inner { padding-top: 14px; }
.opt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.opt-sub { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-mute); }
.opt-sub .ico { width: 12px; height: 12px; }
.opt-wrap:not(.is-locked) .opt-sub { display: none; }
.opt-wrap.is-locked { background: var(--hover); border-style: dashed; box-shadow: none; transform: none; }
.opt-wrap.is-locked:hover { transform: none; border-color: var(--border); box-shadow: none; }
.opt-wrap.is-locked .opt { cursor: not-allowed; }
.opt-wrap.is-locked .opt-label,
.opt-wrap.is-locked:hover .opt-label { color: var(--text-mute); transform: none; }
.opt-wrap.is-locked .opt-icon,
.opt-wrap.is-locked:hover .opt-icon { background: var(--surface); color: var(--text-mute); transform: none; }
.opt-wrap.is-locked .radio-dot { opacity: 0.4; }
.opt-wrap.shake { animation: shake 420ms var(--ease); }
.q-help { margin: -8px 0 12px; font-size: 13px; line-height: 1.45; color: var(--text-soft); max-width: 440px; }
label.q { display: block; }
.guardian-field { position: relative; max-width: 360px; }
.guardian-field .field { width: 100%; padding-left: 40px; font-size: 14px; }
.guardian-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); display: grid; color: var(--text-mute); pointer-events: none; }
.guardian-ico .ico { width: 17px; height: 17px; }
.guardian-field.is-ok .guardian-ico { color: var(--accent-ink); }
.guardian-field.is-error .field { border-color: var(--magenta-ink); animation: shake 420ms var(--ease); }
.same-email {
  display: flex; align-items: center; gap: 10px;
  width: fit-content; max-width: 100%;
  margin: 0 0 14px;
  cursor: pointer;
  font: 500 14px/1.4 var(--font-body);
  color: var(--text);
}
.same-email input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.same-box {
  flex: none; display: grid; place-items: center;
  width: 18px; height: 18px;
  border: 1.5px solid var(--text);
  border-radius: 4px;
  background: var(--surface);
  color: #fff;
}
.same-box .ico { width: 12px; height: 12px; opacity: 0; }
.same-email:hover .same-box { border-color: var(--accent-ink); }
.same-email input:focus-visible + .same-box { box-shadow: 0 0 0 3px var(--accent-line); }
.same-email input:checked + .same-box { background: var(--text); border-color: var(--text); }
.same-email input:checked + .same-box .ico { opacity: 1; }
.guardian-field .field[readonly] { background: var(--surface-2); color: var(--text-soft); }
#guardianHelp:empty { display: none; }
#guardianHelp { margin-top: 8px; }
.kid-safe,
.consent-minor { --safe: #17936a; --safe-ink: #0f7553; }
.kid-safe {
  width: 100%;
  max-width: none;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--safe) 28%, transparent);
  border-radius: 18px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--safe) 7%, white), var(--surface) 72%);
}
.kid-safe-head { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.kid-safe-badge { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; background: var(--safe); color: #fff; }
.kid-safe-badge .ico { width: 11px; height: 11px; }
.kid-safe-title { margin: 0; font: 600 12px/1.3 var(--font-display); color: var(--text-soft); }
.kid-safe-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.kid-safe-list li { display: grid; grid-template-columns: 13px 1fr; gap: 6px; font-size: 11.5px; line-height: 1.35; color: var(--text-mute); }
.kid-safe-list li > span:first-child { display: grid; padding-top: 1px; color: var(--safe-ink); }
.kid-safe-list .ico { width: 12px; height: 12px; }
.kid-safe-list b { font-weight: 600; color: var(--text); }
.consent-minor { display: none; align-items: flex-start; gap: 8px; margin: 12px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--text-soft); }
.consent-minor .ico { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--safe-ink); }
body.is-minor .consent-minor { display: flex; }

/* ---------- Name step ---------- */

/* Name is typed straight into the header, under the question, as display type. */
.name-line { display: none; position: relative; align-items: center; gap: 10px; max-width: 360px; margin-top: 14px; }
.setup[data-step="name"] .name-line { display: flex; }
.name-line::before,
.name-line::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px;
}
.name-line::before { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.name-line::after {
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 520ms var(--ease);
}
.name-line:focus-within::after,
.name-line.is-filled::after { transform: scaleX(1); }
#nameInput {
  flex: 1; min-width: 0;
  padding: 4px 0 10px; border: 0; background: none; outline: none;
  font: 700 26px/1.2 var(--font-display); letter-spacing: -0.02em;
  color: var(--accent-ink); caret-color: var(--accent);
}
#nameInput::placeholder { color: color-mix(in srgb, var(--accent) 34%, transparent); }
.name-ok {
  flex: none; display: grid; place-items: center;
  width: 26px; height: 26px; margin-bottom: 6px; border-radius: 50%;
  background: var(--accent); color: #fff;
  opacity: 0; transform: scale(0.4) rotate(-30deg);
  transition: opacity var(--t) var(--ease), transform var(--t-slow) var(--ease-pop);
}
.name-ok .ico { width: 14px; height: 14px; }
.name-line.is-filled .name-ok { opacity: 1; transform: none; }

/* Character select: equipped look on the left, wardrobe on the right. */
.look { display: grid; grid-template-columns: 148px 1fr; gap: 24px; align-items: stretch; }
.player {
  position: relative; isolation: isolate;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 20px 12px 18px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(80% 60% at 50% 38%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    var(--accent-wash);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent);
}
/* Brand-colour border that orbits the card; brightens while browsing looks, flashes on equip */
.player::before,
.player::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  border-radius: inherit;
  background: conic-gradient(from var(--orbit), var(--magenta), var(--yellow), var(--cyan), var(--indigo), var(--magenta));
  animation: player-orbit 6s linear infinite;
}
.player::before {
  padding: 1px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0.45;
  transition: opacity var(--t) var(--ease);
}
.player::after {
  padding: 8px; filter: blur(8px); opacity: 0;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.look:hover .player::before,
.player:has(.trying)::before,
.player:has(.equip)::before { opacity: 1; }
.player:has(.equip)::after { animation: player-orbit 6s linear infinite, orbit-flash 900ms var(--ease) both; }
@keyframes player-orbit { to { --orbit: 360deg; } }
@keyframes orbit-flash {
  0%, 100% { opacity: 0; }
  30% { opacity: 0.5; }
}
.player-av {
  position: relative;
  width: 100px; aspect-ratio: 1; border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--accent-ring), 0 18px 30px -16px var(--accent-glow);
  animation: idle 3.6s ease-in-out infinite;
}
/* Pedestal shadow, so the avatar reads as standing in a scene. */
.player-av::before {
  content: ""; position: absolute; z-index: -1; left: 14%; right: 14%; bottom: -16px; height: 10px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 22%, transparent); filter: blur(4px);
}
.player-av::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.85) 50%, transparent 65%);
  background-size: 250% 100%; background-position: 120% 0; opacity: 0;
}
.player-av img { width: 100%; height: 100%; display: block; border-radius: 50%; object-fit: cover; transition: opacity var(--t-fast) var(--ease), transform var(--t) var(--ease); }
.player-av.trying img { opacity: 0.72; transform: scale(0.94); }
.player-av.equip img { animation: equip 560ms var(--ease-pop); }
.player-av.equip::after { animation: shine 700ms var(--ease) 120ms; }
@keyframes equip {
  0% { transform: scale(0.7) rotate(-10deg); opacity: 0.4; }
  60% { transform: scale(1.08) rotate(3deg); opacity: 1; }
  100% { transform: none; }
}
@keyframes shine {
  from { opacity: 1; background-position: 120% 0; }
  to { opacity: 1; background-position: -20% 0; }
}
.player-name {
  margin: 0; max-width: 100%;
  font: 700 16px/1.25 var(--font-display); letter-spacing: -0.01em; text-align: center;
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: color var(--t) var(--ease);
}
.player-name.is-empty { color: var(--text-mute); font-weight: 600; }

.look-label { margin: 0 0 10px; font: 600 13px/1 var(--font-display); color: var(--text-soft); }
.avatars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 600px) {
  .look { grid-template-columns: 1fr; gap: 18px; }
  .player { flex-direction: row; justify-content: center; gap: 16px; padding: 14px 16px; }
  .player-av { width: 64px; flex: none; }
  .player-name { min-width: 0; text-align: left; }
  .player-av::before { bottom: -10px; height: 6px; }
  #nameInput { font-size: 21px; }
}
.avatar:not(.avatar-upload) { background: color-mix(in srgb, var(--tone-c) 14%, #fff); }
.avatar:nth-of-type(4n+1) { --tone-c: #3792f2; }
.avatar:nth-of-type(4n+2) { --tone-c: #b61855; }
.avatar:nth-of-type(4n+3) { --tone-c: #e8af1b; }
.avatar:nth-of-type(4n+4) { --tone-c: #2b398f; }
img[src*="assets/avatars/"] { object-fit: contain !important; padding: 9%; box-sizing: border-box; }
.avatar {
  position: relative;
  aspect-ratio: 1;
  border: 0; padding: 0;
  border-radius: 50%;
  background: var(--hover);
  box-shadow: 0 0 0 1px var(--border);
  animation: rise var(--t-slow) var(--ease) both;
  animation-delay: calc(var(--i, 0) * 35ms);
  transition: transform var(--t-slow) var(--ease-pop), box-shadow var(--t) var(--ease);
}
.avatar img { width: 100%; height: 100%; display: block; border-radius: 50%; object-fit: cover; }
.avatar img { transition: transform var(--t-slow) var(--ease-pop); }
.avatar:hover { transform: translateY(-3px) scale(1.08); box-shadow: 0 0 0 2px var(--accent-line), 0 12px 22px -12px var(--accent-glow); }
.avatar:hover img { transform: rotate(-8deg) scale(1.06); }
.avatar:active { transform: scale(0.92); transition-duration: 90ms; }
.avatar[aria-checked="true"] {
  transform: scale(1.04);
  box-shadow: 0 0 0 2.5px var(--surface), 0 0 0 5px var(--accent), 0 12px 24px -12px var(--accent-glow);
}
.avatar .tick { top: auto; bottom: -2px; right: -2px; width: 22px; height: 22px; border: 2px solid var(--surface); }
.avatar[aria-checked="true"] .tick { opacity: 1; transform: none; }
.avatar[aria-checked="true"] .tick .ico path { stroke-dashoffset: 0; }
.avatar-upload {
  display: grid; place-items: center;
  background: var(--surface);
  box-shadow: none;
  border: 1.5px dashed var(--border);
  color: var(--text-soft);
}
.avatar-upload .ico { width: 20px; height: 20px; transition: transform var(--t-slow) var(--ease-pop); }
.avatar-upload:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-wash); }
.avatar-upload:hover .ico { transform: translateY(-2px) scale(1.1); }
.avatar-upload.has-photo { border-style: solid; padding: 0; }
.avatar-upload.has-photo .ico { display: none; }
.avatar-slot { position: relative; display: grid; }
.avatar-remove {
  position: absolute; top: -4px; right: -4px; z-index: 2;
  display: grid; place-items: center;
  width: 22px; height: 22px; padding: 0;
  border: 2px solid var(--surface); border-radius: 50%;
  background: var(--text); color: #fff;
  cursor: pointer;
  opacity: 0; transform: scale(0.4); visibility: hidden;
  transition: opacity var(--t) var(--ease), transform var(--t-slow) var(--ease-pop), background-color var(--t-fast) var(--ease), visibility 0s var(--t);
}
.avatar-remove .ico { width: 12px; height: 12px; stroke-width: 3; }
.avatar-slot.has-photo .avatar-remove { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
.avatar-remove:hover { background: var(--magenta); transform: scale(1.12); }
.avatar-remove:active { transform: scale(0.9); }
.avatar-remove:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Source step ---------- */
.sources { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.src {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 10px 14px 10px 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  text-align: left; font-size: 14px; line-height: 1.35;
  animation: rise var(--t-slow) var(--ease) both;
  animation-delay: calc(var(--i, 0) * 40ms);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t-fast) var(--ease), background var(--t) var(--ease);
}
.src-ico {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink);
  transition: transform var(--t-slow) var(--ease-pop), background var(--t) var(--ease), color var(--t) var(--ease);
}
.src-ico .ico { width: 19px; height: 19px; }
.src[data-source="google"] { --accent: #4285F4; --accent-ink: #4285F4; }
.src[data-source="youtube"] { --accent: #FF0000; --accent-ink: #FF0000; }
.src[data-source="tiktok"] { --accent: #111111; --accent-ink: #111111; }
.src[data-source="instagram"] { --accent: #E4405F; --accent-ink: #E4405F; }
.src[data-source="facebook"] { --accent: #1877F2; --accent-ink: #1877F2; }
.src[data-source="blog"] { --accent: #2F3D99; --accent-ink: #2F3D99; }
.src[data-source="events"] { --accent: #12A9E6; --accent-ink: #0E86B8; }
.src[data-source="people"] { --accent: #E21B72; --accent-ink: #E21B72; }
.src[data-source="other"] { --accent: #E8AE1A; --accent-ink: #8A6505; }
.src-label { flex: 1; }
.src-label small { display: block; font-size: 12px; color: var(--text-soft); }
.src:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  box-shadow: 0 14px 26px -16px var(--accent-glow), var(--e1);
}
.src:hover .src-ico { transform: rotate(-10deg) scale(1.1); }
.src:active { transform: scale(0.97); transition-duration: 90ms; }
.src[aria-checked="true"] {
  border-color: var(--accent);
  background: var(--accent-wash);
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.src[aria-checked="true"] .src-ico { background: var(--accent); color: #fff; transform: none; }
.src[aria-checked="true"] .radio-dot { background: var(--accent); border-color: var(--accent); animation: pop 420ms var(--ease-pop); }
.src[aria-checked="true"] .radio-dot .ico path { stroke-dashoffset: 0; }
.src-other { grid-column: 1 / -1; min-height: 46px; padding: 7px 14px 7px 8px; gap: 10px; border-radius: 14px; }
.src-other .src-ico { width: 32px; height: 32px; border-radius: 10px; }
.src-other .src-ico .ico { width: 16px; height: 16px; }
.src-other .radio-dot { width: 20px; height: 20px; }
.src-other:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -14px var(--accent-glow), var(--e1); }
.src-other-reveal { grid-column: 1 / -1; }
.src-other-reveal .reveal-inner { padding: 2px 2px 4px; }
.src-other-reveal .field { width: 100%; font-size: 12px; }
/* Rows are spaced with margins, not row-gap, so a closed follow-up row adds no space */
.sources { row-gap: 0; }
.sources > .src { margin-bottom: 10px; }
.sources > .src-other { margin-bottom: 0; }
.sources > .reveal { transition: grid-template-rows var(--t-slow) var(--ease), margin var(--t-slow) var(--ease); }
.src-follow { grid-column: 1 / -1; }
.src-follow.open { margin-bottom: 10px; }
.src-other-reveal.open { margin-top: 10px; }
.src-follow-box {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 16px 16px;
  border-radius: 16px;
  background: var(--accent-wash);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.src-follow .field { width: 100%; background: var(--surface); font-size: 12px; }
.follow-opt { margin-left: 4px; font-weight: 500; color: var(--text-soft); }

/* ---------- Phone step ---------- */
.phone-field {
  position: relative;
  display: flex; align-items: center;
  height: 54px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t) var(--ease);
}
.phone-field:hover { border-color: #d1d5db; }
.phone-field:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(18, 169, 230, 0.12); }
.phone-field.is-valid { border-color: color-mix(in srgb, #22c55e 55%, var(--border)); }
.phone-field.is-error { border-color: var(--magenta); box-shadow: 0 0 0 4px rgba(226, 27, 114, 0.1); animation: shake 420ms var(--ease); }
.phone-field > input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; background: transparent; outline: none;
  padding: 0 44px 0 14px;
  font-size: 17px; font-weight: 500; letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.phone-field > input::placeholder { color: var(--text-mute); font-weight: 400; }
.phone-ok {
  position: absolute; right: 14px;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: #22c55e; color: #fff;
  opacity: 0; transform: scale(0.3) rotate(-30deg);
  transition: opacity var(--t-fast) var(--ease), transform var(--t-slow) var(--ease-pop);
}
.phone-ok .ico { width: 13px; height: 13px; stroke-width: 3; }
.phone-field.is-valid .phone-ok { opacity: 1; transform: none; }
.cc { position: relative; height: 100%; }
.cc-btn {
  height: 100%;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 12px 0 14px;
  border: 0; border-right: 1px solid var(--border-soft);
  border-radius: 14px 0 0 14px;
  background: transparent;
  font-size: 15px; font-weight: 600;
  transition: background var(--t-fast) var(--ease);
}
.cc-btn:hover { background: var(--hover); }
.cc-flag { font-size: 20px; line-height: 1; }
.cc-btn .chev .ico { width: 14px; height: 14px; color: var(--text-soft); transition: transform var(--t) var(--ease); }
.cc.open .cc-btn .chev .ico { transform: rotate(180deg); }
.cc-menu {
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 30;
  width: 290px; padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--e4);
  opacity: 0; transform: translateY(-6px) scale(0.97); transform-origin: top left;
  pointer-events: none; visibility: hidden;
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), visibility 0s linear var(--t);
}
.cc.open .cc-menu { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), visibility 0s; }
.cc-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 40px; border-radius: 10px; background: var(--hover); margin-bottom: 6px; }
.cc-search .ico { width: 15px; height: 15px; color: var(--text-mute); }
.cc-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 14px; }
.cc-list { max-height: 232px; overflow-y: auto; }
.cc-opt {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border: 0; border-radius: 10px; background: transparent;
  font-size: 14px; text-align: left;
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.cc-opt:hover, .cc-opt:focus-visible { background: var(--hover); outline: none; transform: translateX(2px); }
.cc-opt .cc-flag { font-size: 18px; }
.cc-opt .cc-name { flex: 1; }
.cc-opt .cc-dial { color: var(--text-soft); font-variant-numeric: tabular-nums; }
.cc-opt[aria-selected="true"] { font-weight: 600; background: var(--accent-wash); }
.cc-empty { margin: 8px 10px; font-size: 13px; color: var(--text-mute); }
.field-help {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 0 0;
  font-size: 13px; color: var(--text-soft);
  transition: color var(--t) var(--ease);
}
.field-help .ico { width: 14px; height: 14px; flex: none; }
.field-help:empty { display: none; }
.field-help:not(:empty) { animation: rise var(--t) var(--ease); }
.field-help.is-warn { color: var(--magenta-ink); }
.field-help.is-note { color: var(--accent-ink); }

.consent {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px;
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border-soft);
  transition: box-shadow var(--t) var(--ease), background-color var(--t) var(--ease);
}
.consent.is-yes { background: var(--accent-wash); box-shadow: inset 0 0 0 1px var(--accent-line); }
.consent-check { display: flex; align-items: center; gap: 16px; width: 100%; cursor: pointer; }
.consent-check .consent-box { order: 2; }
.consent-check input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.consent-box {
  flex: none; display: grid; place-items: center;
  width: 20px; height: 20px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: #fff;
  transition: background var(--t) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t) var(--ease);
}
.consent-box .ico { width: 14px; height: 14px; opacity: 0; transform: scale(0.5); transition: opacity var(--t-fast) var(--ease), transform var(--t) var(--ease-pop); }
.consent-check:hover .consent-box { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-wash); }
.consent-check input:focus-visible + .consent-box { box-shadow: 0 0 0 3px var(--accent-line); }
.consent-check input:checked + .consent-box { background: var(--accent-ink); border-color: var(--accent-ink); animation: pop 380ms var(--ease-pop); }
.consent-check input:checked + .consent-box .ico { opacity: 1; transform: scale(1); }
.consent-check input:disabled + .consent-box { opacity: 0.4; }
.consent.is-locked .consent-check { cursor: not-allowed; }
.consent-title { flex: 1 1 auto; margin: 0; font: 500 13px/1.45 var(--font-body); color: var(--text-soft); }


/* ---------- Loading ---------- */
.loading {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--t) var(--ease);
}
.loading.show { opacity: 1; pointer-events: auto; }
.loading-blr { width: 120px; }
.blocks { display: flex; gap: 6px; margin: 14px 0 18px; }
.blocks i {
  width: 12px; height: 12px; border-radius: 4px;
  animation: stack 900ms var(--ease) infinite;
}
.blocks i:nth-child(1) { background: var(--magenta); }
.blocks i:nth-child(2) { background: var(--cyan); animation-delay: 120ms; }
.blocks i:nth-child(3) { background: var(--yellow); animation-delay: 240ms; }
@keyframes stack {
  0%, 100% { transform: translateY(0) rotate(0); }
  40% { transform: translateY(-10px) rotate(45deg); }
}
.loading-title { margin: 0; font: 700 17px/1.3 var(--font-display); }
.loading-sub { margin: 4px 0 0; font-size: 13px; color: var(--text-soft); }

/* ---------- Try step ---------- */
.try {
  padding: 32px 40px 28px;
  display: flex; flex-direction: column; gap: 20px;
  isolation: isolate;
}
.try-ink {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%;
  border-radius: inherit;
  pointer-events: none;
}
@media (hover: none), (prefers-reduced-motion: reduce) { .try-ink { display: none; } }
.try-head h1 {
  margin: 0;
  max-width: none;
  font: 700 1.35rem/1.15 var(--font-display);
  letter-spacing: -0.02em;
}
.try-head > * { animation: rise var(--t-slow) var(--ease) both; }
.try-head > *:nth-child(2) { animation-delay: 60ms; }
.try-head > *:nth-child(3) { animation-delay: 120ms; }
.try-fit {
  margin: -3px 0 5px; padding: 3px 0; font-size: 14px; line-height: 1.75; color: var(--text-soft);
  text-wrap: pretty;
}
.try-fit .token { padding: 1px 5px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.token {
  display: inline;
  padding: 1px 6px; margin: 0 1px;
  border: 0; border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: underline dotted color-mix(in srgb, var(--accent) 50%, transparent);
  text-underline-offset: 4px;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.token:hover { background: var(--accent); color: #fff; text-decoration-color: transparent; }

.preview {
  position: relative;
  border-radius: var(--radius-xl);
  background: #fdffd8;
  display: flex; justify-content: center;
  animation: rise 560ms var(--ease) 140ms both;
  isolation: isolate;
}
.preview-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 52vh;
  padding: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.6) 50%, transparent 70%) -100% 0 / 200% 100% no-repeat, #fdffd8;
  animation: shimmer 1.4s linear infinite;
}
.preview-media.is-loaded { animation: none; background: #fdffd8; }
.preview-cover {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  border-radius: inherit;
}
/* Video thumbnails are 16:9 with the title slightly below center. Nudge the crop up so that title sits in the middle of the frame. */
.preview-cover.is-video { object-position: center 62%; }
.preview-cover.is-contain { object-fit: contain; padding: 16px; }
.preview-embed { display: block; width: 100%; height: 100%; border: 0; }
.preview-media.is-embed .preview-cover,
.preview-media.is-embed .preview-fs { display: none; }
#try .preview-media.is-embed { background: #fff; }
.try:has(.preview-media.is-embed) .try-gate { display: none; }
/* Gesture hint over the live 3D/AR embed; it never takes pointer events so dragging reaches the viewer */
.gesture-hint {
  position: absolute; left: 50%; top: 50%; z-index: 2;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: 100px; height: 100px; margin: -50px 0 0 -50px;
  border-radius: var(--radius-full);
  background: rgba(17, 20, 45, 0.62); color: #fff;
  box-shadow: 0 8px 24px rgba(17, 20, 45, 0.25);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  pointer-events: none;
  opacity: 0; transform: scale(0.85);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(.22,1,.36,1);
}
.preview-media.is-embed .gesture-hint { display: flex; }
.gesture-hint.show { opacity: 1; transform: scale(1); }
.gesture-hint-hand svg { display: block; width: 36px; height: 36px; stroke-width: 1.4; animation: gesture-hand 2.2s cubic-bezier(.45,0,.55,1) infinite; }
.gesture-hint-track { display: block; width: 52px; height: 16px; }
@keyframes gesture-hand {
  0%, 100% { transform: translateX(-11px) rotate(-6deg); }
  50% { transform: translateX(11px) rotate(6deg); }
}
@media (prefers-reduced-motion: reduce) {
  .gesture-hint-hand svg { animation: none; }
}
.preview-fs {
  position: absolute; left: 50%; top: 50%; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 18px 0 16px;
  border: 0; border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.7); color: #fff;
  font: 600 14px/1 var(--font-body);
  box-shadow: none;
  outline: none;
  appearance: none;
  cursor: pointer;
  transform: translate(-50%, -50%);
  animation: fs-hint 1.35s var(--ease) infinite;
  transition: background var(--t-fast) var(--ease), box-shadow var(--t) var(--ease);
}
.preview-fs:hover,
.preview-fs:focus-visible {
  animation: none;
  background: rgba(0, 0, 0, 0.82);
  transform: translate(-50%, -50%) translateY(-1px);
  box-shadow: 0 14px 28px -8px rgba(0, 0, 0, 0.5);
}
.preview-fs:active {
  animation: none;
  transform: translate(-50%, -50%) scale(0.98);
}
.preview-fs:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.preview-fs .ico { width: 16px; height: 16px; }
@keyframes fs-hint {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  35% { transform: translate(-50%, -50%) scale(1.1); }
  50% { transform: translate(-50%, -50%) scale(0.97); }
  65% { transform: translate(-50%, -50%) scale(1.05); }
}
.preview-stage {
  position: fixed; inset: 0; z-index: 400;
  background: #111418;
}
.preview-stage:fullscreen,
.preview-stage:-webkit-full-screen {
  width: 100%; height: 100%;
  background: #111418;
}
.preview-stage iframe,
.preview-stage .preview-still {
  display: block; width: 100%; height: 100%; border: 0;
  background: #fdffd8;
  object-fit: contain;
}
.preview-stage.is-still { background: #fdffd8; }
.preview-stage.is-video iframe { background: #000; }
.preview-stage.is-page { overflow-y: auto; background: #111418; }
.preview-stage.is-page .preview-still {
  width: min(1120px, calc(100% - 48px)); height: auto;
  margin: 24px auto;
  border-radius: 16px;
  object-fit: initial;
  background: #fff;
}
.preview-stage.is-page .preview-exit { position: fixed; }
.preview-exit {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 16px 0 12px;
  border: 0; border-radius: var(--radius-full);
  background: #fff; color: var(--text);
  font: 600 14px/1 var(--font-body);
  box-shadow: var(--e4);
  cursor: pointer;
}
.preview-exit:hover { transform: translateY(-1px); }
.preview-exit:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.preview-exit .ico { width: 16px; height: 16px; }
@keyframes shimmer { to { background-position: 100% 0, 0 0; } }
/* blr stands behind the preview with its legs hidden, presenting the material */
.blr-peek {
  position: absolute; right: 48px; bottom: 100%;
  width: 88px; margin-bottom: -34px;
  z-index: -1;
  transform: translateY(100%);
  transition: transform 700ms var(--ease-pop);
}
.blr-peek.up { transform: translateY(0); }
.blr-peek.cheer { animation: peek-hop 680ms var(--ease-pop); }
@keyframes peek-hop {
  0% { transform: none; }
  35% { transform: translateY(-26px) rotate(-4deg); }
  70% { transform: translateY(2px) rotate(2deg); }
  100% { transform: none; }
}

.try-foot { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.try-actions { display: flex; gap: 10px; }
.try-gate {
  margin: 0 auto 0 0;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--magenta-ink);
  font: 600 13px/1.3 var(--font-body);
}
.try-gate.is-shown { animation: rise var(--t) var(--ease); }
.try-gate .ico { width: 16px; height: 16px; flex: none; }
.try.is-locked #startBtn[aria-disabled="true"]:hover,
.try.is-locked #startBtn[aria-disabled="true"]:focus-visible {
  background: #c3c9d8;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--indigo) 18%, transparent);
  transform: none;
}
.try.is-locked:has(#startBtn:hover) .preview-fs,
.try.is-locked:has(#startBtn:focus-visible) .preview-fs,
.preview-fs.is-nudge {
  background: rgba(0, 0, 0, 0.88);
  box-shadow:
    0 0 0 4px #fff,
    0 0 0 8px color-mix(in srgb, var(--indigo) 70%, transparent),
    0 14px 28px -8px rgba(0, 0, 0, 0.5);
}
.preview-fs.is-seen {
  animation: none;
  background: rgba(0, 0, 0, 0.7);
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px color-mix(in srgb, var(--indigo) 55%, transparent);
}
.preview-fs.is-seen:hover,
.preview-fs.is-seen:focus-visible {
  background: rgba(0, 0, 0, 0.82);
  transform: translate(-50%, -50%) translateY(-1px);
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--indigo), 0 14px 28px -8px rgba(0, 0, 0, 0.45);
}
#startBtn.is-done { background: var(--accent-ink); }

body[data-view="welcome"] {
  background: linear-gradient(180deg, #d7ecff 0%, #eef6ff 42%, #fff7ee 100%);
}
body[data-view="welcome"] .backdrop { display: none; }
body[data-view="welcome"] .topbar { display: none; }
body[data-view="welcome"] .shell { min-height: 100vh; min-height: 100dvh; position: relative; }
.welcome {
  position: relative;
  z-index: 1;
  width: min(880px, 100%);
  flex: 1;
  padding: 24px 0 32px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  text-align: center;
}
/* Welcome sky: a photo sky, drifting wisps, and glass bubbles that each hold a piece of the world */
.sky {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  --px: 0; --py: 0;
}
.welcome > :not(.sky) { position: relative; z-index: 1; }
.sky img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.sky-photo {
  position: absolute; inset: -6%;
  background: url("assets/world/sky-photo.jpg?v=2") center 70% / cover no-repeat;
  filter: saturate(1.05);
  transform: translate3d(calc(var(--px) * -8px), calc(var(--py) * -6px), 0);
  animation: skyPan 70s ease-in-out infinite alternate;
}
@keyframes skyPan {
  from { scale: 1.02; translate: -1% 0; }
  to { scale: 1.1; translate: 1.5% -1%; }
}
.sky-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 88% 0%, rgba(255, 255, 255, 0.75), transparent 70%),
    radial-gradient(40% 35% at 15% 20%, rgba(214, 200, 255, 0.35), transparent 70%);
  mix-blend-mode: screen;
  animation: glowPulse 9s ease-in-out infinite alternate;
}
@keyframes glowPulse { from { opacity: 0.65; } to { opacity: 1; } }
.layer { position: absolute; inset: 0; will-change: transform; }
.layer-far  { transform: translate3d(calc(var(--px) * -10px), calc(var(--py) * -6px), 0); }
.layer-mid  { transform: translate3d(calc(var(--px) * -22px), calc(var(--py) * -14px), 0); z-index: 2; }
.layer-near { transform: translate3d(calc(var(--px) * -34px), calc(var(--py) * -20px), 0); }

.wisp {
  position: absolute; left: 100%;
  animation: cloudDrift linear infinite;
  will-change: transform;
}
.layer-far .wisp { opacity: 0.75; filter: blur(2px); }
.w1 { top: 6%;  width: 620px; animation-duration: 160s; animation-delay: -40s; }
.w2 { top: 36%; width: 520px; animation-duration: 190s; animation-delay: -130s; }
.w3 { top: 60%; width: 700px; animation-duration: 210s; animation-delay: -15s; }
.layer-near .wisp { opacity: 0.85; filter: blur(6px); }
.w4 { bottom: -4%; top: auto; width: 1100px; animation-duration: 120s; animation-delay: -70s; }
.w5 { bottom: 8%; top: auto; width: 820px; animation-duration: 140s; animation-delay: -10s; }
@keyframes cloudDrift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(calc(-100vw - 100%), 0, 0); }
}
.sky-haze {
  position: absolute; left: 0; right: 0; bottom: 0; height: 38%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.55) 55%, rgba(255, 255, 255, 0.9) 100%);
  backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 45%);
  mask-image: linear-gradient(180deg, transparent, #000 45%);
}

/* Glass bubbles */
.bubble { position: absolute; pointer-events: auto; cursor: pointer; }
.bubble-float { display: block; animation: bubbleDriftA 14s ease-in-out infinite; }
.bubble-orb {
  position: relative; display: block;
  width: 100%; aspect-ratio: 1; border-radius: 50%;
  overflow: hidden; isolation: isolate;
  background: radial-gradient(circle at 50% 55%, rgba(225, 240, 255, 0.12) 0 55%, rgba(255, 255, 255, 0.28) 78%, rgba(200, 225, 255, 0.5) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.6),
    inset -12px -16px 30px rgba(110, 160, 255, 0.28),
    inset 12px 10px 26px rgba(255, 180, 230, 0.22),
    0 24px 44px -22px rgba(47, 61, 153, 0.35);
  -webkit-backdrop-filter: blur(4px) saturate(1.6) brightness(1.08);
  backdrop-filter: blur(4px) saturate(1.6) brightness(1.08);
  animation: bubbleWobble 5.5s ease-in-out infinite;
  transition: scale 600ms cubic-bezier(0.3, 1.6, 0.5, 1);
}
.bubble-orb::before {
  content: ""; position: absolute; inset: 0; z-index: 3; border-radius: 50%;
  background: conic-gradient(from 0deg, #ff9fd8, #9fd6ff, #b6ffd6, #ffe9a3, #cba8ff, #ff9fd8);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 2px));
  opacity: 0.6; filter: blur(0.6px);
  mix-blend-mode: screen;
  animation: rimSpin 10s linear infinite;
}
.bubble-orb::after {
  content: ""; position: absolute; inset: 0; z-index: 4; border-radius: 50%;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.95) 0 5%, rgba(255, 255, 255, 0) 13%),
    radial-gradient(ellipse 26% 12% at 36% 16%, rgba(255, 255, 255, 0.55), transparent 70%),
    radial-gradient(circle at 72% 80%, rgba(255, 255, 255, 0.4) 0 4%, transparent 12%);
  pointer-events: none;
}
.bubble:hover .bubble-orb { scale: 1.1; }
@keyframes bubbleWobble {
  0%, 100% { transform: scale(1, 1); }
  25% { transform: scale(1.035, 0.97); }
  50% { transform: scale(0.98, 1.025); }
  75% { transform: scale(1.02, 0.985); }
}
@keyframes rimSpin { to { rotate: 360deg; } }
@keyframes bubbleDriftA {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(18px, -26px); }
  50% { transform: translate(-6px, -44px); }
  75% { transform: translate(-20px, -18px); }
}
@keyframes bubbleDriftB {
  0%, 100% { transform: translate(0, 0); }
  30% { transform: translate(-22px, -18px); }
  60% { transform: translate(10px, -38px); }
  85% { transform: translate(16px, -10px); }
}
.bb1 { width: 46px; left: max(2vw, calc(50% - 650px)); top: 13%; }
.bb4 { width: 50px; right: max(2vw, calc(50% - 622px)); bottom: 17%; }
.bb7 { width: 18px;  left: max(14vw, calc(50% - 470px)); top: 7%; }
body[data-view="welcome"] #setup,
body[data-view="welcome"] #try { display: none; }
.bb4 .bubble-float { animation-name: bubbleDriftB; }
.bb4 .bubble-float { animation-duration: 20s; animation-delay: -3s; }
.bb7 .bubble-float { animation-duration: 9s; animation-delay: -4s; }
.bubble .bubble-orb { background: radial-gradient(circle at 50% 55%, rgba(255, 255, 255, 0.04) 0 55%, rgba(255, 255, 255, 0.3) 80%, rgba(205, 228, 255, 0.55) 100%); }

/* Sky actors: small 3D characters flying free between the bubbles */
.balloon-flight {
  position: absolute; top: 0; width: 46px;
  left: max(7vw, calc(50% - 560px));
  animation: balloonRise 46s linear infinite;
  animation-delay: -17s;
}
.balloon-flight .balloon {
  filter: drop-shadow(0 10px 12px rgba(47, 61, 153, 0.18));
  animation: balloonSway 7s ease-in-out infinite alternate;
}
.bf2 {
  width: 26px; left: auto; right: max(16vw, calc(50% - 420px));
  opacity: 0.8; filter: blur(0.6px);
  animation-duration: 64s; animation-delay: -38s;
}
.bf2 .balloon { animation-duration: 9s; animation-delay: -3s; }
@keyframes balloonRise {
  from { transform: translateY(calc(100vh + 20px)); }
  to { transform: translateY(-120px); }
}
@keyframes balloonSway {
  from { transform: translateX(-14px) rotate(-4deg); }
  to { transform: translateX(14px) rotate(4deg); }
}

.kite-rig {
  position: absolute; width: 50px;
  right: max(9vw, calc(50% - 540px)); top: 27%;
  will-change: transform;
}
.kite-rig .kite { position: relative; filter: drop-shadow(0 8px 10px rgba(47, 61, 153, 0.2)); will-change: transform; }
.kite-lines { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; }
#kiteString { fill: none; stroke: rgba(255, 255, 255, 0.85); stroke-width: 1; }
#kiteTail { fill: none; stroke: #f0569c; stroke-width: 1.6; stroke-linecap: round; }

.plane-trail { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.plane-trail path {
  fill: none; stroke: #e8ae1a; stroke-opacity: 0.72;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
#planePath { stroke-dasharray: 3.5 6; }
.sky .plane {
  position: absolute; left: 0; top: 0; width: 28px;
  filter: drop-shadow(0 5px 5px rgba(47, 61, 153, 0.2));
  will-change: transform;
}

.bird-flight {
  position: absolute; left: 0; top: 4%;
  animation: birdCross 30s linear infinite;
  animation-delay: -9s;
}
.bird-bob { animation: birdBob 3.4s ease-in-out infinite alternate; }
.bird {
  position: relative; width: 40px;
  filter: drop-shadow(0 5px 5px rgba(47, 61, 153, 0.18));
  animation: birdLift 2.4s ease-in-out infinite;
}
.bird .bird-body { position: relative; z-index: 1; }
.bird .bird-wing {
  position: absolute; width: 50%; left: 15%; top: -22%;
  transform-origin: 93% 64%;
  animation: wingFlap 2.4s ease-in-out infinite;
}
.bird .is-back { z-index: 0; left: 8%; top: -28%; filter: brightness(0.72) saturate(1.1); animation-delay: -0.04s; }
.bird .is-front { z-index: 2; }
.bird-lid {
  position: absolute; z-index: 1;
  left: 80.2%; top: 18.7%; width: 5.7%; height: 10.4%;
  border-radius: 50%;
  background: linear-gradient(180deg, #4655a8, #6370c4);
  transform-origin: 50% 0; transform: scaleY(0);
  animation: birdBlink 3.8s infinite;
}
@keyframes birdCross {
  from { transform: translateX(-90px); }
  to { transform: translateX(calc(100vw + 90px)); }
}
@keyframes birdBob {
  0% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(34px) rotate(4deg); }
  100% { transform: translateY(12px) rotate(-1deg); }
}
@keyframes birdLift {
  0%, 15%, 30%, 45%, 60%, 100% { transform: translateY(0); }
  7.5%, 22.5%, 37.5%, 52.5% { transform: translateY(-3px); }
  80% { transform: translateY(2px); }
}
@keyframes wingFlap {
  0%, 15%, 30%, 45% { transform: rotate(22deg); }
  7.5%, 22.5%, 37.5%, 52.5% { transform: rotate(-52deg) scaleY(0.72); }
  60%, 94% { transform: rotate(-4deg); }
  100% { transform: rotate(22deg); }
}
@keyframes birdBlink {
  0%, 88%, 94%, 100% { transform: scaleY(0); }
  91% { transform: scaleY(1); }
}

/* Tap a bubble: it pops with a ring, then a fresh one forms */
.bubble::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  opacity: 0; pointer-events: none;
}
.bubble.is-popped { pointer-events: none; }
.bubble.is-popped .bubble-orb { animation: bubblePop 320ms cubic-bezier(0.2, 0.8, 0.4, 1) forwards; }
.bubble.is-popped::after { animation: popRing 520ms ease-out forwards; }
.bubble.is-reforming .bubble-orb { animation: bubbleForm 900ms cubic-bezier(0.3, 1.5, 0.5, 1) both; }
@keyframes bubblePop {
  0% { transform: scale(1); opacity: 1; }
  60% { transform: scale(1.22); opacity: 0.6; }
  100% { transform: scale(1.35); opacity: 0; }
}
@keyframes popRing {
  0% { transform: scale(0.9); opacity: 0.9; }
  100% { transform: scale(1.7); opacity: 0; }
}
@keyframes bubbleForm {
  from { transform: scale(0.2); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Finish → Welcome: the camera flies into a frosted cloud bank, then out through it onto the sky */
.cloud-sweep {
  position: fixed; inset: 0; z-index: 300;
  overflow: hidden; pointer-events: none;
  contain: strict;
}
.cloud-sweep[hidden] { display: none; }
.sweep-veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(70% 60% at 50% 46%, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, #8fbcf3 0%, #b9d6fa 38%, #dceaff 72%, #f3f7ff 100%);
  -webkit-backdrop-filter: blur(28px) saturate(1.2);
  backdrop-filter: blur(28px) saturate(1.2);
  opacity: 0;
}
.sweep-glow {
  position: absolute; left: 50%; top: 46%;
  width: 140vmax; height: 140vmax; margin: -70vmax 0 0 -70vmax;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.35) 40%, rgba(255, 255, 255, 0) 100%);
  mix-blend-mode: screen;
  opacity: 0;
}
.sweep-cloud {
  position: absolute; left: 50%; top: 50%;
  height: auto;
  opacity: 0;
  will-change: transform, opacity, filter;
}
body.is-sweeping .setup,
body.is-sweeping #try { animation: sweepOut 820ms cubic-bezier(0.55, 0, 0.75, 0.2) both; }
@keyframes sweepOut {
  to { transform: scale(0.94); filter: blur(10px); opacity: 0.2; }
}
body.is-landing .welcome-view { animation: landZoom 1100ms cubic-bezier(0.16, 1, 0.3, 1) both; }
body.is-landing .welcome-dots,
body.is-landing .welcome-cta { animation: landZoom 1100ms cubic-bezier(0.16, 1, 0.3, 1) 120ms both; }
body.is-landing .sky { animation: skySettle 1600ms cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes landZoom {
  from { opacity: 0; transform: scale(0.9); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes skySettle {
  from { transform: scale(1.18); }
  to { transform: none; }
}
body.is-arriving .sky { animation: skyIn 900ms var(--ease) both; }
body.is-arriving .welcome-view { animation: landIn 820ms var(--ease) both; }
@keyframes skyIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes landIn {
  from { opacity: 0; transform: translateY(64px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.welcome-view { display: flex; flex-direction: column; align-items: center; width: 100%; }
.welcome-view.is-in > * { animation: rise 420ms var(--ease) both; }
.welcome-view.is-in > :nth-child(2) { animation-delay: 60ms; }
.welcome-view.is-in > :nth-child(3) { animation-delay: 120ms; }
.welcome h2 {
  margin: 0;
  max-width: 34rem;
  font: 700 2rem/1.15 var(--font-display);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.welcome h2:focus-visible { outline: none; }
.welcome-view p {
  margin: 10px 0 0;
  max-width: 34rem;
  font-size: 16px; line-height: 1.5;
  color: var(--text-soft);
  text-wrap: balance;
}
.welcome-art {
  display: block;
  --art-max-h: 46vh;
  width: min(100%, calc(var(--art-max-h) * 16 / 9));
  aspect-ratio: 16 / 9;
  margin-top: 28px;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius-xl);
  background: #f6f1e8;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-drag: none;
  cursor: grab;
  transition: transform var(--t) var(--ease);
}
.welcome-view { touch-action: pan-y; }
.welcome-view.is-dragging { cursor: grabbing; user-select: none; }
.welcome-view.is-dragging .welcome-art { cursor: grabbing; transition: none; }
.welcome-cta { animation: rise var(--t-slow) var(--ease) both; }
/* Holds its space before the last slide so the page doesn't jump when it appears */
.welcome-cta[hidden] { display: inline-flex !important; visibility: hidden; animation: none; }
.welcome-dots { display: flex; align-items: center; justify-content: center; gap: 4px; }
.welcome-dots button {
  width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: var(--radius-full);
  background: transparent;
  display: grid; place-items: center;
  cursor: pointer;
}
.welcome-dots button span {
  width: 8px; height: 8px; border-radius: var(--radius-full);
  background: #d5d8e4;
  transition: width var(--t) var(--ease), background var(--t) var(--ease);
}
.welcome-dots button[aria-selected="true"] span { width: 22px; background: var(--indigo); }
.welcome-dots button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ---------- Toast + fx ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 200;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 18px 8px 8px;
  border-radius: var(--radius-full);
  background: var(--text); color: #fff;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--e4);
  opacity: 0; transform: translate(-50%, 16px) scale(0.96);
  pointer-events: none;
  transition: opacity var(--t) var(--ease), transform var(--t-slow) var(--ease-pop);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-blr {
  width: 32px; height: 32px; border-radius: 50%;
  background: #fff;
  display: grid; place-items: start center;
  overflow: hidden;
}
.toast-blr img { width: 62px; max-width: none; height: auto; margin-top: -1px; }
.fx { position: fixed; inset: 0; z-index: 300; pointer-events: none; overflow: hidden; }
.confetti { position: absolute; width: 9px; height: 9px; border-radius: 2px; will-change: transform, opacity; }
.confetti.dot { border-radius: 50%; width: 8px; height: 8px; }
.confetti.tri { clip-path: polygon(50% 0, 100% 100%, 0 100%); width: 10px; height: 10px; border-radius: 0; }
.confetti.bar { width: 4px; height: 12px; border-radius: 2px; }

/* ---------- Solo layout: one focused column for short questions ---------- */
@media (min-width: 981px) {
  .setup.solo { width: min(600px, 100%); grid-template-columns: 1fr; height: auto; min-height: 0; }
  /* Reads top to bottom: blr greets, then the question, then the answer */
  .setup.solo .story { padding: 24px 40px 28px; }
  .setup.solo[data-step="role"] .story { padding-top: 32px; }
  .setup.solo .story::after { width: 260px; height: 260px; right: -100px; bottom: -130px; }
  .setup.solo h1 { max-width: none; font-size: 32px; margin-top: 14px; }
  .setup.solo .blr-stage { order: -1; height: 96px; margin: 0; }
  .setup.solo #blrStory { width: 96px; left: -8px; bottom: 0; }
  .setup.solo .blr-react { left: 80px; bottom: 48px; max-width: 360px; }
  .setup.solo .panel { padding: 28px 40px; }
  .setup.solo .scroll { overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .setup.solo .tile { height: 156px; }
  .setup.solo[data-step="role"] { width: min(760px, 100%); }
  .tile-label { min-height: 2.5em; display: flex; align-items: center; justify-content: center; }
  /* Split layout: each column centres its content in the free space instead of hugging the top */
  /* blr sits above the question; the pair is centred as one group */
  .setup:not(.solo) .blr-stage { order: -1; margin-top: auto; height: 176px; }
  .setup:not(.solo) #blrStory { width: 176px; left: -14px; }
  .setup:not(.solo) .blr-react { left: 122px; bottom: 98px; }
  .setup:not(.solo) .story-copy { margin-bottom: auto; padding-bottom: 24px; }
  .setup:not(.solo) .story-copy h1 { margin-top: 20px; }
  .setup:not(.solo) .scroll { display: flex; flex-direction: column; }
  /* auto margins (not justify-content) so overflowing content still scrolls from the top */
  .setup:not(.solo) .scroll > :first-child { margin-top: auto; }
  .setup:not(.solo) .scroll > :last-child { margin-bottom: auto; }
  .setup:not(.solo) { background: transparent; }
  .setup:not(.solo) .panel { background: var(--surface); }
  .setup:not(.solo) .story {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(18px) saturate(1.35);
    -webkit-backdrop-filter: blur(18px) saturate(1.35);
  }
}

/* Morph between solo and split: every part glides to its new place */
.setup { view-transition-name: setup; }
.story { view-transition-name: story; }
#storyCopy { view-transition-name: story-copy; }
.blr-stage { view-transition-name: blr; }
.panel { view-transition-name: panel; }
.progress { view-transition-name: progress; }
.setup.morphing .pane.active,
.setup.morphing .story-copy.swap > * { animation: none; }
::view-transition-old(root),
::view-transition-new(root) { animation: none; }
::view-transition-group(*) {
  animation-duration: 680ms;
  animation-timing-function: cubic-bezier(0.65, 0, 0.15, 1);
}
::view-transition-old(story-copy), ::view-transition-new(story-copy),
::view-transition-old(blr), ::view-transition-new(blr),
::view-transition-old(panel), ::view-transition-new(panel) {
  width: auto; height: auto;
  object-fit: none; object-position: left top;
}
::view-transition-old(blr), ::view-transition-new(blr) { left: auto; right: 0; top: auto; bottom: 0; object-position: right bottom; }
::view-transition-old(panel) { animation: vt-out 260ms var(--ease) both; }
::view-transition-new(panel) { animation: vt-in 460ms var(--ease) 200ms both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .setup { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .story { padding: 28px 24px 24px; }
  .setup .story { display: flex; flex-direction: column; }
  .story::after { width: 220px; height: 220px; right: -90px; bottom: -110px; }
  h1 { font-size: 28px; max-width: none; }
  .setup .blr-stage {
    position: relative;
    order: -1;
    top: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    height: 96px;
    margin: 0;
  }
  .setup #blrStory { width: 96px; left: 0; right: auto; bottom: 0; }
  .setup .blr-react {
    left: 88px;
    right: auto;
    bottom: 44px;
    max-width: min(240px, calc(100% - 110px));
    border-radius: 18px 18px 18px 4px;
    transform-origin: bottom left;
  }
  .panel { padding: 24px; }
  .scroll { overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .try { padding: 24px; }
  .try-foot { flex-direction: column; align-items: stretch; }
  .try-gate { margin: 0; align-self: flex-start; }
  .try-actions { flex-direction: column-reverse; }
  .welcome { padding: 16px 0 24px; }
  .welcome h2 { font-size: 1.6rem; }
  .welcome-art { --art-max-h: 40vh; margin-top: 20px; }
  .bb7 { display: none; }
  .bb1 { width: 30px; left: 10px; top: 3%; }
  .bb4 { width: 32px; left: auto; right: 12px; bottom: 7%; }
  .bird { width: 30px; }
  .balloon-flight { width: 34px; left: 6vw; }
  .bf2 { width: 20px; left: auto; right: 22vw; }
  .kite-rig { width: 32px; right: 22vw; top: 3%; }
  .sky .plane { width: 22px; }
  .w1, .w3 { width: 420px; }
  .welcome-cta { width: 100%; }
  .setup[data-step="role"] .story { padding: 28px 24px; }
}
@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr auto;
    grid-template-areas: "logo lang";
    height: auto;
    padding: 10px 16px 12px;
  }
  .shell { padding: 4px 14px 28px; min-height: 0; }
}
@media (max-width: 600px) {
  .tiles { grid-template-columns: 1fr; gap: 10px; }
  .tile { height: auto; flex-direction: row; justify-content: flex-start; padding: 14px; gap: 14px; }
  .tile-icon { width: 48px; height: 48px; }
  .tile-icon .ico { width: 22px; height: 22px; }
  .tile-label { min-height: 0; }
  .tick { top: 50%; margin-top: -13px; right: 16px; }
  .other-form { padding: 0 14px 14px; flex-direction: column; }
  .sources { grid-template-columns: 1fr; }
  /* One column: event question sits directly under Events */
  .sources > .src { order: calc(var(--i) * 2); }
  .sources > .src-follow { order: 13; }
  .sources > .src-other-reveal { order: 99; }
  .follow-body { padding-left: 16px; }
  .actions { flex-wrap: wrap; }
  .action-hint { width: 100%; }
  .actions .btn { flex: 1; }
  .story { padding-right: 24px; }
  h1 { font-size: 26px; }
  .blr-peek { width: 64px; margin-bottom: -25px; }
  .lang-btn #langLabel { display: none; }
}

html:not(.anim) .card,
html:not(.anim) .story-copy > *,
html:not(.anim) .tile,
html:not(.anim) .other-wrap,
html:not(.anim) .opt-wrap,
html:not(.anim) .chip,
html:not(.anim) .avatar,
html:not(.anim) .src,
html:not(.anim) .pane.active,
html:not(.anim) .try-head > *,
html:not(.anim) .preview { animation: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .sky * { animation: none !important; }
  .bird-flight { transform: translateX(62vw); }
  .balloon-flight { transform: translateY(18vh); }
}

.auth {
  display: grid;
  grid-template-columns: 392px 1fr;
  min-height: 560px;
  overflow: hidden;
  background: transparent;
}
.auth .panel { background: var(--surface); }
.auth .story {
  justify-content: center;
  padding-bottom: 40px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
}
.auth h1 {
  max-width: 12em;
  font-size: 30px;
  line-height: 1.2;
}
.auth-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  box-shadow: var(--e2);
  object-fit: cover;
}
.accent-word {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.accent-word .spark { width: 16px; height: 16px; color: var(--yellow); }
.auth-lead {
  margin: 10px 0 0;
  max-width: 28em;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-soft);
}
.auth .pane { gap: 14px; overflow: auto; }
.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--hover) 90%, white);
}
.auth-tabs button {
  flex: 1;
  height: 36px;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
}
.auth-tabs button[aria-selected="true"] {
  background: var(--surface);
  color: var(--indigo);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.social-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}
.social-btn {
  position: relative;
  width: 76px;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease);
}
.social-btn:hover { transform: translateY(-1px); box-shadow: var(--e2); }
.social-btn:active { transform: scale(0.98); }
.social-copy { display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.social-kicker { font-size: 9px; color: var(--text-soft); }
.social-name { font-size: 9px; font-weight: 600; }
.brand-ico { width: 20px; height: 20px; display: block; }
.brand-ico.key, .brand-ico.apple { color: var(--text); }
.new-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--yellow) 18%, white);
  color: var(--indigo);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.social-btn.is-loading { pointer-events: none; }
.social-btn.is-loading .social-copy,
.social-btn.is-loading .brand-ico { opacity: 0; }
.social-btn.is-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--indigo);
  border-radius: 50%;
  animation: auth-spin 700ms linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }
.or {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.or::before, .or::after { content: ""; height: 1px; background: var(--border); }
.stack { display: flex; flex-direction: column; gap: 8px; }
.lbl { font-size: 12px; font-weight: 500; }
.auth .field { width: 100%; }
.text-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--indigo);
  font-size: 12px;
  font-weight: 500;
}
.text-link:hover { text-decoration: underline; }
.forgot-link { align-self: flex-end; margin-top: -2px; font-size: 11px; }
.forgot-link[hidden] { display: none; }
.text-link.center { display: block; width: 100%; text-align: center; }
.btn-block { width: 100%; letter-spacing: 0.04em; }
.switch-line, .legal {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-soft);
}
.legal {
  max-width: 22rem;
  margin-inline: auto;
  font-size: 8px;
  line-height: 1.55;
}
.legal a { color: var(--indigo); font-weight: 500; }
.back-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: var(--radius-full);
}
.back-btn:hover { background: var(--hover); }
.code-head h2 {
  margin: 0;
  font: 700 18px/1.3 var(--font-display);
  letter-spacing: -0.02em;
}
.code-head p { margin: 6px 0 0; font-size: 12px; line-height: 1.55; color: var(--text-soft); }
.code-badge {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--yellow) 16%, white);
  color: var(--indigo);
}
.code-badge svg { width: 26px; height: 26px; }
.code-input {
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.demo-hint { margin: 0; font-size: 10px; line-height: 1.5; color: var(--text-soft); }
.demo-hint strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); }
.join-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--hover);
}
.join-av {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  background: var(--surface);
  font: 700 13px/1 var(--font-display);
  color: var(--indigo);
}
.join-title { margin: 0; font-size: 14px; font-weight: 600; }
.join-meta { margin: 2px 0 0; font-size: 12px; color: var(--text-soft); }
.card.is-leaving { animation: card-out 260ms var(--ease) both; }
@keyframes card-out { to { opacity: 0; transform: translateY(10px) scale(0.99); } }

@media (max-width: 980px) {
  .auth { grid-template-columns: 1fr; min-height: 0; }
  .auth .story { padding: 28px 24px 32px; }
  .auth h1 { font-size: 26px; max-width: none; }
}
@media (max-width: 600px) {
  .auth .auth-mark { display: none; }
  .auth .panel { padding-inline: 0; }
  .auth .pane { padding-inline: 24px; }
  .auth h1 { font-size: 18px; }
  .auth h1 .spark { width: 12px; height: 12px; }
  .auth-lead { margin-top: 6px; font-size: 12px; line-height: 1.5; }
}
.social-hint { display: none; }
/* Phones: sign-in options become one swipeable row that bleeds to the card edges */
@media (max-width: 600px) {
  .social-row {
    --bleed: 24px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    margin: 0 calc(var(--bleed) * -1);
    padding: 10px var(--bleed) 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--bleed);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--fade-l, 0px), #000 calc(100% - var(--fade-r, 40px)), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 var(--fade-l, 0px), #000 calc(100% - var(--fade-r, 40px)), transparent 100%);
  }
  .social-row::-webkit-scrollbar { display: none; }
  .social-row.at-start { --fade-l: 0px; }
  .social-row:not(.at-start) { --fade-l: 32px; }
  .social-row.at-end { --fade-r: 0px; }
  .social-row::after { content: ""; flex: none; width: 1px; }
  .social-btn { flex: none; width: 76px; min-height: 72px; scroll-snap-align: start; }
  .social-hint {
    display: block;
    position: relative;
    width: 40px; height: 4px;
    margin: 2px auto 0;
    border-radius: var(--radius-full);
    background: #e3e6ee;
    overflow: hidden;
  }
  .social-hint span {
    position: absolute; top: 0; left: 0; bottom: 0;
    width: var(--thumb-w, 50%);
    border-radius: inherit;
    background: var(--indigo);
    transform: translateX(var(--thumb-x, 0px));
    transition: transform 120ms linear;
  }
  .social-hint.is-hidden { visibility: hidden; }
}

/* Register: stacked options, then a short email sign-up form */
.auth:not(.is-register) #emailBtn { display: none; }
.auth.is-register .social-row {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 10px;
  margin: 0;
  padding: 8px 0 0;
  overflow: visible;
  scroll-snap-type: none;
  -webkit-mask-image: none;
  mask-image: none;
}
.auth.is-register .social-row::after { display: none; }
.auth.is-register .social-btn {
  width: 100%;
  min-height: 48px;
  flex-direction: row;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  border-radius: var(--radius-full);
  scroll-snap-align: none;
}
.auth.is-register .social-copy { flex-direction: row; gap: 4px; }
.auth.is-register .social-kicker,
.auth.is-register .social-name { font-size: 14px; font-weight: 600; color: var(--text); }
.auth.is-register #authHome .or,
.auth.is-register #authHome .stack,
.auth.is-register #primaryAuth,
.auth.is-register #switchLine,
.auth.is-register #legal,
.auth.is-register .social-hint { display: none; }
.auth-checks { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.auth-check { align-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 500; line-height: 1.3; }
.auth-check .same-box { width: 16px; height: 16px; border-radius: 4px; margin-top: 0; }
.auth-check .same-box .ico { width: 11px; height: 11px; }
#authEmail .stack { gap: 10px; }
#authEmail .lbl { margin-top: 4px; }
.pw-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pw-row .lbl { display: block; margin-bottom: 8px; }
@media (max-width: 600px) { .pw-row { grid-template-columns: 1fr; } }

/* ---------- Setup on phones: one fixed frame per step ----------
   Every step shares the same card height, so the title starts on the same line as step 1
   and the progress dots never move. Only the answers scroll; title and buttons stay put. */
.swipe-hint { display: none; }
.role-actions { display: none; }
@media (max-width: 600px) {
  /* Role "Other": same row as the role cards, answer opens below, Next stays pinned */
  .role-actions { display: flex; }
  .other-wrap { border-radius: 16px; }
  .other-row { gap: 14px; min-height: 62px; padding: 10px 14px; }
  .other-icon { width: 42px; height: 42px; }
  .other-icon .ico { width: 20px; height: 20px; }
  .other-text { flex-direction: column; align-items: flex-start; gap: 2px; }
  .other-title { font: 600 16px/1.3 var(--font-display); color: var(--text); }
  .other-sub { font-size: 12px; }
  .other-row .radio-dot { width: 26px; height: 26px; opacity: 0; transform: scale(0.6); }
  .other-wrap.is-selected .radio-dot { opacity: 1; transform: none; }
  .other-form { flex-direction: column; padding: 0 14px 14px; }
  .other-form input { flex: none; width: 100%; height: 44px; }
  .other-form #otherGo { display: none; }

  body[data-phase="setup"]:not([data-view="welcome"]) {
    height: 100vh; height: 100dvh;
    display: flex; flex-direction: column;
    overflow: hidden;
  }
  body[data-phase="setup"]:not([data-view="welcome"]) .topbar { flex: none; }
  body[data-phase="setup"]:not([data-view="welcome"]) .shell {
    flex: 1; min-height: 0;
    padding: 0 12px;
    justify-content: center;
  }
  body[data-phase="setup"] #setup,
  body[data-phase="setup"] #try {
    flex: 1 1 auto; min-height: 0;
    height: auto; max-height: 720px;
  }
  body[data-phase="setup"] .progress { flex: none; margin: 0; padding: 8px 0 12px; }

  /* Header: blr, then the question. Same size on every step. */
  .setup { display: flex; flex-direction: column; }
  .setup .story, .setup[data-step="role"] .story { flex: none; padding: 16px 20px 14px; }
  .setup .blr-stage, .setup[data-step="role"] .blr-stage { display: block; height: 64px; }
  .setup[data-step="role"] .story h1 { margin-top: 8px; }
  .setup #blrStory { width: 64px; left: -4px; }
  .setup .blr-react { left: 62px; bottom: 8px; max-width: calc(100% - 66px); padding: 8px 12px; font-size: 13px; }
  .setup h1 { font-size: 22px; line-height: 1.18; }
  .name-line { margin-top: 6px; }
  #nameInput { font-size: 19px; }

  /* Body: answers scroll, buttons stay at the bottom */
  .setup .panel { flex: 1; min-height: 0; padding: 14px 20px 16px; }
  .setup .scroll {
    overflow-y: auto; overscroll-behavior: contain;
    margin: 0 -20px; padding: 4px 20px 24px;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent);
  }
  .setup .actions { padding-top: 12px; flex-wrap: nowrap; }
  .setup .action-hint:not(.is-warn) { display: none; }
  .setup .actions:has(.action-hint.is-warn) { flex-wrap: wrap; }
  .setup .btn { height: 48px; }

  /* Role: tiles start at the top like every other step */
  .role-area {
    justify-content: flex-start; gap: 10px;
    overflow-y: auto; margin: 0 -20px; padding: 4px 20px 12px;
  }
  .tiles { gap: 8px; }
  .tile { padding: 10px 14px; }
  .tile-icon { width: 42px; height: 42px; }

  /* Sliders: lists swipe sideways instead of stacking */
  .swipe-row {
    overflow-x: auto; overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    margin-left: -20px; margin-right: -20px;
    padding-left: 20px; padding-right: 20px;
    scroll-padding-inline: 20px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--fade-l, 0px), #000 calc(100% - var(--fade-r, 36px)), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 var(--fade-l, 0px), #000 calc(100% - var(--fade-r, 36px)), transparent 100%);
  }
  .swipe-row::-webkit-scrollbar { display: none; }
  .swipe-row:not(.at-start) { --fade-l: 28px; }
  .swipe-row.at-end { --fade-r: 0px; }
  .swipe-row > * { scroll-snap-align: start; }
  .swipe-hint {
    display: block; position: relative;
    width: 40px; height: 4px; margin: 8px auto 0;
    border-radius: var(--radius-full);
    background: #e3e6ee; overflow: hidden;
  }
  .swipe-hint span {
    position: absolute; top: 0; left: 0; bottom: 0;
    width: var(--thumb-w, 50%);
    border-radius: inherit; background: var(--indigo);
    transform: translateX(var(--thumb-x, 0px));
    transition: transform 120ms linear;
  }
  .swipe-hint.is-hidden { display: none; }

  /* Avatars: three rows that swipe */
  .look { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .look-pick { min-width: 0; }
  .player { padding: 12px 16px; }
  .player-av { width: 56px; }
  .look-label { margin-bottom: 6px; }
  .avatars.swipe-row {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    justify-items: center;
    gap: 8px 4px;
    overflow: visible;
    margin-left: 0; margin-right: 0;
    padding: 6px 0 2px;
    scroll-snap-type: none;
    mask-image: none;
    -webkit-mask-image: none;
  }
  .avatars.swipe-row .avatar-slot { width: min(42px, 100%); height: auto; aspect-ratio: 1; }

  /* Subjects: two rows that swipe; grades: one row */
  .q-block { margin-bottom: 20px; }
  .q { margin-bottom: 10px; font-size: 14px; }
  .chips.swipe-row {
    display: grid;
    grid-template-rows: repeat(3, auto);
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 8px;
    padding-top: 2px; padding-bottom: 4px;
    padding-right: 26px;
  }
  .chip { height: 40px; }
  /* Grades: one grid of 3 rows; the school-level groups dissolve into it */
  #gradeGroups.swipe-row {
    display: grid;
    grid-template-rows: repeat(3, 40px);
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 8px;
    padding-top: 2px; padding-bottom: 4px;
  }
  #gradeGroups.swipe-row > .grade-group,
  #gradeGroups.swipe-row .grade-row { display: contents; }
  #gradeGroups.swipe-row .chip { scroll-snap-align: start; }
  #gradeGroups .chip.grade { flex: none; width: 40px; }
  #gradeGroups .chip.grade-wide { width: auto; padding: 0 12px; }

  /* Try: same frame, buttons sit where every other step keeps them */
  body[data-phase="setup"] #try { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px 16px; overflow: hidden; }
  #try .try-head { flex: none; }
  #try .preview { flex: 1 1 auto; min-height: 200px; display: flex; }
  #try .preview-media { flex: 1; aspect-ratio: auto; height: auto; max-height: none; }
  #try .preview { background: transparent; }
  #try .preview-media.is-loaded {
    background: linear-gradient(var(--cover-top, #fdf5ec) 0 50%, var(--cover-bottom, #fdf5ec) 50% 100%);
  }
  #try .preview-cover { object-fit: contain; object-position: center; }
  /* Covers with a wide plain background zoom in so the subject fills the width */
  #try .preview-cover.is-focus {
    position: absolute; top: 50%;
    width: calc(100% * var(--zoom)); max-width: none; height: auto;
    left: calc(-100% * var(--zoom) * var(--focus-x));
    transform: translateY(-50%);
    border-radius: 0;
  }
  #try .blr-peek { display: none; }
  #try .preview-fs { white-space: nowrap; }
  #try .try-foot { margin-top: auto; gap: 10px; }
  #try .try-actions { gap: 8px; }
}
