/* روشن و مدرن */
body, html {
  min-height: 100vh;
  background: #181c24 !important; /* رنگ تیره جذاب */
  color: #f3f3f3;
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 0;
}

.container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  position: relative;
}

#cake-container {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 520px;
}

#cake-svg-img {
  display: block;
  width: 100%;
  max-width: 520px;
  height: auto;
  z-index: 1;
}

#cake-candle-canvas {
  position: absolute;
  left: 51%;
  top: -60px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 2;
  background: transparent;
  filter: drop-shadow(0 0 32px #fffde7)
          drop-shadow(0 0 64px #ffe082)
          drop-shadow(0 0 24px #ffd600cc);
  transition: filter 0.4s, opacity 0.4s;
}

#cake-candle-canvas.candle-off {
  filter: none !important;
  opacity: 1;
}

#cake-candle-canvas::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 22%;
  width: 80px;
  height: 80px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, #fffde7 0%, #ffe08277 40%, #ffd60022 80%, transparent 100%);
  opacity: 1;
  z-index: 3;
  filter: blur(8px);
  transition: opacity 0.4s;
}

#cake-candle-canvas.candle-off::after {
  opacity: 0 !important;
}

#celebrate-message {
  margin-top: 2rem;
  color: #ffe082;
  text-shadow: 0 2px 8px #222, 0 1px 0 #fffde7;
  font-size: 1.3rem;
  font-weight: bold;
  display: none;
  text-align: center;
  width: 100%;
  z-index: 3;
}

.greeting-card {
  position: absolute;
  left: 50%;
  top: 55%;
  transform: translate(-50%, -50%);
  z-index: 5;
  width: 90%;
  max-width: 380px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s;
  perspective: 1200px;
}

.greeting-card.show {
  opacity: 1;
  pointer-events: auto;
}

.card-hinge .card-inner {
  transition: transform 1.1s cubic-bezier(.23, 2, .6, 1);
  transform-style: preserve-3d;
  transform: rotateX(90deg);
}

.greeting-card.show .card-hinge .card-inner {
  transform: rotateX(0deg);
}

.card-front {
  background: #fff8f0;
  border-radius: 18px;
  box-shadow: 0 2px 12px #ff408133;
  padding: 1.5rem 1rem;
  backface-visibility: hidden;
}

.card-3d-text {
  font-size: 1.2rem;
  font-weight: bold;
  color: #ffe082;
  text-shadow:
    0 2px 6px #ffb6d5,
    0 4px 12px #ff408155,
    0 1px 0 #fff,
    2px 2px 0 #e040fb;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.btn-main {
  background: linear-gradient(90deg, #ff4081 60%, #ffb300 100%);
  color: #181c24;
  border: none;
  border-radius: 22px;
  padding: 0.7rem 2.2rem;
  font-size: 1.1rem;
  cursor: pointer;
  margin-top: 1.5rem;
  font-weight: bold;
  box-shadow: 0 2px 12px #ff408144;
  transition: background 0.2s, color 0.2s;
}

.btn-main:hover {
  background: linear-gradient(90deg, #ffb300 60%, #ff4081 100%);
  color: #fffde7;
}

.congrats-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #23263a 60%, #3a2e5f 100%);
  color: #ffe082;
  box-shadow: 0 4px 32px #000a, 0 1px 0 #fff1;
  border-radius: 22px;
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  margin: 2rem auto 0 auto;
  max-width: 340px;
  font-family: inherit;
  z-index: 9999;
  animation: pop-in 0.7s cubic-bezier(.23, 2, .6, 1);
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

@keyframes pop-in {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  80% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

.congrats-message {
  font-size: 1.25rem;
  color: #d81b60;
  font-weight: bold;
  text-align: center;
  margin-bottom: 0.7rem;
  text-shadow: 0 2px 8px #fffde7, 0 1px 0 #fff;
}

/* استایل برای موبایل - بدون تغییر */
@media (max-width: 600px) {
  #cake-container {
    max-width: 99vw;
  }

  #cake-svg-img {
    max-width: 99vw;
  }

  .greeting-card {
    width: 98vw;
    max-width: 98vw;
    font-size: 0.97rem;
  }

  .card-front {
    padding: 1rem 0.5rem;
  }
}


/* استایل بهبود یافته برای دسکتاپ *//* بهبود موقعیت کیک و شمع و متن‌ها در دسکتاپ */
@media (min-width: 768px) {
  /* کیک پایین‌تر بیاد */
  #cake-container {
    margin-top: 120px; /* بیشترش کردم برای پایین‌تر اومدن واضح */
    margin-bottom: 3rem;
  }

  /* موقعیت شمع پایین‌تر */
  #cake-candle-canvas {
    top: -20px; /* از -60 رفت به -20 یعنی نزدیک‌تر به کیک و پایین‌تر */
  }

  /* پیام تبریک */
  #celebrate-message {
    font-size: 1.8rem;
    margin-top: 3rem;
  }

  /* متن روی کارت تبریک */
  .card-3d-text {
    font-size: 1.5rem;
    letter-spacing: 1.2px;
    margin-bottom: 1rem;
  }

  /* دکمه اصلی */
  .btn-main {
    font-size: 1.3rem;
    padding: 0.9rem 2.5rem;
  }

  /* متن تبریک نهایی */
  .congrats-message {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  /* جعبه تبریک نهایی */
  .congrats-box {
    padding: 2.5rem 2rem;
    max-width: 420px;
  }

  /* کارت تبریک */
  .greeting-card {
    max-width: 420px;
  }

  .card-front {
    padding: 2rem 1.5rem;
  }
}
