/* Touch controls are visible only while the game is active on touch hardware. */
.touch-controls[hidden]{display:none!important}
.touch-playing,.touch-playing canvas{touch-action:none;overscroll-behavior:contain}
.touch-controls{position:absolute;inset:0;z-index:3;pointer-events:none;user-select:none;-webkit-user-select:none}
.touch-stick{position:absolute;left:max(12px,env(safe-area-inset-left));bottom:max(12px,env(safe-area-inset-bottom));width:104px;height:104px;border:2px solid #fff9;background:#110c1db0;border-radius:50%;box-shadow:0 2px 12px #0008;touch-action:none;pointer-events:auto}
.touch-stick::after{content:'移動';position:absolute;top:-21px;left:0;width:100%;font-size:11px;font-weight:700;text-align:center;color:#fff;text-shadow:0 1px 4px #000}
.touch-stick-knob{position:absolute;left:50%;top:50%;width:42px;height:42px;border:1px solid #fff9;border-radius:50%;background:#ff9c3ce8;transform:translate(-50%,-50%);pointer-events:none}
.touch-actions{position:absolute;right:max(10px,env(safe-area-inset-right));bottom:max(10px,env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(2,minmax(58px,1fr));gap:7px;pointer-events:auto}
.touch-actions button{margin:0;min-width:60px;min-height:52px;padding:5px 7px;border:1px solid #ffe0a3b0;border-radius:14px;background:#352136e8;color:#fff;font-size:12px;line-height:1.1;text-shadow:0 1px 2px #000;touch-action:none;box-shadow:0 2px 8px #0008}
.touch-actions button:active{background:#e77826;color:#fff}
.touch-playing #hint{bottom:190px;padding:0 10px;font-size:12px;pointer-events:none}
@media(max-width:600px){.game{height:min(74svh,700px);min-height:360px}.overlay{overflow-y:auto;align-items:start}.panel{margin:auto}.panel h2{margin:12px 0}.panel p{margin:8px 0}.touch-playing #hud{top:10px;left:10px;right:10px;gap:12px;font-size:17px}.touch-playing #hud small{font-size:9px}}
@media(max-width:380px){.touch-stick{width:90px;height:90px}.touch-stick-knob{width:36px;height:36px}.touch-actions{gap:4px;grid-template-columns:repeat(2,55px)}.touch-actions button{min-width:55px;min-height:46px}.touch-playing #hint{bottom:165px}}
@media(max-height:500px) and (orientation:landscape){main{padding-bottom:12px}.intro{padding:8px 0}.intro h1{font-size:28px}.intro p{display:none}.game{height:78svh;min-height:240px}.touch-stick{width:90px;height:90px}.touch-actions button{min-height:44px}.touch-playing #hint{bottom:160px}}
