:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f9f0f7;
  background: #141118;
  --level: 0;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid #f1b5e7; outline-offset: 5px; }
.call {
  min-height: 100vh;
  min-height: var(--tg-viewport-stable-height, 100dvh);
  max-width: 40rem;
  margin: auto;
  padding: max(18px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
}
.back {
  justify-self: start; align-self: start;
  display: flex; align-items: center; gap: 8px; min-height: 44px;
  color: #d8cad9; text-decoration: none; font-size: .875rem;
}
.back span { font-size: 1.7rem; line-height: .7; }
.conversation {
  align-self: center; display: flex; flex-direction: column;
  align-items: center; text-align: center; padding: 18px 0;
}
.orb-wrap {
  position: relative; isolation: isolate; display: grid; place-items: center;
  width: clamp(116px, 39vw, 194px); aspect-ratio: 1;
  margin-bottom: clamp(24px, 6vh, 40px);
}
.halo, .orb { position: absolute; border-radius: 50%; }
.halo {
  inset: -10%; border: 1px solid #b771b55c;
  background: radial-gradient(circle, #a063aa35, transparent 70%);
  transform: scale(calc(1 + var(--level) * .28));
  transition: transform 90ms ease-out, border-color 200ms ease;
}
.orb {
  inset: 7%;
  background: radial-gradient(ellipse at 32% 25%, #ffe9f8 0%, #e6a6d9 20%, #a55c9a 48%, #512d67 70%, #30223e 100%);
  box-shadow: 0 0 40px #dd83d83a, inset -6px -10px 22px #31183666;
  transform: scale(calc(1 + var(--level) * .14));
  transition: transform 90ms ease-out, filter 250ms ease;
}
[data-state="speaking"] .halo { border-color: #ffb7eb; }
[data-state="connecting"] .orb { animation: breathe 1.5s ease-in-out infinite alternate; }
[data-state="muted"] .orb, [data-state="ended"] .orb { filter: saturate(.55); }
@keyframes breathe { to { transform: scale(1.065); filter: brightness(1.16); } }
h1 { margin: 0; font-size: clamp(2.2rem, 9vw, 3.55rem); font-weight: 620; letter-spacing: -.045em; }
.status { margin: 8px 0 0; font-size: 1rem; color: #ddcedd; }
.timer { margin: 7px 0 0; font-variant-numeric: tabular-nums; color: #cdaecc; }
.actions { margin: 0 auto; width: 100%; max-width: 23rem; text-align: center; }
.notice { margin: 0 auto 16px; max-width: 31ch; color: #c9bbca; line-height: 1.45; font-size: .85rem; }
.start {
  min-height: 56px; width: 100%; padding: 10px 20px; border: 0;
  border-radius: 99px; background: #ebbee6; color: #2c172c; font-weight: 710;
}
.controls { display: flex; justify-content: center; gap: 35px; }
.control {
  min-width: 80px; padding: 0; display: grid; justify-items: center; gap: 8px;
  border: 0; background: transparent; color: #f9f0f7; font-size: .825rem;
}
.icon {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: #342938;
}
.mute[aria-pressed="true"] .icon { background: #edc8eb; color: #2c172c; }
.hangup .icon { background: #cf4052; color: white; }
.mic { position: relative; width: 10px; height: 18px; margin-bottom: 7px; border: 2px solid currentColor; border-radius: 99px; }
.mic::before {
  position: absolute; content: ""; inset: 6px -6px -5px; border: 2px solid currentColor;
  border-top: 0; border-radius: 0 0 10px 10px;
}
.mic::after { position: absolute; content: ""; width: 2px; height: 4px; background: currentColor; left: 2px; bottom: -8px; }
.phone { display: block; width: 24px; height: 12px; margin-top: 8px; border: 4px solid currentColor; border-bottom: 0; border-radius: 80% 80% 3px 3px; }
@media (prefers-reduced-motion: reduce) {
  .orb, .halo, [data-state="connecting"] .orb { animation: none; transition: none; transform: none; }
}
