/* ========= 全域設定 ========= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Noto Serif TC", "Playfair Display", serif;
  color: #fff;
  overflow: hidden;
  perspective: 1200px;
  background: radial-gradient(circle at 30% 20%, #2a2f44, #0d0f1b 70%);
  position: relative;
}

/* ========= 輕柔漂浮背景光 ========= */
body::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 220, 150, 0.08) 0%, transparent 70%);
  filter: blur(60px);
  animation: floatGlow 20s linear infinite;
  z-index: -1;
}

@keyframes floatGlow {
  0% { transform: translate(0,0) scale(1); }
  50% { transform: translate(10px, -10px) scale(1.05); }
  100% { transform: translate(0,0) scale(1); }
}

/* ========= 卡片本體 ========= */
.card {
  position: relative;
  width: 360px;
  height: 480px;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 1s cubic-bezier(.25,.8,.25,1);
}

/* 正反面共通樣式 */
.front, .back {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 24px;
  backface-visibility: hidden;
  background: linear-gradient(145deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  box-shadow:
    0 8px 32px rgba(0,0,0,0.55),
    inset 0 0 0.5px rgba(255,255,255,0.2);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: transform 1s cubic-bezier(.25,.8,.25,1);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 30px;
}

/* ========= 正面 ========= */
.front {
  transform: rotateY(0deg);
  animation: frontGlow 0.8s ease-in-out infinite alternate;
}

@keyframes frontGlow {
  from { box-shadow: 0 8px 32px rgba(255,215,150,0.15); }
  to { box-shadow: 0 8px 40px rgba(255,215,150,0.35); }
}

.front h1 {
  font-size: 28px;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #ffe8a3, #ffd86a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.front p {
  font-size: 20px;
  opacity: 0.9;
  margin-top: 10px;
}

.hint {
  position: absolute;
  bottom: 24px;
  font-size: 12px;
  opacity: 0.6;
}

/* ========= 背面 ========= */
.back {
  transform: rotateY(180deg);
  background: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
}

.back h2 {
  font-size: 22px;
  margin-bottom: 16px;
  color: #ffeab0;
}

.back p {
  line-height: 1.8;
  font-size: 17px;
  max-width: 80%;
  margin: 0 auto;
  opacity: 0.95;
}

.back small {
  margin-top: 36px;
  opacity: 0.7;
  font-size: 13px;
}

/* ========= 點擊翻轉控制 ========= */
.card.flipped .front {
  transform: rotateY(-180deg);
}

.card.flipped .back {
  transform: rotateY(0deg);
}

/* ========= 背面按鈕 ========= */
.next-btn {
  margin-top: 30px;
  padding: 10px 24px;
  font-size: 16px;
  color: #1a1f2e;
  background: linear-gradient(135deg, #ffe8a3, #ffd86a);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.next-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}

/* ========= 響應式 ========= */
@media (max-width: 480px) {
  .card {
    width: 85vw;
    height: 120vw;
  }
  .front h1 { font-size: 24px; }
  .front p { font-size: 18px; }
  .next-btn { font-size: 14px; padding: 8px 20px; }
}
