:root {
  --background: 336 72% 96%;
  --foreground: 335 58% 13%;
  --primary: 335 88% 51%;
  --primary-foreground: 0 0% 100%;
  --secondary: 29 91% 55%;
  --secondary-foreground: 335 58% 13%;
  --muted: 336 35% 90%;
  --muted-foreground: 335 23% 39%;
  --destructive: 0 80% 52%;
  --destructive-foreground: 0 0% 100%;
  --border: 335 36% 82%;
  --card: 0 0% 100%;
  --shadow-sm: 0 8px 22px hsl(335 88% 30% / 0.12);
  --shadow-md: 0 16px 45px hsl(335 88% 30% / 0.18);
  --shadow-lg: 0 28px 75px hsl(335 88% 25% / 0.26);
  --transition-fast: 160ms ease;
  --transition-smooth: 420ms cubic-bezier(.2,.8,.2,1);
  --radius-sm: 0.75rem;
  --radius-md: 1.15rem;
  --radius-lg: 1.6rem;
}

.dark {
  --background: 335 61% 8%;
  --foreground: 336 100% 96%;
  --primary: 335 92% 62%;
  --primary-foreground: 0 0% 100%;
  --secondary: 31 93% 61%;
  --secondary-foreground: 335 61% 8%;
  --muted: 335 35% 16%;
  --muted-foreground: 336 30% 78%;
  --destructive: 0 78% 58%;
  --destructive-foreground: 0 0% 100%;
  --border: 335 32% 25%;
  --card: 335 45% 12%;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 20% 10%, hsl(29 91% 75% / 0.45), transparent 28rem),
    radial-gradient(circle at 80% 18%, hsl(335 88% 70% / 0.35), transparent 26rem),
    linear-gradient(145deg, hsl(var(--background)), hsl(336 72% 91%));
  color: hsl(var(--foreground));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.hero-title {
  letter-spacing: -0.07em;
  text-shadow: 0 12px 35px hsl(335 88% 35% / 0.18);
}

.floating-heart {
  position: absolute;
  bottom: -40px;
  color: hsl(var(--primary));
  animation: floatHeart 8s linear infinite;
  filter: drop-shadow(0 8px 14px hsl(335 88% 40% / 0.22));
}

@keyframes floatHeart {
  0% { transform: translateY(0) rotate(0deg) scale(0.85); }
  100% { transform: translateY(-110vh) rotate(360deg) scale(1.25); }
}

.scene-card {
  background: linear-gradient(145deg, hsl(335 100% 93% / 0.72), hsl(29 100% 89% / 0.78));
  box-shadow: var(--shadow-lg), inset 0 1px 0 hsl(0 0% 100% / 0.7);
  perspective: 900px;
  overflow: hidden;
}

.moon-glow {
  position: absolute;
  width: 210px;
  height: 210px;
  right: -35px;
  top: -35px;
  border-radius: 999px;
  background: radial-gradient(circle, hsl(0 0% 100% / 0.95), hsl(29 100% 78% / 0.1) 65%);
  filter: blur(1px);
}

.gift-box-3d {
  position: absolute;
  left: 50%;
  top: 45%;
  width: 190px;
  height: 180px;
  transform: translate(-50%, -50%) rotateX(58deg) rotateZ(-18deg);
  transform-style: preserve-3d;
  animation: giftFloat 4s ease-in-out infinite;
}

@keyframes giftFloat {
  0%, 100% { transform: translate(-50%, -50%) rotateX(58deg) rotateZ(-18deg) translateY(0); }
  50% { transform: translate(-50%, -50%) rotateX(58deg) rotateZ(-18deg) translateY(-18px); }
}

.gift-body, .gift-lid {
  position: absolute;
  left: 0;
  width: 190px;
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(335 92% 37%));
  border-radius: 20px;
  box-shadow: 0 24px 40px hsl(335 88% 25% / 0.35);
}
.gift-body { bottom: 0; height: 125px; display: grid; place-items: center; color: white; font-weight: 1000; letter-spacing: 0.18em; }
.gift-lid { top: 0; height: 58px; transform: translateZ(38px); background: linear-gradient(135deg, hsl(29 95% 62%), hsl(335 92% 57%)); }
.gift-ribbon-v, .gift-ribbon-h { position: absolute; background: hsl(0 0% 100% / 0.82); border-radius: 12px; }
.gift-ribbon-v { left: 82px; top: 0; width: 26px; height: 180px; }
.gift-ribbon-h { left: 0; top: 78px; width: 190px; height: 24px; }

.cake-panel { position: relative; overflow: hidden; }
.cake-scene {
  min-height: 330px;
  position: relative;
  display: grid;
  place-items: center;
  perspective: 900px;
  border-radius: 1.5rem;
  background: radial-gradient(circle at center, hsl(29 100% 86% / 0.65), hsl(335 100% 94% / 0.35) 55%, transparent);
}
.cake-3d {
  position: relative;
  width: 260px;
  height: 220px;
  transform: rotateX(54deg) rotateZ(-8deg);
  transform-style: preserve-3d;
  transition: transform var(--transition-smooth);
}
.cake-scene.is-cut .cake-3d { transform: rotateX(54deg) rotateZ(-8deg) translateX(-8px); }
.cake-top {
  position: absolute;
  top: 28px;
  left: 20px;
  width: 220px;
  height: 86px;
  border-radius: 50%;
  background: radial-gradient(circle, hsl(0 0% 100%), hsl(335 100% 88%) 65%, hsl(var(--primary)));
  box-shadow: inset 0 -8px 0 hsl(335 70% 74% / 0.6), 0 16px 30px hsl(335 88% 35% / 0.22);
  z-index: 4;
}
.cake-layer {
  position: absolute;
  left: 20px;
  width: 220px;
  height: 62px;
  border-radius: 0 0 50% 50%;
  background: linear-gradient(90deg, hsl(335 100% 76%), hsl(29 100% 82%), hsl(335 100% 76%));
  box-shadow: inset 0 -12px 0 hsl(335 60% 55% / 0.22);
}
.layer-one { top: 72px; z-index: 3; }
.layer-two { top: 119px; z-index: 2; background: linear-gradient(90deg, hsl(29 100% 80%), hsl(0 0% 100%), hsl(335 100% 78%)); }
.layer-three { top: 166px; z-index: 1; }
.candles { position: absolute; top: -12px; left: 78px; display: flex; gap: 28px; z-index: 8; }
.candles span {
  width: 13px;
  height: 62px;
  border-radius: 8px;
  background: repeating-linear-gradient(45deg, white 0 8px, hsl(var(--secondary)) 8px 15px);
  position: relative;
  box-shadow: 0 8px 18px hsl(29 90% 40% / 0.22);
}
.candles span::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 50%;
  width: 18px;
  height: 24px;
  transform: translateX(-50%);
  border-radius: 60% 60% 60% 10%;
  background: radial-gradient(circle at 60% 70%, hsl(0 0% 100%), hsl(50 100% 58%) 35%, hsl(29 95% 52%) 70%);
  animation: flame 0.9s ease-in-out infinite alternate;
}
@keyframes flame { from { transform: translateX(-50%) scale(0.9) rotate(-4deg); } to { transform: translateX(-50%) scale(1.08) rotate(5deg); } }
.cake-slice {
  position: absolute;
  top: 70px;
  right: 12px;
  width: 82px;
  height: 120px;
  background: linear-gradient(135deg, hsl(0 0% 100%), hsl(335 100% 82%));
  clip-path: polygon(0 0, 100% 34%, 0 100%);
  opacity: 0;
  transform: translateX(0) rotateZ(0deg);
  transition: all var(--transition-smooth);
  z-index: 6;
  box-shadow: 0 20px 34px hsl(335 88% 35% / 0.22);
}
.cake-scene.is-cut .cake-slice { opacity: 1; transform: translateX(72px) rotateZ(12deg); }
.knife-button {
  position: absolute;
  right: 13%;
  top: 12%;
  z-index: 12;
  min-width: 56px;
  min-height: 56px;
  border-radius: 999px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  box-shadow: var(--shadow-md);
  font-size: 1.8rem;
  transition: transform var(--transition-fast);
}
.knife-button:active { transform: scale(0.92) rotate(18deg); }
.sparkles span {
  position: absolute;
  color: hsl(var(--secondary));
  opacity: 0;
  font-weight: 1000;
}
.sparkles span:nth-child(1) { left: 18%; top: 24%; }
.sparkles span:nth-child(2) { left: 30%; top: 12%; }
.sparkles span:nth-child(3) { right: 24%; top: 26%; }
.sparkles span:nth-child(4) { right: 18%; bottom: 34%; }
.sparkles span:nth-child(5) { left: 22%; bottom: 28%; }
.sparkles span:nth-child(6) { right: 37%; top: 10%; }
.cake-scene.is-cut .sparkles span { animation: popSpark 1.2s ease forwards; }
@keyframes popSpark { 0% { opacity: 0; transform: scale(0.2) translateY(15px); } 45% { opacity: 1; } 100% { opacity: 0; transform: scale(1.7) translateY(-45px); } }

.record-player {
  display: grid;
  place-items: center;
  min-height: 210px;
  border-radius: 1.5rem;
  background: linear-gradient(145deg, hsl(335 70% 18%), hsl(335 88% 35%));
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.2), var(--shadow-md);
}
.record-disc {
  width: 160px;
  height: 160px;
  border-radius: 999px;
  background: repeating-radial-gradient(circle, hsl(335 35% 8%) 0 8px, hsl(335 28% 13%) 8px 13px);
  display: grid;
  place-items: center;
  box-shadow: 0 20px 40px hsl(0 0% 0% / 0.3);
}
.record-disc.spinning { animation: spin 4s linear infinite; }
.record-label {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--secondary)));
  color: white;
  font-size: 2rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.playlist-item {
  background: hsl(var(--card) / 0.78);
  border-color: hsl(var(--border));
  box-shadow: var(--shadow-sm);
}
.playlist-item.is-active {
  background: linear-gradient(135deg, hsl(var(--primary) / 0.16), hsl(var(--secondary) / 0.13));
  border-color: hsl(var(--primary) / 0.45);
  transform: translateY(-2px);
}
.love-card { transform-style: preserve-3d; }
.love-card:hover { box-shadow: var(--shadow-lg); }

@media (max-width: 420px) {
  .cake-3d { width: 225px; transform: rotateX(54deg) rotateZ(-8deg) scale(0.86); }
  .cake-top, .cake-layer { left: 2px; }
  .knife-button { right: 6%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
