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

body {
  font-family: "Arial", sans-serif;
  overflow: hidden;
}

/* Space background with black and white stars */
.space-background {
  min-height: 100vh;
  background: #000000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* White stars on black background */
.stars-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  animation: twinkle 2s infinite alternate;
}

.star.small {
  width: 1px;
  height: 1px;
}
.star.medium {
  width: 2px;
  height: 2px;
}
.star.large {
  width: 3px;
  height: 3px;
}

@keyframes twinkle {
  0% {
    opacity: 0.3;
  }
  100% {
    opacity: 1;
  }
}

.shooting-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.shooting-star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  opacity: 0;
  animation: shoot 3s infinite;
}

@keyframes shoot {
  0% {
    opacity: 0;
    transform: translateX(-100px) translateY(0);
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(300px) translateY(150px);
  }
}

.envelope-container {
  position: relative;
  z-index: 10;
}

.envelope {
  width: 320px;
  height: 224px;
  background: linear-gradient(135deg, #fef3c7, #fde68a, #fcd34d);
  border-radius: 8px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  position: relative;
  cursor: pointer;
  transition: all 1.5s ease;
  overflow: hidden;
}

.envelope:hover {
  transform: scale(1.05) rotate(-1deg);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}

.envelope.opened {
  transform: scale(1.1) rotate(1deg);
  filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 128px;
  background: linear-gradient(135deg, #fde68a, #fcd34d, #f59e0b);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transition: all 1.5s ease;
  transform-origin: top center;
}

.envelope.opened .envelope-flap {
  transform: rotateX(-180deg) translateY(32px) scale(1.05);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.envelope-heart {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  animation: heartbeat 2s infinite;
  transition: all 1.5s ease;
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
}

.envelope.opened .envelope-heart {
  opacity: 0;
  transform: translateX(-50%) scale(0) rotate(180deg);
}

@keyframes heartbeat {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
  }
  50% {
    transform: translateX(-50%) scale(1.1);
  }
}

.envelope-text {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: #92400e;
  font-size: 14px;
  font-weight: 500;
  background: #fef3c7;
  padding: 8px 12px;
  border-radius: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  animation: pulse 2s infinite;
}

.envelope.opened .envelope-text {
  opacity: 0;
}

.letter {
  position: absolute;
  top: 32px;
  left: 16px;
  width: 288px;
  background: linear-gradient(135deg, #ffffff, #fdf2f8);
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  padding: 24px;
  transform: translateY(100%) scale(0.95);
  opacity: 0;
  transition: all 2s ease;
  z-index: 10;
  border: 2px solid #fce7f3;
}

.letter.visible {
  transform: translateY(0) scale(1.05) rotate(1deg);
  opacity: 1;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 0 20px rgba(236, 72, 153, 0.1);
}

.close-button {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 32px;
  height: 32px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.close-button:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.letter h2 {
  text-align: center;
  color: #ec4899;
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 8px;
  animation: bounce 1s ease;
}

.divider {
  width: 64px;
  height: 2px;
  background: linear-gradient(to right, #f9a8d4, #ec4899);
  margin: 0 auto 16px;
  animation: pulse 2s infinite;
}

.letter-text {
  color: #374151;
  line-height: 1.6;
  font-size: 14px;
}

.letter-text p {
  margin-bottom: 12px;
  opacity: 0;
  transform: translateY(20px);
  animation: slideIn 1s ease forwards;
}

.letter-text p:nth-child(1) {
  animation-delay: 0.3s;
}
.letter-text p:nth-child(2) {
  animation-delay: 0.6s;
}
.letter-text p:nth-child(3) {
  animation-delay: 0.9s;
}
.letter-text p:nth-child(4) {
  animation-delay: 1.2s;
}
.letter-text p:nth-child(5) {
  animation-delay: 1.5s;
}

.highlight {
  font-weight: 600;
}

.signature {
  text-align: right;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #fce7f3;
  color: #ec4899;
  font-weight: bold;
  animation: pulse 2s infinite;
}

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.letter-hearts {
  position: absolute;
}

.heart {
  position: absolute;
  font-size: 16px;
  animation: float 3s ease-in-out infinite;
}

.heart-1 {
  top: -8px;
  right: -8px;
  color: #f9a8d4;
  animation-delay: 0s;
}
.heart-2 {
  bottom: -8px;
  left: -8px;
  color: #ef4444;
  animation-delay: 1s;
}
.heart-3 {
  top: 50%;
  left: -12px;
  color: #f9a8d4;
  animation-delay: 0.5s;
}
.heart-4 {
  top: 25%;
  right: -12px;
  color: #ef4444;
  animation-delay: 1.5s;
}

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

.sparkles-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.sparkle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #fbbf24;
  border-radius: 50%;
  animation: sparkle 1.5s ease-out;
}

@keyframes sparkle {
  0% {
    opacity: 1;
    transform: scale(0);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0);
  }
}

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

.floating-heart {
  position: absolute;
  font-size: 20px;
  animation: floatUp 4s ease-out forwards;
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-200px) rotate(360deg);
  }
}

.planet-container {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}

.planet-container.visible {
  opacity: 1;
  pointer-events: all;
}

.planet {
  position: relative;
  cursor: pointer;
  transition: transform 0.5s ease;
}

.planet:hover {
  transform: scale(1.1);
}

.planet-inner {
  width: 192px;
  height: 192px;
  background: linear-gradient(135deg, #60a5fa, #a855f7, #ec4899);
  border-radius: 50%;
  animation: spin 20s linear infinite;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.planet-core {
  width: 144px;
  height: 144px;
  background: linear-gradient(135deg, #93c5fd, #c084fc, #f472b6);
  border-radius: 50%;
  opacity: 0.8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.planet-text {
  color: white;
  font-weight: bold;
  font-size: 20px;
  transition: transform 0.3s ease;
}

.planet:hover .planet-text {
  transform: scale(1.1);
}

.planet-glow {
  position: absolute;
  inset: -8px;
  background: linear-gradient(135deg, #60a5fa, #a855f7, #ec4899);
  border-radius: 50%;
  opacity: 0.2;
  animation: pulse 2s infinite;
}

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

.planet-star {
  position: absolute;
  font-size: 24px;
  animation: bounce 2s infinite;
}

.star-1 {
  top: -16px;
  right: -16px;
  color: #fbbf24;
}

.star-2 {
  bottom: -16px;
  left: -16px;
  color: #60a5fa;
  animation-delay: 1s;
}

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

@keyframes pulse {
  0%,
  100% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.4;
  }
}

.hidden {
  opacity: 0;
  pointer-events: none;
}
