:root{font-family:system-ui,-apple-system,'Hiragino Kaku Gothic ProN',sans-serif;color:#2a2328;background:#fff;color-scheme:light}*{box-sizing:border-box}body{margin:0;min-height:100svh;-webkit-tap-highlight-color:transparent}button{font:inherit;min-height:44px;border:1px solid #dfdce0;border-radius:8px;padding:6px 9px;color:inherit;background:#f3f4f6;touch-action:manipulation}button:disabled{opacity:.5}[hidden]{display:none!important}.shell{max-width:450px;margin:auto;padding:4px 8px max(6px,env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:6px}.toolbar,.score-head{display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:12px}.toolbar #best{color:#6e626a}.score{padding:5px 8px;background:#f5f3f8;border-radius:10px}.score-head button{min-height:36px}#target{display:flex;justify-content:space-between;gap:3px;margin-top:5px}.tone{border-radius:6px;background:#fff;padding:6px 0;flex:1;text-align:center;font-size:13px;border-bottom:3px solid var(--tone)}.tone.lit{background:#e5d9f3;outline:2px solid #7c65a2}#hint{font-size:12px;min-height:18px;margin:0;color:#6e626a}.field{position:relative;border-radius:12px;background:#f5f3ed;border:1px solid #e2dfd4;padding:8px;overflow:hidden}#board{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;aspect-ratio:1}#board button{position:relative;min-width:0;min-height:0;background:#e8e8df;border:1px solid #d3d4c7;border-radius:12px;font-size:20px;padding:3px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}#board button.rock{background:#deded9;color:#8c8b82}#board button.path{background:#fff;border-bottom:5px solid var(--tone)}#board button.selected{outline:3px solid #8b709e;outline-offset:-2px}#board button.available{border:2px dashed #8e9c7e;background:#f7faf2}#board small{font-size:10px;color:#6e626a}#board .walker{width:48px;height:48px;position:absolute;inset:50% auto auto 50%;transform:translate(-50%,-50%);object-fit:contain;filter:drop-shadow(0 2px 2px #fff)}.panel{position:absolute;inset:0;background:#fffffff5;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:12px;padding:18px;overflow:auto}.panel h2{font-size:20px;margin:0}.panel p{font-size:13px;line-height:1.65;margin:0}.panel button{width:100%;font-weight:700}.editor{font-size:12px}.editor>b{display:block;margin-bottom:5px}#palette{display:flex;gap:6px}#palette button{flex:1;border-bottom:4px solid var(--tone)}#palette button[aria-pressed=true]{outline:2px solid #8b709e;outline-offset:-2px}.controls{display:flex;gap:5px}.controls button{flex:1;font-size:12px}.controls #walk{flex:1.4;background:#eee7f3;font-weight:700}.companion{display:flex;gap:8px;align-items:center}.companion img{object-fit:contain}.companion b{font-size:11px;color:#6e626a}.companion p{font-size:12px;line-height:1.5;margin:3px 0}#save-note{font-size:10px;color:#6e626a;margin:0}@media(max-height:720px){.shell{gap:4px}#board{aspect-ratio:1.18}.companion img{width:42px;height:42px}.companion p{font-size:11px}.score{padding:3px 6px}.tone{padding:3px 0}#board{gap:5px}.panel{gap:7px}.panel img{width:76px;height:76px}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
/* Keep the entire touch surface visible on short portrait phones. */
body{height:100dvh;display:flex;flex-direction:column}.game-nav-header{flex-shrink:0}.shell{width:100%;flex:1;min-height:0;overflow:auto}.field{flex:1;min-height:180px}#board{height:100%;aspect-ratio:auto;min-height:162px}.toolbar,.score,.editor,.controls,.companion,#hint,#save-note{flex-shrink:0}@media(max-height:720px){.shell{gap:3px}.toolbar button{min-height:36px}.toolbar{min-height:36px}.score-head button{min-height:34px}.score-head{font-size:11px}#target{margin-top:2px}.tone{padding:2px 0}.editor>b{margin-bottom:2px}.companion{min-height:32px}.companion img{width:32px;height:32px}.companion p{margin:1px 0}.field{min-height:180px;padding:5px}#board{gap:4px}#board button{font-size:16px;border-radius:8px}#board small{font-size:9px}#board .walker{width:36px;height:36px}.companion b{font-size:10px}#save-note{font-size:9px}}
#board{grid-template-rows:repeat(4,minmax(0,1fr))}
.shell:has(#panel:not([hidden])) .editor,.shell:has(#panel:not([hidden])) .controls{display:none}
.panel{justify-content:safe center}
@media(max-height:720px){.shell{gap:2px}.field{min-height:202px}#board{min-height:188px}.companion{min-height:28px}.companion img{width:28px;height:28px}.tone{padding:1px 0}.score-head button{min-height:30px}}
