.title-main {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 3rem; color: var(--gold);
  text-align: center;
  text-shadow: 0 0 20px rgba(212,175,55,0.5), 0 0 40px rgba(212,175,55,0.2);
  margin-bottom: 10px; letter-spacing: 4px;
}
.subtitle { font-size: 1.1rem; color: var(--text-dim); text-align: center; margin-bottom: 50px; letter-spacing: 2px; }
.moon-divider {
  width: 120px; height: 40px; margin: 20px auto; position: relative;
}
.moon-divider::before {
  content: '☽'; font-size: 2rem; color: var(--gold);
  position: absolute; left: 50%; transform: translateX(-50%);
  animation: float 3s ease-in-out infinite;
}

/* 修复：添加 margin: 0 auto 确保绝对居中 */
.question-box {
  width: 100%; max-width: 500px;
  text-align: center; padding: 40px 20px;
  margin: 0 auto;
}
.question-title {
  font-family: 'Cinzel Decorative', cursive;
  color: var(--gold); font-size: 1.6rem;
  margin-bottom: 20px; text-shadow: 0 0 15px rgba(212,175,55,0.3);
}
.question-subtitle {
  color: var(--text-dim); font-size: 1rem;
  margin-bottom: 40px; line-height: 1.8;
}

/* 修复：添加 margin: 0 auto */
.prep-box { 
  text-align: center; 
  padding: 40px 20px; 
  margin: 0 auto;
  width: 100%;
}
.prep-text { font-size: 1.3rem; color: var(--accent); margin-bottom: 30px; line-height: 2; min-height: 80px; }
.crystal-ball {
  width: 120px; height: 120px; margin: 30px auto; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(192,160,255,0.4), rgba(107,91,149,0.2), rgba(10,10,26,0.8));
  border: 2px solid rgba(212,175,55,0.3);
  box-shadow: 0 0 30px rgba(192,160,255,0.2), inset 0 0 20px rgba(192,160,255,0.1);
  animation: pulse 2s ease-in-out infinite;
}
.loading-runes { display: flex; gap: 15px; justify-content: center; margin: 30px 0; }
.rune { font-size: 1.5rem; color: var(--gold); animation: runeFloat 1.5s ease-in-out infinite; }
.rune:nth-child(2){animation-delay:0.2s} .rune:nth-child(3){animation-delay:0.4s}
.rune:nth-child(4){animation-delay:0.6s} .rune:nth-child(5){animation-delay:0.8s}

.draw-stage { width: 100%; display: flex; flex-direction: column; align-items: center; position: relative; }
.spread-container {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 30px; margin: 20px 0 30px; width: 100%; min-height: 380px;
}
.deck-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 10px;
  width: 100%;
}
.deck-pile {
  position: relative;
  width: 100px; height: 170px;
  cursor: pointer;
  transition: transform 0.3s;
  margin: 0 auto;
}
.deck-pile:hover { transform: scale(1.08); }
.deck-pile .pile-card {
  position: absolute; width: 100%; height: 100%;
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.6);
  transition: transform 0.3s;
}
.deck-pile .pile-card img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.deck-pile .pile-card:nth-child(1) { transform: translate(0,0); z-index: 5; }
.deck-pile .pile-card:nth-child(2) { transform: translate(2px,2px); z-index: 4; opacity: 0.9; }
.deck-pile .pile-card:nth-child(3) { transform: translate(4px,4px); z-index: 3; opacity: 0.8; }
.deck-pile .pile-card:nth-child(4) { transform: translate(6px,6px); z-index: 2; opacity: 0.7; }
.draw-hint {
  color: var(--text-dim); font-size: 0.9rem; margin-top: 15px;
  animation: blink 2s infinite; text-align: center;
}

/* 修复：添加 margin: 0 auto 确保结果页内容居中 */
.result-area { 
  width: 100%; 
  max-width: 800px; 
  margin: 0 auto; 
  padding-top: 20px;
  text-align: center;
}
.result-title {
  font-family: 'Cinzel Decorative', cursive; color: var(--gold);
  font-size: 1.8rem; text-align: center; margin-bottom: 30px;
  text-shadow: 0 0 15px rgba(212,175,55,0.3);
}

.ai-page-header { text-align: center; margin-bottom: 30px; }
.ai-page-title {
  font-family: 'Cinzel Decorative', cursive;
  color: var(--accent); font-size: 2rem;
  text-shadow: 0 0 20px rgba(192,160,255,0.3);
  margin-bottom: 10px;
}
.ai-page-subtitle {
  color: var(--text-dim); font-size: 0.95rem;
  letter-spacing: 2px;
}
/* 修复：添加 margin: 0 auto 水平居中 */
.ai-full-box {
  width: 100%; max-width: 700px;
  background: rgba(26,26,62,0.5);
  border: 1px solid rgba(192,160,255,0.25);
  border-radius: 16px;
  padding: 30px;
  margin: 0 auto 30px;
  position: relative;
}
.ai-full-box::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: 16px 16px 0 0;
}
.ai-loading-full { text-align: center; padding: 40px 20px; }
.ai-loading-full .crystal-ball { width: 80px; height: 80px; margin: 0 auto 20px; }
.ai-loading-text { color: var(--accent); font-size: 1.1rem; margin-bottom: 15px; }
.ai-loading-sub { color: var(--text-dim); font-size: 0.9rem; }
.ai-content-full {
  color: var(--text); line-height: 2.2;
  font-size: 1rem;
}
.ai-content-full h3 {
  font-family: 'Cinzel', serif;
  color: var(--gold); font-size: 1.15rem;
  margin: 25px 0 12px;
  border-bottom: 1px solid rgba(212,175,55,0.2);
  padding-bottom: 8px;
}
.ai-content-full p { margin-bottom: 16px; text-indent: 2em; }
.ai-content-full strong { color: var(--gold-light); }
.ai-content-full .highlight-box {
  background: rgba(192,160,255,0.08);
  border-left: 3px solid var(--accent);
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin: 20px 0;
  text-indent: 0;
}
.ai-content-full .divider {
  text-align: center;
  color: var(--gold);
  font-size: 1.2rem;
  margin: 20px 0;
  letter-spacing: 8px;
}

/* 手机端适配 */
@media (max-width: 480px) {
  .title-main { font-size: 2.2rem; }
  
  .spread-container { 
    gap: 10px; 
    min-height: 240px; 
    flex-wrap: nowrap; 
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch;
    justify-content: center;
    padding: 0 5px;
  }
  
  .btn-mystic { padding: 16px 30px; font-size: 1rem; }
  .deck-pile { width: 70px; height: 119px; }
  .question-title { font-size: 1.3rem; }
  .btn-ai-big { padding: 20px 30px; font-size: 1.1rem; }
  .ai-page-title { font-size: 1.6rem; }
  .ai-full-box { padding: 20px; }
  
  .position-label { font-size: 0.8rem; margin-top: 10px; letter-spacing: 1px; }
  .reversed-tag { font-size: 0.6rem; padding: 2px 6px; top: 6px; right: 6px; }
  
  /* 手机端确保 question-box 不溢出 */
  .question-box { padding: 30px 15px; }
  /* 新增：AI页底部按钮容器在手机端也强制居中对齐 */
  .ai-page-btn-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    margin-bottom: 40px;
  }
  /* 新增：牌堆长按不要误触放大 */
  .deck-pile { 
    width: 70px; 
    height: 119px; 
    margin: 0 auto;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;   /* 新增 */
  }
  .shuffle-title { font-size: 1.8rem; }
  .shuffle-hint { font-size: 1rem; margin-bottom: 30px; }
  .shuffle-deck-area { width: 100px; height: 170px; }
  .shuffle-progress-ring { width: 140px; height: 140px; }
  .shuffle-sub { font-size: 0.85rem; margin-top: 40px; }
  .shuffle-texts { position: absolute; top: 16%; z-index: 102; pointer-events: none; min-height: 30px; }
  /* .shuffle-text { font-size: 1.1rem; letter-spacing: 2px; } */
  .shuffle-text { 
    font-size: 1.1rem; 
    letter-spacing: 2px;
    text-shadow: 
      0 0 4px rgba(0,0,0,0.9),
      0 0 8px rgba(0,0,0,0.8),
      0 0 15px rgba(212,175,55,0.6),
      0 0 30px rgba(212,175,55,0.3);
  }
}

/* ===== 洗牌页 ===== */
.shuffle-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  padding: 20px;
  position: relative;
}
.shuffle-title {
  font-family: 'Cinzel Decorative', cursive;
  color: var(--gold);
  font-size: 2.2rem;
  margin-bottom: 30px;
  text-shadow: 0 0 20px rgba(212,175,55,0.3);
  letter-spacing: 4px;
}
.shuffle-hint {
  color: var(--accent);
  font-size: 1.1rem;
  margin-bottom: 40px;
  letter-spacing: 2px;
  min-height: 24px;
  transition: all 0.3s;
  text-align: center;
}
.shuffle-deck-area {
  position: relative;
  width: 120px;
  height: 204px;
  margin: 0 auto;
  z-index: 2;
}
.shuffle-deck {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  z-index: 2;
  touch-action: manipulation;     /* 新增：只允许滚动和点击，禁用双击缩放等 */
}
.shuffle-deck.pressing {
  transform: scale(0.92);
  box-shadow: 0 0 40px rgba(212,175,55,0.5);
}
.shuffle-progress-ring {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 170px; height: 170px;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.shuffle-progress-ring.active {
  opacity: 1;
}
.shuffle-progress-ring svg {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}



.progress-bg {
  fill: none;
  stroke: rgba(212,175,55,0.1);
  stroke-width: 3;
}
.progress-bar {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 0.1s linear;
}
.shuffle-sub {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 50px;
  letter-spacing: 1px;
  text-align: center;
  min-height: 20px;
}

/* 洗牌提示词 — absolute 定位在标题与牌堆之间，z-index 高于 flying-overlay(100) */
.shuffle-texts {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 102;
  text-align: center;
  pointer-events: none;
  width: 90%;
  max-width: 500px;
  min-height: 36px;
}
.shuffle-text {
  margin: 0;
  font-size: 1.4rem;
  color: #fff;                    /* 白色主体，对比度最高 */
  letter-spacing: 3px;
  opacity: 0;
  transition: opacity 0.3s;
  position: absolute;
  width: 100%;
  left: 0;
  top: 0;
  white-space: nowrap;
  /* 多层阴影：深色描边 + 金色发光 + 外发光 */
  text-shadow: 
    0 0 6px rgba(0,0,0,0.9),      /* 黑色内描边 */
    0 0 12px rgba(0,0,0,0.8),      /* 黑色外描边 */
    0 0 20px rgba(212,175,55,0.6), /* 金色发光 */
    0 0 40px rgba(212,175,55,0.3); /* 金色外发光 */
}
.shuffle-text.active {
  opacity: 1;
}

/* 每个字单独控制 */
.shuffle-text span {
  display: inline-block;
  opacity: 0;
  will-change: opacity, transform, filter;
}