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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Fireworks Canvas */
#fireworks {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* 3D Greeting Card Container - shown first */
.card-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

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

.card-scene {
  perspective: 2000px;
}

.greeting-card {
  width: 500px;
  height: 350px;
  position: relative;
  transform-style: preserve-3d;
  cursor: pointer;
  transition: transform 1.5s ease;
  /* Start completely closed with left side over the front */
  transform: rotateY(0deg);
}

.greeting-card.opened {
  /* Open card by rotating left side back */
  transform: rotateY(-180deg);
}

.card-left,
.card-right {
  position: absolute;
  width: 50%;
  height: 100%;
  transform-style: preserve-3d;
  border-radius: 15px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
}

.card-left {
  left: 0;
  transform-origin: right center;
  transition: transform 1.5s ease;
  /* Start at 0 degrees so card is closed */
  transform: rotateY(0deg);
}

.greeting-card.opened .card-left {
  /* Rotate to -160deg to open card */
  transform: rotateY(-160deg);
}

.card-right {
  right: 0;
  background: #fff;
  border: 4px solid #ffd700;
}

.card-cover {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
  border: 4px solid #fff;
  border-radius: 15px 0 0 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  backface-visibility: hidden;
}

.card-ribbon {
  position: absolute;
  width: 120%;
  height: 35px;
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card-ribbon-vertical {
  position: absolute;
  width: 35px;
  height: 120%;
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card-emoji {
  font-size: 5rem;
  position: relative;
  z-index: 2;
  margin: 0;
  animation: bounce 2s infinite;
}

.card-click-text {
  font-size: 1.4rem;
  font-weight: 700;
  color: #2d3436;
  position: relative;
  z-index: 2;
  margin-top: 10px;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.card-inside {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
  border-radius: 0 15px 15px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  color: #fff;
}

.inside-title {
  font-size: 2.5rem;
  margin-bottom: 20px;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.3);
  font-weight: 700;
}

.inside-message {
  font-size: 1.3rem;
  line-height: 1.6;
  margin-bottom: 30px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.inside-continue {
  font-size: 1rem;
  /* Remove the "click again" text */
  display: none;
  font-weight: 600;
}

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

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

/* Main content - hidden until card opens */
.main-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease 0.5s;
}

.main-content.visible {
  opacity: 1;
  visibility: visible;
}

/* Container */
.container {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  text-align: center;
  padding: 40px 20px;
  animation: fadeInDown 1s ease-out;
}

.greeting-title {
  font-size: 3.5rem;
  color: #fff;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
  margin-bottom: 10px;
  font-weight: 700;
  letter-spacing: 2px;
}

.greeting-subtitle {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

/* 3D Card Wrapper */
.card-wrapper {
  perspective: 1500px;
  display: flex;
  justify-content: center;
  margin: 60px 0;
}

.card-3d {
  width: 400px;
  height: 280px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1s ease;
  cursor: pointer;
}

.card-3d.opened {
  transform: rotateY(180deg);
}

.card-front,
.card-back-left,
.card-back-right {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.card-front {
  background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid #fff;
}

.card-content {
  text-align: center;
  color: #2d3436;
  position: relative;
}

.card-ribbon {
  position: absolute;
  width: 150%;
  height: 40px;
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.card-ribbon-vertical {
  position: absolute;
  width: 40px;
  height: 150%;
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.card-content h2 {
  font-size: 4rem;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.card-content p {
  font-size: 1.3rem;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.card-back-left {
  background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid #fff;
}

.card-back-right {
  background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
  transform: rotateY(180deg) translateZ(1px);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid #fff;
}

.card-inner-content {
  text-align: center;
  color: #fff;
  padding: 30px;
}

.card-inner-content h3 {
  font-size: 2rem;
  margin-bottom: 15px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.card-inner-content p {
  font-size: 1.1rem;
  line-height: 1.6;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Congratulations Sections */
.congratulations-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin: 60px 0;
}

.cong-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 40px 30px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeInUp 1s ease-out backwards;
}

.cong-card:nth-child(1) {
  animation-delay: 0.2s;
}

.cong-card:nth-child(2) {
  animation-delay: 0.4s;
}

.cong-card:nth-child(3) {
  animation-delay: 0.6s;
}

.cong-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
}

.cong-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.cong-card h3 {
  font-size: 1.8rem;
  color: #2d3436;
  margin-bottom: 15px;
  font-weight: 700;
}

.cong-card p {
  font-size: 1rem;
  color: #636e72;
  line-height: 1.6;
}

/* Photo Gallery */
.photo-gallery {
  margin: 80px 0;
}

.gallery-title {
  text-align: center;
  font-size: 2.5rem;
  color: #fff;
  margin-bottom: 40px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.photo-placeholder {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.photo-placeholder:hover {
  transform: scale(1.05);
}

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

/* 3D Gift Box */
.gift-box-wrapper {
  text-align: center;
  margin: 80px 0;
  perspective: 1500px;
}

.gift-box-link {
  text-decoration: none;
  display: inline-block;
}

.gift-box {
  width: 150px;
  height: 180px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
  cursor: pointer;
  margin: 0 auto 20px;
}

.gift-box:hover {
  transform: rotateY(20deg) rotateX(10deg) scale(1.1);
}

.box-lid {
  position: absolute;
  width: 150px;
  height: 40px;
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  border-radius: 5px;
  top: -10px;
  left: 0;
  transform-origin: bottom;
  transform: translateZ(75px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.lid-ribbon {
  position: absolute;
  width: 100%;
  height: 15px;
  background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
  top: 50%;
  transform: translateY(-50%);
}

.box-body {
  position: absolute;
  width: 150px;
  height: 150px;
  transform-style: preserve-3d;
}

.box-face {
  position: absolute;
  width: 150px;
  height: 150px;
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  border: 3px solid #fff;
}

.box-front {
  transform: translateZ(75px);
}

.box-back {
  transform: translateZ(-75px) rotateY(180deg);
}

.box-left {
  transform: rotateY(-90deg) translateZ(75px);
}

.box-right {
  transform: rotateY(90deg) translateZ(75px);
}

.box-bottom {
  transform: rotateX(-90deg) translateZ(75px);
}

.box-bow {
  position: absolute;
  font-size: 3rem;
  top: -30px;
  left: 50%;
  transform: translateX(-50%) translateZ(80px);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.gift-text {
  font-size: 1.5rem;
  color: #fff;
  font-weight: 600;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

.gift-box-link:hover .gift-text {
  transform: scale(1.1);
}

/* Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .greeting-card {
    width: 400px;
    height: 280px;
  }

  .card-emoji {
    font-size: 4rem;
  }

  .card-click-text {
    font-size: 1.2rem;
  }

  .inside-title {
    font-size: 2rem;
  }

  .inside-message {
    font-size: 1.1rem;
  }

  .greeting-title {
    font-size: 2.5rem;
  }

  .greeting-subtitle {
    font-size: 1rem;
  }

  .card-3d {
    width: 320px;
    height: 220px;
  }

  .card-content h2 {
    font-size: 3rem;
  }

  .card-inner-content h3 {
    font-size: 1.5rem;
  }

  .card-inner-content p {
    font-size: 1rem;
  }

  .cong-card h3 {
    font-size: 1.5rem;
  }

  .gallery-title {
    font-size: 2rem;
  }

  .photo-placeholder img {
    height: 220px;
  }
}

@media (max-width: 480px) {
  .greeting-card {
    width: 320px;
    height: 220px;
  }

  .card-emoji {
    font-size: 3rem;
  }

  .card-click-text {
    font-size: 1rem;
  }

  .card-ribbon {
    height: 28px;
  }

  .card-ribbon-vertical {
    width: 28px;
  }

  .inside-title {
    font-size: 1.6rem;
  }

  .inside-message {
    font-size: 1rem;
  }

  .main-content {
    padding: 15px;
  }

  .container {
    padding: 15px;
  }

  .header {
    padding: 30px 15px;
  }

  .greeting-title {
    font-size: 2rem;
  }

  .card-3d {
    width: 280px;
    height: 200px;
  }

  .card-content h2 {
    font-size: 2.5rem;
  }

  .card-content p {
    font-size: 1.1rem;
  }

  .cong-icon {
    font-size: 3rem;
  }

  .cong-card h3 {
    font-size: 1.3rem;
  }

  .cong-card p {
    font-size: 0.95rem;
  }

  .gift-box {
    width: 120px;
    height: 150px;
  }

  .box-lid {
    width: 120px;
  }

  .box-face {
    width: 120px;
    height: 120px;
  }

  .gift-text {
    font-size: 1.2rem;
  }
}
