/* Shared by standalone games, including controls created after page load. */
:is(button, [role="button"], [onclick], a[href], input[type="button"], input[type="submit"], input[type="reset"], label[for], .music-control, .touch-btn, .mobile-btn, canvas, #mobile-controls, #battlefield, #radar-box),
:is(button, [role="button"], [onclick], a[href], label[for], .music-control, .touch-btn, .mobile-btn, #mobile-controls, #battlefield, #radar-box) * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Taps allow page scrolling and pinch zoom on menus and RPG pages. */
:is(button, [role="button"], [onclick], a[href], input[type="button"], input[type="submit"], input[type="reset"], label[for], .music-control) {
  touch-action: manipulation;
}

/* Held controls and interactive canvases retain their existing gesture ownership. */
:is(.touch-btn, .mobile-btn, #mobile-controls, #battlefield, #radar-box, canvas) {
  touch-action: none;
}

/* Override inherited/inline selection bans only for editable text. Keep these
   ordinary selectors separate from any browser-specific pseudo-elements. */
:is(input:not([type]), input[type="text"], input[type="password"], input[type="email"], input[type="search"], input[type="tel"], input[type="url"], input[type="number"], textarea, [contenteditable]:not([contenteditable="false"])),
[contenteditable]:not([contenteditable="false"]) * {
  -webkit-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default !important;
  touch-action: auto;
}
