/* divination-coin.css — 铜钱增强+手机交互+蓄力环+全屏沉浸+成卦揭幕+英雄卡 */
/* ── 铜钱正反面差异增强 ── */
.div-coin {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.div-coin-back {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #705020 0%, #8b6914 30%, #a07830 50%, #8b6914 70%, #5a3e10 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.div-coin-back::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(245, 240, 255, 0.6);
  border: 1.5px solid rgba(90, 62, 16, 0.5);
}
.div-coin-back::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px dashed rgba(160, 120, 48, 0.25);
}
.div-coin.tails .div-coin-back { opacity: 1; }
.div-coin.tails .div-coin-text { opacity: 0; }
.div-coin.tails::before { border-radius: 50%; width: 16px; height: 16px; }

/* 铜钱散落过渡 */
.div-coin.scatter {
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ══════════════════════════════════════════════════
   渐进氛围层（精致优化版）
   ══════════════════════════════════════════════════ */
.div-shake-card {
  position: relative;
  overflow: hidden;
}
/* 八卦水印 — 极淡底纹增加仪式感 */
.div-shake-card::before {
  content: '☰ ☱ ☲ ☳ ☴ ☵ ☶ ☷';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  letter-spacing: 6px;
  color: rgba(108, 92, 231, 0.02);
  pointer-events: none;
  z-index: 0;
  transform: rotate(-15deg) scale(1.2);
  font-family: serif;
  filter: blur(0.5px);
}

/* 氛围渐变层 */
.div-atmo-layer {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  transition: all 0.8s ease;
  z-index: 0;
  opacity: 0;
}
.div-atmo-layer.active { opacity: 1; }
.div-shake-card > * { position: relative; z-index: 1; }

/* 六级氛围渐变（精致柔和版 — 渐进浓烈） */
.div-atmo-1 .div-atmo-layer {
  background: radial-gradient(ellipse at center, rgba(212, 149, 12, 0.06), transparent 70%);
}
.div-atmo-2 .div-atmo-layer {
  background:
    radial-gradient(ellipse at center, rgba(212, 149, 12, 0.1), transparent 70%),
    radial-gradient(ellipse at 80% 20%, rgba(108, 92, 231, 0.05), transparent 50%);
}
.div-atmo-3 .div-atmo-layer {
  background:
    radial-gradient(ellipse at center, rgba(180, 120, 60, 0.14), transparent 60%),
    radial-gradient(ellipse at 20% 30%, rgba(108, 92, 231, 0.06), transparent 50%);
}
.div-atmo-4 .div-atmo-layer {
  background:
    radial-gradient(ellipse at center, rgba(139, 92, 246, 0.14), transparent 55%),
    radial-gradient(ellipse at 30% 20%, rgba(212, 149, 12, 0.1), transparent 50%);
}
.div-atmo-5 .div-atmo-layer {
  background:
    radial-gradient(ellipse at center, rgba(139, 92, 246, 0.18), transparent 50%),
    radial-gradient(ellipse at 20% 50%, rgba(232, 160, 6, 0.12), transparent 42%);
}
.div-atmo-6 .div-atmo-layer {
  background:
    radial-gradient(ellipse at center, rgba(232, 160, 6, 0.22), transparent 45%),
    radial-gradient(ellipse at 25% 25%, rgba(139, 92, 246, 0.14), transparent 42%),
    radial-gradient(ellipse at 75% 75%, rgba(108, 92, 231, 0.1), transparent 42%);
  animation: atmoGlowPulse 1.5s ease-in-out;
}
@keyframes atmoGlowPulse {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.8; }
}

/* ── 手机模式授权引导 ── */
.div-motion-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  margin-top: 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.06), rgba(212, 149, 12, 0.06));
  border: 1px solid rgba(108, 92, 231, 0.12);
}
.div-motion-prompt-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.15), rgba(212, 149, 12, 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--div-purple);
  animation: motionPromptFloat 2s ease-in-out infinite;
}
@keyframes motionPromptFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-3px) rotate(-8deg); }
  75% { transform: translateY(-3px) rotate(8deg); }
}
.div-motion-prompt p {
  font-size: 13px;
  color: var(--div-text-secondary);
  margin: 0;
}
.div-motion-prompt-btn {
  padding: 8px 20px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #6C5CE7, #a78bfa);
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.div-motion-prompt-btn:active { transform: scale(0.95); }
.div-motion-prompt-skip {
  padding: 4px 12px;
  border: none;
  background: transparent;
  color: var(--div-text-tertiary);
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
}

/* ── 蓄力环（手机长按模式）── */
.div-charge-ring-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.3);
  border-radius: inherit;
  backdrop-filter: blur(4px);
}
.div-charge-ring-svg {
  width: 120px;
  height: 120px;
  transform: rotate(-90deg);
}
.charge-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 5;
}
.charge-ring-fill {
  fill: none;
  stroke: url(#ringGrad);
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.1s linear;
}
.div-charge-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 8px;
  font-family: 'Noto Serif SC', serif;
}

/* 摇卦按钮增强 */
.div-shake-btn {
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}
.div-shake-btn.charging {
  transform: scale(0.95);
  box-shadow: 0 0 24px rgba(212, 149, 12, 0.4);
}
.div-shake-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s, opacity 0.4s;
  opacity: 0;
}
.div-shake-btn:active::after {
  width: 200px;
  height: 200px;
  opacity: 0;
}

/* ── 全屏沉浸模式 ── */
.div-immersive .div-page-header {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.5s ease;
  margin: 0;
  padding: 0;
}
.div-immersive-hide {
  opacity: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  transition: all 0.5s ease !important;
}
.div-immersive .div-shake-card {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 0;
  margin: 0 -16px;
  padding: 32px 24px;
  background: linear-gradient(180deg,
    rgba(15, 10, 30, 0.95) 0%,
    rgba(20, 15, 40, 0.9) 50%,
    rgba(15, 10, 30, 0.95) 100%);
  backdrop-filter: blur(20px);
  border: none;
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.div-immersive .div-shake-hint {
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: 17px;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.8) !important;
}
.div-immersive .div-shake-hint::before,
.div-immersive .div-shake-hint::after {
  color: rgba(232, 160, 6, 0.4);
}
.div-immersive .div-shake-hint.hint-complete {
  -webkit-text-fill-color: transparent !important;
}
.div-immersive .div-coin-result-text {
  color: rgba(255, 255, 255, 0.6);
}
.div-immersive .div-yao-label {
  color: rgba(255, 255, 255, 0.5);
}
.div-immersive .div-btn-gold.div-shake-btn {
  background: linear-gradient(135deg, rgba(212, 149, 12, 0.3), rgba(108, 92, 231, 0.2));
  border: 1px solid rgba(212, 149, 12, 0.3);
  color: var(--div-gold-light);
}
.div-immersive .div-ring-progress .ring-seg-bg {
  stroke: rgba(255, 255, 255, 0.08);
}
.div-immersive .div-action-btns {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.5s ease;
}

/* 飘浮粒子 */
.div-immersive-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.div-float-particle {
  position: absolute;
  bottom: -10px;
  left: var(--fp-x, 50%);
  width: var(--fp-size, 3px);
  height: var(--fp-size, 3px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 160, 6, 0.6), rgba(232, 160, 6, 0));
  animation: floatParticleUp var(--fp-dur, 5s) ease-in-out infinite;
  animation-delay: var(--fp-delay, 0s);
}
@keyframes floatParticleUp {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  10% { opacity: 0.8; }
  50% { opacity: 0.4; }
  100% { transform: translateY(-300px) scale(0.3); opacity: 0; }
}

/* ── 成卦揭幕仪式 ── */
.div-reveal-active .div-yao-line.hex-reveal {
  animation: revealFlash 0.4s ease-in-out 3;
}
@keyframes revealFlash {
  0%, 100% { box-shadow: 0 0 8px rgba(232, 160, 6, 0.3); }
  50% { box-shadow: 0 0 20px rgba(232, 160, 6, 0.6), 0 0 40px rgba(232, 160, 6, 0.2); }
}
.div-reveal-wave {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid rgba(232, 160, 6, 0.4);
  transform: translate(-50%, -50%) scale(0.5);
  animation: revealWaveExpand 1s ease-out forwards;
  pointer-events: none;
}
@keyframes revealWaveExpand {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(4); opacity: 0; }
}

/* ── 成卦英雄卡（浅色炫酷版） ── */
.div-hero-card {
  position: relative;
  border-radius: 22px;
  padding: 32px 24px;
  margin-bottom: 20px;
  background: linear-gradient(145deg,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(248, 245, 255, 0.82) 35%,
    rgba(255, 250, 240, 0.80) 100%);
  border: 1.5px solid rgba(212, 149, 12, 0.18);
  overflow: hidden;
  text-align: center;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 12px 40px rgba(108, 92, 231, 0.08),
    0 4px 16px rgba(212, 149, 12, 0.06),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset,
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
}
.div-hero-glow {
  position: absolute;
  top: -40%;
  left: -20%;
  width: 140%;
  height: 140%;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(212, 149, 12, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 30% 70%, rgba(108, 92, 231, 0.10) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(253, 121, 168, 0.06) 0%, transparent 40%);
  pointer-events: none;
  animation: heroGlowDrift 6s ease-in-out infinite;
}
@keyframes heroGlowDrift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(5%, 3%) rotate(2deg); }
}
/* 英雄卡顶部彩虹渐变装饰线 */
.div-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--div-gold), var(--div-purple), #fd79a8, var(--div-gold));
  background-size: 200% 100%;
  animation: heroRainbowShift 4s ease-in-out infinite;
  z-index: 2;
}
@keyframes heroRainbowShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
/* 英雄卡底部微光粒子装饰 */
.div-hero-card::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 149, 12, 0.3), rgba(108, 92, 231, 0.3), transparent);
}
.div-hero-content {
  position: relative;
  z-index: 1;
}
.div-hero-symbols {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 4px;
  line-height: 1;
}
.div-hero-trigram {
  font-size: 34px;
  letter-spacing: 3px;
  opacity: 0.9;
  transition: all 0.3s;
}
.div-hero-trigram.upper {
  color: var(--div-gold);
  filter: drop-shadow(0 0 8px rgba(212, 149, 12, 0.25));
}
.div-hero-trigram.lower {
  color: var(--div-purple);
  margin-top: -6px;
  filter: drop-shadow(0 0 8px rgba(108, 92, 231, 0.25));
}
.div-hero-card:hover .div-hero-trigram {
  transform: scale(1.05);
  opacity: 1;
}
.div-hero-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 30px;
  font-weight: 900;
  background: linear-gradient(135deg, #2d1b69 0%, var(--div-gold) 50%, #2d1b69 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 8px;
  margin: 10px 0 8px;
  position: relative;
  animation: heroNameShimmer 3s ease-in-out infinite;
}
@keyframes heroNameShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
/* 卦名底部装饰线 */
.div-hero-name::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--div-gold), transparent);
  margin: 8px auto 0;
  opacity: 0.6;
}
.div-hero-desc {
  font-size: 13px;
  color: var(--div-text-secondary);
  margin-bottom: 14px;
  letter-spacing: 1px;
}
.div-hero-tags {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
}
.div-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(4px);
  transition: all 0.3s ease;
}
.div-hero-tag.upper {
  background: rgba(212, 149, 12, 0.10);
  color: #9a6b08;
  border: 1px solid rgba(212, 149, 12, 0.20);
}
.div-hero-tag.lower {
  background: rgba(108, 92, 231, 0.10);
  color: #5b4cc7;
  border: 1px solid rgba(108, 92, 231, 0.20);
}
.div-hero-tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}
.div-hero-changed {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--div-text-tertiary);
  margin-bottom: 10px;
}
.div-hero-changed i { color: var(--div-purple); }
.div-hero-changed-name {
  color: var(--div-purple);
  font-weight: 600;
  letter-spacing: 2px;
}
.div-hero-guaci {
  font-family: 'Noto Serif SC', serif;
  font-size: 13px;
  color: var(--div-text-tertiary);
  line-height: 1.8;
  font-style: italic;
  max-width: 320px;
  margin: 0 auto;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  letter-spacing: 0.5px;
}

/* ── 桌面模式hover增强 ── */
@media (hover: hover) and (pointer: fine) {
  .div-desktop-mode .div-coin {
    transition: transform 0.4s ease;
  }
  .div-desktop-mode .div-shake-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(212, 149, 12, 0.3);
  }
  .div-desktop-mode .div-yao-slot:hover .div-yao-label {
    color: var(--div-gold);
  }
  .div-desktop-mode .div-yao-slot:hover .div-yao-line.yang {
    box-shadow: 0 2px 16px rgba(212, 149, 12, 0.35);
  }
}

/* ── 手机端响应式调整 ── */
@media (pointer: coarse) and (hover: none) {
  .div-shake-btn {
    padding: 16px 32px;
    font-size: 16px;
    min-height: 52px;
  }
  .div-motion-prompt { margin-top: 16px; }
}

/* ── 英雄卡响应式 ── */
@media (max-width: 480px) {
  .div-hero-card { padding: 24px 16px; }
  .div-hero-name { font-size: 26px; letter-spacing: 6px; }
  .div-hero-trigram { font-size: 28px; }
  .div-hero-tags { gap: 8px; }
  .div-hero-tag { padding: 4px 10px; font-size: 11px; }
  .div-hero-guaci { font-size: 12px; }
  .div-hero-card::before { height: 2px; }
}

/* ── 无障碍：设备自适应动画降级 ── */
@media (prefers-reduced-motion: reduce) {
  .div-float-particle { animation: none; }
  .div-motion-prompt-icon { animation: none; }
  .div-hero-glow { animation: none; }
  .div-hero-card::before { animation: none; }
  .div-hero-name { animation: none; }
  .div-reveal-active .div-yao-line.hex-reveal { animation: none; }
  .div-reveal-wave { animation: none; }
  .div-coin.scatter { transition: none; }
  .div-immersive .div-shake-card { transition: none; }
  .div-immersive-hide { transition: none !important; }
  .div-atmo-layer { transition: none; }
  .div-ambient-dot { animation: none; opacity: 0; }
  .div-shake-card::before { animation: none; }
  .mh-taiji { animation: none !important; }
  .mh-gua-reveal { animation: none; opacity: 1; transform: none; }
}
