/* One controller format for Ben's Brain and Tolman's Rats. */
@media(max-width:900px) {
  .handheld-controller { --handheld-action-size:56px; }
  .handheld-controller.handheld-controller {
    border:1px solid #b8b8b8;border-top:0;
    border-radius:0 0 45% 45% / 0 0 var(--handheld-shell-curve,24px) var(--handheld-shell-curve,24px);
    background:#fff;color:#111;box-shadow:none;
  }
  .handheld-controller,.handheld-controller * {
    touch-action:none;user-select:none;-webkit-user-select:none;
    -webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;
  }
  .handheld-controller .handheld-dpad {
    position:relative;display:grid;flex:0 0 132px;width:132px;height:132px;
    grid-template-columns:repeat(3,44px);grid-template-rows:repeat(3,44px);gap:0;
    filter:drop-shadow(0 1px 1px #0004);
  }
  .handheld-controller .handheld-dpad-art { position:absolute;inset:0;display:block;width:100%;height:100%;pointer-events:none;-webkit-user-drag:none; }
  .handheld-controller .handheld-dpad button {
    position:relative;width:44px;min-width:44px;height:44px;min-height:44px;
    padding:0;border:0;border-radius:0;background:transparent;color:transparent;box-shadow:none;
    font:18px/1 ui-monospace,monospace;
  }
  .handheld-controller .handheld-dpad button > span { visibility:hidden; }
  .handheld-controller .handheld-dpad [data-direction="ArrowUp"] { grid-area:1/2;border-radius:4px 4px 0 0; }
  .handheld-controller .handheld-dpad [data-direction="ArrowLeft"] { grid-area:2/1;border-radius:4px 0 0 4px; }
  .handheld-controller .handheld-dpad [data-direction="ArrowDown"] { grid-area:3/2;border-radius:0 0 4px 4px; }
  .handheld-controller .handheld-dpad [data-direction="ArrowRight"] { grid-area:2/3;border-radius:0 4px 4px 0; }
  .handheld-controller .handheld-dpad-center { grid-area:2/2;pointer-events:none; }
  .handheld-controller .handheld-dpad button[aria-pressed="true"] { background:transparent; }
  .handheld-controller .handheld-dpad button[aria-pressed="true"]::after { content:"";position:absolute;inset:7px;border-radius:3px;background:#0002;pointer-events:none; }
  .handheld-controller .handheld-actions { display:grid;grid-template-columns:repeat(2,var(--handheld-action-size));grid-template-rows:repeat(2,var(--handheld-action-size));gap:0;flex:0 0 auto; }
  .handheld-controller .handheld-actions .handheld-action {
    display:grid;place-items:center;width:var(--handheld-action-size);height:var(--handheld-action-size);
    min-width:44px;min-height:44px;padding:0;border:2px solid #222;border-radius:50%;
    background:#d3d3d3;color:#111;box-shadow:0 3px 0 #999;font:700 22px/1 ui-monospace,monospace;
  }
  .handheld-controller .handheld-action-a { grid-area:1/2; }
  .handheld-controller .handheld-action-b { grid-area:2/1; }
  .handheld-controller button:disabled { opacity:.35;cursor:default; }
  .handheld-controller button:focus-visible { outline:2px solid #111;outline-offset:3px; }
  .handheld-controller .handheld-action:active:not(:disabled) { transform:translateY(2px);box-shadow:0 1px 0 #999; }
}
@media(max-width:900px) and (max-height:700px) and (orientation:portrait) {
  .handheld-controller { --handheld-action-size:48px; }
}
@media(max-width:900px) and (max-height:500px) and (orientation:landscape) {
  .handheld-controller { --handheld-action-size:44px; }
}
