@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

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

html {
  height: 100%;
}

body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: center;
  padding:
    max(clamp(18px, 5vw, 44px), env(safe-area-inset-top))
    max(clamp(18px, 5vw, 44px), env(safe-area-inset-right))
    max(clamp(18px, 5vw, 44px), env(safe-area-inset-bottom))
    max(clamp(18px, 5vw, 44px), env(safe-area-inset-left));
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: #f6f4ff;
  background-color: #090514;
  background-image:
    radial-gradient(120% 90% at 50% 0%, rgba(35, 22, 78, 0.9) 0%, transparent 62%),
    radial-gradient(120% 100% at 50% 115%, rgba(46, 20, 84, 0.85) 0%, transparent 58%),
    linear-gradient(165deg, #090514 0%, #130c29 38%, #1c103e 68%, #080412 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#bgm {
  display: none;
}

.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;
}

.sound-btn {
  position: fixed;
  top: max(clamp(14px, 3vw, 22px), env(safe-area-inset-top));
  right: max(clamp(14px, 3vw, 22px), env(safe-area-inset-right));
  z-index: 170;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: rgba(246, 244, 255, 0.9);
  background: rgba(30, 20, 56, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.2s ease, background-color 0.25s ease, border-color 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.sound-btn:hover {
  transform: translateY(-2px);
  background: rgba(44, 30, 78, 0.8);
  border-color: rgba(240, 171, 252, 0.45);
}

.sound-btn:focus-visible {
  outline: 2px solid #c4b5fd;
  outline-offset: 3px;
}

.sound-btn svg {
  display: block;
}

.sound-btn__w1,
.sound-btn__w2,
.sound-btn__slash {
  transition: opacity 0.2s ease;
}

.sound-btn__slash {
  opacity: 0;
}

.sound-btn.is-muted .sound-btn__slash {
  opacity: 1;
}

.sound-btn.is-muted .sound-btn__w1,
.sound-btn.is-muted .sound-btn__w2 {
  opacity: 0.25;
}

.orb {
  position: fixed;
  z-index: 0;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.45;
  pointer-events: none;
  will-change: transform;
}

.orb--violet {
  top: -12%;
  left: -10%;
  width: clamp(320px, 46vw, 640px);
  background: radial-gradient(circle at 32% 32%, rgba(139, 92, 246, 0.85), transparent 66%);
  animation: drift-a 22s ease-in-out infinite;
}

.orb--pink {
  bottom: -16%;
  right: -12%;
  width: clamp(280px, 40vw, 560px);
  background: radial-gradient(circle at 60% 42%, rgba(236, 72, 153, 0.7), transparent 66%);
  animation: drift-b 26s ease-in-out infinite;
}

.orb--cyan {
  top: 52%;
  left: -8%;
  width: clamp(240px, 34vw, 480px);
  background: radial-gradient(circle at 45% 55%, rgba(34, 211, 238, 0.5), transparent 66%);
  animation: drift-c 24s ease-in-out infinite;
}

.orb--amber {
  top: -8%;
  right: -6%;
  width: clamp(200px, 28vw, 420px);
  background: radial-gradient(circle at 55% 45%, rgba(251, 191, 36, 0.42), transparent 66%);
  animation: drift-d 29s ease-in-out infinite;
}

@keyframes drift-a {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(9%, 15%, 0) scale(1.14); }
  100% { transform: translate3d(-4%, 5%, 0) scale(0.98); }
}

@keyframes drift-b {
  0% { transform: translate3d(0, 0, 0) scale(1.05); }
  50% { transform: translate3d(-10%, -9%, 0) scale(0.95); }
  100% { transform: translate3d(5%, -4%, 0) scale(1.12); }
}

@keyframes drift-c {
  0% { transform: translate3d(0, 0, 0) scale(0.95); }
  50% { transform: translate3d(14%, -12%, 0) scale(1.1); }
  100% { transform: translate3d(-6%, 8%, 0) scale(1); }
}

@keyframes drift-d {
  0% { transform: translate3d(0, 0, 0) scale(1.1); }
  50% { transform: translate3d(-12%, 10%, 0) scale(0.96); }
  100% { transform: translate3d(7%, -6%, 0) scale(1.06); }
}

#fx,
#confetti {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#fx {
  z-index: 1;
}

#confetti {
  z-index: 200;
}

.spotlight {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 2;
  width: 1100px;
  height: 1100px;
  margin: -550px 0 0 -550px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(217, 70, 239, 0.12), rgba(139, 92, 246, 0.06) 45%, transparent 70%);
  transform: translate3d(50vw, 36vh, 0);
  will-change: transform;
}

.grain {
  position: fixed;
  inset: -40px;
  z-index: 90;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  animation: grain-jitter 2s steps(1) infinite;
}

@keyframes grain-jitter {
  0% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(-1.5%, 1%, 0); }
  50% { transform: translate3d(1%, -1.5%, 0); }
  75% { transform: translate3d(-1%, -1%, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

.flash {
  position: fixed;
  inset: 0;
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(55% 55% at 50% 42%, rgba(255, 255, 255, 0.5), rgba(240, 171, 252, 0.22) 42%, transparent 72%);
}

.flash.go {
  animation: flash-out 0.9s ease-out forwards;
}

@keyframes flash-out {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.scene {
  position: relative;
  z-index: 4;
  width: 100%;
  display: grid;
  place-items: center;
}

.halo {
  grid-area: 1 / 1;
  place-self: center;
  width: min(640px, 94vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: conic-gradient(
    from 90deg,
    rgba(139, 92, 246, 0.75),
    rgba(217, 70, 239, 0.65),
    rgba(34, 211, 238, 0.4),
    rgba(244, 114, 182, 0.65),
    rgba(139, 92, 246, 0.75)
  );
  filter: blur(60px);
  opacity: 0.35;
  pointer-events: none;
  animation: halo-spin 18s linear infinite;
  will-change: transform;
}

@keyframes halo-spin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.07); }
  100% { transform: rotate(360deg) scale(1); }
}

.card {
  grid-area: 1 / 1;
  place-self: center;
  position: relative;
  display: grid;
  width: min(580px, 100%);
  padding: clamp(30px, 7vw, 54px) clamp(22px, 6vw, 48px);
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.05) 42%, rgba(255, 255, 255, 0.09) 100%);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
  backdrop-filter: blur(16px) saturate(135%);
  box-shadow:
    0 40px 90px -30px rgba(0, 0, 0, 0.75),
    0 10px 30px -18px rgba(139, 92, 246, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  text-align: center;
  animation: card-in 1s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: box-shadow 0.9s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.card.is-live {
  animation: none;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(90% 60% at 50% -12%, rgba(255, 255, 255, 0.18), transparent 62%);
  pointer-events: none;
}

.card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 31px;
  padding: 2px;
  background: conic-gradient(from var(--angle), #8b5cf6, #ec4899, #22d3ee, #fbbf24, #8b5cf6);
  -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, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0.85;
  pointer-events: none;
  animation: ring-spin 12s steps(240) infinite;
}

@keyframes ring-spin {
  to { --angle: 360deg; }
}

.card.is-done {
  box-shadow:
    0 40px 90px -30px rgba(0, 0, 0, 0.75),
    0 0 90px -12px rgba(217, 70, 239, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.content,
.success {
  grid-area: 1 / 1;
}

.content {
  transition: opacity 0.5s ease, transform 0.5s ease, visibility 0s linear 0.5s;
}

.card.is-done .content {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-14px) scale(0.98);
  pointer-events: none;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes float-soft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.badge {
  width: 64px;
  height: 64px;
  margin: 0 auto clamp(12px, 3vw, 18px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 12px 30px -12px rgba(217, 70, 239, 0.5);
  animation: rise-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both, float-soft 4.5s ease-in-out 1.1s infinite;
}

.badge svg {
  display: block;
  filter: drop-shadow(0 4px 14px rgba(217, 70, 239, 0.45));
}

.title {
  margin: 0 0 clamp(14px, 3vw, 20px);
  font-size: clamp(2.3rem, 9vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  background-image: linear-gradient(100deg, #c4b5fd 0%, #f0abfc 28%, #fda4af 52%, #a5b4fc 78%, #c4b5fd 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 8px 26px rgba(217, 70, 239, 0.35));
  animation: rise-in 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both, shimmer 8s linear infinite;
}

@keyframes shimmer {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

.message {
  margin: 0 auto;
  max-width: 46ch;
  font-size: clamp(1rem, 2.6vw, 1.13rem);
  line-height: 1.8;
  font-weight: 400;
  color: rgba(246, 244, 255, 0.8);
  animation: rise-in 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}

.message__em {
  color: #ffffff;
  font-weight: 600;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: clamp(26px, 6vw, 38px);
  animation: rise-in 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.44s both;
}

.tease {
  margin: 14px 0 0;
  min-height: 1.4rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(240, 171, 252, 0.9);
  animation: rise-in 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.56s both;
}

.btn {
  position: relative;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  padding: 16px 30px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform 0.2s ease, box-shadow 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
  will-change: transform;
}

.btn:focus-visible {
  outline: 2px solid #c4b5fd;
  outline-offset: 3px;
}

.btn--yes {
  color: #ffffff;
  background-image: linear-gradient(135deg, #8b5cf6 0%, #d946ef 55%, #f43f5e 100%);
  box-shadow:
    0 16px 34px -14px rgba(217, 70, 239, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  overflow: hidden;
}

.btn--yes::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, 0.42) 50%, transparent 68%);
  transform: translateX(-130%);
  pointer-events: none;
}

@media (hover: hover) {
  .btn--yes:hover::after {
    animation: shine 0.9s ease;
  }
}

@keyframes shine {
  to { transform: translateX(130%); }
}

.btn--yes:hover {
  transform: translateY(-2px) scale(1.035);
  box-shadow:
    0 22px 46px -14px rgba(217, 70, 239, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn--yes:active {
  transform: translateY(0) scale(0.97);
}

.btn:disabled {
  cursor: default;
}

.btn--yes:disabled:hover {
  transform: none;
}

.btn--no {
  color: rgba(246, 244, 255, 0.88);
  background-color: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.btn--no:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn--no.is-escaped {
  position: fixed;
  z-index: 120;
  margin: 0;
  background-color: rgba(30, 20, 56, 0.72);
  box-shadow:
    0 18px 44px -16px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.taunt {
  position: fixed;
  z-index: 130;
  transform: translate(-50%, 0);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #f5d0fe;
  background: rgba(30, 20, 56, 0.82);
  border: 1px solid rgba(240, 171, 252, 0.35);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  pointer-events: none;
  animation: taunt-rise 1.25s ease-out forwards;
}

@keyframes taunt-rise {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(0.8); }
  18% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  70% { opacity: 1; transform: translate(-50%, -14px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -30px) scale(0.96); }
}

.success {
  place-self: center;
  position: relative;
  z-index: 0;
  padding: 14px 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(0.94);
  transition: opacity 0.65s ease, transform 0.75s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.3s;
}

.card.is-done .success {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0.28s, 0.28s, 0s;
}

.success::before {
  content: "";
  position: absolute;
  inset: -45% -20%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(217, 70, 239, 0.35), rgba(139, 92, 246, 0.12) 55%, transparent 76%);
  filter: blur(18px);
  opacity: 0.6;
}

.card.is-done .success::before {
  animation: breathe 3.4s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.6; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.04); }
}

.success__title {
  margin: 0;
  font-size: clamp(1.35rem, 5.5vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.55;
}

.success__text {
  background-image: linear-gradient(100deg, #f0abfc, #fda4af 48%, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 18px rgba(217, 70, 239, 0.35));
}

.heart {
  display: inline-block;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.heart.is-shown {
  opacity: 1;
  transform: scale(1);
  animation: beat 1.15s ease-in-out 0.5s infinite;
}

.type-caret::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  border-radius: 1px;
  background: #f0abfc;
  vertical-align: -0.08em;
  animation: caret-blink 0.9s steps(1) infinite;
}

@keyframes caret-blink {
  50% { opacity: 0; }
}

.btn--soft {
  color: #f5d0fe;
  background: rgba(240, 171, 252, 0.12);
  border-color: rgba(240, 171, 252, 0.4);
}

.btn--soft:hover {
  transform: translateY(-2px) scale(1.03);
  background: rgba(240, 171, 252, 0.2);
  border-color: rgba(240, 171, 252, 0.6);
}

.success__cta {
  margin-top: 22px;
  opacity: 0;
  transform: translateY(14px) scale(0.94);
  pointer-events: none;
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.success__cta.is-shown {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.success__cta.is-shown:hover {
  transition-duration: 0.2s, 0.2s;
}

.success__cta.is-confirmed {
  opacity: 1;
  transform: none;
  color: #bbf7d0;
  background: rgba(74, 222, 128, 0.16);
  border-color: rgba(74, 222, 128, 0.5);
  cursor: default;
}

.success__cta.is-confirmed:hover {
  transform: none;
  background: rgba(74, 222, 128, 0.16);
  border-color: rgba(74, 222, 128, 0.5);
}

@keyframes beat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.26); }
  24% { transform: scale(1); }
  36% { transform: scale(1.18); }
  48% { transform: scale(1); }
}

.fly-heart {
  position: absolute;
  bottom: 8%;
  z-index: 2;
  font-size: var(--size, 18px);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
  animation: fly-up var(--dur, 3s) cubic-bezier(0.18, 0.7, 0.3, 1) var(--delay, 0s) forwards;
}

@keyframes fly-up {
  0% { opacity: 0; transform: translate3d(0, 0, 0) scale(0.6) rotate(-8deg); }
  12% { opacity: 0.95; }
  70% { opacity: 0.8; }
  100% { opacity: 0; transform: translate3d(0, -240px, 0) scale(1.15) rotate(8deg); }
}

.music-embed {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 320px;
  height: 180px;
  opacity: 0;
  pointer-events: none;
}

.music-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 760px) {
  .orb--cyan,
  .orb--amber {
    display: none;
  }

  .orb {
    filter: blur(55px);
  }

  .halo {
    filter: blur(46px);
  }

  .card {
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
  }
}

@media (max-width: 460px) {
  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
    padding: 15px 24px;
  }
}

@media (max-height: 580px) {
  .card {
    padding: 22px 20px;
  }

  .badge {
    width: 52px;
    height: 52px;
  }

  .message {
    line-height: 1.6;
  }
}

.perf-lite .card {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: linear-gradient(155deg, rgba(38, 26, 68, 0.86) 0%, rgba(24, 16, 46, 0.82) 100%);
}

.perf-lite .card::after {
  animation: none;
  opacity: 0.5;
}

.perf-lite .halo,
.perf-lite .grain,
.perf-lite .spotlight,
.perf-lite .orb--cyan,
.perf-lite .orb--amber {
  display: none;
}

.perf-lite .orb {
  filter: blur(46px);
}

.perf-lite .title {
  animation: rise-in 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both;
}

.perf-lite .badge {
  animation: rise-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .card::after,
  .orb,
  .halo,
  .grain,
  .title,
  .heart,
  .badge,
  .message,
  .actions,
  .tease {
    animation: none !important;
  }

  .btn--yes:hover::after,
  .card.is-done .success::before,
  .type-caret::after {
    animation: none !important;
  }

  .content,
  .success,
  .btn,
  .card,
  .heart,
  .success__cta {
    transition-duration: 0.01ms !important;
  }
}
