.stage-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border: var(--line);
  border-radius: var(--radius);
  background: radial-gradient(circle at 40% 50%, #FFFBEF 0, #FFEFC4 55%, #FFD98A 100%);
  box-shadow: 0 8px 0 var(--mo);
}

/* ---------- 计分板 ---------- */
.scoreboard { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; }

.score {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 8px 12px;
  border: var(--line);
  border-radius: 16px;
  background: #fff;
}

.score--main { background: var(--mo); color: #fff; }

.score__label {
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
  opacity: .8;
}

.score__num {
  font-size: clamp(20px, 3.4vw, 28px);
  font-weight: 900;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.score--main .score__num {
  display: inline-block;
  font-size: clamp(34px, 6vw, 52px);
  color: var(--huang);
  -webkit-text-stroke: 1.5px var(--mo);
  paint-order: stroke fill;
  text-shadow: 3px 3px 0 var(--zhu);
}

/* ---------- 口诀横幅 ---------- */
.chant {
  position: relative;
  margin: 0 16px;
  padding: 10px 16px;
  border: var(--line);
  background: var(--zhu);
  box-shadow: 0 4px 0 var(--mo);
  color: var(--huang);
  font-size: clamp(16px, 3.4vw, 21px);
  font-weight: 900;
  line-height: 1.4;
  text-align: center;
}

.chant::before,
.chant::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 16px;
  height: 70%;
  border: var(--line);
  background: var(--zhu-deep);
  transform: translateY(-50%);
}

.chant::before { left: -18px; border-radius: 6px 0 0 6px; }
.chant::after { right: -18px; border-radius: 0 6px 6px 0; }

.chant.is-bump { animation: chant-bump .25s ease-out; }

@keyframes chant-bump {
  from { transform: scale(1.06) rotate(-1deg); }
}

/* ---------- 舞台 ---------- */
.stage {
  position: relative;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.stage:focus-visible { outline: 3px dashed var(--zhu); outline-offset: 4px; border-radius: 24px; }

.scene { display: block; width: 100%; height: 100%; overflow: visible; }

.burst {
  transform-box: view-box;
  transform-origin: 150px 196px;
  animation: spin 40s linear infinite;
  opacity: .75;
}

.smoke { animation: smoke 3s ease-in-out infinite; }
.smoke--b { animation-delay: -1.5s; }

@keyframes smoke {
  0% { opacity: 0; transform: translateY(8px); }
  40% { opacity: .7; }
  100% { opacity: 0; transform: translateY(-16px); }
}

@keyframes spin { to { transform: rotate(360deg); } }

.xiaoren, .arm, .popo__head {
  transform-box: view-box;
}

.xiaoren {
  transform-origin: 150px 332px;
  transition: transform 1.6s ease-in, opacity 1.6s ease-in, filter 1.2s;
}

.arm { transform-origin: 272px 222px; }
.popo__head { transform-origin: 320px 214px; }

.stars {
  transform-box: view-box;
  transform-origin: 150px 64px;
  animation: spin 1.6s linear infinite;
}

/* 受伤程度：data-hurt 从 0 到 4 递增 */
.hurt, .creases { display: none; }
.scene:is([data-hurt="1"], [data-hurt="2"], [data-hurt="3"], [data-hurt="4"]) .hurt--1,
.scene:is([data-hurt="2"], [data-hurt="3"], [data-hurt="4"]) .hurt--2,
.scene:is([data-hurt="2"], [data-hurt="3"], [data-hurt="4"]) .creases,
.scene:is([data-hurt="3"], [data-hurt="4"]) .hurt--3 { display: inline; }
.scene[data-hurt="4"] .xiaoren { transform: scale(1.04, .94); }

/* 换脸：照片模式隐藏预设脸 */
.face-photo, .face-photo-ring { display: none; }
.scene[data-photo="1"] .face-photo,
.scene[data-photo="1"] .face-photo-ring { display: inline; }
.scene[data-photo="1"] #faceUse { display: none; }

/* 婆婆表情 */
.mouth { display: none; }
.scene[data-mouth="shout"] .mouth--shout,
.scene[data-mouth="grit"] .mouth--grit { display: inline; }

/* 烧小人 */
.flames, .ash { opacity: 0; transition: opacity .4s; }
.flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker .28s ease-in-out infinite alternate; }
.flame--b { animation-duration: .22s; }
.flame--c { animation-duration: .34s; }

@keyframes flicker {
  from { transform: scale(1, 1) skewX(-4deg); }
  to { transform: scale(.9, 1.12) skewX(4deg); }
}

.scene.is-burning .flames { opacity: 1; }
.scene.is-burning .xiaoren { transform: scale(.2, .1); opacity: 0; filter: brightness(.2); }
.scene.is-burnt .flames { opacity: 0; }
.scene.is-burnt .ash { opacity: 1; }
.scene.is-burnt .xiaoren { transition: none; }

/* ---------- 漂字 ---------- */
.floats { position: absolute; inset: 0; pointer-events: none; }

.float {
  position: absolute;
  left: var(--x);
  top: var(--y);
  font-size: clamp(20px, 4.4vw, 30px);
  font-weight: 900;
  white-space: nowrap;
  color: var(--zhu);
  -webkit-text-stroke: 6px #fff;
  paint-order: stroke fill;
  animation: float-up .9s ease-out forwards;
}

.float--bonus { color: var(--mo); font-size: clamp(15px, 3vw, 19px); -webkit-text-stroke: 5px var(--huang); }

@keyframes float-up {
  0% { opacity: 0; transform: translate(-50%, 0) scale(.5) rotate(-8deg); }
  15% { opacity: 1; transform: translate(-50%, -14px) scale(1.2) rotate(-4deg); }
  100% { opacity: 0; transform: translate(-50%, -100px) scale(1) rotate(0); }
}

.impact {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 64px;
  height: 64px;
  background: var(--huang);
  clip-path: polygon(50% 0, 61% 32%, 96% 20%, 72% 48%, 100% 72%, 64% 68%, 56% 100%, 44% 70%, 8% 88%, 30% 58%, 0 36%, 38% 34%);
  animation: impact .32s ease-out forwards;
}

@keyframes impact {
  from { opacity: 1; transform: translate(-50%, -50%) scale(.4) rotate(0); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(1.6) rotate(30deg); }
}

/* ---------- 连击 ---------- */
.combo {
  position: absolute;
  z-index: 2;
  top: 2%;
  right: 0;
  font-size: clamp(22px, 4.6vw, 32px);
  font-weight: 900;
  color: var(--zhu);
  -webkit-text-stroke: 5px #fff;
  paint-order: stroke fill;
  transform: rotate(8deg);
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}

.combo.is-on { opacity: 1; }

/* ---------- 控制区 ---------- */
.controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

#burnBtn.is-ready { animation: ready 1s ease-in-out infinite; }

@keyframes ready {
  0%, 100% { box-shadow: var(--pop), 0 0 0 0 rgba(255, 138, 31, .7); }
  50% { box-shadow: var(--pop), 0 0 0 10px rgba(255, 138, 31, 0); }
}

.hint { margin: 0; text-align: center; font-size: 13px; font-weight: 600; opacity: .65; }

/* ---------- 撒金币 ---------- */
.confetti { position: fixed; inset: 0; z-index: 70; overflow: hidden; pointer-events: none; }

.confetti__piece {
  position: absolute;
  top: -40px;
  left: var(--x);
  width: 22px;
  height: 22px;
  animation: fall var(--dur) cubic-bezier(.3, .1, .6, 1) var(--delay) forwards;
}

.confetti__piece--coin {
  border: 2.5px solid var(--mo);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FFF0A8, var(--jin));
}

.confetti__piece--coin::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px solid var(--mo);
  background: #FFE08A;
}

.confetti__piece--paper { width: 10px; height: 18px; background: var(--zhu); border-radius: 2px; }

@keyframes fall {
  from { transform: translate(0, 0) rotate(0); opacity: 1; }
  to { transform: translate(var(--drift), 110vh) rotate(var(--rot)); opacity: .9; }
}

@media (max-width: 480px) {
  .stage-card { padding: 16px 12px; }
  .score { padding: 6px 8px; }
  .score__label { font-size: 12px; }
  .controls .btn { padding: 10px 14px; }
}
