/* 玉京宮 · 视觉
 * 底图是亮的水彩国风，界面就得退到边上：靛蓝 + 暗金细线，不抢画。
 *
 * 四条硬规矩：
 *   1. 底图无字。匾额一律 DOM 画：横匾自右向左，竖牌自上而下，繁体。
 *   2. 每一处可点都有光：正殿悬停推门，侧殿地面光圈，香炉蒲团各有一圈呼吸光。
 *   3. 人物背身，头朝殿里。叩首是往里磕。
 *   4. 一殿一匾，绝不叠第二块。
 */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold: #d9b96a;
  --gold-2: #f0d79c;
  --gold-dim: rgba(217, 185, 106, .42);
  --gold-line: rgba(217, 185, 106, .24);
  --ink: #101c33;
  --ink-2: #1b2c4a;
  --paper: #f2e8d2;
  --jade: #9fd8cf;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --sans: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

html, body {
  height: 100%;
  background: #0a1120;
  color: var(--paper);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ================= 背景 ================= */
.backdrop {
  position: fixed; inset: -6%;
  background-size: cover; background-position: center;
  filter: blur(48px) brightness(.42) saturate(.7);
  transform: scale(1.12);
  z-index: 0;
}

/* ================= 舞台 ================= */
.stage {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
  overflow: hidden;
}
.stage > .scene-layer,
.stage > .lighting,
.stage > .smoke-layer,
.stage > .spots,
.stage > .actors,
.stage > .vignette,
.stage > .grain {
  position: absolute;
  left: 50%; top: 50%;
  width: min(100vw, calc(100vh * 1.5));
  height: min(100vh, calc(100vw / 1.5));
  transform: translate(-50%, -50%);
}

.scene-layer img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .7s ease;
  will-change: opacity;
  filter: saturate(1.02) contrast(1.02);
}
.scene-layer img.on { opacity: 1; }

/* 暗角压得很轻：这套图本身亮，压重了就闷 */
.vignette {
  pointer-events: none;
  background:
    radial-gradient(132% 108% at 50% 42%, transparent 52%, rgba(12, 18, 34, .38) 100%),
    linear-gradient(to bottom, rgba(10, 16, 30, .34) 0%, transparent 15%, transparent 78%, rgba(10, 16, 30, .4) 100%);
}
.grain {
  pointer-events: none; opacity: .028; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/></filter><rect width='120' height='120' filter='url(%23n)'/></svg>");
}
/* 前景云气：给殿内垫一层近景，纵深就出来了 */
.stage > .grain::after {
  content: "";
  position: absolute; left: -12%; right: -12%; bottom: -6%; height: 30%;
  background: radial-gradient(58% 100% at 50% 100%, rgba(226, 236, 248, .16), transparent 72%);
  filter: blur(16px);
}

.stage > .dipmask {
  position: absolute; inset: 0;
  background: radial-gradient(80% 70% at 50% 45%, #0c1424, #05080f 78%);
  opacity: 0; pointer-events: none;
  transition: opacity .24s ease;
  z-index: 5;
}
.stage.dip > .dipmask { opacity: .94; }

/* ================= 热点总则 ================= */
.spots { pointer-events: none; }
.spot {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  border: 0; background: none;
  color: var(--paper);
  font-family: var(--serif);
  -webkit-tap-highlight-color: transparent;
}

/* ---------- 匾额：横匾（自右向左） ---------- */
.plaque.h {
  position: absolute; left: 50%; top: -1%;
  transform: translate(-50%, -100%);
  min-width: 100%;
  padding: 4px 12px;
  display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(180deg, rgba(28, 52, 96, .96), rgba(16, 32, 62, .98)),
    #16294a;
  border: 2px solid rgba(217, 185, 106, .92);
  border-radius: 3px;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, .5),
    inset 0 0 12px rgba(120, 160, 230, .34),
    inset 0 1px 0 rgba(255, 236, 190, .3);
  white-space: nowrap;
}
.plaque.h .txt { display: flex; flex-direction: row-reverse; gap: 5px; }
/* 自右向左：用 row-reverse，DOM 里仍按「玉、皇、殿」写，读起来才是对的 */
.plaque.h .txt b {
  font-size: 15px; font-weight: 400; letter-spacing: 0;
  color: #f6dfa6;
  text-shadow: 0 1px 0 rgba(90, 60, 20, .9), 0 0 10px rgba(255, 220, 150, .45);
}

/* ---------- 正殿：双扇门 ---------- */
.spot.main { overflow: visible; }
.spot.main .portal {
  position: absolute; inset: -6% -4%;
  background:
    radial-gradient(ellipse 60% 70% at 50% 62%, rgba(255, 238, 196, .95), rgba(255, 206, 128, .5) 42%, transparent 74%);
  opacity: 0;
  filter: blur(2px);
  transition: opacity .55s ease;
  pointer-events: none;
}
.spot.main.opening .portal { opacity: 1; }
.spot.main:hover .leaf, .spot.main.opening .leaf { opacity: .96; }
.spot.main:hover .leaf.l, .spot.main.opening .leaf.l { transform: perspective(620px) rotateY(-78deg); }
.spot.main:hover .leaf.r, .spot.main.opening .leaf.r { transform: perspective(620px) rotateY(78deg); }

.spot.main .leaf {
  position: absolute; top: 0; bottom: 0; width: 50%;
  opacity: 0;
  transition: transform .82s cubic-bezier(.32, .78, .22, 1), opacity .38s ease;
  transform-style: preserve-3d;
  pointer-events: none;
  box-shadow: inset 0 0 22px rgba(0, 0, 0, .5);
}
.spot.main .leaf.l {
  left: 0; transform-origin: left center;
  border-radius: 2px 0 0 2px;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .06) 0 2px, transparent 2px 26px),
    linear-gradient(180deg, rgba(150, 44, 38, .92), rgba(112, 30, 26, .95));
}
.spot.main .leaf.r {
  right: 0; transform-origin: right center;
  border-radius: 0 2px 2px 0;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .06) 0 2px, transparent 2px 26px),
    linear-gradient(180deg, rgba(150, 44, 38, .92), rgba(112, 30, 26, .95));
}
/* 门钉 */
.spot.main .leaf i {
  position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe8ab, #b48a3c 70%, #6b4a1c);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}
.spot.main .leaf.l i:nth-child(1) { left: 22%; top: 22%; }
.spot.main .leaf.l i:nth-child(2) { left: 22%; top: 50%; }
.spot.main .leaf.l i:nth-child(3) { left: 22%; top: 78%; }
.spot.main .leaf.r i:nth-child(1) { right: 22%; top: 22%; }
.spot.main .leaf.r i:nth-child(2) { right: 22%; top: 50%; }
.spot.main .leaf.r i:nth-child(3) { right: 22%; top: 78%; }

/* 推门提示：像游戏里的「进入」提示牌，平时淡淡亮着，指上去更亮 */
.push {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 11px 8px;
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(9, 16, 32, .76), rgba(9, 16, 32, .54));
  border: 1px solid rgba(230, 198, 122, .58);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, .5),
    0 0 26px rgba(255, 196, 104, .22),
    inset 0 0 16px rgba(255, 206, 130, .2);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .4s ease .12s;
  pointer-events: none;
}
.push span {
  font-size: 16px; line-height: 1.26; letter-spacing: .18em;
  color: #fffaea;
  /* 门洞里的光很亮，光靠 glow 压不住，先描一圈深色再填字 */
  -webkit-text-stroke: 2.4px rgba(16, 9, 2, .55);
  paint-order: stroke fill;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, .95),
    0 0 6px rgba(20, 10, 0, .85),
    0 0 16px rgba(255, 200, 110, 1);
}
/* 顶部一个小三角，往下指着牌子——游戏里那套「此处可进」的老办法 */
.push::after {
  content: "";
  position: absolute; left: 50%; top: -15px;
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 6px solid rgba(255, 216, 146, .9);
  filter: drop-shadow(0 0 7px rgba(255, 200, 110, .9));
  animation: pushArrow 1.9s ease-in-out infinite;
}
@keyframes pushArrow {
  0%, 100% { transform: translate(-50%, -3px); opacity: .45; }
  50%      { transform: translate(-50%, 3px); opacity: 1; }
}
.spot.main.opening .push { opacity: 0; }
.spot.main:hover .push, .spot.gatein:hover .push { opacity: 1; }
.spot.main:hover .portal { opacity: .5; }

/* ---------- 侧殿：地面光圈 + 竖排名牌 ---------- */
.spot.side { overflow: visible; }
.spot.side .halo {
  position: absolute; left: 50%; top: 46%;
  width: 96%; height: 86%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(180, 214, 255, .22), transparent 70%);
  filter: blur(6px);
  opacity: .7;
  transition: opacity .35s ease;
  pointer-events: none;
}
.spot.side:hover .halo { opacity: 1; }

.spot.side .ring {
  position: absolute;
  left: calc(50% + var(--rx, 0%));
  top: var(--ry, 88%);
  width: 106%; height: 20%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.spot.side .ring i {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 232, 176, .92);
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 228, 168, .3), transparent 70%);
  box-shadow:
    0 0 22px rgba(255, 216, 150, .8),
    inset 0 0 18px rgba(255, 216, 150, .5);
  animation: ringBreath 2.8s ease-in-out infinite;
}
.spot.side .ring::after {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 34%; height: 34%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(255, 238, 200, .55);
}
@keyframes ringBreath {
  0%, 100% { opacity: .74; transform: scale(.97); }
  50% { opacity: 1; transform: scale(1.05); }
}
.spot.side:hover .ring i {
  border-color: #fff8e2;
  box-shadow: 0 0 34px rgba(255, 236, 186, 1), inset 0 0 26px rgba(255, 228, 170, .7);
  animation-duration: 1.2s;
}

/* 竖排名牌：自上而下 */
.board.v {
  position: absolute; left: 50%; top: 16%;
  transform: translate(-50%, 0);
  display: flex; flex-direction: column; align-items: center;
  padding: 5px 4px;
  background: linear-gradient(180deg, rgba(22, 40, 72, .95), rgba(14, 26, 48, .97));
  border: 1.5px solid rgba(217, 185, 106, .85);
  border-radius: 3px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .55), inset 0 0 10px rgba(110, 150, 220, .3);
  transition: transform .35s ease, box-shadow .35s ease;
  pointer-events: none;
}
.board.v b {
  font-size: 13px; font-weight: 400; line-height: 1.18;
  color: #f6dfa6;
  text-shadow: 0 1px 0 rgba(80, 50, 16, .9), 0 0 8px rgba(255, 218, 150, .4);
}
.board.v::before {
  content: "";
  position: absolute; left: 50%; top: -9px;
  width: 1px; height: 9px;
  background: rgba(217, 185, 106, .7);
}
.spot.side:hover .board.v {
  transform: translate(-50%, -3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .55), 0 0 22px rgba(255, 214, 150, .45), inset 0 0 12px rgba(130, 170, 240, .4);
}

/* ================= 祈福彩帶（殿內梁下） ================= */
.ribbons {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 4;
  overflow: hidden;
}
.ribbon {
  position: absolute; top: 0;
  transform: translateX(-50%);
  transform-origin: top center;
  animation: ribbonSway 5.6s ease-in-out infinite;
  animation-delay: var(--d, 0s);
  will-change: transform;
}
.ribbon .cord {
  display: block; width: 2px;
  height: calc(var(--len, 12vh) * .42);
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(255, 226, 168, .78), rgba(198, 62, 52, .9));
  box-shadow: 0 0 6px rgba(255, 190, 120, .35);
}
.ribbon .silk {
  width: 26px;
  min-height: calc(var(--len, 12vh) * .58);
  margin: 0 auto;
  padding: 6px 2px 11px;
  background: linear-gradient(180deg, #ef7059, #d8402f 58%, #a82a1e);
  border-radius: 1px 1px 2px 2px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 88%, 0 100%);
  box-shadow:
    0 5px 14px rgba(110, 18, 14, .5),
    inset 0 0 10px rgba(255, 186, 150, .35);
  display: flex; justify-content: center;
  opacity: .96;
}
.ribbon .silk b {
  writing-mode: vertical-rl;
  font-family: var(--serif); font-size: 10.5px; font-weight: 400;
  letter-spacing: .12em; line-height: 1.25;
  color: #ffe9b8;
  text-shadow: 0 1px 2px rgba(80, 10, 8, .8);
}
@keyframes ribbonSway {
  0%, 100% { transform: translateX(-50%) rotate(-1.6deg); }
  50% { transform: translateX(-50%) rotate(1.8deg); }
}

/* 弹窗里的彩带预览 */
.ribbon-preview {
  margin-top: 14px;
  display: flex; justify-content: center;
  padding: 10px 0 6px;
}
.ribbon-preview .rp-tag {
  writing-mode: vertical-rl;
  min-height: 92px;
  padding: 10px 6px 14px;
  font-family: var(--serif); font-size: 12px; letter-spacing: .18em;
  color: #ffe9b8;
  background: linear-gradient(180deg, #d8503f, #b8332a 62%, #94241d);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 88%, 0 100%);
  box-shadow: 0 6px 16px rgba(120, 20, 16, .5);
}

/* ---------- 鐘樓：在廣場東側，殿裡撞不著 ---------- */
.spot.bell { overflow: visible; }
.spot.bell .turret {
  position: absolute; inset: 0;
  pointer-events: none;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .45));
}
.spot.bell .turret svg { width: 100%; height: 100%; display: block; }
.spot.bell .halo {
  position: absolute; left: 50%; top: 84%;
  width: 168%; height: 42%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 214, 140, .34), transparent 68%);
  filter: blur(9px);
  animation: ringBreath 3.4s ease-in-out infinite;
  pointer-events: none;
}
.spot.bell .bell-body { transform-origin: 40px 18px; }
.spot.bell.clang .bell-body { animation: bellSwing .95s cubic-bezier(.3, .7, .3, 1); }
.spot.bell.clang .bell-hammer { animation: hammerHit .95s ease-out; }
@keyframes bellSwing {
  0% { transform: rotate(0deg); }
  18% { transform: rotate(-4.5deg); }
  40% { transform: rotate(3.4deg); }
  62% { transform: rotate(-2deg); }
  82% { transform: rotate(.8deg); }
  100% { transform: rotate(0deg); }
}
@keyframes hammerHit {
  0% { transform: translateX(0); }
  16% { transform: translateX(-5px); }
  100% { transform: translateX(0); }
}
.spot.bell .board.v { top: auto; bottom: -2%; }
.spot.bell .board.v::before { display: none; }
.spot.bell:hover .turret { filter: drop-shadow(0 10px 22px rgba(255, 200, 120, .5)); }

/* ---------- 宫门：门槛光带 ---------- */
.spot.gatein { overflow: visible; }
.spot.gatein .archlight {
  position: absolute; inset: 4% 2% 6%;
  background:
    radial-gradient(ellipse 52% 62% at 50% 74%, rgba(255, 238, 198, .5), rgba(210, 228, 255, .3) 45%, transparent 78%);
  filter: blur(5px);
  opacity: .55;
  transition: opacity .5s ease;
  pointer-events: none;
}
.spot.gatein:hover .archlight { opacity: 1; }
.spot.gatein .sill {
  position: absolute; left: 4%; right: 4%; bottom: 7%; height: 3.5px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 248, 224, 1), transparent);
  box-shadow: 0 0 26px rgba(255, 234, 186, 1), 0 0 68px rgba(255, 220, 160, .7);
  pointer-events: none;
  animation: sillBreath 3.4s ease-in-out infinite;
}
@keyframes sillBreath {
  0%, 100% { opacity: .7; }
  50% { opacity: 1; }
}

/* ---------- 焦点光（香炉 / 供台） ---------- */
.spot.pin, .spot.altar { overflow: visible; }
.spot.pin .focus, .spot.altar .focus {
  position: absolute; left: 50%; top: 62%;
  width: 96%; height: 60%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 226, 168, .44), rgba(255, 210, 148, .12) 62%, transparent 74%);
  box-shadow: 0 0 34px rgba(255, 214, 152, .45);
  opacity: .75;
  transition: opacity .3s, box-shadow .3s;
  pointer-events: none;
  animation: pinBreath 3.6s ease-in-out infinite;
}
@keyframes pinBreath {
  0%, 100% { opacity: .5; transform: translate(-50%, -50%) scale(.94); }
  50% { opacity: .95; transform: translate(-50%, -50%) scale(1.04); }
}
.spot.pin:hover .focus, .spot.altar:hover .focus {
  opacity: 1;
  box-shadow: 0 0 40px rgba(255, 226, 170, .55);
}

/* ---------- 神像区：只给一圈极淡的框 ---------- */
.spot.zone { border-radius: 6px; transition: box-shadow .3s, background .3s; }
.spot.zone:hover {
  background: radial-gradient(ellipse 60% 70% at 50% 50%, rgba(255, 236, 190, .07), transparent 72%);
  box-shadow: inset 0 0 40px rgba(255, 226, 170, .16);
}

/* ---------- 出殿 ---------- */
.spot.out {
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(217, 185, 106, .38);
  border-radius: 999px;
  background: rgba(8, 14, 26, .42);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3), inset 0 0 10px rgba(255, 214, 150, .10);
  backdrop-filter: blur(3px);
  transition: background .25s, border-color .25s;
}
.spot.out .mk {
  font-size: 11px; letter-spacing: .16em;
  color: rgba(255, 238, 200, .88);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
}
.spot.out:hover { border-color: rgba(246, 218, 160, .95); background: rgba(30, 24, 12, .72); }

/* ---------- 蒲团：套在真垫子上的一圈光 ---------- */
/* 蒲团：草编的。一道一道的草辫从中心绕出去，
   底下压一道暗影，看着才像坐实在地上，不是飘着的圈。 */
.spot.pad {
  width: 76px; height: 32px;
  transform: translate(-50%, -50%) scale(var(--k, 1));
  border-radius: 50%;
  border: 1px solid rgba(116, 84, 32, .62);
  background:
    repeating-conic-gradient(from 0deg at 50% 46%,
      rgba(120, 88, 30, .30) 0 5deg,
      rgba(255, 240, 190, .10) 5deg 10deg),
    radial-gradient(ellipse 72% 66% at 50% 40%,
      #f2e0ac 0%, #dfc288 34%, #c9a865 62%, #a8873f 84%, #8b6a2c 100%);
  box-shadow:
    0 7px 13px rgba(38, 26, 8, .45),
    inset 0 2px 4px rgba(255, 250, 218, .6),
    inset 0 -6px 11px rgba(96, 68, 22, .55),
    0 0 20px rgba(255, 214, 150, .3);
  transition: border-color .28s, box-shadow .28s, transform .28s;
  animation: padBreath 4.4s ease-in-out infinite;
}
/* 边缘一圈草绳收口 */
.spot.pad .weave {
  position: absolute; inset: 12% 9%;
  border-radius: 50%;
  border: 1px dashed rgba(104, 74, 26, .42);
  pointer-events: none;
}
@keyframes padBreath {
  0%, 100% { filter: brightness(.92); }
  50% { filter: brightness(1.1); }
}
.spot.pad:hover {
  border-color: rgba(255, 244, 214, .98);
  box-shadow: 0 0 34px rgba(255, 226, 168, .85), inset 0 0 20px rgba(255, 226, 168, .5);
  animation-play-state: paused;
}
.spot.pad .who {
  position: absolute; left: 50%; top: -18px; transform: translateX(-50%);
  font-size: 11px; letter-spacing: .08em; white-space: nowrap;
  color: #fff3d2; text-shadow: 0 1px 5px #000, 0 0 10px #000;
}
.spot.pad.taken {
  border-color: rgba(160, 230, 196, .8);
  background: radial-gradient(ellipse 62% 56% at 50% 44%, rgba(150, 226, 190, .22), transparent 74%);
  box-shadow: 0 0 20px rgba(150, 226, 190, .4);
}

/* ---------- 拜垫 ---------- */
/* 拜垫：道观里那种红缎厚垫，顶面一块，下面有实打实的侧壁。
   侧壁用 .wall 画，不是投影——投影做不出「有厚度」的感觉。 */
.spot.bowpad {
  width: 98px; height: 34px;
  transform: translate(-50%, -50%);
  background: none; border: 0; box-shadow: none;
}
.spot.bowpad .wall {
  position: absolute; left: 2%; right: 2%; top: 30%; bottom: -8px;
  border-radius: 48% 48% 44% 44% / 62% 62% 38% 38%;
  background: linear-gradient(180deg, #8e241c 0%, #6f1611 55%, #52100c 100%);
  box-shadow: 0 9px 15px rgba(20, 6, 4, .5), inset 0 -4px 8px rgba(0, 0, 0, .45);
  pointer-events: none;
}
.spot.bowpad .top {
  position: absolute; left: 0; right: 0; top: 0; height: 66%;
  border-radius: 50%;
  border: 1px solid rgba(255, 214, 150, .5);
  background:
    radial-gradient(ellipse 58% 52% at 50% 28%, #ec8b80 0%, #cf5245 40%, #a52e25 72%, #821d17 100%);
  box-shadow:
    inset 0 3px 7px rgba(255, 206, 176, .45),
    inset 0 -7px 12px rgba(84, 12, 10, .6),
    0 0 18px rgba(255, 176, 132, .28);
  pointer-events: none;
}
/* 垫角压的金线 */
.spot.bowpad .top::after {
  content: "";
  position: absolute; inset: 18% 14%;
  border-radius: 50%;
  border: 1px solid rgba(255, 216, 156, .34);
}
.spot.bowpad .mk {
  position: absolute; left: 50%; top: 30%;
  transform: translate(-50%, -50%);
  font-weight: 400; font-size: 12px; letter-spacing: .1em;
  color: rgba(255, 240, 206, .82);
  text-shadow: 0 1px 4px rgba(90, 12, 8, .9), 0 0 10px rgba(255, 200, 140, .55);
  pointer-events: none;
}
/* 引导光圈：套在垫子外一圈，一呼一吸 */
.spot.bowpad::after {
  content: "";
  position: absolute; left: -10%; right: -10%; top: -26%; bottom: -40%;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 226, 170, .78);
  box-shadow: 0 0 20px rgba(255, 206, 146, .55);
  animation: ringBreath 3.2s ease-in-out infinite;
  pointer-events: none;
}
/* 「叩」字只画一次，由 <b class="mk"> 负责 —— 先前 ::before 又写了一个，垫子上叠出两个 */
.spot.bowpad:hover .top {
  border-color: rgba(255, 246, 222, .95);
  box-shadow:
    inset 0 3px 8px rgba(255, 226, 200, .6),
    inset 0 -7px 12px rgba(84, 12, 10, .5),
    0 0 26px rgba(255, 206, 150, .6);
}
.spot.bowpad:hover::after {
  border-color: #fff6de;
  box-shadow: 0 0 30px rgba(255, 228, 172, .9);
}

/* ================= 人物 ================= */
.actors { pointer-events: none; }
.actor {
  position: absolute;
  transform: translate(-50%, -100%);
  pointer-events: auto;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center;
}
.actor .ch {
  display: block;
  height: calc(15.2vh * var(--k, 1));
  width: auto;
  overflow: visible;
  filter: drop-shadow(0 6px 10px rgba(8, 14, 26, .45));
}
.actor .pose { display: none; }
.actor[data-pose="stand"] .pose-stand,
.actor[data-pose="sit"] .pose-sit,
.actor[data-pose="kneel"] .pose-kneel,
.actor[data-pose="bow"] .pose-bow,
.actor[data-pose="bent"] .pose-bent { display: block; }
.actor.incensing .pose { display: none; }
.actor.incensing .pose-incense { display: block; }
.actor.belling .pose { display: none; }
.actor.belling .pose-incense { display: block; }
.actor.belling .incense-sticks { opacity: 0; }

.actor .tag {
  /* 名牌挂在头顶，不挂在脚下 —— 脚下会和旁白、动作条挤在一起 */
  order: -1;
  margin-top: 0; margin-bottom: 2px;
  font-family: var(--serif);
  font-size: 11px; letter-spacing: .06em;
  color: #fff4d8;
  background: rgba(10, 18, 32, .5);
  border: 1px solid rgba(217, 185, 106, .26);
  padding: 1px 6px;
  white-space: nowrap;
  text-shadow: 0 1px 4px #000;
  opacity: .9;
}
.actor.me .tag {
  color: #ffeec0;
  border-color: rgba(240, 208, 140, .62);
  background: rgba(38, 30, 14, .55);
}

/* ================= 顶部 HUD ================= */
.hud {
  position: absolute; left: 0; right: 0; top: 0;
  height: 13%;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 14px 20px 0;
  z-index: 6;
  pointer-events: none;
}
.hud::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 190%;
  background: linear-gradient(180deg, rgba(8, 14, 28, .66), rgba(8, 14, 28, .22) 52%, transparent);
  pointer-events: none; z-index: -1;
}
.hud-l { display: flex; align-items: center; gap: 12px; }
/* 宫名牌：竖排，自上而下 */
.plaque.name {
  display: flex; flex-direction: column; align-items: center;
  padding: 6px 5px;
  background: linear-gradient(180deg, rgba(24, 44, 82, .9), rgba(14, 28, 52, .94));
  border: 1.5px solid rgba(217, 185, 106, .78);
  border-radius: 3px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45), inset 0 0 10px rgba(110, 150, 220, .26);
}
.plaque.name b {
  font-family: var(--serif); font-size: 15px; font-weight: 400; line-height: 1.16;
  color: #f8e2a8;
  text-shadow: 0 1px 0 rgba(80, 50, 16, .9), 0 0 10px rgba(255, 218, 150, .4);
}
.scene-name {
  font-family: var(--serif);
  font-size: 13.5px; letter-spacing: .22em;
  color: rgba(240, 228, 202, .78);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .8);
}

.hud-r {
  display: flex; align-items: center; gap: 14px; pointer-events: auto;
  padding: 5px 11px;
  background: rgba(8, 14, 28, .46);
  border: 1px solid rgba(217, 185, 106, .2);
  backdrop-filter: blur(8px);
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.stat i {
  font-style: normal; font-size: 9.5px; letter-spacing: .2em;
  color: rgba(226, 214, 190, .56);
}
.stat b {
  font-family: var(--serif); font-size: 15px; font-weight: 400;
  color: #ffeec0; text-shadow: 0 0 12px rgba(230, 190, 120, .45);
}
.badge {
  font-size: 10.5px; letter-spacing: .14em;
  padding: 3px 9px;
  color: #cfe8de;
  border: 1px solid rgba(159, 216, 207, .42);
  background: rgba(20, 42, 44, .5);
  border-radius: 2px;
}
.badge.off { color: #e8b9a6; border-color: rgba(232, 160, 140, .38); background: rgba(48, 22, 18, .5); }

/* ================= 右侧在宫名单 ================= */
.people {
  position: absolute; right: 16px; top: 15%;
  width: 132px;
  z-index: 6;
  background: rgba(8, 14, 28, .72);
  border: 1px solid rgba(217, 185, 106, .26);
  backdrop-filter: blur(12px);
  padding: 8px 0 6px;
  opacity: .94;
  transition: opacity .3s;
}
.people:hover { opacity: 1; }
/* 静态单人版：没有别人可列，这块收起来别占右上角 */
body.solo .people { display: none; }
.pp-head {
  font-family: var(--serif); font-size: 11px; letter-spacing: .24em;
  color: rgba(217, 185, 106, .82);
  text-align: center; padding-bottom: 6px;
  border-bottom: 1px solid rgba(217, 185, 106, .16);
  margin: 0 8px 6px;
}
.pp-list { max-height: 40vh; overflow-y: auto; padding: 0 8px; }
.pp-scene { margin-bottom: 6px; }
.pp-t {
  display: block; font-size: 9.5px; letter-spacing: .18em;
  color: rgba(206, 220, 240, .62);
  margin-bottom: 2px;
}
.pp-scene i {
  display: inline-block; font-style: normal;
  font-size: 11.5px; color: rgba(242, 232, 210, .88);
  margin: 1px 4px 1px 0;
}
.pp-scene em { font-style: normal; font-size: 11px; color: rgba(200, 214, 236, .42); }
.pp-foot {
  margin: 6px 8px 0;
  padding-top: 5px;
  border-top: 1px solid rgba(217, 185, 106, .14);
  font-size: 9.5px; letter-spacing: .1em;
  color: rgba(206, 220, 240, .62);
  text-align: center;
}
.pp-foot.off { color: rgba(232, 160, 140, .7); }

/* ================= 底部正中：功德动作（上香 / 供燈 / 彩帶 / 求籤） ================
 * 位置在屏幕正中偏下，一排放得下四个，手指够得着，也不挡神像。
 */
.rail {
  position: absolute; left: 50%; bottom: 20px;
  transform: translateX(-50%);
  display: none; flex-direction: row; align-items: stretch; gap: 8px;
  z-index: 7;
}
.rail.on { display: flex; }
.rail button {
  min-width: 60px; padding: 8px 12px;
  font-family: var(--serif); font-size: 13.5px; letter-spacing: .16em;
  color: rgba(255, 242, 214, .96);
  background: linear-gradient(180deg, rgba(12, 24, 46, .84), rgba(8, 14, 26, .9));
  border: 1px solid rgba(217, 185, 106, .5);
  border-radius: 2px;
  backdrop-filter: blur(10px);
  box-shadow: 0 5px 18px rgba(0, 0, 0, .45), inset 0 0 12px rgba(90, 130, 200, .18);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .9);
  white-space: nowrap;
  cursor: pointer;
  transition: color .25s, border-color .25s, background .25s, box-shadow .25s, transform .18s;
}
.rail button:hover {
  color: #fff4d6;
  border-color: rgba(246, 218, 160, .92);
  background: linear-gradient(180deg, rgba(52, 40, 18, .82), rgba(22, 16, 8, .86));
  box-shadow: 0 0 24px rgba(255, 214, 150, .4), inset 0 0 16px rgba(255, 220, 150, .2);
  transform: translateY(-2px);
}
.rail button:active { transform: translateY(0); }

/* ================= 左侧竖排：场景切换 ================
 * 场景交给左边一列，用户随时点着换；屏幕正中留给动作与神像。
 */
.navbar {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%);
  margin: 0; width: auto;
  /* 十项竖成一列会有八百多像素，顶到 HUD；分两列，每列五项正好一屏 */
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(5, auto);
  align-items: stretch;
  /* 竖排字本身窄，两列再挤就贴成一行了，列距给到 7px */
  gap: 1px 7px;
  background: rgba(8, 14, 28, .6);
  border: 1px solid rgba(217, 185, 106, .26);
  backdrop-filter: blur(12px);
  padding: 6px 7px;
  z-index: 6;
  opacity: .9;
  transition: opacity .35s ease;
}
.navbar:hover { opacity: 1; }
.navbar button {
  border: 0; background: none; cursor: pointer;
  font-family: var(--serif); font-size: 11.5px; letter-spacing: .16em;
  color: rgba(240, 230, 208, .8);
  padding: 7px 5px;
  line-height: 1.2;
  writing-mode: vertical-rl;
  transition: color .25s, background .25s;
  white-space: nowrap;
}
.navbar button:hover { color: #fff4d6; background: rgba(255, 224, 160, .12); }
.navbar button.on {
  color: #ffeab4;
  background: rgba(255, 214, 140, .18);
  box-shadow: inset 3px 0 0 rgba(255, 214, 140, .85);
}
/* 两列竖排里分隔线不占位，否则把五行撑成六行 */
.nav-sep { display: none; }
.navbar button.shopbtn {
  font-size: 11px; letter-spacing: .1em;
  padding: 8px 5px;
  color: rgba(240, 212, 156, .88);
  border: 1px solid rgba(217, 185, 106, .38);
  background: linear-gradient(180deg, rgba(52, 38, 20, .56), rgba(22, 16, 10, .56));
  align-self: center;
}
.navbar button.shopbtn:hover {
  color: #fff6e0;
  border-color: rgba(246, 218, 160, .95);
  background: linear-gradient(180deg, rgba(80, 58, 28, .72), rgba(28, 20, 12, .66));
}

/* ================= 声音 / 提示 / 浮字 ================= */
.sound {
  position: absolute; right: 16px; bottom: 16px;
  width: 34px; height: 34px;
  font-family: var(--serif); font-size: 12px;
  color: rgba(240, 228, 200, .8);
  background: rgba(10, 18, 32, .5);
  border: 1px solid rgba(217, 185, 106, .28);
  backdrop-filter: blur(8px);
  cursor: pointer;
  z-index: 7;
}
.sound.mute { color: rgba(200, 200, 200, .34); border-color: rgba(200, 200, 200, .16); }
.sound.wishwall { bottom: 58px; }

.hoverhint {
  position: absolute; left: 50%; bottom: 76px;
  transform: translate(-50%, 8px);
  font-family: var(--serif); font-size: 13px; letter-spacing: .22em;
  color: #ffeec4;
  padding: 5px 16px;
  background: rgba(10, 18, 32, .62);
  border: 1px solid rgba(217, 185, 106, .3);
  backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none;
  transition: opacity .26s ease, transform .26s ease;
  z-index: 6;
  white-space: nowrap;
  text-shadow: 0 0 14px rgba(255, 214, 150, .5);
}
.hoverhint.on { opacity: 1; transform: translate(-50%, 0); }

.toast {
  position: absolute; left: 50%; bottom: 140px;
  transform: translate(-50%, 10px);
  max-width: min(76vw, 520px);
  font-size: 13px; line-height: 1.7; letter-spacing: .06em;
  color: #f6ecd6;
  text-align: center;
  padding: 8px 18px;
  background: rgba(8, 14, 26, .74);
  border: 1px solid rgba(217, 185, 106, .24);
  backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none;
  transition: opacity .35s ease, transform .35s ease;
  z-index: 8;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.caption {
  position: absolute; left: 50%; bottom: 104px;
  transform: translateX(-50%);
  font-family: var(--serif); font-size: 13.5px; letter-spacing: .26em;
  color: rgba(250, 242, 224, .95);
  /* 殿内的旁白正好压在红拜垫上，浅字直接糊掉：描一圈深色再叠暖光 */
  -webkit-text-stroke: 2.2px rgba(18, 10, 4, .5);
  paint-order: stroke fill;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, .95),
    0 0 14px rgba(0, 0, 0, .8),
    0 0 26px rgba(255, 214, 150, .35);
  opacity: 0;
  transition: opacity .9s ease;
  pointer-events: none;
  z-index: 5;
  white-space: nowrap;
}
.caption.on { opacity: 1; }

.floattxt {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--serif); font-size: 15px; letter-spacing: .22em;
  color: #fbeec6;
  text-shadow: 0 0 18px rgba(255, 214, 150, .85), 0 2px 8px #000;
  pointer-events: none;
  z-index: 8;
  animation: floatUp 1.7s ease-out forwards;
}
@keyframes floatUp {
  from { opacity: 1; }
  to { opacity: 0; transform: translate(-50%, -190%); }
}

/* ================= 入山门 ================= */
.veil {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 1s ease, visibility 1s;
}
.veil.hide { opacity: 0; visibility: hidden; }
.veil-art {
  position: absolute; inset: 0;
  background: url("../art/gate.jpg") center 30% / cover no-repeat;
  transform: scale(1.04);
  filter: saturate(1.04) brightness(.84);
}
.veil-art::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(70% 60% at 50% 46%, rgba(8, 14, 26, .5), rgba(6, 10, 20, .84) 100%),
    linear-gradient(180deg, rgba(6, 10, 20, .5), transparent 30%, rgba(6, 10, 20, .62));
}
/* 入场：两个正面立绘并排，点哪个就是哪个 */
.veil-in {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  gap: 10px;
  padding: 24px clamp(18px, 3vw, 40px) 26px;
  text-align: center;
  background: radial-gradient(ellipse 82% 78% at 50% 50%, rgba(6, 10, 20, .8), rgba(6, 10, 20, .3) 70%, transparent);
  border-radius: 8px;
  max-width: min(94vw, 760px);
}
.v-figures {
  display: flex; align-items: flex-end; justify-content: center;
  gap: clamp(14px, 3vw, 40px);
  margin: 2px 0 4px;
}
.v-fig {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 12px 9px;
  background: linear-gradient(180deg, rgba(10, 18, 32, .42), rgba(8, 12, 24, .58));
  border: 1px solid rgba(217, 185, 106, .26);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color .28s, background .28s, box-shadow .28s, transform .28s;
  -webkit-tap-highlight-color: transparent;
}
.v-fig .fig {
  display: block;
  width: auto;
  aspect-ratio: 100 / 170;
  height: clamp(168px, 27vh, 250px);
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .5));
  transition: transform .3s cubic-bezier(.2, .9, .3, 1), filter .3s;
}
.v-fig .fig svg { height: 100%; width: auto; display: block; }
.v-fig b {
  font-family: var(--serif); font-size: 14px; font-weight: 400;
  letter-spacing: .2em; color: rgba(240, 228, 202, .78);
  transition: color .28s;
}
.v-fig i {
  font-style: normal; font-size: 9.5px; letter-spacing: .1em;
  color: rgba(210, 200, 180, .46);
  white-space: nowrap;
}
.v-fig:hover {
  border-color: rgba(240, 214, 158, .6);
  background: linear-gradient(180deg, rgba(24, 32, 50, .5), rgba(12, 16, 28, .62));
}
.v-fig.on {
  border-color: rgba(246, 218, 160, .95);
  background: linear-gradient(180deg, rgba(60, 46, 20, .48), rgba(20, 16, 10, .6));
  box-shadow: 0 0 26px rgba(255, 214, 150, .34), inset 0 0 18px rgba(255, 214, 150, .12);
}
.v-fig.on b { color: #ffeab4; }
.v-fig.on i { color: rgba(255, 226, 170, .68); }
.v-fig.on .fig { transform: translateY(-4px) scale(1.04); }
.v-fig.on .fig { filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .55)) drop-shadow(0 0 16px rgba(255, 210, 140, .3)); }

.v-sub {
  font-family: var(--serif); font-size: 11.5px; letter-spacing: .42em;
  color: rgba(226, 214, 190, .62);
}
.v-line {
  font-size: 12.5px; line-height: 2; letter-spacing: .1em;
  color: rgba(240, 230, 210, .72);
}
#dharmaName {
  width: 232px;
  padding: 9px 12px;
  font-family: var(--serif); font-size: 13px; letter-spacing: .14em;
  text-align: center;
  color: #f6ecd6;
  background: rgba(8, 14, 26, .62);
  border: 1px solid rgba(217, 185, 106, .3);
  outline: none;
}
#dharmaName::placeholder { color: rgba(226, 214, 190, .34); }
#dharmaName:focus { border-color: rgba(246, 218, 160, .8); }
.v-enter {
  margin-top: 6px;
  font-family: var(--serif); font-size: 14px; letter-spacing: .4em;
  padding: 11px 34px;
  color: #1a1206;
  background: linear-gradient(180deg, #f2d79a, #cfa954);
  border: 0; cursor: pointer;
  box-shadow: 0 6px 26px rgba(210, 170, 100, .4);
  transition: transform .2s, box-shadow .2s;
}
.v-enter:hover { transform: translateY(-1px); box-shadow: 0 10px 34px rgba(230, 190, 120, .55); }
.v-note { font-size: 10.5px; letter-spacing: .2em; color: rgba(210, 200, 180, .42); }

/* ================= 弹窗 ================= */
.modal {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 8, 16, .62);
  backdrop-filter: blur(5px);
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease, visibility .3s;
}
.modal.show { opacity: 1; visibility: visible; }
.card {
  width: min(90vw, 380px);
  background: linear-gradient(180deg, rgba(18, 30, 52, .97), rgba(12, 20, 38, .98));
  border: 1px solid rgba(217, 185, 106, .42);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .7), inset 0 0 40px rgba(80, 120, 190, .12);
  transform: translateY(10px) scale(.98);
  transition: transform .32s cubic-bezier(.3, .9, .3, 1);
}
.modal.show .card { transform: none; }
.card.wide { width: min(92vw, 520px); }
.c-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(217, 185, 106, .18);
  font-family: var(--serif); font-size: 14px; letter-spacing: .26em;
  color: #f4dfa8;
}
.c-x {
  border: 0; background: none; cursor: pointer;
  font-size: 18px; line-height: 1;
  color: rgba(226, 214, 190, .5);
  padding: 0 2px;
}
.c-x:hover { color: #f6e6bc; }
.c-body { padding: 16px; max-height: 64vh; overflow-y: auto; }
.c-body p { font-size: 12.5px; line-height: 1.95; color: rgba(238, 230, 212, .8); }
.c-body.center { text-align: center; }
.hint { font-size: 11.5px !important; color: rgba(220, 212, 194, .58) !important; line-height: 1.9 !important; }
.c-foot {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 16px;
  border-top: 1px solid rgba(217, 185, 106, .16);
}
.btn {
  font-family: var(--serif); font-size: 12.5px; letter-spacing: .16em;
  padding: 8px 16px;
  color: rgba(238, 228, 206, .82);
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(217, 185, 106, .26);
  cursor: pointer;
  transition: all .25s;
}
.btn:hover { color: #fff4d6; border-color: rgba(246, 218, 160, .8); }
.btn.gold {
  color: #1c1408;
  background: linear-gradient(180deg, #f0d494, #cda650);
  border-color: #e8cc8c;
}
.btn.gold:hover { color: #1c1408; background: linear-gradient(180deg, #ffe4ae, #dcb662); }

textarea, .c-body input {
  width: 100%;
  padding: 9px 11px;
  font-family: var(--serif); font-size: 13px; letter-spacing: .1em;
  color: #f6ecd6;
  background: rgba(6, 12, 24, .6);
  border: 1px solid rgba(217, 185, 106, .26);
  outline: none;
  resize: none;
}
textarea { height: 76px; line-height: 1.8; }
textarea:focus, .c-body input:focus { border-color: rgba(246, 218, 160, .8); }
.counter { text-align: right; font-size: 10.5px; color: rgba(220, 212, 194, .44); margin-top: 4px; }

.offer { display: flex; gap: 8px; justify-content: center; margin-top: 10px; font-size: 22px; }
.lantern-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.lantern-row i {
  font-style: normal; font-size: 11px; letter-spacing: .06em;
  padding: 3px 8px;
  color: rgba(255, 238, 200, .86);
  background: rgba(255, 206, 130, .12);
  border: 1px solid rgba(255, 214, 150, .26);
}
.wall { display: flex; flex-wrap: wrap; gap: 7px; }
.slip {
  font-family: var(--serif); font-size: 12px; line-height: 1.6; letter-spacing: .06em;
  color: #f8ecc8;
  padding: 7px 10px;
  background: linear-gradient(180deg, rgba(96, 72, 40, .5), rgba(56, 40, 22, .6));
  border: 1px solid rgba(217, 185, 106, .3);
}
.slip b { display: block; font-size: 10px; font-weight: 400; color: rgba(220, 206, 180, .5); margin-top: 3px; }
.shop-icon {
  font-family: var(--serif); font-size: 40px; color: rgba(217, 185, 106, .5);
  margin-bottom: 6px;
}
.big { font-family: var(--serif); font-size: 15px; letter-spacing: .14em; color: #f4dfa8; margin: 6px 0 10px; }

/* 求签 */
.lot-stage { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 10px; }
.lot-tube { position: relative; width: 60px; height: 90px; }
.lot-sticks { position: absolute; left: 50%; bottom: 66px; transform: translateX(-50%); }
.lot-sticks i {
  position: absolute; bottom: 0; left: 0;
  width: 3px; height: var(--h);
  background: linear-gradient(180deg, #f0d79c, #b8894a);
  transform: rotate(var(--r));
  transform-origin: bottom center;
}
.lot-tube.shake { animation: shakeTube .12s linear infinite; }
@keyframes shakeTube {
  0%, 100% { transform: translateX(-2px) rotate(-2deg); }
  50% { transform: translateX(2px) rotate(2deg); }
}
.lot-fly {
  position: absolute; left: 50%; bottom: 70px;
  transform: translateX(-50%);
  font-family: var(--serif); font-size: 12px; color: #f0d79c;
  opacity: 0;
}
.lot-fly.out { animation: flyOut .9s ease forwards; }
@keyframes flyOut {
  0% { opacity: 0; transform: translate(-50%, 0) rotate(0); }
  35% { opacity: 1; transform: translate(-50%, -46px) rotate(12deg); }
  100% { opacity: 0; transform: translate(-30%, 10px) rotate(28deg); }
}
.lot-card {
  width: 100%;
  opacity: 0; transition: opacity .5s ease;
  text-align: center;
}
.lot-card.in { opacity: 1; }
.lot-no { font-family: var(--serif); font-size: 12.5px; letter-spacing: .18em; color: rgba(240, 228, 202, .8); }
.lot-no b.good { color: #ffcf80; }
.lot-no b.mid { color: #cfd8ea; }
.lot-no b.bad { color: #e8a89a; }
.lot-poem { margin: 8px 0; }
.lot-poem span {
  display: block; font-family: var(--serif); font-size: 14px; line-height: 1.9;
  letter-spacing: .16em; color: #f8ecc8;
}
.lot-note {
  font-size: 11.5px; line-height: 1.95; color: rgba(220, 212, 194, .62);
  border-top: 1px solid rgba(217, 185, 106, .16);
  padding-top: 8px;
}

/* ================= 光影 · 粒子 · 香煙 =================
 * 三层，都很轻，只为了让一张静图"喘一口气"，不抢画：
 *   1. .lighting   天光斜柱 + 地面亮斑 + 漂浮微尘（殿内暖，院外冷）
 *   2. .motes      门口上浮的光尘：告诉人"这里能进"
 *   3. .smoke-layer 上香时的青煙，点一次生一次，飘完自己收掉
 * 全部 pointer-events:none，绝不挡点击。
 */

/* ---------- 1. 光线层 ---------- */
.lighting {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 1.1s ease;
  overflow: hidden;
}
.stage[data-light] .lighting { opacity: 1; }

/* 斜插进来的一道天光，慢慢呼吸 */
.lighting::before {
  content: "";
  position: absolute;
  left: -20%; top: -28%;
  width: 64%; height: 120%;
  background: linear-gradient(102deg,
    rgba(255, 246, 218, 0) 0%,
    rgba(255, 242, 208, .17) 24%,
    rgba(255, 238, 196, .10) 52%,
    rgba(255, 244, 214, 0) 78%);
  filter: blur(18px);
  transform: rotate(4deg);
  mix-blend-mode: screen;
  animation: beamBreath 11s ease-in-out infinite;
}
/* 落在地上的一摊亮：冷热由场景给 */
.lighting::after {
  content: "";
  position: absolute;
  left: 24%; bottom: -10%;
  width: 56%; height: 44%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, var(--light-pool, rgba(255, 232, 180, .22)), transparent 68%);
  filter: blur(20px);
  mix-blend-mode: screen;
  animation: poolBreath 8.5s ease-in-out infinite;
}

.stage[data-light="hall"] { --light-pool: rgba(255, 224, 156, .26); }
.stage[data-light="yard"] { --light-pool: rgba(212, 234, 255, .20); }
.stage[data-light="gate"] { --light-pool: rgba(226, 240, 255, .24); }

@keyframes beamBreath {
  0%, 100% { opacity: .55; transform: rotate(4deg) scale(1); }
  50%      { opacity: 1;   transform: rotate(4.6deg) scale(1.04); }
}
@keyframes poolBreath {
  0%, 100% { opacity: .7; }
  50%      { opacity: 1; }
}

/* 空气里的微尘：极慢地往上飘一点，飘到头重来 */
.lighting .dust { position: absolute; inset: 0; }
.lighting .dust i {
  position: absolute;
  left: var(--x, 50%); top: var(--y, 50%);
  width: var(--s, 2px); height: var(--s, 2px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 251, 228, .95), rgba(255, 232, 180, .38) 60%, transparent 74%);
  opacity: 0;
  animation: dustDrift var(--t, 20s) linear var(--d, 0s) infinite;
  will-change: transform, opacity;
}
@keyframes dustDrift {
  0%   { opacity: 0; transform: translate(0, 0); }
  16%  { opacity: .5; }
  78%  { opacity: .3; }
  100% { opacity: 0; transform: translate(var(--dx, 10px), -48px); }
}

/* ---------- 2. 门口光尘：一圈往上飘的小亮点 ---------- */
.motes {
  position: absolute; inset: -6% -8%;
  pointer-events: none;
  overflow: visible;
}
.motes i {
  position: absolute;
  left: var(--x, 50%); bottom: var(--y, 0%);
  width: var(--s, 4px); height: var(--s, 4px);
  border-radius: 50%;
  /* 底图是亮的水彩，纯白点看不见：给一颗琥珀色的心，外面一圈暖光，
     再压一道深色描边，亮处暗处都浮得出来 */
  background: radial-gradient(circle, #fffbe8 0 26%, #ffd47a 48%, #e08a1e 72%, rgba(224, 138, 30, 0) 82%);
  box-shadow:
    0 0 10px rgba(255, 198, 96, .95),
    0 0 20px rgba(255, 172, 60, .55),
    0 0 1px rgba(78, 44, 4, .8);
  opacity: 0;
  animation: moteRise var(--t, 6s) ease-in-out var(--d, 0s) infinite;
  will-change: transform, opacity;
}
@keyframes moteRise {
  0%   { opacity: 0; transform: translate(0, 0) scale(.45); }
  20%  { opacity: 1; }
  64%  { opacity: .7; }
  100% { opacity: 0; transform: translate(var(--dx, 6px), calc(-1 * var(--rise, 74px))) scale(1.15); }
}

/* 门前的「推門而入」平时也亮着，轻轻一跳一跳，
   不用悬停也知道那儿能点。指上去就更亮、跳得快些。 */
.spot.main .push, .spot.gatein .push {
  opacity: .8;
  animation: pushBreath 3.6s ease-in-out infinite;
}
.spot.main:hover .push, .spot.gatein:hover .push {
  opacity: 1;
  animation-duration: 1.5s;
}
.spot.main.opening .push { opacity: 0; animation: none; }
@keyframes pushBreath {
  0%, 100% { opacity: .66; transform: translate(-50%, -50%) scale(.985); }
  50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.025); }
}
/* 门里那团光也跟着一起呼吸（指上去、推门时交给原来的高亮规则） */
.spot.main:not(:hover):not(.opening) .portal { animation: portalBreath 5.2s ease-in-out infinite; }
@keyframes portalBreath {
  0%, 100% { opacity: .12; }
  50%      { opacity: .26; }
}

/* ---------- 3. 上香的青煙 ---------- */
.smoke-layer {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 4;
  overflow: hidden;
}
.smoke-layer i {
  position: absolute;
  left: var(--x, 50%); top: var(--y, 70%);
  width: var(--w, 30px); height: var(--w, 30px);
  margin-left: calc(var(--w, 30px) / -2);
  margin-top: calc(var(--w, 30px) / -2);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 56%,
    rgba(126, 146, 174, .58) 0%,
    rgba(158, 176, 200, .28) 46%,
    rgba(186, 200, 220, 0) 76%);
  filter: blur(5px);
  opacity: 0;
  will-change: transform, opacity;
  animation: smokeRise var(--t, 3.4s) cubic-bezier(.24, .5, .32, 1) var(--d, 0s) forwards;
}
@keyframes smokeRise {
  0%   { opacity: 0; transform: translate(0, 0) scale(.22) rotate(0deg); }
  13%  { opacity: var(--o, .5); }
  52%  { opacity: .3; transform: translate(calc(var(--dx, 12px) * .45), -88px) scale(calc(var(--sc, 2) * .82)) rotate(9deg); }
  100% { opacity: 0; transform: translate(var(--dx, 12px), -236px) scale(calc(var(--sc, 2) * 1.7)) rotate(-13deg); }
}

/* ================= 截图模式：去掉一切过渡 ================= */
html.nofade * { transition: none !important; animation: none !important; }

/* ================= 竖屏：按高度铺满，左右裁切 ================
 * 底图是 3:2。竖屏上如果按宽度放，画面只剩中间一条。
 * 所以让图层按「高 = 100vh」铺开，宽出屏幕的部分裁掉：
 * 图层本身仍是 3:2，热点百分比照样钉在画上，只是两侧看不见。
 * 侧殿交给底部导航，正殿、香炉、拜垫都还在中间。
 */
@media (max-aspect-ratio: 4/3) {
  .stage > .scene-layer,
  .stage > .lighting,
  .stage > .smoke-layer,
  .stage > .spots,
  .stage > .actors,
  .stage > .vignette,
  .stage > .grain {
    width: calc(100vh * 1.5);
    height: 100vh;
  }

  /* 竖屏两侧被裁，侧殿光圈收到名牌正下方，两块别互相压 */
  .spot.side .ring { left: 50%; width: 102%; height: 22%; }
  .spot.side .board.v { top: 8%; }
  .spot.side .ring i { border-width: 1.6px; }

  /* 「出殿」在竖屏会跟人物、圆钮挤成一团；底部导航里已有出殿去处 */
  .spot.out { display: none; }

  /* 竖屏顶部是 HUD，彩带从 11% 起挂，别压在宫名与殿名上 */
  .ribbons { top: 11%; }
}

/* ================= 窄屏 ================= */
@media (max-width: 720px) {
  .people { display: none; }
  /* 入场页：两个立绘并排，手机上收窄一点 */
  .veil-in { gap: 8px; padding: 16px 14px; max-width: 94vw; }
  .v-figures { gap: 10px; }
  .v-fig { padding: 8px 8px 7px; }
  .v-fig .fig { height: clamp(132px, 21vh, 186px); }
  .v-fig b { font-size: 12.5px; letter-spacing: .14em; }
  .v-fig i { font-size: 8.5px; letter-spacing: .06em; }
  .v-sub { font-size: 10px; letter-spacing: .32em; }
  .v-line { font-size: 11.5px; line-height: 1.85; }
  #dharmaName { width: 200px; font-size: 12px; }
  .v-enter { font-size: 13px; padding: 10px 26px; letter-spacing: .32em; }
  .v-plaque { font-size: 20px; padding: 7px 7px; left: 3vw; top: 3.5vh; }
  .plaque.name b { font-size: 13px; }
  .scene-name { font-size: 11px; letter-spacing: .14em; }
  .actor .ch { height: calc(13vh * var(--k, 1)); }
  /* 左列场景：手机更窄，字号与内边距一起收 */
  .navbar { left: 5px; padding: 4px 3px; gap: 0; }
  .navbar button { font-size: 10.5px; padding: 6px 3px; letter-spacing: .1em; }
  .nav-sep { margin: 3px 5px; }
  /* 正中动作条：四个按钮挤在一排，仍居中 */
  .rail { bottom: 14px; gap: 6px; }
  .rail button { min-width: 0; font-size: 12.5px; padding: 8px 9px; letter-spacing: .08em; }
  .plaque.h .txt b { font-size: 12px; }
  .board.v b { font-size: 11px; }
  .hud { padding: 10px 10px 0; }
  .hud-r { gap: 8px; }
  .stat i { font-size: 8px; letter-spacing: .1em; }
  .stat b { font-size: 13px; }
  .badge { display: none; }
  /* 动作条在正中，右下角空出来，圆钮回到角落 */
  .sound { right: 8px; bottom: 16px; }
  .sound.wishwall { bottom: 56px; }
  .hoverhint { bottom: 54px; font-size: 12px; }
  /* 窄屏上拜垫就在 86% 那儿，旁白得抬起来，否则被垫子压住看不见 */
  .toast { bottom: 158px; font-size: 12px; }
  .caption { bottom: 118px; font-size: 12px; letter-spacing: .16em; }
  .spot.pad { width: 84px; height: 34px; }
  .spot.bowpad { width: 108px; height: 46px; }
}
