:root {
  --pink: #ff6f9c;
  --pink-dark: #e84f80;
  --pink-light: #ffd6e4;
  --lavender: #e6dcff;
  --text: #5a3a4a;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Quicksand", sans-serif;
  color: var(--text);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 20px 16px;
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

button, .activity, input, textarea {
  touch-action: manipulation;
}

#confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 50;
}

.confetti-piece {
  position: absolute;
  top: -30px;
  animation: fall linear forwards;
}

@keyframes fall {
  to { transform: translateY(110vh) rotate(720deg); }
}

.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 28px;
  padding: 36px 28px;
  text-align: center;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.85) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.emoji {
  font-size: 72px;
  line-height: 1;
  margin-bottom: 14px;
  display: inline-block;
}

.side-eye { display: inline-block; animation: sideEye 3s ease-in-out infinite; }
.side-eye.inline { font-size: 1.2em; }

@keyframes sideEye {
  0%, 20% { transform: translateX(0) scaleX(1); }
  30%, 45% { transform: translateX(-8px) scaleX(1); }
  55%, 70% { transform: translateX(8px) scaleX(-1); }
  80%, 100% { transform: translateX(0) scaleX(1); }
}

.peek {
  position: absolute;
  top: -26px;
  right: 22px;
  font-size: 40px;
  line-height: 1;
  animation: peek 5s ease-in-out infinite;
  filter: drop-shadow(0 4px 6px rgba(232, 79, 128, 0.25));
}

@keyframes peek {
  0%, 15% { transform: translateY(14px) scaleX(1); opacity: 0; }
  25%, 45% { transform: translateY(0) scaleX(1); opacity: 1; }
  55%, 75% { transform: translateY(0) scaleX(-1); opacity: 1; }
  85%, 100% { transform: translateY(14px) scaleX(-1); opacity: 0; }
}

.pumpkin {
  width: 84px;
  height: 84px;
  display: block;
}

.bounce { animation: bounce 1.6s ease-in-out infinite; }
.wiggle { animation: wiggle 1.2s ease-in-out infinite; }
.heartbeat { animation: heartbeat 1.1s ease-in-out infinite; }

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.18); }
  30% { transform: scale(1); }
  45% { transform: scale(1.12); }
}

h1 {
  font-family: "Pacifico", cursive;
  font-weight: 400;
  color: var(--pink-dark);
  font-size: 2rem;
  margin-bottom: 10px;
  line-height: 1.3;
}

p {
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 8px;
}

.buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 22px;
}

.buttons.column {
  flex-direction: column;
  align-items: stretch;
}

.btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .btn:hover { transform: translateY(-2px) scale(1.04); }
  .activity:hover { transform: translateY(-2px); }
}

.btn:active { transform: scale(0.96); }

.btn.primary {
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  color: white;
  box-shadow: 0 8px 20px rgba(232, 79, 128, 0.35);
}

.btn.secondary {
  background: var(--white);
  color: var(--pink-dark);
  border: 2px solid var(--pink-light);
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

#runaway-no {
  transition: left 0.25s ease, top 0.25s ease, transform 0.15s ease;
  z-index: 20;
}

#runaway-no.running {
  position: fixed;
  flex: none;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
}

.activities {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0 18px;
}

.activity {
  font-family: inherit;
  background: var(--white);
  border: 2px solid var(--pink-light);
  border-radius: 18px;
  padding: 12px 8px;
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.activity .icon {
  display: block;
  font-size: 30px;
  margin-bottom: 4px;
}

.activity:active { transform: scale(0.95); }

.activity.selected {
  background: var(--pink-light);
  border-color: var(--pink);
  box-shadow: 0 6px 16px rgba(255, 111, 156, 0.3);
}

.field {
  display: block;
  text-align: left;
  margin-bottom: 12px;
}

.field span {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.field input,
.field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid var(--pink-light);
  background: var(--white);
  color: var(--text);
  outline: none;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--pink);
}

.error {
  color: var(--pink-dark);
  font-weight: 600;
  font-size: 0.95rem;
  min-height: 1.4em;
}

.status {
  margin-top: 18px;
  font-size: 0.9rem;
  opacity: 0.75;
}

@media (max-width: 420px) {
  .card { padding: 28px 18px; border-radius: 24px; }
  h1 { font-size: 1.65rem; }
  p { font-size: 1rem; }
  .emoji { font-size: 60px; }
  .btn { padding: 15px 24px; min-height: 52px; }
  .buttons:not(.column) .btn { flex: 1 1 40%; }
  .activity { padding: 10px 4px; font-size: 0.85rem; }
  .activity .icon { font-size: 26px; }
}

@media (max-height: 640px) {
  .emoji { font-size: 48px; margin-bottom: 8px; }
  .card { padding-top: 22px; padding-bottom: 22px; }
}
