:root {
  --bg: #fff7f8;
  --surface: #ffffff;
  --surface-2: #fff0f3;
  --text: #2a1a22;
  --muted: #8a7480;
  --border: #f1dde3;
  --brand: #ff4f7b;
  --brand-2: #ff8a5b;
  --brand-grad: linear-gradient(135deg, #ff8a5b 0%, #ff4f7b 55%, #d9367a 100%);
  --good: #19a974;
  --warn: #f4a100;
  --bad: #e5484d;
  --love: #ff4f7b;
  --hate: #7a5af8;
  --hobby: #0ea5a4;
  --sport: #f08c00;
  --shadow: 0 10px 30px rgba(120, 30, 60, .12);
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #160d12; --surface: #22161c; --surface-2: #2c1d25; --text: #f8eaf0; --muted: #b59aa7;
    --border: #3a2731; --shadow: 0 10px 30px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #160d12; --surface: #22161c; --surface-2: #2c1d25; --text: #f8eaf0; --muted: #b59aa7;
  --border: #3a2731; --shadow: 0 10px 30px rgba(0, 0, 0, .4); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
.hidden { display: none !important; }

.app { max-width: 560px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
.view { flex: 1; padding: 16px 16px 96px; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.topbar h1 { font-size: 24px; margin: 0; flex: 1; letter-spacing: -.02em; }
.logo { font-weight: 800; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- tabs ---------- */
.tabs {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 560px;
  display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface);
  border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 20;
}
.tabs button {
  position: relative; background: none; border: 0; display: flex; flex-direction: column; align-items: center;
  gap: 2px; font-size: 11px; color: var(--muted); padding: 6px 0; cursor: pointer; border-radius: 12px;
}
.tabs button .ico { font-size: 22px; filter: grayscale(.8); transition: transform .15s; }
.tabs button.active { color: var(--brand); font-weight: 600; }
.tabs button.active .ico { filter: none; transform: scale(1.1); }
.badge {
  position: absolute; top: 2px; right: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--brand); color: #fff; font-size: 11px; line-height: 18px; text-align: center;
}

/* ---------- buttons & inputs ---------- */
.btn {
  border: 0; border-radius: 999px; padding: 12px 20px; font-weight: 600; cursor: pointer;
  background: var(--surface-2); color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .1s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--brand-grad); color: #fff; box-shadow: 0 6px 18px rgba(255, 79, 123, .35); }
.btn.ghost { background: transparent; border: 1px solid var(--border); }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid var(--bad); }
.btn.small { padding: 7px 14px; font-size: 14px; }
.btn.block { width: 100%; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: 18px; display: inline-flex; align-items: center; justify-content: center; flex: none;
}

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface); outline: none;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 79, 123, .15); }
textarea.input { resize: vertical; min-height: 90px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-size: 14px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--brand); width: 18px; height: 18px; flex: none; }
input[type=range] { width: 100%; accent-color: var(--brand); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.error { color: var(--bad); font-size: 14px; min-height: 20px; margin: 6px 0; }

.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px;
  border: 1px solid var(--border);
}
.card h3 { margin: 0 0 10px; font-size: 16px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; font-weight: 700; }

/* ---------- segmented ---------- */
.segmented { display: flex; background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 4px; margin-bottom: 12px; }
.segmented button { flex: 1; border: 0; background: transparent; padding: 9px 10px; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--muted); }
.segmented button.active { background: var(--surface); color: var(--brand); box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border); background: var(--surface); padding: 6px 12px; border-radius: 999px;
  font-size: 13px; cursor: pointer; user-select: none; white-space: nowrap;
}
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.static { cursor: default; }
.chip.love { background: rgba(255, 79, 123, .12); border-color: transparent; color: var(--love); }
.chip.hate { background: rgba(122, 90, 248, .12); border-color: transparent; color: var(--hate); }
.chip.hobby { background: rgba(14, 165, 164, .12); border-color: transparent; color: var(--hobby); }
.chip.sport { background: rgba(240, 140, 0, .14); border-color: transparent; color: var(--sport); }
.chip.intent { background: var(--surface-2); border-color: transparent; }
.chip .x { margin-left: 6px; opacity: .7; }
.tag-input { display: flex; gap: 8px; margin: 8px 0; }

/* ---------- auth ---------- */
.hero { text-align: center; padding: 30px 10px 10px; }
.hero .mark { width: 76px; height: 76px; border-radius: 22px; margin: 0 auto 12px; display: block; box-shadow: var(--shadow); }
.hero h1 { font-size: 36px; margin: 0; letter-spacing: -.03em; }
.hero p { color: var(--muted); margin: 8px auto 0; max-width: 340px; }
.feature-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0; }
.feature-list div { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px; font-size: 13px; }
.feature-list b { display: block; font-size: 14px; }

/* ---------- avatar ---------- */
.avatar {
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff;
  font-weight: 700; flex: none; overflow: hidden; background: var(--brand-grad);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.s40 { width: 40px; height: 40px; font-size: 16px; }
.avatar.s52 { width: 52px; height: 52px; font-size: 20px; }
.avatar.s96 { width: 96px; height: 96px; font-size: 36px; }
.avatar.mystery { background: linear-gradient(135deg, #3b2a4f, #7a5af8); }
.online-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--good); display: inline-block; box-shadow: 0 0 0 2px var(--surface); }

/* ---------- discover card ---------- */
.profile-card { background: var(--surface); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border); }
.profile-card .photo {
  position: relative; aspect-ratio: 4 / 4.4; background: var(--brand-grad); display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, .9); font-size: 96px; font-weight: 800; cursor: pointer;
}
.profile-card .photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-card .photo .overlay {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 50px 16px 14px; color: #fff; font-size: 15px; font-weight: 400;
  background: linear-gradient(transparent, rgba(0, 0, 0, .7));
}
.profile-card .overlay h2 { margin: 0; font-size: 26px; display: flex; align-items: center; gap: 8px; }
.profile-card .match-pill {
  position: absolute; top: 12px; right: 12px; background: rgba(255, 255, 255, .95); color: var(--brand);
  border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 800;
}
.profile-card .body { padding: 14px 16px 16px; }
.verified { color: #3b9bff; font-size: 18px; }
.actions { display: flex; justify-content: center; gap: 22px; margin: 16px 0 4px; }
.round {
  width: 64px; height: 64px; border-radius: 50%; border: 0; font-size: 28px; cursor: pointer; background: var(--surface);
  box-shadow: var(--shadow); transition: transform .12s;
}
.round:active { transform: scale(.9); }
.round.like { background: var(--brand-grad); color: #fff; }
.round.info { width: 50px; height: 50px; font-size: 20px; align-self: center; }

.common-group { margin-top: 10px; }
.common-group .label { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini {
  position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 3 / 4; background: var(--brand-grad); cursor: pointer;
  color: #fff; display: flex; align-items: flex-end; box-shadow: var(--shadow);
}
.mini img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mini .initial { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 56px; font-weight: 800; opacity: .85; }
.mini .meta { position: relative; width: 100%; padding: 30px 10px 10px; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); font-size: 13px; }
.mini .meta b { font-size: 16px; display: block; }
.mini .pct { position: absolute; top: 8px; right: 8px; background: rgba(255, 255, 255, .95); color: var(--brand); border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 800; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .big { font-size: 56px; display: block; margin-bottom: 10px; }

/* ---------- sheets / modals ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(20, 5, 12, .5); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet {
  background: var(--bg); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 24px 24px 0 0;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); animation: up .2s ease-out;
}
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--border); margin: 0 auto 10px; }
.sheet h2 { margin: 4px 0 14px; font-size: 20px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: #2a1a22; color: #fff;
  padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 80; box-shadow: var(--shadow); max-width: 90vw; text-align: center;
}

.match-splash { text-align: center; padding: 20px 0; }
.match-splash h2 { font-size: 34px; margin: 6px 0; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- chats ---------- */
.conv-item {
  display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; cursor: pointer; background: var(--surface);
  border: 1px solid var(--border); margin-bottom: 8px;
}
.conv-item .info { flex: 1; min-width: 0; }
.conv-item .name { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.conv-item .preview { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item .unread { background: var(--brand); color: #fff; border-radius: 999px; font-size: 12px; padding: 1px 8px; font-weight: 700; }
.tag-blind { font-size: 11px; background: rgba(122, 90, 248, .15); color: var(--hate); padding: 1px 7px; border-radius: 999px; font-weight: 700; }

.chat { position: fixed; inset: 0; background: var(--bg); z-index: 30; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface); }
.chat-head .who { flex: 1; min-width: 0; cursor: pointer; }
.chat-head .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .who span { font-size: 12px; color: var(--muted); }
.chat-banner { padding: 10px 14px; font-size: 13px; background: var(--surface-2); border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: center; }
.chat-banner .grow { flex: 1; }
.chat-banner.blind { background: linear-gradient(135deg, rgba(122, 90, 248, .15), rgba(255, 79, 123, .12)); }
.messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 78%; padding: 9px 13px; border-radius: 18px; word-wrap: break-word; white-space: pre-wrap; font-size: 15px; position: relative; }
.msg.them { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.msg.me { align-self: flex-end; background: var(--brand-grad); color: #fff; border-bottom-right-radius: 6px; }
.msg .time { display: block; font-size: 10px; opacity: .7; margin-top: 3px; text-align: right; }
.msg.blurred { cursor: pointer; }
.msg.blurred .text { filter: blur(6px); user-select: none; }
.msg.blurred::after { content: "🙈 Tap to reveal (may be explicit)"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.typing { font-size: 12px; color: var(--muted); padding: 0 16px 4px; height: 18px; }
.composer { display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface); }
.composer textarea { flex: 1; resize: none; height: 44px; min-height: 44px; max-height: 120px; border-radius: 22px; padding: 11px 16px; }
.composer .send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--brand-grad); color: #fff; font-size: 18px; cursor: pointer; flex: none; }
.icebreakers { display: flex; gap: 6px; overflow-x: auto; padding: 0 12px 8px; }
.icebreakers .chip { flex: none; }
.system-note { align-self: center; font-size: 12px; color: var(--muted); background: var(--surface-2); padding: 5px 12px; border-radius: 999px; text-align: center; }

/* ---------- blind ---------- */
.blind-hero { text-align: center; padding: 24px 10px; }
.blind-hero .mask { font-size: 72px; display: block; }
.pulse { display: inline-block; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { transform: scale(1.15); opacity: .7; } }

.profile-header { text-align: center; }
.profile-header .avatar { margin: 0 auto 8px; cursor: pointer; }
.list-btn { display: flex; width: 100%; align-items: center; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 8px; cursor: pointer; text-align: left; }
.list-btn .grow { flex: 1; }
.tip { display: flex; gap: 10px; margin-bottom: 10px; font-size: 14px; }
.tip span:first-child { font-size: 20px; }
.status-pill { font-size: 12px; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.status-planned { background: rgba(244, 161, 0, .15); color: var(--warn); }
.status-safe { background: rgba(25, 169, 116, .15); color: var(--good); }
.status-help { background: rgba(229, 72, 77, .15); color: var(--bad); }
pre.share { white-space: pre-wrap; background: var(--surface-2); padding: 12px; border-radius: 12px; font: 13px/1.4 inherit; }

@media (min-width: 600px) {
  .view { padding-top: 24px; }
  .grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* ---------- announcement & support ---------- */
.announce { display: flex; gap: 10px; align-items: center; margin: 12px 16px 0; padding: 10px 14px; border-radius: 14px; background: rgba(59, 130, 246, .12); color: var(--text); font-size: 14px; }
.announce.warn { background: rgba(244, 161, 0, .18); }
.announce .x { border: 0; background: none; cursor: pointer; font-size: 14px; opacity: .7; }
.badge-inline { background: var(--brand); color: #fff; border-radius: 999px; padding: 0 8px; font-size: 12px; margin-right: 6px; }
.support-thread { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 14px; }
.sbubble { max-width: 88%; padding: 9px 12px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; font-size: 14px; }
.sbubble .who { font-size: 11px; font-weight: 700; opacity: .75; margin-bottom: 2px; }
.sbubble.member { align-self: flex-end; background: var(--brand-grad); color: #fff; }
.sbubble.staff { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); }
.sbubble.system { align-self: center; background: var(--surface-2); color: var(--muted); font-size: 13px; }
