* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 背景虚影层 */
.bg-shadow-hero {
  position: absolute;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  filter: blur(32px) brightness(0.4) contrast(1.2);
  transition: opacity 1.2s ease, background-image 0.6s ease;
  z-index: 1;
  pointer-events: none;
}
.bg-shadow-hero.active {
  opacity: 0.65;
}

/* 3D 舞台中心容器 */
.stage {
  position: relative;
  width: 500px;
  height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  z-index: 2;
}

/* 火星粒子画布（覆盖整个舞台，层级穿插在卡片与字母之间） */
#sparksCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 150;
}

/* 轮盘主轴容器 */
.cards-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* 单张卡牌容器 */
.card-anchor {
  position: absolute;
  width: 130px;
  height: 205px;
  top: 50%;
  left: 50%;
  margin-top: -102px;
  margin-left: -65px;
  transform-origin: center center;
  transform-style: preserve-3d;
  transition: all 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}

/* 3D 双面卡牌实体 */
.card-body {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.2, 1.2, 0.3, 1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.9);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

/* 卡牌背面 */
.card-back {
  background: #0d1017;
  border: 2px solid rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotateY(0deg) translateZ(1px);
}

.tarot-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* 卡牌正面 (主角出场) */
.card-front {
  background: #111;
  border: 2px solid rgba(255, 255, 255, 0.85);
  transform: rotateY(180deg) translateZ(1px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease;
}

/* 外放动态范围 (HDR 多层光晕爆发 + 电光脉冲) */
.card-front.electric-border {
  border: 3px solid #ffffff;
  box-shadow:
    0 0 15px rgba(255, 255, 255, 1),
    0 0 35px rgba(255, 170, 50, 0.85),
    0 0 70px rgba(255, 90, 0, 0.5),
    inset 0 0 20px rgba(255, 255, 255, 0.7);
  animation: electricPulse 1.6s infinite alternate ease-in-out;
}

@keyframes electricPulse {
  0% {
    filter: drop-shadow(0 0 10px rgba(255, 200, 100, 0.8));
    transform: rotateY(180deg) translateZ(1px) scale(1);
    box-shadow:
      0 0 15px rgba(255, 255, 255, 1),
      0 0 35px rgba(255, 160, 40, 0.8),
      0 0 65px rgba(255, 70, 0, 0.4);
  }
  100% {
    filter: drop-shadow(0 0 32px rgba(255, 220, 150, 1));
    transform: rotateY(180deg) translateZ(1px) scale(1.04);
    box-shadow:
      0 0 25px rgba(255, 255, 255, 1),
      0 0 55px rgba(255, 180, 60, 0.95),
      0 0 110px rgba(255, 80, 0, 0.65);
  }
}

/* 环绕字母旋转轨道 */
.text-orbit-ring {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  pointer-events: none;
  transform-style: preserve-3d;
  opacity: 0;
  transition: opacity 1s ease;
  animation: orbitSpin 14s linear infinite;
}
.text-orbit-ring.active {
  opacity: 1;
}

.orbit-char {
  position: absolute;
  top: 50%;
  left: 50%;
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.95);
  transform-origin: 0 0;
}

@keyframes orbitSpin {
  0% { transform: rotateZ(0deg); }
  100% { transform: rotateZ(360deg); }
}

/* 底部重放按钮 */
.replay-btn {
  position: absolute;
  bottom: 25px;
  z-index: 300;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  padding: 8px 24px;
  border-radius: 25px;
  font-size: 13px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}
.replay-btn:hover {
  background: #fff;
  color: #000;
}