/* Capability detection includes fine-primary-pointer tablets and hybrids. */
.touch-enabled #touch{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));max-width:none;bottom:max(8px,env(safe-area-inset-bottom));left:50%;width:100%;padding:0 max(8px,env(safe-area-inset-right)) 0 max(8px,env(safe-area-inset-left));gap:8px;z-index:5;touch-action:none}
#touch button{height:clamp(60px,12vw,80px);min-height:60px;padding:6px;grid-column:var(--touch-slot);grid-row:1;opacity:.5;touch-action:none;user-select:none;-webkit-user-select:none}
#touch button svg{display:block;width:44px;height:44px;margin:auto;fill:none;stroke:currentColor;stroke-width:6;stroke-linecap:round;stroke-linejoin:round}
#touch button[aria-pressed="true"]{background:#fff4a7;opacity:.5}
html:not(.touch-enabled) #touch{display:none}
@media (orientation:portrait){.touch-enabled main{width:min(100vw,156.25dvh);height:auto;aspect-ratio:750/480}}
@media (orientation:landscape){.touch-enabled main{width:min(100vw,177.777778dvh);height:auto;aspect-ratio:16/9}}

#touch button[data-available="false"]{opacity:0;pointer-events:none}

/* The full-width layout and empty slots must never intercept canvas taps. */
#touch{pointer-events:none}
#touch button[data-available="true"]{pointer-events:auto}
#touch button[data-single="true"]{grid-column:1/-1;width:calc((100% - 24px)/4);justify-self:center}
@media (orientation:landscape){
 #touch button,#touch button[aria-pressed="true"]{opacity:.25}
 #touch button[data-available="false"]{opacity:0}
 #touch button[data-single="true"]{grid-column:4;width:100%;justify-self:stretch}
}
