/* =====================================================================
   萬神牌單元專用樣式（搭配 site.css）
   ===================================================================== */

/* ---- 牌卡縮圖 ---- */
.wthumb{margin:0; display:flex; flex-direction:column; align-items:center; gap:6px; font:inherit; color:inherit; background:none; border:0; padding:0}
button.wthumb{cursor:pointer}
.wthumb img{display:block; width:100%; aspect-ratio:374/586; object-fit:cover; border-radius:8px;
  box-shadow:0 1px 2px rgba(40,24,6,.18), 0 8px 18px -10px rgba(40,24,6,.45); transition:transform .2s, box-shadow .2s, outline-color .2s;
  outline:2px solid transparent; outline-offset:3px}
button.wthumb:hover img{transform:translateY(-3px)}
button.wthumb:focus-visible img{outline-color:var(--accent)}
button.wthumb[aria-pressed="true"] img{outline-color:var(--seal); transform:translateY(-3px)}
.wthumb .cap{font-size:13px; line-height:1.4; text-align:center; color:var(--muted)}
.wthumb .cap b{font-family:var(--mono); font-weight:500; font-size:11.5px; color:var(--faint); margin-right:5px}
button.wthumb[aria-pressed="true"] .cap{color:var(--fg); font-weight:600}

.ws-credit{display:flex; flex-wrap:wrap; gap:6px 18px; margin:0; font-size:14px; color:var(--muted)}
.ws-credit b{font-family:var(--serif); color:var(--fg); font-weight:600; margin-left:4px}

.ws-quote{margin:0; padding:16px 20px; border-left:3px solid var(--seal); background:color-mix(in srgb,var(--surface) 70%, transparent);
  border-radius:0 12px 12px 0; font-family:var(--serif); font-size:16.5px; line-height:1.9}
.ws-quote cite{display:block; font-style:normal; font-family:var(--sans); font-size:13px; color:var(--faint); margin-top:6px; letter-spacing:.06em}

/* ---- 道 vs 術 分類 ---- */
.dao{background:var(--surface); border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--shadow-1); padding:22px 20px; display:flex; flex-direction:column; gap:18px}
.dao-now{min-height:88px; display:flex; align-items:center; justify-content:center; text-align:center; padding:16px 18px; border-radius:14px;
  background:var(--sunk); font-family:var(--serif); font-size:clamp(18px,4.6vw,21px); font-weight:600; line-height:1.6; letter-spacing:.04em}
.dao-now.pop{animation:wspop .45s cubic-bezier(.3,1.5,.5,1)}
@keyframes wspop{from{transform:scale(.92); opacity:.3}to{transform:none; opacity:1}}
.dao-bins{display:grid; grid-template-columns:1fr 1fr; gap:12px}
.dao-bin{font:inherit; cursor:pointer; border:1.5px solid var(--line-strong); border-radius:14px; background:var(--bg); padding:14px 12px 12px;
  display:flex; flex-direction:column; align-items:center; gap:2px; color:var(--fg); transition:border-color .18s, background .18s, transform .12s}
.dao-bin:hover{border-color:var(--accent); transform:translateY(-2px)}
.dao-bin b{font-family:var(--serif); font-size:28px; line-height:1.2}
.dao-bin small{font-size:13px; color:var(--muted); letter-spacing:.08em}
.dao-bin .n{font-family:var(--mono); font-size:12px; color:var(--faint)}
.dao-bin.ok{border-color:var(--wx-wood); background:var(--wx-wood-bg)}
.dao-bin.no{border-color:var(--wx-fire); background:var(--wx-fire-bg); animation:wsshake .35s}
@keyframes wsshake{25%{transform:translateX(-5px)}75%{transform:translateX(5px)}}
.dao-meta{display:flex; justify-content:space-between; align-items:center; gap:12px; font-size:14px; color:var(--muted)}

/* ---- 牌面九要素 ---- */
.hot{display:grid; grid-template-columns:minmax(0,300px) minmax(0,1fr); gap:24px; align-items:start}
.hot-card{position:relative; border-radius:12px; overflow:visible}
.hot-card img{display:block; width:100%; border-radius:12px; box-shadow:var(--shadow-2)}
.hot-pt{position:absolute; transform:translate(-50%,-50%); width:24px; height:24px; border-radius:50%; cursor:pointer; padding:0;
  border:2px solid #fff; background:color-mix(in srgb,var(--seal) 78%, transparent); color:#fff; font:600 12px/1 var(--mono);
  box-shadow:0 2px 6px rgba(0,0,0,.35); transition:transform .2s, background .2s}
.hot-pt:hover,.hot-pt.on{transform:translate(-50%,-50%) scale(1.18); background:var(--seal)}
.hot-pt.on::after{content:""; position:absolute; inset:-7px; border-radius:50%; border:2px solid #fff; animation:wsring 1.4s ease-out infinite}
@keyframes wsring{from{opacity:.9; transform:scale(.8)}to{opacity:0; transform:scale(1.5)}}
.hot-side{display:flex; flex-direction:column; gap:14px}
.hot-list{display:grid; grid-template-columns:1fr 1fr; gap:8px}
.hot-list button{font:inherit; cursor:pointer; text-align:left; display:flex; align-items:baseline; gap:8px; padding:9px 12px; border-radius:10px;
  border:1px solid var(--line); background:var(--surface); color:var(--fg); transition:border-color .18s, background .18s}
.hot-list button i{font-style:normal; font-family:var(--mono); font-size:11.5px; color:var(--faint)}
.hot-list button span{font-size:13.5px; color:var(--muted)}
.hot-list button b{margin-left:auto; font-family:var(--serif); font-size:15.5px}
.hot-list button.on{border-color:var(--seal); background:color-mix(in srgb,var(--seal) 8%, var(--surface))}
.hot-switch{display:flex; align-items:center; gap:10px; flex-wrap:wrap}
.hot-switch .nm{font-family:var(--serif); font-weight:700; font-size:17px; letter-spacing:.08em; flex:1; min-width:8em}
.hot-switch .nm small{font-family:var(--mono); font-weight:500; font-size:12.5px; color:var(--faint); margin-right:8px}
@media (max-width:640px){ .hot{grid-template-columns:1fr} .hot-card{max-width:270px; margin:0 auto; width:100%} }

/* ---- 小卡比較（翻面） ---- */
.flip2{display:grid; grid-template-columns:1fr 1fr; gap:14px}
.fl{perspective:900px; font:inherit; border:0; background:none; padding:0; cursor:pointer; color:inherit; text-align:left}
.fl-in{position:relative; display:grid; transition:transform .6s cubic-bezier(.3,.9,.3,1); transform-style:preserve-3d; min-height:170px}
.fl.on .fl-in{transform:rotateY(180deg)}
.fl-f,.fl-b{grid-area:1/1; backface-visibility:hidden; -webkit-backface-visibility:hidden; border-radius:16px; padding:20px 18px; display:flex; flex-direction:column; gap:8px; justify-content:center}
.fl-f{background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow-1); align-items:center; text-align:center}
.fl-f b{font-family:var(--serif); font-size:40px; line-height:1.1}
.fl-f small{font-size:13px; color:var(--faint); letter-spacing:.12em}
.fl-b{transform:rotateY(180deg); background:var(--accent-soft); border:1px solid color-mix(in srgb,var(--accent) 35%, var(--line))}
.fl-b h4{margin:0; font-family:var(--serif); font-size:17px; letter-spacing:.08em}
.fl-b p{margin:0; font-size:15px; line-height:1.8; color:var(--fg)}
@media (prefers-reduced-motion:reduce){ .fl-in{transition:none} }

/* ---- 情境切換 ---- */
.wscene{display:grid; grid-template-columns:150px minmax(0,1fr); gap:20px; align-items:start}
.wscene .wthumb{max-width:150px}
.wscene-r{display:flex; flex-direction:column; gap:14px}
@media (max-width:560px){ .wscene{grid-template-columns:96px minmax(0,1fr); gap:14px} }

/* ---- 步驟（自動依序亮起） ---- */
.steps{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; counter-reset:st}
.steps .st{position:relative; background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:18px 16px 16px; opacity:.35; transform:translateY(8px); transition:opacity .5s, transform .5s, border-color .5s}
.steps .st.on{opacity:1; transform:none; border-color:color-mix(in srgb,var(--accent) 45%, var(--line)); box-shadow:var(--shadow-1)}
.steps .st i{font-style:normal; font-family:var(--serif); font-weight:700; color:var(--seal); font-size:14px; letter-spacing:.14em}
.steps .st b{display:block; font-family:var(--serif); font-size:17px; margin:4px 0 4px; letter-spacing:.06em}
.steps .st p{margin:0; font-size:14px; line-height:1.75; color:var(--muted)}
@media (max-width:640px){ .steps{grid-template-columns:1fr} }

/* ---- 排序遊戲 ---- */
.order{display:flex; flex-direction:column; gap:14px}
.order-slots{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px}
.order-slot{min-height:64px; border:1.5px dashed var(--line-strong); border-radius:12px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; padding:8px; text-align:center; color:var(--faint); font-size:13px}
.order-slot.fill{border-style:solid; border-color:var(--wx-wood); background:var(--wx-wood-bg); color:var(--wx-wood); animation:wspop .4s}
.order-slot.fill b{font-family:var(--serif); font-size:15px; color:var(--fg)}
.order-pool{display:flex; flex-wrap:wrap; gap:10px}
.order-pool button{font:inherit; font-family:var(--serif); font-size:15.5px; cursor:pointer; border:1px solid var(--line-strong); background:var(--surface); color:var(--fg); border-radius:12px; padding:10px 16px; transition:border-color .18s, transform .12s}
.order-pool button:hover{border-color:var(--accent); transform:translateY(-2px)}
.order-pool button.no{border-color:var(--wx-fire); background:var(--wx-fire-bg); animation:wsshake .35s}
@media (max-width:640px){ .order-slots{grid-template-columns:1fr 1fr} }

/* ---- 中央與四周（上帝與眾神） ---- */
.orbit{position:relative; width:min(100%,460px); aspect-ratio:1; margin:0 auto}
.orbit .o{position:absolute; width:12%; left:50%; top:50%; transform:translate(-50%,-50%) scale(.4); opacity:0; transition:left .9s cubic-bezier(.25,1,.35,1), top .9s cubic-bezier(.25,1,.35,1), transform .9s, opacity .6s}
.orbit .o img{width:100%; display:block; border-radius:5px; box-shadow:0 4px 10px -4px rgba(40,24,6,.5)}
.orbit .c{position:absolute; width:24%; left:50%; top:50%; transform:translate(-50%,-50%); z-index:2}
.orbit .c img{width:100%; display:block; border-radius:9px; box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 35%, transparent), var(--shadow-2)}
.orbit::before{content:""; position:absolute; inset:9%; border-radius:50%; border:1px dashed var(--line-strong)}
.orbit.run .o{opacity:1}

/* ---- 五方佛 ---- */
.mandala{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); grid-template-rows:repeat(3,auto); gap:10px; max-width:460px; margin:0 auto; width:100%}
.mdl{font:inherit; cursor:pointer; border:1.5px solid var(--line); border-radius:16px; background:var(--surface); padding:14px 8px; display:flex; flex-direction:column; align-items:center; gap:2px; color:var(--fg);
  box-shadow:var(--shadow-1); transition:border-color .2s, transform .2s, background .2s; opacity:0; transform:scale(.85)}
.mandala.run .mdl{opacity:1; transform:none; transition:opacity .5s, transform .5s cubic-bezier(.3,1.4,.5,1), border-color .2s, background .2s}
.mdl small{font-size:12px; letter-spacing:.2em; color:var(--faint)}
.mdl b{font-family:var(--serif); font-size:19px; letter-spacing:.1em}
.mdl span{font-size:13px; color:var(--muted)}
.mdl:hover{border-color:var(--accent)}
.mdl[aria-pressed="true"]{border-color:var(--seal); background:color-mix(in srgb,var(--seal) 7%, var(--surface))}
.mdl.n{grid-area:1/2} .mdl.w{grid-area:2/1} .mdl.c{grid-area:2/2} .mdl.e{grid-area:2/3} .mdl.s{grid-area:3/2}
.mdl.c{background:var(--accent-soft)}
.cards-row{display:flex; flex-wrap:wrap; gap:12px}
.cards-row .wthumb{width:84px}
.cards-row .wthumb .cap{font-size:12.5px}
.tagmini{font-size:12px; font-family:var(--sans); border-radius:999px; padding:1px 8px; background:var(--surface-2); color:var(--muted); margin-left:6px}

/* ---- 四大菩薩元素 ---- */
.elem{display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px}
.elem button{font:inherit; cursor:pointer; border:1.5px solid var(--line); border-radius:16px; background:var(--surface); color:var(--fg); padding:14px 4px 12px;
  display:flex; flex-direction:column; align-items:center; gap:4px; box-shadow:var(--shadow-1); transition:border-color .2s, transform .2s}
.elem button:hover{transform:translateY(-2px)}
.elem button[aria-pressed="true"]{border-color:var(--seal)}
.elem .g{width:46px; height:46px; border-radius:50%; display:grid; place-items:center; font-family:var(--serif); font-size:22px; font-weight:700}
.elem small{font-size:12.5px; color:var(--muted)}
.elem b{font-family:var(--serif); font-size:14.5px; letter-spacing:.04em; text-align:center; line-height:1.4}
.elem .kong{border-style:dashed}
@media (max-width:560px){ .elem{grid-template-columns:repeat(3,minmax(0,1fr))} }

/* ---- 六道觀音樹 ---- */
.tree{display:flex; flex-direction:column; align-items:center; gap:0}
.tree-root{width:120px}
.tree-lines{width:100%; max-width:520px; height:46px; display:block}
.tree-lines path{fill:none; stroke:var(--line-strong); stroke-width:1.5; stroke-dasharray:200; stroke-dashoffset:200; transition:stroke-dashoffset 1.2s ease-out}
.tree.run .tree-lines path{stroke-dashoffset:0}
.tree-kids{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; width:100%; max-width:520px}
.tree-kid{display:flex; flex-direction:column; align-items:center; gap:6px; text-align:center; opacity:0; transform:translateY(10px); transition:opacity .6s, transform .6s}
.tree.run .tree-kid{opacity:1; transform:none}
.tree-kid .dao6{font-size:12.5px; letter-spacing:.2em; color:var(--seal); font-family:var(--serif); font-weight:700}
.tree-kid .wthumb{width:90px}
.tree-kid .ph{width:90px; aspect-ratio:374/586; border-radius:8px; border:1.5px dashed var(--line-strong); display:grid; place-items:center; color:var(--faint); font-size:12px; padding:6px; line-height:1.5}
.tree-kid p{margin:0; font-size:13.5px; color:var(--muted); line-height:1.6}

/* ---- 寶部財神：界面活性劑 ---- */
.soap{background:var(--surface); border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--shadow-1); padding:18px 16px; display:flex; flex-direction:column; gap:16px}
.soap svg{width:100%; height:auto; display:block}
.soap .part{cursor:pointer}
.soap .part:focus{outline:none}
.soap .part:focus-visible .hit{stroke:var(--accent); stroke-width:3}
.soap .chain{fill:none; stroke:var(--wx-earth); stroke-width:5; stroke-linecap:round; stroke-linejoin:round; stroke-dasharray:640; stroke-dashoffset:640; transition:stroke-dashoffset 1.6s ease-out .3s}
.soap.run .chain{stroke-dashoffset:0}
.soap .head{fill:var(--wx-water-bg); stroke:var(--wx-water); stroke-width:3}
.soap .mid{fill:var(--accent-soft); stroke:var(--accent); stroke-width:3}
.soap .part.on .hit{stroke:var(--seal); stroke-width:4}
.soap text{font-family:var(--serif); font-weight:700; text-anchor:middle; dominant-baseline:central; fill:var(--fg)}
.soap text.s{font-family:var(--sans); font-weight:500; fill:var(--muted)}
.fu{display:flex; align-items:center; justify-content:center; gap:14px; flex-wrap:wrap; font-family:var(--serif)}
.fu .k{display:flex; flex-direction:column; align-items:center; gap:4px}
.fu .k b{width:62px; height:62px; display:grid; place-items:center; border-radius:14px; font-size:34px; background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow-1)}
.fu .k small{font-family:var(--sans); font-size:12.5px; color:var(--muted); text-align:center; line-height:1.4}
.fu .op{font-size:22px; color:var(--faint)}
.fu .k.big b{width:76px; height:76px; font-size:44px; background:var(--accent-soft); color:var(--accent-ink); border-color:color-mix(in srgb,var(--accent) 40%, var(--line))}
.fu .k{opacity:0; transform:translateY(8px); transition:opacity .5s, transform .5s}
.fu.run .k{opacity:1; transform:none}

/* ---- 等價關係 ---- */
.wseq{display:flex; flex-direction:column; gap:12px}
.wseq-row{display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:14px 16px; border:1px solid var(--line); border-radius:14px; background:var(--surface); transition:border-color .2s, background .2s, opacity .2s}
.wseq-row .lab{flex:1 1 100%; font-size:12.5px; letter-spacing:.16em; color:var(--faint)}
.wseq-row .nm{font-family:var(--serif); font-size:16px; font-weight:600; padding:5px 12px; border-radius:999px; background:var(--sunk); border:1px solid transparent}
.wseq-row .nm.hasc{background:var(--accent-soft); color:var(--accent-ink)}
.wseq-row .is{color:var(--faint); font-family:var(--serif)}
.wseq-row.on{border-color:var(--seal); background:color-mix(in srgb,var(--seal) 6%, var(--surface))}
.wseq.dim .wseq-row:not(.on){opacity:.45}
.wseq-row{cursor:pointer}
.ladder{display:flex; align-items:flex-end; justify-content:center; gap:12px}
.ladder .lv{display:flex; flex-direction:column; align-items:center; gap:6px; text-align:center}
.ladder .bar{width:64px; border-radius:10px 10px 4px 4px; background:linear-gradient(var(--accent),color-mix(in srgb,var(--accent) 45%, var(--surface))); height:0; transition:height 1s cubic-bezier(.25,1,.35,1)}
.ladder b{font-family:var(--serif); font-size:15px}
.ladder small{font-size:12px; color:var(--muted)}

/* ---- 神尊檔案（04–08 共用） ---- */
.wdpick{display:grid; grid-template-columns:repeat(var(--n,4),minmax(0,1fr)); gap:12px; max-width:min(100%, calc(var(--n,4) * 140px))}
@media (max-width:560px){ .wdpick{grid-template-columns:repeat(var(--m,4),minmax(0,1fr)); gap:8px} .wdpick .cap{font-size:11.5px} }
.dmain{display:grid; grid-template-columns:minmax(0,280px) minmax(0,1fr); gap:28px; align-items:start; margin-top:22px}
@media (max-width:680px){ .dmain{grid-template-columns:1fr; gap:20px} }
.dflip{perspective:1200px; font:inherit; border:0; background:none; padding:0; cursor:pointer; color:inherit; width:100%; max-width:280px; margin:0 auto; display:block}
.dflip-in{position:relative; display:grid; transition:transform .7s cubic-bezier(.3,.9,.3,1); transform-style:preserve-3d}
.dflip.on .dflip-in{transform:rotateY(180deg)}
.dflip-f,.dflip-b{grid-area:1/1; backface-visibility:hidden; -webkit-backface-visibility:hidden; border-radius:14px; overflow:hidden}
.dflip-f img{display:block; width:100%; aspect-ratio:374/586; object-fit:cover; box-shadow:var(--shadow-2); border-radius:14px}
.dflip-b{transform:rotateY(180deg); background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow-2); padding:18px 16px; display:flex; flex-direction:column; gap:4px; text-align:left}
.dflip-b h4{margin:0 0 6px; font-family:var(--serif); font-size:15px; letter-spacing:.14em; color:var(--seal)}
.dflip-b dl{margin:0; display:grid; grid-template-columns:auto 1fr; gap:7px 12px; font-size:14px}
.dflip-b dt{color:var(--faint); letter-spacing:.06em}
.dflip-b dd{margin:0; font-family:var(--serif); font-weight:600}
.dflip-hint{margin:8px 0 0; text-align:center; font-size:12.5px; color:var(--faint)}
@media (prefers-reduced-motion:reduce){ .dflip-in{transition:none} }
.dinfo{display:flex; flex-direction:column; gap:14px; min-width:0}
.dinfo .dno{font-family:var(--mono); font-size:13px; letter-spacing:.2em; color:var(--seal)}
.dinfo h3{margin:0; font-family:var(--serif); font-size:clamp(26px,6vw,34px); letter-spacing:.1em; line-height:1.3}
.dinfo .dtag{margin:0; font-family:var(--serif); font-size:16.5px; line-height:1.85; color:var(--fg); padding-left:14px; border-left:3px solid var(--line-strong)}
.dtabs{display:flex; flex-wrap:wrap; gap:6px; border-bottom:1px solid var(--line); padding-bottom:0}
.dtabs button{font:inherit; font-family:var(--serif); font-size:15px; letter-spacing:.06em; cursor:pointer; background:none; border:0; border-bottom:2px solid transparent; color:var(--muted); padding:8px 10px 9px; margin-bottom:-1px}
.dtabs button[aria-selected="true"]{color:var(--fg); border-bottom-color:var(--seal); font-weight:700}
.dtabs button:focus-visible{outline:2px solid var(--accent); outline-offset:-2px; border-radius:6px}
.dpanel{display:flex; flex-direction:column; gap:10px}
.dpanel ul{margin:0; padding:0; list-style:none; display:flex; flex-direction:column; gap:10px}
.dpanel li{font-size:15.5px; line-height:1.85; padding:12px 14px; border-radius:12px; background:color-mix(in srgb,var(--sunk) 55%, var(--surface)); border:1px solid var(--line)}
.dpanel li b{font-family:var(--serif); color:var(--accent-ink); margin-right:4px}
.dpanel li.whl{border-color:var(--seal); background:color-mix(in srgb,var(--seal) 6%, var(--surface)); animation:wspop .35s}
.dchips{display:flex; flex-wrap:wrap; gap:6px}
.dchips button{font:inherit; font-size:13.5px; cursor:pointer; border:1px solid var(--line); background:var(--surface); color:var(--muted); border-radius:999px; padding:5px 12px}
.dchips button[aria-pressed="true"]{background:var(--fg); border-color:var(--fg); color:var(--bg)}
.dtbl{width:100%; border-collapse:collapse; font-size:14px}
.dtbl th,.dtbl td{border-bottom:1px solid var(--line); padding:8px 6px; text-align:left; vertical-align:top}
.dtbl th{font-weight:600; color:var(--muted); font-size:12.5px; letter-spacing:.08em}

/* ---- 方位小地圖 ---- */
.compass{position:relative; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); grid-template-rows:repeat(3,auto); gap:10px; max-width:420px; margin:0 auto; width:100%}
.compass .cp{display:flex; flex-direction:column; align-items:center; gap:4px; text-align:center}
.compass .cp .wthumb{width:92px}
.compass .cp small{font-size:12px; letter-spacing:.2em; color:var(--seal); font-family:var(--serif); font-weight:700}
.compass .cp p{margin:0; font-size:13px; color:var(--muted); line-height:1.5}
.compass .cp.n{grid-area:1/2} .compass .cp.w{grid-area:2/1} .compass .cp.e{grid-area:2/3} .compass .cp.s{grid-area:3/2}
.compass .mid{grid-area:2/2; display:grid; place-items:center}
.compass .mid span{width:64px; height:64px; border-radius:50%; border:1px dashed var(--line-strong); display:grid; place-items:center; font-family:var(--serif); font-size:13px; color:var(--faint); letter-spacing:.1em}

/* ---- 驗收用牌圖 ---- */
.q .qimg{width:96px; margin:2px 0 12px}
.q .qimg img{border-radius:6px}

/* ---- 萬神牌主題首頁 ---- */
.wsfan{position:relative; height:clamp(180px,42vw,240px); margin:30px auto 0; max-width:460px}
.wsfan img{position:absolute; left:50%; bottom:0; width:clamp(96px,24vw,130px); border-radius:9px; transform-origin:50% 120%;
  box-shadow:0 10px 24px -12px rgba(40,24,6,.6); transform:translateX(-50%) rotate(0deg); transition:transform 1s cubic-bezier(.25,1,.35,1)}
.wsgal{display:grid; grid-template-columns:repeat(auto-fill,minmax(88px,1fr)); gap:14px 12px}
.wsgal .wthumb .cap{font-size:12.5px}
.wspop{margin-top:16px; display:grid; grid-template-columns:96px minmax(0,1fr); gap:16px; align-items:start; padding:16px; border-radius:14px; border:1px solid var(--line); background:var(--surface); box-shadow:var(--shadow-1)}
.wspop h4{margin:0 0 4px; font-family:var(--serif); font-size:19px; letter-spacing:.08em}
.wspop p{margin:0 0 8px; font-size:14.5px; line-height:1.8; color:var(--muted)}
.wspop a{font-size:14.5px; color:var(--accent-ink)}
.ws-fb{padding:12px 15px; border-radius:12px; background:var(--sunk); border-left:4px solid var(--line-strong); font-size:15px; line-height:1.8}
.ws-fb.ok{border-left-color:var(--wx-wood)}
.ws-fb.no{border-left-color:var(--wx-fire)}
.dmain.swap-in{animation:wspop .45s cubic-bezier(.3,1.3,.5,1)}
@media (max-width:680px){ .dflip{max-width:220px} }
@media (max-width:640px){ .hot-pt{width:20px; height:20px; font-size:11px; border-width:1.5px} }

/* ---- 養牌四步驟：動畫劇場 ---- */
.yp{display:flex; flex-direction:column; gap:14px}
.yp-steps{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; position:relative}
.yp-steps button{font:inherit; cursor:pointer; border:1px solid var(--line); background:var(--surface); color:var(--muted); border-radius:12px; padding:9px 6px 8px;
  display:flex; flex-direction:column; align-items:center; gap:2px; position:relative; overflow:hidden; transition:border-color .2s, color .2s}
.yp-steps button i{font-style:normal; font-family:var(--serif); font-weight:700; font-size:13px; color:var(--seal); letter-spacing:.1em}
.yp-steps button b{font-family:var(--serif); font-size:14px; letter-spacing:.04em; line-height:1.35}
.yp-steps button::after{content:""; position:absolute; left:0; bottom:0; height:3px; width:0; background:var(--seal)}
.yp-steps button.on{border-color:var(--seal); color:var(--fg)}
.yp-steps button.on::after{animation:ypbar var(--dur,4.2s) linear forwards}
.yp-steps button.done::after{width:100%}
.yp.paused .yp-steps button.on::after{animation:none; width:100%}
@keyframes ypbar{to{width:100%}}
.yp-stage{position:relative; aspect-ratio:16/9; border-radius:18px; overflow:hidden; border:1px solid var(--line); box-shadow:var(--shadow-2);
  background:radial-gradient(120% 90% at 50% 100%, color-mix(in srgb,var(--accent-soft) 85%, var(--surface)), var(--surface))}
.yp-sc{position:absolute; inset:0; opacity:0; transition:opacity .6s; pointer-events:none}
.yp-sc.on{opacity:1}
.yp-card{position:absolute; left:50%; top:50%; width:18%; aspect-ratio:374/586; transform:translate(-50%,-50%); border-radius:8px; overflow:hidden;
  box-shadow:0 14px 28px -12px rgba(40,24,6,.6)}
.yp-card img{width:100%; height:100%; object-fit:cover; display:block}
.yp-cap{position:absolute; left:0; right:0; bottom:0; padding:10px 14px 12px; background:linear-gradient(transparent, color-mix(in srgb,var(--surface) 92%, transparent) 40%);
  text-align:center; font-family:var(--serif); font-size:clamp(13px,3.4vw,16px); letter-spacing:.08em; color:var(--fg)}
.yp-text{display:flex; flex-direction:column; gap:4px; min-height:5.2em}
.yp-text h4{margin:0; font-family:var(--serif); font-size:18px; letter-spacing:.08em}
.yp-text p{margin:0; font-size:15px; line-height:1.85; color:var(--muted)}
.yp-ctl{display:flex; gap:10px}

/* 1 日常共處：日夜交替＋睡吃喝 */
.yp-sky{position:absolute; inset:0; background:linear-gradient(#FCEFD3,#F6E4C1)}
.yp-sc.s1.on .yp-sky{animation:ypsky 4.2s ease-in-out forwards}
@keyframes ypsky{0%,35%{background:linear-gradient(#FCEFD3,#F6E4C1)}55%,100%{background:linear-gradient(#2B3557,#3D3F63)}}
.yp-sun,.yp-moon{position:absolute; top:10%; right:12%; width:9%; aspect-ratio:1; border-radius:50%}
.yp-sun{background:radial-gradient(circle,#FFD36B 55%,rgba(255,211,107,0) 70%)}
.yp-moon{background:radial-gradient(circle at 38% 40%, transparent 42%, #F4E7C5 43%); opacity:0}
.yp-sc.s1.on .yp-sun{animation:ypset 4.2s ease-in-out forwards}
.yp-sc.s1.on .yp-moon{animation:yprise 4.2s ease-in-out forwards}
@keyframes ypset{0%,30%{transform:none; opacity:1}55%,100%{transform:translateY(160%); opacity:0}}
@keyframes yprise{0%,45%{transform:translateY(-120%); opacity:0}70%,100%{transform:none; opacity:1}}
.yp-sc.s1 .yp-card{animation:ypfloat 2.4s ease-in-out infinite}
@keyframes ypfloat{50%{transform:translate(-50%,-56%)}}
.yp-ic{position:absolute; width:15%; display:flex; flex-direction:column; align-items:center; gap:4px; opacity:0; transform:scale(.4)}
.yp-ic svg{width:62%; aspect-ratio:1; fill:none; stroke:var(--accent-ink); stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round;
  background:var(--surface); border-radius:50%; padding:14%; box-shadow:var(--shadow-1)}
.yp-ic span{white-space:nowrap; font-family:var(--serif); font-weight:700; font-size:clamp(10.5px,2.7vw,15px); color:var(--fg); background:var(--surface); border-radius:999px; padding:1px 10px}
.yp-ic.a{left:9%; top:12%} .yp-ic.b{left:9%; top:46%} .yp-ic.c{right:9%; top:40%}
.yp-sc.s1.on .yp-ic{animation:yppop .5s cubic-bezier(.3,1.6,.5,1) forwards}
.yp-sc.s1.on .yp-ic.a{animation-delay:.3s} .yp-sc.s1.on .yp-ic.b{animation-delay:1s} .yp-sc.s1.on .yp-ic.c{animation-delay:1.7s}
@keyframes yppop{to{opacity:1; transform:none}}

/* 2 打坐靜坐：呼吸光圈＋雜念散去 */
.yp-med{position:absolute; left:50%; top:46%; width:24%; transform:translate(-50%,-50%)}
.yp-med svg{width:100%; display:block; fill:var(--accent); opacity:.88}
.yp-ring{position:absolute; left:50%; top:46%; width:26%; aspect-ratio:1; border-radius:50%; transform:translate(-50%,-50%) scale(.6);
  border:2px solid color-mix(in srgb,var(--accent) 60%, transparent); opacity:0}
.yp-sc.s2.on .yp-ring{animation:ypbreath 3s ease-out infinite}
.yp-sc.s2.on .yp-ring.r2{animation-delay:1s} .yp-sc.s2.on .yp-ring.r3{animation-delay:2s}
@keyframes ypbreath{0%{opacity:.8; transform:translate(-50%,-50%) scale(.6)}100%{opacity:0; transform:translate(-50%,-50%) scale(2.2)}}
.yp-word{position:absolute; font-family:var(--serif); font-size:clamp(12px,3vw,15px); color:var(--muted); opacity:.8}
.yp-sc.s2.on .yp-word{animation:ypfade 2.4s ease-in forwards}
.yp-word.w1{left:16%; top:22%} .yp-word.w2{right:16%; top:26%} .yp-word.w3{left:20%; top:62%} .yp-word.w4{right:18%; top:60%}
.yp-sc.s2.on .yp-word.w2{animation-delay:.4s} .yp-sc.s2.on .yp-word.w3{animation-delay:.8s} .yp-sc.s2.on .yp-word.w4{animation-delay:1.2s}
@keyframes ypfade{to{opacity:0; transform:translateY(-24px); filter:blur(4px)}}

/* 3 定義牌與自我共振：兩道波由錯開到同步 */
.yp-me{position:absolute; left:14%; top:50%; width:13%; transform:translateY(-50%)}
.yp-me svg{width:100%; display:block; fill:var(--accent-ink); opacity:.85}
.yp-sc.s3 .yp-card{left:80%; width:15%}
.yp-wave{position:absolute; left:26%; right:28%; top:34%; height:32%}
.yp-wave svg{width:100%; height:100%; display:block; overflow:visible}
.yp-wave path{fill:none; stroke-width:3; stroke-linecap:round}
.yp-wave .wa{stroke:var(--seal)}
.yp-wave .wb{stroke:var(--accent)}
.yp-sc.s3.on .yp-wave .wa{animation:ypwa 1.2s linear infinite}
.yp-sc.s3.on .yp-wave .wb{animation:ypwb 4.2s ease-in-out forwards, ypwa 1.2s linear infinite}
@keyframes ypwa{to{stroke-dashoffset:-80}}
@keyframes ypwb{0%{transform:translateY(18px)}60%,100%{transform:none}}
.yp-wave path{stroke-dasharray:40 0}
.yp-def{position:absolute; left:50%; top:16%; transform:translateX(-50%); font-family:var(--serif); font-size:clamp(12px,3vw,15px); background:var(--surface);
  border:1px solid var(--line); border-radius:999px; padding:3px 14px; opacity:0; white-space:nowrap}
.yp-sc.s3.on .yp-def{animation:yppop .5s .3s forwards}

/* 4 階段開光：光芒與星點 */
.yp-rays{position:absolute; left:50%; top:46%; width:70%; aspect-ratio:1; transform:translate(-50%,-50%);
  background:repeating-conic-gradient(color-mix(in srgb,#F7C35A 55%, transparent) 0 6deg, transparent 6deg 18deg); border-radius:50%;
  -webkit-mask:radial-gradient(circle, #000 18%, transparent 68%); mask:radial-gradient(circle, #000 18%, transparent 68%); opacity:0}
.yp-sc.s4.on .yp-rays{animation:ypray 1s ease-out forwards, ypspin 16s linear infinite}
@keyframes ypray{to{opacity:1}}
@keyframes ypspin{to{transform:translate(-50%,-50%) rotate(360deg)}}
.yp-sc.s4 .yp-card{top:46%}
.yp-sc.s4.on .yp-card{animation:ypglow 2.4s ease-in-out infinite}
@keyframes ypglow{50%{box-shadow:0 0 0 6px rgba(247,195,90,.35), 0 0 46px 10px rgba(247,195,90,.6)}}
.yp-star{position:absolute; width:4%; aspect-ratio:1; opacity:0;
  background:radial-gradient(circle,#FFF4CF 20%,transparent 22%), conic-gradient(from 45deg, transparent 0 20%, #FFE08A 0 30%, transparent 0 45%, #FFE08A 0 55%, transparent 0 70%, #FFE08A 0 80%, transparent 0 95%, #FFE08A 0);
  -webkit-mask:radial-gradient(circle,#000 30%,transparent 70%); mask:radial-gradient(circle,#000 30%,transparent 70%)}
.yp-sc.s4.on .yp-star{animation:yptw 1.6s ease-in-out infinite}
.yp-star.t1{left:30%; top:22%} .yp-star.t2{left:66%; top:18%; animation-delay:.4s !important} .yp-star.t3{left:26%; top:62%; animation-delay:.8s !important} .yp-star.t4{left:70%; top:60%; animation-delay:1.2s !important}
@keyframes yptw{0%,100%{opacity:0; transform:scale(.4)}50%{opacity:1; transform:scale(1.3)}}
@media (prefers-reduced-motion:reduce){ .yp-sc *{animation:none !important} .yp-ic,.yp-def,.yp-rays{opacity:1; transform:none} }
@media (max-width:560px){ .yp-steps b{font-size:12.5px} }

/* ---- 講義原圖＋點選熱區 ---- */
.pic{position:relative; max-width:560px; margin:0 auto; border-radius:18px; overflow:hidden; box-shadow:var(--shadow-2); border:1px solid var(--line)}
.pic.wide{max-width:760px}
.pic img{display:block; width:100%; height:auto}
.pic button{position:absolute; transform:translate(-50%,-50%); border:0; background:transparent; cursor:pointer; border-radius:18px; padding:0;
  box-shadow:inset 0 0 0 0 transparent; transition:box-shadow .25s, background .25s}
.pic button:hover{background:rgba(255,255,255,.12)}
.pic button:focus-visible{box-shadow:inset 0 0 0 3px var(--accent)}
.pic button[aria-pressed="true"]{box-shadow:inset 0 0 0 3px var(--seal), 0 0 0 4px rgba(255,255,255,.55)}
.pic-hint{margin:10px 0 0; text-align:center; font-size:13px; color:var(--faint)}

/* ---- 二十四尊神：旁邊彈出定位框 ---- */
.wsgal{position:relative}
.wsbub{position:absolute; z-index:5; width:min(250px,80vw); padding:14px 16px 14px; border-radius:14px; background:var(--surface); border:1px solid var(--line-strong);
  box-shadow:var(--shadow-2); animation:wspop .3s cubic-bezier(.3,1.4,.5,1)}
.wsbub::before{content:""; position:absolute; top:var(--ay,28px); width:12px; height:12px; background:var(--surface); border:1px solid var(--line-strong); transform:rotate(45deg)}
.wsbub.r::before{left:-7px; border-right:0; border-top:0}
.wsbub.l::before{right:-7px; border-left:0; border-bottom:0}
.wsbub.b::before{top:-7px; left:var(--ax,40px); border-right:0; border-bottom:0}
.wsbub h4{margin:0 0 6px; font-family:var(--serif); font-size:17px; letter-spacing:.06em; line-height:1.4}
.wsbub h4 small{font-family:var(--mono); font-weight:500; font-size:12px; color:var(--seal); margin-right:6px}
.wsbub p{margin:0 0 8px; font-size:14px; line-height:1.75; color:var(--muted)}
.wsbub a{font-size:14px; color:var(--accent-ink)}
.wsbub .x{position:absolute; top:6px; right:8px; border:0; background:none; font-size:18px; color:var(--faint); cursor:pointer; line-height:1; padding:4px}

/* 牌面九要素：聚光框（取代圓點） */
.hot-card{overflow:hidden; border-radius:12px; box-shadow:var(--shadow-2)}
.hot-card img{box-shadow:none}
.hot-spot{position:absolute; border-radius:8px; border:2px solid #FFE3A0; pointer-events:none; z-index:2;
  box-shadow:0 0 0 999px rgba(15,10,4,.5), 0 0 18px 2px rgba(255,214,120,.65);
  transition:left .45s cubic-bezier(.3,.9,.3,1), top .45s cubic-bezier(.3,.9,.3,1), width .45s, height .45s}
.hot-hit{position:absolute; z-index:3; border:0; padding:0; background:transparent; cursor:pointer; border-radius:8px}
.hot-hit:focus-visible{outline:2px solid #fff; outline-offset:1px}
@media (prefers-reduced-motion:reduce){ .hot-spot{transition:none} }

/* ---- 觀音三化身＋寶部兩脅侍 ---- */
.trio{display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:14px; max-width:520px; margin:0 auto}
.trio .side{display:flex; flex-direction:column; align-items:center; gap:6px; text-align:center; opacity:0; transition:opacity .6s, transform .6s}
.trio .side.l{transform:translateX(30px)} .trio .side.r{transform:translateX(-30px)}
.trio.run .side{opacity:1; transform:none}
.trio .side .wthumb{width:96px}
.trio .side small{font-size:12.5px; letter-spacing:.2em; color:var(--seal); font-family:var(--serif); font-weight:700}
.trio .side p{margin:0; font-size:13.5px; color:var(--muted); line-height:1.6}
.trio .ctr{display:flex; flex-direction:column; align-items:center; gap:6px}
.trio .ctr .wthumb{width:110px}
.trio .ctr .wthumb img{box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 35%, transparent), var(--shadow-2)}

/* ---- 情境配對（誰來處理） ---- */
.match{display:flex; flex-direction:column; gap:14px}
.match-q{padding:18px 18px; border-radius:14px; background:var(--sunk); font-family:var(--serif); font-size:clamp(17px,4.4vw,20px); font-weight:600; line-height:1.6; text-align:center}
.match-q.pop{animation:wspop .45s cubic-bezier(.3,1.5,.5,1)}
.match-opts{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; max-width:420px; margin:0 auto; width:100%}
.match-opts button.wthumb.ok img{outline-color:var(--wx-wood); outline-width:3px}
.match-opts button.wthumb.no img{outline-color:var(--wx-fire); outline-width:3px; animation:wsshake .35s}
.match-meta{display:flex; justify-content:space-between; font-size:14px; color:var(--muted)}

/* ---- 主題篩選（八尊各主什麼） ---- */
.tgrid{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px 12px; max-width:560px}
.tgrid .wthumb{transition:opacity .3s, transform .3s, filter .3s}
.tgrid.f .wthumb{opacity:.28; filter:grayscale(.7)}
.tgrid.f .wthumb.hit{opacity:1; filter:none; transform:translateY(-4px)}
.tgrid .wthumb .kw{display:block; font-size:12px; color:var(--seal); font-family:var(--serif); font-weight:700; letter-spacing:.06em}

/* ---- 成對（大財組合） ---- */
.pair{position:relative; display:flex; justify-content:center; align-items:center; gap:0; min-height:240px}
.pair .wthumb{width:120px; transition:transform 1s cubic-bezier(.25,1,.35,1)}
.pair .pa{transform:translateX(-90px) rotate(-12deg)}
.pair .pb{transform:translateX(90px) rotate(12deg)}
.pair.run .pa{transform:translateX(-8px) rotate(-5deg)}
.pair.run .pb{transform:translateX(8px) rotate(5deg)}
.pair .glow{position:absolute; left:50%; top:42%; width:260px; height:260px; transform:translate(-50%,-50%) scale(.4); border-radius:50%;
  background:radial-gradient(circle, rgba(247,195,90,.55), transparent 65%); opacity:0; transition:opacity 1s .8s, transform 1.2s .8s; pointer-events:none}
.pair.run .glow{opacity:1; transform:translate(-50%,-50%) scale(1)}
.pair-cap{text-align:center; font-family:var(--serif); font-size:18px; letter-spacing:.08em; margin:6px 0 0; opacity:0; transition:opacity .6s 1.4s}
.pair.run + .pair-cap{opacity:1}
.pair-cap small{display:block; font-family:var(--sans); font-size:14px; color:var(--muted); letter-spacing:0; margin-top:4px}

/* ---- 十大化身 ---- */
.avat{display:grid; grid-template-columns:repeat(10,minmax(0,1fr)); gap:6px}
.avat button{font:inherit; cursor:pointer; border:1px solid var(--line); background:var(--surface); color:var(--muted); border-radius:10px; padding:8px 2px; display:flex; flex-direction:column; align-items:center; gap:2px}
.avat button i{font-style:normal; font-family:var(--mono); font-size:11px; color:var(--faint)}
.avat button b{font-family:var(--serif); font-size:15px; color:var(--fg)}
.avat button[aria-pressed="true"]{border-color:var(--seal); background:color-mix(in srgb,var(--seal) 7%, var(--surface))}
@media (max-width:640px){ .avat{grid-template-columns:repeat(5,minmax(0,1fr))} }

/* ---- 解牌實務 ---- */
.dw{display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:20px; align-items:start}
@media (max-width:640px){ .dw{grid-template-columns:1fr} }
.dw-deck{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px}
.dw-pos{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px}
.dw-pos button{font:inherit; cursor:pointer; border:1.5px dashed var(--line-strong); background:var(--bg); color:var(--fg); border-radius:14px; min-height:84px; padding:10px;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; transition:border-color .2s, background .2s}
.dw-pos button b{font-family:var(--serif); font-size:17px; letter-spacing:.1em}
.dw-pos button small{font-size:12.5px; color:var(--faint)}
.dw-pos button.ok{border-style:solid; border-color:var(--wx-wood); background:var(--wx-wood-bg)}
.dw-pos button.half{border-style:solid; border-color:var(--wx-earth); background:var(--wx-earth-bg)}
.combo-deck{display:grid; grid-template-columns:repeat(auto-fill,minmax(74px,1fr)); gap:12px 10px}
.combo-deck .wthumb .cap{font-size:12px}
.combo-out{min-height:110px}
.combo-out .hit{animation:wspop .45s cubic-bezier(.3,1.5,.5,1)}
.combo-prog{font-size:14px; color:var(--muted)}
.clue{display:flex; flex-wrap:wrap; gap:8px}
.clue button{font:inherit; font-size:14.5px; cursor:pointer; border:1px solid var(--line); background:var(--surface); color:var(--fg); border-radius:999px; padding:7px 14px; transition:border-color .2s}
.clue button[aria-pressed="true"]{background:var(--fg); color:var(--bg); border-color:var(--fg)}

/* ---- 延伸補充分頁 ---- */
.dext{padding:14px 16px; border:1px solid var(--line); border-radius:12px; background:var(--surface)}
.dext h5{margin:0 0 8px; font-family:var(--serif); font-size:15px; letter-spacing:.12em; color:var(--seal)}
.dext ul{gap:6px !important}
.dext li{background:none !important; border:0 !important; padding:0 0 0 16px !important; position:relative; font-size:15px !important; line-height:1.8 !important}
.dext li::before{content:""; position:absolute; left:2px; top:.8em; width:6px; height:6px; border-radius:50%; background:var(--line-strong)}
.dsrc{margin:2px 0 0; font-size:12.5px; color:var(--faint)}

/* ---- 口授心傳備註 ---- */
.wsnote{margin:6px 0 0; padding:12px 14px 12px 40px; position:relative; border-radius:12px; font-size:14px; line-height:1.75; color:var(--fg);
  background:color-mix(in srgb,var(--seal) 7%, var(--surface)); border:1px solid color-mix(in srgb,var(--seal) 30%, var(--line))}
.wsnote::before{content:"注"; position:absolute; left:12px; top:12px; width:20px; height:20px; border-radius:5px; display:grid; place-items:center;
  background:var(--seal); color:var(--seal-ink); font-family:var(--serif); font-size:12px; font-weight:700}
.wsnote.big{font-size:15px; padding:16px 18px 16px 48px}
.wsnote.big::before{left:16px; top:16px}
/* 成對動畫：開場時牌卡在框外，避免撐出橫向捲動 */
.pair{overflow:hidden}
/* 窄螢幕（320px）防溢出 */
.trio{overflow-x:clip}
.trio .side .wthumb{width:min(96px,25vw)}
.trio .ctr .wthumb{width:min(110px,28vw)}
.hm-hero{overflow-x:clip}

/* 神尊檔案分頁：手機上不換行，改為左右滑動（右緣淡出提示還有內容） */
@media (max-width:560px){
  .dtabs{flex-wrap:nowrap; overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:none; gap:2px;
    -webkit-mask-image:linear-gradient(90deg,#000 85%,transparent); mask-image:linear-gradient(90deg,#000 85%,transparent)}
  .dtabs::-webkit-scrollbar{display:none}
  .dtabs button{flex:none; white-space:nowrap; padding:8px 9px 9px; font-size:14.5px}
  .dtabs button:last-child{margin-right:28px}
}
