:root {
  --ink: #4a2c2a;
  --cream: #fff4d6;
  --cream-deep: #ffe1a8;
  --pink: #ff8fbe;
  --blue: #8fd7ff;
  --yellow: #ffd86d;
  --mint: #95e6c8;
  --lavender: #cbb4ff;
  --brown: #9b6548;
  --shadow: rgba(91, 55, 34, 0.2);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  overscroll-behavior: none;
  color: var(--ink);
  font-family: Inter, ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  background:
    radial-gradient(circle at 44px 44px, rgba(255, 255, 255, 0.38) 0 5px, transparent 6px),
    radial-gradient(circle at 92px 118px, rgba(255, 143, 190, 0.22) 0 7px, transparent 8px),
    radial-gradient(circle at 154px 72px, rgba(149, 230, 200, 0.2) 0 6px, transparent 7px),
    radial-gradient(circle at 18% 16%, rgba(255, 143, 190, 0.38) 0 42px, transparent 43px),
    radial-gradient(circle at 82% 18%, rgba(143, 215, 255, 0.42) 0 52px, transparent 53px),
    radial-gradient(circle at 16% 84%, rgba(255, 216, 109, 0.38) 0 46px, transparent 47px),
    linear-gradient(180deg, #fff8dc 0%, #ffe7f0 46%, #dff5ff 100%);
  background-size: 180px 180px, 210px 210px, 240px 240px, auto, auto, auto, auto;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  font: inherit;
  -webkit-touch-callout: none;
}

.app {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.seo-summary {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#gameCanvas {
  position: fixed;
  inset: 0;
  z-index: 2;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  touch-action: none;
}

.party-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.party-decor::before,
.party-decor::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.38;
  background-image:
    linear-gradient(45deg, transparent 45%, #ff74a8 46% 54%, transparent 55%),
    linear-gradient(-45deg, transparent 45%, #79cff9 46% 54%, transparent 55%),
    radial-gradient(circle, #ffc445 0 3px, transparent 4px);
  background-position: 14px 34px, 88px 112px, 46px 86px;
  background-size: 116px 116px, 148px 148px, 132px 132px;
}

.party-decor::after {
  opacity: 0.26;
  transform: rotate(8deg) scale(1.1);
  background-position: 62px 18px, 34px 92px, 110px 140px;
}

.garland {
  position: absolute;
  top: 18px;
  width: 150px;
  height: 44px;
  background:
    linear-gradient(135deg, transparent 47%, rgba(74, 44, 42, 0.28) 48% 52%, transparent 53%),
    linear-gradient(45deg, transparent 47%, rgba(74, 44, 42, 0.28) 48% 52%, transparent 53%);
}

.garland::before,
.garland::after {
  content: "";
  position: absolute;
  top: 20px;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 24px solid var(--pink);
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.08));
}

.garland::before {
  left: 36px;
  border-top-color: var(--blue);
}

.garland::after {
  right: 34px;
  border-top-color: var(--yellow);
}

.garland-a {
  left: -18px;
  transform: rotate(-8deg);
}

.garland-b {
  right: -14px;
  transform: rotate(8deg);
}

.balloon {
  position: absolute;
  width: 42px;
  height: 54px;
  border-radius: 52% 52% 48% 48%;
  box-shadow: inset -9px -10px 0 rgba(0, 0, 0, 0.08), 0 10px 16px rgba(0, 0, 0, 0.08);
  animation: floaty 4s ease-in-out infinite;
}

.balloon::after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: -30px;
  width: 1px;
  height: 34px;
  background: rgba(74, 44, 42, 0.28);
}

.balloon-pink {
  left: 7vw;
  top: 18vh;
  background: var(--pink);
}

.balloon-blue {
  right: 8vw;
  top: 20vh;
  background: var(--blue);
  animation-delay: -1.4s;
}

.balloon-yellow {
  right: 15vw;
  bottom: 14vh;
  background: var(--yellow);
  animation-delay: -2.2s;
}

.balloon-mint {
  left: 24vw;
  bottom: 11vh;
  width: 34px;
  height: 45px;
  background: var(--mint);
  animation-delay: -3s;
}

.star {
  position: absolute;
  color: #ffc445;
  font-size: 24px;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.06);
  animation: twinkle 1.5s ease-in-out infinite;
}

.star-a {
  left: 18vw;
  top: 10vh;
}

.star-b {
  right: 24vw;
  top: 12vh;
  animation-delay: -0.6s;
}

.star-c {
  left: 52vw;
  bottom: 18vh;
  color: #ff8fbe;
  font-size: 20px;
  animation-delay: -1s;
}

.candy {
  position: absolute;
  width: 36px;
  height: 18px;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, #fff 0 7px, #ff74a8 7px 14px);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.06);
}

.candy-a {
  left: 9vw;
  bottom: 18vh;
  transform: rotate(18deg);
}

.candy-b {
  right: 8vw;
  top: 42vh;
  transform: rotate(-22deg);
}

.candy-c {
  left: 44vw;
  top: 17vh;
  width: 30px;
  transform: rotate(-12deg);
  background: repeating-linear-gradient(90deg, #fff 0 6px, #8fd7ff 6px 12px);
}

.party-hat {
  position: absolute;
  width: 0;
  height: 0;
  border-left: 22px solid transparent;
  border-right: 22px solid transparent;
  border-bottom: 62px solid #cdb7ff;
  filter: drop-shadow(0 8px 0 rgba(91, 55, 34, 0.08));
  animation: bob 4.8s ease-in-out infinite;
}

.party-hat::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 22px;
  width: 36px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 15px 0 rgba(255, 255, 255, 0.72);
}

.party-hat::after {
  content: "";
  position: absolute;
  left: -7px;
  top: 58px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffc445;
}

.hat-a {
  left: 5vw;
  top: 56vh;
  transform: rotate(-14deg);
}

.hat-b {
  right: 5vw;
  bottom: 27vh;
  border-bottom-color: #ff9ec9;
  transform: rotate(15deg) scale(0.82);
  animation-delay: -1.7s;
}

.gift {
  position: absolute;
  width: 48px;
  height: 42px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 38%, rgba(255, 255, 255, 0.72) 39% 59%, transparent 60%),
    linear-gradient(180deg, transparent 34%, rgba(255, 255, 255, 0.72) 35% 53%, transparent 54%),
    #8fd7ff;
  box-shadow: 0 8px 0 rgba(91, 55, 34, 0.08);
  animation: bob 5.4s ease-in-out infinite;
}

.gift::before,
.gift::after {
  content: "";
  position: absolute;
  top: -16px;
  width: 20px;
  height: 18px;
  border: 5px solid #ff74a8;
  border-radius: 50% 50% 4px 50%;
}

.gift::before {
  left: 5px;
  transform: rotate(22deg);
}

.gift::after {
  right: 5px;
  transform: rotate(-68deg);
}

.gift-a {
  left: 4vw;
  bottom: 8vh;
}

.gift-b {
  right: 28vw;
  top: 9vh;
  width: 38px;
  height: 34px;
  background:
    linear-gradient(90deg, transparent 38%, rgba(255, 255, 255, 0.72) 39% 59%, transparent 60%),
    linear-gradient(180deg, transparent 34%, rgba(255, 255, 255, 0.72) 35% 53%, transparent 54%),
    #ffd86d;
  transform: rotate(10deg);
  animation-delay: -2s;
}

.lollipop {
  position: absolute;
  width: 36px;
  height: 36px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: conic-gradient(#ff74a8 0 25%, #fff0a8 0 50%, #8fd7ff 0 75%, #95e6c8 0);
  box-shadow: 0 8px 0 rgba(91, 55, 34, 0.08);
  animation: spinFloat 7s ease-in-out infinite;
}

.lollipop::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 31px;
  width: 5px;
  height: 38px;
  border-radius: 999px;
  background: #9b6548;
  transform: translateX(-50%);
}

.lollipop-a {
  right: 4vw;
  top: 58vh;
}

.lollipop-b {
  left: 31vw;
  top: 8vh;
  width: 28px;
  height: 28px;
  animation-delay: -2.8s;
}

.cloud {
  position: absolute;
  width: 78px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 8px 18px rgba(91, 55, 34, 0.05);
  animation: cloudDrift 9s ease-in-out infinite;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  bottom: 9px;
  border-radius: 50%;
  background: inherit;
}

.cloud::before {
  left: 13px;
  width: 30px;
  height: 30px;
}

.cloud::after {
  right: 13px;
  width: 38px;
  height: 38px;
}

.cloud-a {
  left: 11vw;
  top: 32vh;
}

.cloud-b {
  right: 17vw;
  bottom: 8vh;
  transform: scale(0.78);
  animation-delay: -3.5s;
}

.screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 220ms ease, transform 220ms ease;
  z-index: 5;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.screen-visible {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}

.panel {
  width: min(92vw, 520px);
  padding: clamp(24px, 7vw, 40px);
  border: 3px solid rgba(74, 44, 42, 0.12);
  border-radius: 28px;
  background: rgba(255, 250, 232, 0.9);
  box-shadow: 0 20px 45px var(--shadow), inset 0 0 0 6px rgba(255, 255, 255, 0.45);
  text-align: center;
  backdrop-filter: blur(8px);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.start-panel,
.invite-panel {
  animation: popIn 420ms cubic-bezier(0.2, 1.25, 0.34, 1) both;
}

.eyebrow {
  margin: 0 0 10px;
  color: #bd5c7e;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: #593231;
  line-height: 0.98;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(3rem, 15vw, 5.4rem);
}

.game-title {
  display: grid;
  gap: 2px;
  justify-items: center;
  font-size: clamp(2.75rem, 14vw, 5.1rem);
  line-height: 0.86;
  text-align: center;
  text-wrap: balance;
  text-shadow:
    0 4px 0 #fff8dc,
    0 9px 18px rgba(91, 55, 34, 0.14);
}

.game-title span {
  display: block;
  white-space: nowrap;
}

.game-title span:nth-child(2) {
  color: #e94889;
}

.game-title span:nth-child(3) {
  color: #2c8fc4;
}

h2 {
  font-size: clamp(2.1rem, 10vw, 4rem);
}

.subtitle,
.panel p {
  font-size: clamp(1rem, 4.4vw, 1.28rem);
  line-height: 1.38;
}

.subtitle {
  margin: 16px auto 28px;
  max-width: 15rem;
}

.primary-button,
.secondary-button {
  min-height: 58px;
  min-width: 180px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 16px 22px;
  color: #fff;
  background: linear-gradient(180deg, #ff79ad, #e94889);
  box-shadow: 0 9px 0 #b93367, 0 16px 28px rgba(169, 46, 96, 0.26);
  font-weight: 1000;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.secondary-button {
  color: #5b342f;
  background: linear-gradient(180deg, #fff, #ffe8a8);
  box-shadow: 0 8px 0 #e4b85e, 0 14px 24px rgba(132, 87, 31, 0.18);
}

.primary-button:active,
.secondary-button:active,
.cake-button:active {
  transform: translateY(5px) scale(0.98);
  box-shadow: 0 4px 0 rgba(99, 54, 56, 0.45), 0 8px 16px rgba(132, 87, 31, 0.18);
}

.hud {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.pill {
  min-width: 112px;
  padding: 10px 18px;
  border-radius: 999px;
  color: #57312f;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 22px rgba(91, 55, 34, 0.12);
  font-weight: 1000;
  text-align: center;
}

.feedback {
  position: absolute;
  top: 62px;
  left: 50%;
  width: min(86vw, 360px);
  transform: translateX(-50%) scale(0.8);
  color: #ff4f91;
  font-size: clamp(2.2rem, 11vw, 4rem);
  font-weight: 1000;
  text-align: center;
  text-shadow: 0 4px 0 #fff, 0 10px 24px rgba(91, 55, 34, 0.18);
  opacity: 0;
}

.feedback.show {
  animation: feedbackPop 900ms ease both;
}

.cake-button {
  width: min(72vw, 260px);
  aspect-ratio: 1;
  margin-top: 6px;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle, #fffdf2, #ffddee);
  box-shadow: 0 12px 0 #ef9ac1, 0 22px 36px rgba(141, 62, 95, 0.22);
  cursor: pointer;
  touch-action: manipulation;
}

.mini-cake {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.mini-layer {
  position: absolute;
  left: 50%;
  height: 32px;
  border-radius: 15px 15px 11px 11px;
  transform: translateX(-50%);
  box-shadow: inset 0 -7px 0 rgba(0, 0, 0, 0.08);
}

.mini-layer.top {
  top: 78px;
  width: 118px;
  background: #ff9ec9;
}

.mini-layer.mid {
  top: 109px;
  width: 150px;
  background: #fff1a6;
}

.mini-layer.base {
  top: 140px;
  width: 180px;
  background: #94d9ff;
}

.mini-candles {
  position: absolute;
  top: 48px;
  left: 50%;
  display: flex;
  gap: 15px;
  transform: translateX(-50%);
}

.mini-candles i {
  position: relative;
  display: block;
  width: 8px;
  height: 34px;
  border-radius: 999px;
  background: repeating-linear-gradient(180deg, #fff 0 7px, #ff679b 7px 14px);
}

.mini-candles i::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -15px;
  width: 14px;
  height: 18px;
  border-radius: 50% 50% 45% 45%;
  background: #ffc638;
  transform: translateX(-50%);
  box-shadow: 0 0 18px rgba(255, 198, 56, 0.78);
  animation: flame 360ms ease-in-out infinite alternate;
}

.cake-button.blown .mini-candles i::before {
  opacity: 0;
  transform: translateX(-50%) scale(0.2);
}

.blow-meter {
  height: 12px;
  width: min(76vw, 280px);
  margin: 22px auto 0;
  border-radius: 999px;
  background: rgba(91, 55, 34, 0.14);
  overflow: hidden;
}

.blow-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--mint), var(--yellow));
  transition: width 120ms ease;
}

.invite-details {
  margin: 22px 0;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.52);
}

.invite-details p {
  margin: 8px 0;
  font-weight: 900;
}

.detail-label {
  margin-top: 14px;
  color: #bd5c7e;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.invite-details .detail-main {
  margin-top: 2px;
  color: #593231;
  font-size: clamp(1.35rem, 6vw, 2rem);
  line-height: 1.1;
}

.invite-details .detail-address {
  margin-top: 2px;
  color: #2c6f8f;
  font-size: clamp(1.05rem, 4.7vw, 1.35rem);
  line-height: 1.28;
}

.button-row {
  display: grid;
  gap: 12px;
}

.confetti {
  position: fixed;
  top: -24px;
  z-index: 9;
  width: 10px;
  height: 18px;
  border-radius: 3px;
  pointer-events: none;
  animation: confettiFall var(--fall-time, 1800ms) linear forwards;
}

@keyframes floaty {
  50% {
    transform: translateY(-14px) rotate(3deg);
  }
}

@keyframes twinkle {
  50% {
    transform: scale(1.25) rotate(12deg);
    opacity: 0.64;
  }
}

@keyframes bob {
  50% {
    translate: 0 -12px;
  }
}

@keyframes spinFloat {
  50% {
    translate: 0 -10px;
    rotate: 12deg;
  }
}

@keyframes cloudDrift {
  50% {
    translate: 16px -6px;
  }
}

@keyframes popIn {
  from {
    transform: scale(0.88);
    opacity: 0;
  }
}

@keyframes feedbackPop {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(12px) scale(0.7);
  }
  24%,
  70% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-12px) scale(0.9);
  }
}

@keyframes flame {
  from {
    transform: translateX(-50%) scale(0.86) rotate(-5deg);
  }
  to {
    transform: translateX(-50%) scale(1.08) rotate(6deg);
  }
}

@keyframes confettiFall {
  to {
    transform: translate3d(var(--drift, 0), 110vh, 0) rotate(720deg);
    opacity: 0.2;
  }
}

@media (min-width: 720px) {
  .button-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .primary-button,
  .secondary-button {
    min-width: 0;
  }
}

@media (max-height: 640px) {
  .panel {
    padding: 20px;
  }

  h1 {
    font-size: clamp(2.6rem, 12vw, 4.6rem);
  }

  .game-title {
    font-size: clamp(2.3rem, 10vw, 3.8rem);
    line-height: 0.88;
  }

  h2 {
    font-size: clamp(1.9rem, 8vw, 3.2rem);
  }

  .subtitle,
  .panel p {
    font-size: 1rem;
  }
}
