@import url('https://fonts.googleapis.com/css2?family=Baloo+Bhaijaan+2:wght@500;600;700;800&family=Tajawal:wght@400;500;700&display=swap');

:root {
  --bg-dusk:      #241B14;
  --surface-warm: #362A1E;
  --glow-amber:   #F0A93E;
  --glow-dim:     #6B5636;
  --text-cream:   #F7ECDA;
  --accent-ember: #D9703B;
  --muted:        #9C8869;

  --font-display: 'Baloo Bhaijaan 2', sans-serif;
  --font-body:    'Tajawal', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg-dusk);
}

body {
  font-family: var(--font-body);
  color: var(--text-cream);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

/* Ambient dusk glow — like lamplight diffusing through a room, very restrained */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 38%, rgba(240,169,62,0.10), transparent 65%),
    radial-gradient(ellipse 90% 70% at 50% 100%, rgba(0,0,0,0.35), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 32px 20px;
}

.avatar-row {
  display: flex;
  gap: 48px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
}

.avatar-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.avatar-unit:focus-visible .avatar-ring {
  outline: 2px solid var(--text-cream);
  outline-offset: 6px;
}

.avatar-ring {
  position: relative;
  width: clamp(140px, 34vw, 220px);
  height: clamp(140px, 34vw, 220px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease;
}

.avatar-unit:active .avatar-ring {
  transform: scale(0.96);
}

.avatar-ring svg {
  width: 82%;
  height: 82%;
  border-radius: 50%;
  position: relative;
  z-index: 2;
}

/* The glow ring is the signature element: it IS the identity portrait's
   frame, AND it IS the tap target, AND its animation state IS the only
   status language on the page — reachable / connected / busy — no text
   required to understand it. */
.avatar-ring::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 3px solid var(--glow-dim);
  transition: border-color 0.4s ease, box-shadow 0.6s ease;
}

.avatar-ring.state-ready::after {
  border-color: var(--glow-amber);
  box-shadow: 0 0 0 0 rgba(240,169,62,0.55);
  animation: breathe 2.8s ease-in-out infinite;
}

.avatar-ring.state-connected::after {
  border-color: var(--glow-amber);
  box-shadow: 0 0 26px 6px rgba(240,169,62,0.55);
}

.avatar-ring.state-busy::after {
  border-color: var(--glow-dim);
  box-shadow: none;
}

.avatar-ring.state-offline::after {
  border-color: rgba(107,86,54,0.35);
}
.avatar-ring.state-offline svg { opacity: 0.45; }

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240,169,62,0.45); }
  50%      { box-shadow: 0 0 22px 5px rgba(240,169,62,0.45); }
}

.avatar-label {
  font-family: var(--font-display);
  font-size: clamp(18px, 4vw, 24px);
  font-weight: 700;
  color: var(--text-cream);
}

.avatar-status {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--muted);
  min-height: 18px;
  text-align: center;
}

.avatar-status.is-connected { color: var(--glow-amber); }

.call-frame {
  position: fixed;
  inset: 0;
  border: none;
  width: 100%;
  height: 100%;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  background: var(--bg-dusk);
}
.call-frame.visible {
  opacity: 1;
  pointer-events: auto;
}

.brand-mark {
  position: fixed;
  bottom: 18px;
  left: 0; right: 0;
  text-align: center;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--muted);
  opacity: 0.6;
  z-index: 1;
}
