/* ============ 守護神.台灣 — 廟宇夜色 × 金光 ============ */
:root {
  --bg: #120c07;
  --wood: #2a1a10;
  --wood-dark: #1a120b;
  --gold: #d4a94e;
  --gold-bright: #f0c96c;
  --red: #9c3434;
  --red-deep: #6e1f1f;
  --cream: #f3e7d3;
  --dim: #b7a893;
  --shadow: rgba(0, 0, 0, .55);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 17px; }   /* font1 base */
body {
  background: var(--bg);
  color: var(--cream);
  font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
}
h1, h2, h3, .serif { font-family: 'Noto Serif TC', serif; }
a { color: var(--gold-bright); text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

.btn {
  display: inline-block; border: none; border-radius: 999px;
  padding: .8rem 2.1rem; font-size: 1rem; font-weight: 700; letter-spacing: .12em;
  background: linear-gradient(160deg, var(--gold-bright), var(--gold) 55%, #a87f2f);
  color: #241505; box-shadow: 0 4px 18px rgba(212, 169, 78, .35);
  transition: transform .15s, box-shadow .15s;
}
.btn:active { transform: scale(.96); }
.btn-ghost {
  background: transparent; color: var(--gold);
  border: 1px solid rgba(212, 169, 78, .55); box-shadow: none;
}
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ============ 3D 神殿 ============ */
.stage {
  position: fixed; inset: 0;
  perspective: 1050px; perspective-origin: 50% 46%;
  overflow: hidden; touch-action: pan-y;
}
.room {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transform: translateZ(var(--tz, 0px)) rotateY(var(--ry, 0deg));
  will-change: transform;
}
/* 轉場改由 JS rAF 補間（shrine-room.js）——iOS WebKit 對 var() 驅動 transform 的
   CSS transition 常直接跳終值，勿再加回 transition */
.wall {
  position: absolute; left: 50%; top: 50%;
  width: var(--W); height: var(--H);
  margin-left: calc(var(--W) / -2); margin-top: calc(var(--H) / -2);
  background:
    linear-gradient(rgba(14, 8, 4, .72), rgba(14, 8, 4, .78)),
    url('/assets/textures/wall.jpg');
  background-size: cover;
  backface-visibility: hidden;
  display: flex; align-items: center; justify-content: center;
}
.wall::after { /* 邊角暗角 */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 18vmin 4vmin rgba(0, 0, 0, .75);
}
.wall-n { transform: rotateY(0deg)   translateZ(calc(var(--R) * -1)); }
.wall-e { transform: rotateY(-90deg) translateZ(calc(var(--R) * -1)); }
.wall-s { transform: rotateY(180deg) translateZ(calc(var(--R) * -1)); }
.wall-w { transform: rotateY(90deg)  translateZ(calc(var(--R) * -1)); }
.floor {
  position: absolute; left: 50%; top: 50%;
  width: calc(var(--R) * 2.02); height: calc(var(--R) * 2.02);
  margin-left: calc(var(--R) * -1.01); margin-top: calc(var(--R) * -1.01);
  transform: rotateX(90deg) translateZ(calc(var(--H) / -2));
  background:
    radial-gradient(circle, rgba(30, 18, 8, .35), rgba(8, 4, 2, .92) 75%),
    url('/assets/textures/floor.jpg');
  background-size: 34% auto;
}
.ceilglow {
  position: absolute; left: 50%; top: 50%;
  width: calc(var(--R) * 2.02); height: calc(var(--R) * 2.02);
  margin-left: calc(var(--R) * -1.01); margin-top: calc(var(--R) * -1.01);
  transform: rotateX(-90deg) translateZ(calc(var(--H) / -2));
  background: radial-gradient(circle, rgba(240, 201, 108, .16), rgba(10, 5, 2, .95) 70%);
}

/* 主牆：神龕 */
.altar { text-align: center; transform: translateZ(1px); padding: 1rem; max-width: 96%; width: 100%; }
/* 三欄格線：兩側 1fr、主神 auto → 主神永遠正中央，側欄內容不推擠 */
.altar-row {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: end; gap: min(2.6vw, 20px); width: 100%;
}
.altar-side { display: flex; align-items: flex-end; gap: min(2.6vw, 16px); }
.altar-side.left  { justify-self: end; }
.altar-side.right { justify-self: start; }
.flank { flex: 0 0 auto; }
.flank-frame {
  padding: 6px; border: 2px solid var(--gold); border-radius: 6px 6px 0 0;
  background: linear-gradient(rgba(42, 24, 10, .6), rgba(42, 24, 10, .6)), url('/assets/textures/frame.jpg');
  background-size: cover;
  box-shadow: 0 6px 22px var(--shadow), 0 0 26px rgba(240, 201, 108, .14);
}
.flank-frame img {
  display: block; width: min(21vw, 128px); aspect-ratio: 3 / 4;
  object-fit: cover; border-radius: 3px 3px 0 0;
}
.flank-name {
  margin-top: .4rem; font-family: 'Noto Serif TC', serif; font-weight: 700;
  font-size: .78rem; letter-spacing: .18em; color: var(--gold);
}
/* 候駕中：神位未解鎖 */
.flank.pending .flank-frame { position: relative; }
.flank.pending .flank-frame img { filter: grayscale(1) brightness(.42); }
.flank.pending .flank-frame::after {
  content: '🔒'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; text-shadow: 0 2px 8px #000;
}
.flank.pending .flank-name { color: var(--dim); }
/* 有同祀時主神略縮，同排不擠 */
.altar-row .deity-frame img { width: min(46vw, 300px); }
.altar-row:has(.flank) .deity-frame img { width: min(38vw, 250px); }

/* 祈願牌：直式木牌掛在側欄（不佔主神置中） */
.wish-plaque {
  align-self: center; flex: 0 0 auto;
  writing-mode: vertical-rl; text-orientation: upright;
  max-height: min(46vw, 300px); overflow: hidden;
  padding: 1rem .5rem; border: 2px solid var(--gold); border-radius: 8px;
  background: linear-gradient(160deg, var(--red), var(--red-deep));
  font-family: 'Noto Serif TC', serif; font-weight: 900;
  font-size: .95rem; letter-spacing: .3em; color: var(--gold-bright);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .55);
  box-shadow: 0 6px 22px var(--shadow), 0 0 20px rgba(240, 201, 108, .12);
}
@media (max-width: 400px) { .wish-plaque { font-size: .82rem; padding: .8rem .4rem; } }
.deity-frame {
  position: relative; display: inline-block;
  padding: 12px; border-radius: 8px 8px 0 0;
  background:
    linear-gradient(rgba(42, 24, 10, .55), rgba(42, 24, 10, .55)),
    url('/assets/textures/frame.jpg');
  background-size: cover;
  border: 3px solid var(--gold);
  box-shadow:
    0 0 0 1px #5c431c, 0 10px 40px var(--shadow),
    0 0 55px rgba(240, 201, 108, .22);
}
.deity-frame img {
  display: block; width: min(46vw, 300px); aspect-ratio: 3 / 4;
  object-fit: cover; border-radius: 4px 4px 0 0;
}
.deity-halo {
  position: absolute; inset: -18%; z-index: -1; pointer-events: none;
  background: radial-gradient(circle, rgba(240, 201, 108, .30), transparent 62%);
  animation: halo 5s ease-in-out infinite;
}
@keyframes halo { 50% { opacity: .55; transform: scale(1.06); } }
.altar-plaque {
  display: inline-block; margin-top: .9rem; padding: .35rem 1.4rem;
  background: linear-gradient(160deg, var(--red), var(--red-deep));
  border: 1.5px solid var(--gold); border-radius: 6px;
  font-family: 'Noto Serif TC', serif; font-size: 1.25rem; font-weight: 900;
  letter-spacing: .3em; color: var(--gold-bright);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}
.altar-sub { margin-top: .45rem; color: var(--dim); font-size: .82rem; letter-spacing: .18em; }

/* 香爐與燭 */
.altar-table { display: flex; align-items: flex-end; justify-content: center; gap: 2.4rem; margin-top: 1.1rem; }
.censer { position: relative; width: 74px; height: 52px; }
.censer .bowl {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 74px; height: 40px; border-radius: 0 0 40px 40px;
  background: linear-gradient(180deg, #7a5a24, #3d2c10 70%);
  border: 2px solid var(--gold); border-top-width: 3px;
}
.censer .stick {
  position: absolute; bottom: 30px; width: 2.5px; height: 44px;
  background: linear-gradient(180deg, #c99f56, #8c5a2b);
  left: calc(50% + var(--x)); transform: rotate(var(--r));
}
.censer .stick::before {
  content: ''; position: absolute; top: -4px; left: -1.5px;
  width: 5.5px; height: 5.5px; border-radius: 50%;
  background: #ff8b45; box-shadow: 0 0 7px 2px rgba(255, 120, 40, .8);
  animation: ember 2.2s ease-in-out infinite;
}
@keyframes ember { 50% { opacity: .55; } }
.censer .smoke { position: absolute; bottom: 74px; left: 50%; opacity: 0; }
.censer.lit .smoke { opacity: 1; }
.candle { position: relative; width: 17px; height: 58px; border-radius: 4px;
  background: linear-gradient(180deg, #b03535, #6e1f1f); }
.candle::before { content: ''; position: absolute; top: -6px; left: 50%; width: 2px; height: 7px; background: #333; transform: translateX(-50%); }
.candle::after {
  content: ''; position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  width: 11px; height: 17px; border-radius: 50% 50% 42% 42%;
  background: radial-gradient(ellipse at 50% 78%, #fff8e0, #ffd257 45%, #ff9430 78%, transparent);
  filter: drop-shadow(0 0 9px rgba(255, 190, 80, .85));
  animation: flame .28s ease-in-out infinite alternate;
}
@keyframes flame { from { transform: translateX(-50%) scale(1) rotate(-2deg); } to { transform: translateX(-52%) scale(1.1) rotate(2.5deg); } }

/* 側牆內容 */
.wall-panel { max-width: 78%; text-align: center; transform: translateZ(1px); }
.wall-panel h2 {
  font-size: 1.5rem; letter-spacing: .35em; color: var(--gold-bright);
  margin-bottom: 1.1rem; font-weight: 900;
}
.wish-board {
  padding: 1.6rem 1.9rem; border: 2px solid var(--gold); border-radius: 10px;
  background:
    linear-gradient(rgba(30, 16, 8, .82), rgba(30, 16, 8, .82)),
    url('/assets/textures/damask.jpg');
  background-size: 300px;
  font-family: 'Noto Serif TC', serif; font-size: 1.35rem; letter-spacing: .12em;
  box-shadow: 0 8px 30px var(--shadow);
}
.streak-big { font-size: 3.6rem; font-weight: 900; color: var(--gold-bright); font-family: 'Noto Serif TC', serif; line-height: 1.15; }
.streak-label { color: var(--dim); letter-spacing: .25em; font-size: .85rem; }
.dots { display: flex; gap: 7px; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }
.dots i {
  width: 13px; height: 13px; border-radius: 50%;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(212, 169, 78, .3);
}
.dots i.on { background: var(--gold); box-shadow: 0 0 8px rgba(240, 201, 108, .8); }
.blessing-list { margin-top: 1.1rem; font-size: .92rem; color: var(--dim); }
.blessing-list li { list-style: none; margin: .3rem 0; }

/* HUD */
.hud-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 1rem calc(.7rem + 12px);
  background: linear-gradient(rgba(10, 5, 2, .88), transparent);
  pointer-events: none;
}
.hud-top > * { pointer-events: auto; }
.hud-domain { font-size: .9rem; letter-spacing: .06em; color: var(--cream); opacity: .92; }
.hud-streak {
  font-weight: 900; color: var(--gold-bright); font-size: .95rem;
  padding: .25rem .8rem; border: 1px solid rgba(212, 169, 78, .5); border-radius: 999px;
  background: rgba(20, 12, 6, .6);
}
.hud-bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; flex-direction: column; align-items: center; gap: .55rem;
  padding: 0 1rem calc(1.1rem + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(10, 5, 2, .9) 65%);
  padding-top: 2.2rem;
}
.hud-hint { font-size: .78rem; color: var(--dim); letter-spacing: .1em; }
.wall-nav { position: fixed; z-index: 30; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(212,169,78,.45);
  background: rgba(20, 12, 6, .55); color: var(--gold); font-size: 1.2rem; }
.wall-nav.prev { left: .6rem; } .wall-nav.next { right: .6rem; }
.wall-dots { display: flex; gap: 8px; }
.wall-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(243, 231, 211, .25); transition: .2s; }
.wall-dots i.on { background: var(--gold-bright); transform: scale(1.25); }

/* ============ 上香 overlay ============ */
.worship-overlay {
  position: fixed; inset: 0; z-index: 60; display: none;
  background: #000; flex-direction: column; align-items: center; justify-content: center;
}
.worship-overlay.open { display: flex; }
.worship-overlay video, .worship-overlay canvas.fx {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transform: scaleX(-1);
}
.worship-overlay canvas.fx { pointer-events: none; }
.worship-vignette { position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 32vmin 8vmin rgba(0, 0, 0, .85); }
.worship-status {
  position: absolute; top: calc(1.4rem + env(safe-area-inset-top)); left: 0; right: 0;
  text-align: center; font-size: 1.05rem; letter-spacing: .22em; color: var(--cream);
  text-shadow: 0 1px 8px #000; z-index: 3; padding: 0 1rem;
}
/* 上香時的守護神像：面前的神，光暈隨進度增強（--glow: 0~1） */
.worship-deity {
  position: absolute; z-index: 3; left: 50%; transform: translateX(-50%);
  top: calc(3.6rem + env(safe-area-inset-top));
  width: min(40vw, 210px); pointer-events: none; --glow: 0;
}
.worship-deity img {
  display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  border: 3px solid var(--gold); border-radius: 8px;
  box-shadow:
    0 8px 34px rgba(0, 0, 0, .65),
    0 0 calc(18px + var(--glow) * 60px) calc(2px + var(--glow) * 14px) rgba(240, 201, 108, calc(.25 + var(--glow) * .55));
  filter: brightness(calc(.92 + var(--glow) * .18));
  transition: box-shadow .25s, filter .25s;
  animation: deity-breathe 4.5s ease-in-out infinite;
}
@keyframes deity-breathe { 50% { transform: scale(1.015); } }
.worship-deity::after { /* 頂光 */
  content: ''; position: absolute; inset: -30% -40%; z-index: -1;
  background: radial-gradient(ellipse at 50% 30%, rgba(240, 201, 108, calc(.18 + var(--glow) * .4)), transparent 65%);
}
.worship-done .done-deity {
  width: min(34vw, 170px); aspect-ratio: 3 / 4; object-fit: cover;
  border: 3px solid var(--gold); border-radius: 8px;
  box-shadow: 0 0 55px 10px rgba(240, 201, 108, .55);
}
@media (max-height: 640px) { .worship-deity { width: min(32vw, 150px); } }

.ring-wrap { position: absolute; bottom: 12vh; left: 50%; transform: translateX(-50%); z-index: 3; }
.ring-wrap svg { width: 118px; height: 118px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, .18); stroke-width: 7; }
.ring-fg { fill: none; stroke: var(--gold-bright); stroke-width: 7; stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(240, 201, 108, .9)); }
.ring-emoji { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.3rem; }
.worship-cancel { position: absolute; top: calc(1rem + env(safe-area-inset-top)); right: 1rem; z-index: 4;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.4);
  background: rgba(0, 0, 0, .45); color: #fff; font-size: 1.1rem; }
.worship-fallback { position: absolute; bottom: calc(2.2vh + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 4; }

/* 信士照（請神合十禮擷取）：上香畫面左下 */
.worshipper {
  position: absolute; left: 1rem; bottom: calc(4.6rem + env(safe-area-inset-bottom));
  z-index: 3; text-align: center; pointer-events: none;
}
.worshipper img {
  display: block; width: 72px; aspect-ratio: 3 / 4; object-fit: cover;
  border: 2px solid var(--gold); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .6), 0 0 18px rgba(240, 201, 108, .2);
}
.worshipper span {
  display: block; margin-top: .3rem; font-size: .62rem; letter-spacing: .1em;
  color: var(--gold); text-shadow: 0 1px 4px #000;
}

/* 完成畫面 */
.worship-done {
  position: absolute; inset: 0; z-index: 5; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: .8rem;
  background: radial-gradient(circle at 50% 42%, rgba(90, 60, 15, .55), rgba(0, 0, 0, .93) 70%);
  text-align: center; padding: 1.5rem;
}
.worship-done.show { display: flex; }
.worship-done .big { font-size: 2rem; font-family: 'Noto Serif TC', serif; font-weight: 900; color: var(--gold-bright); letter-spacing: .3em; }
.worship-done .streak-line { font-size: 1.1rem; color: var(--cream); }

/* ============ 主站 landing ============ */
.landing { min-height: 100svh; background:
  radial-gradient(60% 42% at 50% 0%, rgba(156, 52, 52, .28), transparent),
  radial-gradient(52% 40% at 50% 100%, rgba(212, 169, 78, .13), transparent), var(--bg); }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 1.2rem; }
.hero { text-align: center; padding: 4.2rem 0 2.6rem; }
.hero .logo { font-size: 2.35rem; font-weight: 900; letter-spacing: .22em; color: var(--gold-bright);
  font-family: 'Noto Serif TC', serif; text-shadow: 0 0 30px rgba(240, 201, 108, .35); }
.hero .tagline { margin-top: .9rem; font-size: 1.12rem; color: var(--cream); letter-spacing: .12em; }
.hero .sub { margin-top: .5rem; color: var(--dim); font-size: .92rem; }
.steps3 { display: flex; gap: .8rem; margin: 2rem 0; }
.steps3 > div { flex: 1; text-align: center; padding: 1.1rem .6rem; border: 1px solid rgba(212, 169, 78, .25);
  border-radius: 12px; background: rgba(38, 24, 12, .45); }
.steps3 b { display: block; color: var(--gold); margin-bottom: .3rem; font-size: 1rem; }
.steps3 span { font-size: .8rem; color: var(--dim); }

/* wizard */
.wizard { padding-bottom: 4rem; }
.wz-step { display: none; }
.wz-step.on { display: block; animation: fadein .35s; }
@keyframes fadein { from { opacity: 0; transform: translateY(10px); } }
.wz-title { font-size: 1.3rem; font-weight: 900; color: var(--gold-bright); letter-spacing: .2em;
  margin: 1.6rem 0 1.1rem; font-family: 'Noto Serif TC', serif; text-align: center; }
.deity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .9rem; }
.deity-card { position: relative; border: 2px solid rgba(212, 169, 78, .3); border-radius: 12px; overflow: hidden;
  background: var(--wood-dark); transition: .18s; }
.deity-card img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.deity-card figcaption { padding: .5rem .4rem .7rem; text-align: center; }
.deity-card b { display: block; font-size: 1rem; color: var(--cream); }
.deity-card span { font-size: .75rem; color: var(--dim); }
.deity-card.sel { border-color: var(--gold-bright); box-shadow: 0 0 22px rgba(240, 201, 108, .4); transform: translateY(-3px); }
.deity-card[data-slot]::before {
  content: attr(data-slot); position: absolute; top: 6px; left: 6px; z-index: 2;
  padding: .12rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 700;
  letter-spacing: .12em; background: linear-gradient(160deg, var(--gold-bright), var(--gold));
  color: #241505; box-shadow: 0 2px 8px rgba(0, 0, 0, .45);
}
.deity-card[data-slot="同祀"]::before { background: rgba(20, 12, 6, .85); color: var(--gold); border: 1px solid var(--gold); }
.deity-card.upload-card { display: flex; align-items: center; justify-content: center; aspect-ratio: auto; min-height: 200px;
  border-style: dashed; color: var(--dim); text-align: center; font-size: .9rem; cursor: pointer; }
.field { margin: 1rem 0; }
.field label { display: block; font-size: .85rem; color: var(--dim); margin-bottom: .4rem; letter-spacing: .1em; }
.field input, .field textarea, .field select {
  width: 100%; padding: .85rem 1rem; border-radius: 10px; font-size: 1.05rem;
  border: 1.5px solid rgba(212, 169, 78, .4); background: rgba(18, 10, 5, .7); color: var(--cream);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold-bright); }
.url-preview { text-align: center; margin: 1rem 0; padding: 1rem; border-radius: 12px;
  background: rgba(38, 24, 12, .5); border: 1px dashed rgba(212, 169, 78, .4);
  font-size: 1.25rem; font-family: 'Noto Serif TC', serif; color: var(--gold-bright); word-break: break-all; }
.check-msg { text-align: center; font-size: .88rem; min-height: 1.4em; }
.check-msg.ok { color: #8fd18f; } .check-msg.bad { color: #e08585; }
.wz-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.6rem; }
.footer { text-align: center; padding: 2.2rem 1rem 3rem; color: #6d5f4d; font-size: .78rem; line-height: 2; }

/* 成功頁 / 通用卡 */
.holy-card { max-width: 560px; margin: 8vh auto; padding: 2.2rem 1.6rem; text-align: center;
  border: 2px solid var(--gold); border-radius: 16px; background: rgba(30, 18, 9, .72);
  box-shadow: 0 12px 60px var(--shadow), 0 0 60px rgba(240, 201, 108, .12); }

/* PWA 安裝引導 */
.pwa-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; transform: translateY(105%);
  transition: transform .38s cubic-bezier(.2, .9, .3, 1);
  background: linear-gradient(180deg, #2c1c0e, #1a100a); border-radius: 20px 20px 0 0;
  border-top: 2px solid var(--gold); padding: 1.4rem 1.3rem calc(1.6rem + env(safe-area-inset-bottom));
  text-align: center; }
.pwa-sheet.show { transform: none; }
.pwa-sheet h3 { color: var(--gold-bright); letter-spacing: .2em; font-size: 1.15rem; margin-bottom: .5rem; }
.pwa-sheet p { font-size: .9rem; color: var(--cream); }
.pwa-sheet .ios-steps { text-align: left; margin: .8rem auto 0; max-width: 330px; font-size: .88rem; color: var(--dim); }

/* 分享 modal */
.share-modal { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .78); padding: 1.2rem; }
.share-modal.show { display: flex; }
.share-box { text-align: center; max-width: 340px; }
.share-box img { border-radius: 14px; border: 1px solid rgba(212, 169, 78, .5); max-height: 62vh; }
.share-actions { display: flex; gap: .7rem; justify-content: center; margin-top: 1rem; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 16vh; transform: translateX(-50%) translateY(20px);
  z-index: 90; background: rgba(20, 12, 6, .92); border: 1px solid var(--gold); color: var(--cream);
  padding: .6rem 1.3rem; border-radius: 999px; font-size: .9rem; opacity: 0; transition: .3s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%); }

@media (max-width: 640px) {
  html { font-size: 16px; }
  .stage { perspective: 900px; }
  .deity-frame img { width: min(62vw, 260px); }
  .steps3 { flex-direction: column; }
  .wall-nav { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .room.snap { transition: none; }
  .candle::after, .deity-halo { animation: none; }
}
