#touch-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  pointer-events: none;
  touch-action: none;
}

#touch-overlay.is-active {
  display: block;
}

#touch-overlay .touch-overlay__grid {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 2px;
  pointer-events: none;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}

#touch-overlay .touch-overlay__button {
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  border: 0;
  border-radius: 12px;
  background: #88888855;
  color: #88888888;
  font-family: Helvetica, Arial, sans-serif;
  font-weight: bold;
  font-size: 16px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  -webkit-appearance: none;
  padding-top: 4pt;
  padding-bottom: 4pt;
  padding-left: 0;
  padding-right: 0;
  line-height: 1;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#touch-overlay .touch-overlay__button.is-pressed {
  background: #88888866;
  color: #88888888;
}

#touch-overlay .touch-overlay__pair {
  pointer-events: auto;
  display: grid;
  gap: 2px;
  touch-action: none;
}

#touch-overlay .touch-overlay__pair > .touch-overlay__button {
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#touch-overlay .touch-overlay__pair--horizontal {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}

#touch-overlay .touch-overlay__pair--vertical {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr;
}
