/* 第二版介面樣式（世界地圖 / 新模式 / 圖鑑 / 成就 / 設定）。沿用 style.css 的色彩變數。 */
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
svg.icon { width: 1.25em; height: 1.25em; vertical-align: -0.22em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.icon.on { fill: var(--gold); color: var(--gold); stroke: #8a5a00; }
svg.icon.off { stroke: #b8a898; }
.ic { display: inline-flex; align-items: center; }
.btn .ic { margin-right: 8px; }
.hint { color: var(--ink-soft); margin: 4px 0; font-size: .95rem; }
.chip-total { font-weight: 800; background: #fff; border: 3px solid var(--ink); border-radius: 999px; padding: 2px 12px; font-size: .9rem; white-space: nowrap; }
button:disabled, button[aria-disabled="true"].btn { opacity: .55; cursor: not-allowed; }
button:focus-visible, input:focus-visible, textarea:focus-visible, .lv-node:focus-visible { outline: 4px solid #2a6df4; outline-offset: 3px; }
.btn, .icon-btn, .seg, .switch { min-height: 44px; }
.icon-btn { min-width: 46px; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn svg.icon { width: 1.5rem; height: 1.5rem; }

/* 存檔提示列 */
.save-notice { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; padding: 8px 12px; background: #fff3c4; border-bottom: 3px solid var(--ink); font-weight: 700; }
.save-notice.error { background: #ffd9d4; }
.save-notice.info { background: #dff5e5; }

/* 主選單 */
.menu-hero .logo { width: min(40vw, 170px); height: auto; margin: 0 auto; animation: bob 3.2s ease-in-out infinite; }
.menu-hero .logo svg { width: 100%; height: auto; display: block; }
.menu-rank { margin: 4px 0 0; font-weight: 800; color: var(--ink-soft); }
#screen-menu { padding-top: 56px; }
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; width: min(100%, 560px); }
.menu-grid .btn.big { width: 100%; padding: 12px 10px; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; }
.menu-grid #btn-start { grid-column: 1 / -1; font-size: 1.35rem; }
@media (max-width: 380px) { .menu-grid { grid-template-columns: 1fr; } }

/* 遊戲模式 */
.hub-list { display: grid; gap: 14px; }
.hub-mode { background: rgba(255,255,255,.92); border: 3px solid var(--ink); border-radius: 22px; padding: 14px; box-shadow: var(--shadow); }
.hub-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.hub-head svg.icon { width: 2.2rem; height: 2.2rem; color: var(--primary-d); }
.hub-head h3 { margin: 0; font-size: 1.25rem; }
.hub-head p { margin: 0; }
.preset-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.preset { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px 12px; border: 3px solid var(--ink); border-radius: 16px; background: #fff; box-shadow: 0 4px 0 var(--ink); min-height: 88px; }
.preset:hover { background: #fff7e8; }
.preset:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.preset-name { font-weight: 800; font-size: 1.05rem; }
.preset-desc { font-size: .88rem; color: var(--ink-soft); flex: 1; }
.preset-best { font-size: .85rem; font-weight: 700; color: var(--primary-d); }
.hub-classic { margin-top: 4px; }

/* 世界地圖 */
.map-body { display: grid; gap: 18px; }
.region { background: rgba(255,255,255,.93); border: 3px solid var(--ink); border-radius: 24px; padding: 12px; box-shadow: var(--shadow); border-top: 10px solid var(--rc, #7fcf5a); }
.region-banner { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.region-art { width: 150px; flex: none; border-radius: 14px; overflow: hidden; border: 3px solid var(--ink); }
.region-art svg { width: 100%; height: auto; display: block; }
.region-info { flex: 1; min-width: 200px; }
.region-info h3 { margin: 0; font-size: 1.3rem; }
.region-info p { margin: 2px 0; }
.region-prog { font-weight: 800; }
.region-lock { color: #9a3a00; font-weight: 700; background: #fff0d6; border-radius: 10px; padding: 4px 8px; }
.level-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.lv-node { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 3px solid var(--ink); border-radius: 16px; background: #fff; box-shadow: 0 4px 0 var(--ink); min-height: 120px; text-align: center; position: relative; }
.lv-node.completed { background: #e8f9ee; }
.lv-node.available { background: #fff6dd; animation: availPulse 2.4s ease-in-out infinite; }
.lv-node.locked { background: #ececec; color: #6a6258; border-style: dashed; box-shadow: 0 3px 0 #9a9288; }
.lv-node.boss { border-width: 4px; }
.lv-node.boss::after { content: "魔王"; position: absolute; top: -10px; right: -4px; background: var(--bad); color: #fff; font-size: .7rem; font-weight: 800; padding: 1px 6px; border-radius: 999px; border: 2px solid var(--ink); }
.lv-top { display: flex; align-items: center; gap: 4px; font-weight: 900; }
.lv-num { background: var(--ink); color: #fff; border-radius: 999px; min-width: 24px; height: 24px; line-height: 24px; font-size: .85rem; }
.lv-name { font-weight: 800; font-size: .85rem; line-height: 1.2; }
.lv-mode { font-size: .72rem; color: var(--ink-soft); }
.lv-state { font-size: .72rem; font-weight: 800; }
.lv-node .stars-row svg.icon { width: 1rem; height: 1rem; }
@keyframes availPulse { 50% { box-shadow: 0 4px 0 var(--ink), 0 0 0 5px rgba(255,180,0,.45); } }
@media (max-width: 640px) { .level-grid { grid-template-columns: repeat(2, 1fr); } .region-art { width: 100%; } .lv-node { min-height: 104px; } }
@media (min-width: 641px) and (max-width: 900px) { .level-grid { grid-template-columns: repeat(5, 1fr); } .lv-name { font-size: .78rem; } }

/* 關卡資訊 */
.level-body { display: grid; gap: 10px; }
.lv-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-weight: 800; }
.lv-head svg.icon { width: 1.8rem; height: 1.8rem; color: var(--primary-d); }
.lv-diff { background: #fff3c4; border: 2px solid var(--ink); border-radius: 999px; padding: 0 10px; }
.lv-goal { margin: 0; font-size: 1.1rem; }
.explain-box, .unlock-box { background: #fff7e8; border: 2px solid var(--line); border-radius: 14px; padding: 8px 12px; text-align: left; }
.explain-box h3, .unlock-box h3 { margin: 0 0 4px; font-size: 1rem; }
.star-list { list-style: none; padding: 0; margin: 0; }
.star-list li { display: flex; gap: 6px; align-items: flex-start; padding: 2px 0; }
.star-list li.no { color: #8a4a3a; }
.star-list li.ok svg.icon { color: var(--good); }
.star-list li.no svg.icon { color: var(--bad); }
.lv-record { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-weight: 700; }
.lock-reason { background: #fff0d6; border: 2px solid #e0a040; border-radius: 12px; padding: 8px 12px; font-weight: 700; margin: 0; }
.unlocks { display: flex; flex-wrap: wrap; gap: 6px; }
.unlock-chip { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 2px 10px 2px 4px; font-weight: 700; font-size: .9rem; }
.chip-art { width: 32px; height: 32px; display: inline-flex; }
.chip-art svg { width: 100%; height: 100%; }

/* 遊戲畫面 */
.play { padding: 10px 12px 18px; gap: 8px; position: relative; }
.hud2 { background: rgba(255,255,255,.94); border: 3px solid var(--ink); border-radius: 20px; padding: 8px 10px; box-shadow: var(--shadow); display: grid; gap: 6px; }
.hud2-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hud2-title { font-weight: 800; font-size: 1.05rem; text-align: center; flex: 1; }
.hud2-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 6px; }
.hud2-stats .stat.hot .stat-val { color: var(--primary-d); animation: pulse .4s; }
.hud2-bar { display: grid; grid-template-columns: 42px 1fr 52px; align-items: center; gap: 6px; font-size: .8rem; }
.hud2-bar.low .bar-fill.timer { background: var(--bad); }
.hud2-bar.low .bar-val { color: var(--bad); font-weight: 900; }
.play-stage { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0; min-height: 0; width: 100%; max-width: 820px; margin: 0 auto; }
.play-stage .prompt { margin: 0; }

/* 翻牌 */
.fboard { display: grid; gap: var(--fc-gap, 6px); margin: 0 auto; }
.fcard { position: relative; padding: 0; border: 0; background: none; aspect-ratio: 1 / 1.12; perspective: 600px; min-width: 0; min-height: 0; }
.fc-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .4s cubic-bezier(.4,.2,.2,1.2); border-radius: 12px; }
.fcard.flipped .fc-inner { transform: rotateY(180deg); }
.fc-face { position: absolute; inset: 0; border-radius: 12px; border: 3px solid var(--ink); backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; box-shadow: 0 3px 0 rgba(0,0,0,.2); }
.fboard[data-size="xs"] .fc-face { border-width: 2px; border-radius: 8px; }
.fc-back { background: var(--cb-img, none) center / cover, linear-gradient(135deg, #ff9d5c, #ffb98a); color: #fff; }
.fc-back svg.icon { width: 45%; height: 45%; }
.fc-front { background: #fff; transform: rotateY(180deg); padding: 2px; }
.fc-art { width: 82%; flex: 1; min-height: 0; display: block; }
.fc-art svg { width: 100%; height: 100%; display: block; }
.fc-name { font-size: clamp(.6rem, 1.6vw, .85rem); font-weight: 800; line-height: 1.1; white-space: nowrap; }
.fboard[data-size="xs"] .fc-name { display: none; }
.fboard[data-size="s"] .fc-name { font-size: .7rem; }
.fc-badge { position: absolute; top: 1px; right: 1px; width: 22%; min-width: 14px; line-height: 0; color: #b57a00; }
.fc-badge svg.icon { width: 100%; height: auto; }
.fc-mark { position: absolute; bottom: 1px; left: 1px; width: 26%; min-width: 14px; line-height: 0; border-radius: 50%; background: #fff; }
.fc-mark svg.icon { width: 100%; height: auto; stroke-width: 3; }
.fc-mark[data-k="check"] svg { color: var(--good); }
.fc-mark[data-k="cross"] svg { color: var(--bad); }
.fcard.matched .fc-face { border-color: var(--good); }
.fcard.matched .fc-front { background: #e8f9ee; }
.fcard.miss .fc-face { border-color: var(--bad); }
.fcard.miss { animation: shake .4s; }
.fboard:not(.locked) .fcard:not(.flipped):hover .fc-back { filter: brightness(1.08); }
.fcard:focus-visible { outline: 4px solid #2a6df4; outline-offset: 2px; z-index: 2; }

/* 快問快答 */
.q2-card { width: 100%; background: #fff; border: 4px solid var(--ink); border-radius: 24px; padding: 14px 16px; box-shadow: 0 6px 0 rgba(0,0,0,.15); text-align: center; animation: popIn .3s cubic-bezier(.3,1.5,.5,1); }
.q2-meta { display: flex; justify-content: space-between; font-size: .8rem; font-weight: 800; color: var(--ink-soft); }
.q2-prompt { margin: 8px 0 4px; font-size: clamp(1.25rem, 4.5vw, 1.8rem); font-weight: 900; line-height: 1.4; }
.q2-opts { display: grid; gap: 10px; width: 100%; grid-template-columns: 1fr 1fr; }
.q2-opts.kind-choice4 { grid-template-columns: 1fr 1fr; }
.q2-opt { position: relative; min-height: 76px; border: 4px solid var(--ink); border-radius: 18px; font-size: 1.25rem; font-weight: 900; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px 8px 32px; box-shadow: 0 5px 0 var(--ink); background: #fff; transition: transform .08s; }
.q2-opt.side-black { background: #2b2b33; color: #fff; }
.q2-opt.side-white { background: #fff; color: #2b2b33; }
.q2-opt:hover { transform: translateY(-2px); }
.q2-opt:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.q2-token svg { width: 1.4rem; height: 1.4rem; }
.q2-key { position: absolute; left: 8px; top: 8px; width: 20px; height: 20px; line-height: 20px; font-size: .75rem; border-radius: 6px; background: var(--ink); color: #fff; border: 1px solid #fff; }
.q2-opt.side-black .q2-key { background: #fff; color: #2b2b33; }
.q2-mark { position: absolute; right: 8px; top: 8px; line-height: 0; }
.q2-mark svg.icon { width: 1.6rem; height: 1.6rem; stroke-width: 3.2; background: #fff; border-radius: 50%; padding: 2px; }
.q2-mark[data-k="check"] svg { color: var(--good); }
.q2-mark[data-k="cross"] svg { color: var(--bad); }
.q2-opt.correct { box-shadow: 0 0 0 5px var(--good), 0 5px 0 var(--ink); }
.q2-opt.wrong { box-shadow: 0 0 0 5px var(--bad), 0 5px 0 var(--ink); animation: shake .4s; text-decoration: line-through; }
.q2-opt.dim { opacity: .55; }
.q2-expl { width: 100%; background: #fff7e8; border: 3px solid var(--ink); border-radius: 16px; padding: 10px 14px; text-align: left; }
.q2-verdict { display: flex; align-items: center; gap: 6px; font-weight: 900; font-size: 1.15rem; margin: 0 0 4px; }
.q2-verdict.good svg { color: var(--good); } .q2-verdict.bad svg { color: var(--bad); }
.q2-text-expl { margin: 0; }
@media (max-width: 480px) { .q2-opts.kind-choice4 { grid-template-columns: 1fr; } .q2-opt { min-height: 64px; } }

/* 廚房 */
.k-h { margin: 4px 0 0; font-size: 1rem; align-self: flex-start; }
.k-customers { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; width: 100%; min-height: 40px; }
.k-cust { background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 8px 10px; display: grid; gap: 4px; box-shadow: 0 4px 0 rgba(0,0,0,.15); }
.k-cust.low { border-color: var(--bad); background: #fff3f1; }
.k-cname { font-weight: 900; }
.k-order { display: flex; flex-wrap: wrap; gap: 4px; }
.k-oi { display: inline-flex; align-items: center; gap: 2px; background: #fff7e8; border-radius: 999px; padding: 0 8px 0 2px; font-size: .85rem; font-weight: 700; }
.ing-art { width: 48px; height: 48px; display: inline-block; flex: none; }
.ing-art.sm { width: 30px; height: 30px; }
.ing-art svg { width: 100%; height: 100%; display: block; }
.k-pat { height: 10px; border: 2px solid var(--ink); border-radius: 999px; background: #eadfcf; overflow: hidden; }
.k-pat-fill { height: 100%; background: linear-gradient(90deg, #4cc36f, #ffd23f); }
.k-cust.low .k-pat-fill { background: var(--bad); }
.k-warn { font-size: .8rem; font-weight: 800; color: var(--bad); min-height: 1em; }
.k-plate { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; width: 100%; min-height: 56px; background: rgba(255,255,255,.85); border: 3px dashed var(--ink); border-radius: 16px; padding: 8px; }
.k-pi { display: inline-flex; align-items: center; gap: 4px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; padding: 2px 10px 2px 4px; font-weight: 800; min-height: 44px; }
.k-cap { margin-left: auto; font-weight: 800; color: var(--ink-soft); }
.k-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; width: 100%; }
.k-ing { position: relative; display: flex; flex-direction: column; align-items: center; border: 3px solid var(--ink); border-radius: 14px; background: #fff; padding: 4px 2px; box-shadow: 0 3px 0 var(--ink); min-height: 84px; }
.k-ing:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.k-name { font-size: .8rem; font-weight: 800; }
.k-count { position: absolute; top: 2px; right: 4px; font-weight: 900; color: var(--primary-d); font-size: .85rem; }

/* 記憶食譜 */
.r-card { width: 100%; background: #fff; border: 4px solid var(--ink); border-radius: 22px; padding: 12px 16px; box-shadow: 0 6px 0 rgba(0,0,0,.15); }
.r-title { margin: 0 0 6px; text-align: center; font-size: 1.4rem; }
.r-items { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; }
.r-item { display: flex; align-items: center; gap: 6px; background: #fff7e8; border-radius: 12px; padding: 2px 8px 2px 2px; }
.r-iname { font-weight: 800; }
.r-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; width: 100%; }
.r-optwrap { position: relative; }
.r-opt { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; border: 3px solid var(--ink); border-radius: 14px; background: #fff; padding: 4px; box-shadow: 0 3px 0 var(--ink); min-height: 92px; }
.r-opt .ing-art { width: 54px; height: 54px; }
.r-oname { font-weight: 800; font-size: .85rem; }
.r-opt.selected { background: #fff0c2; box-shadow: 0 0 0 4px var(--primary), 0 3px 0 var(--ink); }
.r-badge { position: absolute; top: 2px; right: 4px; min-width: 24px; text-align: center; background: var(--primary); color: #fff; border-radius: 999px; font-weight: 900; font-size: .85rem; padding: 0 4px; }
.r-badge:empty { display: none; }
.r-minus { position: absolute; bottom: 2px; right: 2px; width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--ink); background: #fff; font-size: 1.4rem; font-weight: 900; line-height: 1; padding: 0; }
.r-sel { font-weight: 800; margin: 0; }
.r-mine { width: 100%; }
.r-mylist { list-style: none; padding: 0; margin: 0; }
.r-mylist li { display: flex; gap: 6px; align-items: center; font-weight: 700; }
.r-mylist li.ok svg { color: var(--good); } .r-mylist li.no svg { color: var(--bad); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; }

/* 結果 */
#screen-result2 { justify-content: center; align-items: center; }
.result2 { width: min(100%, 620px); text-align: center; display: grid; gap: 10px; }
.r2-head h2 { margin: 0; font-size: 2rem; }
.r2-det { width: 120px; margin: 0 auto; }
.r2-det svg { width: 100%; height: auto; }
.stars-row { display: inline-flex; gap: 4px; }
.stars-row svg.icon { width: 2rem; height: 2rem; }
.stars-row.big svg.icon { width: 3rem; height: 3rem; }
#r2-stars { justify-content: center; }
.r2-flags { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.flag { background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 0 12px; font-weight: 800; }
.flag.good { background: #dff5e5; }
.result2 .res-actions { margin-top: 6px; }

/* 圖鑑 / 食譜 / 成就 */
.filters { display: grid; gap: 8px; }
.search input, textarea, input[type="search"] { width: 100%; min-height: 44px; border: 3px solid var(--ink); border-radius: 14px; padding: 8px 12px; font: inherit; background: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.seg.chip { padding: 4px 14px; }
.seg.chip[aria-pressed="true"] { background: var(--accent); color: #fff; box-shadow: 0 3px 0 #1f7a38; }
.codex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.codex-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 3px solid var(--ink); border-radius: 16px; background: #fff; box-shadow: 0 4px 0 var(--ink); min-height: 140px; }
.codex-card.locked { background: #ececec; border-style: dashed; color: #5c554d; }
.codex-card .ing-art { width: 72px; height: 72px; }
.locked-art { display: inline-flex; align-items: center; justify-content: center; color: #8a8278; }
.locked-art svg.icon { width: 2.2rem; height: 2.2rem; }
.cx-name { font-weight: 800; }
.cx-cat { font-size: .78rem; color: var(--ink-soft); }
.detail-art { width: 160px; height: 160px; margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.detail-art svg.ing-svg { width: 100%; height: 100%; }
#codex-detail .dialog { text-align: center; width: min(100%, 420px); }
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.recipe-card { background: #fff; border: 3px solid var(--ink); border-radius: 18px; padding: 12px; box-shadow: var(--shadow); display: grid; gap: 4px; align-content: start; }
.recipe-card.locked { background: #ececec; border-style: dashed; }
.recipe-card h3 { margin: 0; }
.r-items.small { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.ach-list { display: grid; gap: 10px; }
.ach-card { display: flex; gap: 10px; align-items: center; background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 10px 12px; }
.ach-card.locked { background: #ececec; border-style: dashed; }
.ach-card.claimable { background: #fff6dd; box-shadow: 0 0 0 4px rgba(255,180,0,.5); }
.ach-card.claimed { background: #e8f9ee; }
.ach-ic svg.icon { width: 2rem; height: 2rem; }
.ach-card.claimable .ach-ic svg, .ach-card.claimed .ach-ic svg { color: #b57a00; }
.ach-txt { flex: 1; } .ach-txt h3 { margin: 0; font-size: 1.05rem; } .ach-txt p { margin: 2px 0; }

/* 設定 */
.screen > .panel + .panel { margin-top: 0; }
.setting label { font-weight: 700; }
input[type="range"] { width: min(55%, 240px); min-height: 44px; accent-color: var(--primary); }
.explain { background: #fff7e8; border-radius: 14px; padding: 4px 12px; }
.save-meta { font-size: .85rem; color: var(--ink-soft); word-break: break-all; }
.msg { font-weight: 700; padding: 6px 10px; border-radius: 10px; margin: 6px 0; }
.msg.good { background: #dff5e5; } .msg.bad { background: #ffd9d4; }
.file-btn { display: inline-flex; align-items: center; cursor: pointer; }
.file-btn:focus-within { outline: 4px solid #2a6df4; }
textarea { resize: vertical; font-size: .9rem; }
.panel h4 { margin: 14px 0 4px; }

/* 頁面切換動畫與減少動態 */
.screen { animation: screenIn .3s ease both; }
.pop.pop-anchored { position: absolute; left: 50%; top: 100%; z-index: 3; font-size: 1.3rem; line-height: 1.2; white-space: nowrap; padding: 2px 14px; background: #fff; border: 3px solid currentColor; border-radius: 999px; text-shadow: none; pointer-events: none; animation: popStay .95s ease-out forwards; }
.q2-opt.wrong, .q2-opt.correct { z-index: 2; }
@media (max-width: 480px) { .pop.pop-anchored { font-size: 1.05rem; padding: 1px 10px; } }
@keyframes popStay { from { transform: translate(-50%, -35%) scale(.6); opacity: 0; } 18% { transform: translate(-50%, -35%) scale(1.12); opacity: 1; } 70% { transform: translate(-50%, -35%) scale(1); opacity: 1; } to { transform: translate(-50%, -35%) scale(1); opacity: 0; } }
#hud2-timer-row.frozen .bar-fill, #hud2-timer-row.frozen #hud2-timer-fill { filter: grayscale(.6); }
@media (prefers-reduced-motion: reduce) {
  .pop.pop-anchored { animation: none; transform: translate(-50%, -35%); }

  .lv-node.available, .menu-hero .logo, .q2-card, .fcard.miss, .q2-opt.wrong { animation: none !important; }
  .fc-inner { transition-duration: .01ms; }
  .screen { animation: none; }
}
.reduce-motion .lv-node.available, .reduce-motion .menu-hero .logo { animation: none !important; }
@media (min-width: 900px) { .play-stage { max-width: 860px; } }

/* ===== v3：今日 / 簽到 / 任務 / 每日挑戰 / 商店 / 道具 / 外觀 ===== */
.today-panel { width: min(100%, 560px); margin: 4px auto 12px; padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; }
.tp-head { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; }
.tp-head .ic svg { width: 1.3em; height: 1.3em; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: .8rem; font-weight: 800; border: 2px solid #fff; box-shadow: 0 0 0 2px var(--bad); }
.menu-grid .btn { position: relative; }
.menu-grid .btn .badge { position: absolute; top: -8px; right: -6px; }
.tp-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.tp-row { display: flex; align-items: center; gap: 8px; font-size: .95rem; }
.tp-row.done { color: var(--ink-soft); }
.tp-row.done .ic { color: var(--good); }
.tp-row .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); margin-left: auto; flex: none; }
.tp-welcome, .tp-note { margin: 0; font-size: .92rem; background: #fff7e0; border: 2px dashed var(--line); border-radius: 12px; padding: 6px 10px; }
.today-panel .btn { align-self: flex-start; }
.daily-body, .shop-body { width: min(100%, 760px); margin: 0 auto; display: grid; gap: 14px; }
.daily-body h3, .shop-body h3 { margin: 0 0 8px; }
.hint.small, p.small { font-size: .85rem; }
.ck-strip { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.ck-day { border: 3px solid var(--ink); border-radius: 12px; background: #fff; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .78rem; text-align: center; position: relative; min-height: 86px; }
.ck-day .ck-n { font-weight: 800; }
.ck-day .ck-ic svg { width: 22px; height: 22px; color: var(--gold); }
.ck-day.big { background: #fff1c9; }
.ck-day.big .ck-ic svg { width: 28px; height: 28px; color: var(--primary); }
.ck-day.today { outline: 4px solid var(--primary); outline-offset: 1px; background: #ffe7d6; }
.ck-day.got { background: #dff5e5; color: var(--ink-soft); }
.ck-day.got > .ic { position: absolute; top: 2px; right: 2px; color: var(--good); }
.ck-day.got > .ic svg { width: 16px; height: 16px; }
@media (max-width: 520px) { .ck-strip { grid-template-columns: repeat(4, 1fr); } }
.task-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.task { display: flex; align-items: center; gap: 10px; border: 2px solid var(--line); border-radius: 14px; padding: 8px 10px; background: #fff; }
.task.ready { border-color: var(--good); background: #f0fbf3; }
.task.claimed { opacity: .7; }
.task-txt { flex: 1; display: grid; gap: 4px; }
.task-name { font-weight: 700; }
.task-prog { font-size: .82rem; color: var(--ink-soft); }
.task .bar { height: 10px; }
.task-list.extra .task { border-style: dashed; }
.task-bonus { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #fff7e0; border: 2px solid var(--line); border-radius: 14px; padding: 8px 10px; }
.task-bonus .ic svg { color: var(--primary); width: 1.4em; height: 1.4em; }
.task-bonus > span:nth-child(2) { flex: 1; font-weight: 700; }
.tag { border: 2px solid var(--ink); border-radius: 999px; padding: 0 10px; font-weight: 800; font-size: .85rem; background: #fff; white-space: nowrap; }
.tag.good { background: #dff5e5; }
.run-stages, .run-progress { margin: 0 0 8px; padding-left: 0; list-style: none; display: grid; gap: 6px; }
.run-stages li, .run-progress li { display: flex; align-items: center; gap: 8px; }
.run-progress li.done { color: var(--good); font-weight: 700; }
.run-progress li.next { font-weight: 800; }
.run-body { width: min(100%, 620px); margin: 0 auto; display: grid; gap: 10px; text-align: center; justify-items: center; }
.run-body .run-progress { text-align: left; }
.run-card { display: grid; gap: 8px; justify-items: center; }
.run-card .r2-det { width: 120px; }
/* 道具列 */
.play-items { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.item-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 4px 10px; border: 3px solid var(--ink); border-radius: 999px; background: #fff; font: inherit; font-weight: 800; font-size: .9rem; cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,.15); color: var(--ink); }
.item-btn .ic svg { width: 18px; height: 18px; }
.item-btn .item-count { color: var(--primary-d); }
.item-btn.off { opacity: .45; }
.item-btn.armed { background: #ffe27a; outline: 3px solid var(--primary); }
.play-stage.peek-armed .fcard:not(.flipped) .fc-back { outline: 4px dashed #ffe27a; outline-offset: -6px; cursor: zoom-in; }
.fcard.revealed .fc-face { border-color: #ffb400; box-shadow: 0 0 0 4px rgba(255,180,0,.55); }
.q2-opt.elim { opacity: .3; text-decoration: line-through; pointer-events: none; }
.k-ing.hinted, .r-opt.hinted, #btn-k-clear.hinted, #btn-r-undo.hinted, .k-cust.hinted { outline: 4px solid #ffb400; outline-offset: 2px; box-shadow: 0 0 0 8px rgba(255,180,0,.3); }
@media (prefers-reduced-motion: no-preference) { .k-ing.hinted, .r-opt.hinted { animation: hintPulse .8s ease-in-out infinite alternate; } }
@keyframes hintPulse { from { transform: scale(1); } to { transform: scale(1.06); } }
/* 商店 */
.shop-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.shop-tabs .seg[aria-selected="true"] { background: var(--accent); color: #fff; box-shadow: 0 3px 0 #1f7a38; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.shop-card { background: #fff; border: 3px solid var(--ink); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; box-shadow: var(--shadow); }
.shop-card.equipped { outline: 4px solid var(--good); }
.shop-card h3 { margin: 0; font-size: 1.05rem; }
.shop-card .btn { width: 100%; }
.shop-own { margin: 0; font-weight: 700; font-size: .9rem; }
.shop-art { width: 110px; height: 110px; display: flex; align-items: center; justify-content: center; }
.shop-art svg { width: 100%; height: 100%; }
.shop-art.item-art svg { width: 60%; height: 60%; color: var(--primary); }
.shop-art.cb-prev { width: 84px; border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; }
.theme-prev { gap: 0; border: 3px solid var(--ink); border-radius: 14px; overflow: hidden; }
.theme-prev .sw { flex: 1; height: 100%; }
.theme-prev .sw-a { background: var(--tp-a, #fff3d6); } .theme-prev .sw-b { background: var(--tp-b, #ff7a3d); } .theme-prev .sw-c { background: var(--tp-c, #3fae5a); }
.theme-prev.theme-mint { --tp-a: #dff6ea; --tp-b: #2fae7a; --tp-c: #ff9d5c; }
.theme-prev.theme-dusk { --tp-a: #ece0ff; --tp-b: #8a5ad8; --tp-c: #ffb400; }
.theme-prev.theme-forest { --tp-a: #e4f1dc; --tp-b: #3f7d3a; --tp-c: #d9a441; }
.theme-prev.theme-sakura { --tp-a: #ffe6ee; --tp-b: #e0587a; --tp-c: #7fbf6a; }
.theme-prev.theme-fruit { --tp-a: #fff0dc; --tp-b: #ff7a3d; --tp-c: #e0453a; }
.theme-prev.theme-ocean { --tp-a: #dcf0ff; --tp-b: #2f7fc0; --tp-c: #ffb84c; }
/* 色彩主題（只改顏色變數）。.pv-scope：收藏室的「先看看」預覽用同一組變數 */
body.theme-mint, .pv-scope.theme-mint { --bg1: #e3f7ec; --bg2: #d6f0ff; --bg3: #f1ffe0; --primary: #2fae7a; --primary-d: #1f8a5e; --accent: #ff8a4c; --line: #c6e8d4; }
body.theme-forest, .pv-scope.theme-forest { --bg1: #e7f2df; --bg2: #f4ecd6; --bg3: #dcefe4; --primary: #3f7d3a; --primary-d: #2c5e28; --accent: #d9902a; --line: #cfe2c4; }
body.theme-dusk, .pv-scope.theme-dusk { --bg1: #efe3ff; --bg2: #ffd9e8; --bg3: #dfe6ff; --primary: #8a5ad8; --primary-d: #6c3fbd; --accent: #e0882a; --line: #ddd0f2; }
body.theme-sakura, .pv-scope.theme-sakura { --bg1: #ffe9f0; --bg2: #fff4e8; --bg3: #f0f8e4; --primary: #e0587a; --primary-d: #c23d60; --accent: #5fa84e; --line: #f4cfd9; }
body.theme-fruit, .pv-scope.theme-fruit { --bg1: #fff1dc; --bg2: #ffe0d0; --bg3: #fff8c8; --primary: #f06a2c; --primary-d: #cf5218; --accent: #d63b31; --line: #f6d4b4; }
body.theme-ocean, .pv-scope.theme-ocean { --bg1: #ddf1ff; --bg2: #e2fbf6; --bg3: #fff6e0; --primary: #2f7fc0; --primary-d: #1f639c; --accent: #f0a030; --line: #c4def2; }
.pv-scope.theme-default, .pv-scope:not([class*="theme-"]) { --bg1: #fff3d6; --bg2: #ffe0e6; --bg3: #d9f3e4; --primary: #ff7a3d; --primary-d: #e65f22; --accent: #3fae5a; --line: #f0d9b8; }

/* 浮動文字不換行（避免長字串蓋住道具列） */
#play-pops .pop { white-space: nowrap; }

/* ---------- 魔王關 / 無盡模式 ---------- */
.play-runbar { display: flex; align-items: center; gap: 10px; margin: 4px 0 6px; padding: 6px 10px; border: 3px solid var(--ink); border-radius: 14px; background: #fff8ec; }
.play-runbar[hidden] { display: none; }
.play-runbar .rb-face { width: 54px; height: 54px; flex: none; }
.play-runbar .rb-face svg { width: 100%; height: 100%; }
.play-runbar .rb-mid { flex: 1; min-width: 0; display: grid; gap: 3px; }
.play-runbar .rb-top { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.play-runbar .rb-stage, .play-runbar .rb-val { font-size: .85rem; }
.play-runbar.hit .rb-face { animation: rbHit .45s ease; }
@keyframes rbHit { 0% { transform: translateX(0); } 25% { transform: translateX(-5px) rotate(-6deg); } 60% { transform: translateX(4px) rotate(4deg); } 100% { transform: none; } }
.reduce-motion .play-runbar.hit .rb-face { animation: none; }
.boss-hp { height: 14px; background: #f3d9d9; }
.boss-fill { background: linear-gradient(90deg, #e2574c, #f29a3a); transition: width .3s ease; }
.play-runbar.ko .boss-fill { background: var(--good); }
.rb-endless { justify-content: center; flex-wrap: wrap; }
.rx-hearts { display: inline-flex; gap: 2px; color: var(--bad); }
.rx-hearts .icon, .rx-hearts svg { width: 22px; height: 22px; }
.runx-body { display: grid; gap: 10px; max-width: 680px; margin: 0 auto; text-align: center; }
.runx-body .run-progress, .runx-body .star-list { text-align: left; justify-self: center; }
.rx-head { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rx-result .rx-head { flex-direction: row; justify-content: center; }
.rx-boss { width: 150px; max-width: 40vw; }
.rx-boss svg, .rx-det svg { width: 100%; height: auto; }
.rx-det { width: 110px; max-width: 30vw; }
.rx-line { font-style: italic; margin: 0; }
.rx-hp { display: grid; gap: 4px; width: 100%; max-width: 420px; justify-self: center; }
.rx-result.lost h2 { color: var(--bad); }
.star-list li.ok { color: var(--good); }
.star-list li.no { opacity: .7; }
.good-note { color: var(--good); font-weight: 700; }
.lv-boss { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 6px 0 10px; text-align: left; }
.lv-boss .rx-boss { width: 120px; }
.endless-body { display: grid; gap: 10px; }
.endless-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.endless-card { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 12px; border: 3px solid var(--ink); border-radius: 16px; background: #fff; }
.endless-card .ec-icon { width: 44px; height: 44px; }
.endless-card .ec-icon svg { width: 100%; height: 100%; }
.endless-card h3, .endless-card p { margin: 0; }
.ec-best { font-weight: 700; }
.items-note { margin: 0; font-size: .85rem; opacity: .85; }
.r-peek { margin: 6px auto; padding: 6px 12px; border: 3px dashed var(--ink); border-radius: 12px; background: #fff6c8; font-weight: 800; max-width: 90%; }
.r-peek[hidden] { display: none; }
.records-list .row { padding: 4px 0; border-bottom: 1px dashed #ddd; }
@media (max-width: 480px) { .endless-grid { grid-template-columns: 1fr 1fr; } .endless-card { padding: 8px; } }
.run-progress li.missed { color: #8a4a3a; }
.run-progress li.missed svg.icon { color: var(--bad); }

/* ===== v2.4：偵探等級、結算強化、新手教學 ===== */
.xp-bar { height: 14px; }
.xp-bar.small { height: 10px; width: min(240px, 70vw); }
.xp-fill { background: linear-gradient(90deg, #7fd4ff, #6f8fe8); transition: width .5s ease-out; }
.xp-fill.no-trans { transition: none !important; }
.menu-xp { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; margin-top: 2px; }
.menu-xp .hint { margin: 0; }
.level-card { display: flex; gap: 12px; align-items: center; background: #f1f6ff; border: 2px solid var(--ink); border-radius: 18px; padding: 10px 12px; margin-bottom: 12px; }
.level-card h3 { margin: 0 0 6px; }
.level-card .hint { margin: 4px 0; }
.lc-art { width: 84px; flex: none; }
.lc-main { flex: 1; min-width: 0; }
.tag.lock-tag { background: #eef2ff; }
.tut-list { display: grid; gap: 6px; }
.tut-row { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; gap: 0 8px; background: #fff7e8; border-radius: 12px; padding: 6px 10px; }
.tut-row .tut-name { font-weight: 800; }
.tut-row .hint { grid-column: 1; margin: 0; }
.tut-row button { grid-column: 2; grid-row: 1 / span 2; }

/* 結算 */
.rfx { display: grid; gap: 10px; margin: 10px 0; text-align: left; }
.rfx-newbest { justify-self: center; display: inline-flex; align-items: center; gap: 6px; background: #ffe27a; border: 3px solid var(--ink); border-radius: 999px; padding: 2px 14px; font-weight: 900; box-shadow: 0 3px 0 var(--ink); }
.rfx-newbest svg.icon { width: 1.2rem; height: 1.2rem; }
.rfx-gains { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px; }
.rfx-gain { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.rfx-gain svg.icon { width: 1.3rem; height: 1.3rem; color: var(--gold); }
.rfx-num { font-size: 1.5rem; font-variant-numeric: tabular-nums; color: var(--primary-d); }
.rfx-level { background: #f1f6ff; border-radius: 14px; padding: 8px 10px; }
.rfx-level-top { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 4px; }
.rfx-levelup { display: flex; gap: 10px; align-items: center; background: linear-gradient(135deg, #fff3c4, #ffe0ef); border: 3px solid var(--ink); border-radius: 18px; padding: 8px 12px; box-shadow: 0 4px 0 var(--ink); }
.rfx-levelup h3 { margin: 0; font-size: 1.3rem; }
.rfx-lu-art { width: 64px; flex: none; }
.rfx-lu-list { margin: 4px 0 6px; padding-left: 1.1em; }
.rfx-hint { background: #fff4e0; border: 2px dashed #e0a800; border-radius: 14px; padding: 8px 12px; }
.rfx-hint.close { background: #fff0c2; border-style: solid; }
.rfx-hint h3 { margin: 0 0 4px; font-size: 1.05rem; }
.rfx-hint ul, .rfx-tasks ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rfx-hint li, .rfx-tasks li { display: flex; gap: 6px; align-items: center; font-weight: 700; }
.rfx-hint li svg.icon, .rfx-tasks li svg.icon { width: 1.1rem; height: 1.1rem; flex: none; }
.rfx-tasks { background: #eef9f1; border-radius: 14px; padding: 8px 12px; }
.rfx-tasks h3 { margin: 0 0 4px; font-size: 1rem; }
.rfx-tasks li.done { color: var(--good); }
@keyframes starPop { 0% { transform: scale(0) rotate(-60deg); opacity: 0; } 70% { transform: scale(1.25); opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes luIn { from { transform: translateY(8px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  .stars-row.anim svg.icon.on { animation: starPop .45s ease-out backwards; }
  .stars-row.anim svg.icon.on:nth-child(2) { animation-delay: .3s; }
  .stars-row.anim svg.icon.on:nth-child(3) { animation-delay: .6s; }
  .rfx-levelup { animation: luIn .5s ease-out .5s backwards; }
}
.rfx-skip .stars-row.anim svg.icon, .rfx-skip .rfx-levelup { animation: none !important; }
.reduce-motion .stars-row.anim svg.icon, .reduce-motion .rfx-levelup { animation: none !important; }
.reduce-motion .xp-fill { transition: none !important; }

/* 新手教學：遮罩不攔截點擊；只有提示卡可以點 */
.coach { position: fixed; inset: 0; z-index: 900; pointer-events: none; }
.coach[hidden] { display: none; }
.coach-ring { position: fixed; border: 3px solid #ffd23f; border-radius: 14px; box-shadow: 0 0 0 4px rgba(59, 42, 32, .55), 0 0 0 9999px rgba(30, 22, 16, .28); pointer-events: none; transition: left .25s, top .25s, width .25s, height .25s; }
.coach-ring[hidden] { display: none; }
.coach-card { position: fixed; left: 50%; transform: translateX(-50%); width: min(520px, 94vw); display: flex; gap: 10px; align-items: flex-start; background: #fffaf0; border: 3px solid var(--ink); border-radius: 18px; padding: 10px 12px; box-shadow: 0 5px 0 var(--ink); pointer-events: auto; }
.coach-card.at-bottom { bottom: max(10px, env(safe-area-inset-bottom)); }
.coach-card.at-top { top: 10px; }
.coach-face { width: 64px; flex: none; }
.coach-body { flex: 1; min-width: 0; }
.coach-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.coach-title { font-size: 1.05rem; }
.coach-step { font-size: .8rem; color: var(--ink-soft); font-weight: 700; white-space: nowrap; }
.coach-text { margin: 4px 0 8px; line-height: 1.5; }
.coach-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.ghost { background: transparent; box-shadow: none; }
.reduce-motion .coach-ring { transition: none; }
@media (prefers-reduced-motion: reduce) { .coach-ring { transition: none; } }
@media (max-width: 480px) { .coach-face { width: 44px; } .coach-card { padding: 8px 10px; gap: 8px; } .coach-text { font-size: .92rem; margin: 2px 0 6px; } }
.tut-done { display: grid; justify-items: center; gap: 6px; padding: 24px 0; }
.tut-done-art { width: 120px; }

/* ===== v2.5 收藏室（衣櫥） ===== */
.wardrobe-body, .event-body { width: min(100%, 980px); margin: 0 auto; display: grid; gap: 12px; }
.wd-progress { display: grid; gap: 8px; }
.wd-count { margin: 0; font-weight: 800; }
.ev-bar { position: relative; height: 18px; border: 3px solid var(--ink); border-radius: 999px; background: #fff; overflow: visible; }
.ev-bar .ev-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--ev-color, var(--primary)); transition: width .5s ease; }
.ev-bar .ev-mark { position: absolute; top: -5px; width: 4px; height: 22px; margin-left: -2px; border-radius: 2px; background: var(--ink); opacity: .35; }
.ev-bar .ev-mark.on { opacity: .9; background: var(--gold); box-shadow: 0 0 0 1px var(--ink); }
.wd-miles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.wd-mile { display: grid; gap: 2px; padding: 6px 10px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font-size: .88rem; }
.wd-mile.ready { border-color: var(--good); background: #effbf2; }
.wd-mile.claimed { opacity: .7; }
.wd-mile .btn, .wd-mile .tag { justify-self: start; }
.wd-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.wd-wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); gap: 12px; align-items: start; }
.wd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.wd-item { display: grid; justify-items: center; gap: 4px; padding: 8px 6px; background: #fff; border: 3px solid var(--ink); border-radius: 16px; cursor: pointer; font: inherit; color: var(--ink); min-height: 44px; }
.wd-item.sel { outline: 4px solid var(--primary); outline-offset: 1px; }
.wd-item.equipped { background: #effbf2; }
.wd-item.locked .wd-art { filter: grayscale(.85) opacity(.55); }
.wd-art { width: 84px; height: 84px; display: flex; align-items: center; justify-content: center; }
.wd-art svg { width: 100%; height: 100%; }
.wd-name { font-weight: 800; font-size: .92rem; text-align: center; }
.wd-state { display: inline-flex; align-items: center; gap: 3px; font-size: .8rem; font-weight: 800; padding: 0 8px; border-radius: 999px; border: 2px solid var(--line); }
.wd-state .ic svg { width: .9rem; height: .9rem; }
.wd-state.equipped { border-color: var(--good); color: var(--good); }
.wd-state.locked { color: var(--ink-soft); }
.wd-preview { position: sticky; top: 8px; display: grid; gap: 8px; justify-items: center; text-align: center; }
.wd-preview h3 { margin: 0; }
.wd-pv-art { width: 100%; min-height: 180px; display: flex; align-items: center; justify-content: center; }
.wd-pv-art > svg { width: 170px; height: 190px; }
.wd-src { display: flex; gap: 6px; align-items: flex-start; text-align: left; margin: 0; font-size: .92rem; }
.wd-acts { display: grid; gap: 6px; justify-items: center; }
.pv-cards { display: grid; grid-template-columns: repeat(4, 56px); gap: 8px; }
.pv-card { width: 56px; height: 72px; border: 3px solid var(--ink); border-radius: 10px; background: var(--pv-cb) center / cover; }
.pv-card.up { background: #fff; display: flex; align-items: center; justify-content: center; }
.pv-card.up svg { width: 44px; height: 44px; }
.pv-scope { width: 100%; max-width: 280px; padding: 14px; border: 3px solid var(--ink); border-radius: 18px; background: linear-gradient(135deg, var(--bg1), var(--bg2) 55%, var(--bg3)); display: grid; gap: 8px; justify-items: center; }
.pv-top { font-weight: 900; font-size: 1.2rem; color: var(--primary-d); }
.pv-btn { display: block; width: 80%; padding: 6px; border: 3px solid var(--ink); border-radius: 14px; background: #fff; font-weight: 800; }
.pv-btn.primary { background: var(--primary); color: #fff; }
.pv-chip { border: 2px solid var(--line); border-radius: 999px; padding: 0 10px; background: #fff; color: var(--accent); font-weight: 800; }
.pv-result { width: 100%; max-width: 300px; padding: 18px; border: 3px solid var(--ink); border-radius: 18px; display: grid; gap: 4px; justify-items: center; background-size: cover; background-position: center; }
.pv-result strong { font-size: 1.3rem; }
.pv-score { font-weight: 900; font-size: 1.4rem; }
.shop-art.cos-prev svg { width: 90%; height: 90%; }
.shop-card.locked .shop-art { filter: grayscale(.8) opacity(.6); }
.btn.ghost { background: transparent; box-shadow: none; }
/* 結算背景：套在所有結果卡上（淡化花紋，文字保持清楚） */
body:not([data-resultbg="bg-plain"]) .result2, body:not([data-resultbg="bg-plain"]) .run-body.panel, body:not([data-resultbg="bg-plain"]) .runx-body.panel { background-image: linear-gradient(rgba(255,255,255,.62), rgba(255,255,255,.62)), var(--rbg-img, none); background-size: cover; background-position: center; }
/* 主選單偵探的徽章（小物） */
#menu-hero-art .det-badge { filter: drop-shadow(0 2px 0 rgba(0,0,0,.15)); }

/* ===== v2.5 每週主題活動 ===== */
.ev-hero { display: grid; gap: 6px; border-color: var(--ink); background: linear-gradient(180deg, color-mix(in srgb, var(--ev-color) 16%, #fff), #fff 70%); }
.ev-banner { display: flex; align-items: center; justify-content: center; padding: 6px; border-radius: 14px; background: color-mix(in srgb, var(--ev-color) 22%, #fff); border: 2px solid color-mix(in srgb, var(--ev-color) 55%, #fff); }
.ev-ings { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.ev-ing svg { width: 34px; height: 34px; }
.ev-banner.big .ev-ing svg { width: 48px; height: 48px; }
.ev-title { margin: 4px 0 0; font-size: 1.35rem; color: color-mix(in srgb, var(--ev-color) 70%, var(--ink)); }
.ev-tag { margin: 0; font-weight: 700; }
.ev-pts { margin: 0; font-weight: 900; }
.ev-cos { display: flex; align-items: center; gap: 10px; }
.ev-cos-art { width: 64px; height: 64px; flex: none; } .ev-cos-art svg { width: 100%; height: 100%; }
.ev-cos p { margin: 0; font-weight: 700; text-align: left; }
.ev-steps { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.ev-step { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 10px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font-size: .9rem; }
.ev-step .ev-at { font-weight: 900; min-width: 4.2em; }
.ev-step .ev-rw { flex: 1; min-width: 7em; }
.ev-step.ready { border-color: var(--good); background: #effbf2; }
.ev-step.claimed { opacity: .72; } .ev-step.claimed .ic { color: var(--good); }
.ev-game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ev-game { display: flex; align-items: center; gap: 6px; justify-content: center; }
.ev-how { margin: 8px 0 0; padding-left: 1.2em; font-size: .9rem; color: var(--ink-soft); }
.ev-up-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ev-up-card { display: grid; gap: 2px; justify-items: center; text-align: center; }
.ev-nofomo { margin: 8px 0 0; padding: 8px 10px; border-radius: 12px; background: #f2f7ff; border: 2px dashed #9fb7e0; font-weight: 700; }
.ev-hist { margin: 0; padding-left: 1.2em; font-size: .9rem; }
.tp-row.tp-event .btn { margin-left: auto; padding: 4px 12px; min-height: 44px; }
.tp-row.tp-event .dot { margin-left: 4px; }
.tp-row.tp-event .ic { color: var(--ev-color, var(--primary)); }
.ev-result { display: grid; gap: 4px; justify-items: center; padding: 6px 10px; border-radius: 14px; border: 2px solid color-mix(in srgb, var(--ev-color, var(--primary)) 50%, #fff); background: color-mix(in srgb, var(--ev-color, var(--primary)) 10%, #fff); }
.ev-r-pts { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 800; }
.ev-r-pts .ic { color: var(--ev-color, var(--primary)); }
.ev-r-step { margin: 0; font-weight: 900; color: var(--good); }
@media (max-width: 760px) {
  .wd-wrap { grid-template-columns: 1fr; }
  .wd-preview { position: static; order: -1; }
  .wd-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .wd-art { width: 64px; height: 64px; }
  .ev-up-row { grid-template-columns: 1fr; }
  .ev-steps { grid-template-columns: 1fr; }
  .wd-pv-art > svg { width: 140px; height: 156px; }
}

/* ---------- v2.6 玩法說明「一張圖看懂」（js/howto-info.js；海報版加 .hti-poster） ---------- */
.hti { --h-ink: #3b2a20; --h-soft: #6b5548; --h-or: #ff7a3d; --h-ord: #c9501a; --h-line: #f0d9b8; --h-cream: #fff3d6;
  font-size: 15px; color: var(--h-ink); line-height: 1.45; background: #fff6e8; border-radius: 22px; padding: 1em; display: grid; gap: .9em;
  background-image: radial-gradient(circle at 10% 0, #fff3d6 0, transparent 45%), radial-gradient(circle at 100% 18%, #ffe0e6 0, transparent 40%), radial-gradient(circle at 0 70%, #d9f3e4 0, transparent 40%); }
.hti, .hti * { box-sizing: border-box; }
.hti ul, .hti ol { list-style: none; margin: 0; padding: 0; }
.hti h3, .hti h4, .hti h5, .hti p { margin: 0; }
.hti-svg { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.hti-svg svg { width: 100%; height: 100%; }
.hti-hero { display: flex; align-items: center; gap: .8em; background: #fff; border-radius: 1.6em; padding: .9em 1em; box-shadow: 0 .3em 0 var(--h-line); }
.hti-det { width: 5.2em; height: 5.6em; }
.hti-boss { width: 4.2em; height: 4.4em; margin-left: auto; align-self: flex-end; }
.hti-title { font-size: 2.2em; color: var(--h-or); font-weight: 900; letter-spacing: .12em; line-height: 1.05; }
.hti-sub { font-size: 1.15em; color: #2e8f4a; font-weight: 900; letter-spacing: .3em; }
.hti-tag { display: inline-block; margin-top: .4em; font-size: .95em; font-weight: 700; color: #fff; background: var(--h-ink); border-radius: 99px; padding: .2em .9em; }
.hti-ver { font-size: .85em; color: var(--h-soft); margin-top: .3em; }
.hti-sec, .hti-card { background: #fff; border-radius: 1.4em; padding: .9em 1em 1em; box-shadow: 0 .3em 0 var(--h-line); }
.hti-h { display: flex; align-items: center; gap: .5em; font-size: 1.3em; font-weight: 900; margin-bottom: .55em; }
.hti-n { width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--h-or); color: #fff; font-size: .85em; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.hti-hic { width: 1.4em; height: 1.4em; color: var(--h-ord); }
.hti-flow { display: flex; gap: .5em; align-items: stretch; }
.hti-st { flex: 1; background: var(--h-cream); border-radius: 1.1em; padding: .6em .5em; text-align: center; position: relative; }
.hti-st b { display: block; font-size: 1em; }
.hti-st small { display: block; font-size: .85em; color: var(--h-soft); margin-top: .2em; line-height: 1.3; }
.hti-stic { width: 2.1em; height: 2.1em; display: flex; margin: 0 auto .2em; color: var(--h-ord); }
.hti-flow .hti-st + .hti-st::before { content: "›"; position: absolute; left: -.5em; top: 50%; transform: translate(-50%, -50%); color: var(--h-or); font-weight: 900; font-size: 1.4em; }
.hti-modes { display: grid; grid-template-columns: 1fr 1fr; gap: .6em; }
.hti-mode { border-radius: 1.1em; padding: .7em .8em; border: .15em solid var(--h-line); }
.hti-mode h5 { display: flex; align-items: center; gap: .4em; font-size: 1.15em; font-weight: 900; }
.hti-mic { width: 1.7em; height: 1.7em; }
.hti-mode p { font-size: .95em; margin-top: .25em; }
.hti-ctl { margin-top: .4em; font-size: .8em; color: var(--h-soft); background: rgba(255, 255, 255, .85); border-radius: .7em; padding: .25em .5em; }
.hti-m1 { background: #fff0e6; } .hti-m1 h5 { color: #c9501a; }
.hti-m2 { background: #eef0f6; }
.hti-m3 { background: #e6f6ec; } .hti-m3 h5 { color: #1f7f40; }
.hti-m4 { background: #ffe8ee; } .hti-m4 h5 { color: #b0335a; }
.hti-stars { display: flex; gap: .5em; }
.hti-s { flex: 1; text-align: center; background: #fff4d6; border-radius: 1em; padding: .5em .3em; }
.hti-k { display: flex; justify-content: center; gap: .1em; color: #e0a000; }
.hti-star { width: 1.4em; height: 1.4em; }
.hti-s b { display: block; } .hti-s small { display: block; font-size: .85em; color: var(--h-soft); }
.hti-gate { margin-top: .5em; font-size: .88em; color: var(--h-soft); text-align: center; }
.hti-dgrp { border-radius: 1.1em; padding: .5em; }
.hti-core { background: #e6f6ec; border: .15em solid #9fd8b2; }
.hti-extra { margin-top: .5em; background: #f6f2ff; border: .15em dashed #c9b6ef; }
.hti-dl { font-weight: 900; font-size: .95em; margin: 0 0 .4em .2em; }
.hti-core .hti-dl { color: #1f7f40; } .hti-extra .hti-dl { color: #6a4bb0; }
.hti-core .hti-st, .hti-extra .hti-st { background: rgba(255, 255, 255, .9); }
.hti-big { font-size: .98em; }
.hti-items { display: grid; grid-template-columns: repeat(5, 1fr); gap: .45em; margin-top: .6em; }
.hti-it { background: var(--h-cream); border-radius: 1em; padding: .45em .2em; text-align: center; }
.hti-iic { width: 2em; height: 2em; display: flex; margin: 0 auto; color: var(--h-ord); }
.hti-it b { display: block; } .hti-it small { display: block; color: var(--h-ord); font-weight: 700; font-size: .85em; }
.hti-it i { display: block; font-style: normal; font-size: .75em; color: var(--h-soft); line-height: 1.25; }
.hti-two { display: grid; grid-template-columns: 1fr 1fr; gap: .6em; }
.hti-card p { font-size: .95em; }
.hti-cardart { width: 2.4em; height: 2.4em; }
.hti-bosscard { background: #f3e8ff; } .hti-endl { background: #e3f1ff; }
.hti-save { background: #fde8e6; border: .15em dashed #e0453a; box-shadow: none; }
.hti-save .hti-h { color: #b5302a; }
.hti-savelist li { display: flex; gap: .5em; align-items: center; margin: .25em 0; }
.hti-sic { width: 1.5em; height: 1.5em; color: #b5302a; }
.hti-ings { display: flex; justify-content: center; flex-wrap: wrap; gap: .2em; }
.hti-ing { width: 2.4em; height: 2.4em; }
.hti-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: .4em; font-weight: 700; color: var(--h-soft); }
.hti-foot li { background: #fff; border-radius: 99px; padding: .2em .8em; box-shadow: 0 .2em 0 var(--h-line); }
@media (max-width: 600px) {
  .hti { font-size: 14.5px; padding: .7em; }
  .hti-modes, .hti-two { grid-template-columns: 1fr; }
  .hti-flow { flex-direction: column; gap: .7em; }
  .hti-st { display: grid; grid-template-columns: 2.4em 1fr; text-align: left; align-items: center; column-gap: .5em; padding: .5em .7em; }
  .hti-stic { grid-row: span 2; margin: 0; }
  .hti-flow .hti-st + .hti-st::before { left: 50%; top: -.6em; transform: translateX(-50%) rotate(90deg); font-size: 1.2em; line-height: 1; }
  .hti-stars { flex-direction: column; }
  .hti-s { display: flex; align-items: center; gap: .6em; text-align: left; padding: .45em .7em; }
  .hti-s .hti-k { flex: none; width: 4.4em; justify-content: flex-start; }
  .hti-items { grid-template-columns: repeat(3, 1fr); }
  .hti-det { width: 4em; height: 4.4em; } .hti-boss { width: 3em; height: 3.2em; }
  .hti-title { font-size: 1.9em; }
}
/* 海報（企劃書附圖）：固定 1080px 寬，字放大 */
.hti.hti-poster { font-size: 26px; width: 1080px; border-radius: 0; padding: 44px 48px 40px; gap: 26px; }
.howto-info-wrap { margin: 0 0 6px; }
.howto-info-wrap > h3 { margin-top: 0; }
