@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@1,900&family=Fraunces:ital,opsz,wght@0,9..144,900;1,9..144,900&family=DM+Sans:wght@300;400;500;600;700&display=swap');

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

:root {
  --rose: #E8445A;
  --warm: #FF8C5A;
  --cream: #FDF8F2;
  --ink: #08040B;
  --ink2: #130A10;
  --ink3: #1C0F18;
  --muted: rgba(253,248,242,0.45);
  --muted2: rgba(253,248,242,0.22);
  --border: rgba(255,255,255,0.07);
  --green: #22C97B;
  --max: 430px;
}

html { scroll-behavior: smooth; }
body {
  background: var(--ink);
  font-family: 'DM Sans', sans-serif;
  color: var(--cream);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── APP SHELL (mobile) ── */
.app-shell {
  width: 100%;
  max-width: var(--max);
  min-height: 100dvh;
  margin: 0 auto;
  background: linear-gradient(160deg, #0A060D 0%, #160B13 50%, #0A060D 100%);
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ── BUTTONS ── */
.btn {
  display: block; width: 100%;
  padding: 16px; border-radius: 100px;
  border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px; font-weight: 700;
  text-align: center; text-decoration: none;
  transition: transform 0.13s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--rose), var(--warm));
  color: white;
  box-shadow: 0 8px 24px rgba(232,68,90,0.3);
}
.btn-primary:hover { box-shadow: 0 12px 32px rgba(232,68,90,0.4); }
.btn-secondary {
  background: rgba(255,255,255,0.07);
  color: var(--cream);
  border: 1px solid var(--border);
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}
.btn-sm {
  padding: 10px 20px;
  font-size: 13px;
  width: auto;
  display: inline-block;
}

/* ── INPUTS ── */
.input-wrap { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.input-label { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.input {
  width: 100%; padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid var(--border);
  color: var(--cream);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; outline: none;
  transition: border-color 0.2s;
}
.input:focus { border-color: rgba(232,68,90,0.5); }
.input::placeholder { color: rgba(253,248,242,0.2); }
select.input { appearance: none; cursor: pointer; }

/* ── CARDS ── */
.card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
}

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: var(--max);
  height: 72px;
  background: rgba(10,6,13,0.97);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-around;
  padding: 0 4px 8px;
  z-index: 50;
}
.nav-btn {
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  cursor: pointer; padding: 6px 18px;
  border-radius: 14px; border: none;
  background: transparent;
  transition: background 0.15s;
  color: rgba(253,248,242,0.28);
  font-family: 'DM Sans', sans-serif;
  text-decoration: none;
}
.nav-btn:hover { background: rgba(255,255,255,0.04); }
.nav-btn.active { color: var(--rose); }
.nav-btn svg { width: 22px; height: 22px; }
.nav-label { font-size: 10px; font-weight: 600; }
.nav-badge {
  position: absolute; top: 2px; right: 6px;
  background: var(--rose); color: white;
  font-size: 9px; font-weight: 800;
  border-radius: 8px; padding: 1px 5px;
  min-width: 16px; text-align: center;
}

/* ── HEADER ── */
.header {
  height: 56px;
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── SCROLLABLE CONTENT ── */
.scroll-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 80px;
}
.scroll-content::-webkit-scrollbar { display: none; }

/* ── SECTION TITLES ── */
.section-title {
  font-family: 'Fraunces', serif;
  font-size: 26px; font-weight: 900;
  letter-spacing: -0.5px; line-height: 1.15;
  margin-bottom: 8px;
}
.section-title em { font-style: italic; color: var(--rose); }
.section-sub { font-size: 14px; color: var(--muted); line-height: 1.65; margin-bottom: 24px; }

/* ── CHIPS ── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 16px; border-radius: 100px;
  border: 1.5px solid var(--border);
  background: rgba(255,255,255,0.04);
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
  color: var(--muted);
}
.chip.selected {
  border-color: var(--rose);
  background: rgba(232,68,90,0.12);
  color: var(--cream);
}

/* ── CHOICE GRID ── */
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.choice-btn {
  padding: 18px 10px; border-radius: 18px;
  border: 1.5px solid var(--border);
  background: rgba(255,255,255,0.04);
  cursor: pointer; text-align: center;
  transition: all 0.18s; color: var(--cream);
}
.choice-btn.selected { border-color: var(--rose); background: rgba(232,68,90,0.12); }
.choice-emoji { font-size: 28px; margin-bottom: 6px; }
.choice-label { font-size: 13px; font-weight: 700; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 90px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20,10,18,0.95);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 12px 24px;
  font-size: 14px; font-weight: 600;
  z-index: 200;
  opacity: 0;
  transition: all 0.3s;
  white-space: nowrap;
  max-width: 360px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(34,201,123,0.4); color: var(--green); }
.toast.error { border-color: rgba(232,68,90,0.4); color: var(--rose); }

/* ── LOADING ── */
.loading {
  display: flex; align-items: center; justify-content: center;
  min-height: 100dvh;
  font-size: 14px; color: var(--muted);
}
.spinner {
  width: 32px; height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--rose);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes hbDraw {
  0% { stroke-dashoffset: 600; opacity: 0; }
  7% { opacity: 1; }
  58% { stroke-dashoffset: 0; opacity: 1; }
  78% { opacity: 0.55; }
  100% { stroke-dashoffset: -70; opacity: 0; }
}
@keyframes hbDot {
  0%,100% { opacity: 1; r: 5; }
  38% { opacity: 0.15; r: 2.5; }
  62% { opacity: 1; r: 7.5; }
}
@keyframes heartPulse {
  0%,100% { transform: scale(1); opacity: 1; }
  40% { transform: scale(0.55); opacity: 0.2; }
  65% { transform: scale(1.45); opacity: 1; }
}
@keyframes ringBreath {
  0%,100% { opacity: 0.06; }
  50% { opacity: 0.18; }
}
@keyframes bounce {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(7px); }
}

.fade-up { animation: fadeUp 0.5s ease both; }
.fade-up-1 { animation: fadeUp 0.5s 0.08s ease both; }
.fade-up-2 { animation: fadeUp 0.5s 0.16s ease both; }
.fade-up-3 { animation: fadeUp 0.5s 0.24s ease both; }

.hb-line { stroke-dasharray: 600; stroke-dashoffset: 600; animation: hbDraw 3s ease-in-out infinite; }
.hb-dot { animation: hbDot 3s ease-in-out infinite; }
.hb-heart { transform-origin: 50% 50%; animation: heartPulse 3s ease-in-out infinite; }
.ring-breath { animation: ringBreath 3s ease-in-out infinite; }

/* ── PROGRESS BAR ── */
.progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 100px;
  margin-bottom: 28px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rose), var(--warm));
  border-radius: 100px;
  transition: width 0.4s ease;
}

/* ── MATCH OVERLAY ── */
.match-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.92);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 40px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s;
}
.match-overlay.show { opacity: 1; pointer-events: all; }
.match-title {
  font-family: 'Fraunces', serif;
  font-size: 44px; font-weight: 900;
  font-style: italic; color: var(--rose);
  margin-bottom: 8px;
}

/* ── PREMIUM MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.88);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal-sheet {
  width: 100%; max-width: var(--max);
  background: #120910;
  border-radius: 28px 28px 0 0;
  padding: 28px 24px 40px;
  border: 1px solid var(--border);
  transform: translateY(20px);
  transition: transform 0.3s;
}
.modal-overlay.show .modal-sheet { transform: translateY(0); }
