:root{font-family:'Hiragino Kaku Gothic ProN','Yu Gothic',Meiryo,sans-serif;color:#28302b;background:#e9e6d7}*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0;min-height:100svh;display:grid;place-items:center;padding:max(8px,env(safe-area-inset-top)) 8px max(8px,env(safe-area-inset-bottom));overscroll-behavior:none}button{font:inherit;color:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}button:focus-visible,canvas:focus-visible{outline:3px solid #648a49;outline-offset:2px}.game{width:min(440px,100%,calc((100svh - 76px)*9/11));min-width:min(260px,100%)}.hud{height:52px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 8px;background:#f6f4e9;border:2px solid #354030;border-bottom:0}.hud>strong{font-family:monospace;font-size:25px;letter-spacing:-1px;white-space:nowrap}.hud small{font-size:10px;letter-spacing:0;margin-left:3px}.best{font-size:8px;line-height:1.5;color:#78856a;text-align:center}.best b{display:block;color:#4a6939;font:700 16px monospace}.hud button{background:transparent;border:0;font-size:20px;padding:4px 2px;color:#6c7e5d}#sound[aria-pressed=true]{color:#3b7834}.board-wrap{position:relative;overflow:hidden;border:2px solid #354030;background:#e4e2d2;touch-action:none}canvas{display:block;width:100%;height:auto;image-rendering:pixelated;touch-action:none;user-select:none}.control-zone{display:flex;justify-content:center;padding:12px 0 0}.joystick{width:100px;height:100px;border:2px solid #b4c2a0;border-radius:50%;background:#d0dac1;box-shadow:inset 0 0 0 12px #dce3cf;position:relative;touch-action:none;user-select:none;cursor:grab}.joystick>span{position:absolute;inset:0;display:grid;place-items:center;font:86px monospace;line-height:1;color:#9eaf89}.joystick i{position:absolute;left:50%;top:50%;width:44px;height:44px;margin:-22px;border-radius:50%;background:#5b764b;border:2px solid #3e562f;box-shadow:0 4px 0 #3e562f55;pointer-events:none}.joystick.active{border-color:#6f9651}.floating-stick{position:absolute;width:80px;height:80px;border:2px solid #597b4f88;border-radius:50%;background:#c7dca544;pointer-events:none;z-index:3}.floating-stick span{position:absolute;left:50%;top:50%;width:32px;height:32px;margin:-16px;border-radius:50%;background:#597b4fa8}.overlay{position:absolute;inset:0;display:grid;place-items:center;background:#eee9d585;backdrop-filter:blur(1px);padding:20px;z-index:5}.card{width:100%;max-width:270px;text-align:center}.primary{width:100%;padding:15px 17px;background:#bce790;border:2px solid #354030;box-shadow:0 4px 0 #354030;font-size:15px;font-weight:800}.primary:active{transform:translateY(3px);box-shadow:none}.result-card{background:#faf9ee;border:2px solid #354030;box-shadow:4px 4px 0 #35403033;padding:22px 18px}.result-card h2{font-size:24px;margin:0 0 15px}.result-number{font:800 56px monospace;letter-spacing:-2px}.result-number small{font-size:14px;letter-spacing:0;margin-left:5px}.result-card p{font-size:11px;color:#778365;margin:10px 0 20px}.new-best{display:block;color:#527a32;font-size:10px;font-weight:700;margin:8px 0}.bubble{position:absolute;bottom:10px;left:50%;transform:translateX(-50%);max-width:96%;width:max-content;padding:8px 10px;background:#c5e7a6;border:2px solid #354030;font-size:11px;font-weight:700;box-shadow:3px 3px 0 #35403033;pointer-events:none;z-index:4;text-align:center}.scene{position:absolute;inset:0;z-index:6;background:#e7edce;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:14px;isolation:isolate}.scene[data-kind=lost]{background:#eaddcb}#portrait{width:120px;height:140px;margin:-10px 0 -3px}.speech{background:#fffdf0;border:2px solid #354030;padding:9px 12px;font-size:13px;font-weight:700;box-shadow:3px 3px 0 #35403022}.scene h2{font-size:29px;letter-spacing:-1px;line-height:1.3;margin:18px 0 8px;color:#4f7d32}.scene[data-kind=lost] h2{color:#9b5135}.scene p{font-size:10px;color:#7a866a;margin:0}.skip{position:absolute;right:13px;bottom:10px;background:transparent;border:0;font-size:23px;color:#6c8059}#confetti{position:absolute;inset:0;z-index:-1;overflow:hidden;pointer-events:none}#confetti i{position:absolute;top:-20px;left:var(--x);width:7px;height:11px;background:var(--c);animation:fall var(--speed) var(--delay) linear infinite}.scene[data-kind=won] #portrait{animation:jump .4s ease-in-out 3}.scene[data-kind=lost] #portrait{animation:enter .25s ease-out}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}@keyframes fall{to{transform:translateY(500px) rotate(540deg)}}@keyframes jump{50%{transform:translateY(-15px) rotate(5deg)}}@keyframes enter{from{transform:translateX(100px);opacity:0}to{transform:translateX(0);opacity:1}}@media(max-height:650px){.game{width:min(360px,100%,calc((100svh - 68px)*9/11))}.joystick{width:78px;height:78px}.control-zone{padding-top:8px}.hud{height:44px}.hud>strong{font-size:21px}.scene h2{font-size:24px}#portrait{width:96px;height:112px}.speech{font-size:11px}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important}}
#timer.urgent{color:#ae5436}.hud>strong:first-child>small:first-child{margin:0 4px 0 0;font-family:inherit;font-size:9px}
/* Small feedback stays inside the board; gameplay never pauses for a celebration. */
.pickup-pop{animation:pickup-pop .25s ease-out}.moment{position:absolute;top:14px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:8px;padding:8px 12px;background:#f6f4e9ed;border:2px solid #56783e;box-shadow:3px 3px 0 #3d5e3328;white-space:nowrap;pointer-events:none;z-index:4;animation:moment-in .18s ease-out}.moment strong{font:800 22px monospace;color:#4c792e}.moment span{font-size:11px;font-weight:800}.board-wrap[data-phase=exit]{border-color:#689d3d;box-shadow:0 0 0 3px #b1d58c77}#timer.urgent{animation:clock-beat 1s ease-in-out infinite}.scene{gap:0;overflow:hidden}.scene::before{content:'';position:absolute;inset:-50%;z-index:-2;background:repeating-conic-gradient(from 0deg,#faf5c845 0deg 15deg,transparent 15deg 30deg);transform:rotate(-12deg);pointer-events:none;animation:clear-rays 4s ease-out both}.scene[data-kind=lost]::before{background:repeating-linear-gradient(0deg,transparent 0 5px,#815a4010 5px 6px);animation:none}.scene-label{font-size:11px;letter-spacing:5px;font-weight:900;color:#4f7d32;margin:0 0 6px;padding-left:5px}.scene[data-kind=lost] .scene-label{color:#9b5135;letter-spacing:3px}.scene #portrait{width:96px;height:112px;margin:-6px 0 -3px}.scene .speech{font-size:12px;max-width:100%;padding:8px 10px}.scene h2{font-size:27px;margin:15px 0 8px;animation:score-pop .4s .15s both}.ending-rank{display:block;max-width:100%;padding:6px 10px;background:#5d833c;color:#fffde9;border:1px solid #3c602b;box-shadow:2px 2px 0 #35502325;font-size:14px;line-height:1.4;transform:rotate(-3deg);animation:rank-stamp .25s .3s both}.scene[data-level='7'] .ending-rank,.scene[data-level='8'] .ending-rank{background:#d5af4c;color:#4d3715;border-color:#88702f}.scene[data-kind=lost] .ending-rank{background:#c6a486;color:#503b2b;border-color:#896d51;transform:rotate(2deg)}.scene .ending-comment{font-size:11px;line-height:1.6;color:#475b38;margin:12px 0 5px;font-weight:700}.scene #ending-copy{max-width:95%;font-size:10px;line-height:1.5}.scene #ending-crew{width:min(300px,100%);height:auto;margin:8px 0 -6px}.scene[data-kind=lost]{animation:caught-impact .3s ease-out}.result-card h2{font-size:20px;line-height:1.5}.result-card .result-comment{font-size:11px;line-height:1.65;color:#4f693b;font-weight:700;margin:10px 0 0}.result-card .result-number{animation:score-pop .25s ease-out}@keyframes pickup-pop{50%{transform:scale(1.25);color:#5a8c36}}@keyframes moment-in{from{opacity:0;transform:translate(-50%,-8px)}to{opacity:1;transform:translate(-50%,0)}}@keyframes score-pop{0%{opacity:0;transform:scale(.7)}70%{opacity:1;transform:scale(1.08)}100%{opacity:1;transform:scale(1)}}@keyframes rank-stamp{from{opacity:0;scale:1.5}to{opacity:1;scale:1}}@keyframes clear-rays{from{rotate:-14deg;opacity:0}to{rotate:12deg;opacity:1}}@keyframes caught-impact{0%{filter:brightness(1.6);translate:6px 0}30%{translate:-5px 0}60%{translate:3px 0}100%{filter:none;translate:0 0}}@keyframes clock-beat{50%{opacity:.45}}@media(max-height:650px){.scene #portrait{width:78px;height:91px}.scene h2{font-size:23px;margin:10px 0 6px}.ending-rank{font-size:12px;padding:4px 8px}.scene .ending-comment{font-size:10px;margin:8px 0 4px}.scene #ending-crew{width:240px;margin:4px 0 -8px}.scene-label{font-size:9px;margin-bottom:3px}.scene .speech{font-size:11px;padding:6px 8px}}@media(prefers-reduced-motion:reduce){.scene::before,.pickup-pop,.moment,#timer.urgent,.scene,.scene h2,.ending-rank,.result-number{animation:none!important}}
.scene-actions{width:min(250px,100%);margin-top:14px;flex-shrink:0}.scene-actions .primary{padding:11px 14px;font-size:14px}.scene-actions .new-best{margin:0 0 7px}.scene #ending-crew{margin-bottom:0}.scene h2{font-size:30px}.scene[data-kind=lost] h2{font-size:32px}@media(max-height:650px){.scene{padding:10px}.scene #portrait{width:66px;height:77px}.scene h2{font-size:25px;margin:9px 0 6px}.scene[data-kind=lost] h2{font-size:28px}.scene #ending-crew{width:210px;margin:4px 0 0}.scene-actions{margin-top:10px}.scene-actions .primary{padding:9px 12px;font-size:13px}.scene-actions .new-best{font-size:9px;margin-bottom:5px}.scene .ending-comment{margin:7px 0 3px}}
.scene[data-special=president]{background:#f1dea0;color:#423015}.scene[data-special=president]::before{background:repeating-conic-gradient(from 4deg,#79531b25 0deg 2deg,transparent 2deg 15deg);animation:rank-stamp .25s ease-out}.scene[data-special=president]::after{content:'';position:absolute;inset:6px;border:2px solid #8c651f88;pointer-events:none;z-index:-1}.scene[data-special=president] #portrait{animation:none}.scene[data-special=president] h2{font-family:'Yu Mincho','Hiragino Mincho ProN',serif;font-size:29px;font-weight:900;letter-spacing:-1px;color:#30220d;text-shadow:2px 2px #fff6bf;transform:skew(-5deg)}.scene[data-special=president] .ending-rank{background:#c99b2c;border-color:#765213;color:#fff9d8}.scene[data-special=president] .scene-label{color:#7d591a}.scene[data-special=president] .primary{background:#edca62;border-color:#654b1d;box-shadow:0 4px 0 #654b1d}.scene[data-special=president] .speech{border-color:#654b1d}@media(max-height:650px){.scene[data-special=president] h2{font-size:24px}}
.scene-actions{width:min(300px,100%)}.result-buttons{display:grid;grid-template-columns:1fr 1.05fr .8fr;gap:7px;align-items:stretch}.scene-actions .primary,.share-x,.save-image{display:flex;align-items:center;justify-content:center;white-space:nowrap;min-width:0;padding:11px 5px;font-size:12px;line-height:1.5;font-weight:800;border:2px solid #354030;text-decoration:none}.share-x{background:#28302b;color:#fffdf1;box-shadow:0 4px 0 #151e16;cursor:pointer}.save-image{background:#faf8ec;color:#475f36;box-shadow:0 4px 0 #35403055;font-size:11px}.share-x:active,.save-image:active{transform:translateY(3px);box-shadow:none}.share-x:focus-visible{outline:3px solid #648a49;outline-offset:2px}.scene #share-status{margin-top:9px;font-size:10px;color:#9b5135}@media(max-height:650px){.scene-actions .primary,.share-x,.save-image{padding:9px 4px;font-size:11px}.save-image{font-size:10px}.result-buttons{gap:6px}}
html,body{touch-action:none}.floating-stick{position:fixed;z-index:10}
