/* 메신저의 1:1 음성 통화 화면(public/call-ui.js). 걸려 온 전화와 통화 중은 화면 전체, 다른 화면으로 가면 위쪽의 작은 띠. */
#call-root { position: relative; z-index: 2147483000; }
.call-screen {
  position: fixed; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: max(56px, env(safe-area-inset-top)) 24px max(40px, calc(env(safe-area-inset-bottom) + 28px));
  color: #fff; background: radial-gradient(120% 80% at 50% 0%, #5a4368 0%, #33263c 55%, #231a2a 100%);
  font-family: inherit; text-align: center; overscroll-behavior: contain;
}
.call-screen[hidden] { display: none; }
.call-who { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: clamp(24px, 12vh, 120px); min-width: 0; max-width: 100%; }
.call-who h2 { margin: 14px 0 0; font-size: clamp(24px, 6vw, 32px); font-weight: 700; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.call-role { margin: 0; color: #d9cfe0; font-size: 15px; }
.call-status { margin: 6px 0 0; color: #f1e9f6; font-size: 17px; font-variant-numeric: tabular-nums; min-height: 1.4em; }
.call-face {
  width: 128px; height: 128px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: #eadcf2; color: #45334f; font-size: 52px; font-weight: 700; box-shadow: 0 0 0 6px #ffffff1f;
}
.call-face img { width: 100%; height: 100%; object-fit: cover; }
.call-face-ring { animation: call-ring 1.6s ease-out infinite; }
@keyframes call-ring { 0% { box-shadow: 0 0 0 0 #ffffff59, 0 0 0 6px #ffffff1f; } 100% { box-shadow: 0 0 0 28px #ffffff00, 0 0 0 6px #ffffff1f; } }
.call-actions { display: flex; justify-content: center; gap: clamp(48px, 22vw, 120px); width: 100%; }
.call-round {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0; border: 0; background: none; color: #fff;
  font: inherit; font-size: 14px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.call-round i { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: #ffffff26; transition: transform .12s ease, background .12s ease; }
.call-round i svg { width: 30px; height: 30px; }
.call-round:active i { transform: scale(.94); }
.call-round:focus-visible { outline: none; }
.call-round:focus-visible i { outline: 3px solid #fff; outline-offset: 3px; }
.call-round:disabled { opacity: .6; cursor: default; }
.call-accept i { background: #23a35a; }
.call-decline i { background: #e0473f; }
.call-mute[aria-pressed="true"] i { background: #fff; color: #33263c; }
.call-shrink {
  position: absolute; top: max(14px, env(safe-area-inset-top)); left: 14px; width: 44px; height: 44px; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: #ffffff1f; color: #fff; cursor: pointer;
}
.call-shrink:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.call-live audio { display: none; }

/* 다른 화면으로 가도 남는 작은 띠 */
.call-bar {
  position: fixed; top: max(8px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 1;
  display: flex; align-items: center; gap: 6px; max-width: min(420px, calc(100vw - 16px)); padding: 6px 8px 6px 6px;
  border-radius: 999px; background: #33263c; color: #fff; box-shadow: 0 8px 24px #2a1f3a40;
}
.call-bar[hidden] { display: none; }
.call-bar-open {
  display: flex; align-items: center; gap: 8px; min-width: 0; height: 40px; padding: 0 10px; border: 0; border-radius: 999px;
  background: none; color: inherit; font: inherit; font-size: 14px; cursor: pointer;
}
.call-bar-open b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.call-bar-status { flex: none; color: #d9cfe0; font-variant-numeric: tabular-nums; }
.call-bar-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; animation: call-dot 1.4s ease-in-out infinite; }
@keyframes call-dot { 50% { opacity: .35; } }
.call-bar-button { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; display: grid; place-items: center; background: #ffffff26; color: #fff; cursor: pointer; }
.call-bar-button svg { width: 20px; height: 20px; }
.call-bar-button[aria-pressed="true"] { background: #fff; color: #33263c; }
.call-bar-end { background: #e0473f; }
.call-bar :is(button):focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .call-face-ring, .call-bar-dot { animation: none; }
  .call-round i { transition: none; }
}
@media (max-height: 520px) {
  .call-who { margin-top: 8px; }
  .call-face { width: 84px; height: 84px; font-size: 34px; }
}

/* ---- 화상 ---- */
.call-note { margin: 4px 0 0; padding: 6px 12px; border-radius: 999px; background: #ffffff24; color: #fff; font-size: 14px; }
.call-note[hidden] { display: none; }
.call-controls { gap: clamp(14px, 6vw, 44px); flex-wrap: nowrap; }
.call-controls .call-round[hidden] { display: none; }
.call-controls .call-round i { width: 60px; height: 60px; }
.call-controls .call-round i svg { width: 26px; height: 26px; }
.call-controls .call-round span { font-size: 13px; white-space: nowrap; }
.call-camera[aria-pressed="true"] i { background: #fff; color: #33263c; }
.call-stage { position: absolute; inset: 0; background: #17111c; overflow: hidden; }
.call-stage[hidden] { display: none; }
.call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #17111c; }
.call-remote[hidden], .call-self[hidden] { display: none; }
.call-self {
  position: absolute; right: 14px; bottom: calc(max(40px, env(safe-area-inset-bottom) + 28px) + 112px); width: clamp(96px, 26vw, 200px); aspect-ratio: 3 / 4;
  object-fit: cover; border-radius: 14px; background: #2a2032; box-shadow: 0 6px 20px #0006, 0 0 0 1.5px #ffffff40; cursor: grab; touch-action: none; z-index: 2;
}
.call-self:active { cursor: grabbing; }
.call-mirror { transform: scaleX(-1); }
@media (min-width: 720px) { .call-self { aspect-ratio: 4 / 3; width: clamp(180px, 18vw, 260px); } }
/* 영상 화면: 이름과 시간은 위쪽의 작은 머리로, 단추는 영상 위에 뜬다 */
.call-live[data-view="video"] { justify-content: space-between; }
.call-live[data-view="video"] > :not(.call-stage) { position: relative; z-index: 3; }
.call-live[data-view="video"] .call-who { margin-top: 0; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 4px 10px; padding: 8px 14px; border-radius: 999px; background: #17111c99; max-width: calc(100% - 120px); }
.call-live[data-view="video"] .call-face, .call-live[data-view="video"] .call-role { display: none; }
.call-live[data-view="video"] .call-who h2 { margin: 0; font-size: 16px; }
.call-live[data-view="video"] .call-status { margin: 0; font-size: 15px; min-height: 0; }
.call-live[data-view="video"] .call-note { flex-basis: 100%; margin: 0; background: none; padding: 0; }
/* 상대의 영상이 없을 때(나만 켰다)는 상대의 얼굴을 가운데에 둔다 */
.call-live[data-view="video"][data-remote="none"] .call-who { flex-direction: column; flex-wrap: nowrap; gap: 10px; max-width: 100%; margin-top: clamp(24px, 12vh, 120px); padding: 0; border-radius: 0; background: none; }
.call-live[data-view="video"][data-remote="none"] .call-note { flex-basis: auto; margin-top: 4px; padding: 6px 12px; background: #ffffff24; }
.call-live[data-view="video"][data-remote="none"] .call-status { font-size: 17px; }
.call-live[data-view="video"][data-remote="none"] .call-face { display: grid; }
.call-live[data-view="video"][data-remote="none"] .call-who h2 { margin-top: 14px; font-size: clamp(24px, 6vw, 32px); }
.call-live[data-view="video"] .call-controls { padding: 12px 18px; border-radius: 28px; background: #17111cb3; width: auto; }
.call-live[data-view="video"] .call-shrink { position: absolute; background: #17111c99; }

/* 걸려 온 화상 통화: 영상 없이 받기 */
.call-answer { display: flex; flex-direction: column; align-items: center; gap: 22px; width: 100%; }
.call-plain { min-height: 44px; padding: 0 18px; border: 1.5px solid #ffffff59; border-radius: 999px; background: none; color: #fff; font: inherit; font-size: 15px; cursor: pointer; }
.call-plain:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.call-plain:disabled { opacity: .6; }

/* 음성·화상 고르기 */
.call-choose { position: fixed; inset: 0; z-index: 2; display: flex; align-items: flex-end; justify-content: center; background: #2a1f3a66; }
.call-choose-sheet { width: min(420px, 100%); padding: 20px 16px max(16px, env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; background: var(--white, #fff); color: var(--ink, #2e2735); display: grid; gap: 10px; box-shadow: 0 -12px 40px #2a1f3a33; }
@media (min-width: 720px) { .call-choose { align-items: center; } .call-choose-sheet { border-radius: 22px; padding-bottom: 16px; } }
.call-choose-who { display: flex; align-items: center; gap: 12px; padding: 0 4px 6px; min-width: 0; }
.call-choose-who b { display: block; font-size: 17px; overflow-wrap: anywhere; }
.call-choose-who small { color: var(--muted, #6a6470); font-size: 13px; }
.call-face-small { flex: none; width: 48px; height: 48px; font-size: 20px; box-shadow: none; }
.call-choice { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 16px; border: 1px solid var(--line, #e4e0e5); border-radius: 14px; background: none; color: inherit; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; text-align: left; }
.call-choice svg { color: var(--plum, #45334f); }
.call-choice:hover { background: #45334f0f; }
.call-choice:focus-visible, .call-choose-close:focus-visible { outline: 3px solid var(--plum, #45334f); outline-offset: 2px; }
.call-choose-close { border-color: transparent; color: var(--muted, #6a6470); justify-self: center; }

/* ---- 화면 공유 ---- */
.call-live[data-remote="screen"] .call-remote { object-fit: contain; }
.call-remote-small { position: absolute; left: 14px; bottom: calc(max(40px, env(safe-area-inset-bottom) + 28px) + 112px); width: clamp(96px, 22vw, 200px); aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; background: #2a2032; box-shadow: 0 6px 20px #0006, 0 0 0 1.5px #ffffff40; z-index: 2; }
.call-remote-small[hidden] { display: none; }
.call-share[aria-pressed="true"] i { background: #fff; color: #33263c; }
.call-live .call-sharing, .call-live[data-view="video"] > .call-sharing { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 132px); }
.call-live[data-view="video"][data-sharing]:not([data-remote="none"]) .call-who { margin-top: 20px; }
.call-sharing { z-index: 3; display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 8px 12px; padding: 8px 8px 8px 14px; border-radius: 999px; background: #1f7a45; color: #fff; font-size: 14px; }
.call-sharing[hidden] { display: none; }
.call-sharing span { display: inline-flex; align-items: center; gap: 8px; }
.call-sharing svg { width: 18px; height: 18px; }
.call-sharing button, .call-bar-share { min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: #fff; color: #1b5e37; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.call-sharing button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.call-bar-share { flex: none; }
.call-bar-share[hidden] { display: none; }
/* 통화의 기록과 요약: 기록 중이라는 표시는 통화 화면과 작은 띠에 늘 보인다 */
.call-recording { z-index: 3; display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; padding: 6px 8px 6px 14px; width: max-content; max-width: calc(100% - 32px); border-radius: 999px; background: #a3261f; color: #fff; font-size: 14px; }
.call-recording[hidden], .call-rec-main[hidden], .call-rec-choice[hidden], .call-bar-rec[hidden] { display: none; }
.call-rec-main, .call-rec-choice { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 8px; }
.call-recording button { min-height: 32px; padding: 0 12px; border-radius: 999px; background: #ffffff2e; color: #fff; font-size: 13px; }
.call-rec-dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; flex: none; animation: call-rec 1.6s ease-in-out infinite; }
@keyframes call-rec { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .call-rec-dot { animation: none; } }
.call-live[data-view="video"] > .call-recording { position: absolute; top: max(58px, calc(env(safe-area-inset-top) + 44px)); left: 50%; transform: translateX(-50%); margin: 0; }
.call-bar-rec { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; background: #a3261f; color: #fff; font-size: 12px; flex: none; }
