*{box-sizing:border-box}
html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#52785d;color:#f7f7ed;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
button,a{-webkit-tap-highlight-color:transparent}
button{font:600 14px/1.35 system-ui,sans-serif;color:inherit;border:1px solid #edf2e27a;background:#304b39e8;border-radius:12px;padding:11px 16px;min-height:44px;cursor:pointer}
button:disabled{opacity:.5;cursor:default}
button:focus-visible,a:focus-visible{outline:3px solid #ffe5a0;outline-offset:3px}
[hidden]{display:none!important}
#stage{position:relative;width:100%;height:100dvh;min-height:320px;overflow:hidden}
#kick-canvas,#ink{position:absolute;inset:0;width:100%;height:100%}
#ink{touch-action:none;cursor:crosshair}
.site-header{position:absolute!important;top:0;left:0;right:0;display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px;align-items:center;padding:max(14px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) 40px max(18px,env(safe-area-inset-left));background:linear-gradient(#253b42b8,transparent);pointer-events:none;z-index:10}
.site-header a,.site-header button,.site-header details{pointer-events:auto}
.heading{min-width:0}
.heading a{font-size:12px;color:#fff;text-decoration:none;display:inline-block;min-height:26px}
h1{font-size:17px;line-height:1.2;margin:4px 0 0;font-weight:650;letter-spacing:.015em;overflow-wrap:break-word}
.score{display:flex;flex-direction:column;align-items:center;gap:1px;max-width:80px}
.score small{font-size:10px;line-height:1.2;text-align:center}
.score strong{font-size:23px;font-variant-numeric:tabular-nums;font-weight:700}
.header-controls{display:flex;gap:6px;align-items:center}
#mute,#help{padding:0;width:44px;height:44px;min-width:44px;margin:0}
#mute{font-size:22px}
#help{font-size:23px;font-weight:650}
.site-header .header-controls .lang-switcher{position:relative!important;top:auto!important;right:auto!important;transform:none!important}
.site-header .header-controls .lang-switcher summary{width:44px;height:44px;background:#304b39d9!important;color:#fff!important;border-radius:12px}
#loading{position:absolute;left:10%;top:46%;width:80%;text-align:center;background:#304b39e8;padding:18px;border-radius:12px}
#tutorial-caption,#first-shot-tip{position:absolute;top:125px;left:50%;transform:translateX(-50%);width:max-content;max-width:min(90vw,600px);margin:0;text-align:center;color:#fff9e6;background:#304b39b5;border-radius:12px;pointer-events:none;z-index:6;overflow-wrap:break-word}
#tutorial-caption{font-size:clamp(20px,5.4vw,23px);font-weight:700;line-height:1.35;padding:10px 15px;text-shadow:0 1px 2px #203b2d}
#first-shot-tip{font-size:14px;line-height:1.5;padding:9px 14px;background:#304b39d9}
#dizzy{position:absolute;transform:translate(-50%,-100%);font-size:13px;font-weight:750;white-space:nowrap;color:#ffe489;background:#3b482de8;border:1px solid #f9df7a;border-radius:10px;padding:5px 9px;pointer-events:none;margin:0;z-index:5}
#toast{position:absolute;top:max(166px,17%);left:50%;transform:translateX(-50%);max-width:min(88vw,620px);width:max-content;min-width:180px;text-align:center;color:#f8f3db;background:#263b32ed;border:1px solid #fff7b180;border-radius:16px;padding:13px 20px;pointer-events:none;box-shadow:0 8px 24px #0002}
#toast strong{font-size:25px}
#toast p{font-size:12px;line-height:1.7;margin:5px 0 0}
#replay-label{position:absolute;top:130px;left:50%;transform:translateX(-50%);color:#26382d;background:#fff4cde8;border-radius:999px;padding:8px 16px;font-size:13px;font-weight:700;margin:0;max-width:90vw;text-align:center;pointer-events:none}
.bottom{position:absolute;bottom:0;left:0;right:0;padding:24px max(18px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left));background:linear-gradient(transparent,#243e30ad);pointer-events:none;text-align:center}
#hint{font-size:13px;line-height:1.6;white-space:pre-line;text-shadow:0 1px 3px #153723;margin:0 0 12px;pointer-events:none}
.buttons{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px;max-width:420px;margin:0 auto}
.buttons button{pointer-events:auto;flex:1 1 calc(50% - 4px);min-width:0;padding:9px 10px;font-size:13px;overflow-wrap:break-word}
#change-position small{display:block;font-size:10px;opacity:.75;margin-top:3px;font-weight:400}
#placement-tip{display:block;margin:8px 0 0;font-size:12px;line-height:1.35;color:#edf2e2;opacity:.86;text-shadow:0 1px 2px #203b2d}
#again{background:#ede6c9;color:#273e2e;border-color:#ede6c9}
#save-gif{flex:0 1 auto;padding:8px 13px;background:#304b39b8;color:#f7f7ed;border-color:#edf2e255}
#penalty[aria-pressed=true]{background:#fff4cd;color:#293e30;border-color:#fff4cd}
#speed-readout{position:absolute;top:90px;left:max(18px,env(safe-area-inset-left));font-size:17px;font-weight:750;font-variant-numeric:tabular-nums;color:var(--speed-tier-color,#ffffff);background:#304b39db;padding:7px 11px;border-radius:10px;pointer-events:none}
#speed-readout:not([data-tier=ordinary]){text-shadow:0 0 var(--speed-tier-glow,2px) var(--speed-tier-color)}
#speed-readout[data-tier=professional]{--speed-tier-glow:2px}#speed-readout[data-tier=record]{--speed-tier-glow:4px}#speed-readout[data-tier=train]{--speed-tier-glow:6px}#speed-readout[data-tier=maglev]{--speed-tier-glow:8px}#speed-readout[data-tier=maglevTest]{--speed-tier-glow:10px}#speed-readout[data-tier=airliner]{--speed-tier-glow:12px}#speed-readout[data-tier=sonic]{--speed-tier-glow:14px}#speed-readout[data-tier=jet]{--speed-tier-glow:16px}#speed-readout[data-tier=blackbird]{--speed-tier-glow:18px}#speed-readout[data-tier=rocketPlane]{--speed-tier-glow:20px}#speed-readout[data-tier=mach10]{--speed-tier-glow:22px}#speed-readout[data-tier=orbit]{--speed-tier-glow:24px}#speed-readout[data-tier=escape]{--speed-tier-glow:26px}
#speed-readout[data-tier=sonic],#speed-readout[data-tier=jet],#speed-readout[data-tier=blackbird],#speed-readout[data-tier=rocketPlane],#speed-readout[data-tier=mach10],#speed-readout[data-tier=orbit],#speed-readout[data-tier=escape]{box-shadow:inset 0 0 0 1px var(--speed-tier-color)}
.speed-tier-badge{display:block;width:max-content;max-width:100%;margin:5px auto 0;padding:3px 8px;border-radius:8px;background:var(--badge-color,#ffdd79);color:#26372d;font-size:12px;font-weight:750;line-height:1.5}
#result-record{margin-left:0}
#gif-progress{position:absolute;top:90px;right:max(18px,env(safe-area-inset-right));max-width:calc(50vw - 26px);text-align:center;margin:0;padding:7px 10px;background:#304b39ed;border-radius:10px;font-size:12px;white-space:normal;pointer-events:none;z-index:22}
#export-cover{position:absolute;inset:0;background:#20362ca8;display:flex;align-items:center;justify-content:center;z-index:20;touch-action:none}
#export-cover p{color:#fff4c8;font-size:16px;padding:18px}
noscript{position:absolute;left:10%;top:40%;background:#304b39;padding:20px}
@media(min-width:800px){.site-header{gap:14px;padding:20px 28px 50px}h1{font-size:23px}.heading a{font-size:13px}.score{max-width:140px}.score strong{font-size:27px}.score small{font-size:12px}.bottom{padding-bottom:24px}#hint{font-size:15px}.buttons{max-width:640px}.buttons button{flex:0 1 auto;min-width:110px;padding:10px 16px}.buttons #save-gif{min-width:0}#tutorial-caption,#first-shot-tip{top:130px}}
@media(max-width:370px){.site-header{gap:6px;padding-left:12px;padding-right:12px}.header-controls{gap:4px}h1{font-size:16px}.score small{font-size:9px}.score strong{font-size:21px}}

#shoot-controls{display:flex;flex-wrap:wrap;max-width:480px}#shoot-controls #place-ball,#shoot-controls #penalty{flex:1 1 calc(50% - 5px);min-height:52px;font-size:16px}
#placement-banner{position:absolute;top:120px;left:50%;transform:translateX(-50%);width:min(90vw,620px);padding:12px 16px;color:#fff8df;background:#2e483be8;border-radius:14px;text-align:center;pointer-events:none}#placement-banner strong{display:block;font-size:17px;line-height:1.4}#position{display:block;font-size:12px;margin-top:5px;color:#eef3e4}#placement-reason{position:absolute;top:215px;left:50%;transform:translateX(-50%);width:min(88vw,560px);padding:9px 12px;margin:0;color:#fff2d4;background:#653f32e8;border-radius:10px;text-align:center;font-size:13px;line-height:1.45;pointer-events:none}
#placement-controls{pointer-events:auto;max-width:560px;margin:auto}.presets{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.presets button{min-height:48px;padding:7px 4px;font-size:12px;overflow-wrap:anywhere}#placement-done{display:block;width:100%;margin-top:10px;min-height:52px;background:#f7edc5;color:#263d2f;border-color:#f7edc5;font-size:17px}#first-shot-tip{font-size:14px;line-height:1.5;max-width:min(90vw,560px)}
@media(min-width:800px){#placement-banner{top:120px}.presets button{font-size:14px;overflow-wrap:normal}#shoot-controls #place-ball,#shoot-controls #penalty{min-width:155px}}
#result-summary{position:absolute;left:18px;top:100px;max-width:calc(100% - 36px);margin:0;padding:8px 11px;background:#304b39e8;color:#fff4cd;border-radius:10px;font-size:12px;line-height:1.5;pointer-events:none}
#result-summary{z-index:3}
#auto-camera{position:absolute;top:100px;right:18px;z-index:12;padding:7px 10px;min-height:40px;max-width:140px;font-size:12px;background:#304b39c9}
#stage[data-manual-camera=true] #result-summary{max-width:calc(100% - 182px)}
#replay-fade{position:absolute;inset:0;background:#253b42;opacity:0;pointer-events:none;z-index:1}
#stage[data-mode=result] #ink{cursor:grab}#stage[data-mode=result] #ink:active{cursor:grabbing}
#stage[data-mode=result] #toast{animation:replay-result-contract 1.5s ease-in forwards;z-index:4}
@keyframes replay-result-contract{0%,80%{opacity:1;transform:translateX(-50%) scale(1)}100%{opacity:0;transform:translate(-50%,-95px) scale(.3)}}
#stage[data-mode=result] .bottom{z-index:3;padding-top:14px;background:linear-gradient(transparent,#243e307d)}
#stage[data-mode=result] #result-controls button{min-height:46px;background-color:#304b39b8}#stage[data-mode=result] #result-controls #again{background:#ede6c9df}
#result-controls{max-width:480px;margin:10px auto 0}#result-controls button{flex:1 1 calc(50% - 5px);min-height:52px;font-size:16px}#stage[data-mode=result] #shoot-controls button{min-height:44px;font-size:13px}#stage[data-mode=result] #gif-progress{top:151px}#stage[data-mode=result] #toast{top:195px}
#gif-preview{position:fixed;inset:0;z-index:50;padding:12px;display:flex;align-items:center;justify-content:center;background:#1b302beb;overflow:hidden}
.gif-preview-panel{width:min(420px,100%);max-height:calc(100dvh - 24px);overflow:auto;padding:14px;background:#35513f;border:1px solid #f6efcc66;border-radius:16px;box-shadow:0 12px 40px #0004;text-align:center}
.gif-preview-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}.gif-preview-heading h2{font-size:17px;line-height:1.3;margin:0;text-align:left}.gif-preview-heading button{flex:0 0 auto;font-size:13px;padding:8px 12px}
#gif-preview-image{display:block;margin:auto;max-width:100%;max-height:46dvh;width:auto;height:auto;object-fit:contain;border-radius:6px;touch-action:auto;-webkit-touch-callout:default}
.gif-preview-actions{display:flex;gap:8px;justify-content:center;margin-top:10px}.gif-preview-actions button,.gif-preview-actions a{display:flex;align-items:center;justify-content:center;flex:1 1 0;min-height:48px;padding:10px 12px;font:600 15px/1.3 system-ui,sans-serif;color:#f7f7ed;background:#304b39;border:1px solid #edf2e27a;border-radius:12px;text-decoration:none}.gif-preview-actions a{background:#f7edc5;color:#263d2f;border-color:#f7edc5}
#gif-preview-long-press,#gif-preview-browser-hint,#gif-preview-status{font-size:12px;line-height:1.4;margin:9px 0 0;overflow-wrap:anywhere}#gif-preview-browser-hint{color:#ffe5a0}#gif-preview-copy-link{min-height:44px;margin-top:8px;width:100%}#gif-preview-status:empty{display:none}

#gif-preview-share{background:#f7edc5;color:#263d2f;border-color:#f7edc5}#gif-preview-download{background:#304b39;color:#f7f7ed;border-color:#edf2e27a;font-size:13px}.gif-preview-actions button:active,.gif-preview-actions a:active{transform:scale(.96);filter:brightness(1.12)}#gif-preview-long-press{font-size:15px;font-weight:650;color:#fff3be}#gif-preview.save-help #gif-preview-image{max-height:54dvh}#gif-preview.save-help #gif-preview-long-press{padding:10px;border-radius:10px;background:#f7edc5;color:#263d2f}#gif-preview.save-help #gif-preview-status{font-size:13px}

#gif-preview-ios-help{font-size:12px;line-height:1.4;color:#eef2db;margin:8px 0 0}
