* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #1b1228;
  --bg2: #241738;
  --card: #2e2044;
  --text: #f4eefb;
  --muted: #b6a8cc;
  --accent: #ff4d79;
  --accent2: #ff8a5c;
  --like: #2edb8a;
  --nope: #ff5560;
}

html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: radial-gradient(1200px 800px at 50% -10%, var(--bg2), var(--bg));
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

.hidden { display: none !important; }
.view { min-height: 100dvh; display: flex; flex-direction: column; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.center { text-align: center; }

/* ---------- auth / link ---------- */
.auth-wrap {
  width: 100%; max-width: 420px; margin: 0 auto;
  padding: max(48px, env(safe-area-inset-top)) 20px 40px;
  display: flex; flex-direction: column; gap: 16px;
}
.logo { font-size: 2.4rem; font-weight: 800; text-align: center; letter-spacing: -1px; }
.logo span { color: var(--accent); }
.logo em { font-style: normal; font-size: 1.6rem; vertical-align: middle; }
.logo.small { font-size: 1.25rem; }
.logo.small em { font-size: 1rem; }
.tagline { text-align: center; color: var(--muted); margin-top: -8px; }

.tabs { display: flex; gap: 8px; }
.tab {
  flex: 1; padding: 10px; border-radius: 12px; border: 1px solid #4a3766;
  background: transparent; color: var(--muted); font-size: 1rem;
}
.tab.active { background: var(--card); color: var(--text); border-color: var(--accent); }

.card {
  background: var(--card); border-radius: 18px; padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.card h3 { font-size: 1.05rem; }

.form input {
  padding: 13px 14px; border-radius: 12px; border: 1px solid #4a3766;
  background: #221636; color: var(--text); font-size: 1rem; width: 100%;
}
.form input:focus { outline: 2px solid var(--accent); border-color: transparent; }

.btn {
  padding: 13px 18px; border: none; border-radius: 14px; font-size: 1rem;
  font-weight: 600; cursor: pointer; background: #3c2c58; color: var(--text);
}
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid #4a3766; color: var(--muted); }
.btn.danger.ghost { border-color: #7c3344; color: #ff8e9b; }
.btn.small { padding: 9px 14px; font-size: 0.88rem; align-self: flex-start; }
.btn:active { transform: scale(0.97); }

.or { text-align: center; color: var(--muted); }

.invite-code {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #221636; border: 1px dashed var(--accent); border-radius: 12px; padding: 12px 14px;
}
.invite-code span { font-size: 1.5rem; font-weight: 800; letter-spacing: 4px; }

/* ---------- app chrome ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: max(12px, env(safe-area-inset-top)) 18px 10px;
}
.couple-label { color: var(--muted); font-size: 0.85rem; }

.tabpane { flex: 1; display: flex; flex-direction: column; padding: 8px 16px 90px; overflow-y: auto; }
.pane-title { font-size: 1.3rem; margin: 6px 2px 14px; }

.bottombar {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; background: rgba(27,18,40,0.92); backdrop-filter: blur(12px);
  border-top: 1px solid #3c2c58; padding-bottom: env(safe-area-inset-bottom);
}
.nav-btn {
  flex: 1; padding: 10px 0 8px; background: none; border: none; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 1.25rem; position: relative;
}
.nav-btn span { font-size: 0.68rem; font-weight: 600; }
.nav-btn.active { color: var(--accent); }
.badge {
  position: absolute; top: 6px; right: calc(50% - 22px);
  min-width: 16px; height: 16px; border-radius: 8px; background: var(--accent);
  color: #fff; font-size: 0.65rem; font-style: normal; line-height: 16px; padding: 0 4px;
}

/* ---------- swipe deck ---------- */
.deck-hint {
  text-align: center; color: var(--muted); font-size: 0.85rem;
  background: var(--card); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px;
}
.deck {
  position: relative; flex: 1; max-width: 420px; width: 100%;
  margin: 0 auto; min-height: 420px;
}
.swipe-card {
  position: absolute; inset: 0; border-radius: 22px; overflow: hidden;
  background: var(--card); box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  touch-action: none; user-select: none; display: flex; flex-direction: column;
  will-change: transform;
}
.swipe-card img.gen { width: 100%; flex: 1; object-fit: cover; pointer-events: none; }
.swipe-card .art {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: 7rem;
}
.swipe-card .info {
  padding: 14px 16px max(14px, 16px); background: linear-gradient(transparent, rgba(0,0,0,0.55));
  position: absolute; bottom: 0; left: 0; right: 0;
}
.swipe-card .info h3 { font-size: 1.45rem; text-shadow: 0 2px 8px rgba(0,0,0,0.5); }
.swipe-card .info p { font-size: 0.9rem; color: #fff; opacity: 0.92; text-shadow: 0 1px 6px rgba(0,0,0,0.5); margin-top: 4px; }
.stamp {
  position: absolute; top: 26px; font-size: 2rem; font-weight: 900; padding: 4px 14px;
  border: 4px solid; border-radius: 10px; opacity: 0; transform: rotate(-14deg);
  letter-spacing: 2px;
}
.stamp.like { left: 18px; color: var(--like); border-color: var(--like); }
.stamp.nope { right: 18px; color: var(--nope); border-color: var(--nope); transform: rotate(14deg); }

.deck-empty { text-align: center; margin: auto; font-size: 1.2rem; display: flex; flex-direction: column; gap: 8px; }

.swipe-actions {
  display: flex; justify-content: center; gap: 38px; padding: 16px 0 4px;
}
.round-btn {
  width: 64px; height: 64px; border-radius: 50%; border: none; font-size: 1.6rem;
  cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,0.35); color: #fff;
}
.round-btn.nope { background: #3c2c58; color: var(--nope); }
.round-btn.like { background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.round-btn:active { transform: scale(0.92); }

/* ---------- matches ---------- */
.matches-list { display: flex; flex-direction: column; gap: 14px; max-width: 480px; margin: 0 auto; width: 100%; }
.match-card { border-radius: 18px; overflow: hidden; background: var(--card); }
.match-card .head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; }
.match-card .head .em { font-size: 1.8rem; }
.match-card .head h3 { font-size: 1.1rem; }
.match-card .head p { font-size: 0.82rem; color: var(--muted); }
.match-photos { display: flex; gap: 8px; padding: 0 12px 12px; }
.match-photos figure { flex: 1; margin: 0; }
.match-photos img { width: 100%; border-radius: 12px; aspect-ratio: 3/4; object-fit: cover; background: #221636; }
.match-photos figcaption { text-align: center; font-size: 0.78rem; color: var(--muted); padding-top: 4px; }
.match-photos .pending {
  flex: 1; aspect-ratio: 3/4; border-radius: 12px; background: #221636;
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--muted); font-size: 0.8rem; padding: 10px;
}
.match-card .idea { padding: 0 16px 16px; color: var(--muted); font-size: 0.92rem; }

/* ---------- profile ---------- */
.photo-row { display: flex; align-items: center; gap: 14px; }
.my-photo { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; }
.my-photo.placeholder {
  display: flex; align-items: center; justify-content: center;
  background: #221636; font-size: 2rem; border: 1px dashed #4a3766;
}
.consent-row { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; cursor: pointer; }
.consent-row input { width: 20px; height: 20px; accent-color: var(--accent); flex-shrink: 0; margin-top: 1px; }

/* ---------- modal & toast ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(12,6,22,0.82); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal-card {
  background: var(--card); border-radius: 24px; padding: 26px 22px; max-width: 420px; width: 100%;
  text-align: center; display: flex; flex-direction: column; gap: 14px;
  animation: pop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.modal-card h2 {
  font-size: 2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hearts { font-size: 1.4rem; animation: floaty 1.6s ease-in-out infinite alternate; }
@keyframes pop { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes floaty { from { transform: translateY(0); } to { transform: translateY(-6px); } }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 60;
  background: #3c2c58; color: var(--text); padding: 12px 18px; border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4); font-size: 0.92rem; max-width: 90vw; text-align: center;
}
.toast.match { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-weight: 700; }
