*{box-sizing:border-box}html,body{margin:0;background:#fff;color:#2a2328;font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Noto Sans JP",sans-serif}button{font:inherit;font-weight:700;min-height:44px;border:0;border-radius:8px;background:#f3f4f6;color:#2a2328;padding:8px 12px;touch-action:manipulation;-webkit-tap-highlight-color:transparent}button:disabled{opacity:.4}[hidden]{display:none!important}main{height:calc(100dvh - var(--nav-height,52px));padding:4px 8px max(4px,env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:4px}.stage{position:relative;flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column;border-radius:12px;background:#192f36;color:#fff}.hud{height:38px;flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:4px;padding:0 12px;font-size:13px;font-weight:700}.hud #goals{color:#ffe09b}.board-area{display:flex;align-items:center;justify-content:center;flex:1;min-height:0;background:radial-gradient(ellipse,#35595b,#192f36)}#board{display:grid;grid-template-columns:repeat(7,1fr);aspect-ratio:1;border:2px solid #cfb77a;box-shadow:0 0 0 3px #112329;border-radius:4px;touch-action:none}.cell{position:relative;min-width:0;min-height:0;display:flex;align-items:center;justify-content:center;background:#547372;border:1px solid #365553;font-size:clamp(18px,6vw,32px);color:#ffe298;line-height:1}.wall{background:linear-gradient(145deg,#304650,#152d37);border:2px solid #617073;box-shadow:inset 1px 1px #b3a77e55}.goal{background:#687957;color:#ffe1a0;text-shadow:0 0 7px #ffdf7e}.box:after{content:'';position:absolute;inset:4px;border:2px solid #d9c899;border-radius:4px;box-shadow:inset 0 2px #fff5,0 2px 2px #0007;pointer-events:none}.box{background:linear-gradient(145deg,#c2a36a,#75603e);color:#fff0c7}.box.placed{background:linear-gradient(145deg,#ecce75,#a87922);color:#fff;box-shadow:inset 0 0 10px #ffe58b}.player img{position:absolute;width:115%;height:115%;object-fit:contain;z-index:1;filter:drop-shadow(0 2px 2px #0008);pointer-events:none}#level-name{font-size:12px;text-align:center;margin:3px 0;color:#d9e4df}.tools{display:flex;gap:8px;padding:4px 12px;justify-content:center;flex-shrink:0}.tools button{font-size:12px;background:#304950;color:#fff}.pad{display:grid;grid-template-columns:repeat(3,58px);grid-template-rows:48px 48px;gap:4px;align-self:center;margin:2px 0 8px;flex-shrink:0}.pad button{font-size:25px;background:#e8e6d9;color:#213c40;border-bottom:3px solid #a8b6af}.pad button:active{background:#f6d585;transform:translateY(1px)}[data-dir=up]{grid-column:2}[data-dir=left]{grid-column:1;grid-row:2}[data-dir=down]{grid-column:2;grid-row:2}[data-dir=right]{grid-column:3;grid-row:2}.buddy{display:flex;align-items:center;gap:8px;min-height:62px;flex-shrink:0}.buddy img{width:60px;height:60px;object-fit:contain}.buddy small{font-size:11px;color:#6e626a}.buddy p{font-size:13px;margin:3px 0;line-height:1.4}#overlay{position:absolute;inset:0;background:#0a2028d9;display:flex;align-items:center;justify-content:center;padding:12px;z-index:4}.panel{max-width:320px;width:100%;padding:16px;background:#fff;color:#2a2328;text-align:center;border-radius:12px}.panel img{width:110px;height:110px;object-fit:contain}.panel h2{font-size:21px;margin:5px 0}.panel p{font-size:13px;line-height:1.6;margin:8px 0}.panel #best{font-size:12px;color:#6e626a}.panel button{width:100%;margin-top:4px}.panel #play{background:#29494c;color:#fff}@media(max-height:650px){.buddy{min-height:46px}.buddy img{width:44px;height:44px}.buddy p{font-size:12px}.pad{grid-template-rows:44px 44px;margin-bottom:4px}.tools{padding-block:2px}.panel{padding:10px}.panel img{width:80px;height:80px}.hud{height:32px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
