body {
  text-align: center;
  font-family: sans-serif;
  background-color: #f0f8ff;
}

.calendar {
  position: relative;
  display: inline-block;
}

.calendar #card {
  width: 1080px;
  height: 1300px;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  pointer-events: auto;
  z-index: 0;
}

.stamp {
  position: absolute;
  width: 100px;
  height: 100px;
  transform-origin: center;
  transition: transform 0.3s ease;
  user-select: none;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10;
}

.particle.sparkle {
  background: radial-gradient(circle, #ffd700, #ffef94);
  /* 三個動畫同時執行 */
  animation: 
    sparkleOpacity 2s linear forwards,               /* 透明度 */
    sparkleTranslate 2s cubic-bezier(.17,.67,.21,.94) forwards /* 移動 */
}

.particle.heart {
  background: #ff69b4;
  transform: rotate(45deg);
  animation: heartAnimation 2s cubic-bezier(0.17,0.67,0,1.03) forwards;
}

.particle.star {
  background: #87ceeb;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  animation: starAnimation 2s cubic-bezier(0.17,0.67,0,1.03) forwards;
}


/* 透明度動畫：線性淡出 */
@keyframes sparkleOpacity {
  0%   { opacity: 1; }
  30%  { opacity: 0.9; }
  70%  { opacity: 0.5; }
  100% { opacity: 0; }
}

/* 移動動畫：沿 var(--dx, --dy) 移動，速度用 cubic-bezier 控制 */
@keyframes sparkleTranslate {
  0% {
    transform: translate(0,0) scale(1);
  }
  100% {
    transform: translate(calc(var(--dx) * 1.2), calc(var(--dy) * 1.2)) scale(0.2);
  }
}

/* 縮放動畫：單獨控制大小變化 */
@keyframes sparkleScale {
  0%   { transform: scale(0.5); }
  40%  { transform: scale(1); }  /* 中間放大 */
  100% { transform: scale(0.3); } /* 最後縮小 */
}

@keyframes heartAnimation {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(0.3) rotate(45deg);
  }
  50% {
    opacity: 0.3;
    transform: translate(calc(var(--dx) * 1.4), calc(var(--dy) * 1.4)) scale(0.4) rotate(45deg);
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--dx) * 2), calc(var(--dy) * 2)) scale(0.2) rotate(45deg);
  }
}

@keyframes starAnimation {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(0.4) rotate(0deg);
  }
  50% {
    opacity: 0.3;
    transform: translate(calc(var(--dx) * 1.2), calc(var(--dy) * 1.2)) scale(0.5) rotate(240deg);
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--dx) * 1.8), calc(var(--dy) * 1.8)) scale(0.2) rotate(360deg);
  }
}

#nameDisplay {
  position: absolute;
  top: 490px;  /* 依你的卡片圖調整位置 */
  left: 367px; /* 依你的卡片圖調整位置 */
  font-size: 60px;
  font-weight: bold;
  font-family: "微軟正黑體", sans-serif;
  color: #2e88de;
  pointer-events: none;
}

#stampBtn, #downloadBtn, #clearBtn {
  margin-top: 20px;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease;
  height: 32px;
  padding: 6px 16px;
}

#stampBtn {
  background-color: #007bff;
  height: 150px;
  width: 150px;
  color: white;
  border-radius: 75px;
  font-size: 24px;
}

#stampBtn:hover {
  background-color: #c72b43;
}

#stampBtn:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

#downloadBtn {
  background-color: #17a2b8;
  color: white;
}

#downloadBtn:hover {
  background-color: #117a8b;
}

#downloadBtn:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

#exportCardBtn {
  background-color: #f3b700;
  color: white;
}

#exportCardBtn:hover {
  background-color: #f4d056;
}

#exportCardBtn:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

#clearBtn {
  background-color: #dc3545;
  color: white;
}

#clearBtn:hover {
  background-color: #c82333;
}

#clearBtn:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

#makeupStampBtn, #exportCardBtn {
  background-color: #ff5464;
  color: white;
  height: 32px;
  width: 120px;
  border: none;
  border-radius: 16px;
  transition: background-color 0.3s ease;
}

#exportCardBtn {
  background-color: #f3b700;
}

#makeupStampBtn:hover {
  background-color: #84cbff;
}

#makeupStampBtn:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

.name-input-wrapper {
  position: relative;
  display: inline-block;
  background: linear-gradient(90deg, #b0cfec, #d1effa);
  padding: 3px;
  border-radius: 28px;
  background-size: 200% 100%;
  animation: gradientShift 4s ease infinite;
}

.name-input-wrapper:focus-within {
  animation: gradientShift 2s ease infinite;
}

#nameInput {
  font-family: "Microsoft JhengHei", "微軟正黑體", sans-serif;
  color: #2e87db;
  height: 50px;
  width: 700px;
  font-size: 20px;
  border-radius: 25px;
  padding-left: 20px;
  position: relative;
  background: white;
  border: none;
  outline: none;
}

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

#dateSelect {
  padding: 8px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 20px;
  margin-right: 10px;
}

#languageSelect {
  padding: 5px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 3px;
  margin-left: 10px;
  background-color: white;
}

.language-switcher {
  position: absolute;
  top: 10px;
  right: 10px;
}

.splitter {
  height: 1px;
  margin: 10px 0;
}

.splitter-thick {
  height: 2px;
  margin: 30px 0;
}

#stampInfo, #makeupInfo {
  text-align: left;
  max-width: 800px;
  margin: 10px auto;
  padding: 0 20px;
}
