/* Ковчег Mini App: монохромная дизайн-система.
   Типографика: Unbounded (заголовки), Manrope (текст), JetBrains Mono (метки, цифры).
   Тема берётся из Telegram (светлая/тёмная), цвета только чёрный, белый и их оттенки. */

:root {
  --bg: #f3f3f0;
  --bg-2: #eaeae6;
  --surface: #ffffff;
  --surface-2: #f7f7f5;
  --ink: #0a0a0a;
  --ink-2: #2b2b29;
  --muted: #7d7d78;
  --faint: #b9b9b3;
  --line: rgba(10, 10, 10, 0.09);
  --line-strong: rgba(10, 10, 10, 0.18);
  --inv-bg: #0a0a0a;
  --inv-ink: #f3f3f0;
  --inv-muted: #8f8f8a;
  --scrim: rgba(10, 10, 10, 0.55);
  --glass: rgba(255, 255, 255, 0.72);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px -12px rgba(0, 0, 0, 0.18);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.35);

  --f-display: "Unbounded", "Manrope", system-ui, sans-serif;
  --f-text: "Manrope", -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-xl: 32px;
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;
  --pad: 16px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --sat: 0px;   /* safe area top (system + Telegram) */
  --sab: 0px;
  --vh: 100vh;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-2: #121212;
  --surface: #151515;
  --surface-2: #1c1c1c;
  --ink: #f2f2ee;
  --ink-2: #d6d6d1;
  --muted: #85857f;
  --faint: #4a4a46;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.18);
  --inv-bg: #f2f2ee;
  --inv-ink: #0a0a0a;
  --inv-muted: #6d6d68;
  --scrim: rgba(0, 0, 0, 0.7);
  --glass: rgba(21, 21, 21, 0.72);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px -12px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 500 15px/1.45 var(--f-text);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  overflow-x: hidden;
}
/* лёгкое зерно, как у печатной бумаги */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.35;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--ink); color: var(--bg); }

/* ---------------------------------------------------------------- каркас */
#app { position: relative; z-index: 1; min-height: var(--vh); }
.screen {
  padding: calc(var(--sat) + 12px) var(--pad) calc(var(--sab) + 120px);
  max-width: 560px; margin: 0 auto;
  animation: screen-in 0.45s var(--ease) both;
}
@keyframes screen-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; min-height: 44px; }
.topbar .right { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: transform 0.2s var(--ease);
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--surface); }
.avatar-btn { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------- типографика */
.kicker { font: 500 11px/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.display { font: 600 clamp(38px, 11vw, 56px)/0.95 var(--f-display); letter-spacing: -0.04em; margin: 6px 0 0; }
.h1 { font: 600 28px/1.05 var(--f-display); letter-spacing: -0.03em; margin: 0; }
.h2 { font: 600 20px/1.1 var(--f-display); letter-spacing: -0.02em; margin: 0; }
.h3 { font: 700 16px/1.25 var(--f-text); margin: 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--f-mono); font-feature-settings: "zero" 1; }
.num { font: 600 40px/1 var(--f-display); letter-spacing: -0.04em; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 2px 12px; }
.section-head .kicker b { color: var(--ink); font-weight: 600; }
.link { font: 600 13px/1 var(--f-text); color: var(--ink); opacity: 0.7; }

/* ---------------------------------------------------------------- кнопки */
.btn {
  height: 52px; padding: 0 22px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 15px/1 var(--f-text); letter-spacing: -0.01em; background: var(--ink); color: var(--bg);
  transition: transform 0.18s var(--ease), opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.35; pointer-events: none; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.btn.soft { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.block { width: 100%; }
.btn.sm { height: 40px; padding: 0 16px; font-size: 14px; }
.btn svg { width: 18px; height: 18px; }
.row-btns { display: flex; gap: 10px; }
.row-btns > * { flex: 1; }

/* ---------------------------------------------------------------- чипы, сегменты */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--pad)); padding: 2px var(--pad); }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.chip {
  flex: none; height: 36px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px;
  font: 600 13px/1 var(--f-text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.chip:active { transform: scale(0.96); }
.chip.on { background: var(--ink); color: var(--bg); box-shadow: none; }
.chip .count { font: 600 11px/1 var(--f-mono); opacity: 0.6; }
.tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font: 600 12px/1 var(--f-text); background: var(--bg-2); color: var(--ink-2); }
.tag.line { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.tag.inv { background: var(--ink); color: var(--bg); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.segment { display: flex; padding: 4px; border-radius: 999px; background: var(--bg-2); gap: 2px; position: relative; }
.segment button { flex: 1; height: 40px; border-radius: 999px; font: 700 13px/1 var(--f-text); color: var(--muted); position: relative; z-index: 1; transition: color 0.25s; }
.segment button.on { color: var(--ink); }
.segment .thumb { position: absolute; top: 4px; bottom: 4px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); transition: left 0.35s var(--ease), width 0.35s var(--ease); }

/* ---------------------------------------------------------------- карточки и списки */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); padding: 18px; }
.card.inv { background: var(--inv-bg); color: var(--inv-ink); box-shadow: none; }
.card.inv .muted, .card.inv .kicker { color: var(--inv-muted); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.list { background: var(--surface); border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 64px; width: 100%; text-align: left; position: relative; }
.item + .item::before { content: ""; position: absolute; top: 0; left: 72px; right: 0; height: 1px; background: var(--line); }
.item.plain + .item.plain::before { left: 16px; }
.item:active { background: var(--surface-2); }
.item .body { flex: 1; min-width: 0; }
.item > svg { width: 22px; height: 22px; flex: none; opacity: 0.85; }
.item > svg.chev { width: 16px; height: 16px; opacity: 0.4; }
.item .title { font: 700 15px/1.25 var(--f-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .sub { font-size: 13px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .end { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 500 12px/1 var(--f-mono); }
.ava { width: 44px; height: 44px; border-radius: 50%; flex: none; background: var(--bg-2); overflow: hidden; display: grid; place-items: center; font: 600 16px/1 var(--f-display); color: var(--muted); }
.ava img { width: 100%; height: 100%; object-fit: cover; }
.ava.sq { border-radius: 14px; }
.badge-n { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--ink); color: var(--bg); font: 600 11px/22px var(--f-mono); text-align: center; }
.chev { width: 16px; height: 16px; opacity: 0.4; }

/* ---------------------------------------------------------------- бенто */
.bento { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile {
  position: relative; border-radius: var(--r-lg); padding: 16px; min-height: 132px; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden; text-align: left; transition: transform 0.25s var(--ease);
}
.tile:active { transform: scale(0.975); }
.tile.wide { grid-column: span 2; }
.tile.tall { grid-row: span 2; min-height: 274px; }
.tile.inv { background: var(--inv-bg); color: var(--inv-ink); box-shadow: none; }
.tile.inv .kicker, .tile.inv .muted { color: var(--inv-muted); }
.tile .big { font: 600 44px/0.9 var(--f-display); letter-spacing: -0.05em; }
.tile .label { font: 700 15px/1.2 var(--f-text); }
.tile .ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line-strong); }
.tile.inv .ico { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); }
:root[data-theme="dark"] .tile.inv .ico { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2); }
.tile .ico svg { width: 18px; height: 18px; }
.tile .photo-bg { position: absolute; inset: 0; object-fit: cover; width: 100%; height: 100%; filter: grayscale(1) contrast(1.05); }
.tile .photo-bg + .shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.75)); }
.tile > * { position: relative; }
.tile .photo-bg { position: absolute; }

/* бегущая строка LIVE */
.ticker { overflow: hidden; border-radius: 999px; background: var(--inv-bg); color: var(--inv-ink); height: 40px; display: flex; align-items: center; margin-bottom: 10px; }
.ticker .track { display: flex; gap: 28px; padding-left: 18px; white-space: nowrap; animation: ticker 30s linear infinite; font: 500 12px/1 var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; }
.ticker .track span::before { content: "●"; margin-right: 10px; font-size: 8px; vertical-align: 2px; animation: blink 1.6s infinite; }
@keyframes ticker { to { transform: translateX(-50%); } }  /* содержимое продублировано: цикл без шва */
@keyframes blink { 50% { opacity: 0.25; } }

/* ---------------------------------------------------------------- анкета (свайп) */
.deck { position: relative; height: calc(var(--vh) - var(--sat) - var(--sab) - 372px); min-height: 340px; max-height: 640px; }
.pcard {
  position: absolute; inset: 0; border-radius: var(--r-xl); overflow: hidden; background: #111; color: #f5f5f2;
  box-shadow: var(--shadow-lg); touch-action: none; user-select: none; will-change: transform;
  transition: transform 0.45s var(--ease), opacity 0.3s;
}
.pcard.behind { transform: scale(0.94) translateY(14px); opacity: 0.7; pointer-events: none; }
.pcard.dragging { transition: none; }
.pcard .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #1a1a1a; }
.pcard .ph.empty { display: grid; place-items: center; font: 600 120px/1 var(--f-display); color: #2a2a2a; }
.pcard .bars { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; gap: 4px; z-index: 2; }
.pcard .bars i { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.3); }
.pcard .bars i.on { background: #fff; }
.pcard .taps { position: absolute; inset: 0 0 45% 0; display: flex; z-index: 1; }
.pcard .taps b { flex: 1; }
.pcard .grad { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, transparent 18%, transparent 45%, rgba(0, 0, 0, 0.88) 100%); pointer-events: none; }
.pcard .info { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 64px 20px 20px; z-index: 2; }
.pcard .name { font: 600 32px/1 var(--f-display); letter-spacing: -0.035em; margin: 0; display: flex; align-items: baseline; gap: 10px; }
.pcard .name small { font: 400 26px/1 var(--f-display); opacity: 0.75; }
.pcard .meta { font: 500 11px/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.7; margin-top: 10px; }
.pcard .bio { margin: 12px 0 0; font-size: 15px; line-height: 1.4; opacity: 0.92; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .why { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pcard .why span { height: 26px; padding: 0 10px; border-radius: 999px; display: inline-flex; align-items: center; font: 600 12px/1 var(--f-text); background: rgba(255, 255, 255, 0.14); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.pcard .premium { position: absolute; top: 26px; right: 14px; z-index: 2; height: 28px; padding: 0 12px; border-radius: 999px; background: #f5f5f2; color: #0a0a0a; display: inline-flex; align-items: center; gap: 6px; font: 600 11px/1 var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; }
.pcard .stamp { position: absolute; top: 60px; z-index: 3; padding: 8px 14px; border: 3px solid #fff; border-radius: 12px; font: 700 26px/1 var(--f-display); letter-spacing: 0.02em; opacity: 0; transition: opacity 0.1s; }
.pcard .stamp.yes { left: 22px; transform: rotate(-12deg); }
.pcard .stamp.no { right: 22px; transform: rotate(12deg); }
.pcard .more { position: absolute; right: 16px; bottom: 20px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: grid; place-items: center; color: #fff; }
.pcard .more svg { width: 18px; height: 18px; }

.actions { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 18px; }
.act { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); transition: transform 0.2s var(--spring); }
.act:active { transform: scale(0.88); }
.act svg { width: 26px; height: 26px; }
.act.main { width: 76px; height: 76px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); }
.act.main svg { width: 30px; height: 30px; }
.act.small { width: 52px; height: 52px; }
.act.small svg { width: 20px; height: 20px; }
.likes-meter { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; font: 500 11px/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.likes-meter .bar { width: 90px; height: 3px; border-radius: 3px; background: var(--line-strong); overflow: hidden; }
.likes-meter .bar i { display: block; height: 100%; background: var(--ink); transition: width 0.4s var(--ease); }

/* мэтч */
.match-overlay { position: fixed; inset: 0; z-index: 60; background: #0a0a0a; color: #f5f5f2; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 32px; text-align: center; animation: fade 0.3s both; }
.match-overlay .word { font: 700 clamp(56px, 18vw, 92px)/0.9 var(--f-display); letter-spacing: -0.06em; animation: pop 0.7s var(--spring) both 0.15s; }
.match-overlay .pair { display: flex; margin: 34px 0 26px; }
.match-overlay .pair .ava { width: 112px; height: 112px; border: 4px solid #0a0a0a; font-size: 40px; }
.match-overlay .pair .ava:first-child { transform: rotate(-8deg) translateX(14px); animation: slide-l 0.6s var(--ease) both 0.25s; }
.match-overlay .pair .ava:last-child { transform: rotate(8deg) translateX(-14px); animation: slide-r 0.6s var(--ease) both 0.25s; }
.match-overlay p { color: #9a9a95; margin: 0 0 30px; max-width: 280px; }
.match-overlay .btn { background: #f5f5f2; color: #0a0a0a; }
.match-overlay .btn.ghost { background: transparent; color: #f5f5f2; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.25); }
@keyframes pop { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
@keyframes slide-l { from { opacity: 0; transform: translateX(-60px) rotate(-20deg); } }
@keyframes slide-r { from { opacity: 0; transform: translateX(60px) rotate(20deg); } }
@keyframes fade { from { opacity: 0; } }

/* ---------------------------------------------------------------- профиль */
.hero { position: relative; border-radius: var(--r-xl); overflow: hidden; aspect-ratio: 4 / 5; background: #111; color: #f5f5f2; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero .grad { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.85)); }
.hero .info { position: absolute; left: 20px; right: 20px; bottom: 20px; }
.hero .bars { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; gap: 4px; z-index: 2; }
.hero .bars i { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.3); }
.hero .bars i.on { background: #fff; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.facts > div { background: var(--surface); padding: 14px 12px; }
.facts .v { font: 600 20px/1.1 var(--f-display); letter-spacing: -0.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facts > div { min-width: 0; }
.facts .k { margin-top: 6px; }
.prose { font-size: 16px; line-height: 1.55; margin: 0; white-space: pre-wrap; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-grid .cell { position: relative; aspect-ratio: 3 / 4; border-radius: var(--r-md); overflow: hidden; background: var(--bg-2); }
.photo-grid .cell img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid .cell .lbl { position: absolute; left: 8px; bottom: 8px; }
.photo-grid .cell.add { display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--line-strong); background: transparent; color: var(--muted); }
.photo-grid .cell.add svg { width: 26px; height: 26px; }

/* ---------------------------------------------------------------- формы */
.field { display: block; margin-bottom: 12px; }
.field .kicker { display: block; margin: 0 4px 8px; }
.input, .textarea, .select {
  width: 100%; border: 0; outline: 0; border-radius: var(--r-md); background: var(--surface); padding: 15px 16px;
  box-shadow: inset 0 0 0 1px var(--line); font: 600 16px/1.3 var(--f-text); transition: box-shadow 0.2s;
}
.input:focus, .textarea:focus { box-shadow: inset 0 0 0 2px var(--ink); }
.textarea { min-height: 120px; resize: vertical; }
.hint { font-size: 12px; color: var(--muted); margin: 6px 4px 0; }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 60px; width: 100%; text-align: left; position: relative; }
.switch-row + .switch-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--line); }
.switch-row .body { flex: 1; }
.switch { width: 50px; height: 30px; border-radius: 999px; background: var(--faint); position: relative; flex: none; transition: background 0.25s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); transition: transform 0.3s var(--spring); }
.switch.on { background: var(--ink); }
.switch.on::after { transform: translateX(20px); }
:root[data-theme="dark"] .switch.on::after { background: #0a0a0a; }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--bg-2); border-radius: 999px; padding: 4px; }
.stepper button { width: 34px; height: 34px; border-radius: 50%; background: var(--surface); font: 700 18px/1 var(--f-text); }
.stepper span { min-width: 34px; text-align: center; font: 600 14px/1 var(--f-mono); }
.range2 { display: flex; gap: 10px; align-items: center; }

/* ---------------------------------------------------------------- пати, сообщества, активности */
.party { padding: 18px; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); display: block; width: 100%; text-align: left; }
.party .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.party .game { font: 600 20px/1.05 var(--f-display); letter-spacing: -0.02em; }
.seats { display: flex; gap: 5px; margin: 16px 0 12px; }
.seats i { flex: 1; height: 8px; border-radius: 8px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); }
.seats i.on { background: var(--ink); box-shadow: none; }
.party .foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.cm { display: flex; gap: 14px; align-items: stretch; padding: 12px; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); width: 100%; text-align: left; }
.cm .cover { width: 84px; height: 84px; border-radius: 18px; flex: none; background: var(--inv-bg); color: var(--inv-ink); display: grid; place-items: center; font: 600 30px/1 var(--f-display); overflow: hidden; }
.cm .cover img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }
.cm .body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.cm .t { font: 700 16px/1.2 var(--f-text); }
.cm .d { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.ev { display: grid; grid-template-columns: 64px 1fr; gap: 14px; padding: 14px; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); width: 100%; text-align: left; align-items: center; }
.ev .date { height: 72px; border-radius: 16px; background: var(--inv-bg); color: var(--inv-ink); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ev .date b { font: 600 26px/1 var(--f-display); letter-spacing: -0.04em; }
.ev .date small { font: 500 10px/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.6; margin-top: 4px; }

.biz { padding: 18px; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.biz .head { display: flex; gap: 12px; align-items: center; }
.biz .pitch { margin: 14px 0; font-size: 15px; line-height: 1.45; }
.biz .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 14px; }
.biz .grid > div { background: var(--surface-2); padding: 10px 12px; }
.biz .grid .v { font-weight: 700; font-size: 14px; margin-top: 4px; }

/* премиум */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.plan { border-radius: var(--r-md); padding: 14px 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); text-align: center; transition: transform 0.2s var(--ease), background 0.2s; }
.plan:active { transform: scale(0.96); }
.plan.on { background: var(--ink); color: var(--bg); box-shadow: none; }
.plan .d { font: 600 22px/1 var(--f-display); letter-spacing: -0.03em; }
.plan .p { font: 500 12px/1 var(--f-mono); margin-top: 8px; opacity: 0.75; }
.perk { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; }
.perk + .perk { border-top: 1px solid rgba(255, 255, 255, 0.1); }
.perk svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }

/* ---------------------------------------------------------------- таббар */
.tabbar {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); bottom: calc(var(--sab) + 14px);
  display: flex; gap: 2px; padding: 6px; border-radius: 999px; background: var(--inv-bg); box-shadow: var(--shadow-lg);
  width: min(calc(100% - 28px), 420px);
}
.tabbar button { flex: 1; height: 52px; border-radius: 999px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--inv-muted); position: relative; transition: color 0.25s, background 0.3s var(--ease); }
.tabbar button svg { width: 22px; height: 22px; }
.tabbar button span { font: 600 9.5px/1 var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; }
.tabbar button.on { color: var(--inv-bg); background: var(--inv-ink); }
.tabbar button .pip { position: absolute; top: 9px; right: calc(50% - 16px); width: 7px; height: 7px; border-radius: 50%; background: var(--inv-ink); }
.tabbar button.on .pip { background: var(--inv-bg); }

/* ---------------------------------------------------------------- шторка, тосты, пустые состояния */
.sheet-scrim { position: fixed; inset: 0; z-index: 70; background: var(--scrim); animation: fade 0.25s both; }
.sheet {
  position: fixed; z-index: 71; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto; background: var(--bg);
  border-radius: 28px 28px 0 0; padding: 10px var(--pad) calc(var(--sab) + 24px); animation: sheet-in 0.42s var(--ease) both;
  max-width: 560px; margin: 0 auto;
}
.sheet .grab { width: 40px; height: 5px; border-radius: 5px; background: var(--line-strong); margin: 0 auto 16px; }
.sheet.out { animation: sheet-out 0.25s var(--ease) both; }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }

.toast { position: fixed; z-index: 90; left: 50%; top: calc(var(--sat) + 12px); transform: translateX(-50%); max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 999px; background: var(--inv-bg); color: var(--inv-ink); font: 600 14px/1.3 var(--f-text); box-shadow: var(--shadow-lg); animation: toast 2.6s var(--ease) both; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -20px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -10px); } }

.empty { text-align: center; padding: 48px 24px; }
.empty .glyph { font: 600 72px/1 var(--f-display); letter-spacing: -0.06em; color: var(--faint); }
.empty .h2 { margin-top: 18px; }
.empty p { color: var(--muted); margin: 10px auto 22px; max-width: 300px; }

.skel { background: linear-gradient(90deg, var(--bg-2) 25%, var(--surface-2) 50%, var(--bg-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--r-lg); }
@keyframes shimmer { to { background-position: -200% 0; } }

.gate { min-height: var(--vh); display: flex; flex-direction: column; justify-content: flex-end; padding: calc(var(--sat) + 24px) 24px calc(var(--sab) + 32px); }
.gate .mark { font: 700 clamp(64px, 22vw, 120px)/0.85 var(--f-display); letter-spacing: -0.07em; margin-bottom: 18px; }

.spacer { height: 12px; }
.center { text-align: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
hr.rule { border: 0; height: 1px; background: var(--line); margin: 20px 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------------------------------------------------------------- достижения */
.medals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 10px; }
.medal { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; min-width: 0; }
.medal .disc {
  width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: var(--inv-bg); color: var(--inv-ink); font: 700 17px/1 var(--f-display); letter-spacing: -0.04em;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4.5px var(--ink);
}
.medal .disc::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; border: 1px dashed rgba(255, 255, 255, 0.28); }
:root[data-theme="dark"] .medal .disc::after { border-color: rgba(0, 0, 0, 0.28); }
.medal.locked .disc { background: conic-gradient(var(--ink) calc(var(--p, 0) * 1%), var(--bg-2) 0); color: var(--muted); box-shadow: none; }
.medal.locked .disc::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--surface); }
.medal.locked .disc span { position: relative; z-index: 1; }
.medal.locked .disc::after { display: none; }
.medal .name { font: 700 12px/1.2 var(--f-text); }
.medal .sub { font: 500 10px/1.2 var(--f-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.medal.sm .disc { width: 44px; height: 44px; font-size: 12px; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--ink); }
.medal.sm .disc::after { inset: 3px; }

.ach-overlay { position: fixed; inset: 0; z-index: 65; background: var(--scrim); display: grid; place-items: center; padding: 24px; animation: fade 0.25s both; }
.ach-overlay .box { width: min(100%, 340px); background: var(--bg); border-radius: 32px; padding: 30px 24px 22px; text-align: center; animation: pop 0.6s var(--spring) both; }
.ach-overlay .medal .disc { width: 112px; height: 112px; font-size: 30px; margin: 10px auto 18px; }

.bond-line { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font: 600 12.5px/1.2 var(--f-text); }
.bond-card { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: var(--r-lg); background: var(--inv-bg); color: var(--inv-ink); }
.bond-card .big { font: 600 30px/1 var(--f-display); letter-spacing: -0.04em; }
.bond-card .muted { color: var(--inv-muted); }

/* ---------------------------------------------------------------- чат */
.chat-screen { padding-bottom: calc(var(--sab) + 96px); }
.chat-head { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: calc(var(--sat) + 10px) var(--pad) 10px; margin: calc(-1 * (var(--sat) + 12px)) calc(-1 * var(--pad)) 6px; background: var(--glass); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border-bottom: 1px solid var(--line); }
.chat-head .t { font: 700 16px/1.2 var(--f-text); }
.chat-head .s { font: 500 11px/1 var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.msgs { display: flex; flex-direction: column; gap: 3px; padding-top: 6px; }
.day { align-self: center; margin: 14px 0 8px; font: 500 10.5px/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.mrow { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; }
.mrow.mine { justify-content: flex-end; }
.mrow .ava { width: 28px; height: 28px; font-size: 11px; }
.mrow .ava.ghost { visibility: hidden; }
.bubble { max-width: min(78%, 420px); padding: 9px 13px 7px; border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font: 500 15px/1.4 var(--f-text); white-space: pre-wrap; overflow-wrap: anywhere; position: relative; animation: bubble-in 0.25s var(--ease) both; }
.mrow.mine .bubble { background: var(--ink); color: var(--bg); box-shadow: none; border-bottom-right-radius: 6px; }
.mrow:not(.mine) .bubble { border-bottom-left-radius: 6px; }
.bubble .who { display: block; font: 700 12px/1.3 var(--f-text); margin-bottom: 2px; }
.bubble .time { float: right; margin: 6px 0 0 10px; font: 500 10px/1 var(--f-mono); opacity: 0.5; }
.bubble .quote { display: block; margin: 2px 0 6px; padding: 4px 0 4px 10px; border-left: 2px solid currentColor; font-size: 13px; opacity: 0.75; max-height: 3.2em; overflow: hidden; }
.bubble .quote b { display: block; font-size: 12px; }
.bubble.media { padding: 4px; }
.bubble.media img, .bubble.media video { border-radius: 16px; max-height: 320px; width: 100%; object-fit: cover; background: var(--bg-2); min-height: 120px; }
.bubble.media.sticker { background: transparent; box-shadow: none; }
.bubble.media.sticker img { width: 140px; min-height: 0; background: transparent; }
.bubble audio { width: 230px; max-width: 100%; height: 40px; }
.bubble .note { font-size: 13px; opacity: 0.7; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(6px) scale(0.98); } }
.composer { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; padding: 8px var(--pad) calc(var(--sab) + 10px); background: var(--glass); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border-top: 1px solid var(--line); }
.composer .inner { max-width: 560px; margin: 0 auto; }
.composer .row { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; border: 0; outline: 0; border-radius: 22px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); padding: 12px 16px; font: 500 16px/1.35 var(--f-text); max-height: 140px; min-height: 46px; }
.composer .send { width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; flex: none; transition: transform 0.2s var(--spring), opacity 0.2s; }
.composer .send:disabled { opacity: 0.3; }
.composer .send:active { transform: scale(0.9); }
.composer .send svg { width: 20px; height: 20px; }
.composer .replybar { display: flex; align-items: center; gap: 10px; padding: 4px 4px 10px; font-size: 13px; }
.composer .replybar .body { flex: 1; min-width: 0; border-left: 2px solid var(--ink); padding-left: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .sub b { color: var(--ink); font-weight: 600; }
.chat-item .end { flex-direction: column; align-items: flex-end; gap: 6px; }

/* ---------------------------------------------------------------- реакции, объявления, графики */
.mcol { display: flex; flex-direction: column; max-width: min(78%, 420px); }
.mrow.mine .mcol { align-items: flex-end; }
.mcol .bubble { max-width: 100%; }
.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.react { height: 26px; padding: 0 8px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.react b { font: 600 11px/1 var(--f-mono); }
.react.mine { box-shadow: inset 0 0 0 1.5px var(--ink); }
.picker { display: flex; justify-content: space-between; gap: 6px; padding: 6px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.picker button { width: 46px; height: 46px; border-radius: 50%; font-size: 24px; transition: transform 0.2s var(--spring); }
.picker button:active { transform: scale(1.25); }
.picker button.on { background: var(--bg-2); }
.bubble.announce { background: var(--inv-bg); color: var(--inv-ink); box-shadow: none; }
.bubble.announce .who { font: 600 10px/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.6; margin-bottom: 6px; }
.chart .bars { display: flex; align-items: flex-end; gap: 3px; }
.chart .bars i { flex: 1; min-width: 2px; border-radius: 3px 3px 1px 1px; background: var(--ink); }
.chart .bars i.zero { background: var(--line-strong); }
.chart .axis { display: flex; gap: 3px; margin-top: 6px; }
.chart .axis span { flex: 1; min-width: 2px; font: 500 9.5px/1 var(--f-mono); color: var(--muted); text-align: center; overflow: visible; white-space: nowrap; }

/* регистрация */
.reg { display: flex; flex-direction: column; min-height: calc(var(--vh) - var(--sat) - 24px); }
.reg-bar { display: flex; gap: 6px; }
.reg-bar i { flex: 1; height: 3px; border-radius: 3px; background: var(--line-strong); transition: background .3s; }
.reg-bar i.on { background: var(--ink); }
.reg-cta { position: sticky; bottom: 0; z-index: 40; margin: auto calc(-1 * var(--pad)) 0; padding: 24px var(--pad) calc(var(--sab) + 14px); background: linear-gradient(to bottom, transparent, var(--bg) 40%); }
