*{box-sizing:border-box}
body{margin:0;background:#12080a;color:#f4e9e0;font-family:system-ui,sans-serif}
header{display:flex;justify-content:space-between;align-items:center;padding:14px 20px;border-bottom:3px solid #ff6a1a;background:#1b0d0f}
header h1{margin:0;font-size:1.5rem}
header a{color:#ffb070}
main{max-width:1000px;margin:0 auto;padding:16px}
.sub{color:#cdb8ad;margin:6px 0}
#q{width:100%;padding:10px 12px;font-size:1rem;border-radius:8px;border:2px solid #4a2a22;background:#1b0d0f;color:#f4e9e0;margin:8px 0 14px}
#grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:12px}
.card{text-align:left;background:#1b0d0f;border:2px solid #4a2a22;border-radius:10px;padding:12px;color:inherit;cursor:pointer;font:inherit;display:flex;flex-direction:column;gap:6px}
.card:hover,.card:focus-visible{border-color:#ff6a1a;background:#26110f}
.card h3{margin:0;font-size:1.05rem;color:#ffb070}
.card p{margin:0;font-size:.88rem;color:#cdb8ad;flex:1}
.card span{font-size:.8rem;color:#8fd48f}
.bar{display:flex;align-items:center;justify-content:space-between;gap:10px}
.bar h2{margin:0;font-size:1.3rem}
.btn{background:#ff6a1a;color:#1a0a05;border:0;border-radius:8px;padding:9px 14px;font:inherit;font-weight:700;cursor:pointer}
.btn:hover{background:#ff8a45}
.hud{margin:8px 0;font-size:1.1rem}
#stage{display:flex;flex-direction:column;align-items:center;gap:10px;min-height:200px;user-select:none;-webkit-user-select:none}
.cv{width:100%;height:auto;background:#1b0d0f;border:3px solid #4a2a22;border-radius:10px;touch-action:none}
.dpad{display:flex;gap:10px}
.dp{width:64px;height:54px;font-size:1.2rem;border-radius:10px;border:2px solid #4a2a22;background:#26110f;color:#f4e9e0;touch-action:none}
@media (hover:hover) and (pointer:fine){.dpad{display:none}}
#over{position:fixed;inset:0;background:rgba(0,0,0,.65);display:flex;align-items:center;justify-content:center;z-index:5}
#over[hidden]{display:none}
.box{background:#1b0d0f;border:3px solid #ff6a1a;border-radius:14px;padding:22px 28px;text-align:center;max-width:90vw}
.box h3{margin:0 0 8px;font-size:1.3rem}
.box .btn{margin:6px}
.big{font-size:2rem;padding:18px 28px}
.react{width:100%;max-width:480px;height:300px;display:flex;align-items:center;justify-content:center;text-align:center;font-size:1.6rem;font-weight:700;border-radius:14px;cursor:pointer;background:#26110f;border:3px solid #4a2a22;padding:12px}
.react.wait{background:#7a1c1c}
.react.go{background:#1f8a3b}
.word{font-size:2rem;letter-spacing:.35rem;font-weight:700;min-height:2.6rem;text-align:center}
.keys{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;max-width:460px}
.keys button{width:38px;height:38px;border-radius:8px;border:2px solid #4a2a22;background:#26110f;color:#f4e9e0;font:inherit;font-weight:700;cursor:pointer}
.keys button:disabled{opacity:.3;cursor:default}
.cardbig{font-size:5rem;font-weight:800;color:#ffb070}
.peg{display:inline-block;width:34px;height:34px;border-radius:50%;margin:3px;border:2px solid #4a2a22;vertical-align:middle}
.peg.sm{width:20px;height:20px}
.pal button.peg{cursor:pointer}
.mm-row,.mm-pal{text-align:center}
.mm-hist{text-align:center;max-height:360px;overflow:auto;width:100%}
.mm-hist div{white-space:nowrap}
.fb{font-size:1.1rem;margin-left:8px;letter-spacing:2px}
.inp{font:inherit;font-size:1.4rem;padding:10px;border-radius:8px;border:2px solid #4a2a22;background:#1b0d0f;color:#f4e9e0;text-align:center;width:min(90vw,320px)}
.msg{min-height:1.5rem;text-align:center;color:#ffb070}
.row{display:flex;gap:12px;flex-wrap:wrap;justify-content:center}
