.touch-bar {
  width: 100%;
  max-width: none;
  flex-shrink: 0;
  display: none;
  gap: 0.5rem;
  align-items: stretch;
  padding: 0.1rem 0
    max(0.2rem, env(safe-area-inset-bottom));
}

.touch-bar__cluster {
  display: contents;
}

.touch-bar__cluster--right {
  justify-content: flex-end;
}

.touch-btn {
  flex: 1 1 0;
  max-width: none;
  min-height: var(--touch-target-min, 3.25rem);
  min-width: var(--touch-target-min, 3.25rem);
  border: 1px solid rgba(62, 240, 255, 0.25);
  border-radius: 12px;
  background: var(--bg-panel);
  color: var(--accent-cyan);
  font-size: 1.35rem;
  font-weight: 700;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--glow-cyan);
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.touch-btn:active {
  transform: scale(0.96);
  background: rgba(62, 240, 255, 0.12);
}

.touch-btn--fire {
  flex: 1.15 1 0;
  color: var(--accent-magenta);
  border-color: rgba(255, 62, 181, 0.35);
  box-shadow: var(--glow-magenta);
}

@media (hover: none), (pointer: coarse), (max-width: 900px) {
  .touch-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
  }
}

@media (pointer: coarse), (max-width: 600px) {
  .touch-btn {
    min-height: 3.35rem;
    font-size: 1.45rem;
    border-radius: 14px;
  }

  .touch-btn--fire {
    min-height: 3.5rem;
  }
}

@media (orientation: landscape) and (pointer: coarse) and (max-height: 520px) {
  .touch-btn,
  .touch-btn--fire {
    min-height: 2.45rem;
    font-size: 1.05rem;
  }
}
