#touch-controls {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-hud);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: var(--space-md);
  pointer-events: none; /* re-enabled per-panel below, so gaps stay click-through */
}

.dpad {
  display: grid;
  grid-template-columns: repeat(3, var(--touch-dpad-btn-size));
  grid-template-rows: repeat(3, var(--touch-dpad-btn-size));
  gap: var(--space-xs);
  padding: var(--space-xs);
  border-radius: var(--radius-md);
  background: var(--color-panel-bg);
  pointer-events: auto;
  touch-action: none; /* the whole pad is a drag surface now (bindJoystickDpad), not just its buttons */
}

.touch-btn {
  width: var(--touch-dpad-btn-size);
  height: var(--touch-dpad-btn-size);
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-secondary);
  color: var(--color-button-text);
  font-size: 20px;
  font-weight: var(--font-weight-bold);
  touch-action: none; /* user-select/-webkit-touch-callout now come from the global rule in base.css */
}
.touch-btn:active,
.touch-btn.pressed {
  background: var(--color-primary);
  color: #fff;
}

.action-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  background: var(--color-panel-bg);
  pointer-events: auto;
}

#touch-shoot {
  width: var(--touch-shoot-size);
  height: var(--touch-shoot-size);
  border: none;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 14px;
  font-weight: var(--font-weight-bold);
  touch-action: none;
}
#touch-shoot:active {
  background: var(--color-primary-dark);
}
/* Set alongside the "Shoot" -> "Confirm" label swap in game.ts's
   updateBuildButtonLabel, so the confirm action reads as clearly distinct
   from firing a shot. */
#touch-shoot.build-mode {
  background: var(--color-build);
}
#touch-shoot.build-mode:active {
  background: var(--color-build-dark);
}
