@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,650&family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --bg: #12060f;
  --card: #1f0f1b;
  --accent: #ff4d7d;
  --accent-soft: #ff85a8;
  --text: #f5e9f0;
  --muted: #a88b9d;
  --serif: 'Fraunces', Georgia, serif;
}

body {
  background: radial-gradient(1200px 800px at 50% -10%, #2a0f22, var(--bg));
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

main {
  width: 100%;
  max-width: 720px;
  padding: 40px 24px 96px;
  text-align: center;
}

h1 { font-size: 2.6rem; letter-spacing: -0.02em; }
h2 { font-size: 1.9rem; letter-spacing: -0.02em; }
.logo { font-family: var(--serif); font-weight: 650; }

.heart { color: var(--accent); margin-left: 6px; }
.tagline { color: var(--muted); margin: 10px 0 28px; }
.hint { color: var(--muted); font-size: 0.85rem; }

/* ---- Welcome ---- */
.welcome {
  max-width: 480px;
  margin: 0 auto;
  padding-top: 6vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  animation: rise 0.5s ease both;
}
.welcome .logo { font-size: 3.4rem; }
.welcome .headline {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.2;
  margin: 26px 0 14px;
  background: linear-gradient(120deg, var(--text) 40%, var(--accent-soft));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.welcome .sub {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 34px;
  max-width: 400px;
}
.how {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 38px;
  text-align: left;
}
.how-row {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1rem;
  color: var(--text);
}
.how-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid rgba(255, 77, 125, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
button.big {
  font-size: 1.15rem;
  padding: 18px 48px;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 8px 30px rgba(255, 77, 125, 0.35);
  margin-bottom: 14px;
}

/* ---- Wizard steps ---- */
.step {
  max-width: 420px;
  margin: 0 auto;
  padding-top: 4vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: relative;
  animation: rise 0.4s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.step-back {
  position: absolute;
  top: 0;
  left: 0;
}
.dots { display: flex; gap: 8px; margin-bottom: 8px; }
.dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
}
.dots i.on { background: var(--accent); }
.step-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.85rem;
  line-height: 1.25;
}
.step-help { color: var(--muted); font-size: 1rem; line-height: 1.5; max-width: 340px; }
.step-help.small { font-size: 0.85rem; }
.step-help a { color: var(--accent-soft); }
.big-input {
  width: 100%;
  max-width: 340px;
  background: var(--card);
  border: 1px solid rgba(255, 77, 125, 0.3);
  border-radius: 18px;
  padding: 18px 22px;
  color: var(--text);
  font-size: 1.3rem;
  text-align: center;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.big-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 77, 125, 0.15); }
.big-input.code { letter-spacing: 0.45em; font-size: 1.6rem; }

/* Voice orb */
.orb {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  margin: 0 auto 18px;
  background: radial-gradient(circle at 35% 30%, var(--accent-soft), var(--accent) 60%, #7d1039);
  box-shadow: 0 0 60px rgba(255, 77, 125, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.orb.idle { opacity: 0.55; }
.orb.listening { animation: pulse 1.6s ease-in-out infinite; }
.orb.speaking { animation: pulse 0.7s ease-in-out infinite; box-shadow: 0 0 90px rgba(255, 77, 125, 0.6); }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

#status { color: var(--muted); min-height: 1.4em; margin-bottom: 24px; }

.controls { display: flex; gap: 12px; justify-content: center; margin: 20px 0; flex-wrap: wrap; }
.controls.column { flex-direction: column; align-items: center; }

button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
button:hover { transform: translateY(-1px); filter: brightness(1.1); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.secondary { background: transparent; border: 1px solid var(--muted); color: var(--text); }

/* Transcript & chat bubbles */
#transcript, #thread-messages {
  text-align: left;
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bubble {
  padding: 10px 16px;
  border-radius: 16px;
  max-width: 85%;
  font-size: 0.95rem;
  line-height: 1.4;
}
.bubble.agent { background: var(--card); align-self: flex-start; }
.bubble.user { background: #3a1230; align-self: flex-end; }

/* Match cards */
.match-card {
  background: var(--card);
  border: 1px solid rgba(255, 77, 125, 0.2);
  border-radius: 18px;
  padding: 22px 18px;
  text-align: left;
  position: relative;
}
.match-card.big { max-width: 420px; margin: 0 auto; padding: 28px 24px; }
.match-card .avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8a2be2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.avatar.small { width: 44px; height: 44px; font-size: 1.1rem; margin: 0; flex-shrink: 0; }
.match-card h3 { font-size: 1.3rem; margin-bottom: 2px; }
.match-card .meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 10px; }
.match-card .score {
  color: var(--accent-soft);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.match-card .bio { font-size: 0.9rem; color: var(--muted); margin: 10px 0; font-style: italic; }
.match-card .why p { font-size: 0.88rem; margin: 4px 0; }
.match-card .detail { font-size: 0.85rem; color: var(--muted); margin-top: 8px; }
.likes-you {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Deck */
.deck-controls { display: flex; gap: 20px; justify-content: center; margin-top: 20px; }
.round-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  font-size: 1.5rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.round-btn.pass { background: transparent; border: 2px solid var(--muted); color: var(--muted); }
.round-btn.like { background: var(--accent); }
#suggestion-stage .hint { margin-top: 14px; }

.empty { color: var(--muted); padding: 40px 0; line-height: 1.6; }

/* Chats list */
#chats-list { display: flex; flex-direction: column; gap: 10px; }
.chat-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid rgba(255, 77, 125, 0.15);
  border-radius: 16px;
  padding: 14px 16px;
  text-align: left;
  color: var(--text);
  font-weight: 400;
}
.chat-row:hover { transform: none; filter: brightness(1.15); }
.chat-info h4 { font-size: 1rem; margin-bottom: 2px; }
.chat-info p { font-size: 0.85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 480px; }

/* Thread */
.thread-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.thread-title { flex: 1; text-align: left; }
.icon-btn {
  background: var(--card);
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 1.5rem;
  border-radius: 50%;
}
.pill-btn { padding: 10px 18px; font-size: 0.85rem; }
#thread-messages { min-height: 300px; max-height: 55vh; margin-bottom: 12px; }
#thread-form { display: flex; gap: 10px; }
#thread-form input {
  flex: 1;
  background: var(--card);
  border: 1px solid rgba(255, 77, 125, 0.3);
  border-radius: 999px;
  padding: 13px 20px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
}
#thread-form input:focus { border-color: var(--accent); }
#thread-form button { padding: 13px 24px; }

/* Date screen */
.date-view h3 { margin-bottom: 6px; }
.history-title { margin: 28px 0 10px; font-size: 1rem; color: var(--muted); }
.history-row {
  display: flex;
  justify-content: space-between;
  background: var(--card);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

/* Bottom nav */
#nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  background: rgba(18, 6, 15, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 77, 125, 0.15);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
}
#nav button {
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 1.25rem;
  padding: 6px 22px;
  border-radius: 14px;
}
#nav button span { font-size: 0.68rem; font-weight: 600; }
#nav button.active { color: var(--accent-soft); background: rgba(255, 77, 125, 0.12); }

/* Overlays */
#match-overlay, #date-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 3, 8, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 24px;
}
.celebrate, .modal-card {
  background: var(--card);
  border: 1px solid rgba(255, 77, 125, 0.35);
  border-radius: 22px;
  padding: 36px 28px;
  max-width: 380px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.big-heart { font-size: 3.5rem; animation: pulse 1s ease-in-out infinite; }
.modal-card { text-align: left; }
.modal-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}
.modal-card input {
  background: var(--bg);
  border: 1px solid rgba(255, 77, 125, 0.3);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  color-scheme: dark;
}
.modal-card input:focus { border-color: var(--accent); }

/* Toast */
#toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid rgba(255, 77, 125, 0.4);
  border-radius: 999px;
  padding: 12px 24px;
  font-size: 0.9rem;
  z-index: 30;
  max-width: 90vw;
}

/* Auth */
.auth-box {
  max-width: 340px;
  margin: 24px auto 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#phone-step, #code-step { display: flex; flex-direction: column; gap: 12px; }
.auth-box input {
  background: var(--card);
  border: 1px solid rgba(255, 77, 125, 0.3);
  border-radius: 999px;
  padding: 14px 20px;
  color: var(--text);
  font-size: 1.05rem;
  text-align: center;
  outline: none;
}
.auth-box input:focus { border-color: var(--accent); }
.error { color: #ff7b7b; font-size: 0.9rem; min-height: 1.2em; }
