/**
 * p.amline.ir — ChatGPT-style fullscreen live voice stage.
 */

html.pilot-voice-active,
html.pilot-voice-active body {
  overflow: hidden;
}

/* Hide chat chrome — voice stage is the only surface */
html.pilot-voice-active .chat-page {
  visibility: hidden;
  pointer-events: none;
}

html.pilot-voice-active #pilot-voice-stage {
  display: flex;
}

#pilot-voice-stage {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding:
    max(20px, env(safe-area-inset-top))
    20px
    max(28px, env(safe-area-inset-bottom));
  color: #f3f6f4;
  background:
    radial-gradient(circle at 50% 18%, rgba(23, 154, 156, 0.22), transparent 42%),
    linear-gradient(180deg, #08120e 0%, #040806 100%);
}

#pilot-voice-stage .pilot-voice-stage__brand {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0.9;
}

#pilot-voice-stage .pilot-voice-stage__brand img {
  width: 28px;
  height: auto;
}

#pilot-voice-stage .pilot-voice-stage__orb-wrap {
  position: relative;
  width: min(72vw, 280px);
  height: min(72vw, 280px);
  display: grid;
  place-items: center;
}

#pilot-voice-stage .pilot-voice-stage__orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(23, 154, 156, 0.28);
  animation: pilot-stage-ring 2.4s ease-out infinite;
}

#pilot-voice-stage .pilot-voice-stage__orb {
  width: 46%;
  height: 46%;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, #2fd0d2 0%, #179a9c 48%, #0d4a3c 100%);
  box-shadow:
    0 0 40px rgba(23, 154, 156, 0.45),
    0 0 120px rgba(23, 154, 156, 0.18);
  animation: pilot-stage-orb-idle 2s ease-in-out infinite;
}

html.pilot-voice-listening #pilot-voice-stage .pilot-voice-stage__orb {
  animation: pilot-stage-orb-listen 1.4s ease-in-out infinite;
}

html.pilot-voice-speaking #pilot-voice-stage .pilot-voice-stage__orb {
  animation: pilot-stage-orb-speak 0.75s ease-in-out infinite;
}

#pilot-voice-stage .pilot-voice-stage__status {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
  text-align: center;
  min-height: 1.6em;
  color: #dfe8e4;
}

#pilot-voice-stage .pilot-voice-stage__caption {
  margin: 0;
  max-width: min(92vw, 420px);
  min-height: 3.2em;
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
  color: rgba(243, 246, 244, 0.78);
}

#pilot-voice-stage .pilot-voice-stage__caption--user {
  color: #9de7e8;
}

#pilot-voice-stage .pilot-voice-stage__caption--assistant {
  color: rgba(243, 246, 244, 0.92);
}

#pilot-voice-stage .pilot-voice-stage__end {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #f3f6f4;
  border-radius: 999px;
  padding: 12px 28px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

#pilot-voice-stage .pilot-voice-stage__end:active {
  transform: scale(0.98);
}

@keyframes pilot-stage-ring {
  0% {
    transform: scale(0.84);
    opacity: 0.55;
  }
  100% {
    transform: scale(1.12);
    opacity: 0;
  }
}

@keyframes pilot-stage-orb-idle {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

@keyframes pilot-stage-orb-listen {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 40px rgba(23, 154, 156, 0.45), 0 0 120px rgba(23, 154, 156, 0.18);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 56px rgba(23, 154, 156, 0.55), 0 0 140px rgba(23, 154, 156, 0.24);
  }
}

@keyframes pilot-stage-orb-speak {
  0%,
  100% {
    transform: scale(1.02);
  }
  50% {
    transform: scale(1.14);
  }
}
