/* Voice and video calls (calls.js): full screen, dark, like the phone's own call screen. */

.call-view {
  position: fixed; inset: 0; z-index: 120; background: radial-gradient(circle at 50% 30%, #2a2f45, #0b0c12 70%); color: #fff;
  display: flex; flex-direction: column; align-items: center; overflow: hidden;
  padding: calc(var(--safe-t, 0px) + 28px) 16px calc(var(--safe-b, 0px) + 24px);
}
.call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; opacity: 0; transition: opacity .3s; }
.call-view.video.connected .call-remote { opacity: 1; }
.call-view.voice .call-remote { width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.call-self {
  position: absolute; right: 14px; top: calc(var(--safe-t, 0px) + 14px); width: 104px; height: 148px; object-fit: cover; border-radius: 14px;
  background: #222; box-shadow: 0 6px 20px rgba(0,0,0,.5); z-index: 2; border: 2px solid rgba(255,255,255,.25);
}
.call-self.mirror { transform: scaleX(-1); }
.call-view.voice .call-self { display: none; }
.call-view.video:not(.connected) .call-self { inset: 0; width: 100%; height: 100%; border-radius: 0; border: 0; z-index: 0; opacity: .55; }

.call-head { position: relative; z-index: 1; display: grid; justify-items: center; gap: 6px; margin-top: 7vh; text-align: center; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.call-face {
  width: 112px; height: 112px; border-radius: 50%; background: linear-gradient(135deg, #0eadff, #6a5cff); display: grid; place-items: center;
  font-size: 46px; font-weight: 800; box-shadow: 0 0 0 10px rgba(255,255,255,.06), 0 0 0 22px rgba(255,255,255,.03);
}
.call-view[data-mode="incoming"] .call-face, .call-view[data-mode="outgoing"] .call-face { animation: call-ring 1.6s infinite; }
@keyframes call-ring { 50% { box-shadow: 0 0 0 16px rgba(255,255,255,.09), 0 0 0 34px rgba(255,255,255,.04); } }
.call-view.video.connected .call-face { display: none; }
.call-view.video.connected .call-head { margin-top: 0; position: absolute; left: 16px; top: calc(var(--safe-t, 0px) + 16px); justify-items: start; text-align: left; }
.call-head h2 { margin: 6px 0 0; font-size: 26px; font-weight: 800; }
.call-view.video.connected .call-head h2 { font-size: 18px; margin: 0; }
.call-status { margin: 0; font-size: 15px; opacity: .85; font-variant-numeric: tabular-nums; }
.call-view.them-muted .call-status::after { content: " · muted"; }
.call-note { position: relative; z-index: 1; max-width: 380px; margin: 18px 0 0; font-size: 12.5px; line-height: 1.4; opacity: .7; text-align: center; }
.call-note:empty { display: none; }
.call-view.connected .call-note { display: none; }

.call-bar, .call-answer { position: relative; z-index: 2; margin-top: auto; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; max-width: 420px; }
.call-bar[hidden], .call-answer[hidden] { display: none; }
.call-answer { gap: 64px; }
.call-btn { border: 0; background: none; color: #fff; display: grid; justify-items: center; gap: 6px; padding: 0; min-width: 64px; font: inherit; }
.call-ico {
  width: 62px; height: 62px; border-radius: 50%; background: rgba(255,255,255,.16); display: grid; place-items: center; padding: 17px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.call-ico svg { width: 100%; height: 100%; display: block; }
.call-btn small { font-size: 12px; font-weight: 700; opacity: .9; }
.call-btn.on .call-ico { background: #fff; color: #111; }
.call-btn.end .call-ico { background: #ff3b30; }
.call-btn.accept .call-ico { background: #34c759; }
.call-answer .call-ico { width: 72px; height: 72px; padding: 20px; }
.call-btn.accept .call-ico { animation: call-bounce 1.4s infinite; }
@keyframes call-bounce { 0%, 100% { transform: translateY(0); } 15% { transform: translateY(-6px); } 30% { transform: translateY(0); } }
.call-btn:focus-visible .call-ico { outline: 3px solid #ffcf24; outline-offset: 3px; }
.call-view[data-mode="over"] .call-bar { opacity: .4; pointer-events: none; }

@media (max-width: 360px) {
  .call-bar { gap: 8px; }
  .call-ico { width: 56px; height: 56px; padding: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .call-face, .call-btn.accept .call-ico { animation: none !important; }
}
