/* Дейтинг-мини-апп — светлый premium editorial: тёплая бумага, чернила, вермильон. */
:root {
  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --ink: #1A1614;
  --muted: #8A8178;
  --border: #EBE4DA;
  --accent: #E4573D;
  --accent-rgb: 228, 87, 61;
  --accent-mid: #F2A48E;
  --accent-soft: #FBE9E4;
  --radius: 20px;
  --shadow: 0 10px 30px rgba(26, 22, 20, .08);
}
/* нетворкинг — тот же светлый premium, но спокойный тил вместо вермильона */
body.kind-networking {
  --accent: #17756A;
  --accent-rgb: 23, 117, 106;
  --accent-mid: #7FB8AE;
  --accent-soft: #E2F1ED;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
/* атрибут hidden должен побеждать любые display-правила (иначе скрытый img выталкивает заглушку из круга) */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  padding-top: env(safe-area-inset-top);
}
#app { max-width: 520px; margin: 0 auto; min-height: 100dvh; }

.screen { display: none; min-height: 100dvh; }
.screen.active { display: block; }

.center-col {
  min-height: 80dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  gap: 14px; padding: 32px 28px;
}
.center-col.slim { min-height: 40dvh; }
.wrap { padding: 28px 22px 40px; }
.pad { padding: 0 22px 14px; }

.display {
  font-family: Unbounded, Inter, sans-serif;
  font-weight: 800; font-size: 44px; line-height: 1.04;
  letter-spacing: -.01em;
}
.display.sm { font-size: 32px; margin-bottom: 22px; }
.eyebrow {
  font-family: Unbounded, sans-serif; font-weight: 400;
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent);
}
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; }
.err { color: #C0392B; font-size: 14px; min-height: 20px; margin-top: 10px; }
.big-emoji { font-size: 44px; }

.pulse-heart { font-size: 56px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1);} 50% { transform: scale(1.18);} }

/* кнопки */
.btn {
  border: 0; cursor: pointer; font: inherit; font-weight: 600;
  border-radius: 999px; padding: 14px 28px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 8px 24px rgba(var(--accent-rgb), .35);
}
.btn-big { width: 100%; padding: 16px; font-size: 17px; margin-top: 10px; }
.chip {
  border: 1.5px solid var(--border); background: var(--surface);
  border-radius: 999px; padding: 10px 16px; font: inherit; font-size: 14px;
  font-weight: 500; cursor: pointer; color: var(--ink);
}
.chip:active { background: var(--accent-soft); }

/* код комнаты */
.code-form { display: flex; gap: 10px; margin-top: 8px; }
#code-input {
  width: 150px; text-align: center; font-family: Unbounded, monospace;
  font-size: 24px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  border: 2px solid var(--border); border-radius: var(--radius);
  padding: 12px 10px; background: var(--surface); color: var(--ink); outline: none;
}
#code-input:focus { border-color: var(--accent); }

/* онбординг */
.avatar-block { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 26px; }
.avatar-ring {
  width: 132px; height: 132px; border-radius: 50%; position: relative;
  background: conic-gradient(from 20deg, var(--accent), var(--accent-mid), var(--accent));
  padding: 4px;
}
.avatar-ring img, .avatar-ph {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  background: var(--surface); display: flex; align-items: center; justify-content: center;
  font-size: 52px; border: 3px solid var(--bg);
}
.avatar-btns { display: flex; gap: 10px; }

.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; font: inherit; font-size: 17px;
  border: 2px solid var(--border); border-radius: 16px;
  padding: 13px 16px; background: var(--surface); color: var(--ink); outline: none;
}
.field input:focus { border-color: var(--accent); }
.field textarea {
  width: 100%; resize: vertical; min-height: 84px; font: inherit; font-size: 16px;
  border: 2px solid var(--border); border-radius: 16px; padding: 13px 16px;
  background: var(--surface); color: var(--ink); outline: none;
}
.field textarea:focus { border-color: var(--accent); }
.field em { font-style: normal; font-weight: 400; color: var(--muted); }
#ob-number { text-align: center; font-size: 28px !important; font-weight: 800; letter-spacing: .08em; }
.seg { display: flex; gap: 10px; }
.seg-btn {
  flex: 1; border: 2px solid var(--border); background: var(--surface);
  border-radius: 16px; padding: 13px; font: inherit; font-size: 15px; font-weight: 600;
  color: var(--muted); cursor: pointer; transition: border-color .12s, background .12s, color .12s;
}
.seg-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* поиск по участникам */
.search-wrap { padding: 0 22px 12px; }
#search {
  width: 100%; font: inherit; font-size: 15px;
  border: 2px solid var(--border); border-radius: 999px;
  padding: 11px 18px; background: var(--surface); color: var(--ink); outline: none;
}
#search:focus { border-color: var(--accent); }

/* пошаговая анкета */
.ob-progress {
  display: flex; align-items: center; gap: 12px; margin-bottom: 30px;
  color: var(--muted); font-size: 12px; font-weight: 600;
}
.ob-progress i { height: 4px; flex: 1; border-radius: 999px; background: var(--border); }
.ob-step { min-height: 66dvh; display: flex; flex-direction: column; }
.ob-step[hidden] { display: none; }
.ob-welcome-copy { color: var(--muted); margin-top: -8px; }
.ob-event-card {
  display: flex; flex-direction: column; gap: 5px; margin: 16px 0 auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.ob-event-card strong { font-size: 20px; line-height: 1.25; }
.ob-event-card span { color: var(--accent); font-size: 14px; font-weight: 600; }
.ob-number-copy { color: var(--muted); margin: -8px 0 22px; }
.ob-step .btn-big { margin-top: auto; }
.ob-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.ob-back {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font: inherit; padding: 12px 0; margin-top: 8px; text-align: left;
}
.ob-refresh { margin-top: 8px; white-space: nowrap; }
.ob-refresh:disabled { opacity: .55; cursor: default; }

/* камера для кнопки «Сделать фото» */
.camera-overlay {
  position: fixed; inset: 0; z-index: 50; background: var(--bg);
  overflow-y: auto;
  padding: max(env(safe-area-inset-top), var(--tg-content-safe-area-inset-top, 0px))
    max(env(safe-area-inset-right), var(--tg-content-safe-area-inset-right, 0px))
    max(env(safe-area-inset-bottom), var(--tg-content-safe-area-inset-bottom, 0px))
    max(env(safe-area-inset-left), var(--tg-content-safe-area-inset-left, 0px));
}
.camera-overlay[hidden] { display: none; }
.camera-inner { max-width: 520px; margin: 0 auto; padding: 28px 22px; }
.camera-frame {
  width: min(420px, 100%); aspect-ratio: 3 / 4; margin: 18px auto 0;
  overflow: hidden; position: relative; border-radius: var(--radius);
  background: #111; box-shadow: var(--shadow), 0 0 0 2px var(--accent);
}
.camera-frame video {
  width: 100%; height: 100%; display: block; object-fit: cover;
  transform: scaleX(-1); background: #111;
}
#camera-error { min-height: 24px; text-align: center; margin: 12px 0 0; }
.camera-btns {
  display: flex; gap: 12px; justify-content: center; align-items: center; margin-top: 18px;
}
.camera-btns .btn { padding: 13px 24px; }

/* свайп-лента: одна анкета за раз */
.swipe-stage { padding: 0 22px; min-height: 360px; }
.swipe-feed {
  position: relative; width: 100%;
  /* Fallback для старых Telegram/WebView без поддержки dvh/min(). */
  height: 50vh; max-height: 480px;
  height: min(50dvh, 480px);
}
.swipe-stage.is-finished { min-height: 0; }
.swipe-stage.is-finished .swipe-feed { display: none; }
.swipe-stage.is-finished .feed-empty {
  min-height: min(42dvh, 390px); height: auto; justify-content: center; padding: 18px 20px 22px;
}
.swipe-stage.is-empty { min-height: 0; }
.swipe-stage.is-empty .swipe-feed { display: none; }
.swipe-stage.is-empty .feed-empty {
  min-height: 0; height: auto; justify-content: center; padding: 18px 20px 22px;
}
.swipe-card {
  position: absolute; inset: 0; overflow: hidden; border-radius: 24px; background: var(--surface);
  box-shadow: 0 14px 34px rgba(26, 22, 20, .15); touch-action: pan-y; user-select: none;
  cursor: grab; transition: transform .18s ease, opacity .18s ease;
}
.swipe-card.dragging { cursor: grabbing; transition: none; }
.swipe-photo { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--accent-soft); }
.swipe-card .ph-empty { width: 100%; height: 100%; }
.swipe-card-gradient { position: absolute; inset: 35% 0 0; background: linear-gradient(transparent, rgba(0,0,0,.78)); pointer-events: none; }
.swipe-card-meta { position: absolute; left: 20px; right: 20px; bottom: 18px; color: #fff; pointer-events: none; }
.swipe-card-name { font-size: 28px; font-weight: 700; line-height: 1.12; }
.swipe-card-number {
  position: absolute; top: 18px; right: 18px; z-index: 2;
  display: inline-flex; align-items: center; min-height: 46px;
  padding: 7px 14px; border-radius: 999px; background: #fff; color: var(--ink);
  font-family: Unbounded, Inter, sans-serif; font-size: 20px; font-weight: 800;
  letter-spacing: .02em; box-shadow: 0 6px 16px rgba(0,0,0,.22);
}
.swipe-card-description {
  margin-top: 8px; max-width: 92%; font-size: 15px; line-height: 1.3;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.swipe-nope, .swipe-like {
  position: absolute; top: 22px; z-index: 1; padding: 7px 11px; border: 2px solid currentColor;
  border-radius: 10px; font-size: 13px; font-weight: 800; letter-spacing: .05em; opacity: 0;
  transform: rotate(-12deg); transition: opacity .1s ease;
}
.swipe-nope { left: 18px; color: #fff; background: rgba(192,57,43,.75); }
.swipe-like { right: 18px; color: #fff; background: rgba(var(--accent-rgb), .8); transform: rotate(12deg); }
.swipe-card.drag-left .swipe-nope, .swipe-card.drag-right .swipe-like { opacity: 1; }
.feed-empty {
  height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 30px; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow);
}
.feed-empty.is-finished { padding: 26px 22px 30px; }
.feed-empty h3 { margin: 2px 0 8px; font-family: Unbounded, sans-serif; font-size: 20px; }
.finished-art { display: block; width: min(210px, 100%); aspect-ratio: 4 / 3; object-fit: cover; border-radius: 20px; margin: 0 auto 10px; }
.finished-art[hidden] { display: none; }
.swipe-actions { display: flex; align-items: center; justify-content: center; gap: 34px; padding: 18px 22px 12px; }
.tab-pane.is-finished .swipe-actions,
.tab-pane.is-empty .swipe-actions,
.tab-pane.is-searching .swipe-actions { display: none !important; }
.tab-pane.is-empty #people-hint { display: none; }
.swipe-action {
  width: 62px; height: 62px; border-radius: 50%; background: var(--surface); cursor: pointer;
  font: inherit; font-size: 34px; line-height: 1; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); transition: transform .12s ease, opacity .12s ease;
}
.swipe-action:active { transform: scale(.92); }
.swipe-action:disabled { opacity: .35; cursor: default; }
.swipe-no { border: 2px solid #C0392B; color: #C0392B; }
.swipe-yes { border: 2px solid var(--accent); color: var(--accent); }
.feed-progress { min-width: 92px; text-align: center; color: var(--muted); font-size: 13px; }

/* поиск остаётся отдельным режимом и видит уже просмотренные карточки */
.search-results { padding: 0 22px; display: flex; flex-direction: column; gap: 10px; }
.search-result {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; background: var(--surface);
  border-radius: 16px; box-shadow: var(--shadow);
}
.profile-photo-button {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer;
}
.profile-photo-button:focus-visible { outline: 3px solid var(--accent-mid); outline-offset: 3px; }
.search-photo { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 50%; object-fit: cover; background: var(--accent-soft); }
.search-result .ph-empty { background-color: #D8D3CB; }
.search-result-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.search-result-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-info span { color: var(--accent); font-size: 16px; font-weight: 800; }
.search-description, .match-description {
  color: var(--muted); font-size: 13px; line-height: 1.35; margin-top: 3px;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.search-status { margin-top: 6px; font-size: 12px !important; font-weight: 700 !important; }
.search-status.like { color: var(--accent) !important; }
.search-status.dislike { color: #B26B62 !important; }
.search-status.pending { color: var(--muted) !important; font-weight: 500 !important; }

/* комната */
.room-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 22px 12px;
}
.room-head-actions { display: flex; align-items: center; gap: 10px; }
.room-switch {
  border: 1.5px solid var(--border); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 10px 13px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.room-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.me-avatar {
  width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--accent);
  overflow: hidden; background: var(--surface); cursor: pointer; font-size: 22px;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.me-avatar img { width: 100%; height: 100%; object-fit: cover; }

.tabs { display: flex; gap: 8px; padding: 8px 22px 14px; }
.tab {
  flex: 1; border: 1.5px solid var(--border); background: var(--surface);
  border-radius: 999px; padding: 10px; font: inherit; font-weight: 600; font-size: 14px;
  color: var(--muted); cursor: pointer;
}
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.badge {
  background: var(--accent); color: #fff; border-radius: 999px;
  font-size: 11px; padding: 1px 7px; margin-left: 4px;
}
.tab-pane { display: none; padding-bottom: 40px; }
.tab-pane.active { display: block; }

.grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 22px;
}
.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; position: relative;
  animation: rise .35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px);} to { opacity: 1; transform: none;} }
.card .ph {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block;
  background: var(--accent-soft);
}
.card .ph-empty {
  width: 100%; aspect-ratio: 1; display: flex; align-items: center;
  justify-content: center; font-size: 44px; background: var(--accent-soft);
}
.card .num {
  position: absolute; top: 10px; left: 10px;
  font-family: Unbounded, sans-serif; font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,.92); border-radius: 999px; padding: 4px 10px;
}
.card .meta { padding: 10px 12px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card .name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.like-btn {
  border: 2px solid var(--accent); background: var(--surface); color: var(--accent);
  border-radius: 50%; width: 44px; height: 44px; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), .20);
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.like-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.like-btn.liked {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 4px 14px rgba(var(--accent-rgb), .45);
  animation: pop .3s ease;
}
.like-btn.liked svg { fill: currentColor; }
@keyframes pop { 50% { transform: scale(1.35);} }
.card.is-me { outline: 2px solid var(--accent); outline-offset: -2px; }
.card .you-tag { font-size: 12px; color: var(--accent); font-weight: 600; }

.match-list { padding: 0 22px; display: flex; flex-direction: column; gap: 12px; }
.match-row {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 14px;
}
.match-row img, .match-row .ph-empty {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
  background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 26px;
  flex-shrink: 0;
}
.match-row .profile-photo-button { width: 56px; height: 56px; }
.match-row .info { flex: 1; min-width: 0; }
.match-row .name { font-weight: 600; }
.match-row .match-description { margin-top: 5px; }
.muted-line { color: var(--muted); }
.match-row .uname { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.match-row a.btn { padding: 10px 16px; font-size: 14px; text-decoration: none; display: inline-block; }

/* полноэкранное подтверждение взаимной симпатии */
.match-modal {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 22px; background: rgba(26, 22, 20, .72); backdrop-filter: blur(8px);
  overflow: hidden;
}
.match-sheet {
  width: min(420px, 100%); position: relative; overflow: hidden; text-align: center;
  padding: 30px 24px 24px; border-radius: 28px; color: var(--ink); background: var(--surface);
  box-shadow: 0 24px 70px rgba(0,0,0,.28); animation: match-in .48s cubic-bezier(.2,.85,.25,1.15) both;
}
@keyframes match-in { from { opacity: 0; transform: translateY(26px) scale(.86); } to { opacity: 1; transform: none; } }
.match-close {
  position: absolute; top: 10px; right: 14px; border: 0; background: transparent; color: var(--muted);
  cursor: pointer; font: inherit; font-size: 30px; line-height: 1; z-index: 2;
}
.match-kicker { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.match-burst { margin: 8px auto 0; font-size: 66px; line-height: 1; animation: match-heart 1.1s ease-in-out infinite; }
@keyframes match-heart { 0%,100% { transform: scale(1) rotate(-4deg); } 50% { transform: scale(1.12) rotate(4deg); } }
.match-sheet .display.sm { margin: 4px 0 4px; font-size: 30px; }
.match-copy { color: var(--muted); }
.match-person { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 20px auto 22px; text-align: left; }
.match-person-photo { width: 68px; height: 68px; flex: 0 0 68px; border-radius: 50%; object-fit: cover; background: var(--accent-soft); }
.match-person-photo.ph-empty { display: flex; }
.match-person strong, .match-person span { display: block; }
.match-person strong { font-size: 20px; }
.match-person span { color: var(--accent); font-weight: 700; font-size: 15px; margin-top: 2px; }
.match-person small { display: block; max-width: 240px; color: var(--muted); font-size: 13px; line-height: 1.35; margin-top: 5px; }
.match-actions { display: flex; gap: 10px; }
.match-actions .btn { flex: 1; padding: 14px 12px; text-decoration: none; }
.match-confetti { position: absolute; inset: 0; pointer-events: none; }
.match-confetti i { position: absolute; color: var(--accent-mid); font-size: 26px; font-style: normal; animation: confetti-float 2.7s ease-in-out infinite; }
.match-confetti i:nth-child(1) { top: 16%; left: 12%; animation-delay: -.3s; }
.match-confetti i:nth-child(2) { top: 30%; right: 12%; animation-delay: -.9s; }
.match-confetti i:nth-child(3) { top: 68%; left: 8%; animation-delay: -1.5s; color: var(--accent); }
.match-confetti i:nth-child(4) { top: 76%; right: 10%; animation-delay: -.6s; }
.match-confetti i:nth-child(5) { top: 10%; right: 28%; animation-delay: -1.8s; color: var(--accent); }
.match-confetti i:nth-child(6) { top: 54%; left: 18%; animation-delay: -2.1s; }
@keyframes confetti-float { 0%,100% { opacity: .2; transform: translateY(8px) rotate(0); } 50% { opacity: 1; transform: translateY(-10px) rotate(25deg); } }

/* просмотр анкеты из поиска и списка мэтчей */
.profile-modal {
  position: fixed; inset: 0; z-index: 105; display: flex; align-items: center; justify-content: center;
  padding: 22px; background: rgba(26, 22, 20, .72); backdrop-filter: blur(8px); overflow: hidden;
}
.profile-sheet {
  width: min(420px, 100%); position: relative; overflow: hidden; text-align: center;
  padding: 28px 24px 26px; border-radius: 28px; color: var(--ink); background: var(--surface);
  box-shadow: 0 24px 70px rgba(0,0,0,.28); animation: match-in .35s cubic-bezier(.2,.85,.25,1.15) both;
}
.profile-modal-photo { width: 150px; height: 150px; margin: 18px auto 16px; }
.profile-modal-image { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--accent-soft); }
.profile-modal-photo .ph-empty { width: 100%; height: 100%; border-radius: 50%; }
.profile-sheet .display.sm { margin: 0 0 4px; font-size: 27px; }
.profile-number { color: var(--accent); font-size: 17px; font-weight: 800; }
.profile-description { margin-top: 14px; color: var(--ink); font-size: 16px; line-height: 1.45; }
.profile-status { margin-top: 18px; padding: 10px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.profile-status.dislike { color: #B26B62; background: #F7E8E5; }
.profile-status.pending { color: var(--muted); background: #F1EEE9; }

/* список ивентов */
.room-picker {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center;
  padding: 22px; background: rgba(26, 22, 20, .62); backdrop-filter: blur(7px);
}
.room-picker-sheet {
  width: min(440px, 100%); max-height: min(720px, 90vh); overflow-y: auto;
  position: relative; padding: 30px 22px 22px; border-radius: 28px; background: var(--surface);
  box-shadow: 0 24px 70px rgba(0,0,0,.28); animation: match-in .35s ease both;
}
.room-picker-sheet .display.sm { margin: 5px 0 18px; font-size: 27px; }
.room-picker-list { display: flex; flex-direction: column; gap: 9px; }
.room-option {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1.5px solid var(--border); border-radius: 16px; background: var(--bg); color: var(--ink);
  padding: 14px; text-align: left; cursor: pointer; font: inherit;
}
.room-option.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .12); }
.room-option-main { display: flex; flex-direction: column; min-width: 0; gap: 5px; }
.room-option-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-option-main small, .room-option-status { color: var(--muted); font-size: 12px; }
.room-option-status { flex-shrink: 0; }
.room-picker-code { display: flex; gap: 8px; margin-top: 18px; }
.room-picker-code input { min-width: 0; flex: 1; }

/* пустая аватарка — классический серый силуэт (тёплый тон под палитру) */
.avatar-ph, .card .ph-empty, .match-row .ph-empty, #me-avatar-ph {
  background-color: #D8D3CB;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='37' r='16' fill='%23FFFFFF'/%3E%3Cpath d='M50 59c-19 0-31 12-33 26l-1 15h68l-1-15C81 71 69 59 50 59z' fill='%23FFFFFF'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}
#me-avatar-ph { display: block; width: 100%; height: 100%; border-radius: 50%; }

/* кроп фото */
.crop-overlay {
  position: fixed; inset: 0; z-index: 50; background: var(--bg);
  overflow-y: auto; padding: env(safe-area-inset-top) 0 24px;
}
.crop-overlay[hidden] { display: none; }
.crop-inner { max-width: 520px; margin: 0 auto; padding: 28px 22px; }
.crop-frame {
  width: min(340px, 100%); aspect-ratio: 1; margin: 18px auto 0;
  border-radius: var(--radius); overflow: hidden; position: relative;
  background: #EDE8E0; box-shadow: var(--shadow), 0 0 0 2px var(--accent);
  touch-action: none; cursor: grab;
}
.crop-frame:active { cursor: grabbing; }
.crop-frame img {
  position: absolute; left: 0; top: 0; max-width: none; max-height: none;
  user-select: none; -webkit-user-select: none; pointer-events: none;
}
.crop-hint { text-align: center; margin-top: 12px; }
#crop-zoom {
  display: block; width: min(340px, 100%); margin: 14px auto 0;
  accent-color: var(--accent);
}
.crop-btns {
  display: flex; gap: 12px; justify-content: center; align-items: center; margin-top: 18px;
}
.crop-btns .btn { padding: 13px 34px; }
