/* One immutable cross layout for exploration, menus and battles, in every
   viewport. Only the four existing buttons accept input; the center is inert. */
.dual-console:has(#touch-controls) #touch-controls[data-enabled=true]{
 --dpad-key:44px;--dpad-gap:2px;--dpad-span:calc(var(--dpad-key)*3 + var(--dpad-gap)*2);
 display:grid!important;grid-template-columns:var(--dpad-span) minmax(0,1fr) 44px 44px!important;
 grid-template-rows:repeat(3,var(--dpad-key))!important;gap:var(--dpad-gap) 4px!important;
 height:calc(var(--dpad-span) + 18px)!important;min-height:calc(var(--dpad-span) + 18px)!important;
 max-height:none!important;flex:none!important;flex-wrap:nowrap!important;align-items:center!important;
 justify-content:stretch!important;padding:6px!important;width:100%!important;max-width:none!important;
 touch-action:none;user-select:none;-webkit-user-select:none;
}
#touch-controls .dpad{
 grid-column:1!important;grid-row:1 / 4!important;display:grid!important;
 grid-template-columns:repeat(3,var(--dpad-key))!important;grid-template-rows:repeat(3,var(--dpad-key))!important;
 gap:var(--dpad-gap)!important;width:var(--dpad-span)!important;height:var(--dpad-span)!important;
 flex:none!important;align-self:center!important;justify-self:start!important;position:relative;isolation:isolate;
}
#touch-controls .dpad::after{
 content:''!important;display:block!important;grid-column:2!important;grid-row:2!important;
 position:relative!important;inset:auto!important;transform:none!important;
 width:var(--dpad-key)!important;height:var(--dpad-key)!important;min-width:0!important;min-height:0!important;
 border:1px solid #3a5c66;border-radius:3px;background:radial-gradient(circle,#68878d 0 17%,#526f7b 18% 25%,#385c68 26%);
 box-shadow:inset 0 1px #9fb6b6,inset 0 -2px #254653;pointer-events:none!important;z-index:0;
}
#touch-controls .dpad button{
 width:var(--dpad-key)!important;height:var(--dpad-key)!important;min-width:var(--dpad-key)!important;min-height:var(--dpad-key)!important;
 max-width:var(--dpad-key)!important;max-height:var(--dpad-key)!important;margin:0!important;padding:0!important;
 display:grid!important;place-items:center!important;align-self:stretch!important;justify-self:stretch!important;
 border:1px solid #264852!important;border-radius:5px!important;
 background:linear-gradient(#eff7e8,#bed4d1 48%,#8fb3ba)!important;color:#284e5d!important;
 box-shadow:inset 0 2px #fff9,0 2px #1b4552!important;font:700 16px/1 Arial,Helvetica,sans-serif!important;
 position:relative;z-index:1;touch-action:none!important;
}
#touch-controls .dpad [data-hold=up]{grid-row:1!important;grid-column:2!important}
#touch-controls .dpad [data-hold=left]{grid-row:2!important;grid-column:1!important}
#touch-controls .dpad [data-hold=right]{grid-row:2!important;grid-column:3!important}
#touch-controls .dpad [data-hold=down]{grid-row:3!important;grid-column:2!important}
#touch-controls .dpad button:active{background:linear-gradient(#b9d3cb,#79a7b0)!important;box-shadow:inset 0 2px #32616a!important}
#touch-controls .dpad button:focus-visible{outline:2px solid #ffe798!important;outline-offset:0}
#touch-controls #back-button,#touch-controls #interact-button{
 width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;
 max-width:44px!important;max-height:44px!important;padding:0!important;margin:0!important;
 align-self:center!important;justify-self:center!important;order:0!important;flex:none!important;transform:none!important;
 display:grid!important;place-items:center!important;touch-action:manipulation;
}
#touch-controls #back-button{grid-column:3!important;grid-row:2 / 4!important}
#touch-controls #interact-button{grid-column:4!important;grid-row:1 / 3!important}
#touch-controls .touch-help{grid-column:2!important;grid-row:1 / 4!important;align-self:center!important;justify-self:center!important;order:0!important;flex-basis:auto!important;width:100%;max-width:145px!important;padding:0 3px;line-height:1.3;text-align:center}
@media(max-width:719px){#touch-controls .touch-help{display:none!important}}
/* Do not shrink touch targets to fit short windows; scrolling belongs to the
   content panes, with an ordinary page-scroll fallback for very short screens. */
.app:has(#touch-controls[data-enabled=true]){zoom:1!important}
#touch-controls #back-button,#touch-controls #interact-button{border:1px solid #697861!important;border-radius:50%!important;background:radial-gradient(circle at 35% 30%,#fffde1,#d6d2af)!important;color:#ba4c3c!important;box-shadow:inset 0 2px #fff9,0 2px #225563!important;font:700 20px/1 Arial,Helvetica,sans-serif!important}
#touch-controls #interact-button{background:radial-gradient(circle at 35% 30%,#fff5cf,#ecc47b)!important;color:#31788e!important}
