/* Capsule Corner. A dusk street corner, a glowing machine, soft toy-like pals. */
:root {
  --night: #1b1338;
  --plum: #2b2140;
  --ink: #2b2140;
  --cream: #fff8ee;
  --cream-2: #f6ead9;
  --pink: #ff5f93;
  --pink-d: #d93d74;
  --gold: #ffc93c;
  --gold-d: #e39a14;
  --mint: #4fd1c1;
  --mint-d: #2aa594;
  --lilac: #9b8cf2;
  --muted: #6d6384;
  --radius: 26px;
  --font: 'Fredoka', ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
  background: var(--night);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}
a {
  color: inherit;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 4px solid #fff;
  outline-offset: 3px;
  box-shadow: 0 0 0 8px rgba(43, 33, 64, 0.85);
  border-radius: 14px;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Motion off: nothing animates, and every result is still written in words. */
html.calm *,
html.calm *::before,
html.calm *::after {
  animation-duration: 0.001ms !important;
  animation-delay: 0s !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  transition-delay: 0s !important;
}

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 19px;
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 5px 0 var(--gold-d);
  transition:
    transform 0.08s,
    box-shadow 0.08s,
    filter 0.15s;
  text-decoration: none;
}
.btn:hover {
  filter: brightness(1.05);
}
.btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--gold-d);
}
.btn.pink {
  background: var(--pink);
  color: #fff;
  box-shadow: 0 5px 0 var(--pink-d);
}
.btn.pink:active {
  box-shadow: 0 1px 0 var(--pink-d);
}
.btn.mint {
  background: var(--mint);
  box-shadow: 0 5px 0 var(--mint-d);
}
.btn.mint:active {
  box-shadow: 0 1px 0 var(--mint-d);
}
.btn.ghost {
  background: rgba(43, 33, 64, 0.08);
  box-shadow: none;
}
.btn.ghost.on-dark {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.btn.big {
  min-height: 72px;
  font-size: 24px;
  padding: 0 34px;
}
.btn.small {
  min-height: 46px;
  font-size: 16px;
  padding: 0 18px;
}
.btn svg {
  width: 26px;
  height: 26px;
  flex: none;
}

/* ---- app shell ---- */
#app {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #23165a 0%, #4a2488 34%, #a23c8e 60%, #f0736f 82%, #ffb26b 100%);
  overflow: hidden;
}
.top {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 8px max(18px, env(safe-area-inset-left));
  color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
}
.brand svg {
  width: 44px;
  height: 44px;
}
.brand b {
  display: block;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
}
.brand small {
  font-size: 14px;
  opacity: 0.85;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  backdrop-filter: blur(6px);
}
.chip:hover {
  background: rgba(255, 255, 255, 0.26);
}
.chip svg {
  width: 26px;
  height: 26px;
}
.chip .count {
  padding: 1px 9px;
  border-radius: 99px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
}
a.chip {
  text-decoration: none;
}
.chip.lulu {
  background: #e4f4ec;
  color: #1f3b33;
}
.chip.lulu:hover {
  background: #f0faf4;
  filter: none;
}
.chip.lulu svg {
  width: 22px;
  height: 22px;
}

.home {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
}
.stage {
  position: relative;
  min-height: 46vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.backdrop {
  position: absolute;
  inset: -90px 0 0 0;
  width: 100%;
  height: calc(100% + 90px);
}
.twinkle {
  animation: twinkle 3.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.7s);
}
@keyframes twinkle {
  50% {
    opacity: 0.25;
  }
}
.floor-row {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(0px, 2vw, 28px);
  width: 100%;
  padding: 0 12px 4.5%;
}
.machine-btn {
  position: relative;
  height: clamp(210px, min(56vh, 80vw), 520px);
  aspect-ratio: 300 / 420;
  border-radius: 40px;
}
.machine {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.mcap {
  transform-box: fill-box;
  transform-origin: center;
  animation: capbob 4s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.55s);
}
@keyframes capbob {
  50% {
    transform: translateY(-2.5px) rotate(4deg);
  }
}
.rattle .mcap {
  animation: rattle 0.6s ease-in-out;
}
.rattle .mcap:nth-child(odd) {
  animation-direction: reverse;
}
@keyframes rattle {
  25% {
    transform: translate(6px, -14px) rotate(26deg);
  }
  60% {
    transform: translate(-7px, -4px) rotate(-20deg);
  }
}
.m-bulbs circle {
  animation: bulb 1.6s steps(1) infinite;
  animation-delay: calc(var(--i) * -0.23s);
}
@keyframes bulb {
  50% {
    fill: #ffb03a;
  }
}
.m-knob {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.6s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.m-glow {
  animation: glow 4s ease-in-out infinite alternate;
}
@keyframes glow {
  from {
    opacity: 0.6;
  }
}
.buddy-spot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: clamp(120px, min(30vh, 38vw), 290px);
}
.buddy-btn {
  width: 100%;
  border-radius: 40px;
}
.pal {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.pal-bob {
  animation: bob 3.2s ease-in-out infinite;
  transform-origin: 100px 190px;
}
@keyframes bob {
  50% {
    transform: translateY(-4px) scale(1.012, 0.99);
  }
}
.pal-blink {
  transform-box: fill-box;
  transform-origin: center;
  animation: blink 5.2s infinite;
}
@keyframes blink {
  0%,
  94%,
  100% {
    transform: scaleY(1);
  }
  97% {
    transform: scaleY(0.08);
  }
}
.pal.hop .pal-hopper {
  animation: hop 0.62s cubic-bezier(0.3, 1.3, 0.6, 1);
  transform-origin: 100px 190px;
}
@keyframes hop {
  0% {
    transform: scale(1.08, 0.9);
  }
  40% {
    transform: translateY(-30px) scale(0.95, 1.07);
  }
  75% {
    transform: translateY(0) scale(1.06, 0.93);
  }
}
.bubble {
  position: relative;
  max-width: 250px;
  margin-bottom: -6px;
  padding: 10px 16px;
  border-radius: 20px;
  background: #fff;
  font-size: 16px;
  text-align: center;
  box-shadow: 0 6px 0 rgba(27, 19, 56, 0.18);
}
.bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  background: #fff;
  transform: rotate(45deg);
  border-radius: 3px;
}
.nametag {
  margin-top: -6px;
  padding: 4px 16px;
  border-radius: 999px;
  background: rgba(27, 19, 56, 0.6);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}
.mystery {
  width: 62%;
  aspect-ratio: 1;
  margin: 10px 0 18px;
  border-radius: 50%;
  border: 5px dashed rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: clamp(54px, 9vh, 96px);
  font-weight: 700;
  animation: bob 3.2s ease-in-out infinite;
}

/* ---- side panel ---- */
.side {
  background: linear-gradient(180deg, #2a1548 0%, #23165a 100%);
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px max(16px, env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.card {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--cream);
  box-shadow: 0 8px 0 rgba(27, 19, 56, 0.2);
}
.card h2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
}
.card h2 small {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}
.routine {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 20px;
  background: #fff;
}
.routine + .routine {
  margin-top: 10px;
}
.routine .ico {
  flex: none;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: #e9f7ff;
  display: grid;
  place-items: center;
}
.routine .ico svg {
  width: 44px;
  height: 44px;
}
.routine .txt {
  flex: 1;
  min-width: 0;
}
.routine b {
  display: block;
  font-size: 20px;
  font-weight: 600;
}
.routine .state {
  font-size: 15px;
  color: var(--muted);
}
.routine.is-pending {
  background: #fff3cf;
}
.routine.is-pending .state {
  color: #8a5a00;
  font-weight: 600;
}
.routine.is-done {
  background: #e3f8ee;
}
.routine.is-done .state {
  color: #1d7a52;
  font-weight: 600;
}
.tick {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #35c486;
  display: grid;
  place-items: center;
}
.tick svg {
  width: 26px;
  height: 26px;
}
.road {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  position: relative;
}
.road::before {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  top: 30px;
  border-top: 4px dotted #d9cdbb;
}
.stop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  font-size: 13.5px;
  line-height: 1.15;
  color: var(--muted);
}
.stop svg {
  width: 58px;
  height: 58px;
}
.stop.is-next {
  color: var(--ink);
  font-weight: 600;
}
.stop.is-next svg {
  animation: nextbob 2s ease-in-out infinite;
}
@keyframes nextbob {
  50% {
    transform: translateY(-4px) rotate(-4deg);
  }
}
.stop .n {
  font-size: 12px;
  opacity: 0.8;
}
.lulu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: #e4f4ec;
  color: #1f3b33;
  text-decoration: none;
  box-shadow: 0 8px 0 rgba(27, 19, 56, 0.2);
  min-height: 64px;
}
.lulu-link:hover {
  filter: brightness(1.03);
}
.lulu-link:focus-visible {
  outline: 4px solid #fff;
  outline-offset: 3px;
  box-shadow: 0 0 0 8px rgba(43, 33, 64, 0.85), 0 8px 0 rgba(27, 19, 56, 0.2);
}
.lulu-link .pal {
  width: 62px;
  flex: none;
}
.lulu-link b {
  display: block;
  font-size: 19px;
  font-weight: 600;
}
.lulu-link small {
  font-size: 14px;
  color: #4e6b62;
}
.lulu-link .arrow {
  margin-left: auto;
  width: 30px;
  height: 30px;
  flex: none;
}
.lulu-link.in-dex {
  margin-top: 22px;
  max-width: 460px;
}
.fine {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
}
.fine button {
  text-decoration: underline;
  min-height: 44px;
  padding: 0 6px;
}

/* wide screens: Chromebook and iPad in landscape */
@media (min-width: 900px) and (min-aspect-ratio: 11/10) {
  #app {
    height: 100dvh;
  }
  .home {
    position: relative;
    grid-template-columns: minmax(0, 1fr) clamp(360px, 36vw, 470px);
  }
  /* the street runs behind the whole screen, with the cards floating over it */
  .stage {
    position: static;
    min-height: 0;
  }
  .side {
    background: none !important;
  }
  .side {
    overflow-y: auto;
    padding-top: 4px;
    justify-content: center;
  }
  .machine-btn {
    height: clamp(280px, 60vh, 600px);
  }
  .buddy-spot {
    width: clamp(170px, 32vh, 300px);
  }
}
/* tall screens with room: iPad portrait */
@media (min-width: 700px) and (max-aspect-ratio: 11/10) {
  .side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
  }
  .side .span {
    grid-column: 1 / -1;
  }
  .stage {
    min-height: 50vh;
  }
}

/* ---- overlays ---- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(20, 12, 46, 0.72);
  backdrop-filter: blur(5px);
  animation: fadein 0.2s ease-out;
  overflow-y: auto;
}
@keyframes fadein {
  from {
    opacity: 0;
  }
}
.sheet {
  position: relative;
  width: min(100%, 520px);
  padding: 26px 24px 22px;
  border-radius: 34px;
  background: var(--cream);
  box-shadow: 0 12px 0 rgba(0, 0, 0, 0.25);
  text-align: center;
  animation: pop 0.32s cubic-bezier(0.3, 1.4, 0.5, 1);
}
@keyframes pop {
  from {
    transform: scale(0.86) translateY(20px);
    opacity: 0;
  }
}
.sheet h2 {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
}
.sheet .lead {
  margin-top: 6px;
  font-size: 18px;
  color: var(--muted);
}
.sheet .actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}
.hero-ico {
  width: 108px;
  height: 108px;
  margin: 0 auto 8px;
  border-radius: 34px;
  background: #e9f7ff;
  display: grid;
  place-items: center;
}
.hero-ico svg {
  width: 84px;
  height: 84px;
}
.steps {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  text-align: left;
}
.stepchip {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  background: #fff;
  font-size: 18px;
  width: 100%;
  text-align: left;
}
.stepchip i {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid #d7cbe6;
}
.stepchip[aria-pressed='true'] {
  background: #e3f8ee;
}
.stepchip[aria-pressed='true'] i {
  border-color: #35c486;
  background: #35c486 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.4 3.4L15 7' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat;
}

/* Mom's PIN */
.pin .saved {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #e3f8ee;
  color: #1d7a52;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
}
.dots {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 18px 0 6px;
}
.dots i {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 4px solid #cdbfe0;
  transition:
    background 0.12s,
    transform 0.12s;
}
.dots i.on {
  background: var(--ink);
  border-color: var(--ink);
  transform: scale(1.12);
}
.dots.bad {
  animation: shake 0.4s;
}
.dots.bad i {
  border-color: #e0414f;
}
@keyframes shake {
  20%,
  60% {
    transform: translateX(-10px);
  }
  40%,
  80% {
    transform: translateX(10px);
  }
}
.pin-msg {
  min-height: 24px;
  font-size: 16px;
  font-weight: 600;
  color: #c22a3a;
}
.keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 330px;
  margin: 8px auto 0;
}
.key {
  min-height: 64px;
  border-radius: 20px;
  background: #fff;
  font-size: 28px;
  font-weight: 600;
  box-shadow: 0 4px 0 #e2d6c4;
}
.key:hover {
  background: #fffdf6;
}
.key:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #e2d6c4;
}
.key.alt {
  font-size: 16px;
  background: transparent;
  box-shadow: none;
}
.demo-note {
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: 14px;
  background: #efe7fb;
  color: #54407e;
  font-size: 14px;
}

/* ---- the reveal ---- */
.reveal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px;
  color: #fff;
  text-align: center;
  overflow-x: hidden;
  overflow-y: auto;
  justify-content: safe center;
  background: radial-gradient(circle at 50% 42%, #6a3bb0 0%, #2a1a5e 55%, #140c2e 100%);
  animation: fadein 0.25s ease-out;
}
.reveal.kind-gold {
  background: radial-gradient(circle at 50% 42%, #c98a1f 0%, #5a2a6e 55%, #140c2e 100%);
}
.reveal.kind-lulu {
  background: radial-gradient(circle at 50% 42%, #5aa37a 0%, #3b2a7a 55%, #140c2e 100%);
}
.reveal canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}
.rays {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 200vmax;
  height: 200vmax;
  margin: -100vmax;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.11) 0 9deg, transparent 9deg 18deg);
  position: fixed;
  opacity: 0.28;
  transition: opacity 0.5s;
  animation: spin 40s linear infinite;
  pointer-events: none;
}
.reveal.s-show .rays {
  opacity: 1;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.rv-kicker {
  position: relative;
  z-index: 4;
  min-height: 30px;
  font-size: 22px;
  font-weight: 600;
}
.rv-stage {
  position: relative;
  z-index: 2;
  width: min(64vw, 46vh, 440px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.rv-stage > * {
  grid-area: 1 / 1;
}
.rv-stage::before {
  content: '';
  grid-area: 1 / 1;
  align-self: end;
  width: 120%;
  margin: 0 -10% -6%;
  height: 22%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 70%);
}
.rv-capsule {
  width: 78%;
  transform: translateY(-120vh);
}
.capsule {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.cap-glow {
  opacity: 0;
  transition: opacity 0.3s;
}
.cap-top,
.cap-bot {
  transition:
    transform 0.55s cubic-bezier(0.2, 0.9, 0.3, 1),
    opacity 0.55s;
  transform-box: fill-box;
  transform-origin: center;
}
.s-drop .rv-capsule,
.s-wob .rv-capsule,
.s-open .rv-capsule {
  transform: none;
}
.s-drop .rv-capsule {
  animation: drop 0.75s cubic-bezier(0.3, 1.2, 0.5, 1);
}
@keyframes drop {
  0% {
    transform: translateY(-110vh) rotate(-200deg);
  }
  62% {
    transform: translateY(0) rotate(0) scale(1.08, 0.9);
  }
  80% {
    transform: translateY(-9%) scale(0.97, 1.04);
  }
}
.s-wob .rv-capsule {
  animation: wob 0.42s ease-in-out;
}
.s-wob.w2 .rv-capsule {
  animation: wob2 0.42s ease-in-out;
}
.s-wob.w3 .rv-capsule {
  animation: wob3 0.5s ease-in-out;
}
.s-wob .cap-glow {
  opacity: 0.5;
}
.s-wob.w2 .cap-glow {
  opacity: 0.75;
}
.s-wob.w3 .cap-glow {
  opacity: 1;
}
.s-wob.w2 .cap-top {
  transform: translateY(-3px);
}
.s-wob.w3 .cap-top {
  transform: translateY(-7px) rotate(-3deg);
}
@keyframes wob {
  30% {
    transform: rotate(-12deg);
  }
  70% {
    transform: rotate(9deg);
  }
}
@keyframes wob2 {
  30% {
    transform: rotate(15deg) scale(1.04);
  }
  70% {
    transform: rotate(-13deg);
  }
}
@keyframes wob3 {
  20% {
    transform: rotate(-18deg) scale(1.08);
  }
  50% {
    transform: rotate(16deg) scale(1.1);
  }
  80% {
    transform: rotate(-8deg) scale(1.12);
  }
}
.s-open .cap-top {
  transform: translate(-70%, -120%) rotate(-50deg);
  opacity: 0;
}
.s-open .cap-bot {
  transform: translate(60%, 120%) rotate(40deg);
  opacity: 0;
}
.s-open .cap-shadow,
.s-open .cap-glow,
.s-show .rv-capsule {
  opacity: 0;
}
.rv-flash {
  width: 40%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, rgba(255, 255, 255, 0.8) 30%, rgba(255, 255, 255, 0) 70%);
  opacity: 0;
  pointer-events: none;
}
.s-open .rv-flash {
  animation: flash 0.7s ease-out;
}
@keyframes flash {
  0% {
    opacity: 1;
    transform: scale(0.4);
  }
  100% {
    opacity: 0;
    transform: scale(5);
  }
}
.rv-prize {
  width: 100%;
  opacity: 0;
  transform: scale(0.2);
}
.s-open .rv-prize,
.s-show .rv-prize {
  opacity: 1;
  transform: none;
  transition:
    transform 0.6s cubic-bezier(0.3, 1.6, 0.5, 1),
    opacity 0.2s;
}
.rv-prize .pal {
  width: 92%;
  margin: 0 auto;
  filter: drop-shadow(0 10px 30px rgba(255, 255, 255, 0.35));
}
.rv-gear {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4%;
}
.rv-gear .gcard {
  width: 44%;
  aspect-ratio: 1;
  border-radius: 26%;
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.2);
}
.rv-gear .gcard:nth-child(odd) {
  transform: rotate(-5deg);
}
.rv-gear .gcard:nth-child(even) {
  transform: rotate(4deg);
}
.rv-gear .gcard:nth-child(n + 3) {
  margin-top: 4%;
}
.rv-gear svg,
.rv-gear .scene-tile {
  width: 76%;
  height: 76%;
}
.rv-card {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 620px;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
}
.s-show .rv-card {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition:
    opacity 0.35s 0.2s,
    transform 0.35s 0.2s;
}
.ribbon {
  padding: 4px 16px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}
.kind-gold .ribbon {
  background: var(--gold);
}
.kind-lulu .ribbon {
  background: #c8f2d6;
}
.rv-card h2 {
  font-size: clamp(34px, 6vw, 54px);
  font-weight: 700;
  line-height: 1;
}
.rv-card .about {
  font-size: 19px;
  opacity: 0.92;
}
.loot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
}
.lootchip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 15px;
  font-weight: 600;
}
.lootchip span.pic {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.lootchip svg {
  width: 30px;
  height: 30px;
}
.lootchip .scene-tile {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}
.lootchip em {
  font-style: normal;
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--gold);
  color: var(--ink);
}
.s-show .lootchip {
  animation: pop 0.4s cubic-bezier(0.3, 1.5, 0.5, 1) backwards;
  animation-delay: calc(0.45s + var(--i) * 0.12s);
}
.rv-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}
.rv-skip {
  position: fixed;
  z-index: 5;
  right: 16px;
  bottom: calc(14px + env(safe-area-inset-bottom));
}
.s-show .rv-skip {
  display: none;
}
@media (max-height: 620px) {
  .rv-stage {
    width: min(34vh, 300px);
  }
  .rv-card .about {
    font-size: 16px;
  }
}

/* ---- scenes (backdrops a pal can stand in) ---- */
.scene-corner {
  background: linear-gradient(180deg, #4a2488 0%, #c2477f 62%, #ffb26b 100%);
}
.scene-bubbles {
  background:
    radial-gradient(circle at 20% 28%, rgba(255, 255, 255, 0.85) 0 5%, transparent 5.6%),
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.7) 0 8%, transparent 8.6%),
    radial-gradient(circle at 86% 56%, rgba(255, 255, 255, 0.75) 0 4%, transparent 4.6%),
    radial-gradient(circle at 12% 66%, rgba(255, 255, 255, 0.6) 0 7%, transparent 7.6%),
    radial-gradient(circle at 60% 36%, rgba(255, 255, 255, 0.5) 0 3%, transparent 3.6%),
    linear-gradient(180deg, #8fe3ff 0%, #5bb8f0 100%);
}
.scene-stars {
  background:
    radial-gradient(circle at 18% 22%, #fff 0 1.2%, transparent 1.6%),
    radial-gradient(circle at 70% 14%, #ffe27a 0 1.6%, transparent 2%),
    radial-gradient(circle at 86% 40%, #fff 0 1%, transparent 1.4%),
    radial-gradient(circle at 34% 44%, #fff 0 0.9%, transparent 1.3%),
    radial-gradient(circle at 8% 58%, #ffe27a 0 1.3%, transparent 1.7%),
    radial-gradient(circle at 54% 26%, #fff 0 1.1%, transparent 1.5%),
    linear-gradient(180deg, #141a52 0%, #4a257c 100%);
}
.scene-confetti {
  background:
    radial-gradient(circle at 14% 20%, #ff5f93 0 2.4%, transparent 2.8%),
    radial-gradient(circle at 80% 16%, #4fd1c1 0 2.8%, transparent 3.2%),
    radial-gradient(circle at 64% 34%, #ffc93c 0 2%, transparent 2.4%),
    radial-gradient(circle at 26% 46%, #9b8cf2 0 2.6%, transparent 3%),
    radial-gradient(circle at 90% 52%, #ff9a5c 0 2.2%, transparent 2.6%),
    radial-gradient(circle at 44% 12%, #6fb6ff 0 2%, transparent 2.4%),
    linear-gradient(180deg, #fff3d6 0%, #ffd9e6 100%);
}
.scene-garden {
  background:
    radial-gradient(circle at 16% 80%, #ff8fb8 0 3%, transparent 3.4%),
    radial-gradient(circle at 36% 88%, #ffd45e 0 2.6%, transparent 3%),
    radial-gradient(circle at 70% 84%, #fff 0 3%, transparent 3.4%),
    radial-gradient(circle at 88% 90%, #c59bff 0 2.6%, transparent 3%),
    linear-gradient(180deg, #bff0ff 0%, #d9f7c8 55%, #8fd98a 56%, #6cc873 100%);
}
.scene-tile {
  display: block;
  border-radius: 18px;
}

/* ---- studio ---- */
.full {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  flex-direction: column;
  background: #2a1a5e;
  color: #fff;
  animation: fadein 0.2s ease-out;
}
.full-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 16px 8px;
}
.full-top h2 {
  flex: 1;
  font-size: 26px;
  font-weight: 700;
}
.studio {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(220px, 42%) 1fr;
  gap: 12px;
  padding: 0 16px calc(14px + env(safe-area-inset-bottom));
}
.display {
  position: relative;
  border-radius: 34px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 12px 14px;
  min-height: 0;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.25);
}
.display::after {
  content: '';
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -14%;
  height: 34%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
}
.display .pal {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  width: auto;
  max-width: 100%;
}
.namerow {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.namerow input {
  width: min(56vw, 230px);
  min-height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  border: 0;
  background: #fff;
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  text-align: center;
}
.options {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 30px;
  background: var(--cream);
  color: var(--ink);
  overflow: hidden;
}
.tabs {
  display: flex;
  gap: 6px;
  padding: 10px 10px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab {
  flex: 1 0 auto;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 16px 16px 0 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--muted);
  background: var(--cream-2);
}
.tab[aria-selected='true'] {
  background: #fff;
  color: var(--ink);
}
.optgrid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  align-content: start;
  gap: 10px;
  padding: 12px;
  background: #fff;
}
.opt {
  position: relative;
  aspect-ratio: 1;
  border-radius: 22px;
  background: #f6f0fb;
  display: grid;
  place-items: center;
  padding: 8px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  line-height: 1.1;
  transition: transform 0.1s;
}
.opt:hover {
  background: #efe5fa;
}
.opt:active {
  transform: scale(0.95);
}
.opt svg,
.opt .scene-tile {
  width: 74%;
  height: 74%;
}
.opt .sw {
  width: 66%;
  height: 66%;
  border-radius: 50%;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.12), inset 0 5px 0 rgba(255, 255, 255, 0.35);
}
.opt[aria-pressed='true'] {
  background: #fff3cf;
  box-shadow: inset 0 0 0 4px var(--gold);
}
.opt[aria-pressed='true']::after {
  content: '';
  position: absolute;
  right: 6px;
  top: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #35c486 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.4 3.4L15 7' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat;
}
.opt.locked {
  background: #efeaf3;
  color: #9a90ab;
}
.opt.locked svg {
  filter: brightness(0) opacity(0.14);
}
.opt.new::before {
  content: 'NEW';
  position: absolute;
  left: 6px;
  top: 6px;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--pink);
  color: #fff;
  font-size: 11px;
  z-index: 1;
}
.opt .none {
  width: 54%;
  height: 54%;
  border-radius: 50%;
  border: 5px solid #cdbfe0;
  position: relative;
}
.opt .none::after {
  content: '';
  position: absolute;
  inset: 44% -8% auto;
  border-top: 5px solid #cdbfe0;
  transform: rotate(-45deg);
}
.hint {
  padding: 8px 14px 12px;
  background: #fff;
  font-size: 15px;
  color: var(--muted);
  min-height: 38px;
}
@media (min-width: 900px) and (min-aspect-ratio: 11/10) {
  .studio {
    grid-template-rows: 1fr;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 18px;
    padding: 4px 24px 22px;
  }
  .optgrid {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  }
}

/* ---- collection ---- */
.dex {
  flex: 1;
  overflow-y: auto;
  padding: 4px 18px calc(24px + env(safe-area-inset-bottom));
}
.dex h3 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 18px 0 10px;
  font-size: 22px;
  font-weight: 700;
}
.dex h3 small {
  font-size: 15px;
  font-weight: 500;
  opacity: 0.8;
}
.palgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.palcard {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  padding: 10px 10px 12px;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.22);
}
.palcard small {
  display: block;
  font-size: 13px;
  font-weight: 500;
  opacity: 0.9;
}
.palcard.unknown {
  background: #3a2a70;
  color: #b9addf;
}
.palcard .badge {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 1px 9px;
  border-radius: 99px;
  background: var(--gold);
  color: var(--ink);
  font-size: 12px;
}
.palcard .qm {
  position: absolute;
  inset: 0 0 26px;
  display: grid;
  place-items: center;
  font-size: 44px;
  font-weight: 700;
  color: #6f61a8;
}
.geargrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}
.gearcell {
  aspect-ratio: 1;
  border-radius: 20px;
  background: #fff;
  display: grid;
  place-items: center;
}
.gearcell svg,
.gearcell .scene-tile {
  width: 72%;
  height: 72%;
}
.gearcell.locked {
  background: #3a2a70;
}
.gearcell.locked svg {
  filter: brightness(0) invert(1) opacity(0.16);
}
.gearcell.locked .scene-tile {
  opacity: 0.15;
  filter: grayscale(1);
}

/* ---- toast ---- */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 90;
  transform: translate(-50%, 24px);
  max-width: min(92vw, 520px);
  padding: 12px 20px;
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.build .sheet {
  text-align: left;
}
.build p {
  margin-top: 8px;
  font-size: 16px;
  color: var(--muted);
}
.build code {
  padding: 1px 8px;
  border-radius: 8px;
  background: #efe7fb;
  color: #54407e;
  font-weight: 600;
  font-family: inherit;
}

/* small phones (Mom's phone) */
@media (max-width: 480px) {
  .brand small {
    display: none;
  }
  .brand b {
    font-size: 20px;
  }
  .brand svg {
    width: 36px;
    height: 36px;
  }
  .chip {
    padding: 0 14px;
    font-size: 15px;
  }
  .top {
    gap: 8px;
  }
  .bubble {
    font-size: 14.5px;
    padding: 8px 12px;
  }
  .rv-stage {
    width: min(58vw, 34vh);
  }
  .rv-card h2 {
    font-size: 34px;
  }
  .btn.big {
    min-height: 62px;
    font-size: 21px;
    padding: 0 26px;
  }
  .key {
    min-height: 58px;
  }
  .sheet {
    padding: 20px 16px 16px;
  }
}

/* ================= round 2: motion and life ================= */
#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 80;
  pointer-events: none;
}

/* ---- creature motion: every part moves on its own ---- */
.p-ear-l,
.p-ear-r,
.p-tail,
.p-top,
.p-gill,
.p-twinkle,
.pal-arm-r,
.pal-look,
.gear {
  transform-box: fill-box;
}
.pal-look {
  transform: translate(calc(var(--lx, 0) * 1px), calc(var(--ly, 0) * 1px));
  transition: transform 0.16s ease-out;
}
.pal-bob {
  animation: breathe 3.4s ease-in-out infinite;
}
@keyframes breathe {
  50% {
    transform: translateY(-3px) scale(1.018, 0.985);
  }
}
.p-ear-l {
  transform-origin: 70% 100%;
  animation: earL 5.6s ease-in-out infinite;
}
.p-ear-r {
  transform-origin: 30% 100%;
  animation: earR 5.6s ease-in-out infinite 0.4s;
}
@keyframes earL {
  0%,
  82%,
  100% {
    transform: rotate(0);
  }
  87% {
    transform: rotate(-9deg);
  }
  92% {
    transform: rotate(4deg);
  }
}
@keyframes earR {
  0%,
  82%,
  100% {
    transform: rotate(0);
  }
  87% {
    transform: rotate(9deg);
  }
  92% {
    transform: rotate(-4deg);
  }
}
.kind-bunny .p-ear-l {
  animation: flopL 3.6s ease-in-out infinite alternate;
}
.kind-bunny .p-ear-r {
  animation: flopR 3.6s ease-in-out infinite alternate 0.3s;
}
@keyframes flopL {
  to {
    transform: rotate(-7deg);
  }
}
@keyframes flopR {
  to {
    transform: rotate(8deg);
  }
}
.kind-frog .p-ear-l,
.kind-frog .p-ear-r {
  animation: none;
}
.kind-axolotl .p-ear-l,
.kind-axolotl .p-ear-r {
  animation: none;
}
.p-gill {
  transform-origin: center;
  animation: gill 2.2s ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * -0.5s);
}
@keyframes gill {
  to {
    transform: scale(1.1, 0.8);
  }
}
.p-tail {
  transform-origin: 0% 100%;
  animation: wag 1.5s ease-in-out infinite alternate;
}
.kind-bunny .p-tail {
  transform-origin: center;
  animation: wiggle 0.9s ease-in-out infinite alternate;
}
@keyframes wag {
  from {
    transform: rotate(-4deg);
  }
  to {
    transform: rotate(9deg);
  }
}
@keyframes wiggle {
  to {
    transform: translateX(3px) scale(1.08);
  }
}
.p-top {
  transform-origin: 30% 100%;
  animation: sprout 2.8s ease-in-out infinite alternate;
}
@keyframes sprout {
  from {
    transform: rotate(-7deg);
  }
  to {
    transform: rotate(8deg);
  }
}
.p-twinkle {
  transform-origin: center;
  animation: startw 1.4s ease-in-out infinite alternate;
}
@keyframes startw {
  from {
    transform: scale(0.7) rotate(-20deg);
  }
  to {
    transform: scale(1.2) rotate(20deg);
  }
}
.holo {
  mix-blend-mode: screen;
  animation: holo 4.2s ease-in-out infinite;
}
@keyframes holo {
  0%,
  45% {
    transform: skewX(-18deg) translateX(0);
  }
  100% {
    transform: skewX(-18deg) translateX(560px);
  }
}
.gear.pop {
  transform-origin: center;
  animation: gearpop 0.55s cubic-bezier(0.3, 1.7, 0.5, 1);
}
@keyframes gearpop {
  0% {
    transform: translateY(-46px) scale(1.8) rotate(-18deg);
    opacity: 0;
  }
  55% {
    opacity: 1;
  }
}
.pal.hop .pal-arm-r {
  transform-origin: 20% 90%;
  animation: wave 0.3s ease-in-out 3 alternate;
}
@keyframes wave {
  to {
    transform: rotate(-38deg) translateY(-6px);
  }
}
.pal.hop .pal-shadow {
  animation: shadowhop 0.62s ease-in-out;
  transform-origin: 100px 197px;
}
@keyframes shadowhop {
  40% {
    transform: scale(0.7);
    opacity: 0.12;
  }
}

/* ---- the Corner comes alive ---- */
.bd-sky,
.bd-far,
.bd-near,
.bd-lights {
  transition: transform 0.5s ease-out;
}
.bd-sky {
  transform: translate(calc(var(--px, 0) * -5px), calc(var(--py, 0) * -3px));
}
.bd-far {
  transform: translate(calc(var(--px, 0) * -11px), calc(var(--py, 0) * -4px));
}
.bd-near {
  transform: translate(calc(var(--px, 0) * -20px), calc(var(--py, 0) * -6px));
}
.bd-lights {
  transform: translate(calc(var(--px, 0) * -28px), calc(var(--py, 0) * -8px));
}
.shoot {
  position: absolute;
  z-index: 1;
  left: 8%;
  top: 6%;
  width: 150px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, #fff);
  opacity: 0;
  transform: rotate(18deg);
  animation: shoot 11s linear infinite 3s;
  pointer-events: none;
}
@keyframes shoot {
  0% {
    opacity: 0;
    transform: translate(0, 0) rotate(18deg);
  }
  2% {
    opacity: 1;
  }
  9% {
    opacity: 0;
    transform: translate(46vw, 15vw) rotate(18deg);
  }
  100% {
    opacity: 0;
    transform: translate(46vw, 15vw) rotate(18deg);
  }
}
.fly {
  position: absolute;
  z-index: 2;
  left: calc(6% + var(--i) * 11.5%);
  bottom: calc(16% + (var(--i) * 37%) / 8);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff6b8;
  box-shadow: 0 0 12px 4px rgba(255, 240, 150, 0.7);
  animation:
    flyx calc(7s + var(--i) * 0.9s) ease-in-out infinite alternate,
    flyglow 2.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * -1.3s);
  pointer-events: none;
}
@keyframes flyx {
  0% {
    transform: translate(0, 0);
  }
  33% {
    transform: translate(34px, -26px);
  }
  66% {
    transform: translate(-18px, -44px);
  }
  100% {
    transform: translate(26px, -12px);
  }
}
@keyframes flyglow {
  50% {
    opacity: 0.2;
  }
}
.machine-btn {
  transition: transform 0.25s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.machine-btn:hover {
  transform: scale(1.02);
}
.machine-btn:active {
  transform: scale(0.97, 1.02);
}
.machine-btn.thump {
  animation: thump 0.5s cubic-bezier(0.3, 1.4, 0.5, 1);
}
@keyframes thump {
  25% {
    transform: scale(1.05, 0.94) rotate(-2deg);
  }
  55% {
    transform: scale(0.97, 1.04) rotate(2deg);
  }
}
.crew {
  display: flex;
  align-items: flex-end;
  flex: none;
}
.crewpal {
  flex: none;
  width: clamp(54px, 11vh, 112px);
  margin: 0 -9px;
  border-radius: 30px;
  animation: wander calc(7s + var(--i) * 1.7s) ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * -2.4s);
}
/* the ones further back are smaller and stand a little higher up the pavement */
.crewpal:nth-child(2) {
  width: clamp(44px, 9vh, 92px);
  margin-bottom: 5%;
  filter: brightness(0.92);
}
.crewpal:nth-child(3) {
  width: clamp(38px, 8.5vh, 86px);
  margin-bottom: 9%;
  filter: brightness(0.86);
}
.crew-l {
  flex-direction: row-reverse;
  margin-right: clamp(-34px, -3vh, -12px);
}
.crew-r {
  margin-left: clamp(-30px, -2.5vh, -10px);
}
@keyframes wander {
  0% {
    transform: translateX(0);
  }
  45%,
  55% {
    transform: translateX(calc(var(--d) * 1px));
  }
  100% {
    transform: translateX(calc(var(--d) * -0.6px));
  }
}
@media (max-width: 480px) {
  .crewpal {
    width: 13vw;
    margin: 0 -20px;
  }
  .crewpal:nth-child(n + 2) {
    display: none;
  }
}
.buddy-btn {
  transition: transform 0.2s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.buddy-btn:active {
  transform: scale(1.05, 0.94);
}
.buddy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -8px;
  position: relative;
  z-index: 2;
}
.buddy-row > * {
  flex: none;
  white-space: nowrap;
}
.buddy-row .nametag {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.bond {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #ffb3cd;
  font-size: 14px;
}
.bond svg {
  width: 15px;
  height: 15px;
}
.card {
  animation: cardin 0.55s cubic-bezier(0.3, 1.3, 0.5, 1) backwards;
}
.side > :nth-child(2) {
  animation-delay: 0.07s;
}
.side > :nth-child(3) {
  animation-delay: 0.14s;
}
.side > :nth-child(4) {
  animation-delay: 0.21s;
}
.no-intro .card {
  animation: none;
}
@keyframes cardin {
  from {
    opacity: 0;
    transform: translateY(26px) scale(0.96);
  }
}
.stop.is-next svg {
  filter: drop-shadow(0 0 10px rgba(255, 201, 60, 0.9));
}

/* ---- the reveal, as a little film ---- */
.rv-machine {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: min(60vw, 50vh, 400px);
  transform: translate(-50%, -46%) scale(0.6);
  opacity: 0;
  transition:
    transform 0.9s cubic-bezier(0.5, 0, 0.3, 1),
    opacity 0.5s;
  pointer-events: none;
}
.s-machine .rv-machine {
  opacity: 1;
  transform: translate(-50%, -46%);
  transition:
    transform 0.6s cubic-bezier(0.3, 1.4, 0.5, 1),
    opacity 0.3s;
}
.s-machine .rv-machine .machine {
  animation: churn 0.28s ease-in-out infinite alternate;
}
@keyframes churn {
  from {
    transform: rotate(-1.4deg) translateY(1px);
  }
  to {
    transform: rotate(1.4deg) translateY(-2px);
  }
}
.s-machine .rv-machine .m-knob {
  animation: knobspin 0.9s linear infinite;
}
@keyframes knobspin {
  to {
    transform: rotate(360deg);
  }
}
.s-machine .rv-machine .mcap {
  animation: rattle 0.5s ease-in-out infinite;
}
.s-drop .rv-machine,
.s-wob .rv-machine {
  transform: translate(-50%, -150%) scale(2.2);
  opacity: 0;
}
.s-drop .rv-capsule {
  animation: emerge 1s cubic-bezier(0.3, 1.25, 0.5, 1);
}
@keyframes emerge {
  0% {
    transform: translateY(70%) scale(0.16) rotate(-260deg);
  }
  55% {
    transform: translateY(-14%) scale(1.1, 0.94) rotate(0);
  }
  76% {
    transform: translateY(4%) scale(0.96, 1.05);
  }
}
.rv-beams {
  width: 230%;
  aspect-ratio: 1;
  margin: -65%;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.5) 0 6deg, transparent 6deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 12%, transparent 62%);
  mask: radial-gradient(circle, #000 12%, transparent 62%);
  opacity: 0;
  transform: scale(0.5);
  transition:
    opacity 0.4s,
    transform 0.5s;
  animation: spin 9s linear infinite;
  pointer-events: none;
}
.kind-gold .rv-beams {
  background: repeating-conic-gradient(rgba(255, 220, 120, 0.7) 0 6deg, transparent 6deg 22deg);
}
.s-wob .rv-beams {
  opacity: 0.3;
  transform: scale(0.62);
}
.s-wob.w2 .rv-beams {
  opacity: 0.55;
  transform: scale(0.8);
}
.s-wob.w3 .rv-beams {
  opacity: 0.95;
  transform: scale(1);
}
.s-open .rv-beams,
.s-who .rv-beams {
  opacity: 0.8;
  transform: scale(1.25);
}
.s-show .rv-beams {
  opacity: 0.4;
  transform: scale(1.15);
}
.rv-capsule .capsule {
  filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0));
  transition: filter 0.4s;
}
.s-wob.w2 .capsule {
  filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.7));
}
.s-wob.w3 .capsule {
  filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.95)) brightness(1.15);
}
.s-who .rv-capsule,
.s-who .cap-top,
.s-who .cap-bot {
  opacity: 0;
}
.s-who .rv-capsule {
  transform: none;
}
.rv-prize .pal {
  transition: filter 0.7s ease-out;
}
.rv-prize.is-mystery .pal {
  filter: brightness(0) drop-shadow(0 0 22px rgba(255, 255, 255, 0.95));
}
.s-who .rv-prize {
  opacity: 1;
  transform: none;
  transition:
    transform 0.6s cubic-bezier(0.3, 1.6, 0.5, 1),
    opacity 0.2s;
  animation: whopulse 0.9s ease-in-out infinite alternate;
}
@keyframes whopulse {
  to {
    transform: scale(1.05);
  }
}
.reveal.shake {
  animation: camshake 0.45s linear;
}
@keyframes camshake {
  15% {
    transform: translate(-9px, 5px);
  }
  30% {
    transform: translate(8px, -6px);
  }
  45% {
    transform: translate(-6px, -4px);
  }
  60% {
    transform: translate(5px, 4px);
  }
  80% {
    transform: translate(-2px, 2px);
  }
}
.rv-card h2 .w {
  display: inline-block;
  white-space: nowrap;
}
.rv-card h2 .l {
  display: inline-block;
}
.s-show .rv-card h2 .l {
  animation: letter 0.55s cubic-bezier(0.3, 1.8, 0.5, 1) backwards;
  animation-delay: calc(0.25s + var(--i) * 0.045s);
}
@keyframes letter {
  from {
    opacity: 0;
    transform: translateY(46px) scale(0.3) rotate(-14deg);
  }
}
.rv-card h2 {
  text-shadow: 0 5px 0 rgba(20, 12, 46, 0.45);
}
.rv-stars {
  display: flex;
  gap: 4px;
  justify-content: center;
}
.rv-stars svg {
  width: 30px;
  height: 30px;
}
.s-show .rv-stars svg {
  animation: pop 0.45s cubic-bezier(0.3, 1.8, 0.5, 1) backwards;
  animation-delay: calc(0.9s + var(--i) * 0.14s);
}
.s-show .rv-prize .pal {
  filter: drop-shadow(0 10px 34px rgba(255, 255, 255, 0.4));
}

/* ---- studio stage lighting ---- */
.display::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -10%;
  width: 90%;
  height: 120%;
  transform: translateX(-50%);
  background: conic-gradient(from 160deg at 50% 0%, transparent 0 4deg, rgba(255, 255, 255, 0.2) 4deg 36deg, transparent 36deg);
  pointer-events: none;
}
.opt {
  animation: optin 0.35s cubic-bezier(0.3, 1.5, 0.5, 1) backwards;
  animation-delay: calc(var(--i, 0) * 0.025s);
}
@keyframes optin {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
}

/* ---- collection cards ---- */
.palcard {
  transition: transform 0.2s cubic-bezier(0.3, 1.5, 0.5, 1);
}
button.palcard:hover {
  transform: translateY(-6px) rotate(-1.5deg);
}
.palcard .no {
  position: absolute;
  right: 10px;
  top: 8px;
  font-size: 12px;
  opacity: 0.85;
}
.palcard.rare::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(159, 243, 255, 0.35) 45%, rgba(255, 255, 255, 0.55) 50%, rgba(255, 179, 240, 0.35) 55%, transparent 70%);
  background-size: 300% 100%;
  animation: sheen 3.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sheen {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -60% 0;
  }
}

/* When the name card arrives, the camera pulls back so the buttons are on screen without scrolling. */
.rv-stage {
  transition: width 0.6s cubic-bezier(0.3, 1.2, 0.5, 1);
}
.s-show .rv-stage {
  width: min(42vw, 30vh, 300px);
}
.rv-card {
  gap: 6px;
}
@media (max-height: 700px) {
  .s-show .rv-stage {
    width: min(36vw, 26vh);
  }
  .rv-card h2 {
    font-size: clamp(30px, 5vw, 44px);
  }
  .rv-stars svg {
    width: 24px;
    height: 24px;
  }
}

.unlock {
  max-width: 28rem;
  margin: 4rem auto;
}

.unlock-form {
  display: grid;
  gap: 0.75rem;
}

.unlock-form input {
  width: 100%;
  padding: 0.65rem;
  font: inherit;
}
