/* 規則與流程（public/js/help.js）：圖解說明書。平塗紙張 + 墨線，留白大；一節一節落下，插圖（.hp-scene）播一遍、點一下重播 */
.modal.help { width: min(920px, 100%); height: min(90vh, 980px); max-height: none; }
.modal.help .modal-head { gap: 12px; }
.modal.help .modal-body { padding: 0; }
.hp-title { display: flex; align-items: center; gap: 16px; min-width: 0; }
.hp-title > b { font-size: 17px; letter-spacing: .08em; white-space: nowrap; }
.hp-tabs { display: inline-flex; gap: 2px; padding: 3px; border: 1.5px solid var(--ink); border-radius: 999px; font: 400 13px var(--sans); }
.hp-tabs button { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border: 0; border-radius: 999px; background: none; color: var(--muted); white-space: nowrap; }
.hp-tabs button .ico { width: 14px; height: 14px; }
.hp-tabs button:hover { color: var(--ink); }
.hp-tabs button.on { background: var(--ink); color: var(--card); font-weight: 700; }

/* 目錄：貼在頂上，滾到哪節亮哪節 */
.hp-nav { position: sticky; top: 0; z-index: 3; display: flex; justify-content: center; gap: 8px; padding: 10px 16px; overflow-x: auto; scrollbar-width: none;
  background: var(--card) url(../img/grain.svg); border-bottom: 1px solid var(--line); }
.hp-nav button { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 13px 5px 9px; border: 1.5px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--muted); font: 700 13px var(--serif); letter-spacing: .06em; transition: border-color .2s, color .2s, background .2s, transform .15s; }
.hp-nav button .ico { width: 16px; height: 16px; }
.hp-nav button:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-1px); }
.hp-nav button.on { border-color: var(--ink); background: var(--ink); color: var(--card); }

.hp-page { max-width: 800px; margin: 0 auto; padding: 32px 32px 24px; }
.hp .token { cursor: default; }
.hp .btn, .hp .vbtn, .hp-menu, .hp .setup-role { pointer-events: none; }
.hp-page > .credit { margin-top: 48px; text-align: center; }

/* 每一節：圓章 + 大標題；滾進來時圓章蓋下去、內容一層層浮上來 */
.hp-sec { display: grid; gap: 16px; }
.hp-sec:not(.in) { opacity: 0; }
.hp-sec.in > * { animation: hp-rise .55s cubic-bezier(.2,.8,.3,1.1) both; }
.hp-sec.in > :nth-child(2) { animation-delay: .1s; }
.hp-sec.in > :nth-child(3) { animation-delay: .2s; }
.hp-sec.in > :nth-child(4) { animation-delay: .28s; }
.hp-sec.in > :nth-child(n+5) { animation-delay: .36s; }
@keyframes hp-rise { from { opacity: 0; translate: 0 22px; } }
.hp-h { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.hp-h h3 { margin: 0; font: 900 26px/1.2 var(--serif); letter-spacing: .08em; }
.hp-seal { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 50%; color: var(--ink); background: var(--card);
  border: 2px solid currentColor; box-shadow: inset 0 0 0 3px var(--card), inset 0 0 0 4.5px currentColor; }
.hp-seal .ico { width: 54%; height: 54%; }
.hp-sec.in .hp-seal { animation: hp-slam .42s cubic-bezier(.5,0,.6,1.3) .05s both; }
@keyframes hp-slam { from { transform: scale(2.4) rotate(-25deg); opacity: 0; } 60% { opacity: 1; } }
@keyframes hp-pop { from { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } }
@keyframes hp-drop { from { transform: translateY(-26px) scale(1.4) rotate(-12deg); opacity: 0; } 60% { opacity: 1; } }
@keyframes hp-press { from { transform: scale(2.4) rotate(-20deg); opacity: 0; } 65% { transform: scale(.9); opacity: 1; } }
@keyframes hp-stamp { from { transform: rotate(-30deg) scale(3); opacity: 0; } 60% { opacity: 1; } }

/* 節與節之間：兩道細線中間一顆金色四角星 */
.hp-div { display: flex; align-items: center; gap: 14px; margin: 56px 0 44px; color: var(--brass); }
.hp-div::before, .hp-div::after { content: ""; flex: 1; height: 3px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hp-div .ico { width: 16px; height: 16px; }

/* 卡片和網格 */
.hp-grid { display: grid; gap: 16px; }
.hp-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hp-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hp-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hp-grid.one { grid-template-columns: minmax(0, 1fr); }
.hp-card { position: relative; display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 18px 20px; background: #fffdf6; border: 1.5px solid var(--line);
  border-radius: 12px; transition: transform .2s, border-color .2s, box-shadow .2s; }
.hp-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 8px 18px #2a262214; }
.hp-card.fact { flex-direction: row; align-items: center; gap: 16px; }
.hp-card.warn { border-color: #8a1c1c55; }
.hp-say { display: grid; gap: 6px; min-width: 0; }
.hp-say > b { font: 700 17px/1.35 var(--serif); }
.hp-say > small { font-size: 13px; line-height: 1.65; color: var(--muted); }
.hp-k { font: 700 13px var(--serif); color: var(--muted); letter-spacing: .14em; }
.hp-lead { margin: 0; text-align: center; font: 700 15px/1.6 var(--serif); color: var(--muted); }
.hp-note { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.hp-row { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; font-size: 20px; line-height: 1; }
.hp-row.sm { font-size: 15px; justify-content: flex-start; }
.hp-say .hp-row { justify-content: flex-start; font-size: 18px; }
.hp-step .hp-pic > .frm { font-size: 28px; }
.hp-row small { font-size: 12px; color: var(--muted); }
.hp-pic { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 76px; padding: 14px;
  border-radius: 10px; background: var(--paper); font-size: 22px; }
.hp-big-ico { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; border: 1.5px dashed var(--line-strong); color: var(--ink); }
.hp-big-ico .ico { width: 26px; height: 26px; }
.hp-big-ico b { font: 900 20px var(--serif); }
.hp-big-ico.bad { color: var(--evil); border-color: currentColor; }
.hp-big-ico.brass { color: var(--brass); border-color: currentColor; }
.hp-yn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 11px 4px 8px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--card);
  font: 700 13px/1.2 var(--serif); color: var(--ink); }
.hp-yn .ico { width: 15px; height: 15px; }
.hp-yn.yes { border-color: var(--good); color: var(--good); }
.hp-yn.no { border-color: var(--evil); color: var(--evil); }
.hp-votes { display: inline-flex; align-items: center; gap: 2px; font: 700 16px var(--serif); color: #8a6a1c; }
.hp-votes .ico { width: 17px; height: 17px; }
.hp-timer { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 6px; background: var(--ink); color: var(--card); font: 700 16px/1 var(--serif); font-variant-numeric: tabular-nums; }
.hp-timer .ico { width: 16px; height: 16px; }
.hp-stamp { display: inline-block; padding: .1em .28em .12em .5em; font: 900 22px/1.1 var(--serif); letter-spacing: .25em; white-space: nowrap; color: var(--evil);
  border: .08em solid currentColor; border-radius: .14em; box-shadow: inset 0 0 0 .04em #fffdf6, inset 0 0 0 .08em currentColor; transform: rotate(-7deg); mix-blend-mode: multiply; }
.hp-stamp.brass { color: var(--brass); }
body.art .hp-stamp { -webkit-mask: url(../img/art/stamp-mask.webp) center / cover luminance; mask: url(../img/art/stamp-mask.webp) center / cover luminance; }

/* 會動的插圖：右上角重播鈕，懸停才出現 */
.hp-scene { position: relative; cursor: pointer; }
.hp-replay { position: absolute; right: 8px; top: 8px; z-index: 2; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  color: var(--muted); background: var(--card); border: 1px solid var(--line); opacity: 0; transition: opacity .2s, transform .35s; }
.hp-replay .ico { width: 14px; height: 14px; }
.hp-scene:hover .hp-replay { opacity: 1; }
.hp-scene:active .hp-replay { transform: rotate(-200deg); }
@media (hover: none) { .hp-replay { opacity: .7; } }
.hp-card > .hp-scene { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 120px; padding: 16px; border-radius: 10px; background: var(--paper); }

/* 誰會贏：兩個陣營對面站，角色牌一張張落下，勝利條件蓋章 */
.hp-vs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 16px; }
.hp-team { --c: var(--ink); display: grid; justify-items: center; align-content: start; gap: 16px; padding: 22px 16px 20px; text-align: center; background: #fffdf6;
  border: 2px solid var(--c); border-radius: 16px; box-shadow: inset 0 0 0 4px #fffdf6, inset 0 0 0 5.5px var(--c); }
.hp-team.good { --c: var(--good); }
.hp-team.evil { --c: var(--evil); }
.hp-team-h { display: grid; gap: 4px; }
.hp-team-h b { font: 900 32px/1.1 var(--serif); letter-spacing: .3em; padding-left: .3em; color: var(--c); }
.hp-team-h small { font-size: 12.5px; color: var(--muted); letter-spacing: .12em; }
.hp-toks { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.hp-drop { display: inline-block; }
.hp-toks .token.md { width: 64px; height: 64px; }
.hp-toks .token .token-name { font-size: 11.5px; }
.hp-win { display: grid; justify-items: center; gap: 10px; width: 100%; padding-top: 14px; border-top: 1px dashed var(--line-strong); }
.hp-win-k { font: 700 12px var(--serif); letter-spacing: .3em; padding-left: .3em; color: var(--muted); }
.hp-win .hp-row { font-size: 22px; }
.hp-win .hp-row b { font: 900 18px var(--serif); color: var(--c); letter-spacing: .06em; }
.hp-win .ico { color: var(--c); }
.hp-vs-k { align-self: center; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: var(--ink); color: var(--card);
  font: 900 16px var(--serif); box-shadow: 0 0 0 4px var(--card), 0 0 0 5.5px var(--ink); }
.hp-dots { display: inline-flex; gap: 3px; }
.hp-dots i { display: grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--card); color: var(--muted); }
.hp-dots i.gone { border-color: var(--line-strong); background: var(--line); }
.hp-dots i .ico { width: 9px; height: 9px; color: var(--card); }
.hp-vs.play .hp-drop { animation: hp-drop .4s cubic-bezier(.5,0,.6,1.3) both; animation-delay: calc(.15s + var(--i) * .12s); }
.hp-vs.play .hp-vs-k { animation: hp-slam .4s cubic-bezier(.5,0,.6,1.3) .55s both; }
.hp-vs.play .hp-win .hp-row { animation: hp-press .36s cubic-bezier(.5,0,.7,1) .9s both; }
.hp-vs.play .hp-dots .gone { animation: hp-gone .3s ease-out both; animation-delay: calc(1.3s + var(--i) * .2s); }
@keyframes hp-gone { from { border-color: var(--ink); background: var(--card); transform: scale(1.3); } }

/* 一天怎麼過：四站一條線，亮光一站站走，走完再入夜 */
.hp-cycle { padding: 26px 20px 30px; background: #fffdf6; border: 1.5px solid var(--line); border-radius: 16px; }
.hp-stops { display: flex; align-items: flex-start; }
.hp-stop { --c: var(--ink); flex: 1 1 0; min-width: 0; display: grid; justify-items: center; gap: 8px; text-align: center; }
.hp-stop.night { --c: #4a5272; }
.hp-stop.dawn { --c: var(--brass); }
.hp-stop.talk { --c: var(--good); }
.hp-stop.exec { --c: var(--evil); }
.hp-stop-seal { position: relative; display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; color: var(--c); background: var(--card);
  border: 2px solid currentColor; box-shadow: inset 0 0 0 3.5px var(--card), inset 0 0 0 5px currentColor; }
.hp-stop.night .hp-stop-seal { background: #4a5272; color: #f4eedf; border-color: #4a5272; box-shadow: inset 0 0 0 3.5px #4a5272, inset 0 0 0 5px #f4eedf; }
.hp-stop-seal .ico { width: 48%; height: 48%; }
.hp-stop b { font: 900 19px var(--serif); letter-spacing: .14em; padding-left: .14em; color: var(--c); }
.hp-stop small { max-width: 9.5em; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.hp-link { flex: 0 1 44px; position: relative; margin-top: 34px; border-top: 2px dotted var(--line-strong); }
.hp-link::after { content: ""; position: absolute; right: -2px; top: -6px; border: 5px solid transparent; border-left: 7px solid var(--line-strong); border-right: 0; }
.hp-loop { position: relative; display: flex; justify-content: center; height: 24px; margin: 6px 12.5% 0; border: 2px dotted var(--line-strong); border-top: 0; border-radius: 0 0 18px 18px; }
.hp-loop::before { content: ""; position: absolute; left: -7px; top: -6px; border: 6px solid transparent; border-bottom: 8px solid var(--line-strong); border-top: 0; }
.hp-loop span { position: absolute; bottom: -12px; display: inline-flex; align-items: center; gap: 5px; padding: 0 12px; background: #fffdf6; font: 700 13px var(--serif); color: var(--muted); white-space: nowrap; }
.hp-loop .ico { width: 14px; height: 14px; }
.hp-cycle.play .hp-stop-seal { animation: hp-turn 8s ease-in-out infinite; animation-delay: calc(var(--i) * 2s); }
.hp-cycle.play .hp-stop-seal::after { content: ""; position: absolute; inset: -8px; border: 2px solid var(--c); border-radius: 50%; opacity: 0;
  animation: hp-turn-ring 8s ease-out infinite; animation-delay: calc(var(--i) * 2s); }
@keyframes hp-turn { 0%, 25%, 100% { transform: none; } 6%, 19% { transform: translateY(-5px) scale(1.1); } }
@keyframes hp-turn-ring { 0% { opacity: 0; transform: scale(.85); } 6%, 19% { opacity: 1; transform: none; } 25%, 100% { opacity: 0; transform: scale(1.2); } }

/* 編號步驟：插圖左上角一個墨色圓號 */
.hp-step { position: relative; display: grid; align-content: start; gap: 14px; min-width: 0; }
.hp-no { position: absolute; left: -9px; top: -9px; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--ink); color: var(--card); font: 700 14px var(--serif); box-shadow: 0 0 0 3px #fffdf6; }
.hp-card.step.wide .hp-step { grid-template-columns: minmax(0, 1fr); }

/* 計票時鐘：7 人圍一圈，指針順時針掃，舉著的手一個個按下去，滿票蓋章 */
.hp-card .hp-pic:has(.hp-tally) { padding: 20px 14px; }
.hp-tally { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 28px 40px; width: 100%; }
.hp-clock { position: relative; width: 210px; height: 210px; flex: none; }
.hp-clock::before { content: ""; position: absolute; inset: 24px; border-radius: 50%; border: 1px dashed var(--line-strong); }
.hp-clock::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: var(--brass); }
.hp-hand-line { position: absolute; left: 50%; top: calc(50% - 58px); width: 3px; height: 58px; margin-left: -1.5px; border-radius: 2px; background: var(--brass);
  transform-origin: 50% 100%; rotate: 205.71deg; }
.hp-cs { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: rotate(var(--a)) translateY(-82px) rotate(calc(-1 * var(--a))); }
.hp-cs .token { position: absolute; left: -21px; top: -21px; width: 42px; height: 42px; font-size: 17px; }
.hp .hp-cs.nominee .token { border-color: var(--evil); color: var(--evil); box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--evil); }
.hp-up { position: absolute; left: 10px; top: -34px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #c9962c; color: #fff; }
.hp-up .ico { width: 15px; height: 15px; }
.hp-need { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; }
.hp-need b { font: 700 17px var(--serif); }
.hp-need small { font-size: 12.5px; color: var(--muted); }
.hp-slots { display: flex; gap: 6px; margin-bottom: 6px; }
.hp-slots i { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 2px solid #c9962c; background: #c9962c; color: #fff; }
.hp-slots i .ico { width: 19px; height: 19px; }
.hp-need .hp-stamp { margin-top: 12px; }
.hp-tally.play .hp-hand-line { animation: hp-sweep 2.7s linear .6s both; }
@keyframes hp-sweep { from { rotate: 257.14deg; } to { rotate: 565.71deg; } }
.hp-tally.play .hp-cs .token { animation: hp-tick .4s ease-out both; animation-delay: var(--t); }
@keyframes hp-tick { from { transform: scale(1.18); } }
.hp-tally.play .hp-up { animation: hp-press .3s cubic-bezier(.5,0,.7,1) both; animation-delay: var(--t); }
.hp-tally.play .hp-slots i { animation: hp-fill .3s ease-out both; animation-delay: var(--t); }
@keyframes hp-fill { from { background: transparent; color: transparent; border-color: var(--line-strong); transform: scale(.9); } }
.hp-tally.play .hp-stamp { animation: hp-stamp .32s cubic-bezier(.5,0,.6,1.3) 3.5s both; }

.hp-card.dead { align-items: center; }
.hp-card.dead .hp-row { justify-content: flex-start; }

/* 小心陷阱 */
.hp-poison .token { box-shadow: inset 0 0 0 3px var(--card), inset 0 0 0 4px var(--team), 0 0 0 4px #3d8b3d44; }
.hp-drip { position: absolute; left: calc(50% + 22px); top: calc(50% - 50px); z-index: 1; color: #3d8b3d; }
.hp-drip .ico { width: 30px; height: 30px; }
.hp-poison.play .hp-drip { animation: hp-fall .5s cubic-bezier(.6,0,.8,.6) .2s both; }
@keyframes hp-fall { from { transform: translateY(-46px); opacity: 0; } 30% { opacity: 1; } }
.hp-poison.play .token { animation: hp-wobble .6s ease-in-out .7s both; }
@keyframes hp-wobble { 0% { box-shadow: inset 0 0 0 3px var(--card), inset 0 0 0 4px var(--team); } 25% { rotate: -8deg; } 50% { rotate: 6deg; } 75% { rotate: -3deg; } }
.hp-flip { perspective: 600px; }
.hp-flip-in { position: relative; display: block; width: 84px; height: 84px; transform-style: preserve-3d; transform: rotateY(180deg); }
.hp-flip-in > span { position: absolute; inset: 0; backface-visibility: hidden; }
.hp-flip-in .token { width: 100%; height: 100%; }
.hp-flip-in .f .token { border-style: dashed; }
.hp-flip-in .b { transform: rotateY(180deg); }
.hp-flip.play .hp-flip-in { animation: hp-flip 1.5s cubic-bezier(.5,0,.3,1.25) .3s both; }
@keyframes hp-flip { 0%, 50% { transform: none; } }
.hp-thinks { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 12px; border: 1.5px dashed var(--line-strong); border-radius: 999px; background: var(--card); font-size: 20px; }
.hp-thinks .token { border-style: dashed; opacity: .75; }
.hp-flip.play .hp-thinks { animation: hp-pop .3s cubic-bezier(.5,0,.6,1.3) 1.4s both; }
.hp-reg .token { width: 76px; height: 76px; }
.hp-as { display: grid; justify-items: start; gap: 8px; }
.hp-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.hp-reg.play .hp-tags .tag { animation: hp-pop .3s cubic-bezier(.5,0,.6,1.3) both; animation-delay: calc(.3s + var(--i) * .16s); }
.hp-reg.play > .token { animation: hp-shift .9s ease-in-out .2s both; }
@keyframes hp-shift { 30% { transform: translateX(-4px) rotate(-6deg); } 60% { transform: translateX(3px) rotate(4deg); } }
.hp-who { display: flex; align-items: flex-start; gap: 12px; }
.hp-who .token { margin-top: 2px; }
.hp-who .hp-say > b { font-size: 15px; }

/* 獎勵 */
.hp-card.award { align-items: center; justify-content: flex-start; gap: 12px; text-align: center; }
.hp-card.award.win { border-color: var(--brass); }
.hp-prize { display: grid; grid-template-columns: auto auto; align-items: center; justify-content: center; column-gap: 8px; text-align: left; }
.hp-prize .ico { grid-row: span 2; width: 30px; height: 30px; }
.hp-prize .ico:not(:has([fill="#fffdf3"])) { color: var(--brass); }
.hp-prize b { font: 900 26px/1 var(--serif); }
.hp-prize small { grid-column: 2; font-size: 11.5px; color: var(--muted); }
.hp-card.award > small { font-size: 12px; line-height: 1.55; color: var(--muted); }
.hp-crowns { display: flex; gap: 8px; }
.hp-crowns { flex: none; }
.hp-crowns .crown { width: 40px; height: 30px; }
.hp-sec.in .hp-prize { animation: hp-pop .35s cubic-bezier(.5,0,.6,1.3) .4s both; }
.hp-throw { justify-content: space-between !important; padding: 16px 28px !important; }
.hp-throw .sb.lg { font-size: 30px; }
.hp-egg { position: absolute; left: 76px; right: 76px; top: 50%; height: 0; }
.hp-egg > span { position: absolute; left: 100%; top: -14px; opacity: 0; }
.hp-egg .ico { display: block; width: 28px; height: 28px; }
.hp-target { position: relative; }
.hp-target .token { width: 48px; height: 48px; font-size: 20px; }
.hp-splat { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -31px 0 0 -29px; pointer-events: none; }
.hp-throw.play .hp-egg > span { animation: hp-egg-x .7s linear .3s both; }
.hp-throw.play .hp-egg .ico { animation: hp-egg-y .7s .3s both; }
@keyframes hp-egg-x { from { left: 0; opacity: 1; } 99% { left: 100%; opacity: 1; } to { left: 100%; opacity: 0; } }
@keyframes hp-egg-y { 0% { transform: translateY(0) rotate(0); animation-timing-function: ease-out; } 50% { transform: translateY(-46px) rotate(300deg); animation-timing-function: ease-in; }
  100% { transform: translateY(0) rotate(620deg); } }
.hp-throw.play .hp-splat { animation: hp-splat .25s ease-out 1s both; }
@keyframes hp-splat { from { transform: scale(.2) rotate(-30deg); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } }
.hp-throw.play .hp-target .token { animation: hp-hit .42s ease-out 1s both; }
@keyframes hp-hit { 30% { transform: scale(.86) rotate(-7deg); } 65% { transform: scale(1.04) rotate(3deg); } }
body.art .hp-splat { background: url(../img/art/egg-splat-1.webp) center / contain no-repeat; }
body.art .hp-splat * { visibility: hidden; }

/* 網頁怎麼用：一屏的地圖 + 每處怎麼點 */
.hp-map { display: flex; justify-content: center; }
.hp-screen { display: grid; grid-template-columns: 24% minmax(0, 1fr) 26%; grid-template-rows: 34px minmax(0, 1fr) 46px; grid-template-areas: "top top top" "hud ring side" "dock dock side";
  width: 100%; max-width: 640px; aspect-ratio: 16 / 9; padding: 4px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); box-shadow: 0 10px 24px #2a26221a; }
.hp-screen .z { position: relative; display: grid; place-content: center; justify-items: center; gap: 2px; margin: 3px; padding: 4px 6px; text-align: center;
  border: 1.5px dashed var(--line-strong); border-radius: 7px; background: #fffdf6; }
.hp-screen .z b { font: 700 14px var(--serif); }
.hp-screen .z small { font-size: 11px; line-height: 1.35; color: var(--muted); }
.hp-screen .z small.m { display: none; }
.hp-screen .z-top { grid-area: top; grid-auto-flow: column; align-items: baseline; gap: 10px; }
.hp-screen .z-hud { grid-area: hud; align-self: start; height: 58%; border-style: solid; border-color: var(--ink); }
.hp-screen .z-ring { grid-area: ring; border: 0; background: none; }
.hp-screen .z-side { grid-area: side; }
.hp-screen .z-dock { grid-area: dock; border-style: solid; border-color: var(--ink); }
.hp-mini-ring { position: absolute; left: 50%; top: 50%; width: min(80%, 150px); aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; border: 1.5px dashed #2a262233; }
.hp-mini-ring i { position: absolute; width: 16px; height: 16px; margin: -8px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--card); }
.hp-map.play .z { animation: hp-zone .7s ease-out both; animation-delay: calc(.2s + var(--i) * .28s); }
.hp-map.play .z-ring { animation-name: hp-pop; }
@keyframes hp-zone { from { opacity: 0; transform: scale(.92); } 50% { opacity: 1; border-color: var(--brass); background: #fff3cf; } }
.hp-pick .hp-row { gap: 12px; }
.hp-pick .token { width: 46px; height: 46px; font-size: 19px; }
.hp .hp-pick .token.pick { border-color: var(--brass); color: var(--ink); box-shadow: 0 0 0 3px #fff3cf, 0 0 0 5px #e9c46a; }
.hp-pick.play .token { animation: beckon 1.1s ease-in-out; }
.hp-pick.play .token.pick { animation: beckon 1.1s ease-in-out, hp-picked .3s cubic-bezier(.5,0,.6,1.3) 1.2s both; }
@keyframes hp-picked { from { border-color: var(--ink); box-shadow: none; transform: scale(1.3); } }
.hp-pick.play .btn { animation: hp-pop .3s ease-out 1.5s both; }
.hp-info { overflow: hidden; }
.hp-inforow { display: inline-flex; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fffdf6; }
.hp-inforow .frm { font-size: 20px; justify-content: center; }
.hp-info.play .hp-inforow { animation: arrive .5s cubic-bezier(.2,.9,.3,1.1) .2s both; }
.hp-info.play .hp-inforow .sb { animation: hp-lit .8s ease-in-out .9s 2; }
@keyframes hp-lit { 50% { background: #fff3cf; border-color: var(--brass); box-shadow: 0 0 0 3px #e9c46a; } }
.hp-menu { position: static; width: 100%; max-width: 240px; min-width: 0; animation: none; box-shadow: 0 8px 20px #2a26221c; font-size: 13.5px; text-align: left; }
.hp-menu button { padding: 5px 10px; }
.hp-skip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px 4px 10px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--card);
  font: 700 13px var(--serif); letter-spacing: .1em; }
.hp-skip .ico { width: 13px; height: 13px; }

/* 說書人：開局四步 */
.hp-chain { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.hp-chain > .hp-step { padding: 18px 20px; background: #fffdf6; border: 1.5px solid var(--line); border-radius: 12px; }
.hp-chain .hp-no { left: -10px; top: -10px; box-shadow: 0 0 0 3px var(--card); }
.hp-chain .chips { justify-content: center; margin: 0; font-size: 13px; }
.hp-rules { display: grid; gap: 6px; width: 100%; max-width: 220px; }
.hp-rules .setup-role .token.sm { width: 30px; height: 30px; }
.hp-step .hp-pic:has(.hp-rules) { padding: 14px 20px; }
.hp-rules.play .setup-role { animation: hp-press .32s cubic-bezier(.5,0,.7,1) both; animation-delay: calc(.2s + var(--i) * .45s); }

/* 說書人：夜晚 */
.hp-wake { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 20px 14px; border-radius: 16px; background: #1b2132; }
.hp-wake .hp-replay { background: #2a3146; border-color: #4a5272; color: #c9cde0; }
.hp-w { position: relative; }
.hp-w .token { width: 50px; height: 50px; }
.hp-w.done .token { opacity: .45; filter: grayscale(.6); }
.hp-w .hp-ok { position: absolute; right: -4px; bottom: -4px; width: 19px; height: 19px; padding: 3px; border-radius: 50%; background: var(--good); color: #fff; }
.hp-w.cur .token { box-shadow: inset 0 0 0 2px var(--card), inset 0 0 0 3px var(--team), 0 0 0 3px #1b2132, 0 0 0 5.5px var(--brass); }
.hp-w.cur::after { content: ""; position: absolute; inset: -8px; border: 2px solid var(--brass); border-radius: 50%; pointer-events: none; animation: acting 1.8s ease-out infinite; }
.hp-wake.play .hp-w.done .token { animation: hp-wake .8s ease-out both; animation-delay: calc(.3s + var(--i) * .6s); }
@keyframes hp-wake { 0% { opacity: 1; filter: none; } 35%, 65% { opacity: 1; filter: none; transform: scale(1.14);
  box-shadow: inset 0 0 0 2px var(--card), inset 0 0 0 3px var(--team), 0 0 0 3px #1b2132, 0 0 0 5.5px var(--brass); } }
.hp-wake.play .hp-ok { animation: hp-pop .3s ease-out both; animation-delay: calc(.95s + var(--i) * .6s); }
.hp-wake.play .hp-w.cur .token { animation: hp-pop .35s cubic-bezier(.5,0,.6,1.3) 2.1s both; }
.hp-card.give { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: center; gap: 24px; }
.hp-ic { display: grid; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--card); font-size: 20px; }
.hp-ic-h { padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 22px; }
.hp-ic-h .rn b { font-size: 16px; }
.hp-ic-r { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.hp-ic-k { flex: none; display: inline-flex; align-items: center; gap: 4px; width: 5.6em; font: 700 12.5px var(--serif); color: var(--muted); }
.hp-ic-k .ico { width: 14px; height: 14px; }
.hp-ic-r.see { padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.hp-ic .opt-row { font-size: 18px; }
.hp-pic .opt-row { justify-content: center; }
.hp-tagrow { justify-content: center; gap: 6px; max-width: none; margin: 0; }
.hp-tagrow .tag { height: auto; padding: 3px 10px; font-size: 12.5px; }
.hp-card.dawn { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 16px 20px; }
.hp-card.dawn > .hp-pic { flex: 1 1 280px; flex-direction: row; flex-wrap: wrap; }
.hp-card.dawn .btn { flex: none; }
.hp-card.dawn > .hp-say { flex: 1 1 100%; }

/* 說書人：白天四步，左邊一條虛線串起來 */
.hp-flow { position: relative; display: grid; margin: 0; padding: 0; list-style: none; counter-reset: f; }
.hp-flow::before { content: ""; position: absolute; left: 14px; top: 30px; bottom: 30px; border-left: 2px dotted var(--line-strong); }
.hp-flow li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 24px; padding: 12px 0 12px 52px; counter-increment: f; }
.hp-flow li::before { content: counter(f); position: absolute; left: 0; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink); color: var(--card); font: 700 14px var(--serif); box-shadow: 0 0 0 4px var(--card); }
.hp-flow .hp-pic { flex-direction: row; flex-wrap: wrap; min-height: 64px; }
.hp-sec.in .hp-flow li { animation: hp-rise .5s cubic-bezier(.2,.8,.3,1.1) both; }
.hp-sec.in .hp-flow li:nth-child(2) { animation-delay: .12s; }
.hp-sec.in .hp-flow li:nth-child(3) { animation-delay: .24s; }
.hp-sec.in .hp-flow li:nth-child(4) { animation-delay: .36s; }

/* 說書人：系統自動處理的角色，蓋一個「自動」章 */
.hp-auto { padding: 24px 18px 18px; background: #fffdf6; border: 1.5px solid var(--line); border-radius: 16px; }
.hp-tokgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 16px 8px; }
.hp-tk { display: grid; justify-items: center; gap: 6px; text-align: center; }
.hp-tk .token { width: 54px; height: 54px; }
.hp-tk small { font: 700 12px/1.35 var(--serif); }
.hp-icotok { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; border: 1.5px dashed var(--line-strong); color: var(--ink); }
.hp-icotok .ico { width: 26px; height: 26px; }
.hp-auto > .hp-stamp { position: absolute; right: 18px; top: -18px; font-size: 24px; background: #fffdf6; }
.hp-auto.play .hp-tk { animation: hp-drop .35s cubic-bezier(.5,0,.6,1.3) both; animation-delay: calc(.1s + var(--i) * .06s); }
.hp-auto.play > .hp-stamp { animation: hp-stamp .32s cubic-bezier(.5,0,.6,1.3) 1.1s both; }

/* 說書人：糾錯菜單、代入視角、流程日誌 */
.hp-split { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.hp-split > .hp-menu { max-width: none; }
.hp-stack { display: grid; gap: 12px; }
.hp-peek { display: flex; justify-content: center; padding: 22px 14px; border-radius: 16px; background: var(--paper); border: 1.5px solid var(--line); }
.hp-peek .peekbar { position: static; transform: none; flex-wrap: wrap; justify-content: center; white-space: normal; }
.hp-logs { display: grid; gap: 6px; }
.hp-logs .log-row { font-size: 18px; }

/* 手機：一欄，彈窗佔滿屏幕 */
@media (max-width: 860px) {
  .backdrop:has(.modal.help) { padding: 0; grid-template-columns: minmax(0, 1fr); }
  .modal.help { width: 100%; min-width: 0; height: 100%; height: 100dvh; border-radius: 0; border-width: 0; }
  body.art .modal.help { border-width: 14px; border-image-width: 14px; }
  .hp-title:has(.hp-tabs) > b { display: none; }
  .hp-nav { justify-content: flex-start; gap: 6px; padding: 8px 12px; }
  .hp-nav button { padding: 4px 11px 4px 8px; }
  .hp-page { padding: 24px 16px 16px; }
  .hp-h h3 { font-size: 22px; }
  .hp-seal { width: 40px; height: 40px; }
  .hp-div { margin: 40px 0 32px; }
  .hp-grid.two, .hp-grid.three, .hp-chain, .hp-split, .hp-card.give { grid-template-columns: minmax(0, 1fr); }
  .hp-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hp-vs { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hp-vs-k { justify-self: center; margin: -12px 0; z-index: 1; }
  .hp-card { padding: 16px; }
  .hp-cycle { padding: 20px 8px 28px; }
  .hp-stop-seal { width: 50px; height: 50px; }
  .hp-stop b { font-size: 16px; }
  .hp-stop small { font-size: 11px; }
  .hp-link { flex-basis: 14px; margin-top: 25px; }
  .hp-link::after { display: none; }
  .hp-split > .hp-menu { max-width: 280px; justify-self: center; }
  .hp-flow li { grid-template-columns: minmax(0, 1fr); gap: 10px; padding-left: 44px; }
  .hp-flow li::before { top: 26px; }
  .hp-screen { grid-template-columns: minmax(0, 1fr); grid-template-rows: 40px 54px minmax(0, 1fr) 46px; grid-template-areas: "top" "hud" "ring" "dock";
    max-width: 230px; aspect-ratio: 9 / 15; margin: 0 auto; }
  .hp-screen .z-hud { height: auto; align-self: stretch; }
  .hp-screen .z-side, .hp-screen .z small.d { display: none; }
  .hp-screen .z small.m { display: block; }
  .hp-screen .z-top { grid-auto-flow: row; gap: 0; }
  .hp-throw { padding: 16px 20px !important; }
  .hp-egg { left: 66px; right: 64px; }
}
