/* One action family; on touch screens, utilities sit above the movement stick. */
#game #combat-actions{position:absolute;right:calc(var(--safe-right,0px) + 36px);bottom:calc(var(--safe-bottom,0px) + 116px);display:flex;align-items:flex-start;gap:12px;z-index:var(--z-control);pointer-events:none}
#game #auto-quick-controls{position:static;display:grid;grid-template-columns:72px 72px;grid-template-rows:72px 44px;gap:8px;align-items:center;pointer-events:none}
#game #return-town-btn,#game #auto-combat-toggle,#game #dodge-btn{position:relative;inset:auto;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;width:72px;height:72px;min-width:0;min-height:0;padding:6px;border:1px solid #bca36e;border-radius:18px;background:linear-gradient(155deg,#35493b,#14251f 80%);color:#f5e4b6;box-shadow:inset 0 0 0 3px #09181099,inset 0 1px 0 #fff2,0 4px 12px #0006;pointer-events:auto;touch-action:manipulation;cursor:pointer;font:600 11px/1.3 "Noto Sans Thai",system-ui;transition:background .15s,border-color .15s,box-shadow .15s}
#game #return-town-btn{border-color:#83aaa8;color:#d9efec;background:linear-gradient(155deg,#30494b,#15292c 80%)}
#game #dodge-btn{border-color:#94bca0;color:#e1f5de;background:linear-gradient(155deg,#3d5b48,#192f25 80%)}
#game #combat-actions svg{display:block;width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#game #auto-combat-toggle svg{width:32px;height:32px;stroke-width:2.4}
#game #return-town-btn>span:first-child,#game #dodge-btn>span{font-size:inherit;line-height:1}
#game #bot-button-label{font-size:10px;line-height:14px;white-space:nowrap}
#game #dodge-btn small{font:inherit}
#game #dodge-btn kbd{position:absolute;top:calc(100% + 7px);font:500 10px/16px "Noto Sans Thai",system-ui;color:#ede5ca;background:#14251fd9;border:1px solid #a995623d;border-radius:5px;padding:1px 7px}
#game .auto-combat-control{position:relative;grid-column:2;grid-row:1;pointer-events:none}
#game #auto-settings-btn{position:absolute;top:-10px;right:-4px;z-index:var(--z-local-content,1);width:32px;height:32px;min-height:32px;padding:0;border:1px solid #bca36e;border-radius:50%;background:#152820;color:#dcc68d;box-shadow:0 2px 6px #0008;pointer-events:auto;font-size:17px}
#game #bot-usage-label{position:static;grid-column:2;grid-row:2;transform:none;align-self:center;justify-self:center;padding:4px 6px;border:1px solid #bca36e33;border-radius:8px;background:#14251feb;color:#f0dfb8;font-size:10px;line-height:15px;white-space:normal;text-align:center}
#game #auto-combat-toggle[aria-pressed=true]{background:linear-gradient(155deg,#577643,#213f2c 80%);border-color:#c4e99c;color:#ecffd5;box-shadow:inset 0 0 0 3px #10231799,0 0 14px #9cdd6940}
#game #return-town-btn.channeling{border-color:#bdf8fa;box-shadow:inset 0 0 0 3px #10231799,0 0 14px #8deeff60}
#game #combat-actions button:disabled{opacity:.48;cursor:default}
#game #combat-actions button:focus-visible{outline:2px solid #ffedbc;outline-offset:4px}
#game #combat-actions button:active:not(:disabled){filter:brightness(1.2)}
@media(hover:hover){#game #combat-actions button:hover:not(:disabled){border-color:#fff0bf;filter:brightness(1.12)}}
#game #bot-settings-panel{right:calc(var(--safe-right,0px) + 36px);bottom:calc(var(--safe-bottom,0px) + 252px)}
@media(max-width:750px),(pointer:coarse) and (max-width:1100px),(max-width:1100px) and (max-height:600px){
 #game #combat-actions{display:contents}
 #game #auto-quick-controls{position:absolute;left:calc(var(--safe-left,0px) + 12px);right:auto;bottom:calc(var(--mobile-bottom) + var(--mobile-stick-size,104px) + 14px);grid-template-columns:64px 64px;grid-template-rows:64px 44px;gap:8px;z-index:var(--z-control)}
 #game #return-town-btn,#game #auto-combat-toggle{width:64px;height:64px;border-radius:16px;padding:4px;gap:3px;font-size:10px}
 body.equipment-adventure #game #dodge-btn{position:absolute;right:calc(var(--safe-right,0px) + 18px);bottom:calc(var(--mobile-bottom) + 82px);width:48px;height:48px;border-radius:14px;padding:4px;gap:2px;font-size:10px;z-index:var(--z-control)}
 #game #auto-settings-btn{width:36px;height:36px;min-height:36px;font-size:18px}
 #game #dodge-btn svg{width:21px;height:21px}
 #game #dodge-btn kbd{display:none}
 #game #bot-settings-panel{left:calc(var(--safe-left,0px) + 12px);right:auto;bottom:calc(var(--mobile-bottom) + var(--mobile-stick-size,104px) + 146px);max-height:calc(100dvh - var(--safe-top,0px) - var(--safe-bottom,0px) - 290px)}
}
@media(max-width:420px) and (orientation:portrait){
 body.equipment-adventure #game #dodge-btn{bottom:calc(var(--mobile-bottom) + 187px)}
}
/* Narrow phones reserve the bottom-right shelf below the combat skill arc. */
@media(max-width:359px) and (orientation:portrait){
 #game #auto-quick-controls{left:auto;right:calc(var(--safe-right,0px) + 12px);bottom:var(--mobile-bottom);grid-template-columns:56px 56px;grid-template-rows:56px 44px;gap:4px}
 #game #return-town-btn,#game #auto-combat-toggle{width:56px;height:56px;border-radius:14px;font-size:9px}
 #game #bot-button-label{font-size:9px}
 #game #auto-settings-btn{top:0;right:-6px;width:32px;height:32px;min-height:32px;font-size:17px}
 #game #bot-usage-label{font-size:9px;padding:3px}
 #game #bot-settings-panel{left:auto;right:calc(var(--safe-right,0px) + 12px);bottom:calc(var(--mobile-bottom) + 116px);max-height:calc(100dvh - var(--safe-top,0px) - var(--safe-bottom,0px) - 156px)}
}
@media(max-width:1100px) and (max-height:600px) and (orientation:landscape){
 #game #auto-quick-controls{left:calc(var(--safe-left,0px) + var(--mobile-stick-size,104px) + 28px);bottom:var(--mobile-bottom)}
 #game #bot-settings-panel{left:calc(var(--safe-left,0px) + var(--mobile-stick-size,104px) + 28px);bottom:calc(var(--mobile-bottom) + 128px);max-height:calc(100dvh - var(--safe-top,0px) - var(--safe-bottom,0px) - 164px)}
}
@media(prefers-reduced-motion:reduce){#game #combat-actions button{transition:none}}
