*{box-sizing:border-box;margin:0;padding:0}
html,body{width:100%;height:100%;overflow:hidden;background:#2b2350;font-family:"Hiragino Maru Gothic ProN","Hiragino Sans","Noto Sans JP","Yu Gothic","Meiryo",sans-serif;color:#2a2140;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}
canvas{display:block;width:100%;height:100%;touch-action:none}
button{font-family:inherit;cursor:pointer;border:0;-webkit-tap-highlight-color:transparent}
.hide{display:none!important}
#hud{position:fixed;top:8px;right:8px;display:flex;gap:8px;z-index:20}
.round{width:42px;height:42px;border-radius:50%;background:rgba(255,255,255,.92);box-shadow:0 3px 0 #b9a8e6;display:flex;align-items:center;justify-content:center}
.round svg{width:24px;height:24px;fill:none;stroke:#2a2140;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.round svg .fill{fill:#2a2140;stroke:none}
#btnMute .off{display:none} #btnMute.muted .on{display:none} #btnMute.muted .off{display:inline}
#btnMusic.off{opacity:.45}
.panel{position:fixed;inset:0;display:none;align-items:center;justify-content:center;z-index:10;padding:12px;background:rgba(40,28,80,.35)}
.panel.show{display:flex}
.card{background:#fffaf2;border:3px solid #2a2140;border-radius:22px;box-shadow:0 8px 0 rgba(42,33,64,.45);padding:16px 18px;max-width:560px;width:100%;max-height:100%;overflow:auto;text-align:center}
.mcard{max-width:640px}
.head{display:flex;gap:12px;align-items:center;text-align:left}
.head img{width:96px;height:auto;flex:none}
h1{font-size:32px;line-height:1.1;color:#2a2140;letter-spacing:1px}
.sub{font-size:15px;font-weight:bold;color:#e8577a;margin-top:2px}
.intro{font-size:13px;line-height:1.5;margin-top:6px;color:#4a3d6b}
.big{display:block;width:100%;margin:12px 0 8px;padding:12px 10px;border-radius:16px;background:linear-gradient(#ff8a7a,#ef5d70);color:#fff;font-size:26px;font-weight:900;box-shadow:0 5px 0 #a93450;letter-spacing:2px}
.big small{display:block;font-size:12px;font-weight:bold;letter-spacing:0;opacity:.95}
.big:active{transform:translateY(3px);box-shadow:0 2px 0 #a93450}
.modes{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}
.mode{background:#e9e2ff;border:2px solid #2a2140;border-radius:12px;padding:6px 3px;font-size:13px;font-weight:bold;color:#2a2140;box-shadow:0 3px 0 #9d8fd1}
.mode i{display:block;font-style:normal;font-size:10px;font-weight:normal;margin-top:2px;color:#5a4d7d}
.opts{display:grid;grid-template-columns:auto 1fr;gap:6px 10px;align-items:center;margin-top:10px;text-align:left;font-size:13px}
.seg{display:flex;gap:4px}
.opt{flex:1;padding:5px 2px;border-radius:9px;background:#f0ebfa;border:2px solid #cfc4f0;font-size:12px;font-weight:bold;color:#4a3d6b}
.opt.on{background:#4cb8ff;border-color:#2a2140;color:#fff}
.keys{display:flex;flex-wrap:wrap;gap:6px 14px;justify-content:center;margin-top:10px;font-size:12px}
.k{display:inline-block;min-width:22px;padding:1px 5px;margin:0 1px;border:2px solid #2a2140;border-bottom-width:3px;border-radius:6px;background:#fff;font-weight:bold;font-size:11px}
.touch{font-size:12px;margin-top:6px;color:#5a4d7d}
.stats{font-size:12px;margin-top:6px;color:#e8577a;font-weight:bold}
.rt{font-size:30px;font-weight:900;color:#2a2140}
.rs{font-size:14px;margin:4px 0;color:#4a3d6b;line-height:1.5}
.score{font-size:40px;font-weight:900;color:#ef5d70;margin:2px 0}
.small{margin-top:4px;padding:8px 22px;border-radius:12px;background:#e9e2ff;border:2px solid #2a2140;font-weight:bold;font-size:15px;color:#2a2140}
.troph{width:110px;height:auto}
.grid{display:grid;grid-template-columns:repeat(6,1fr);gap:6px;margin:10px 0}
.lv{padding:6px 0;border-radius:10px;border:2px solid #2a2140;background:#fff;font-weight:900;font-size:16px;color:#2a2140;box-shadow:0 3px 0 #9d8fd1}
.lv i{display:block;font-style:normal;font-size:10px;color:#f2a900;letter-spacing:-1px;min-height:12px}
.lv.lock{background:#ddd6ee;color:#9a91b5;box-shadow:none}
.ladder{margin:8px 0;display:flex;flex-direction:column;gap:6px}
.rung{display:flex;align-items:center;gap:8px;padding:6px 10px;border-radius:12px;border:2px solid #cfc4f0;background:#fff;font-weight:bold;font-size:14px;text-align:left}
.rung.cur{border-color:#2a2140;background:#fff3c4}
.rung.done{opacity:.6}
.rung .dot{width:18px;height:18px;border-radius:50%;border:2px solid #2a2140;flex:none}
#keepBar{position:fixed;left:0;right:0;bottom:14px;z-index:8;text-align:center;pointer-events:none}
#keepMsg{display:inline-block;background:rgba(255,250,242,.95);border:2px solid #2a2140;border-radius:12px;padding:4px 12px;font-weight:900;font-size:15px;margin-bottom:6px}
.kb{display:flex;justify-content:center;gap:10px;pointer-events:auto}
.kb button{padding:12px 16px;border-radius:14px;background:#ffe14d;border:3px solid #2a2140;font-weight:900;font-size:17px;box-shadow:0 4px 0 #b39400;color:#2a2140}
@media (max-width:620px){
  .modes{grid-template-columns:repeat(3,1fr)}
  h1{font-size:26px}
  .head img{width:74px}
  .big{font-size:22px}
  .card{padding:12px}
}
@media (max-height:500px){
  .card{padding:8px 12px}
  .head img{width:60px}
  h1{font-size:22px}
  .intro{font-size:11px;margin-top:2px}
  .big{margin:6px 0 5px;padding:6px;font-size:20px}
  .opts{margin-top:5px}
  .keys,.touch{margin-top:4px}
}
