/* 靜月之光 · 共用動態系統 / 20261021compat48
 * 一套節奏、一種月光語言，貫穿十四個房間：門卡綻放進房、結果分段浮現、按壓光暈、回首頁門卡歸位。
 * 只動 transform / opacity；所有層 pointer-events:none，不攔任何點擊；減少動態時整套關閉。 */

:root{
  --jy-ease-out:cubic-bezier(.16,1,.3,1);      /* 進場：快起慢收 */
  --jy-ease-in:cubic-bezier(.7,0,.84,0);       /* 離場 */
  --jy-ease-spring:cubic-bezier(.34,1.56,.64,1);/* 回彈：按鈕、徽記 */
  --jy-dur-1:140ms;--jy-dur-2:260ms;--jy-dur-3:420ms;--jy-dur-4:680ms;
  --jy-moon:#f6e6c3;--jy-moon-gold:#d2ad6c;--jy-night:#08111d;
}

/* ── 1. 門卡綻放：從點下的那扇門，月光擴成全螢幕再溶入房間 ── */
.jy-veil{position:fixed;left:0;top:0;width:100vw;height:100dvh;z-index:2147482000;pointer-events:none;
  transform-origin:0 0;border-radius:22px;overflow:hidden;will-change:transform,opacity;contain:strict;
  background:
    radial-gradient(130% 78% at 50% 40%,#fbf1da 0%,#e9cf98 9%,#b8915a 20%,#4a4436 34%,#1b2638 50%,#0d1626 68%,var(--jy-night) 86%);
  box-shadow:0 0 0 1px #ffe8bd55,0 30px 80px #000c}
.jy-veil::before{content:'';position:absolute;inset:0;
  background:
    radial-gradient(2px 2px at 18% 26%,#fff9 50%,transparent 51%),radial-gradient(1.5px 1.5px at 72% 18%,#fff8 50%,transparent 51%),
    radial-gradient(1.5px 1.5px at 84% 64%,#fff7 50%,transparent 51%),radial-gradient(2px 2px at 30% 78%,#fff8 50%,transparent 51%),
    radial-gradient(1px 1px at 56% 52%,#fffa 50%,transparent 51%),radial-gradient(1.5px 1.5px at 10% 58%,#fff6 50%,transparent 51%);
  opacity:.9}
.jy-veil-moon{position:absolute;left:50%;top:40%;width:112px;height:112px;margin:-56px 0 0 -56px;border-radius:50%;
  box-shadow:inset -22px -5px 0 0 #fffaf0,0 0 60px 18px #fff3d6aa,0 0 140px 50px #e9cf9855;opacity:0;transform:scale(.6) rotate(-18deg)}
.jy-veil-title{position:absolute;left:0;right:0;top:calc(40% + 78px);text-align:center;color:#2a2116;opacity:0;
  font:600 22px/1.4 var(--f-display,"Noto Serif TC",serif);letter-spacing:.32em;text-shadow:0 1px 0 #fff8,0 0 24px #fff3d6}

/* ── 2. 結果分段浮現：只套在結果卡片，不碰表單 ── */
.jy-rv{opacity:0;transform:translateY(18px) scale(.985);filter:blur(2px)}
.jy-rv.jy-in{opacity:1;transform:none;filter:none;
  transition:opacity var(--jy-dur-4) var(--jy-ease-out),transform var(--jy-dur-4) var(--jy-ease-out),filter var(--jy-dur-3) var(--jy-ease-out);
  transition-delay:var(--jy-rv-delay,0ms)}

/* ── 3. 按壓光暈：從指尖位置擴散 ── */
.jy-press{position:relative;overflow:hidden}
.jy-ripple{position:absolute;border-radius:50%;pointer-events:none;width:12px;height:12px;margin:-6px 0 0 -6px;
  background:radial-gradient(circle,#fffbe9 0%,#ffe8bdaa 32%,#ffe8bd00 70%);mix-blend-mode:screen;
  animation:jy-ripple 620ms var(--jy-ease-out) forwards}
@keyframes jy-ripple{from{transform:scale(1);opacity:.85}to{transform:scale(var(--jy-ripple-scale,26));opacity:0}}

/* ── 4. 首頁門卡依序就位（初次載入與從房間返回） ── */
.jy-door-in{animation:jy-door-in var(--jy-dur-4) var(--jy-ease-out) both;animation-delay:var(--jy-door-delay,0ms)}
@keyframes jy-door-in{from{opacity:0;transform:translateY(22px) rotateX(10deg) scale(.97)}to{opacity:1;transform:none}}

/* 門卡被點下的瞬間：先往內收一下，像真的推開一扇門 */
.jy-atelier .at-tool.jy-door-pressed{transform:scale(.965)!important;transition:transform 120ms var(--jy-ease-out)!important}

/* ── 減少動態：整套停用，內容一律直接可見 ── */
@media (prefers-reduced-motion:reduce){
  .jy-veil{display:none!important}
  .jy-rv,.jy-rv.jy-in{opacity:1!important;transform:none!important;filter:none!important;transition:none!important}
  .jy-ripple{display:none!important}
  .jy-door-in{animation:none!important}
}

/* ── 5. 儀式翻牌特效層：金色光暈、光帶掃過、星點散開（掛在儀式 dialog 內，用完即移除） ── */
.jy-fx-halo{position:absolute;inset:-4px;border-radius:12px;box-shadow:0 0 0 1.5px #ffe8bdcc,0 0 22px 6px #f3d79a99,0 0 60px 18px #e9cf9855;opacity:0}
.jy-fx-clip{position:absolute;inset:0;border-radius:10px;overflow:hidden}
.jy-fx-sweep{position:absolute;top:-10%;bottom:-10%;left:0;width:42%;transform:skewX(-14deg);
  background:linear-gradient(100deg,transparent 0%,#fff7e155 35%,#fffdf5dd 50%,#fff7e155 65%,transparent 100%);mix-blend-mode:screen}
.jy-spark{position:absolute;left:50%;top:50%;width:9px;height:9px;margin:-4.5px 0 0 -4.5px;border-radius:50%;pointer-events:none;
  background:radial-gradient(circle,#fffdf3 0%,#f3d79a 55%,transparent 72%);box-shadow:0 0 12px 4px #fff0c8cc,0 0 26px 8px #f3d79a66}
@media (prefers-reduced-motion:reduce){.jy-fx,.jy-spark{display:none!important}}

/* ── 7. 塔羅抽牌飛行的牌背分身 ── */
.jy-card-ghost{border-radius:8px;box-shadow:0 0 0 1px #ffe8bd99,0 10px 30px #000a,0 0 28px 8px #e9cf9866;will-change:translate,rotate,scale,opacity}
@media (prefers-reduced-motion:reduce){.jy-card-ghost{display:none!important}}

/* ── 8. 墨書成形：一爻成形、六爻成卦（由初爻往上）、籤詩逐行顯現 ── */
@keyframes jy-ink-draw{from{clip-path:inset(0 100% 0 0);filter:brightness(1.9)}62%{filter:brightness(1.25)}to{clip-path:inset(0 0 0 0);filter:none}}
@keyframes jy-ink-down{from{clip-path:inset(0 0 100% 0);opacity:.25}to{clip-path:inset(0 0 0 0);opacity:1}}
@keyframes jy-moving-pulse{0%,100%{box-shadow:0 0 0 0 #e0705a00}50%{box-shadow:0 0 0 3px #e0705a66,0 0 16px 5px #f3c27a77}}
.gw-progress-row.is-new .gw-yao i{animation:jy-ink-draw .62s cubic-bezier(.2,.7,.2,1) both}
.gw-progress-row.is-new .gw-yao i+i{animation-delay:.14s}
.gw-progress-row.is-new .gw-yao.is-moving i{animation:jy-ink-draw .62s cubic-bezier(.2,.7,.2,1) both,jy-moving-pulse 1.3s .75s ease-in-out 2}
.gw-hex-card.jy-draw .gw-hex-line,.gw-room .gw-hex-card.jy-draw button.gw-hex-line{animation:jy-ink-draw .6s cubic-bezier(.2,.7,.2,1) both!important}  /* 本卦爻線是按鈕，全域樣式關掉按鈕動畫 → 需 !important */
.gw-room .gw-hex-card.jy-draw .gw-hex-line:nth-child(6){animation-delay:.12s!important}
.gw-room .gw-hex-card.jy-draw .gw-hex-line:nth-child(5){animation-delay:.30s!important}
.gw-room .gw-hex-card.jy-draw .gw-hex-line:nth-child(4){animation-delay:.48s!important}
.gw-room .gw-hex-card.jy-draw .gw-hex-line:nth-child(3){animation-delay:.66s!important}
.gw-room .gw-hex-card.jy-draw .gw-hex-line:nth-child(2){animation-delay:.84s!important}
.gw-room .gw-hex-card.jy-draw .gw-hex-line:nth-child(1){animation-delay:1.02s!important}
#oracle-screen .or-poem-column.jy-draw .or-poem-line{animation:jy-ink-draw 1s cubic-bezier(.25,.6,.2,1) both!important}  /* oracle-result.css 以 #oracle-screen 指定籤詩行動畫，需同權重 */
#oracle-screen .or-poem-column.jy-draw .or-poem-lines[data-layout=vertical] .or-poem-line{animation-name:jy-ink-down!important}
#oracle-screen .or-poem-column.jy-draw .or-poem-line:nth-child(1){animation-delay:.25s!important}
#oracle-screen .or-poem-column.jy-draw .or-poem-line:nth-child(2){animation-delay:.8s!important}
#oracle-screen .or-poem-column.jy-draw .or-poem-line:nth-child(3){animation-delay:1.35s!important}
#oracle-screen .or-poem-column.jy-draw .or-poem-line:nth-child(4){animation-delay:1.9s!important}
@media (prefers-reduced-motion:reduce){
  .gw-progress-row.is-new .gw-yao i,.gw-room .gw-hex-card.jy-draw .gw-hex-line,#oracle-screen .or-poem-column.jy-draw .or-poem-line{animation:none!important;clip-path:none!important;filter:none!important}
}
