:root {
  --accent: #FF69B4;
  --accent-dark: #e85aa8;
  --border-light: #FFB6C1;
  --radius-frame: 32px;
  --radius-input: 20px;
  --font: 'Poppins', sans-serif;
  --title-font: 'Great Vibes', cursive;
  --toast-duration: 1s;
  --toast-enter: 0.3s;
  --toast-exit: 0.3s;
  --toast-offset: 60px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font);
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font);
  background-color: #fff6f9;
  overflow: hidden;
  position: relative;
  color: #222;
  transition: background-color 3s ease, color 3s ease;
  min-height: 100vh;
}

body.dark {
  background-color: #000;
  color: #fff;
}

.prompt-box {
  background: #fff;
  border: 3px solid var(--accent);
  border-radius: var(--radius-frame);
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.prompt-text {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1rem;
}

.input-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
}

.input-group input {
  flex: 1;
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-input);
  outline: none;
  background: #faf5fb;
}

.input-group input:focus {
  border-color: var(--accent);
}

.submit-btn {
  width: 44px;
  height: 44px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .15s ease;
}

.submit-btn:hover {
  transform: scale(1.08);
}

.submit-btn svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.error-toast {
  position: fixed;
  right: 20px;
  background: rgba(255,0,0,0.9);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 16px;
  font-weight: 600;
  animation:
    toastIn var(--toast-enter) ease-out forwards,
    toastOut var(--toast-exit) ease-in forwards var(--toast-duration);
  opacity: 0;
  z-index: 300;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.flower {
  border-radius: 50%;
  position: absolute;
  pointer-events: none;
  will-change: transform, opacity;
  overflow: visible;
  background: rgb(124, 86, 34);
}
.petal {
  position: absolute;
  width: inherit;
  height: inherit;
  top: 0;
  left: 0;
  opacity: inherit;
}

#celebration {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1.05);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 28px;
  padding: clamp(1.8rem, 2.5vw, 2.5rem) clamp(2rem, 3vw, 3rem) clamp(2rem, 3vw, 3rem);
  color: #fff;
  text-align: center;
  width: 88vw;
  max-width: 900px;
  opacity: 0;
  transition: opacity .6s ease, transform .6s ease;
  z-index: 200;
  overflow: visible;
}
#celebration.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.05);
}

.celebration-inner {
  position: relative;
  padding-bottom: 1rem;
}

#celebration-title {
  font-family: var(--title-font), cursive, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  font-size: clamp(1.8rem, 5vw, 4rem);
  margin: 0;
  line-height: 1;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  display: block;
  width: 100%;
}

.underline {
  width: 75%;
  height: 6px;
  margin: 12px auto 0;
  background: linear-gradient(90deg, var(--accent) 0%, #fff 100%);
  border-radius: 4px;
}

.cursor {
  display: inline-block;
  width: 1px;
  margin-left: 4px;
  background: currentColor;
  animation: blink 0.8s step-start infinite;
  height: 1.2em;
  vertical-align: middle;
}

@keyframes blink {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

.photo-section {
  margin-top: 1.8rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .5s ease, transform .5s ease;
}
#celebration.show .photo-section {
  opacity: 1;
  transform: translateY(0);
}

.photo-gallery {
  display: flex;
  gap: 0.85rem;
  margin: 0 auto;
  max-width: 100%;
  justify-content: center;
  flex-wrap: nowrap;
}

.photo-placeholder {
  flex: 1 1 0;
  max-width: 300px;
  min-width: 0;
  aspect-ratio: 3 / 2;
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #fff;
  border: 1.5px dashed var(--accent);
  backdrop-filter: blur(6px);
  transition: transform .25s ease, opacity .5s ease;
  opacity: 0;
  transform: translateY(12px);
  cursor: pointer;
  overflow: hidden;
}
.photo-placeholder.visible {
  opacity: 1;
  transform: translateY(0);
}
.photo-placeholder:hover {
  transform: translateY(-2px) scale(1.03);
}

.photo-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.placeholder-text {
  margin-top: 1.25rem;
  font-size: clamp(0.95rem, 1vw, 1.15rem);
  line-height: 1.4;
  background: rgba(255,255,255,0.07);
  padding: 1.25rem 1.5rem;
  border-radius: 14px;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .5s ease .3s, transform .5s ease .3s;
  font-weight: 500;
  position: relative;
  backdrop-filter: blur(4px);
}
#celebration.show .placeholder-text {
  opacity: 1;
  transform: translateY(0);
}