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

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a0a2e, #2d1b69, #16082a);
  background-size: 400% 400%;
  animation: bg-drift 12s ease infinite;
  font-family: 'Nunito', system-ui, sans-serif;
  color: #fff;
  overflow-x: hidden;
}

@keyframes bg-drift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Entrance */
.entrance {
  opacity: 0;
  transform: translateY(30px);
  animation: fade-in-up 0.8s ease forwards;
}

@keyframes fade-in-up {
  to { opacity: 1; transform: translateY(0); }
}

/* Stars */
.star-field { position: fixed; inset: 0; pointer-events: none; z-index: 0; }

.star {
  position: absolute;
  width: 2px; height: 2px;
  background: #fff;
  border-radius: 50%;
  animation: twinkle var(--dur) ease-in-out infinite;
  opacity: 0;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.5); }
}

/* Hearts */
.floating-hearts { position: fixed; inset: 0; pointer-events: none; z-index: 0; }

.heart-float {
  position: absolute;
  animation: heart-rise linear forwards;
  opacity: 0;
}

@keyframes heart-rise {
  0% { opacity: 0; transform: translateY(0) scale(0.5) rotate(0deg); }
  10% { opacity: 0.7; }
  90% { opacity: 0.2; }
  100% { opacity: 0; transform: translateY(-100vh) scale(1.2) rotate(45deg); }
}

/* Container */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 30px 20px 60px;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* Title */
.title {
  font-family: 'Baloo 2', cursive;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ff6b9d, #ffa8cc, #ff6bde, #ffa8cc, #ff6b9d);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s ease infinite;
  margin-bottom: 4px;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.subtitle {
  font-family: 'Baloo 2', cursive;
  color: #ffa8cc;
  font-size: 1.1rem;
  margin-bottom: 28px;
  opacity: 0.8;
}

/* Photo gallery */
.gallery {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.photo-frame {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  flex: 1;
  min-width: 150px;
  max-width: 260px;
  transition: transform 0.3s ease;
}

.photo-frame:hover {
  transform: translateY(-6px) scale(1.02);
}

/* Animated gradient border */
.frame-glow {
  position: absolute;
  inset: -2px;
  border-radius: 18px;
  background: conic-gradient(from var(--angle, 0deg), #ff6b9d, #ffa8cc, #c471ed, #ff6b9d);
  animation: rotate-glow 4s linear infinite;
  z-index: -1;
}

@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes rotate-glow {
  to { --angle: 360deg; }
}

.photo {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
  border-radius: 14px;
  border: 2px solid rgba(255, 107, 157, 0.3);
}

.frame-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px 12px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  font-family: 'Baloo 2', cursive;
  font-size: 1rem;
  color: #ffa8cc;
  border-radius: 0 0 14px 14px;
}

/* Cat container */
.dance-floor {
  position: relative;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 300px;
}

.cat-container {
  cursor: pointer;
  transition: filter 0.2s;
  position: relative;
}

.cat-container:hover { filter: brightness(1.05) drop-shadow(0 0 12px rgba(255, 107, 157, 0.4)); }

.cat-svg { overflow: visible; }

/* SVG idle animations */
.cat-torso {
  animation: breathe 3s ease-in-out infinite;
  transform-origin: center;
}

@keyframes breathe {
  0%, 100% { ry: 35; }
  50% { ry: 37; }
}

.cat-tail {
  animation: tail-idle 3s ease-in-out infinite;
  transform-origin: 155px 180px;
}

@keyframes tail-idle {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(8deg); }
}

.cat-ear-left {
  animation: ear-twitch-l 5s ease-in-out infinite;
  transform-origin: 72px 85px;
}

@keyframes ear-twitch-l {
  0%, 90%, 100% { transform: rotate(0deg); }
  93% { transform: rotate(-8deg); }
  96% { transform: rotate(0deg); }
}

/* Dance animations */
.cat-container.dancing .cat-svg {
  animation: cat-bounce 0.5s ease-in-out infinite;
}

@keyframes cat-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-12px) rotate(-4deg); }
  50% { transform: translateY(-2px); }
  75% { transform: translateY(-12px) rotate(4deg); }
}

.cat-container.dancing .cat-arm-left {
  animation: wave-l 0.35s ease-in-out infinite alternate;
  transform-origin: 55px 175px;
}

.cat-container.dancing .cat-arm-right {
  animation: wave-r 0.35s ease-in-out infinite alternate-reverse;
  transform-origin: 145px 175px;
}

@keyframes wave-l {
  0% { transform: rotate(10deg); }
  100% { transform: rotate(-40deg); }
}

@keyframes wave-r {
  0% { transform: rotate(-10deg); }
  100% { transform: rotate(40deg); }
}

.cat-container.dancing .cat-leg-left {
  animation: kick-l 0.5s ease-in-out infinite;
  transform-origin: 75px 215px;
}

.cat-container.dancing .cat-leg-right {
  animation: kick-r 0.5s ease-in-out infinite;
  transform-origin: 125px 215px;
}

@keyframes kick-l {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-15deg); }
}

@keyframes kick-r {
  0%, 100% { transform: rotate(0); }
  50% { transform: rotate(-15deg); }
}

.cat-container.dancing .cat-tail {
  animation: tail-dance 0.3s ease-in-out infinite alternate;
  transform-origin: 155px 180px;
}

@keyframes tail-dance {
  0% { transform: rotate(-15deg); }
  100% { transform: rotate(20deg); }
}

.cat-container.dancing .cat-head {
  animation: head-bop 0.5s ease-in-out infinite;
  transform-origin: 100px 110px;
}

@keyframes head-bop {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

.cat-container.dancing .cat-ear-left {
  animation: ear-dance-l 0.3s ease-in-out infinite alternate;
  transform-origin: 72px 85px;
}

.cat-container.dancing .cat-ear-right {
  animation: ear-dance-r 0.3s ease-in-out infinite alternate-reverse;
  transform-origin: 128px 85px;
}

@keyframes ear-dance-l {
  0% { transform: rotate(0); }
  100% { transform: rotate(-12deg); }
}

@keyframes ear-dance-r {
  0% { transform: rotate(0); }
  100% { transform: rotate(12deg); }
}

/* Blink */
.cat-container.blink .cat-eyes-open { display: none; }
.cat-container.blink .cat-eyes-happy { display: none; }

/* Speech bubble */
.speech-bubble {
  background: #fff;
  border: 3px solid #5d4037;
  border-radius: 20px;
  padding: 12px 20px;
  margin-top: 14px;
  opacity: 0;
  transform: scale(0.5) translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 4px 4px 0 rgba(93, 64, 55, 0.3);
  max-width: 90%;
  position: relative;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 10px solid #5d4037;
}

.speech-bubble::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 7px solid #fff;
  z-index: 1;
}

.speech-bubble.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.bubble-text {
  font-family: 'Baloo 2', cursive;
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
}

.msg-counter {
  display: block;
  font-size: 0.7rem;
  color: #999;
  margin-top: 4px;
  font-family: 'Nunito', sans-serif;
}

/* Hint */
.click-hint {
  font-family: 'Baloo 2', cursive;
  color: #ffa8cc;
  font-size: 0.9rem;
  animation: fade-pulse 2s ease infinite;
  margin-bottom: 28px;
}

@keyframes fade-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* Love letter */
.love-letter {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 168, 204, 0.25);
  border-radius: 20px;
  padding: 28px 24px;
  backdrop-filter: blur(10px);
  text-align: left;
  max-width: 450px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.love-letter::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 20px;
  background: conic-gradient(from var(--angle, 0deg), transparent, rgba(255, 107, 157, 0.2), transparent, rgba(196, 113, 237, 0.2), transparent);
  animation: rotate-glow 6s linear infinite;
  z-index: -1;
}

.letter-greeting {
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  font-size: 1.3rem;
  color: #ffa8cc;
  margin-bottom: 10px;
}

.letter-body {
  margin-bottom: 12px;
  line-height: 1.8;
  font-size: 0.95rem;
  color: #e8c8d8;
}

.letter-sign {
  font-family: 'Baloo 2', cursive;
  text-align: right;
  font-size: 1.1rem;
  color: #ffa8cc;
  font-weight: 600;
}

/* Typewriter effect */
.letter-body .typed-char {
  opacity: 0;
  animation: type-in 0.05s forwards;
}

@keyframes type-in {
  to { opacity: 1; }
}

/* Particles */
.particle {
  position: fixed;
  font-size: 1.4rem;
  pointer-events: none;
  animation: particle-fly 1.5s ease forwards;
  z-index: 100;
}

@keyframes particle-fly {
  0% { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translateY(-120px) scale(1.5) rotate(360deg); }
}

/* Confetti */
.confetti {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
  animation: confetti-fall 3s ease forwards;
  z-index: 100;
}

@keyframes confetti-fall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translateY(100vh) rotate(720deg) scale(0.5); }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  cursor: pointer;
  padding: 20px;
}

.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 12px;
  transform: scale(0.8);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox.active .lightbox-img {
  transform: scale(1);
}

.lightbox-caption {
  font-family: 'Baloo 2', cursive;
  color: #ffa8cc;
  font-size: 1.2rem;
  margin-top: 16px;
  opacity: 0.9;
}

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

/* Mobile tweaks */
@media (max-width: 480px) {
  .title { font-size: 1.6rem; }
  .photo { height: 250px; }
  .gallery { gap: 10px; }
  .cat-container svg { width: 150px; height: 195px; }
}
