/* ═══════════════════════════════════════════
   INCOMING CALL OVERLAY
═══════════════════════════════════════════ */
#_call_overlay {
  position: fixed; inset: 0; z-index: 999990;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 0;
}
#_call_overlay .co-bg {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.85) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
#_call_overlay .co-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 480px;
  background: linear-gradient(160deg, #1c1c2e 0%, #16213e 100%);
  border-radius: 32px 32px 0 0;
  padding: 40px 32px calc(env(safe-area-inset-bottom,0px) + 40px);
  text-align: center;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
  animation: _co_slide 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes _co_slide { from { transform: translateY(100%); } to { transform: translateY(0); } }

#_call_overlay .co-avatar {
  width: 96px; height: 96px; border-radius: 50%;
  object-fit: cover; border: 3px solid #E1306C;
  margin-bottom: 16px;
  animation: _co_pulse 1.4s ease-in-out infinite;
}
@keyframes _co_pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(225,48,108,0.5); }
  50%      { box-shadow: 0 0 0 18px rgba(225,48,108,0); }
}
#_call_overlay .co-name {
  font-family: DM Sans, sans-serif; font-size: 24px; font-weight: 700;
  color: #fff; margin-bottom: 6px;
}
#_call_overlay .co-type {
  font-family: DM Sans, sans-serif; font-size: 14px;
  color: rgba(255,255,255,0.6); margin-bottom: 36px;
}
#_call_overlay .co-btns {
  display: flex; justify-content: center; gap: 56px;
}
#_call_overlay .co-btn-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
#_call_overlay .co-btn {
  width: 68px; height: 68px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; transition: transform 0.15s;
}
#_call_overlay .co-btn:active { transform: scale(0.88); }
#_call_overlay .co-btn.answer  { background: #22c55e; }
#_call_overlay .co-btn.decline { background: #ef4444; }
#_call_overlay .co-btn-label {
  font-family: DM Sans, sans-serif; font-size: 12px;
  color: rgba(255,255,255,0.6);
}

/* ═══════════════════════════════════════════
   CALL PAGE
═══════════════════════════════════════════ */
#_call_page {
  position: fixed; inset: 0; z-index: 999995;
  background: #0a0a0f;
  font-family: DM Sans, sans-serif;
  overflow: hidden;
}

/* Audio call background */
#_call_page .cp-audio-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  z-index: 0;
}

/* Remote video — full screen */
#_call_page #_cp_rv {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; z-index: 1;
  background: #111;
}

/* Local video — PiP corner */
#_call_page #_cp_lv {
  position: absolute;
  bottom: 140px; right: 16px;
  width: 110px; height: 150px;
  border-radius: 18px; object-fit: cover;
  z-index: 10; border: 2px solid rgba(255,255,255,0.5);
  background: #222; transform: scaleX(-1);
  box-shadow: 0 6px 24px rgba(0,0,0,0.7);
}

/* Audio element — handled via JS, no CSS needed */
#_call_page #_cp_au { display: none; }

/* Top bar */
#_call_page .cp-top {
  position: absolute;
  top: calc(env(safe-area-inset-top,0px) + 16px);
  left: 16px; right: 16px;
  display: flex; align-items: center; gap: 12px;
  z-index: 20;
}
#_call_page .cp-avatar-sm {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; border: 2px solid rgba(255,255,255,0.4);
  flex-shrink: 0;
}
#_call_page .cp-name {
  font-size: 17px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,0.8);
}
#_call_page .cp-status {
  font-size: 12px; color: rgba(255,255,255,0.7);
  text-shadow: 0 1px 6px rgba(0,0,0,0.8);
  margin-top: 2px;
}

/* Center (audio call only) */
#_call_page .cp-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 5;
}
#_call_page .cp-avatar-lg {
  width: 120px; height: 120px; border-radius: 50%;
  object-fit: cover; border: 4px solid rgba(255,255,255,0.3);
  margin-bottom: 20px;
  box-shadow: 0 0 0 12px rgba(255,255,255,0.06), 0 0 0 24px rgba(255,255,255,0.03);
  animation: _cp_pulse 2s ease-in-out infinite;
}
@keyframes _cp_pulse {
  0%,100% { box-shadow: 0 0 0 12px rgba(255,255,255,0.06), 0 0 0 24px rgba(255,255,255,0.03); }
  50%      { box-shadow: 0 0 0 18px rgba(255,255,255,0.1),  0 0 0 36px rgba(255,255,255,0.05); }
}
#_call_page .cp-name-lg {
  font-size: 26px; font-weight: 700; color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

/* Controls bar */
#_call_page .cp-controls {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom,0px) + 32px);
  left: 0; right: 0;
  display: flex; justify-content: center;
  align-items: flex-end;
  gap: 16px; padding: 0 16px;
  z-index: 20;
}
#_call_page .cp-ctrl-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
#_call_page .cp-btn {
  width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  transition: transform 0.15s, background 0.2s;
}
#_call_page .cp-btn:active { transform: scale(0.88); }
#_call_page .cp-btn.end    { background: #ef4444; width: 66px; height: 66px; font-size: 26px; }
#_call_page .cp-btn.active { background: rgba(255,255,255,0.38); }
#_call_page .cp-btn-lbl {
  font-size: 11px; color: rgba(255,255,255,0.65);
  text-align: center; white-space: nowrap;
}
