*{box-sizing:border-box;margin:0;padding:0}
html,body{width:100%;height:100%;overflow:hidden;background:#2b1d5c;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;font-family:"Trebuchet MS","Segoe UI",system-ui,-apple-system,Roboto,Arial,sans-serif;color:#fff}
canvas#c{position:fixed;left:0;top:0;display:block}
button{font-family:inherit;cursor:pointer;border:0;color:inherit;touch-action:manipulation}
.hide{display:none!important}
#topbtns{position:fixed;top:max(8px,env(safe-area-inset-top));right:8px;display:flex;gap:8px;z-index:30}
#bQuit{position:fixed;top:max(8px,env(safe-area-inset-top));left:8px;z-index:30}
.ib{width:44px;height:44px;border-radius:14px;background:#4a3796;border:3px solid #1b1238;box-shadow:0 4px 0 #1b1238;display:flex;align-items:center;justify-content:center}
.ib svg{width:24px;height:24px;fill:#fff;stroke:#fff}
.ib:active{transform:translateY(2px);box-shadow:0 2px 0 #1b1238}
.muted #mWave{display:none}
#mX{display:none}.muted #mX{display:inline}
#bMusic .mOff{display:none}#bMusic.off .mOff{display:inline}#bMusic.off{opacity:.6}
.ov{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;z-index:20;padding:10px;background:rgba(30,16,70,.35)}
.panel{background:#fff8ec;color:#3a2160;border:4px solid #1b1238;border-radius:24px;box-shadow:0 8px 0 #1b1238;padding:12px 14px 12px;width:min(470px,100%);max-height:100%;overflow:auto;text-align:center}
.panel.small{width:min(330px,100%)}
h1{font-size:40px;line-height:.95;font-weight:900;color:#ff5a3c;text-shadow:0 3px 0 #a3271a,0 5px 0 #1b1238;letter-spacing:.5px}
h1 span{display:block;font-size:21px;color:#2fb5ff;text-shadow:0 2px 0 #145c86,0 4px 0 #1b1238;margin-top:4px}
.pick{margin-top:8px}
h2{font-size:30px;font-weight:900;color:#ff5a3c;text-shadow:0 3px 0 #a3271a,0 5px 0 #1b1238;margin:0 0 4px;line-height:1.05}
.modes{display:flex;gap:6px;margin:4px 0 6px}
.mode{flex:1;font-size:16px;font-weight:900;padding:9px 4px;border-radius:14px;background:#e9dcff;color:#5a3d9a;border:3px solid #1b1238}
.mode.sel{background:#7b5cff;color:#fff;box-shadow:0 3px 0 #1b1238}
.lbl{font-size:12px;letter-spacing:1.4px;text-transform:uppercase;color:#8a72b8;font-weight:900;margin:4px 0 2px}
.chars{display:flex;justify-content:center;gap:6px}
.ch{width:76px;border-radius:14px;background:#f3e8ff;border:3px solid #d8c6f5;padding:3px 2px 4px;font-size:13px;font-weight:900;color:#3a2160;line-height:1.1}
.ch img{display:block;width:50px;height:50px;object-fit:contain;margin:0 auto 1px}
.ch small{display:block;font-size:10px;color:#8a72b8;font-weight:700}
.ch.sel{background:#ffe27a;border-color:#1b1238;box-shadow:0 3px 0 #1b1238}
.ch.taken{opacity:.35}
.big{display:block;width:100%;font-size:30px;font-weight:900;padding:12px;border-radius:18px;background:#ff5a3c;border:3px solid #1b1238;box-shadow:0 6px 0 #1b1238;color:#fff;text-shadow:0 2px 0 #a3271a;margin:10px 0 10px;letter-spacing:1px}
.big:active{transform:translateY(3px);box-shadow:0 3px 0 #1b1238}
.mid{display:block;width:100%;font-size:18px;font-weight:900;padding:9px;border-radius:14px;background:#7b5cff;border:3px solid #1b1238;box-shadow:0 4px 0 #1b1238;color:#fff}
.mid:active{transform:translateY(2px);box-shadow:0 2px 0 #1b1238}
.opts{display:flex;gap:6px;margin-top:6px}
.opt{flex:1;background:#f3e8ff;border-radius:14px;padding:2px 4px 6px}
.sel3{display:flex;align-items:center;gap:4px}
.sel3 b{flex:1;font-size:15px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.arr{width:34px;min-width:34px;height:34px;border-radius:10px;background:#7b5cff;color:#fff;font-size:26px;line-height:1;font-weight:900;border:2px solid #1b1238}
.arr:active{transform:translateY(2px)}
.streak{font-size:14px;font-weight:900;color:#ff5a3c;margin-top:6px;min-height:17px}
.hint{font-size:12px;color:#8a72b8;margin-top:4px;line-height:1.35}
#winPic{width:110px;height:110px;display:block;margin:0 auto}
#rScore{font-size:44px;font-weight:900;color:#ffb21e;text-shadow:0 3px 0 #9a5b00,0 5px 0 #1b1238;margin:2px 0}
#rInfo{font-size:15px;color:#5a3d9a;line-height:1.5;background:#f3e8ff;border-radius:14px;padding:6px 10px;margin:6px 0;font-weight:700}
#touch{position:fixed;left:0;right:0;bottom:0;z-index:15;pointer-events:none;display:flex;justify-content:space-between;align-items:flex-end;padding:0 12px max(14px,env(safe-area-inset-bottom))}
#touch button{pointer-events:auto;border-radius:50%;background:rgba(255,255,255,.28);border:4px solid rgba(27,18,56,.75);color:#fff;font-weight:900;text-shadow:0 2px 0 #1b1238;box-shadow:0 4px 0 rgba(27,18,56,.6)}
#touch button.on{background:rgba(255,226,122,.75);transform:translateY(2px)}
#touch .tl,#touch .tr{display:flex;gap:12px;align-items:flex-end}
#tLeft,#tRight{width:82px;height:82px;font-size:34px}
#tJump{width:96px;height:96px;font-size:20px;background:rgba(255,90,60,.55)!important}
#tJump.on{background:rgba(255,160,120,.85)!important}
#tDown{width:58px;height:58px;font-size:22px;margin-bottom:4px}
@media (max-height:430px){
  .panel{padding:8px 10px}
  h1{font-size:28px}h1 span{font-size:16px}
  .modes{margin:6px 0 4px}.mode{padding:6px 4px;font-size:14px}
  .ch img{width:36px;height:36px}.ch{width:66px;font-size:12px}
  .big{font-size:24px;padding:8px;margin:6px 0}
  #tLeft,#tRight{width:68px;height:68px}#tJump{width:80px;height:80px}#tDown{width:50px;height:50px}
}
