*{box-sizing:border-box}html,body{margin:0;background:#fff;color:#000;overscroll-behavior:none}body{min-height:100svh;display:grid;place-items:center;font:16px system-ui}main{width:min(100%,420px);padding:env(safe-area-inset-top,0px) 18px env(safe-area-inset-bottom,0px)}.toolbar{height:64px;display:grid;grid-template-columns:72px 1fr auto;align-items:center}.tools{display:flex;gap:8px}button{display:grid;place-items:center;width:44px;height:44px;padding:10px;background:#fff;color:#000;border:1px solid #000;border-radius:50%;cursor:pointer;touch-action:manipulation}button:focus-visible{outline:2px solid #000;outline-offset:4px}svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}#next{width:72px;height:60px}.scores{display:flex;justify-content:center;gap:14px;min-width:0}.score-stat{display:grid;gap:5px;text-align:center;min-width:0}.score-stat span{font-size:14px;color:#555}#score,#high-score{font:600 21px/1 ui-monospace,SFMono-Regular,Menlo,monospace;font-variant-numeric:tabular-nums;min-width:4ch;text-align:center}.board-wrap{position:relative;width:min(100%,calc((100svh - 88px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))/2));margin:0 auto 16px;border:1px solid #000;line-height:0}#board{display:block;width:100%;height:auto;background:#fff;touch-action:none;overscroll-behavior:none;-webkit-touch-callout:none;user-select:none;-webkit-user-select:none}#overlay{position:absolute;inset:0;background:#fffc;display:grid;place-items:center}#overlay[hidden]{display:none}#start{width:68px;height:68px}#start svg{width:30px;height:30px;fill:#000;stroke:none}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}

@media(max-width:360px){main{padding-left:10px;padding-right:10px}.toolbar{grid-template-columns:60px 1fr auto}#next{width:60px;height:50px}.scores{gap:8px}#score,#high-score{font-size:18px;min-width:3ch}.tools{gap:6px}}

#overlay{background:#fffffff2;overflow:auto;line-height:1.3;padding:20px 18px}.pause-panel{width:min(100%,240px);margin:auto;text-align:center}.pause-panel h1{font-size:20px;font-weight:600;margin:0 0 8px}#final-score{margin:0 0 18px;font-size:16px}.leaderboard{text-align:left;margin:20px 0 24px}.global-record{display:flex;align-items:baseline;justify-content:space-between;gap:12px;font-size:14px;padding-bottom:14px;border-bottom:1px solid #ddd}.global-record strong{font:600 24px ui-monospace,monospace}.leaderboard h2{font-size:14px;font-weight:500;color:#555;margin:16px 0 8px}.leaderboard ol{list-style:none;margin:0;padding:0;counter-reset:rank}.leaderboard li{display:flex;justify-content:space-between;gap:12px;padding:7px 0;font:16px ui-monospace,monospace;counter-increment:rank}.leaderboard li::before{content:counter(rank);color:#777}.leaderboard li span{margin-left:auto}#leaderboard-state{font-size:14px;color:#555;margin:10px 0 0}#leaderboard-state:empty{display:none}#start{margin:0 auto}.text-button{border:0;border-radius:0;width:auto;height:auto;padding:8px 0;font:14px system-ui;text-decoration:underline;background:transparent}.pause-panel [hidden]{display:none!important}

#player-form{text-align:left;margin:16px 0 20px}#player-form p{font-size:14px;margin:8px 0 12px}#player-form label{display:block;font-size:14px;margin:12px 0}#player-form input{display:block;margin-top:6px;width:100%;border:1px solid #aaa;background:#fff;color:#000;border-radius:0;padding:10px;font:16px system-ui}#player-form small{display:block;font-size:12px;line-height:1.5;color:#555}.save-player{width:100%;height:42px;border-radius:0;margin-top:14px;font:14px system-ui}#player-error:empty{display:none}

.leaderboard li .player-label{margin-left:0;min-width:0;overflow-wrap:anywhere;flex:1;font-family:system-ui}.leaderboard li .player-score{margin-left:auto;flex-shrink:0}

#open-game{color:#000;font-size:14px}

.prize-message{font-size:14px;line-height:1.5;border:1px solid #000;padding:12px;text-align:left;margin:16px 0}
