*{box-sizing:border-box}
:root{font-family:system-ui,sans-serif;color:#332536;background:#f2e7d6}
body{margin:0}
main{width:min(100%,540px);margin:0 auto;padding:10px 10px max(12px,env(safe-area-inset-bottom))}
header a{font-size:.77rem;font-weight:800;color:#68485b}
h1{font-size:1.58rem;margin:3px 0 10px}
#forgeStage{position:relative;overflow:hidden;height:clamp(320px,60dvh,620px);border:2px solid #674859;border-radius:16px;background:#574058}
canvas{width:100%;height:100%;display:block}
#hud{position:absolute;inset:10px 9px auto;display:flex;justify-content:space-between;gap:5px;pointer-events:none}
#hud>*{background:#3e2939;color:#fff1d9;border:1px solid #cf9776;border-radius:7px;padding:6px 8px;font-size:.85rem;font-weight:850;white-space:nowrap}
#intro{position:absolute;inset:0;display:grid;place-items:center;background:#2f1d2ca0;padding:19px}
#intro[hidden],#quote[hidden]{display:none}
#intro div{background:#fff1d8;border:2px solid #ba826c;border-radius:12px;padding:16px;max-width:340px}
h2{margin:0 0 8px;font-size:1.28rem}
p{margin:0 0 14px;line-height:1.48}
button{width:100%;min-height:45px;border:0;border-radius:8px;color:#fff;background:#774750;font:900 1rem system-ui;touch-action:manipulation}
button:active{background:#54324a}
button:disabled{opacity:.55}
.panel{margin-top:8px;padding:9px;background:#f9efdb;border:1px solid #d8ba9d;border-radius:10px}
#stepList{display:grid;grid-template-columns:repeat(5,1fr);gap:4px}
#stepList span{text-align:center;padding:4px 2px;border-radius:5px;color:#694a58;background:#eadfcf;font-size:.79rem;font-weight:800}
#stepList [aria-current=step]{color:#fff0d9;background:#774750}
#meter{position:relative;margin:10px 1px 4px;height:17px;border:1px solid #784955;border-radius:6px;background:#4e3549;overflow:hidden}
#meter[hidden]{display:none}
#target,#needle{position:absolute;inset-block:0}
#target{background:#f0bd66}
#needle{width:4px;background:#fff9eb;box-shadow:0 0 4px #39233b;transform:translateX(-50%)}
#advice{min-height:31px;text-align:center;font-size:.84rem;font-weight:800;padding:4px 0}
#quote{position:absolute;inset:auto 8px 10px;display:grid;justify-items:center;gap:4px;pointer-events:none}
#quote strong{padding:7px 10px;border-radius:7px;color:#533449;background:#fff0d3;text-align:center;font-size:.93rem}
#quote span{padding:3px 8px;border-radius:5px;color:#fff0d3;background:#573543;font-weight:900}
