:root {
  --ios-green: #30D158;
  --ios-green-deep: #248A3D;
  --ios-red: #FF453A;
  --ios-pink: #FF2D55;
  --ios-pink-soft: #FF375F;
  --glass: rgba(28, 28, 32, 0.72);
  --glass-strong: rgba(22, 22, 26, 0.82);
  --border: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.22);
  --text-muted: rgba(255, 255, 255, 0.62);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --touch-min: 44px;
}
body { align-items: stretch; }

.phone-viewport {
  position: relative; width: 100%; max-width: 430px; height: 100dvh; overflow: hidden;
  background: #0c0c0e; display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
}

/* 底层人物背景：随阶段逐渐清晰；不拦截通关层点击 */
.bg-layer {
  position: absolute; inset: -20px; overflow: hidden;
  filter: blur(30px) brightness(0.55);
  transition: filter 0.8s var(--ease-out), transform 0.8s ease;
  z-index: 1; pointer-events: none;
}
.bg-layer.semi-clear { filter: blur(14px) brightness(0.65); }
.bg-layer.full-clear { filter: blur(0px) brightness(0.88); }

.top-hud {
  position: relative; z-index: 30; display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px 8px; font-size: 12px; font-weight: 500; letter-spacing: 0.2px;
  color: rgba(255, 255, 255, 0.7);
}

/* ── 阶段 1：来电 ── */
.call-screen {
  position: relative; z-index: 10; flex: 1; display: flex; flex-direction: column;
  justify-content: space-between; align-items: center;
  padding: 16px 24px calc(36px + env(safe-area-inset-bottom, 0px)); text-align: center;
}
.caller-info { margin-top: 8px; }
.avatar-pulse {
  width: 118px; height: 118px; border-radius: 50%; margin: 0 auto 18px; position: relative;
  padding: 3px;
  background: linear-gradient(145deg, var(--ios-pink) 0%, #FF6B8A 45%, var(--ios-green) 100%);
  box-shadow: 0 8px 28px rgba(255, 45, 85, 0.28);
}
.avatar-pulse::before,
.avatar-pulse::after {
  content: ""; position: absolute; inset: -10px; border-radius: 50%;
  border: 1.5px solid rgba(255, 45, 85, 0.45); pointer-events: none;
  animation: ringExpand 2.2s ease-out infinite;
}
.avatar-pulse::after { inset: -10px; animation-delay: 1.1s; border-color: rgba(48, 209, 88, 0.35); }
@keyframes ringExpand {
  0% { transform: scale(0.92); opacity: 0.7; }
  100% { transform: scale(1.55); opacity: 0; }
}
.avatar-pulse img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  display: block; background: #1c1c1e;
}
.caller-name {
  font-size: 32px; font-weight: 700; letter-spacing: -0.6px; line-height: 1.15;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}
.caller-sub {
  font-size: 15px; color: var(--text-muted); margin-top: 8px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.live-dot {
  width: 8px; height: 8px; background: var(--ios-green); border-radius: 50%;
  display: inline-block; flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.5);
  animation: livePulse 1.4s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.45); }
  50% { opacity: 0.55; box-shadow: 0 0 0 6px rgba(48, 209, 88, 0); }
}

.call-actions {
  width: 100%; display: flex; justify-content: space-around; align-items: flex-start;
  padding: 0 12px; gap: 24px;
}
.call-btn-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, 0.85);
  min-width: 88px;
}
.circle-btn {
  width: 72px; height: 72px; min-width: var(--touch-min); min-height: var(--touch-min);
  border-radius: 50%; border: none; color: #fff; font-size: 26px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s ease, filter 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.circle-btn:hover { filter: brightness(1.06); }
.circle-btn:active { transform: scale(0.88); }
.circle-btn:focus-visible {
  outline: 2px solid #fff; outline-offset: 4px;
}
.btn-decline {
  background: var(--ios-red);
  box-shadow: 0 8px 22px rgba(255, 69, 58, 0.38);
}
.btn-accept {
  background: var(--ios-green);
  box-shadow: 0 8px 26px rgba(48, 209, 88, 0.42);
  animation: acceptNudge 2s ease-in-out infinite;
}
@keyframes acceptNudge {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.05); }
  55% { transform: scale(1.02); }
}
.btn-accept:active { animation: none; transform: scale(0.88); }

/* ── 阶段 2：滑卡 ── */
.swipe-screen {
  position: relative; z-index: 15; flex: 1; display: none; flex-direction: column;
  justify-content: space-between;
  padding: 8px 18px calc(28px + env(safe-area-inset-bottom, 0px));
}
.call-status-bar {
  background: rgba(48, 209, 88, 0.14);
  border: 1px solid rgba(48, 209, 88, 0.36);
  color: #6dff90; border-radius: 999px; padding: 7px 14px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.1px;
  align-self: center; display: flex; align-items: center; gap: 8px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.card-stack-area {
  position: relative; flex: 1; display: flex; align-items: center; justify-content: center;
  margin: 14px 0; perspective: 1000px; min-height: 0;
}
.tinder-card {
  position: absolute; width: 100%; max-width: 350px; min-height: 300px;
  background: var(--glass-strong);
  backdrop-filter: blur(36px) saturate(1.2); -webkit-backdrop-filter: blur(36px) saturate(1.2);
  border: 1px solid var(--border-strong); border-radius: 26px; padding: 24px 22px;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.35s var(--ease-out), opacity 0.3s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  touch-action: pan-y; cursor: grab; will-change: transform;
}
.tinder-card:active { cursor: grabbing; }
.tinder-card.lean-yes {
  border-color: rgba(48, 209, 88, 0.55);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(48, 209, 88, 0.2);
}
.tinder-card.lean-no {
  border-color: rgba(255, 45, 85, 0.5);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 45, 85, 0.18);
}
.q-progress {
  font-size: 11px; color: var(--ios-pink-soft); font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase;
}
.q-quote {
  font-size: 21px; font-weight: 700; line-height: 1.36; letter-spacing: -0.3px;
  margin: 18px 0; flex: 1; display: flex; align-items: center;
}
.q-hint {
  font-size: 12px; color: var(--text-muted);
  display: flex; justify-content: space-between; gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 14px;
}

.stat-toast {
  position: absolute; bottom: 118px; left: 50%; transform: translateX(-50%) translateY(6px);
  background: rgba(12, 12, 14, 0.88); border: 1px solid var(--border);
  padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 500; color: #fff;
  white-space: nowrap; opacity: 0; pointer-events: none; z-index: 25;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: opacity 0.25s ease, transform 0.25s var(--ease-out);
}
.stat-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.swipe-controls { display: flex; gap: 12px; justify-content: center; }
.swipe-btn {
  flex: 1; min-height: var(--touch-min); padding: 14px 12px; border-radius: 16px;
  border: 1px solid var(--border); background: var(--glass); color: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: transform 0.15s var(--ease-out), background 0.15s ease, box-shadow 0.15s ease;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  -webkit-tap-highlight-color: transparent;
}
.swipe-btn:hover { background: rgba(40, 40, 46, 0.85); }
.swipe-btn:active { transform: scale(0.96); }
.swipe-btn:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.9); outline-offset: 3px; }
.swipe-btn.yes {
  background: linear-gradient(160deg, var(--ios-pink-soft), #D91B42);
  border: none;
  box-shadow: 0 8px 22px rgba(255, 45, 85, 0.32);
}
.swipe-btn.yes:hover { filter: brightness(1.05); }

/* ── 阶段 3：配对结果（高于视频层，可点 CTA） ── */
.match-modal {
  position: relative; z-index: 20; flex: 1; display: none; flex-direction: column;
  justify-content: flex-end;
  padding: 24px 20px calc(36px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.94) 22%, rgba(0, 0, 0, 0.45) 58%, transparent 100%);
  text-align: center; pointer-events: auto;
  animation: matchIn 0.45s var(--ease-out);
}
@keyframes matchIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.match-badge {
  display: inline-block; align-self: center;
  background: var(--ios-green); color: #06210c; font-weight: 800; font-size: 12px;
  letter-spacing: 0.4px; padding: 5px 14px; border-radius: 999px; margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(48, 209, 88, 0.35);
}
.match-title {
  font-size: 26px; font-weight: 700; letter-spacing: -0.4px; margin-bottom: 10px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
}
.match-text { font-size: 15px; color: rgba(255, 255, 255, 0.78); line-height: 1.5; max-width: 34em; margin: 0 auto; }
.cta-btn {
  width: 100%; min-height: var(--touch-min); padding: 16px; border-radius: 16px; border: none;
  background: linear-gradient(160deg, var(--ios-green), var(--ios-green-deep));
  color: #fff; font-size: 17px; font-weight: 700; cursor: pointer; margin-top: 20px;
  box-shadow: 0 10px 28px rgba(48, 209, 88, 0.38);
  transition: transform 0.15s var(--ease-out), filter 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.cta-btn:hover { filter: brightness(1.05); }
.cta-btn:active { transform: scale(0.97); }
.cta-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .avatar-pulse::before, .avatar-pulse::after, .btn-accept, .live-dot, .match-modal {
    animation: none;
  }
}
