/* Screen 6: New Invite
   Builds on Crossed Paths (header, badges, match pill, where-row) and
   Person Profile (cards, tags, sticky actions) so the social flow feels like one place. */

.iv-scroll {
  position: absolute;
  top: 0; left: 0; right: 0;
  bottom: var(--nav-h);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.iv-scroll::-webkit-scrollbar { display: none; }
.iv-header { align-items: center; padding-left: max(16px, env(safe-area-inset-left, 0px)); }
.iv-heading { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.iv-title { margin: 0; font-family: var(--font-display); font-size: 21px; font-weight: 800; }
.iv-header .cp-sub { font-size: 12px; }

.iv-content {
  display: flex; flex-direction: column; gap: 16px;
  padding-top: 4px;
  padding-bottom: 100px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- Main invite card ---------- */
.iv-card {
  border-radius: 28px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(185, 139, 255, 0.4);
  box-shadow: 0 0 34px rgba(157, 92, 255, 0.2);
  animation: iv-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition: opacity 0.28s, transform 0.28s, box-shadow 0.4s, border-color 0.4s;
}
@keyframes iv-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.iv-card.leaving { opacity: 0; transform: translateY(10px) scale(0.97); }
.iv-card.accepting, .iv-card.connected {
  border-color: rgba(210, 182, 255, 0.75);
  box-shadow: 0 0 0 1px rgba(157, 92, 255, 0.4), 0 0 46px rgba(157, 92, 255, 0.45);
}
.iv-photo {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 100%;
  overflow: hidden;
  background: #0d0a14;
  text-align: left;
}
.iv-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; }
.iv-photo::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.35), transparent 30%, transparent 55%, rgba(18, 16, 25, 0.96));
  pointer-events: none;
}
.iv-body { display: flex; flex-direction: column; gap: 16px; padding: 6px 16px 18px; }
.iv-hi {
  margin: 0;
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 600; color: #d9d5e3;
}
.iv-hi svg { flex: none; width: 22px; height: 22px; color: var(--accent-light); }
.iv-hi b { color: var(--fg); font-weight: 800; }
.iv-hi em { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 700; color: var(--accent-light); }
.iv-encounter {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(157, 92, 255, 0.08);
  border: 1px solid rgba(185, 139, 255, 0.2);
}

/* ---------- Why you're seeing this ---------- */
.iv-why ul { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.iv-why li { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: #d9d5e3; }
.iv-why svg { flex: none; width: 17px; height: 17px; color: var(--accent-light); }
.iv-mutual { grid-template-columns: 1fr 1fr; }

/* ---------- More invites ---------- */
.iv-list { display: flex; flex-direction: column; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.iv-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  text-align: left;
}
.iv-row + .iv-row { border-top: 1px solid var(--line); }
.iv-row img { flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(185, 139, 255, 0.4); }
.iv-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.iv-row-text b { font-size: 15px; font-weight: 800; }
.iv-row-text span { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iv-row-time { font-size: 12px; font-weight: 700; color: var(--accent-light); white-space: nowrap; }
.iv-row > svg { flex: none; width: 16px; height: 16px; color: var(--muted); }

/* ---------- Bottom actions: Accept is the dominant choice ---------- */
.iv-actions { grid-template-columns: 1fr 1.6fr; }

/* ---------- Connected moment ---------- */
.iv-connected { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 14px; text-align: center; }
.iv-connected .cp-sheet-actions { width: 100%; margin-top: 14px; }
.iv-check {
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #c9a4ff, var(--accent) 70%);
  color: #fff;
  box-shadow: 0 0 0 8px rgba(157, 92, 255, 0.16), 0 0 36px var(--glow);
  margin-bottom: 8px;
  animation: iv-check 0.5s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.iv-check svg { width: 30px; height: 30px; }
@keyframes iv-check { from { transform: scale(0.4); opacity: 0; } }
.iv-connected-title { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 800; line-height: 1.3; max-width: 22ch; }

/* ---------- Connection preview ---------- */
.iv-conn { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 10px; }
.iv-pair { display: flex; }
.iv-pair > * {
  width: 72px; height: 72px; border-radius: 50%;
  border: 2px solid var(--accent-light);
  box-shadow: 0 0 22px rgba(157, 92, 255, 0.45);
}
.iv-pair img { object-fit: cover; margin-left: -16px; }
.iv-you {
  display: grid; place-items: center;
  background: linear-gradient(135deg, #ff6fb5, #7a35e8);
  font-weight: 800; font-size: 20px;
}
.iv-conn-title { margin: 0; font-family: var(--font-display); font-size: 21px; font-weight: 800; text-transform: uppercase; }
.iv-conn-stats { list-style: none; margin: 4px 0 0; padding: 0; width: 100%; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.iv-conn-stats li { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; font-size: 14px; }
.iv-conn-stats li + li { border-top: 1px solid var(--line); }
.iv-conn-stats span { color: var(--muted); font-weight: 600; }
.iv-conn-stats b { font-weight: 800; }
.iv-status { display: inline-flex; align-items: center; gap: 5px; color: var(--accent-light) !important; font-weight: 800 !important; }
.iv-status svg { width: 14px; height: 14px; }
.iv-soon { margin: 0; font-size: 13px; color: var(--muted); font-style: italic; }
.iv-conn .cp-sheet-actions { width: 100%; }

/* ---------- Block confirmation ---------- */
.iv-block { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; }
.iv-block p { margin: 0 0 6px; font-size: 14px; line-height: 1.5; color: #d9d5e3; }
.iv-danger { background: rgba(255, 143, 163, 0.12); border: 1px solid rgba(255, 143, 163, 0.5); color: #ff8fa3; }

@media (prefers-reduced-motion: reduce) {
  .iv-card, .iv-check { animation: none; }
}
.iv-pair > :first-child { margin-left: 0; position: relative; z-index: 1; }
