*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;background:#000;color:#fff;font-family:"Courier New",monospace;overflow:hidden;
 user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;touch-action:none;overscroll-behavior:none;position:fixed;inset:0}
body{display:flex;align-items:center;justify-content:center}
#game-wrapper{--cw:min(100vw - 12px,(100dvh - 64px)*224/288,672px);display:flex;flex-direction:column;align-items:center;gap:6px;padding:6px;padding-bottom:max(6px,env(safe-area-inset-bottom));max-height:100dvh;width:100vw}
#topbar{width:max(var(--cw),300px);max-width:100%;display:flex;gap:6px;align-items:center}
#back-link{color:#fff;text-decoration:none;font-size:13px;letter-spacing:2px;border:1px solid #fff;padding:5px 9px;margin-right:auto}
#back-link:hover{background:#fff;color:#000}
.mini-btn{background:#000;color:#fff;border:1px solid #fff;font:inherit;font-size:12px;letter-spacing:1px;padding:5px 9px;cursor:pointer}
#canvas-wrap{line-height:0;border:1px solid #333}
#game{display:block;background:#000;width:var(--cw);height:auto;image-rendering:pixelated;image-rendering:crisp-edges;touch-action:none}
#help{font-size:11px;color:#aaa;letter-spacing:1px;text-align:center;max-width:var(--cw)}
#mobile-controls{display:none;width:100%;max-width:520px;justify-content:space-between;align-items:center;padding:0 10px}
#dpad{position:relative;width:150px;height:150px;border-radius:50%;border:2px solid #fff;background:rgba(255,255,255,.06);touch-action:none}
.dp{position:absolute;width:50px;height:50px;display:flex;align-items:center;justify-content:center;font-size:22px;border-radius:10px;pointer-events:none}
.dp[data-dir=U]{left:50px;top:0}.dp[data-dir=D]{left:50px;bottom:0}.dp[data-dir=L]{left:0;top:50px}.dp[data-dir=R]{right:0;top:50px}
.dp.active{background:rgba(255,255,255,.4)}
#btn-pump{width:120px;height:120px;border-radius:50%;border:3px solid #ff3030;background:rgba(255,40,40,.15);color:#fff;font:inherit;font-size:20px;font-weight:bold;letter-spacing:2px;touch-action:none}
#btn-pump.active{background:rgba(255,40,40,.55)}
body.touch #mobile-controls{display:flex}
body.touch #help{display:none}
body.touch #game-wrapper{--cw:min(100vw - 12px,(100dvh - 230px)*224/288,672px)}
@media (orientation:landscape){body.touch #game-wrapper{--cw:min(100vw - 12px,(100dvh - 54px)*224/288,672px);display:grid;grid-template-columns:1fr auto 1fr;grid-template-rows:auto 1fr;align-items:center}
 body.touch #topbar{grid-column:1/4}
 body.touch #canvas-wrap{grid-column:2;grid-row:2}
 body.touch #mobile-controls{display:contents}
 body.touch #dpad{grid-column:1;grid-row:2;justify-self:center}
 body.touch #btn-pump{grid-column:3;grid-row:2;justify-self:center}}
