/* =====================================================
   call.css —— 情侣语音 / 视频通话全屏界面
   三态：来电、呼叫中、通话中；跟随五套主题变量
   ===================================================== */

body.call-open { overflow: hidden; }
.call-overlay {
  position: fixed;
  inset: 0;
  z-index: 10020;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: calc(24px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom));
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, color-mix(in srgb, var(--primary) 20%, transparent), transparent 34%),
    radial-gradient(circle at 88% 86%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 38%),
    color-mix(in srgb, var(--bg) 92%, #f7ecd9 8%);
  isolation: isolate;
}
.call-overlay * { box-sizing: border-box; }
.call-ambient {
  position: absolute;
  inset: -20%;
  z-index: -1;
  opacity: .66;
  background:
    radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--card) 88%, transparent) 0 16%, transparent 48%),
    radial-gradient(circle at 46% 62%, color-mix(in srgb, var(--primary) 13%, transparent), transparent 42%);
  transform: rotate(-6deg);
  pointer-events: none;
}
.call-card {
  width: min(100%, 430px);
  min-height: min(680px, calc(100dvh - 48px));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px 24px 30px;
  border-radius: var(--r-xl, 24px);
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  box-shadow: var(--sh-3, var(--shadow));
  backdrop-filter: saturate(1.2) blur(22px);
  -webkit-backdrop-filter: saturate(1.2) blur(22px);
}
.call-kicker {
  margin-bottom: 34px;
  color: var(--primary-deep);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
}
.call-avatar-wrap {
  position: relative;
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
}
.call-avatar {
  position: relative;
  z-index: 2;
  width: 124px;
  height: 124px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 5px solid color-mix(in srgb, var(--card) 90%, transparent);
  border-radius: 50%;
  color: var(--primary-deep);
  background: var(--bg-soft);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--primary) 24%, transparent);
}
.call-avatar img { width: 100%; height: 100%; object-fit: cover; }
.call-avatar.compact { width: 92px; height: 92px; }
.call-avatar-ph { font-size: 42px; font-weight: 900; line-height: 1; }
.call-pulse {
  position: absolute;
  inset: 8px;
  z-index: 0;
  border: 2px solid color-mix(in srgb, var(--primary) 48%, transparent);
  border-radius: 50%;
  opacity: 0;
  animation: callPulse 2.2s ease-out infinite;
}
.call-pulse.p2 { animation-delay: 1.1s; }
.call-name {
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(24px, 7vw, 32px);
  font-weight: 850;
  line-height: 1.25;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.call-status { margin-top: 10px; color: var(--muted); font-size: 15px; text-align: center; }
.call-countdown {
  margin-top: 12px;
  padding: 6px 12px;
  border-radius: var(--r-pill, 999px);
  color: var(--muted);
  background: color-mix(in srgb, var(--bg-soft) 74%, transparent);
  font-size: 12px;
}
.call-countdown span { color: var(--primary-deep); font-weight: 800; }
.call-actions {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(36px, 14vw, 74px);
  margin-top: auto;
  padding-top: 58px;
}
.call-actions.one { gap: 0; }
.call-actions.active-actions { gap: clamp(22px, 8vw, 50px); padding-top: 32px; }
.call-action-item { min-width: 70px; display: flex; flex-direction: column; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.call-round {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  font-size: 27px;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(20, 16, 22, .16);
  transition: transform var(--t-fast, .16s) ease, filter var(--t-fast, .16s) ease, background var(--t-fast, .16s) ease;
}
.call-round:active { transform: scale(.91); }
.call-round:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 42%, transparent); outline-offset: 4px; }
.call-round:disabled { opacity: .55; cursor: wait; }
.call-accept { background: linear-gradient(145deg, #66d79a, #31b774); }
.call-reject { background: linear-gradient(145deg, color-mix(in srgb, var(--danger) 78%, #fff), var(--danger)); }
.call-tool { color: var(--text); background: color-mix(in srgb, var(--bg-soft) 82%, var(--card)); }
.call-tool.on { color: #fff; background: var(--gradient); }
.call-action-item[hidden] { display: none; }

/* ---------- 通话中 ---------- */
.call-active-card { justify-content: flex-start; }
.call-active-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 13px;
}
.call-active-top strong { color: var(--text); font-size: 16px; font-variant-numeric: tabular-nums; letter-spacing: .05em; }
.call-audio-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.call-audio-main .call-avatar-wrap { margin-bottom: 18px; }
.call-video-stage {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: calc(var(--r-xl, 24px) - 4px);
  background: color-mix(in srgb, var(--bg-soft) 72%, #18141e);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line) 72%, transparent);
}
.call-remote-video { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: cover; background: transparent; }
.call-video-fallback { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; }
.call-local-video {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  width: 30%;
  max-width: 118px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 3px solid color-mix(in srgb, var(--card) 86%, transparent);
  border-radius: var(--r-lg, 18px);
  background: var(--bg-soft);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
  transform: scaleX(-1);
}
.call-view-active.video .call-card { height: min(760px, calc(100dvh - 48px)); padding: 20px; }
.call-view-active.video .call-actions { flex: 0 0 auto; }

@keyframes callPulse {
  0% { opacity: .64; transform: scale(.82); }
  72%, 100% { opacity: 0; transform: scale(1.22); }
}

@media (max-height: 650px) {
  .call-card { min-height: calc(100dvh - 28px); padding-top: 22px; padding-bottom: 20px; }
  .call-kicker { margin-bottom: 16px; }
  .call-avatar-wrap { width: 122px; height: 122px; margin-bottom: 12px; }
  .call-avatar { width: 102px; height: 102px; }
  .call-actions { padding-top: 28px; }
  .call-round { width: 60px; height: 60px; }
}

@media (min-width: 768px) {
  .call-card { min-height: 690px; }
}

@media (prefers-reduced-motion: reduce) {
  .call-pulse { animation: none; opacity: .22; transform: scale(1.08); }
  .call-round { transition-duration: .01ms; }
}

/* =====================================================
   v19：通话最小化悬浮窗 + 增强按钮
   ===================================================== */
/* 悬浮窗：固定在右上角的小气泡，通话中可切到其它页面 */
.call-mini {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 12000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 10px;
  background: var(--card, #fff);
  border: 1px solid var(--line, #f0e7df);
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(158, 128, 105, .22);
  cursor: pointer;
  animation: callMiniIn .28s cubic-bezier(.34,1.56,.64,1);
}
.call-mini-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: none;
  background: var(--bg-soft, #faf5f1); display: flex; align-items: center; justify-content: center; }
.call-mini-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.call-mini-avatar .call-avatar-ph { font-size: 17px; color: var(--primary, #ff7da3); }
.call-mini-info { min-width: 0; }
.call-mini-name { font-size: 13px; font-weight: 700; color: var(--text, #4a3b33);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.call-mini-dur { font-size: 11px; color: var(--accent, #d8a97e); font-variant-numeric: tabular-nums;
  margin-top: 2px; }
.call-mini-hang {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: #ff5b5b; color: #fff; font-size: 14px; font-weight: 700;
}
@keyframes callMiniIn {
  from { opacity: 0; transform: translateY(-12px) scale(.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 通话中按钮更多时，允许横向排布且不换行 */
.call-actions.active-actions {
  flex-wrap: wrap;
  gap: 14px 18px;
}
.call-round.call-tool.on {
  background: var(--primary, #ff7da3);
  color: #fff;
}

/* 关摄像头时本地画面淡出 */
.call-local-video { transition: opacity .3s ease; }

@media (prefers-reduced-motion: reduce) {
  .call-mini { animation: none; }
}
