*{box-sizing:border-box;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}
html,body{margin:0;height:100%;overflow:hidden;background:#ead6ed;overscroll-behavior:none;font-family:ui-rounded,"Nunito","Baloo 2",system-ui,-apple-system,"Segoe UI",sans-serif;color:#26324d}
#gl{position:fixed;inset:0;width:100%;height:100%;display:block;touch-action:none;outline:none}
.hidden{display:none!important}
#hud{position:fixed;inset:0;pointer-events:none;z-index:5}
#score{position:absolute;left:14px;top:12px;display:flex;align-items:center;gap:8px;background:rgba(255,255,255,.88);border-radius:999px;padding:6px 18px 6px 12px;box-shadow:0 4px 14px #0002;font-size:30px;font-weight:900}
#score b{min-width:2ch}
#dots{position:absolute;left:50%;top:18px;transform:translateX(-50%);display:flex;gap:10px}
#dots i{width:22px;height:22px;border-radius:50%;background:#fff9;border:3px solid #fff;transition:transform .25s,background .25s}
#dots i.on{background:#ffc933;transform:scale(1.25)}
#mute,#gear{position:absolute;top:12px;width:52px;height:52px;border-radius:50%;border:0;background:rgba(38,50,77,.55);display:grid;place-items:center;pointer-events:auto;cursor:pointer;padding:0}
#mute{right:76px}#gear{right:14px}
#mute.off #wave{display:none}
#gring{position:absolute;inset:-4px;border-radius:50%;border:4px solid transparent;border-top-color:#ffc933;opacity:0;transform:rotate(0)}
#gear.hold #gring{opacity:1;animation:spin 1.2s linear forwards}
@keyframes spin{to{transform:rotate(360deg)}}
#pops{position:fixed;inset:0;pointer-events:none;z-index:6;overflow:hidden}
.pop{position:absolute;transform:translate(-50%,-50%);font-size:44px;font-weight:900;color:#fff;text-shadow:0 3px 0 #e59a00,0 0 14px #ffc933;animation:pop 1.1s ease-out forwards;white-space:nowrap}
@keyframes pop{0%{opacity:0;transform:translate(-50%,-20%) scale(.4)}20%{opacity:1;transform:translate(-50%,-60%) scale(1.25)}100%{opacity:0;transform:translate(-50%,-190%) scale(1)}}
.overlay{position:fixed;inset:0;z-index:20;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;background:linear-gradient(#ead6edee,#ffe9c9ee);padding:16px}
#menu h1{margin:0;font-size:clamp(34px,7vw,64px);letter-spacing:.02em;color:#9c4b20;text-shadow:0 4px 0 #fff}
.modes{display:flex;gap:clamp(12px,3vw,32px);flex-wrap:wrap;justify-content:center}
.modes button{width:clamp(130px,26vw,240px);aspect-ratio:1;border:0;border-radius:32px;background:#fff;box-shadow:0 8px 0 #0002,0 14px 30px #0002;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;cursor:pointer;font:inherit;font-weight:900;font-size:clamp(16px,2.4vw,24px);color:#26324d;transition:transform .12s}
.modes button:active{transform:translateY(5px) scale(.97);box-shadow:0 3px 0 #0002}
.modes svg{width:68%;height:68%}
.sub{margin:0;font-size:clamp(16px,2.4vw,22px);font-weight:800;opacity:.7}
#cheer{background:transparent;pointer-events:none;z-index:15}
#stars{display:flex;gap:10px;font-size:clamp(80px,22vw,190px);line-height:1;color:#ffc933;text-shadow:0 8px 0 #e59a00,0 0 30px #fff}
#stars span{opacity:0;transform:scale(.2) rotate(-40deg)}
#stars span.on{animation:star .6s cubic-bezier(.2,1.6,.4,1) forwards}
#stars span.dim{color:#fff;text-shadow:0 6px 0 #0002}
@keyframes star{to{opacity:1;transform:scale(1) rotate(0)}}
.card{background:#fff;border-radius:22px;padding:20px 22px;max-width:640px;width:100%;max-height:92vh;overflow:auto;box-shadow:0 14px 50px #0004;font-size:15px;line-height:1.45}
.card h2{margin:0 0 8px;font-size:24px}
.card h3{margin:14px 0 4px;font-size:15px;text-transform:uppercase;letter-spacing:.08em;color:#6b7896}
.card .muted{color:#6b7896;font-size:13px}
.bars{display:grid;grid-template-columns:110px 1fr 54px;gap:6px 10px;align-items:center}
.bar{height:12px;border-radius:6px;background:#e8eef9;overflow:hidden}.bar i{display:block;height:100%;border-radius:6px;background:linear-gradient(90deg,#35c46a,#2fd0c0)}
.spark{display:flex;gap:4px;align-items:flex-end;height:46px}.spark i{width:16px;background:#3d8bff;border-radius:4px 4px 0 0;min-height:3px}
.prow{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px;align-items:center}
.card button,.card a{border:0;border-radius:12px;background:#eef3fb;padding:10px 14px;font:inherit;font-weight:800;color:#26324d;cursor:pointer;text-decoration:none}
.card button.big{background:#35c46a;color:#fff;margin-left:auto}
.card button.danger{color:#c4313f}
@media (max-width:560px){#score{font-size:22px}#score svg{width:24px;height:24px}#mute,#gear{width:44px;height:44px}#mute{right:64px}#dots i{width:16px;height:16px}.bars{grid-template-columns:90px 1fr 46px}}

#playTools{position:fixed;bottom:40px;left:50%;transform:translateX(-50%);display:flex;gap:6px;z-index:8;max-width:98vw;justify-content:center}#playTools button{font:12px system-ui;padding:10px 12px;border-radius:12px;border:1px solid #966f9d;background:#fff0dedf;color:#503356;cursor:pointer;min-height:40px;white-space:nowrap}#playHelp{position:fixed;top:79px;left:50%;transform:translateX(-50%);background:#fff3e5e8;border-radius:16px;padding:8px 14px;font-size:13px;z-index:7;text-align:center;max-width:92vw;pointer-events:none}.twist-label{font-size:16px;color:#573e65}.twist-label input{width:22px;height:22px;vertical-align:middle;accent-color:#9e64ba}.hall-link{color:#744483;font-weight:700}#menu h1{text-align:center;font-size:clamp(30px,6vw,58px)}button:focus-visible,a:focus-visible{outline:3px solid #9b43b0;outline-offset:3px}@media(max-width:560px){#playTools{gap:3px;width:98vw}#playTools button{font-size:10px;padding:8px 6px;min-height:36px}#playHelp{top:67px;font-size:11px}.sub{font-size:14px;text-align:center}.modes button{width:120px;border-radius:22px}.modes{gap:12px}.overlay{gap:15px}.twist-label{font-size:14px}}
