:root {
  --bg: #0e1016;
  --bg2: #151823;
  --card: #1b1f2e;
  --card2: #222740;
  --line: #2a2f45;
  --text: #eef0f7;
  --muted: #9aa1b8;
  --accent1: #ff5e8a;
  --accent2: #8b5cf6;
  --gold: #fbbf24;
  --ok: #34d399;
  --bad: #f87171;
  --radius: 16px;
}
/* Атрибут hidden всегда скрывает, даже если у элемента задан display (модалка, бейджи) */
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}
a { color: var(--accent2); text-decoration: none; }
img { max-width: 100%; display: block; }

.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: rgba(14,16,22,0.85);
  backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 1.15rem; color: var(--text); letter-spacing: 0.3px; }
.nav-links { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-links a {
  color: var(--muted); padding: 7px 10px; border-radius: 10px; font-size: 0.9rem;
  transition: background .15s, color .15s;
}
.nav-links a:hover { color: var(--text); background: var(--card); }
.badge {
  display: inline-block; min-width: 18px; height: 18px; line-height: 18px;
  background: var(--accent1); color: #fff; border-radius: 9px;
  font-size: 0.7rem; text-align: center; padding: 0 5px; margin-left: 4px; vertical-align: 2px;
}
.wrap { max-width: 960px; margin: 0 auto; padding: 20px 16px 60px; }

/* ---------- Лендинг ---------- */
.landing { text-align: center; padding-top: 40px; }
.hero-emoji { font-size: 4rem; }
.hero h1 {
  font-size: clamp(2.6rem, 8vw, 4.2rem); margin: 10px 0 6px;
  background: linear-gradient(120deg, var(--accent1), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { color: var(--muted); font-size: 1.15rem; line-height: 1.6; }
.hero-actions { margin: 28px 0 50px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px; text-align: left;
}
.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
}
.feature-icon { font-size: 1.8rem; }
.feature h3 { margin: 10px 0 6px; font-size: 1.05rem; }
.feature p { color: var(--muted); margin: 0; font-size: 0.92rem; line-height: 1.55; }
.landing-note { color: var(--muted); margin-top: 36px; font-size: 0.9rem; }

/* ---------- Кнопки и формы ---------- */
.btn {
  display: inline-block; border: 0; cursor: pointer; border-radius: 12px;
  padding: 11px 20px; font-size: 0.98rem; font-weight: 600; color: #fff;
  background: linear-gradient(120deg, var(--accent1), var(--accent2));
  transition: transform .12s, opacity .15s; text-align: center;
}
.btn:hover { opacity: 0.92; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-ghost {
  background: var(--card); color: var(--text); border: 1px solid var(--line);
}
.btn-block { display: block; width: 100%; }
.btn-small { padding: 7px 12px; font-size: 0.85rem; }
.btn-super { background: linear-gradient(120deg, #f59e0b, #fbbf24); color: #1a1205; }
.btn-danger { background: linear-gradient(120deg, #b91c1c, #7f1d1d); }
.btn-danger-ghost { color: var(--bad); border-color: rgba(248,113,113,0.4); background: transparent; }

input, select, textarea {
  width: 100%; background: var(--bg2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; font-size: 0.98rem; font-family: inherit; margin: 4px 0 14px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent2); }
label { font-size: 0.86rem; color: var(--muted); display: block; }
textarea { resize: vertical; }
.form-row { display: flex; gap: 12px; }
.form-row > div { flex: 1; min-width: 0; }
.check { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; font-size: 0.92rem; color: var(--text); }
.check input { width: auto; margin: 0; }
.big-check { font-size: 1rem; padding: 10px 0; }
.checks { display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.inline-range { display: flex; align-items: center; gap: 8px; }
.inline-range input { width: 4.5em; }
.form-error {
  background: rgba(248,113,113,0.12); border: 1px solid rgba(248,113,113,0.4);
  color: var(--bad); padding: 10px 14px; border-radius: 10px; margin-bottom: 14px;
}
.form-ok { color: var(--ok); margin-left: 12px; font-weight: 600; }

.card-panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 18px;
}
.card-panel h3 { margin: 0 0 10px; font-size: 1.05rem; }
.danger-panel { border-color: rgba(248,113,113,0.35); }

.auth-card {
  max-width: 430px; margin: 40px auto; background: var(--card);
  border: 1px solid var(--line); border-radius: 20px; padding: 26px;
}
.auth-tabs { display: flex; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.auth-tabs a {
  flex: 1; text-align: center; padding: 10px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.auth-tabs a.active { color: var(--text); border-color: var(--accent1); }
.auth-note { color: var(--muted); font-size: 0.8rem; text-align: center; margin-top: 10px; }

/* ---------- Лента ---------- */
.filters-panel { margin-bottom: 14px; }
.filters-panel summary {
  cursor: pointer; color: var(--muted); font-size: 0.9rem; padding: 6px 2px;
  user-select: none;
}
.filters {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  padding: 12px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; margin-top: 6px;
}
.filters label { display: flex; flex-direction: column; gap: 2px; font-size: 0.82rem; }
.filters input, .filters select { width: auto; margin: 0; padding: 8px 10px; }
.filters .check { flex-direction: row; align-items: center; padding-top: 8px; }
.feed { display: flex; justify-content: center; }
.feed-card {
  width: 100%; max-width: 430px; background: var(--card);
  border: 1px solid var(--line); border-radius: 22px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
  position: relative; touch-action: pan-y; transition: transform .25s ease, opacity .25s ease;
}
.feed-card.swiping { transition: none; }
.feed-card.swiped-left { transform: translateX(-120%) rotate(-12deg); opacity: 0; }
.feed-card.swiped-right { transform: translateX(120%) rotate(12deg); opacity: 0; }
.feed-card .photo-wrap { position: relative; height: 470px; background: var(--bg2); display: block; }
.feed-card .photo-wrap img { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.feed-card .photo-wrap .no-photo {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 7rem; font-weight: 800;
  background: linear-gradient(120deg, var(--accent1), var(--accent2));
}
.feed-card .card-overlay {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 20px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,0.78));
}
.feed-card h3 { margin: 0 0 4px; font-size: 1.5rem; }
.feed-card .city { color: #cfd3e3; font-size: 0.92rem; margin-bottom: 6px; }
.feed-card .goal-chip {
  display: inline-block; background: rgba(139,92,246,0.35); border: 1px solid rgba(139,92,246,0.6);
  color: #e4dcff; font-size: 0.78rem; padding: 3px 10px; border-radius: 20px; margin-bottom: 4px;
}
.feed-card .bio {
  font-size: 0.92rem; color: #e4e7f2; margin: 6px 0; max-height: 60px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.verified-inline {
  display: inline-block; width: 22px; height: 22px; line-height: 22px; border-radius: 50%;
  background: linear-gradient(120deg, #38bdf8, #6366f1); color: #fff; font-size: 0.8rem;
  text-align: center; vertical-align: 3px; margin-left: 6px;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip {
  background: var(--card2); border: 1px solid var(--line); color: var(--muted);
  font-size: 0.78rem; padding: 4px 10px; border-radius: 20px;
}
.card-actions {
  display: flex; gap: 16px; justify-content: center; padding: 14px;
  background: var(--card); border-top: 1px solid var(--line);
}
.act-btn {
  width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  font-size: 1.5rem; display: flex; align-items: center; justify-content: center;
  transition: transform .12s; box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
.act-btn:hover { transform: scale(1.08); }
.act-pass { background: var(--card2); color: var(--bad); border: 1px solid var(--line); }
.act-like { background: linear-gradient(120deg, var(--accent1), var(--accent2)); color: #fff; }
.act-super {
  background: linear-gradient(120deg, #f59e0b, #fbbf24); color: #1a1205;
  width: 48px; height: 48px; font-size: 1.2rem; align-self: center;
}
.feed-empty { text-align: center; color: var(--muted); padding: 60px 0; }
.feed-empty h3 { color: var(--text); }

/* ---------- Модалка пары ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 34px; text-align: center; max-width: 380px; width: 100%;
}
.modal-emoji { font-size: 3.4rem; }
.modal-card h2 { margin: 10px 0 6px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

/* ---------- Симпатии, гости, уведомления ---------- */
.page-title { margin: 8px 0 18px; font-size: 1.4rem; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
  padding: 9px 16px; border-radius: 20px; cursor: pointer; font-size: 0.92rem;
}
.tab.active { color: #fff; background: linear-gradient(120deg, var(--accent1), var(--accent2)); border-color: transparent; }
.like-item {
  display: flex; align-items: center; gap: 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px;
}
.like-item img.thumb, .match-avatar, .guest-avatar {
  width: 54px; height: 54px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.like-item .no-photo, .match-avatar-no {
  width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.3rem;
  background: linear-gradient(120deg, var(--accent1), var(--accent2));
}
.like-item .who { flex: 1; min-width: 0; }
.like-item .who h4 { margin: 0 0 2px; font-size: 1rem; }
.like-item .who p { margin: 0; color: var(--muted); font-size: 0.85rem; }
.super-tag {
  display: inline-block; background: rgba(251,191,36,0.15); border: 1px solid rgba(251,191,36,0.5);
  color: var(--gold); font-size: 0.72rem; padding: 1px 8px; border-radius: 20px; margin-left: 8px;
  vertical-align: 2px;
}
.notif-item { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.notif-item.unread { border-color: rgba(139,92,246,0.55); background: rgba(139,92,246,0.08); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent1); flex-shrink: 0; }
.notif-time { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.search-meta { color: var(--muted); font-size: 0.88rem; margin: 6px 0 14px; }

/* ---------- Пары ---------- */
.matches-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.match-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; display: flex; flex-direction: column; gap: 8px;
  transition: border-color .15s;
}
.match-card:hover { border-color: var(--accent2); }
.match-card .match-head { display: flex; align-items: center; gap: 12px; }
.match-card .match-head h4 { margin: 0; font-size: 1.02rem; }
.match-card .match-head .city { color: var(--muted); font-size: 0.82rem; }
.match-preview { color: var(--muted); font-size: 0.88rem; min-height: 20px; flex: 1; }
.match-preview.unread { color: var(--text); font-weight: 600; }
.match-card .btn { margin-top: 4px; }

/* ---------- Поиск ---------- */
.search-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; display: flex; flex-direction: column; cursor: pointer;
  transition: border-color .15s;
}
.search-card:hover { border-color: var(--accent2); }
.search-card .sc-photo { position: relative; aspect-ratio: 3/4; background: var(--bg2); }
.search-card .sc-photo img { width: 100%; height: 100%; object-fit: cover; }
.search-card .sc-photo .no-photo {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 3.4rem; font-weight: 800; background: linear-gradient(120deg, var(--accent1), var(--accent2));
}
.search-card .sc-info { padding: 10px 12px 12px; }
.search-card .sc-info h4 { margin: 0 0 2px; font-size: 0.98rem; }
.search-card .sc-info .city { color: var(--muted); font-size: 0.82rem; }
.search-card .sc-goal { color: var(--muted); font-size: 0.78rem; margin-top: 4px; }
.sc-like {
  position: absolute; right: 8px; bottom: 8px; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: linear-gradient(120deg, var(--accent1), var(--accent2));
  color: #fff; font-size: 1.1rem; cursor: pointer; z-index: 2;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}
.sc-like.liked { background: var(--card2); color: var(--muted); }

/* ---------- Чат ---------- */
.chat-shell {
  max-width: 700px; margin: 0 auto; display: flex; flex-direction: column;
  height: calc(100vh - 130px); min-height: 420px;
}
.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px 16px 0 0; padding: 12px 16px;
}
.chat-back { color: var(--muted); font-size: 0.9rem; }
.chat-peer-name { font-weight: 700; }
.chat-peer-city { color: var(--muted); font-size: 0.8rem; }
.chat-profile-link { font-size: 0.88rem; }
.chat-messages {
  flex: 1; overflow-y: auto; background: var(--bg2);
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  padding: 16px; display: flex; flex-direction: column; gap: 8px;
}
.msg { max-width: 75%; padding: 9px 14px; border-radius: 14px; font-size: 0.95rem; line-height: 1.45; word-wrap: break-word; white-space: pre-wrap; }
.msg.me { align-self: flex-end; background: linear-gradient(120deg, var(--accent1), var(--accent2)); color: #fff; border-bottom-right-radius: 4px; }
.msg.them { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg .time { display: block; font-size: 0.68rem; opacity: 0.65; margin-top: 3px; }
.msg-day {
  align-self: center; color: var(--muted); font-size: 0.75rem; margin: 8px 0;
  background: var(--card); padding: 3px 12px; border-radius: 20px; border: 1px solid var(--line);
}
.chat-input { display: flex; gap: 10px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 16px 16px; }
.chat-input input { margin: 0; flex: 1; }

/* ---------- Профиль ---------- */
.profile-layout { display: grid; grid-template-columns: 1fr 1.3fr; gap: 20px; align-items: start; }
@media (max-width: 720px) { .profile-layout { grid-template-columns: 1fr; } }
.photos-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.photo-item { position: relative; border-radius: 12px; overflow: hidden; }
.photo-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo-item .del {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,0.65); color: #fff; cursor: pointer; font-size: 0.9rem;
}
.photo-note { color: var(--muted); font-size: 0.8rem; }
.upload-btn { margin-top: 4px; }
.prompts-panel { margin-top: 20px; }
.prompt-edit {
  display: flex; gap: 10px; align-items: flex-start; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px;
}
.prompt-edit select { margin: 0; flex: 1; }
.prompt-edit input { margin: 0; flex: 2; }
.prompt-edit .del { background: none; border: 0; color: var(--bad); font-size: 1.1rem; cursor: pointer; padding: 8px; }

/* ---------- Просмотр анкеты ---------- */
.user-view { max-width: 640px; margin: 0 auto; }
.user-photo { position: relative; border-radius: 20px; overflow: hidden; max-height: 480px; }
.user-photo img { width: 100%; max-height: 480px; object-fit: cover; }
.user-photo .no-photo {
  height: 300px; display: flex; align-items: center; justify-content: center;
  font-size: 6rem; font-weight: 800; background: linear-gradient(120deg, var(--accent1), var(--accent2));
}
.online-dot {
  position: absolute; top: 14px; right: 14px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 4px rgba(52,211,153,0.25);
}
.verified-badge {
  position: absolute; top: 14px; left: 14px; width: 26px; height: 26px; line-height: 26px;
  border-radius: 50%; background: linear-gradient(120deg, #38bdf8, #6366f1); color: #fff;
  font-size: 0.9rem; text-align: center;
}
.user-info { padding: 18px 4px; }
.user-info h2 { margin: 0 0 4px; }
.user-city { color: var(--muted); margin: 0 0 10px; }
.profile-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.fact {
  background: var(--bg2); border: 1px solid var(--line); color: #dfe3f0;
  font-size: 0.85rem; padding: 6px 12px; border-radius: 20px;
}
.user-bio { line-height: 1.65; color: #dfe3f0; }
.prompts { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.prompt-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px;
}
.prompt-q { color: var(--muted); font-size: 0.82rem; margin-bottom: 4px; }
.prompt-a { font-size: 0.95rem; line-height: 1.5; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.gallery img { border-radius: 12px; aspect-ratio: 1; object-fit: cover; }
.user-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Настройки ---------- */
#blocked-list .like-item { margin-bottom: 8px; }
