:root {
  --ptt-bg: #0b3d2e;
  --ptt-active: #c45c26;
  --ptt-text: #f4f7f5;
  --ptt-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

/* Always rendered; sits below mumble-web dialogs and is dimmed + inert until
   the client is connected. Never hidden, so a state-detection miss cannot make
   push-to-talk disappear. */
.ptt-fab {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 15;
  width: min(160px, 42vw);
  height: min(160px, 42vw);
  max-width: 180px;
  max-height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #147a5a, var(--ptt-bg) 70%);
  color: var(--ptt-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  box-shadow: var(--ptt-shadow);
  border: 3px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  opacity: 1;
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease,
    opacity 0.15s ease;
  pointer-events: auto;
}

.ptt-fab.is-disabled {
  opacity: 0.4;
  filter: grayscale(0.6);
  cursor: not-allowed;
  pointer-events: none;
}

.ptt-fab:active,
.ptt-fab.is-talking {
  background: radial-gradient(circle at 35% 30%, #e8894a, var(--ptt-active) 70%);
  transform: translateX(-50%) scale(0.96);
  box-shadow: 0 0 0 8px rgba(196, 92, 38, 0.25), var(--ptt-shadow);
}

.ptt-label {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: clamp(1.4rem, 5vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.ptt-hint {
  font-size: 0.75rem;
  opacity: 0.85;
  text-transform: lowercase;
}

/* Keep Connect / settings dialogs above the PTT FAB */
.connect-dialog,
.join-dialog,
.error-dialog,
.settings-dialog,
.connection-info-dialog,
.dialog {
  z-index: 40 !important;
}

@media (max-width: 899px) {
  .ptt-fab {
    /* Sit lower-right on phones so channel tree stays usable */
    left: auto;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    transform: none;
    width: 120px;
    height: 120px;
  }

  .ptt-fab:active,
  .ptt-fab.is-talking {
    transform: scale(0.96);
  }
}

@media (min-width: 900px) {
  .ptt-fab {
    right: 32px;
    left: auto;
    bottom: 32px;
    transform: none;
    width: 160px;
    height: 160px;
  }

  .ptt-fab:active,
  .ptt-fab.is-talking {
    transform: scale(0.96);
  }
}
