:root {
  --purple: #5f4686;
  --purple-deep: #3b2a5a;
  --purple-000: #ece3fb;
  --purple-200: #aa8adf;
  --purple-300: #8564bb;
  --blue-gray-100: #f7f9fe;
  --blue-gray-400: #515e74;
  --blue-gray-500: #353e4d;
  --teal: #8abfbd;
  --dc-blue: #07baef;
  --dc-green: #82c24a;
  --dc-yellow: #feea47;
  --white: #ffffff;
  --kiosk-w: 1920;
  --kiosk-h: 1080;
}

@font-face {
  font-family: "Nulshock";
  src: url("assets/fonts/Nulshock-Bd.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: Inter, system-ui, sans-serif;
  background: #1a1228;
  color: var(--white);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.viewport {
  height: 100%;
  display: grid;
  place-items: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: linear-gradient(160deg, #2a1d45 0%, #1a1228 100%);
}

.stage {
  position: relative;
  width: min(
    100vw - 24px,
    calc((100vh - 24px) * (var(--kiosk-w) / var(--kiosk-h))),
    calc(var(--kiosk-w) * 1px)
  );
  aspect-ratio: var(--kiosk-w) / var(--kiosk-h);
  max-height: min(100vh - 24px, calc(var(--kiosk-h) * 1px));
  border-radius: 0;
  overflow: hidden;
  background: var(--purple-deep);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  container-type: inline-size;
}

.home {
  display: flex;
  flex-direction: column;
}

.home-main {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 0;
  padding: 0 0 clamp(2rem, 3.3cqi, 4rem);
}

.bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
  z-index: 0;
}

.bg-home {
  object-fit: cover;
  object-position: center top;
}

.home-floor-glow {
  display: none;
}

.brand-logo {
  display: block;
  width: clamp(10rem, 23.5cqi, 28.25rem);
  height: auto;
  filter: drop-shadow(0 0 18px rgba(7, 186, 239, 0.35));
}

.hero h1,
.home-tagline {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  color: var(--blue-gray-100);
  font-family: "Nulshock", Inter, system-ui, sans-serif;
  font-size: clamp(1.75rem, 4.6cqi, 5.5rem);
  font-weight: 700;
  line-height: 1.2;
  text-transform: none;
  text-align: center;
  width: 100%;
  padding: 0 clamp(1.5rem, 2.7cqi, 4rem);
}

.brand-chip {
  display: grid;
  place-items: center;
  background: transparent;
  border-radius: 0;
  padding: 0;
  mix-blend-mode: normal;
}

.choices {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 2.13cqi, 2.55rem);
  padding: 0 clamp(2rem, 4cqi, 5rem);
  width: min(80.5cqi, 1545px);
  margin: 0 auto;
}

.choice {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(9rem, 16.6cqi, 20rem);
  aspect-ratio: 711 / 319;
  text-decoration: none;
  transform-origin: center center;
  will-change: transform, filter;
  animation:
    choice-scale-pulse 4s cubic-bezier(0.37, 0, 0.63, 1) infinite,
    choice-glow-pulse 3.2s ease-in-out infinite;
}

.choice-label {
  font-size: clamp(1.35rem, 3.2cqi, 3.83rem);
  font-weight: 700;
  line-height: 1.208;
  text-align: center;
  white-space: nowrap;
  color: var(--white);
}

.top-nav {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  padding: clamp(1.25rem, 2.7cqi, 4rem);
}

.back-link {
  margin-right: auto;
  color: var(--white);
  text-decoration: none;
  font-size: clamp(0.9rem, 2cqi, 1.25rem);
  font-weight: 700;
  opacity: 0.9;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: clamp(0.45rem, 1cqi, 0.75rem);
  padding: clamp(0.35rem, 0.7cqi, 0.625rem);
  border-radius: 999px;
  background: var(--purple);
  box-shadow: 3px 2.5px 2.5px rgba(50, 42, 87, 0.55);
}

.lang-btn {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: clamp(0.55rem, 1.4cqi, 1.25rem) clamp(1.1rem, 2.4cqi, 1.75rem);
  font: inherit;
  font-size: clamp(0.85rem, 1.9cqi, 2.25rem);
  line-height: 1.2;
  color: var(--white);
  cursor: pointer;
}

.lang-btn.is-active {
  background: var(--white);
  color: var(--purple);
}

.choice-solo {
  color: var(--dc-blue);
  animation-delay: 0s, 0s;
  --choice-glow: rgba(7, 186, 239, 0.55);
  --choice-glow-hot: rgba(7, 186, 239, 1);
}

.choice-together {
  color: var(--dc-green);
  animation-delay: -2s, -1.6s;
  --choice-glow: rgba(130, 194, 74, 0.55);
  --choice-glow-hot: rgba(130, 194, 74, 1);
}

.choice:active {
  animation: none;
  transform: scale(0.985);
  filter: drop-shadow(0 0 16px var(--choice-glow-hot));
}

@keyframes choice-scale-pulse {
  0%,
  100% {
    transform: scale(0.975);
  }
  50% {
    transform: scale(1.02);
  }
}

@keyframes choice-glow-pulse {
  0%,
  100% {
    filter: drop-shadow(0 0 10px var(--choice-glow));
  }
  50% {
    filter: drop-shadow(0 0 22px var(--choice-glow-hot));
  }
}

@media (prefers-reduced-motion: reduce) {
  .choice {
    animation: none;
    filter: drop-shadow(0 0 14px var(--choice-glow));
  }
}

.choice-shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

/* Figma mirrors the together frame (rotate 180 + flip) */
.choice-together .choice-shape {
  transform: scaleX(-1);
}

.choice-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.6rem, 1.4cqi, 1.25rem);
  padding: 1rem;
}

.choice-icon {
  width: clamp(2.75rem, 4.65cqi, 5.6rem);
  height: auto;
}

.choice-icon.users {
  width: clamp(3rem, 5.65cqi, 6.8rem);
}

/* Wristband scan screens (solo / together) */
.wristband {
  display: flex;
  flex-direction: column;
  background: #4b2c7f;
}

.bg-wristband {
  object-fit: cover;
  object-position: center center;
}

.top-nav-split {
  justify-content: space-between;
}

.top-nav-end {
  justify-content: flex-end;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: clamp(0.55rem, 1.1cqi, 1rem) clamp(1rem, 2.2cqi, 2rem);
  border: 1.5px solid var(--purple);
  border-radius: 4px;
  color: var(--purple);
  text-decoration: none;
  font-size: clamp(0.9rem, 1.9cqi, 2.25rem);
  line-height: 1.5;
  font-weight: 400;
}

.back-arrow {
  display: block;
  width: clamp(0.9rem, 1.8cqi, 1.6rem);
  height: auto;
  transform: scaleY(-1);
}

.back-x {
  display: none;
}

.lang-on-dark {
  background: var(--purple);
}

.lang-on-dark .lang-btn {
  color: var(--white);
}

.lang-on-dark .lang-btn.is-active {
  background: var(--white);
  color: var(--purple);
}

.wristband-area {
  position: relative;
  z-index: 2;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 0 clamp(0.5rem, 2cqi, 1.5rem) clamp(0.75rem, 2.7cqi, 4rem);
  min-height: 0;
}

.wristband-tap {
  position: relative;
  width: min(72cqi, 40rem);
  max-height: 100%;
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.wristband-tap:active:not(:disabled) {
  transform: scale(0.985);
}

.wristband-radar {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  transform-origin: center center;
  will-change: transform;
  animation: soundwave-breathe 2s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.wristband-soundwave {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
  will-change: opacity;
}

/* Idle loop: dark ring ? Figma pulse #8564BB (2078:3773) */
.wristband-soundwave-idle {
  z-index: 1;
  opacity: 1;
  animation: soundwave-color-idle 2s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.wristband-soundwave-pulse {
  z-index: 2;
  opacity: 0;
  animation: soundwave-color-pulse 2s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

/* Confirmed ? dark ring + white check (Figma 1943:2114) */
.wristband.is-confirmed .wristband-radar {
  animation: none;
  transform: scale(1);
}

.wristband.is-confirmed .wristband-soundwave-idle {
  animation: none;
  opacity: 1;
}

.wristband.is-confirmed .wristband-soundwave-pulse {
  animation: none;
  opacity: 0;
}

.wristband-core {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: min(42%, 16rem);
  color: var(--blue-gray-100);
}

.wristband-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.45rem, 1.2cqi, 0.9rem);
  width: 100%;
  grid-area: 1 / 1;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.wristband-state-idle {
  z-index: 1;
}

.wristband-state-done {
  z-index: 0;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.82);
  pointer-events: none;
}

.wristband-icon {
  width: 73%;
  height: auto;
  display: block;
  animation: wristband-icon-pulse 2s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.wristband-check {
  width: min(55%, 7.5rem);
  height: auto;
  display: block;
  overflow: visible;
}

.wristband-core p {
  margin: 0;
  font-family: "Nulshock", Inter, system-ui, sans-serif;
  font-size: clamp(1rem, 1.45cqi, 1.75rem);
  font-weight: 700;
  line-height: 1.21;
  text-align: center;
  color: var(--purple-000);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.wristband-state-idle p {
  animation: wristband-label-pulse 2s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.wristband.is-confirmed .wristband-state-idle {
  z-index: 0;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.9);
  pointer-events: none;
}

.wristband.is-confirmed .wristband-state-done {
  z-index: 1;
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  pointer-events: auto;
  animation: confirm-settle 0.55s cubic-bezier(0.22, 1.2, 0.36, 1) both;
}

.wristband.is-confirmed .wristband-state-idle p {
  animation: none;
}

.wristband.is-confirmed .wristband-icon {
  animation: none;
}

.wristband.is-confirmed .wristband-check {
  animation: confirm-check-pop 0.5s cubic-bezier(0.22, 1.2, 0.36, 1) both;
}

.wristband.is-confirmed .wristband-state-done p {
  color: var(--blue-gray-100);
  animation: confirm-label-in 0.4s ease-out 0.15s both;
}

@keyframes soundwave-breathe {
  0% {
    transform: scale(0.97);
  }
  18% {
    transform: scale(1.06);
  }
  40% {
    transform: scale(0.985);
  }
  100% {
    transform: scale(0.97);
  }
}

/* Sync with breathe: idle dark ? Figma pulse (2078:3773) ? idle */
@keyframes soundwave-color-idle {
  0% {
    opacity: 1;
  }
  18% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}

@keyframes soundwave-color-pulse {
  0% {
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  40% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

@keyframes wristband-icon-pulse {
  0% {
    transform: scale(1);
  }
  18% {
    transform: scale(1.04);
  }
  40% {
    transform: scale(1);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes wristband-label-pulse {
  0%,
  40%,
  100% {
    color: var(--blue-gray-100);
  }
  18% {
    color: #ece3fb;
  }
}

@keyframes confirm-settle {
  0% {
    opacity: 0;
    transform: scale(0.78);
  }
  65% {
    opacity: 1;
    transform: scale(1.06);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes confirm-check-pop {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }
  70% {
    opacity: 1;
    transform: scale(1.08);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes confirm-label-in {
  from {
    opacity: 0;
    transform: translateY(0.35em);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wristband-radar,
  .wristband-icon,
  .wristband-soundwave-idle,
  .wristband-soundwave-pulse,
  .wristband-state-idle p,
  .wristband.is-confirmed .wristband-state-done,
  .wristband.is-confirmed .wristband-check,
  .wristband.is-confirmed .wristband-state-done p {
    animation: none;
  }

  .wristband-soundwave-idle {
    opacity: 1;
  }

  .wristband-soundwave-pulse {
    opacity: 0;
  }

  .wristband.is-confirmed .wristband-state-done {
    opacity: 1;
    transform: none;
  }
}

/* Age selector screens */
.age {
  display: flex;
  flex-direction: column;
  background: #28104e;
}

.bg-age {
  object-fit: cover;
  object-position: center center;
}

.age-body {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 2.6cqi, 3.1rem);
  padding: clamp(0.5rem, 1.5cqi, 1rem) clamp(1.5rem, 2.7cqi, 4rem) 0;
  min-height: 0;
}

.age-question {
  margin: 0;
  color: var(--white);
  font-size: clamp(1.6rem, 2.92cqi, 3.5rem);
  font-weight: 700;
  line-height: 1.04;
  text-align: center;
  width: 100%;
}

.age-picker {
  position: relative;
  width: min(65cqi, 1250px);
  height: clamp(5.5rem, 8.2cqi, 9.8rem);
  border-radius: clamp(2rem, 2.8cqi, 3.35rem);
  background: #361f4e;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  --col-w: clamp(4.2rem, 7cqi, 8.4rem);
}

.age-under5 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.45rem, 0.57cqi, 0.7rem);
  margin: 0;
  padding: clamp(0.35rem, 0.46cqi, 0.55rem) clamp(0.9rem, 1.15cqi, 1.4rem);
  border: 0;
  border-radius: 999px;
  background: var(--blue-gray-100);
  color: var(--purple);
  font: inherit;
  font-size: clamp(1rem, 1.84cqi, 2.2rem);
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 2px 2px 14px rgba(0, 0, 0, 0.5);
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.age-under5:active {
  transform: scale(0.98);
}

.age-under5.is-active {
  background: var(--purple);
  color: var(--white);
}

.age-under5.is-active .age-under5-icon {
  filter: brightness(0) invert(1);
}

.age-under5-icon {
  width: clamp(1.6rem, 2.9cqi, 3.45rem);
  height: auto;
  display: block;
}

.age-footer {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 0 clamp(1.5rem, 2.7cqi, 4rem) clamp(1.5rem, 2.7cqi, 4rem);
}

.age-next {
  position: relative;
  width: min(31.5cqi, 604px);
  aspect-ratio: 604 / 200;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.age-next:active {
  transform: scale(0.985);
}

.age-next-glow {
  position: absolute;
  inset: -16% -8%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(170, 138, 223, 0.55) 0%,
    rgba(95, 70, 134, 0.28) 45%,
    rgba(95, 70, 134, 0) 72%
  );
  filter: blur(16px);
}

/* Purple frame pieces: offset + flip so the stroke wraps the black face */
.age-next-frame {
  position: absolute;
  top: 0;
  height: 100%;
  width: 95.5%;
  object-fit: fill;
  pointer-events: none;
  z-index: 1;
  filter:
    drop-shadow(0 0 8px rgba(170, 138, 223, 0.65))
    drop-shadow(0 0 22px rgba(95, 70, 134, 0.45));
}

.age-next-frame-a {
  left: 0;
  transform: none;
}

.age-next-frame-b {
  left: 4.5%;
  transform: scaleX(-1);
  transform-origin: center center;
}

.age-next-face {
  position: absolute;
  left: 4.66%;
  top: 0;
  width: 90.85%;
  height: 89.4%;
  object-fit: fill;
  pointer-events: none;
  z-index: 2;
}

.age-next-label {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.4rem, 0.55cqi, 0.7rem);
  margin-top: 2%;
  font-family: Inter, system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(1.15rem, 2.2cqi, 2.65rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-shadow:
    0 8px 20px rgba(0, 0, 0, 0.34),
    0 24px 40px rgba(0, 0, 0, 0.22);
  pointer-events: none;
}

.age-next-label img {
  width: clamp(1.6rem, 3.3cqi, 4rem);
  height: auto;
  display: block;
}

/* Keep legacy ready button styles for username / summary screens */
.age-ready {
  position: relative;
  width: min(72%, 48rem);
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.age-wheel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: none;
  box-sizing: border-box;
  cursor: grab;
  user-select: none;
}

.age-wheel.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.age-wheel::-webkit-scrollbar {
  display: none;
}

.age-digit {
  flex: 0 0 var(--col-w);
  width: var(--col-w);
  height: 100%;
  display: grid;
  place-items: center;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  margin: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font: inherit;
  font-size: clamp(2rem, 3.67cqi, 4.4rem);
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-align: center;
  cursor: inherit;
  pointer-events: none;
}

.age-digit.is-selected {
  color: #fff;
}

.age-highlight {
  position: absolute;
  top: 12%;
  bottom: 12%;
  left: 50%;
  width: calc(var(--col-w) * 1.01);
  transform: translateX(-50%);
  border-radius: clamp(1.2rem, 2.8cqi, 3.35rem);
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  z-index: 2;
}

.age-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28%;
  z-index: 3;
  pointer-events: none;
}

.age-fade-left {
  left: 0;
  background: linear-gradient(
    90deg,
    rgba(54, 31, 78, 0.95) 0%,
    rgba(54, 31, 78, 0.45) 55%,
    rgba(54, 31, 78, 0) 100%
  );
}

.age-fade-right {
  right: 0;
  background: linear-gradient(
    270deg,
    rgba(54, 31, 78, 0.95) 0%,
    rgba(54, 31, 78, 0.45) 55%,
    rgba(54, 31, 78, 0) 100%
  );
}

.age-ready:active {
  transform: scale(0.985);
}

.age-ready-shape {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

.age-ready-label {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.55rem, 1.4cqi, 1.6rem);
  font-family: "IBM Plex Sans", Inter, sans-serif;
  font-size: clamp(1.35rem, 3.8cqi, 6rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-shadow:
    0 8px 20px rgba(0, 0, 0, 0.34),
    0 24px 40px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.age-ready-icon {
  width: clamp(1.6rem, 4.2cqi, 5.5rem);
  height: auto;
  display: block;
}

/* legacy alias */
.age-continue {
  display: none;
}

/* Username cube select */
.username {
  display: flex;
  flex-direction: column;
  background: #28104e;
}

.bg-username-select {
  object-fit: cover;
  object-position: center center;
}

.username-body {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(2.5rem, 4cqi, 4.8rem);
  padding: clamp(1rem, 2.7cqi, 4rem) clamp(1.5rem, 2.7cqi, 4rem)
    clamp(1.5rem, 2.7cqi, 4rem);
  min-height: 0;
}

.username-title {
  margin: 0;
  width: 100%;
  color: var(--white);
  font-size: clamp(1.6rem, 2.92cqi, 3.5rem);
  font-weight: 700;
  line-height: 1.04;
  text-align: center;
}

.cube-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(2rem, 8.3cqi, 10rem);
  width: 100%;
  max-width: 100%;
  padding: 0 clamp(1rem, 3cqi, 4rem);
}

.cube-btn {
  flex: 0 0 auto;
  width: min(14.5cqi, 279px);
  aspect-ratio: 279 / 445;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
  filter: drop-shadow(0 0 40px rgba(222, 0, 251, 0.55));
}

.cube-shadow {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 0;
  width: 76%;
  height: auto;
  display: block;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0.9;
}

.cube-img {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 100%;
  height: 67.5%;
  object-fit: contain;
  object-position: center top;
  pointer-events: none;
  will-change: transform;
}

.cube-btn:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 6px;
  border-radius: 8px;
}

.cube-btn:active {
  transform: scale(0.97);
}

/* Figma motion — 2s loop, staggered bob */
.cube-bob-a .cube-img {
  animation: cube-bob-a 2s linear infinite;
}

.cube-bob-b .cube-img {
  animation: cube-bob-b 2s linear infinite;
}

.cube-bob-c .cube-img {
  animation: cube-bob-c 2s linear infinite;
}

.cube-bob-d .cube-img {
  animation: cube-bob-d 2s linear infinite;
}

@keyframes cube-bob-a {
  0% {
    translate: 0 1.65cqi;
  }
  12.95% {
    translate: 0 0;
  }
  37.4% {
    translate: 0 1.65cqi;
  }
  63% {
    translate: 0 0;
  }
  87.25% {
    translate: 0 1.65cqi;
  }
  100% {
    translate: 0 0;
  }
}

@keyframes cube-bob-b {
  0% {
    translate: 0 -0.825cqi;
  }
  13% {
    translate: 0 1.65cqi;
  }
  38.2% {
    translate: 0 0;
  }
  62.55% {
    translate: 0 1.65cqi;
  }
  86.95%,
  100% {
    translate: 0 0;
  }
}

@keyframes cube-bob-c {
  0% {
    translate: 0 1.65cqi;
  }
  13.35% {
    translate: 0 0.03cqi;
  }
  37.6% {
    translate: 0 1.65cqi;
  }
  62.9% {
    translate: 0 0;
  }
  87.1% {
    translate: 0 0.825cqi;
  }
  99.75%,
  100% {
    translate: 0 0;
  }
}

@keyframes cube-bob-d {
  0% {
    translate: 0 -0.825cqi;
  }
  20.1% {
    translate: 0 0;
  }
  39.95% {
    translate: 0 -0.825cqi;
  }
  63.98% {
    translate: 0 0;
  }
  99.4%,
  100% {
    translate: 0 -0.825cqi;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cube-bob-a .cube-img,
  .cube-bob-b .cube-img,
  .cube-bob-c .cube-img,
  .cube-bob-d .cube-img {
    animation: none;
  }
}

/* Username result (single 1?4) */
.username-result {
  display: flex;
  flex-direction: column;
  background: var(--blue-gray-500);
}

.username-result[data-mode="solo"] {
  background: #28104e;
}

.username-result[data-mode="together"] {
  background: #28104e;
}

.bg-username-result {
  object-fit: cover;
  object-position: center center;
}

.username-result[data-mode="solo"] .lang-toggle,
.username-result[data-mode="together"] .lang-toggle {
  background: var(--purple);
}

.username-result[data-mode="solo"] .lang-btn,
.username-result[data-mode="together"] .lang-btn {
  color: var(--white);
}

.username-result[data-mode="solo"] .lang-btn.is-active,
.username-result[data-mode="together"] .lang-btn.is-active {
  background: var(--white);
  color: var(--purple);
}

.username-result-body {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 2.7cqi, 3.3rem);
  padding: clamp(0.5rem, 1.5cqi, 1rem) clamp(1.2rem, 3cqi, 2.5rem) 0;
  min-height: 0;
}

.username-result-title {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(0.45rem, 0.7cqi, 0.85rem);
  font-size: clamp(1.6rem, 2.92cqi, 3.5rem);
  font-weight: 700;
  line-height: 1.04;
  text-align: center;
}

.username-you-are {
  color: var(--blue-gray-100);
}

.username-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.3rem, 0.4cqi, 0.5rem) clamp(0.45rem, 0.55cqi, 0.7rem);
  background: radial-gradient(
    ellipse at center,
    rgba(48, 44, 54, 0) 0%,
    rgba(48, 44, 54, 1) 100%
  );
  color: var(--white);
}

.username-result[data-mode="solo"] .username-chip,
.username-result[data-mode="together"] .username-chip {
  background: radial-gradient(
    ellipse at center,
    rgba(48, 44, 54, 0.15) 0%,
    rgba(48, 44, 54, 0.95) 100%
  );
  color: var(--white);
  padding: clamp(0.3rem, 0.4cqi, 0.5rem) clamp(0.45rem, 0.55cqi, 0.7rem);
}

.username-avatar {
  position: relative;
  width: min(18.1cqi, 348px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: clamp(0.35rem, 0.41cqi, 0.5rem) solid var(--white);
  overflow: hidden;
  background: #d8dce8;
  flex-shrink: 0;
}

.username-result[data-mode="solo"] .username-avatar {
  width: min(18.1cqi, 348px);
  border-color: var(--white);
  border-width: clamp(0.35rem, 0.41cqi, 0.5rem);
  background: #c8efe8;
}

.username-result[data-mode="together"] .username-avatar {
  width: min(15.4cqi, 296px);
  border-color: var(--white);
  border-width: clamp(0.3rem, 0.35cqi, 0.42rem);
  background: #d8dce8;
  box-shadow: none;
}

.username-result[data-mode="together"] .username-avatar.is-tiger {
  background: #54a40f;
}

.username-avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
}

.username-avatar[data-box="1"] .username-avatar-img {
  width: 121.28%;
  height: 116.18%;
  max-width: none;
  position: absolute;
  left: -10.64%;
  top: -8.09%;
  object-fit: fill;
}

.username-avatar[data-box="2"] .username-avatar-img {
  width: 135.41%;
  height: 125.07%;
  max-width: none;
  position: absolute;
  left: -19.7%;
  top: -8.59%;
  object-fit: fill;
}

.username-avatar[data-box="3"] .username-avatar-img {
  width: 122.03%;
  height: 105.82%;
  max-width: none;
  position: absolute;
  left: -11.01%;
  top: -3.66%;
  object-fit: fill;
}

.username-avatar.is-tiger {
  background: #82c24a;
  display: grid;
  place-items: center;
  padding-top: 12%;
}

.username-avatar.is-tiger .username-avatar-img {
  position: static;
  width: 76%;
  height: auto;
  max-height: 110%;
  object-fit: contain;
}

.username-result-footer {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 0 clamp(1.5rem, 2.6cqi, 2.5rem) clamp(1.5rem, 2.7cqi, 4rem);
}

.username-result[data-mode="solo"] .username-result-footer {
  padding: 0 clamp(1.5rem, 2.7cqi, 4rem) clamp(1.5rem, 2.7cqi, 4rem);
}

.username-result[data-mode="solo"] .age-next {
  width: min(31.5cqi, 604px);
}

.username-result-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 1.86cqi, 2.25rem);
  width: min(70.3cqi, 1350px);
  margin: 0 auto;
  padding-left: clamp(1rem, 1.86cqi, 2.25rem);
  padding-right: clamp(1rem, 1.86cqi, 2.25rem);
}

.username-result[data-mode="together"] .username-result-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 0 clamp(1.5rem, 2.7cqi, 4rem) clamp(1.5rem, 2.7cqi, 3rem);
}

.group-choice {
  position: relative;
  display: grid;
  place-items: center;
  flex: 1 1 0;
  max-width: min(32.4cqi, 622px);
  min-height: clamp(8rem, 14.5cqi, 17.5rem);
  aspect-ratio: 622 / 279;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  text-decoration: none;
  transform-origin: center center;
  will-change: transform, filter;
  animation:
    choice-scale-pulse 4s cubic-bezier(0.37, 0, 0.63, 1) infinite,
    choice-glow-pulse 3.2s ease-in-out infinite;
}

.group-choice-add {
  --choice-glow: rgba(7, 186, 239, 0.55);
  --choice-glow-hot: rgba(7, 186, 239, 1);
  animation-delay: 0s, 0s;
}

.group-choice-done {
  --choice-glow: rgba(130, 194, 74, 0.55);
  --choice-glow-hot: rgba(130, 194, 74, 1);
  animation-delay: -2s, -1.6s;
}

.group-choice:active {
  animation: none;
  transform: scale(0.985);
  filter: drop-shadow(0 0 16px var(--choice-glow-hot));
}

.group-choice .choice-label {
  font-size: clamp(1.15rem, 2.79cqi, 3.35rem);
  text-transform: uppercase;
}

.group-choice .choice-icon {
  width: clamp(2rem, 2.7cqi, 3.2rem);
}

.group-choice-done .choice-shape {
  transform: scaleX(-1);
}

@media (prefers-reduced-motion: reduce) {
  .group-choice {
    animation: none;
    filter: drop-shadow(0 0 14px var(--choice-glow));
  }
}

.glow-btn {
  position: relative;
  flex: 1 1 0;
  max-width: min(42%, 18rem);
  border: 0;
  padding: 0;
  background: transparent;
  color: #7de7ff;
  cursor: pointer;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 8px rgba(125, 231, 255, 0.45))
    drop-shadow(0 0 22px rgba(117, 87, 166, 0.4));
  animation: glow-btn-pulse 2.4s ease-in-out infinite;
}

.glow-btn-new {
  color: #ffe56a;
  filter: drop-shadow(0 0 8px rgba(255, 229, 106, 0.45))
    drop-shadow(0 0 22px rgba(244, 139, 50, 0.35));
  animation-delay: 0.35s;
}

.glow-btn:active {
  transform: scale(0.985);
}

.glow-btn-bloom {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 22%;
  bottom: 22%;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(125, 231, 255, 0.45) 0%,
    transparent 70%
  );
  filter: blur(16px);
  pointer-events: none;
  animation: glow-btn-bloom 2.4s ease-in-out infinite;
}

.glow-btn-new .glow-btn-bloom {
  background: radial-gradient(
    ellipse at center,
    rgba(255, 229, 106, 0.4) 0%,
    transparent 70%
  );
  animation-delay: 0.35s;
}

.glow-btn-shape {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.glow-btn-label {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.35rem, 1cqi, 0.7rem);
  color: var(--white);
  font-weight: 700;
  font-size: clamp(1rem, 2.8cqi, 1.85rem);
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(125, 231, 255, 0.45),
    0 8px 18px rgba(0, 0, 0, 0.35);
}

.glow-btn-new .glow-btn-label {
  text-shadow: 0 0 14px rgba(255, 229, 106, 0.45),
    0 8px 18px rgba(0, 0, 0, 0.35);
}

.glow-btn-icon {
  width: clamp(1.1rem, 2.8cqi, 1.9rem);
  height: auto;
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 0 8px rgba(125, 231, 255, 0.8));
}

.glow-btn-new .glow-btn-icon {
  filter: drop-shadow(0 0 8px rgba(255, 229, 106, 0.8));
}

@keyframes glow-btn-pulse {
  0%,
  100% {
    filter: drop-shadow(0 0 6px rgba(125, 231, 255, 0.35))
      drop-shadow(0 0 16px rgba(117, 87, 166, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 14px rgba(125, 231, 255, 0.8))
      drop-shadow(0 0 32px rgba(170, 138, 223, 0.55));
  }
}

.glow-btn-new {
  animation-name: glow-btn-pulse-new;
}

@keyframes glow-btn-pulse-new {
  0%,
  100% {
    filter: drop-shadow(0 0 6px rgba(255, 229, 106, 0.35))
      drop-shadow(0 0 16px rgba(244, 139, 50, 0.25));
  }
  50% {
    filter: drop-shadow(0 0 14px rgba(255, 229, 106, 0.85))
      drop-shadow(0 0 32px rgba(244, 139, 50, 0.45));
  }
}

@keyframes glow-btn-bloom {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .glow-btn,
  .glow-btn-bloom {
    animation: none;
  }
}

/* Summary (solo / together check-in) — Figma 2372:5771 */
.summary {
  display: flex;
  flex-direction: column;
  background: #e8e4ef;
}

.bg-summary {
  object-fit: cover;
  object-position: center center;
  opacity: 0.35;
}

.summary-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(0.85rem, 1.96cqi, 2.35rem);
  background: var(--purple);
  min-height: clamp(4.5rem, 6.25cqi, 7.5rem);
}

.summary .lang-toggle {
  background: var(--purple);
  flex-shrink: 0;
  box-shadow: 3px 2.5px 2.5px rgba(50, 42, 87, 0.55);
}

.summary .lang-btn {
  color: var(--white);
}

.summary .lang-btn.is-active {
  background: var(--white);
  color: var(--purple);
}

.summary-players {
  display: flex;
  align-items: center;
  gap: clamp(0.7rem, 1.22cqi, 1.45rem);
  min-width: 0;
  overflow-x: auto;
  max-width: min(78%, 70rem);
  padding-bottom: 0.15rem;
}

.summary-users-badge {
  width: clamp(3.2rem, 4.28cqi, 5.15rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--purple);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 0 transparent;
}

.summary-users-badge img {
  width: 72%;
  height: auto;
  display: block;
}

.summary-avatar-list {
  display: flex;
  align-items: center;
  gap: clamp(0.45rem, 0.61cqi, 0.75rem);
}

.summary-avatar {
  position: relative;
  width: clamp(2.8rem, 3.76cqi, 4.5rem);
  aspect-ratio: 1;
  border-radius: 50%;
  border: clamp(0.15rem, 0.18cqi, 0.22rem) solid var(--purple);
  overflow: hidden;
  background: #d8dce8;
  flex-shrink: 0;
}

.summary-avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
}

.summary-avatar[data-box="1"] .summary-avatar-img {
  width: 121.28%;
  height: 116.18%;
  max-width: none;
  position: absolute;
  left: -10.64%;
  top: -8.09%;
  object-fit: fill;
}

.summary-avatar[data-box="2"] .summary-avatar-img {
  width: 135.41%;
  height: 125.07%;
  max-width: none;
  position: absolute;
  left: -19.7%;
  top: -8.59%;
  object-fit: fill;
}

.summary-avatar[data-box="3"] .summary-avatar-img {
  width: 122.03%;
  height: 105.82%;
  max-width: none;
  position: absolute;
  left: -11.01%;
  top: -3.66%;
  object-fit: fill;
}

.summary-avatar[data-box="4"],
.summary-avatar.is-tiger {
  background: #54a40f;
  display: grid;
  place-items: center;
  padding-top: 8%;
}

.summary-avatar[data-box="4"] .summary-avatar-img,
.summary-avatar.is-tiger .summary-avatar-img {
  width: 76%;
  height: auto;
  max-height: 110%;
  object-fit: contain;
  position: relative;
}

.summary-body {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 3cqi, 3.5rem);
  padding: clamp(1.5rem, 2.5cqi, 3rem) clamp(1.5rem, 2.7cqi, 4rem) 0;
}

.summary-title {
  margin: 0;
  width: 100%;
  color: var(--purple);
  font-size: clamp(2rem, 5cqi, 6rem);
  font-weight: 700;
  line-height: 1.21;
  text-align: center;
}

.summary-traits {
  flex: 0 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, min(38.5cqi, 740px)));
  grid-template-rows: auto auto;
  gap: clamp(1.5rem, 3cqi, 3.55rem) clamp(2rem, 4.6cqi, 5.5rem);
  align-content: center;
  justify-content: center;
  justify-items: center;
  width: 100%;
}

.trait-card {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  width: 100%;
  max-width: min(38.5cqi, 740px);
}

.trait-card-bg {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

/* Faces are skewed parallelograms — center content on the face */
.trait-card-content {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 82%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.45rem, 0.71cqi, 0.85rem);
  color: var(--white);
  font-size: clamp(1.35rem, 3.4cqi, 4.1rem);
  font-weight: 700;
  line-height: 1.21;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.trait-card-content span {
  display: block;
  text-align: center;
}

.trait-dynamic .trait-card-content,
.trait-curious .trait-card-content,
.trait-collab .trait-card-content,
.trait-tenacious .trait-card-content {
  left: 50%;
  top: 50%;
  width: 82%;
}

.trait-card-icon {
  width: clamp(2.4rem, 5.7cqi, 6.8rem);
  height: auto;
  flex-shrink: 0;
  display: block;
}

.summary-footer {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 0 clamp(1.5rem, 2.7cqi, 4rem) clamp(1.5rem, 2.7cqi, 4rem);
}

.summary-enter {
  width: min(18.1cqi, 348px);
  aspect-ratio: 348 / 115;
}

.summary-enter .age-next-label {
  font-size: clamp(1rem, 1.88cqi, 2.25rem);
  margin-top: 4%;
}

@media (max-width: 700px) {
  .stage {
    border-radius: 18px;
  }

  .choices {
    gap: 0.75rem;
  }

  .choice-label {
    white-space: normal;
    font-size: clamp(1rem, 4.5cqi, 1.5rem);
  }

  .age-body {
    text-align: center;
  }

  .age-picker {
    width: min(98%, calc(100% - 0.75rem));
    height: clamp(5rem, 18cqi, 7rem);
  }

  .cube-row {
    gap: 0.4rem;
  }

  .username-body {
    gap: 1.25rem;
  }

  .username-result-title {
    flex-wrap: wrap;
  }

  .username-avatar {
    width: min(42cqi, 14rem);
  }

  .username-result[data-mode="solo"] .username-avatar,
  .username-result[data-mode="together"] .username-avatar {
    width: min(48cqi, 16rem);
  }

  .username-result-actions {
    gap: 0.75rem;
  }

  .username-result[data-mode="together"] .age-ready-label {
    font-size: clamp(0.95rem, 3.2cqi, 1.4rem);
  }

  .summary-traits {
    gap: 0.55rem;
  }

  .trait-card-content {
    font-size: clamp(0.85rem, 3.6cqi, 1.2rem);
  }

  .summary-footer .age-ready {
    width: min(72%, 22rem);
  }
}
