/* touch controls — only mounted by game.js on coarse-pointer devices */
.touch {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom));
  pointer-events: none;
  z-index: 20;
  font-family: "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace;
}

.touch .dpad,
.touch .acts {
  pointer-events: auto;
  display: grid;
  gap: 6px;
}

.touch .dpad {
  grid-template-columns: repeat(3, 46px);
  grid-template-rows: repeat(3, 46px);
}
.touch .dpad-up { grid-area: 1 / 2; }
.touch .dpad-left { grid-area: 2 / 1; }
.touch .dpad-down { grid-area: 2 / 2; }
.touch .dpad-right { grid-area: 2 / 3; }

.touch .acts {
  grid-template-columns: repeat(2, auto);
  justify-items: stretch;
}

.tbtn {
  appearance: none;
  margin: 0;
  padding: 10px 12px;
  min-width: 46px;
  min-height: 46px;
  border-radius: 10px;
  border: 1px solid rgba(150, 170, 190, 0.35);
  background: rgba(12, 18, 24, 0.55);
  color: #cfd8e0;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.04em;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tbtn:active {
  background: rgba(120, 160, 190, 0.35);
  border-color: rgba(190, 215, 235, 0.7);
  color: #f2f6fa;
}
