:root {
  color-scheme: light;
  --pink: #e83e8c; --pink-dark: #c2185b; --pink-soft: #fde8f0; --pink-bg: #fff5f9;
  --gold-bg: #fff4dc; --gold: #8a5a00; --text: #1d1d1f; --muted: #8e8e93; --line: #eee;
  --bubble: #f1f1f4; --bg: #fff; --green: #34c759;
  --g1: linear-gradient(160deg, #f7a8c4 0%, #c2185b 55%, #3a0a1f 100%);
}
[hidden] { display: none !important; }
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--text);
  overscroll-behavior: none; }
button { font: inherit; border: 0; background: none; color: inherit; cursor: pointer; }
input { font: inherit; color: var(--text); -webkit-text-fill-color: var(--text); background: #fff;
  -webkit-appearance: none; appearance: none; caret-color: var(--pink); }
input::placeholder { color: #a0a0a8; -webkit-text-fill-color: #a0a0a8; }
#app { height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  max-width: 520px; margin: 0 auto; position: relative; overflow: hidden; }
.splash { margin: auto; font-size: 64px; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { transform: scale(1.15); } }

/* шапка и вкладки */
.top { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; gap: 8px; }
.top h1 { font-size: 20px; }
.top .sub { font-size: 12px; color: var(--muted); }
.pill { background: var(--pink-soft); color: #a3285a; border-radius: 20px; padding: 6px 12px; font-size: 13px; font-weight: 600; }
.coins { background: var(--gold-bg); color: var(--gold); border-radius: 20px; padding: 6px 12px; font-size: 14px; font-weight: 700; }
.screen { flex: 1; overflow-y: auto; padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.nav { display: flex; justify-content: space-around; border-top: 1px solid var(--line); padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); background: #fff; }
.nav button { display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--muted); gap: 2px; min-width: 64px; position: relative; }
.nav .i { font-size: 22px; }
.nav .on { color: var(--pink-dark); font-weight: 600; }
.badge { position: absolute; top: -2px; right: 10px; background: var(--pink); color: #fff; border-radius: 10px; padding: 0 6px; font-size: 10px; line-height: 16px; }

/* карточка анкеты */
.card-zone { flex: 1; position: relative; min-height: 0; }
.screen.fit { overflow: hidden; }
.card { position: absolute; inset: 0; border-radius: 22px; overflow: hidden; color: #fff; background: var(--g1) center/cover;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 18px; touch-action: pan-y; user-select: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); transition: transform .25s; touch-action: pan-y; }
.card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.65)); }
.card > * { position: relative; z-index: 1; }
.card .stamp { position: absolute; top: 24px; font-size: 28px; font-weight: 800; padding: 4px 12px; border: 3px solid; border-radius: 10px; opacity: 0; z-index: 2; }
.card .stamp.yes { left: 20px; color: #4cd964; transform: rotate(-12deg); }
.card .stamp.no { right: 20px; color: #ff3b30; transform: rotate(12deg); }
.name { font-size: 26px; font-weight: 700; }
.city { font-size: 14px; opacity: .95; margin-top: 2px; }
.ai-tag { font-size: 13px; background: rgba(255,255,255,.25); border-radius: 12px; padding: 2px 8px; margin-left: 6px; vertical-align: middle; font-weight: 600; }
.bio { font-size: 15px; opacity: .95; line-height: 1.35; margin-top: 4px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { background: rgba(255,255,255,.22); border-radius: 14px; padding: 4px 10px; font-size: 12px; }
.liked-me { background: rgba(232,62,140,.9); border-radius: 12px; padding: 6px 10px; font-weight: 700; font-size: 14px; align-self: flex-start; margin-bottom: 8px; }
.acts { display: flex; justify-content: center; align-items: center; gap: 26px; padding: 4px 0; }
.round { width: 66px; height: 66px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 30px;
  background: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.round.no { color: #999; } .round.yes { color: #fff; background: var(--pink); }
.round.info { width: 52px; height: 52px; font-size: 20px; color: #f5a400; }
.empty { margin: auto; text-align: center; color: var(--muted); padding: 30px; line-height: 1.5; }
.empty .big { font-size: 54px; margin-bottom: 8px; }

/* кнопки */
.cta { background: var(--pink); color: #fff; border-radius: 14px; padding: 15px; text-align: center; font-size: 16px; font-weight: 600; width: 100%; }
.cta:disabled { opacity: .5; }
.ghost { border: 1.5px solid var(--pink); color: var(--pink-dark); border-radius: 14px; padding: 13px; text-align: center; font-size: 15px; font-weight: 600; width: 100%; }
.sm { font-size: 13px; color: var(--muted); }
.center { text-align: center; }

/* мэтч */
.match { position: absolute; inset: 0; z-index: 20; background: linear-gradient(170deg, #ff7eb3, #c2185b 60%, #5a0a2a); color: #fff;
  display: flex; flex-direction: column; animation: fade .3s; }
@keyframes fade { from { opacity: 0; } }
.match .mid { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 0 26px; text-align: center; }
.match .pair { display: flex; align-items: center; height: 220px; }
.match .ph { width: 140px; height: 190px; border-radius: 20px; border: 4px solid #fff; background: center/cover; display: flex; align-items: center; justify-content: center; font-size: 70px; }
.match .ph.me { background: linear-gradient(160deg, #ddd, #888); transform: rotate(-9deg); }
.match .ph.her { transform: rotate(9deg); margin-left: -26px; }
.match h2 { font-size: 34px; font-weight: 800; }
.match .bottom { padding: 0 20px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.dots3 { font-size: 28px; letter-spacing: 4px; animation: pulse 1.2s infinite; }

/* список чатов */
.row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); text-align: left; width: 100%; }
.ava { width: 54px; height: 54px; border-radius: 50%; background: var(--g1) center/cover; flex: none; }
.row .t { flex: 1; min-width: 0; }
.row .t b { display: block; }
.row .t span { display: block; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.free { background: var(--pink-soft); color: var(--pink-dark); border-radius: 10px; font-size: 11px; padding: 2px 8px; font-weight: 600; flex: none; }

/* чат */
.chat-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.chat-head .ava { width: 40px; height: 40px; }
.chat-head .online { font-size: 12px; color: var(--green); }
.back { font-size: 26px; color: var(--muted); padding: 0 6px; }
.msgs { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 1.35; white-space: pre-wrap; word-wrap: break-word; }
.msg.in { background: var(--bubble); border-bottom-left-radius: 6px; align-self: flex-start; }
.msg.out { background: var(--pink); color: #fff; align-self: flex-end; border-bottom-right-radius: 6px; }
.msg.typing { color: var(--muted); }
.lock { width: 220px; height: 260px; border-radius: 18px; background: #c2185b center/cover; position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: #fff; gap: 10px; overflow: hidden; align-self: flex-start; }
.lock .ico { font-size: 34px; }
.lock .lockbtn { background: #fff; color: var(--pink-dark); border-radius: 20px; padding: 8px 16px; font-weight: 700; font-size: 14px; }
.lock.open { cursor: zoom-in; }
.chat-foot { padding: 6px 16px calc(12px + env(safe-area-inset-bottom)); }
.input { display: flex; align-items: center; gap: 10px; border: 1px solid #e5e5ea; border-radius: 24px; padding: 6px 8px 6px 14px; }
.input input { flex: 1; border: 0; outline: 0; font-size: 15px; padding: 6px 0; min-width: 0; background: none; }
.input .send { color: var(--pink); font-size: 22px; padding: 0 6px; }
.input .gift { font-size: 20px; padding: 0 4px; }

/* сетки */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { aspect-ratio: 3/4; border-radius: 14px; display: flex; align-items: flex-end; padding: 8px; color: #fff; font-size: 13px; font-weight: 600;
  position: relative; overflow: hidden; background: var(--g1) center/cover; }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.55)); }
.tile > * { position: relative; z-index: 1; }
.tile.locked { justify-content: center; align-items: center; flex-direction: column; gap: 4px; font-size: 22px; background: linear-gradient(160deg, #cfcfd6, #8d8d97); }
.tile.locked::after { display: none; }
.tile.locked span { font-size: 13px; }
.tile.blur { justify-content: center; align-items: center; flex-direction: column; gap: 4px; font-size: 22px; }
.tile.blur span { font-size: 13px; }
.boost-box { border-radius: 18px; background: #fff8e6; padding: 16px; display: flex; gap: 12px; align-items: center; }
.boost-box .bolt { font-size: 34px; }
.low { color: #d93025; } .high { color: #e8590c; }

/* профиль героини */
.hero { height: 330px; border-radius: 0 0 26px 26px; background: var(--g1) center/cover; color: #fff; position: relative; display: flex;
  flex-direction: column; justify-content: flex-end; padding: 18px; flex: none; }
.hero::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.6)); }
.hero > * { position: relative; z-index: 1; }
.hero .back { position: absolute; top: 10px; left: 10px; color: #fff; z-index: 2; background: rgba(0,0,0,.25); border-radius: 50%; width: 36px; height: 36px; font-size: 22px; }
.chip2 { display: inline-block; border-radius: 16px; padding: 7px 13px; font-size: 14px; background: #f4f4f6; margin: 0 6px 8px 0; }

/* регистрация */
.reg { padding: 22px 16px; display: flex; flex-direction: column; gap: 14px; flex: 1; overflow-y: auto; }
.reg h2 { text-align: center; font-size: 23px; }
.progress { height: 6px; border-radius: 3px; background: #f1f1f4; }
.progress i { display: block; height: 6px; background: var(--pink); border-radius: 3px; transition: width .3s; }
.field { border: 1.5px solid #e5e5ea; border-radius: 14px; padding: 12px 12px; font-size: 17px; line-height: 1.3; outline: 0; width: 100%; text-indent: 0; }
.field:focus { border-color: var(--pink); }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chip { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; font-size: 15px; }
.chip.on { border-color: var(--pink); background: #fff0f6; color: var(--pink-dark); font-weight: 600; }

/* нижний лист (магазин, подарки) */
.sheet-wrap { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { background: #fff; border-radius: 26px 26px 0 0; padding: 14px 18px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 11px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; animation: up .25s; }
@keyframes up { from { transform: translateY(40px); } }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: #ddd; align-self: center; }
.sheet .emoji { text-align: center; font-size: 40px; }
.sheet h3 { text-align: center; font-size: 20px; }
.pack { background: #fff; border: 1.5px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; font-size: 15px; width: 100%; text-align: left; }
.pack b { font-size: 17px; }
.pack .pack-l { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding-right: 10px; }
.pack .note { font-size: 13px; color: #555; line-height: 1.3; }
.pack .per { font-size: 12px; color: var(--muted); }
.pack .old { display: block; font-size: 12px; color: var(--muted); }
.need { background: var(--pink-bg); color: var(--pink-dark); border-radius: 12px; padding: 10px 12px; font-size: 14px; text-align: center; }
.round.info { flex-direction: column; line-height: 1; }
.sl-price { font-size: 10px; color: var(--muted); margin-top: 2px; }
.pack.on { border: 2px solid var(--pink); background: var(--pink-bg); }
.pack .stars { color: var(--muted); font-size: 13px; display: block; }
.lbl { font-size: 11px; font-weight: 700; color: #fff; background: var(--pink); border-radius: 8px; padding: 2px 8px; margin-left: 6px; }
.lbl.green { background: #1f9e7f; }
.viewer { position: fixed; inset: 0; background: #000; z-index: 60; display: flex; align-items: center; justify-content: center; }
.viewer img { max-width: 100%; max-height: 100%; }
.viewer button { position: absolute; top: 14px; right: 14px; color: #fff; font-size: 30px; }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: rgba(30,30,30,.92); color: #fff; padding: 10px 16px;
  border-radius: 12px; font-size: 14px; z-index: 70; max-width: 90%; text-align: center; }
.me-card { border-radius: 18px; background: var(--pink-bg); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.me-card .big { font-size: 22px; font-weight: 700; }
