/* 소개팅 (/match — templates/match.html · static/js/match.js)
   데이팅 앱처럼 한 장씩 넘기는 사진 카드를 Daisy 디자인(단색·보더·2px 모서리·코랄 강조)으로.
   사진 위 이름판은 그라데이션 대신 반투명 단색 판 — 라이트 테마에서도 사진 위 글자는 흰색 그대로. */

.match-body { background: var(--bg); overflow: hidden; overscroll-behavior: none; }

.mt-page {
  position: fixed;
  top: var(--nav-total);
  bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 37.5rem;
  display: flex;
  flex-direction: column;
  padding: 10px 16px 8px;
  box-sizing: border-box;
  gap: 8px;
}

.mt-count { font-size: 12px; color: var(--text-faint); padding-right: 6px; font-variant-numeric: tabular-nums; }

/* ---------- 내 페르소나 · 상대 성별 ---------- */
.mt-filters { display: flex; align-items: center; gap: 8px; min-height: 36px; }

.mt-persona {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mt-persona:hover { border-color: var(--border-strong); }
.mt-persona-label { color: var(--text-faint); font-size: 12px; flex: none; }
.mt-persona-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mt-persona-sex {
  flex: none;
  font-size: 11px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-dim);
}
.mt-persona-caret { flex: none; margin-left: auto; color: var(--text-faint); }

.mt-want {
  flex: none;
  display: inline-flex;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.mt-want-btn {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  padding: 0 9px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.mt-want-btn + .mt-want-btn { border-left: 1px solid var(--border); }
.mt-want-btn.is-active { background: var(--accent); color: var(--on-accent); font-weight: 700; }

.mt-hint { margin: -2px 0 0; font-size: 12px; color: var(--text-faint); }

/* ---------- 카드 더미 ---------- */
.mt-stage { position: relative; flex: 1 1 auto; min-height: 0; }

.mt-card {
  position: absolute;
  inset: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
  transform-origin: 50% 110%;
  transition: transform 0.42s cubic-bezier(0.2, 0.9, 0.25, 1.08), opacity 0.3s ease;
}
.mt-card.is-dragging { transition: none; cursor: grabbing; }
/* 뒤 카드: 살짝 작고 아래 — 위 카드를 넘기는 만큼 앞으로 (match.js 가 --lift 0~1) */
.mt-card.is-next {
  --lift: 0;
  transform: translateY(calc(12px * (1 - var(--lift)))) scale(calc(0.955 + 0.045 * var(--lift)));
  opacity: calc(0.55 + 0.45 * var(--lift));
  pointer-events: none;
}
.mt-card.is-next.is-following { transition: none; }
.mt-card.is-entering { transform: translateY(18px) scale(0.93); opacity: 0; }

.mt-card-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.mt-card-scroll::-webkit-scrollbar { display: none; }

.mt-photo {
  position: relative;
  height: calc(100% - 48px);
  min-height: 300px;
  background: var(--surface-2);
}
.mt-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.mt-photo img.is-loaded { opacity: 1; }

.mt-badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; z-index: 2; }

/* 사진 위 이름판 (단색 반투명 판) */
.mt-nameplate {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  padding: 12px 14px 12px;
  background: rgba(26, 26, 26, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.mt-card .mt-name { margin: 0; color: #ffffff; font-size: 22px; line-height: 1.25; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.mt-card .mt-age { color: #FFA178; font-size: 16px; font-weight: 600; }
.mt-card .mt-job { margin: 3px 0 0; color: rgba(255, 255, 255, 0.72); font-size: 13px; }
.mt-card .mt-teaser {
  margin: 9px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mt-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.mt-card .mt-tag {
  font-size: 11px;
  line-height: 1;
  padding: 5px 7px;
  border-radius: var(--radius);
  background: rgba(255, 161, 120, 0.16);
  color: #FFA178;
}

/* 더 보기 안내 (아래로 스크롤하면 소개·첫 상황) */
.mt-more {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-faint);
  font-size: 12px;
}
.mt-more svg { animation: mt-nudge 1.8s ease-in-out infinite; }
@keyframes mt-nudge { 0%, 100% { transform: translateY(-1px); } 50% { transform: translateY(3px); } }

.mt-body { padding: 4px 16px 22px; display: flex; flex-direction: column; gap: 18px; }
.mt-section-title {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--accent-text, #FFA178);
}
.mt-card .mt-intro { margin: 0; color: var(--text); font-size: 14px; line-height: 1.65; white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; }
.mt-card .mt-situation {
  margin: 0;
  padding: 12px 14px;
  background: var(--surface-2);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.65;
  font-style: italic;
  white-space: pre-line;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.mt-card .mt-line {
  align-self: flex-start;
  max-width: 88%;
  margin: 10px 0 0;
  padding: 10px 13px;
  background: var(--surface-3);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.mt-line-who { display: block; margin-bottom: 3px; color: var(--text-faint); font-size: 11px; }
.mt-card .mt-profile-link { align-self: flex-start; color: var(--text-dim); font-size: 13px; text-decoration: none; border-bottom: 1px solid var(--border-strong); padding-bottom: 1px; }

/* 넘길 때 도장 */
.mt-stamp {
  position: absolute;
  top: 22px;
  z-index: 3;
  padding: 6px 12px;
  border: 3px solid currentColor;
  border-radius: var(--radius);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.08em;
  opacity: 0;
  pointer-events: none;
  background: rgba(26, 26, 26, 0.35);
}
.mt-stamp--like { left: 18px; color: #FFA178; transform: rotate(-12deg); }
.mt-stamp--pass { right: 18px; color: #d9d9de; transform: rotate(12deg); }

/* 불러오는 중 · 빈 화면 */
.mt-skeleton {
  position: absolute;
  inset: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.mt-skeleton span {
  position: absolute;
  inset: 0;
  background: var(--surface-2);
  animation: mt-pulse 1.4s ease-in-out infinite;
}
@keyframes mt-pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.6; } }
.mt-stage[aria-busy="false"] .mt-skeleton { display: none; }

.mt-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}
.mt-empty[hidden] { display: none; }
.mt-empty-title { margin: 0; color: var(--text); font-size: 16px; }
.mt-empty-desc { margin: 0 0 8px; color: var(--text-dim); font-size: 13px; }

/* ---------- 버튼 줄 ---------- */
.mt-actions { flex: none; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 4px 0 2px; }
.mt-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s cubic-bezier(0.3, 1.4, 0.5, 1), background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.mt-act:active { transform: scale(0.9); }
.mt-act:disabled, .mt-act.is-disabled { opacity: 0.35; pointer-events: none; }
.mt-act--undo { width: 42px; height: 42px; color: var(--text-dim); }
.mt-act--pass { width: 56px; height: 56px; color: var(--text-dim); }
.mt-act--like { width: 56px; height: 56px; color: #FFA178; border-color: rgba(255, 161, 120, 0.55); }
.mt-act--chat { height: 56px; padding: 0 22px; background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-size: 15px; }
.mt-act--pass.is-hot { background: var(--surface-3); }
.mt-act--like.is-hot { background: rgba(255, 161, 120, 0.18); }
@media (hover: hover) {
  .mt-act--pass:hover { border-color: var(--text-faint); }
  .mt-act--like:hover { background: rgba(255, 161, 120, 0.12); }
  .mt-act--chat:hover { background: var(--accent-strong); }
}

/* ---------- 연결됐어요 ---------- */
.mt-matched {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(18, 18, 18, 0.92);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.mt-matched[hidden] { display: none; }
.mt-matched.is-open { opacity: 1; }
.mt-matched-inner { width: 100%; max-width: 340px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.mt-matched-pics { position: relative; height: 150px; width: 240px; margin-bottom: 8px; }
.mt-matched-pics img {
  position: absolute;
  top: 10px;
  width: 118px;
  height: 128px;
  object-fit: cover;
  border: 2px solid #1a1a1a;
  border-radius: var(--radius);
  outline: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.6s cubic-bezier(0.2, 0.9, 0.25, 1.15), opacity 0.4s ease;
  opacity: 0;
}
.mt-matched-me { left: 6px; transform: translateX(-60px) rotate(-16deg); }
.mt-matched-char { right: 6px; transform: translateX(60px) rotate(16deg); }
.mt-matched.is-open .mt-matched-me { opacity: 1; transform: translateX(0) rotate(-7deg); }
.mt-matched.is-open .mt-matched-char { opacity: 1; transform: translateX(0) rotate(6deg); transition-delay: 0.06s; }
.mt-matched-heart {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 2;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #FFA178;
  color: #1a1a1a;
  transform: scale(0);
  transition: transform 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) 0.32s;
}
.mt-matched.is-open .mt-matched-heart { transform: scale(1); }
.mt-matched .mt-matched-kicker { margin: 4px 0 0; color: #FFA178; font-size: 12px; letter-spacing: 0.24em; }
.mt-matched .mt-matched-title { margin: 0; color: #ffffff; font-size: 22px; line-height: 1.35; word-break: keep-all; }
.mt-matched .mt-matched-scene {
  margin: 2px 0 10px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  line-height: 1.6;
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mt-matched-scene:empty { display: none; }
.mt-matched .ds-btn--ghost { color: rgba(255, 255, 255, 0.7); }
.mt-matched-inner > * { transform: translateY(8px); opacity: 0; transition: transform 0.4s ease 0.18s, opacity 0.4s ease 0.18s; }
.mt-matched-inner > .mt-matched-pics { transform: none; opacity: 1; transition: none; }
.mt-matched.is-open .mt-matched-inner > * { transform: none; opacity: 1; }

/* ---------- 페르소나 고르기 시트 ---------- */
.mt-sheet-overlay { position: fixed; inset: 0; z-index: 1100; background: rgba(0, 0, 0, 0.5); opacity: 0; transition: opacity 0.22s ease; }
.mt-sheet-overlay.is-open { opacity: 1; }
.mt-sheet-overlay[hidden], .mt-sheet[hidden] { display: none; }
.mt-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 1101;
  width: 100%;
  max-width: 37.5rem;
  max-height: 70vh;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--border-strong);
  border-radius: var(--radius) var(--radius) 0 0;
  transform: translate(-50%, 100%);
  transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.25, 1);
}
.mt-sheet.is-open { transform: translate(-50%, 0); }
.mt-sheet-handle { width: 36px; height: 4px; margin: 0 auto 12px; border-radius: 2px; background: var(--border-strong); }
.mt-sheet .mt-sheet-title { margin: 0; font-size: 16px; color: var(--text); }
.mt-sheet .mt-sheet-desc { margin: 4px 0 12px; font-size: 12px; color: var(--text-faint); }
.mt-sheet-list { display: flex; flex-direction: column; gap: 6px; }
.mt-sheet-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.mt-sheet-item.is-active { border-color: var(--accent); }
.mt-sheet-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-sheet-item-sex { flex: none; color: var(--text-dim); font-size: 12px; }
.mt-sheet .mt-sheet-manage { display: inline-block; margin-top: 12px; font-size: 13px; color: var(--text-dim); text-decoration: none; }

@media (max-height: 640px) {
  .mt-photo { min-height: 240px; }
  .mt-act--pass, .mt-act--like, .mt-act--chat { height: 50px; }
  .mt-act--pass, .mt-act--like { width: 50px; }
}
