.mobile-hint {
  display: none;
}

.touch-menu {
  padding: 18px max(16px, env(safe-area-inset-right)) 18px max(16px, env(safe-area-inset-left));
}

.touch-menu header {
  margin-bottom: 16px;
}

.touch-menu h1 {
  font-size: clamp(36px, 7vw, 52px);
  letter-spacing: -2px;
  line-height: 1;
}

.touch-menu h1 span {
  display: inline;
  margin-left: 0.15em;
}

.touch-menu .panel {
  padding: 14px;
  min-width: 0;
}

.touch-menu .fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.touch-menu select {
  font-size: 16px;
}

.touch-menu #roster {
  grid-template-columns: repeat(auto-fit, minmax(62px, 1fr));
}

.touch-menu .character {
  min-height: 50px;
}

.touch-menu .startrow {
  margin-top: 12px;
  padding-bottom: env(safe-area-inset-bottom);
}

.touch-menu .startrow .primary {
  min-width: 0;
  flex: 1;
}

.touch-menu .mobile-hint {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 12px;
}

@media (orientation: landscape) and (min-width: 620px) {
  .touch-menu .setup {
    grid-template-columns: minmax(225px, 0.8fr) minmax(0, 1.35fr);
    gap: 12px;
  }
}

.touch-match #skillsHud,
.touch-match #hint {
  display: none;
}

.touch-match #topHud {
  padding: max(6px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    0 max(12px, env(safe-area-inset-left));
  gap: 0;
}

.touch-match .team {
  width: 36%;
}

.touch-match .fighterHud {
  padding: 5px 7px;
}

.touch-match .fighterName {
  font-size: 12px;
  margin-bottom: 3px;
}

.touch-match #clock {
  font-size: clamp(18px, 5.8vmin, 30px);
  top: max(4px, env(safe-area-inset-top));
}

.touch-match #pause {
  left: 50%;
  right: auto;
  bottom: max(8px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  min-height: 44px;
}

#touchControls {
  position: absolute;
  left: max(14px, calc(env(safe-area-inset-left) + 8px));
  right: max(14px, calc(env(safe-area-inset-right) + 8px));
  bottom: max(14px, calc(env(safe-area-inset-bottom) + 8px));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.touch-stick,
.touch-actions button {
  pointer-events: auto;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.touch-stick {
  position: relative;
  width: clamp(76px, 30vmin, 126px);
  aspect-ratio: 1;
  border: 2px solid #b6eaff7a;
  border-radius: 50%;
  background: #0e243bd9;
  box-shadow: inset 0 0 0 9px #c6f2ff10, 0 3px 16px #0006;
}

.touch-stick-thumb {
  position: absolute;
  width: 46%;
  aspect-ratio: 1;
  top: 50%;
  left: 50%;
  border: 2px solid #e0f7ffbc;
  border-radius: 50%;
  transform: translate(calc(-50% + var(--stick-x, 0px)), calc(-50% + var(--stick-y, 0px)));
  background: #65cbe5;
  box-shadow: 0 4px 9px #0007;
}

.touch-actions {
  display: grid;
  grid-template-columns: repeat(2, clamp(68px, 22vmin, 94px));
  gap: clamp(5px, 2vmin, 8px);
}

.touch-actions button {
  display: grid;
  place-items: center;
  border: 1px solid #a7dcf780;
  border-radius: 14px;
  min-height: clamp(46px, 15vmin, 62px);
  padding: 4px 3px;
  background: #132840ef;
  color: #f4fbff;
  font-size: clamp(12px, 3.7vmin, 15px);
  line-height: 1.15;
}

.touch-actions .touch-attack {
  background: #6ee1ff;
  color: #0a2434;
  border-color: #cbf4ff;
}

.touch-actions button.is-held {
  background: #bfecfa;
  color: #082032;
  transform: scale(0.94);
}

#touchTechniqueName {
  font-size: 0.7em;
  font-weight: 500;
}

#touchTechnique.is-recharging {
  background: #262d46f7;
  color: #c9d9e7;
}

#turnPhone {
  margin-top: 9px;
  color: #b9ecfc;
}

@media (max-height: 420px) and (orientation: landscape) {
  .shade .dialog {
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    padding: 18px;
    overflow: auto;
  }

  .shade .dialog h2 {
    font-size: clamp(20px, 6vmin, 26px);
  }
}
