:root {
  --bg-1: #ffe3ec;
  --bg-2: #fff4e6;
  --bg-3: #ffeaf4;
  --card: #fffafc;
  --ink: #5b3a4e;
  --ink-soft: #9c7688;
  --accent: #ff6f9c;
  --accent-strong: #e8548a;
  --ring: #ffb3cd;
  --radius: 24px;
  --shadow: 0 20px 60px rgba(232, 84, 138, 0.18);
  --font:
    ui-rounded, 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 20% -10%, var(--bg-3), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, var(--bg-2), transparent 55%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2));
  -webkit-font-smoothing: antialiased;
}

#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(28px, 6vw, 44px);
  text-align: center;
}

.view {
  display: grid;
  gap: 18px;
  justify-items: center;
}

.flower {
  font-size: 44px;
  line-height: 1;
}

.greet {
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  color: var(--accent-strong);
  letter-spacing: 0.01em;
}

.prompt {
  font-size: clamp(1rem, 4vw, 1.15rem);
  color: var(--ink-soft);
}

#form {
  display: grid;
  gap: 16px;
  width: 100%;
  margin-top: 6px;
}

#count {
  width: 100%;
  font-family: inherit;
  font-size: 2rem;
  text-align: center;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ring);
  border-radius: 16px;
  padding: 16px;
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

#count::placeholder {
  color: #e6c3d2;
}

#count:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 111, 156, 0.2);
}

/* hide number spinners for a cleaner look */
#count::-webkit-outer-spin-button,
#count::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#count {
  -moz-appearance: textfield;
  appearance: textfield;
}

.hint {
  color: var(--accent-strong);
  font-size: 0.95rem;
}

.btn {
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  border: none;
  border-radius: 16px;
  padding: 16px 20px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(232, 84, 138, 0.32);
  transition:
    transform 0.12s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.btn:hover {
  filter: brightness(1.03);
}
.btn:active {
  transform: translateY(1px) scale(0.99);
}
.btn:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 3px;
}

.badge {
  font-size: 56px;
  line-height: 1;
  animation: pop 0.5s cubic-bezier(0.2, 0.8, 0.2, 1.4) both;
}

.message {
  font-size: clamp(1.25rem, 5vw, 1.6rem);
  font-weight: 600;
  color: var(--accent-strong);
  line-height: 1.4;
}

.count-note {
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.link {
  margin-top: 6px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 8px 12px;
  border-radius: 10px;
}
.link:hover {
  color: var(--accent-strong);
}
.link:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 2px;
}

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

@keyframes pop {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .badge,
  .btn,
  #count {
    animation: none;
    transition: none;
  }
}
