:root {
  color-scheme: only light;
  --ink: #2b1416;
  --cream: #fff0f5;
  --rose: #ffd2e3;
  --rose-strong: #f06b8a;
  --copper: #d85278;
  --blush: #ffe2eb;
  --golden: #f4b6c2;
  --shadow: rgba(43, 20, 22, 0.15);
  --glow: rgba(240, 107, 138, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Optima", "Candara", "Georgia", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, #ffeaf3 0%, transparent 46%),
    radial-gradient(circle at 90% 12%, #ffd4e6 0%, transparent 52%),
    radial-gradient(circle at 78% 75%, #ffe7f1 0%, transparent 48%),
    linear-gradient(135deg, #fff7fb 0%, #ffe2ee 52%, #ffd3e2 100%);
  overflow-x: hidden;
}

.bg-orbit {
  position: fixed;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  border: 2px dashed rgba(216, 82, 120, 0.24);
  top: -140px;
  right: -160px;
  animation: spin 26s linear infinite;
  z-index: 0;
}

.bg-orbit.second {
  width: 320px;
  height: 320px;
  border: 2px solid rgba(240, 107, 138, 0.24);
  top: auto;
  bottom: -120px;
  left: -120px;
  animation-direction: reverse;
}

.love-rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.love-rain span {
  position: absolute;
  font-size: clamp(1rem, 2.6vw, 1.6rem);
  color: rgba(216, 82, 120, 0.25);
  animation: drift 10s ease-in-out infinite;
}

.love-rain span:nth-child(1) { left: 8%; top: 12%; animation-duration: 9s; }
.love-rain span:nth-child(2) { left: 18%; top: 62%; animation-duration: 12s; }
.love-rain span:nth-child(3) { left: 32%; top: 22%; animation-duration: 11s; }
.love-rain span:nth-child(4) { left: 44%; top: 70%; animation-duration: 13s; }
.love-rain span:nth-child(5) { left: 58%; top: 14%; animation-duration: 10s; }
.love-rain span:nth-child(6) { left: 70%; top: 46%; animation-duration: 12.5s; }
.love-rain span:nth-child(7) { left: 84%; top: 18%; animation-duration: 9.5s; }
.love-rain span:nth-child(8) { left: 12%; top: 34%; animation-duration: 11.5s; }
.love-rain span:nth-child(9) { left: 28%; top: 84%; animation-duration: 10.5s; }
.love-rain span:nth-child(10) { left: 62%; top: 78%; animation-duration: 12s; }
.love-rain span:nth-child(11) { left: 76%; top: 8%; animation-duration: 9s; }
.love-rain span:nth-child(12) { left: 90%; top: 62%; animation-duration: 13.5s; }

.heart-burst {
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: none;
  z-index: 3;
}

.heart-burst.active {
  display: block;
}

.heart-burst span {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: clamp(1.2rem, 3vw, 2.1rem);
  color: rgba(229, 62, 108, 0.92);
  text-shadow: 0 10px 22px rgba(240, 107, 138, 0.55);
  transform: translate(-50%, -50%) scale(0.2);
  animation: burst 2.2s ease-out forwards;
  animation-delay: var(--delay, 0s);
}

.stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  max-width: 980px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4rem;
}

.hero {
  display: grid;
  gap: 1rem;
  text-align: center;
  padding: 2rem 2.5rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 234, 243, 0.8));
  border-radius: 28px;
  box-shadow: 0 20px 50px var(--shadow);
  backdrop-filter: blur(6px);
  animation: rise 0.9s ease-out;
}

.badge {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--copper);
}

.hero h1 {
  font-family: "Didot", "Bodoni 72", "Garamond", serif;
  font-size: clamp(2.3rem, 4vw, 3.4rem);
  margin: 0;
}

.subtitle {
  font-size: 1.05rem;
  margin: 0;
  color: rgba(43, 20, 22, 0.72);
}

.spark {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  font-size: 1.3rem;
  color: var(--rose-strong);
  animation: float 3.8s ease-in-out infinite;
}

.game {
  display: grid;
  gap: 1.6rem;
}

.progress {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  font-size: 1.4rem;
}

.progress .heart {
  color: rgba(200, 79, 79, 0.35);
  transition: transform 0.3s ease, color 0.3s ease;
}

.progress .heart.active {
  color: var(--rose-strong);
  transform: scale(1.2);
}

.puzzle-grid {
  display: grid;
  gap: 1.4rem;
}

.puzzle {
  padding: 1.6rem 1.8rem;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 226, 238, 0.86));
  box-shadow: 0 16px 30px var(--shadow);
  border: 1px solid rgba(240, 107, 138, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.puzzle:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 36px rgba(43, 20, 22, 0.18);
}

.puzzle h2 {
  margin-top: 0;
  font-size: 1.2rem;
}

.answer-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem;
  margin: 1rem 0 0.4rem;
}

input[type="text"] {
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(216, 82, 120, 0.35);
  font-size: 1rem;
  font-family: inherit;
  background: #fff7fb;
  outline: none;
}

input[type="text"]:focus {
  border-color: var(--rose-strong);
  box-shadow: 0 0 0 3px var(--glow);
}

button {
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--rose-strong), var(--copper));
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 16px rgba(200, 79, 79, 0.3);
}

button:disabled {
  cursor: default;
  opacity: 0.65;
  box-shadow: none;
}

.status {
  font-size: 0.9rem;
  color: rgba(43, 20, 22, 0.55);
}

.puzzle.solved {
  border-color: rgba(236, 153, 180, 0.6);
  background: linear-gradient(135deg, rgba(255, 240, 247, 0.95), rgba(255, 223, 235, 0.9));
}

.puzzle.solved .status {
  color: #c05377;
}

.gift {
  display: none;
  justify-content: center;
  animation: rise 0.8s ease-out;
}

.gift.visible {
  display: flex;
}

.gift-card {
  text-align: center;
  padding: 2rem 2.5rem;
  border-radius: 26px;
  background: linear-gradient(135deg, #fff0f5, #ffd6e4);
  box-shadow: 0 20px 45px var(--shadow);
  max-width: 520px;
}

.download {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.8rem 1.8rem;
  border-radius: 999px;
  background: #2b1416;
  color: #fff0f5;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: transform 0.2s ease, background 0.2s ease;
}

.download:hover {
  transform: translateY(-2px) scale(1.02);
  background: #3a1b1d;
}

.hint {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  color: rgba(43, 20, 22, 0.6);
}

@media (max-width: 720px) {
  .answer-row {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform:
      translate(calc(-50% + var(--x)), calc(-50% + var(--y)))
      rotate(var(--spin))
      scale(var(--scale));
  }
}

@keyframes drift {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0.4;
  }
  50% {
    transform: translateY(-18px) translateX(8px) rotate(6deg);
    opacity: 0.65;
  }
  100% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0.4;
  }
}
