:root {
  --bg-1: #ffeef6;
  --bg-2: #eef7ff;
  --bg-3: #f4efff;
  --coral: #ff9aa2;
  --coral-deep: #f47f8c;
  --coral-dark: #d96a78;
  --yellow: #ffd98a;
  --text: #7a6a80;
  --text-soft: #9a86a0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  min-height: 100vh;
}

body {
  font-family: "Nunito", sans-serif;
  background: linear-gradient(160deg, var(--bg-1), var(--bg-2) 55%, var(--bg-3));
  background-attachment: fixed;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  z-index: -1;
  pointer-events: none;
}

.blob-1 {
  width: 280px;
  height: 280px;
  background: #ffd1dc;
  top: -80px;
  left: -60px;
  animation: float 14s ease-in-out infinite alternate;
}

.blob-2 {
  width: 320px;
  height: 320px;
  background: #cfe9ff;
  bottom: -100px;
  right: -80px;
  animation: float 18s ease-in-out infinite alternate-reverse;
}

.blob-3 {
  width: 220px;
  height: 220px;
  background: #e6dcff;
  top: 40%;
  left: 60%;
  animation: float 16s ease-in-out infinite alternate;
}

@keyframes float {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(30px, 40px) scale(1.15);
  }
}

.page {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 34px 20px 26px;
  flex: 1;
}

.header {
  text-align: center;
  margin-bottom: 26px;
}

.logo {
  font-family: "Baloo 2", cursive;
  font-weight: 800;
  font-size: 44px;
  line-height: 1.1;
  background: linear-gradient(90deg, #ff8fa3, #b58ef7 70%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.logo .domain {
  background: linear-gradient(90deg, #f7b2c4, #c9b3f7);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  font-size: 32px;
}

.tagline {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-soft);
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.speech-bubble {
  position: relative;
  background: #ffffff;
  border: 3px solid #ffe1ea;
  border-radius: 26px;
  padding: 18px 28px;
  max-width: 420px;
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 12px 34px rgba(244, 127, 140, 0.2);
  margin-bottom: 26px;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -15px;
  left: 50%;
  margin-left: -11px;
  width: 22px;
  height: 22px;
  background: #ffffff;
  border-right: 3px solid #ffe1ea;
  border-bottom: 3px solid #ffe1ea;
  transform: rotate(45deg);
  z-index: -1;
}

.bubble-text {
  font-family: "Baloo 2", cursive;
  font-weight: 700;
  font-size: 20px;
  line-height: 1.45;
  color: #6f5b7a;
}

.speech-bubble.show {
  animation: bubblePop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bubblePop {
  0% {
    transform: scale(0.55);
    opacity: 0;
  }
  60% {
    transform: scale(1.06);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.machine {
  position: relative;
  width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.machine.shake {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0) rotate(0); }
  15% { transform: translateX(-6px) rotate(-1.6deg); }
  30% { transform: translateX(5px) rotate(1.6deg); }
  45% { transform: translateX(-4px) rotate(-1deg); }
  60% { transform: translateX(4px) rotate(1deg); }
  75% { transform: translateX(-2px) rotate(0); }
  90% { transform: translateX(2px) rotate(0); }
}

.cap {
  width: 132px;
  height: 44px;
  background: linear-gradient(#ffe3a3, #ffd98a 70%);
  border-radius: 16px 16px 8px 8px;
  position: relative;
  z-index: 4;
  margin-bottom: -6px;
  box-shadow: inset 0 3px 6px rgba(255, 255, 255, 0.8), 0 6px 14px rgba(214, 166, 90, 0.25);
}

.cap::after {
  content: "";
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 62px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(#ffdf9a, #f6c568);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.7);
}

.dome {
  width: 264px;
  height: 264px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.42);
  border: 5px solid rgba(255, 255, 255, 0.78);
  overflow: hidden;
  position: relative;
  z-index: 2;
  box-shadow:
    inset -16px -12px 28px rgba(173, 196, 240, 0.28),
    inset 12px 14px 30px rgba(255, 255, 255, 0.85),
    0 16px 30px rgba(206, 148, 180, 0.28);
  backdrop-filter: blur(2px);
}

.dome::before {
  content: "";
  position: absolute;
  left: 30px;
  top: 22px;
  width: 44px;
  height: 96px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  filter: blur(7px);
  transform: rotate(24deg);
  z-index: 3;
}

.gumballs {
  position: absolute;
  inset: 0;
  transform-origin: 50% 90%;
}

.gumballs.churn {
  animation: churn 0.8s ease-in-out;
}

@keyframes churn {
  0% { transform: rotate(0); }
  25% { transform: rotate(-9deg) translateY(4px); }
  50% { transform: rotate(8deg) translateY(-3px); }
  75% { transform: rotate(-5deg) translateY(2px); }
  100% { transform: rotate(0) translateY(0); }
}

.ball {
  position: absolute;
  border-radius: 50%;
  box-shadow:
    inset -4px -6px 8px rgba(0, 0, 0, 0.13),
    inset 4px 6px 8px rgba(255, 255, 255, 0.8);
}

.neck {
  width: 272px;
  height: 46px;
  background: linear-gradient(#f8b8c6, #f28aa0);
  border-radius: 18px 18px 34px 34px;
  margin-top: -46px;
  z-index: 3;
  box-shadow:
    inset 0 3px 6px rgba(255, 255, 255, 0.55),
    inset 0 -3px 6px rgba(214, 106, 120, 0.2);
}

.base {
  width: 300px;
  height: 214px;
  border-radius: 36px;
  background: linear-gradient(180deg, #ffb3c1, #ff9aa2 55%, #f28a9c);
  margin-top: -8px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 16px;
  gap: 13px;
  box-shadow:
    inset 0 6px 12px rgba(255, 255, 255, 0.55),
    0 20px 42px rgba(244, 127, 140, 0.35);
}

.label {
  background: #ffffff;
  color: var(--coral-deep);
  font-family: "Baloo 2", cursive;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 3px;
  padding: 6px 20px;
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(214, 106, 120, 0.18);
}

.press-btn {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  border: 6px solid #ffffff;
  background: radial-gradient(circle at 34% 28%, #ffe9ae, #ffcf6b 65%, #ffb84d);
  color: #ffffff;
  font-family: "Baloo 2", cursive;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow:
    0 9px 0 #e8a84e,
    0 16px 26px rgba(214, 106, 120, 0.35);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  user-select: none;
  text-shadow: 0 2px 4px rgba(190, 130, 40, 0.45);
}

.press-btn:active,
.press-btn.pressed {
  transform: translateY(7px) scale(0.96);
  box-shadow:
    0 2px 0 #e8a84e,
    0 6px 12px rgba(214, 106, 120, 0.3);
}

.press-btn:focus-visible {
  outline: 3px dashed #ffffff;
  outline-offset: 4px;
}

.dispenser {
  width: 96px;
  height: 38px;
  border-radius: 12px 12px 18px 18px;
  background: #d96a78;
  box-shadow: inset 0 5px 12px rgba(120, 30, 45, 0.35);
  position: relative;
}

.dispenser::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 8px;
  width: 80px;
  height: 12px;
  border-radius: 6px;
  background: #f39da9;
  box-shadow: 0 2px 4px rgba(120, 30, 45, 0.25);
}

.tray {
  width: 128px;
  height: 30px;
  border-radius: 50%;
  background: #ffffff;
  margin-top: 5px;
  box-shadow: 0 7px 16px rgba(214, 106, 120, 0.25);
  position: relative;
  z-index: 5;
}

.gumball-out {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  position: absolute;
  left: 50%;
  margin-left: -23px;
  bottom: 2px;
  transform: scale(0);
  box-shadow:
    inset -5px -7px 10px rgba(0, 0, 0, 0.15),
    inset 5px 7px 10px rgba(255, 255, 255, 0.85),
    0 7px 14px rgba(214, 106, 120, 0.25);
}

.gumball-out.pop {
  animation: ballDrop 1s cubic-bezier(0.3, 0.8, 0.4, 1) forwards;
}

@keyframes ballDrop {
  0% {
    transform: translateY(-235px) scale(0.2);
  }
  28% {
    transform: translateY(-40px) scale(1.08);
  }
  48% {
    transform: translateY(-10px) scale(0.95);
  }
  66% {
    transform: translateY(-27px) scale(1.03);
  }
  82% {
    transform: translateY(-6px) scale(0.98);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

.hint {
  margin-top: 24px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-soft);
}

.footer {
  margin-top: 34px;
  font-size: 12px;
  font-weight: 600;
  color: #bdbdc4;
  text-align: center;
}

.footer a {
  color: #bdbdc4;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: #8f8f98;
  text-decoration: underline;
}

.confetti {
  position: fixed;
  top: -24px;
  width: 12px;
  height: 12px;
  border-radius: 40%;
  z-index: 50;
  pointer-events: none;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  to {
    transform: translateY(108vh) rotate(560deg);
    opacity: 0.7;
  }
}

@media (max-width: 400px) {
  .logo {
    font-size: 36px;
  }

  .logo .domain {
    font-size: 26px;
  }

  .machine-scale {
    transform: scale(0.8);
    margin: -46px 0 -56px;
  }

  .speech-bubble {
    padding: 15px 20px;
  }

  .bubble-text {
    font-size: 17px;
  }
}
