/* Lumira 18+ — Mini App. Тёмная витрина: плотный шрифт, крупные карточки,
   акцент — фиолетово-розовый. Никаких тонких курсивов. */

:root {
  --bg:        #07050d;
  --bg-2:      #0d0916;
  --surface:   #120e1c60;
  --card:      #15111f;
  --card-2:    #1b1629;
  --line:      #ffffff12;
  --text:      #f4f1fa;
  --text-2:    #a99fc0;
  --accent:    #7a4fd6;
  --accent-2:  #b93ecb;
  --hot:       #ff3d71;
  /* золото осталось только как знак Premium — приглушённое, без оранжевого */
  --gold:      #c9a45c;
  --ok:        #35d07f;
  --radius:    22px;
  --tabbar-h:  84px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* Тач-нюансы, из-за которых приложение ощущается «не родным»:
   touch-action убирает задержку 300 мс и двойной тап-зум, text-size-adjust —
   самовольное увеличение шрифта Safari при повороте экрана, touch-callout —
   меню «сохранить картинку» по долгому нажатию на карточку. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Выделять текст в приложении нельзя: длинное нажатие на карточке выдавало
   системное меню «копировать/поделиться» и синюю подсветку поверх витрины —
   для приложения это выглядит как поломка вёрстки. Исключения ниже: живая
   переписка (её копируют) и поля ввода. */
body {
  touch-action: manipulation; -webkit-touch-callout: none;
  -webkit-user-select: none; user-select: none;
}
.msg, .chat-scroll, .input, textarea, input {
  -webkit-user-select: text; user-select: text; -webkit-touch-callout: default;
}
/* системный цвет текста у <button> — чёрный: гасим один раз для всех кнопок */
button { color: inherit; font-family: inherit; }

html, body {
  margin: 0; padding: 0; height: 100%; min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body { overflow-x: hidden; }

/* Фон ровный и одноцветный по всему приложению: подсветка сверху и
   осветлённая полоса делали верх страницы светлее, чем непрозрачные шапки,
   и на стыке всегда была видна ступенька. Один цвет — швов нет. */
#bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--bg);
}

h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
p { margin: 0 0 10px; }
b, strong { font-weight: 700; }
.muted { color: var(--text-2); font-weight: 500; }
.hidden { display: none !important; }
.note { font-size: 14px; text-align: center; padding: 14px 6px 0; }

/* ---------------- кнопки ---------------- */
.btn {
  border: 0; cursor: pointer; border-radius: 16px;
  padding: 15px 22px;
  font-family: inherit; font-size: 17px; font-weight: 700; letter-spacing: -0.01em;
  color: #fff; background: #ffffff14;
  transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 30px -12px var(--accent-2); }
.btn-gold { background: var(--gold); color: #16110a; }
.btn-ghost { background: #ffffff10; color: var(--text); }
.btn-wide { width: 100%; display: block; margin-top: 10px; }
.grow { flex: 1; }

.btn-icon {
  width: 44px; height: 44px; flex: none;
  border: 0; border-radius: 15px; background: #ffffff10; color: var(--text);
  font-size: 28px; font-weight: 600; line-height: 1; cursor: pointer;
}

.input, .search {
  width: 100%; border: 1px solid var(--line); border-radius: 16px;
  background: #ffffff0d; color: var(--text);
  font-family: inherit; font-size: 17px; font-weight: 500;
  padding: 15px 17px; outline: none;
}
.input::placeholder, .search::placeholder { color: #7e739a; font-weight: 500; }
.input:focus, .search:focus { border-color: #ffffff2e; background: #ffffff14; }

/* ---------------- полноэкранные состояния ---------------- */
.fullscreen {
  display: none; position: fixed; inset: 0; z-index: 50;
  flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 32px 24px; background: var(--bg);
}
.fullscreen.active { display: flex; }
.big-emoji { font-size: 65px; margin-bottom: 10px; }
/* Экран 18+ и витрина магазина: под текстом лежит сгенерированный фон
   (`tools/genart.py --what ui`). Файла нет — CSS просто не покажет картинку,
   останется прежний тёмный фон. */
#screen-age {
  background:
    linear-gradient(180deg, #0b0712d9 0%, #0b0712b8 45%, #0b0712 100%),
    url('/static/ui/hero-age.webp') center / cover no-repeat;
}
.age-card {
  max-width: 380px; background: #150e22d9; border: 1px solid var(--line);
  border-radius: 26px; padding: 28px 22px; backdrop-filter: blur(14px);
}
.age-card h2 { font-size: 28px; margin-bottom: 10px; }

.loader { display: flex; gap: 8px; margin-bottom: 18px; }
.loader i {
  width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  animation: bounce 1s infinite ease-in-out;
}
.loader i:nth-child(2) { animation-delay: .15s; }
.loader i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,80%,100% { transform: translateY(0); opacity:.5 } 40% { transform: translateY(-10px); opacity:1 } }

/* ---------------- шапка ---------------- */
/* Шапка непрозрачная и ровно цвета фона (--bg, он же цвет нативной шапки
   Telegram): любой свой оттенок или растушёвка тут же читались как полоса
   потемнения над карточками. */
.appbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 14px) 16px 12px;
  background: var(--bg);
}

.appbar-title { font-size: 32px; font-weight: 900; flex: 1; }
.wallet {
  display: flex; align-items: center; gap: 2px;
  background: #ffffff12; border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 4px 4px 6px;
}
.wallet-part {
  display: flex; align-items: center; gap: 5px;
  border: 0; background: none; color: var(--text); cursor: pointer;
  font-family: inherit; font-size: 16px; font-weight: 800; padding: 4px 6px;
}
.wallet-part .ic { font-size: 15px; }
.wallet-plus {
  width: 34px; height: 34px; border: 0; border-radius: 50%; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 24px; font-weight: 600; line-height: 1;
}

/* поля контента совпадают с полями аппбара и панели вкладок — 16px */
#views { padding: 0 16px calc(var(--tabbar-h) + 46px); }
.view { display: none; animation: fade .22s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }

/* ---------------- поиск и категории ---------------- */
/* Шапка каталога липнет под аппбаром и никуда не уезжает: пряталась при
   листании — и на полпути анимации сквозь неё просвечивали карточки.
   Фон — тот же var(--bg), что у аппбара и страницы: полупрозрачный размывал
   карточки под собой в грязное пятно, а свой оттенок давал видимую границу. */
.girls-head {
  position: sticky; top: var(--appbar-h, 70px); z-index: 15;
  margin: 0 -16px; padding: 0 16px 12px;
  background: var(--bg);
}

.search-wrap { position: relative; margin-bottom: 10px; }
.search-ic {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  width: 19px; height: 19px; color: #7e739a; pointer-events: none;
}
.search-ic svg { width: 100%; height: 100%; display: block; fill: none;
  stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.search {
  padding: 13px 16px 13px 44px; font-size: 16px;
  border-radius: 15px; background: #ffffff0a; border-color: #ffffff12;
}

/* Категорий всего две — компактные пилюли слева, без тяжёлого сегмента */
.cats { display: flex; gap: 8px; margin: 0; }
.cat {
  flex: none; border: 1px solid #ffffff12; border-radius: 999px;
  background: #ffffff0a; color: var(--text-2);
  font-family: inherit; font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em;
  padding: 9px 18px; cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.cat.active {
  color: #fff; font-weight: 800; border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px -12px var(--accent-2);
}

/* ---------------- карточки девушек ---------------- */
.girls-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; padding-top: 13px; }
.girl-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 3 / 4.3; cursor: pointer; border: 1px solid var(--line);
  background-size: cover; background-position: center top;
  transition: transform .14s ease;
}
.girl-card:active { transform: scale(.975); }
/* Карточки ниже экрана браузер не раскладывает и не декодирует, пока до них
   не долистали. Размер известен заранее из aspect-ratio, поэтому прокрутка
   не прыгает. */
.girl-card { content-visibility: auto; contain-intrinsic-size: auto 240px; }
/* заглушка вместо фото: градиент + силуэт + эмодзи */
.gc-art { position: absolute; inset: 0; }
/* Обложка — <img> (ленивая загрузка, см. coverImg в app.js), а не фон.
   Затемнение .gc-art::after рисуется поверх: оно идёт после в порядке вывода. */
.gc-img {
  position: absolute; inset: 0; display: block;
  width: 100%; height: 100%; object-fit: cover; object-position: center top;
  transition: transform .3s ease;
}
.gc-art::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(58% 42% at 50% 26%, #ffffff2e 0%, transparent 62%),
    radial-gradient(90% 60% at 50% 105%, #00000090 0%, transparent 70%);
}
.gc-emoji {
  position: absolute; left: 0; right: 0; top: 20%;
  text-align: center; font-size: 63px; filter: drop-shadow(0 8px 22px #0009);
}
.gc-stub {
  position: absolute; left: 50%; top: 24%; transform: translateX(-50%);
  width: 62%; opacity: .22; color: #fff;
}
.gc-body {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 13px 13px 14px;
  background: linear-gradient(180deg, #0b071200 0%, #0b0712e6 46%, #0b0712 100%);
}
.gc-name {
  font-size: 18px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.15;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.gc-tag {
  margin-top: 4px; font-size: 14px; font-weight: 600; color: #cec3e2;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.gc-top {
  position: absolute; top: 10px; left: 10px; right: 10px; z-index: 2;
  display: flex; align-items: center; gap: 8px;
}
.gc-online { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.dot-online, .gc-online i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 8px var(--ok); display: inline-block;
}
.gc-int {
  margin-top: 7px; display: inline-block; font-size: 12px; font-weight: 800;
  padding: 4px 9px; border-radius: 999px; background: #ffffff1a;
}
/* Закрытая девушка. Само превью уже размыто на сервере (`covers/blur/`),
   поэтому фильтром только сглаживаем артефакты сжатия. Класс raw остаётся
   для старой статики без blur-файлов: там размывать приходится тут.
   Главное — не мазать блюром весь блок: раньше он захватывал и подпись,
   и та расплывалась вместе с картинкой. */
.girl-card.locked .gc-img { filter: blur(3px) saturate(.85) brightness(.82); transform: scale(1.06); }
.girl-card.locked.raw .gc-img { filter: blur(14px) saturate(.7) brightness(.75); transform: scale(1.15); }
.girl-card.locked .gc-emoji { filter: blur(6px); }
/* Под текстом — плотная подложка, а не мягкий градиент по размытому фону:
   на блюре светлые пятна пролезали сквозь и съедали имя. */
.girl-card.locked .gc-body {
  background: linear-gradient(180deg, #0b071200 0%, #0b0712f2 42%, #0b0712 100%);
}
.lock-ic {
  width: 13px; height: 13px; flex: none; vertical-align: -1px;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
.gs-go .lock-ic { width: 17px; height: 17px; margin-right: 8px; stroke-width: 2.1; }
/* Ценник — в верхнем ряду карточки, рядом с точкой «онлайн»: по центру он
   ложился ровно на имя и подпись и перекрывал их. */
.gc-price {
  display: flex; align-items: center; gap: 5px;
  font-size: 15px; font-weight: 900; color: #fff;
  padding: 5px 11px; border-radius: 999px;
  background: #0b0712c4; border: 1px solid #ffffff2e; backdrop-filter: blur(8px);
}

/* «Ваш персонаж» — первая карточка каталога */
.girl-card.custom {
  border-color: #c4b5fd47;
  box-shadow: 0 0 0 1px #a855f71f, 0 16px 40px -22px var(--accent-2);
}
.girl-card.custom .gc-art::after {
  background:
    radial-gradient(58% 40% at 50% 42%, #ffffff26 0%, transparent 66%),
    radial-gradient(90% 60% at 50% 106%, #0b0712d9 0%, transparent 72%);
}
.gc-portal {
  position: absolute; left: 50%; top: 6%; transform: translateX(-50%);
  width: 92%; height: 74%; animation: portal 4.5s ease-in-out infinite;
}
@keyframes portal {
  0%, 100% { opacity: .85; transform: translateX(-50%) scale(1); }
  50%      { opacity: 1;   transform: translateX(-50%) scale(1.045); }
}
.girl-card.custom .gc-price {
  background: linear-gradient(135deg, #7c3aedd9, #d946efd9);
  border-color: #ffffff40;
}
.girl-card.custom .gc-tag b { font-weight: 900; color: #fff; }

/* конструктор своего персонажа */
.cc-row { display: flex; gap: 10px; }
.cc-row .input { flex: 1; }
.cc-age { width: 88px; flex: none !important; text-align: center; }
.cc-wish { margin-top: 10px; resize: none; line-height: 1.4; }

/* ---------------- предметы ---------------- */
/* Шапка вкладки: арсенал с прогрессом. Раньше вкладка начиналась сразу с
   сетки и читалась как склад — непонятно, сколько всего и зачем собирать. */
.items-head {
  margin: 2px 0 14px; padding: 14px 16px 15px;
  border-radius: 20px; border: 1px solid var(--line);
  background: linear-gradient(150deg, #1b1430, var(--card) 62%);
}
.ih-row { display: flex; align-items: center; gap: 12px; }
.ih-txt { flex: 1; min-width: 0; }
.ih-title { font-size: 19px; font-weight: 900; letter-spacing: -0.02em; }
.ih-sub { font-size: 13.5px; margin-top: 2px; }
.ih-count { font-size: 23px; font-weight: 900; letter-spacing: -0.02em; }
.ih-count small { font-size: 14px; font-weight: 800; color: var(--text-2); }
.ih-bar { margin-top: 12px; height: 6px; border-radius: 999px; background: #ffffff12; overflow: hidden; }
.ih-bar i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .45s ease;
}

.items-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
/* Карточка предмета — товар, а не строка списка: сверху крупный арт во всю
   ширину с ценником поверх, ниже название с описанием и кнопка. Прежний
   вариант (имя сверху, кружок арта посередине) давал три разных выравнивания
   в одной карточке и выглядел рыхло. */
.item-card {
  position: relative; display: flex; flex-direction: column;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--card); overflow: hidden; padding-bottom: 12px;
}
.item-art {
  position: relative; aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(72% 58% at 50% 44%, var(--g2) 0%, transparent 72%),
    linear-gradient(160deg, var(--g1), #0b0712);
}
.item-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Низ кадра растворяется в подложке карточки: иначе фотография обрывается
   ровной линией прямо над названием и выглядит вклеенной. */
.item-art::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, transparent 55%, #15111f 100%),
    radial-gradient(120% 80% at 50% 30%, transparent 55%, #15111f66 100%);
}
.item-emoji { font-size: 62px; filter: drop-shadow(0 10px 26px #0009); }
.item-chip {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  padding: 5px 11px; border-radius: 999px;
  font-size: 14px; font-weight: 900; color: #fff;
  background: #0b0712c4; border: 1px solid #ffffff2b; backdrop-filter: blur(8px);
}
.item-body { flex: 1; padding: 2px 14px 0; }
.item-name { font-size: 16.5px; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; }
.item-tag {
  margin-top: 4px; font-size: 13px; line-height: 1.35; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 35px;
}
/* Ради чего покупают: не «что это», а что она сделает. Строка идёт под
   описанием и подсвечена акцентом — на витрине глаз цепляется именно за неё,
   а прежняя карточка продавала железку. */
.item-promise {
  margin-top: 6px; font-size: 12.5px; font-weight: 800; line-height: 1.25;
  color: #c9b6ff; display: flex; gap: 5px; align-items: baseline;
}
.item-promise::before { content: '→'; opacity: .65; font-weight: 900; }

.item-btn {
  margin: 11px 14px 0; border: 0; border-radius: 14px; cursor: pointer;
  padding: 11px; font-family: inherit; font-size: 16px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
/* Купленное не выключаем, но и не кричим о нём: карточка глушится, кнопка
   становится тихой отметкой. */
.item-card.owned { border-color: #35d07f2e; }
.item-card.owned .item-art { opacity: .72; }
.item-card.owned .item-chip { color: var(--ok); border-color: #35d07f5c; }
.item-btn.owned { background: #ffffff10; color: var(--ok); }


/* Скидка подписчика. Зачёркнутая цена стоит рядом с новой — так выгода
   читается числом, а не обещанием. */
.item-chip s, .ci-price s {
  opacity: .55; font-weight: 700; margin-right: 4px; text-decoration-thickness: 1.5px;
}
.ih-deal {
  display: block; width: 100%; margin-top: 12px; padding: 9px 12px;
  border: 0; border-radius: 13px; cursor: pointer;
  font-family: inherit; font-size: 13.5px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px -12px var(--accent-2);
}
/* у кого подписка уже есть — это не оффер, а отметка «скидка работает» */
.ih-deal.on {
  cursor: default; color: #e2cb9a;
  background: #c9a45c1a; box-shadow: inset 0 0 0 1px #c9a45c47;
}

/* ---------------- чаты ---------------- */
.chats-list { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.chat-row {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  padding: 12px 10px; border-radius: 18px;
}
.chat-row:active { background: #ffffff0d; }
.row-ava {
  width: 60px; height: 60px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
  position: relative;
}
.row-ava i {
  position: absolute; right: 1px; bottom: 1px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--ok); border: 2px solid var(--bg);
}
.row-main { flex: 1; min-width: 0; }
.row-top { display: flex; align-items: baseline; gap: 8px; }
.row-name { font-size: 17px; font-weight: 800; }
.row-time { margin-left: auto; font-size: 13px; color: var(--text-2); font-weight: 600; }
.row-last {
  font-size: 15px; color: var(--text-2); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.empty { text-align: center; padding: 60px 20px; }
.empty h3 { font-size: 22px; margin-bottom: 6px; }

/* ---------------- профиль: см. блок «профиль» ниже ---------------- */
/* Premium: розовая плашка во всю ширину выглядела дёшево и спорила с
   карточками. Теперь та же тёмная карточка, что и «Подарок дня», но с золотым
   кантом и золотой кнопкой — золото в приложении означает только подписку. */
.promo {
  position: relative; overflow: hidden;
  width: 100%; display: flex; align-items: center; gap: 12px; cursor: pointer;
  border: 1px solid #c9a45c40; border-radius: 22px; padding: 14px;
  background:
    radial-gradient(115% 130% at 0% 0%, #c9a45c1a 0%, transparent 58%),
    linear-gradient(150deg, #251b36, #1a1229 70%);
  color: var(--text); text-align: left; font-family: inherit; margin-bottom: 12px;
  transition: transform .12s ease;
}
.promo:active { transform: scale(.985); }

.promo-crown {
  flex: none; width: 44px; height: 44px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: #c9a45c1f; box-shadow: inset 0 0 0 1px #c9a45c3d;
}
.promo-txt { flex: 1; min-width: 0; }
.promo-title {
  display: block; font-size: 20px; font-weight: 900; letter-spacing: -0.02em;
  line-height: 1.2; color: #e2cb9a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .promo-title {
    background: linear-gradient(92deg, #eddcb4 0%, #c9a45c 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
}
.promo-sub {
  display: block; font-size: 13px; font-weight: 600; line-height: 1.35;
  color: var(--text-2); margin-top: 3px; text-wrap: balance;
}
/* Главная кнопка продажи. Была плоской пилюлей вровень с фоном — теперь у
   неё объём (светлая грань сверху, тень снизу), собственное свечение и
   медленное «дыхание»: на спокойном тёмном экране взгляд цепляется за
   движение, а не за цвет, и золото не приходится делать ядовитее. */
.promo-cta {
  flex: none; padding: 12px 18px; border-radius: 15px;
  font-size: 15px; font-weight: 900; letter-spacing: -0.01em;
  color: #1b1206; white-space: nowrap;
  background: linear-gradient(135deg, #fdf0cd 0%, #e3bd77 46%, #c9a45c 100%);
  box-shadow:
    0 12px 26px -12px #c9a45cd9,
    0 0 0 1px #ffeec880,
    inset 0 1px 0 #fffaf0, inset 0 -2px 6px -2px #8a6a2a66;
  animation: cta-breathe 3.4s ease-in-out infinite;
}
@keyframes cta-breathe {
  0%, 100% { box-shadow: 0 12px 26px -12px #c9a45cd9, 0 0 0 1px #ffeec880,
                         inset 0 1px 0 #fffaf0, inset 0 -2px 6px -2px #8a6a2a66; }
  50%      { box-shadow: 0 14px 34px -12px #c9a45c, 0 0 0 1px #ffeec8c4,
                         0 0 22px -6px #dcb46980,
                         inset 0 1px 0 #fffaf0, inset 0 -2px 6px -2px #8a6a2a66; }
}
.promo:active .promo-cta { transform: scale(.97); }
/* у кого подписка уже есть — «Продлить» не должно кричать */
.promo.on .promo-cta { animation: none; }
/* Блик раз в несколько секунд: карточка подписки должна ловить взгляд на
   экране, где всё остальное намеренно спокойное. */
.promo::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 34%;
  pointer-events: none; transform: skewX(-18deg);
  background: linear-gradient(100deg, transparent, #ffffff1f 45%, transparent);
  animation: promo-shine 5.5s ease-in-out infinite;
}
@keyframes promo-shine {
  0%, 70% { left: -60%; }
  100%    { left: 130%; }
}
@media (prefers-reduced-motion: reduce) {
  .promo::after, .promo-cta, .btn-soft { animation: none; }
}
/* подписка уже есть — кант ярче, кнопка спокойнее */
.promo.on { border-color: #c9a45c8c; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 22px; padding: 18px; margin-bottom: 13px;
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.card-title { font-size: 17px; font-weight: 800; }
.pct {
  margin-left: auto; font-size: 14px; font-weight: 900; padding: 4px 10px;
  border-radius: 999px; background: #35d07f26; color: var(--ok);
}
.ref-earn { font-size: 14px; margin: 8px 0 4px; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px; text-align: center;
}
.stat b { display: block; font-size: 20px; font-weight: 900; }
.stat small { font-size: 12px; }

/* ---------------- нижняя навигация ---------------- */
.tabbar {
  position: fixed; z-index: 30;
  left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 12px);
  display: flex; justify-content: space-around; align-items: center;
  padding: 8px; border-radius: 26px;
  background: #100c1aed; border: 1px solid var(--line);
  backdrop-filter: blur(18px); box-shadow: 0 18px 40px -18px #000;
}
.tab {
  flex: 1; border: 0; background: none; cursor: pointer; padding: 10px 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 18px;
}
.tab svg { width: 28px; height: 28px; fill: none; stroke: #8d82a8; stroke-width: 1.9; stroke-linejoin: round; }
.tab.active { background: #ffffff10; }
.tab.active svg { stroke: #fff; fill: #ffffff1a; }

/* ---------------- чат ---------------- */
.chat-overlay, .premium-overlay {
  position: fixed; left: 0; right: 0; top: 0; z-index: 40;
  height: var(--app-h, 100%);
  display: flex; flex-direction: column;
  background: var(--bg);
  animation: slidein .2s ease;
}
/* премиум открывается ПОВЕРХ чата — закрыл и вернулся ровно туда же */
.premium-overlay { z-index: 45; }
@keyframes slidein { from { transform: translateX(22px); opacity: .4 } to { transform: none; opacity: 1 } }

.chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 12px) 14px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.chat-head.plain { border-bottom: 0; }
.chat-ava {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  background-size: cover; background-position: center;
}
.chat-head-info { flex: 1; min-width: 0; }
.chat-name { font-size: 18px; font-weight: 800; }
.chat-status { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.int-chip { padding: 2px 8px; border-radius: 999px; background: #ffffff14; font-weight: 700; }

.chat-int-bar { height: 3px; background: #ffffff12; }
.chat-int-bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--hot));
  transition: width .5s ease;
}

.chat-scroll {
  flex: 1; overflow-y: auto; overflow-anchor: none; padding: 16px 14px 6px;
  display: flex; flex-direction: column; gap: 10px;
}
/* прижимаем короткую переписку к низу, как в мессенджере */
.chat-scroll::before { content: ''; margin-top: auto; }
/* без этого flex-контейнер ужимает элементы при переполнении
   (пейволл с overflow:hidden схлопывался в пару пикселей) */
.chat-scroll > * { flex: 0 0 auto; }
.msg {
  max-width: 83%; padding: 12px 16px; border-radius: 21px;
  font-size: 17px; font-weight: 500; line-height: 1.42;
  animation: pop .18s ease; word-wrap: break-word;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
.msg.her {
  align-self: flex-start; background: var(--card-2);
  border: 1px solid var(--line); border-bottom-left-radius: 7px;
}
.msg.me {
  align-self: flex-end; color: #fff; border-bottom-right-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
/* действия в *звёздочках* — не тонкий курсив, а приглушённый плотный текст */
.msg .act { color: #b9a8e0; font-style: normal; font-weight: 500; }
.msg.me .act { color: #efe2ff; }
.msg.photo { padding: 6px; max-width: 62%; }
.msg.photo img { display: block; width: 100%; border-radius: 15px; }
.photo-cap { padding: 7px 8px 3px; font-size: 14px; color: var(--text-2); }
.photo-stub {
  position: relative; width: 100%; aspect-ratio: 4/5; max-height: 230px;
  border-radius: 15px; overflow: hidden;
  background: linear-gradient(150deg, #3a1c4e, #7a2a5c 60%, #b03a6e);
  display: flex; align-items: center; justify-content: center;
}
.photo-stub::after {
  content: '🔒 скоро'; position: relative; z-index: 2;
  font-size: 15px; font-weight: 800; color: #fff;
  padding: 8px 14px; border-radius: 999px;
  background: #0b0712a8; border: 1px solid #ffffff2e;
}
.photo-stub i {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(115deg, #ffffff0f 0 12px, transparent 12px 26px);
  backdrop-filter: blur(3px);
}

.chat-typing { display: flex; gap: 5px; padding: 4px 24px 10px; }
.chat-typing span {
  width: 8px; height: 8px; border-radius: 50%; background: #9d8dc4;
  animation: bounce 1s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: .15s; }
.chat-typing span:nth-child(3) { animation-delay: .3s; }

.quickies {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 14px 10px;
  scrollbar-width: none;
}
.quickies::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid #ffffff24; border-radius: 999px;
  background: #ffffff12; color: var(--text);
  font-family: inherit; font-size: 15px; font-weight: 600;
  padding: 9px 15px; cursor: pointer;
}
/* подсказки-сценарии длинные — пусть переносятся, а не уезжают за край */
#custom-ideas .chip { flex: 0 1 auto; max-width: 100%; text-align: left;
  font-size: 14px; line-height: 1.3; padding: 8px 14px; border-radius: 16px; }
.chip.selected { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

/* строка «сколько стоит сообщение» над полем ввода */
.chat-cost {
  padding: 0 14px 6px; font-size: 12.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-cost b { color: #c4b5fd; font-weight: 800; }

/* ценник прямо на кнопках фото и голоса */
.chat-xtra { position: relative; }
.xtra-cost {
  position: absolute; right: -3px; bottom: -3px;
  min-width: 18px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 900; font-style: normal; line-height: 16px;
  text-align: center; box-shadow: 0 0 0 2px #130d20;
}
.xtra-cost:empty { display: none; }

.pw-offer {
  margin: 2px 0 10px; padding: 8px 12px; border-radius: 14px;
  background: #a78bfa1f; color: #c4b5fd; font-size: 14px; font-weight: 700;
}
/* «первое бесплатно» на кнопках фото и голоса */
.xtra-cost.free { background: var(--ok); }

/* скелетоны на время загрузки — форма контента вместо пустого экрана */
.sk {
  border-radius: var(--radius);
  background: linear-gradient(100deg, #ffffff0a 30%, #ffffff18 50%, #ffffff0a 70%);
  background-size: 220% 100%;
  animation: skwave 1.1s linear infinite;
}
.sk-item { aspect-ratio: 3 / 3.6; }
.sk-chat { height: 74px; margin-bottom: 10px; border-radius: 18px; }
@keyframes skwave { from { background-position: 120% 0 } to { background-position: -120% 0 } }

/* таблица цен в профиле */
.price-list { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.price-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px;
}
.price-row:last-child { border-bottom: 0; }
.price-row .pr-ic { width: 22px; flex: none; font-size: 17px; text-align: center; }
.price-row .pr-name { flex: 1; min-width: 0; font-weight: 600; }
.price-row .pr-sub { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.price-row .pr-cost { flex: none; font-weight: 900; }
.price-row.free .pr-cost { color: var(--ok); }
.price-foot { font-size: 13px; margin-top: 10px; }

.chat-input-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px calc(env(safe-area-inset-bottom) + 10px);
  background: #130d20f2; border-top: 1px solid var(--line);
}
.chat-input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 22px;
  background: #ffffff0f; color: var(--text);
  font-family: inherit; font-size: 17px; font-weight: 500;
  padding: 13px 16px; outline: none;
}
.chat-input::placeholder { color: #7e739a; }
.chat-xtra {
  width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%;
  background: #ffffff12; color: var(--text); font-size: 20px; cursor: pointer;
}
.chat-send {
  width: 46px; height: 46px; flex: none; border: 0; border-radius: 50%; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
}
.chat-send svg { width: 20px; height: 20px; fill: #fff; }

/* пейволл в чате */
.paywall {
  align-self: stretch; border-radius: 22px; overflow: hidden;
  border: 1px solid #ffffff20; background: var(--card);
  animation: pop .22s ease;
}
.pw-teaser { position: relative; padding: 18px 16px 22px; background: linear-gradient(160deg, #2a1436, #4a1a3c); }
.pw-teaser p { margin: 0; filter: blur(4.5px); font-size: 16px; font-weight: 500; color: #e8dcf5; user-select: none; }
.pw-lock {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 32px;
}
.pw-body { padding: 16px; }
.pw-title { font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.pw-sub { font-size: 15px; color: var(--text-2); margin-bottom: 14px; }
.pw-btn {
  width: 100%; border: 0; border-radius: 15px; cursor: pointer; margin-bottom: 8px;
  padding: 14px; font-family: inherit; font-size: 17px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.pw-btn.secondary { background: #ffffff12; }

/* предметы в шторке чата */
/* Шторка «что пустим в ход»: список строк с артом предмета. Сеткой в две
   колонки с одним эмодзи она читалась как набор пустых плашек — а выбирают
   тут по картинке. */
.chat-items {
  display: flex; flex-direction: column; gap: 8px; margin-top: 8px;
  max-height: 52vh; overflow-y: auto;
}
.ci {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--card-2);
  padding: 9px 12px 9px 9px; cursor: pointer; text-align: left;
  font-family: inherit; color: var(--text);
}
.ci:active { background: #ffffff14; }
.ci-art {
  width: 52px; height: 52px; flex: none; border-radius: 13px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  background: radial-gradient(75% 65% at 50% 45%, var(--g2) 0%, #16101f 78%);
}
.ci-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ci-txt { flex: 1; min-width: 0; }
.ci-name { font-size: 15.5px; font-weight: 800; }
.ci-promise { font-size: 12.5px; font-weight: 700; color: #c9b6ff; margin-top: 1px; }
.ci-price { font-size: 14px; font-weight: 800; color: var(--text-2); margin-top: 1px; }
.ci.owned .ci-price { color: var(--ok); }
.ci:not(.owned) .ci-art { opacity: .8; }

/* ---------------- premium ---------------- */
.prem-scroll {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 8px 16px 210px;
}
/* Шапка магазина держится компактной: раньше корона с заголовком съедали
   весь первый экран, и тарифы человек видел только после скролла. */
.prem-hero {
  position: relative; text-align: center; padding: 96px 6px 16px;
  border-radius: 22px; overflow: hidden; margin-bottom: 6px;
  background-position: center 28%; background-size: cover;
}
.prem-hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, #0b071233 0%, #0b0712cc 58%, var(--bg) 100%);
}
.prem-hero h2, .prem-hero p { position: relative; z-index: 1; }
#shop-prem .prem-hero { background-image: url('/static/ui/hero-premium.webp'); }
#shop-dia .prem-hero  { background-image: url('/static/ui/hero-diamonds.webp'); }
.prem-hero h2 { font-size: 23px; margin: 6px 0 0; }
.prem-hero .muted { font-size: 14.5px; margin: 6px 0 0; }

.plans { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.plans::-webkit-scrollbar { display: none; }
.plan {
  position: relative; flex: none; width: 124px; cursor: pointer;
  border: 2px solid var(--line); border-radius: 20px; background: var(--card);
  padding: 16px 12px 14px; text-align: center; color: var(--text); font-family: inherit;
}
.plan.selected { border-color: var(--accent); background: #2a1a44; box-shadow: 0 0 0 4px #8b5cf62e; }
.plan-title { font-size: 16px; font-weight: 800; }
.plan-dia { font-size: 14px; font-weight: 700; color: #7dd3fc; margin: 6px 0 8px; }
.plan-price { font-size: 20px; font-weight: 900; }
.plan-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-size: 11px; font-weight: 900; letter-spacing: .02em;
  padding: 4px 9px; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
}
.plan-save {
  position: absolute; right: -1px; bottom: -1px;
  font-size: 11px; font-weight: 900; padding: 4px 8px;
  border-radius: 12px 0 18px 0; background: var(--hot); color: #fff;
}

.perks { display: flex; flex-direction: column; gap: 2px; }
.perk { display: flex; align-items: center; gap: 14px; padding: 11px 4px; }
.perk-ic {
  width: 42px; height: 42px; flex: none; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: #ffffff10;
}
.perk-t { font-size: 16px; font-weight: 700; }
.perk-s { font-size: 14px; color: var(--text-2); font-weight: 500; }

.prem-h3 { font-size: 19px; margin: 24px 0 12px; }
.packs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pack {
  position: relative; border: 1px solid var(--line); border-radius: 18px;
  background: var(--card); padding: 14px; cursor: pointer;
  color: var(--text); font-family: inherit; text-align: left;
}
.pack-amount { font-size: 22px; font-weight: 900; }
.pack-price { font-size: 15px; font-weight: 700; color: var(--text-2); margin-top: 6px; }
.pack-label {
  position: absolute; top: 10px; right: 10px; font-size: 12px; font-weight: 900;
  padding: 3px 8px; border-radius: 999px; background: #35d07f26; color: var(--ok);
}

.prem-footer {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 16px calc(env(safe-area-inset-bottom) + 14px);
  background: #0d0916f7; border-top: 1px solid var(--line); backdrop-filter: blur(16px);
}
.pf-line { display: flex; align-items: baseline; gap: 10px; }
.pf-line b { margin-left: auto; font-size: 24px; font-weight: 900; }
.pf-sub { font-size: 14px; margin-bottom: 10px; }
.pf-btns { display: flex; gap: 8px; }

/* ---------------- шторки, оверлеи, тосты ---------------- */
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; }
.sheet-backdrop { position: absolute; inset: 0; background: #000000a8; backdrop-filter: blur(3px); }
.sheet-body {
  position: relative; width: 100%; max-height: 86vh; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #130e20; border: 1px solid var(--line); border-bottom: 0;
  border-radius: 26px 26px 0 0;
  padding: 10px 18px calc(env(safe-area-inset-bottom) + 22px);
  animation: up .22s ease;
}
@keyframes up { from { transform: translateY(30px) } to { transform: none } }
.sheet-handle { width: 42px; height: 4px; border-radius: 3px; background: #ffffff2e; margin: 4px auto 14px; }
.sheet-title { font-size: 22px; margin-bottom: 6px; }
.menu-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  border: 0; background: none; color: var(--text); cursor: pointer;
  font-family: inherit; font-size: 17px; font-weight: 600; padding: 15px 4px;
  border-bottom: 1px solid var(--line); text-align: left;
}
.menu-row:last-child { border-bottom: 0; }

.overlay {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: #05030acc; backdrop-filter: blur(6px);
}
.levelup {
  position: relative; width: 100%; max-width: 340px; text-align: center;
  background: var(--card); border: 1px solid #ffffff24; border-radius: 26px; padding: 30px 22px;
}
.levelup-glow {
  position: absolute; inset: -40% 10% auto; height: 200px; filter: blur(50px); opacity: .55;
  background: radial-gradient(circle, var(--accent-2), transparent 70%);
}
.levelup-emoji { font-size: 58px; }
.levelup h2 { font-size: 26px; margin: 6px 0 6px; }

#toasts {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + 28px);
  z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  max-width: 90%; padding: 12px 18px; border-radius: 16px;
  background: #241a35f2; border: 1px solid var(--line);
  font-size: 16px; font-weight: 600; animation: pop .2s ease;
}
.toast.error { background: #3a1220f2; border-color: #ff3d7140; }
.toast.gold { background: #1e1733f2; border-color: #a78bfa40; }

/* ---------------- подсказка «энергия на исходе» ---------------- */
.lowbar {
  display: flex; align-items: center; gap: 10px; width: calc(100% - 20px);
  margin: 0 10px 8px; padding: 10px 14px; cursor: pointer;
  border: 1px solid #a78bfa2e; border-radius: 16px;
  background: #17122a;
  color: var(--text); font-family: inherit; font-size: 15px; font-weight: 600;
  text-align: left; animation: pop .2s ease; white-space: nowrap;
}
#lowbar-text { overflow: hidden; text-overflow: ellipsis; }
.lowbar b { color: #c4b5fd; }
.lowbar-cta { margin-left: auto; flex: none; font-weight: 800; color: #c4b5fd; }

/* бейдж близости в списке чатов */
.row-int {
  flex: none; font-size: 12px; font-weight: 800; color: var(--text-2);
  padding: 2px 7px; border-radius: 999px; background: #ffffff12;
}

/* «Premium активен» на экране подписки */
.prem-status {
  display: inline-block; margin-bottom: 10px;
  font-size: 14px; font-weight: 800; color: #16110a;
  padding: 6px 14px; border-radius: 999px;
  background: var(--gold);
}

/* ---------------- «ждут первого сообщения» ---------------- */
.suggest { padding: 22px 0 4px; }
.suggest-title { font-size: 18px; margin-bottom: 12px; }
.suggest-row {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px;
  scrollbar-width: none;
  /* pan-x — чтобы палец таскал ленту, а не страницу; contain — чтобы
     Telegram не принимал горизонтальный свайп за «назад» */
  touch-action: pan-x; overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
  cursor: grab;
}
.suggest-row.dragging { cursor: grabbing; scroll-snap-type: none; }
.suggest-row .sug { scroll-snap-align: start; touch-action: pan-x; }
.suggest-row::-webkit-scrollbar { display: none; }
.sug {
  flex: none; width: 96px; border: 0; background: none; padding: 0;
  cursor: pointer; color: var(--text); font-family: inherit; text-align: center;
}
.sug-art {
  position: relative; width: 96px; height: 120px; border-radius: 18px;
  border: 1px solid var(--line); overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 37px;
}
.sug.locked .sug-art span { filter: blur(6px); opacity: .8; }
.sug-lock {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  font-size: 13px; font-weight: 800; font-style: normal; white-space: nowrap;
  padding: 4px 9px; border-radius: 999px;
  background: #0b0712c4; border: 1px solid #ffffff2e;
}
.sug-name {
  margin-top: 7px; font-size: 14px; font-weight: 700; line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ============ карточка персонажа (всплывающее окно) ============ */
.girl-sheet { padding: 0 0 calc(env(safe-area-inset-bottom) + 14px); overflow: hidden; }
.gs-close {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 34px; height: 34px; border: 0; border-radius: 50%; cursor: pointer;
  background: #00000066; color: #fff; font-size: 16px; backdrop-filter: blur(6px);
}
.girl-sheet { max-height: 88vh; overflow-y: auto; }
.gs-art {
  position: relative; height: 230px; overflow: hidden; flex: none;
  background-size: cover; background-position: center top;
}
.gs-art::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, #0b071200 55%, #1b1329 100%);
}
/* Закрытая: сервер прислал сюда размытое превью вместо обложки, так что
   остаётся только притемнить. raw — старая статика без blur-файлов, там
   размываем сами (заодно уходят в туман чипы поверх кадра — не беда). */
.gs-art.locked::after {
  background:
    linear-gradient(180deg, #0b071233 0%, #0b071277 46%, #1b1329 100%);
}
.gs-art.locked.raw { filter: blur(16px) saturate(.7) brightness(.8); }
.gs-emoji {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; font-size: 84px; filter: drop-shadow(0 10px 26px #0009);
}
.gs-chips { position: absolute; left: 14px; top: 14px; z-index: 2; display: flex; gap: 6px; }
.gs-info { padding: 14px 18px 4px; }
.gs-scene {
  font-size: 14px; font-weight: 700; color: var(--accent-2);
  letter-spacing: -0.01em; margin-bottom: 3px;
}
.gs-scene:empty { display: none; }
.gs-head { display: flex; align-items: baseline; gap: 8px; }
.gs-name { font-size: 26px; font-weight: 900; }
.gs-age {
  font-size: 14px; font-weight: 800; color: var(--text-2);
  background: #ffffff12; border-radius: 999px; padding: 3px 9px;
}
.gs-tag { margin: 8px 0 0; font-size: 16px; font-weight: 600; color: var(--text); }
.gs-bio { margin: 8px 0 0; font-size: 15px; color: var(--text-2); }
.gs-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.gs-pill {
  font-size: 13px; font-weight: 700; padding: 6px 11px; border-radius: 999px;
  background: #ffffff12; color: var(--text-2);
}
.gs-pill.hot { background: #ff3d7126; color: var(--hot); }
.gs-pill.int { background: #8b5cf626; color: #c4b5fd; }
.gs-go { margin-top: 12px; }
.gs-note { font-size: 13px; text-align: center; margin: 8px 0 0; }

/* ============ профиль ============ */
/* до первого ответа сервера прячем всё, чего ещё не знаем: пустое место
   честнее, чем нули и кнопка «Забрать» у уже забранного подарка */
#view-profile.pending #btn-daily,
#view-profile.pending #daily-sub,
#view-profile.pending .ref-steps,
#view-profile.pending .ref-stats { visibility: hidden; }
#view-profile.pending .daily-ic { opacity: .5; }

.pcard {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #1b1430, #120d1d 72%);
  border: 1px solid #ffffff17; border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
}
.pcard::before {
  content: ''; position: absolute; inset: -45% 35% 55% -25%;
  background: radial-gradient(closest-side, #a855f73d, transparent 70%);
  pointer-events: none;
}
.pcard > * { position: relative; }

.profile-head { display: flex; align-items: center; gap: 13px; margin-bottom: 14px; }
.profile-ava {
  width: 62px; height: 62px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 900; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 3px #ffffff14, 0 10px 26px -12px var(--accent-2);
}
.profile-id { flex: 1; min-width: 0; }
.profile-name {
  font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile-status {
  flex: none; font-size: 12px; font-weight: 800; padding: 6px 12px;
  border-radius: 999px; background: #ffffff14; color: var(--text-2);
  border: 1px solid #ffffff14; white-space: nowrap;
}
.profile-status.prem {
  background: var(--gold);
  color: #16110a; border-color: transparent;
}

.balances { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bal {
  position: relative; display: block; min-width: 0;
  border: 1px solid #ffffff14; border-radius: 18px;
  background: #ffffff0f; color: var(--text);
  padding: 12px; text-align: left; cursor: pointer; font-family: inherit;
  transition: transform .12s ease, background .12s ease;
}
.bal:active { transform: scale(.97); background: #ffffff1a; }
.bal-top { display: flex; align-items: center; gap: 9px; }
.bal-ic {
  width: 34px; height: 34px; flex: none; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.bal-e { background: linear-gradient(155deg, #a78bfa14, #ffffff08 60%); }
.bal-d { background: linear-gradient(155deg, #38bdf814, #ffffff08 60%); }
.bal-e .bal-ic { background: #a78bfa26; box-shadow: inset 0 0 0 1px #a78bfa3d; }
.bal-d .bal-ic { background: #38bdf833; box-shadow: inset 0 0 0 1px #38bdf847; }
.bal-top b {
  flex: 1; min-width: 0; font-size: 24px; font-weight: 900; line-height: 1.1;
  letter-spacing: -0.02em; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bal small {
  display: block; margin-top: 7px; font-size: 12.5px; font-weight: 600;
  color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Заголовок секции — крупный и белый: мелкий серый капслок терялся и читался
   технической подписью, а не названием блока. */
.sec-title {
  font-size: 19px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--text); margin: 22px 4px 10px;
}

/* ежедневный подарок */
.daily-card { padding: 13px 13px 12px 14px; }
.daily-row { display: flex; align-items: center; gap: 11px; }
.daily-ic {
  width: 38px; height: 38px; flex: none; border-radius: 13px;
  display: flex; align-items: center; justify-content: center; font-size: 19px;
  background: #a78bfa1f; box-shadow: inset 0 0 0 1px #a78bfa33;
}
.daily-txt { flex: 1; min-width: 0; }
.daily-card .card-title { font-size: 15.5px; letter-spacing: -0.02em;
  /* многоточие вместо «Подарок дня» смотрелось как баг: пусть лучше
     переносится — кнопка справа стала шире, места на 375 px впритык */
  white-space: normal; line-height: 1.2; }
.daily-sub {
  font-size: 13.5px; font-weight: 600; color: var(--text-2); margin-top: 2px;
}
.daily-sub b { color: var(--text); font-weight: 800; }
/* правило серии — отдельной строкой во всю карточку, иначе не помещается */
.daily-note {
  margin-top: 11px; padding-top: 10px; border-top: 1px solid #ffffff12;
  font-size: 13.5px; font-weight: 600; line-height: 1.35; color: var(--text-2);
  text-wrap: balance;
}
.daily-note b { color: #c4b5fd; font-weight: 800; }
.btn-sm { flex: none; padding: 10px 15px; font-size: 14.5px; border-radius: 14px; white-space: nowrap; }
/* Подарок дня — не подписка, поэтому не золото, а фирменный фиолетовый. Но
   и не полупрозрачная плашка, как раньше: бесплатную энергию человек не
   забирал просто потому, что кнопка выглядела выключенной. Пока подарок
   доступен — заливка и свечение, забрал — тихий серый (.claimed ниже). */
.btn-soft { padding: 11px 16px; font-size: 14.5px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 900;
  box-shadow: 0 10px 24px -12px var(--accent-2), inset 0 1px 0 #ffffff40;
  animation: cta-breathe-violet 3.4s ease-in-out infinite;
}
@keyframes cta-breathe-violet {
  0%, 100% { box-shadow: 0 10px 24px -12px var(--accent-2), inset 0 1px 0 #ffffff40; }
  50%      { box-shadow: 0 12px 30px -12px var(--accent-2),
                         0 0 20px -6px #b93ecb7a, inset 0 1px 0 #ffffff40; }
}
.btn-soft:not(:disabled):hover { filter: brightness(1.1); }
.btn-soft:disabled { animation: none; }
.daily-card:not(.claimed) {
  border-color: #a78bfa33;
}
.daily-card.claimed .daily-ic { opacity: .55; }
.daily-card.claimed #btn-daily {
  background: #ffffff12; color: var(--text-2); opacity: 1;
  box-shadow: none; animation: none;
}

/* друзья */
.ref-card .card-head { align-items: flex-start; gap: 10px; margin-bottom: 2px; }
.ref-card .card-title { font-size: 20px; line-height: 1.2; letter-spacing: -0.02em; }
.ref-card .pct { flex: none; margin-top: 2px; }
.ref-steps {
  list-style: none; counter-reset: st; margin: 12px 0 4px; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.ref-steps li {
  counter-increment: st; position: relative; padding-left: 36px;
  font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--text-2);
}
.ref-steps li b { color: var(--text); font-weight: 800; }
.ref-steps li::before {
  content: counter(st); position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 9px; text-align: center;
  line-height: 26px; font-size: 13.5px; font-weight: 900; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
/* Плитки: крупное число и подпись словом. Раньше было «пришли / платили /
   💎 твои» — три ряда мелкого серого без опоры для глаза. */
.ref-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 16px 0 0; }
.ref-stats .rs {
  background: #ffffff0a; border: 1px solid #ffffff14; border-radius: 16px;
  padding: 14px 6px 13px; text-align: center; min-width: 0;
}
.ref-stats .rs b {
  display: block; font-size: 22px; font-weight: 900; line-height: 1.1;
  letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis;
}
.ref-stats .rs small {
  display: block; margin-top: 3px; font-size: 12px; font-weight: 600; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Заработок — отдельной строкой: с друзей капает и ⚡ (флэт-бонус за приход),
   и 💎 (процент с покупок), в одну плитку это не влезало. */
.ref-earn {
  display: flex; align-items: center; gap: 10px; margin-top: 9px;
  padding: 11px 13px; border-radius: 16px;
  background: #ffffff0a; border: 1px solid #ffffff14;
}
.re-title { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700; color: var(--text-2); }
.re-vals { display: flex; gap: 8px; flex: none; }
.re-chip {
  display: flex; align-items: center; gap: 4px; white-space: nowrap;
  padding: 5px 11px; border-radius: 999px; font-size: 14px; font-weight: 700;
}
.re-chip b { font-size: 16px; font-weight: 900; letter-spacing: -0.02em; }
.re-e { background: #a78bfa1f; box-shadow: inset 0 0 0 1px #a78bfa3d; color: #c4b5fd; }
.re-d { background: #38bdf821; box-shadow: inset 0 0 0 1px #38bdf840; color: #7dd3fc; }

/* ============ промо предмета в чате ============ */
.item-promo {
  display: flex; align-items: center; gap: 10px; margin: 10px 0;
  padding: 10px 12px; border-radius: 18px; cursor: pointer;
  background: linear-gradient(135deg, #2a1a3a, #3a1030); border: 1px solid #ffffff1a;
}
.item-promo .ip-emoji { font-size: 28px; flex: none; }
.item-promo .ip-txt { flex: 1; min-width: 0; }
.item-promo .ip-t { font-size: 15px; font-weight: 800; }
.item-promo .ip-s { font-size: 13px; color: var(--text-2); }
.item-promo .ip-price {
  flex: none; font-size: 14px; font-weight: 900; padding: 7px 12px;
  border-radius: 999px; background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

/* ================= магазин ================= */
.shop-tabs {
  display: flex; gap: 6px; padding: 6px; margin: 0 15px 12px;
  background: #ffffff0a; border: 1px solid var(--line); border-radius: 999px;
}
.shop-tab {
  flex: 1; border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--text-2);
  font-family: inherit; font-size: 16px; font-weight: 800; padding: 11px 8px;
  transition: background .15s ease, color .15s ease;
}
.shop-tab.active {
  color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 22px -12px var(--accent-2);
}

/* что меняется с подпиской — главный аргумент, поэтому вверху */
.compare {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 18px;
}
.cmp-head, .cmp-row {
  display: grid; grid-template-columns: 1fr 68px 88px; align-items: center;
  gap: 8px; padding: 11px 14px;
}
.cmp-head { background: #ffffff0a; font-size: 12px; font-weight: 800; color: var(--text-2); }
.cmp-head span:last-child { color: var(--ok); }
.cmp-head span:not(:first-child) { text-align: center; }
.cmp-row { border-top: 1px solid var(--line); font-size: 15px; font-weight: 600; }
.cmp-free, .cmp-prem { text-align: center; font-size: 14px; font-weight: 800; }
.cmp-free { color: var(--text-2); }
.cmp-prem { color: var(--ok); }

/* тарифы — списком: все видно сразу, выгода посчитана за тебя */
.plans-list { display: flex; flex-direction: column; gap: 12px; margin: 6px 0 18px; }
.plan-row {
  position: relative; width: 100%; cursor: pointer; text-align: left;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px;
  background: var(--card); border: 2px solid var(--line); border-radius: 18px;
  padding: 14px 16px; font-family: inherit; color: var(--text);
  transition: border-color .15s ease, transform .12s ease;
}
.plan-row:active { transform: scale(.985); }
.plan-row.selected { border-color: var(--accent-2); background: #2a1a3a; }
.plan-row .pr-title { font-size: 18px; font-weight: 900; }
.plan-row .pr-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.plan-row .pr-right { text-align: right; }
.plan-row .pr-stars { font-size: 19px; font-weight: 900; white-space: nowrap; }
.plan-row .pr-day { font-size: 12px; color: var(--text-2); }
.plan-badge2 {
  position: absolute; top: -9px; left: 14px; font-size: 11px; font-weight: 900;
  padding: 3px 9px; border-radius: 999px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.plan-save2 {
  position: absolute; top: -9px; right: 14px; font-size: 11px; font-weight: 900;
  padding: 3px 9px; border-radius: 999px; background: var(--hot); color: #fff;
}

/* пакеты алмазов: сколько получишь — слева, сколько стоит — справа */
.packs-list { display: flex; flex-direction: column; gap: 10px; }
.pack-row {
  position: relative; width: 100%; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 2px solid var(--line); border-radius: 18px;
  padding: 16px; font-family: inherit; color: var(--text);
  transition: border-color .12s ease, background .12s ease;
}
.pack-row.selected { border-color: var(--accent-2); background: #2a1a3a; }
.pack-row .pk-dia { flex: 1; font-size: 22px; font-weight: 900; letter-spacing: -0.02em; white-space: nowrap; }
.pack-row .pk-price {
  flex: none; font-size: 17px; font-weight: 900; white-space: nowrap;
  padding: 7px 13px; border-radius: 999px; background: #ffffff12;
}
.pack-row.selected .pk-price { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.pack-label2 {
  position: absolute; top: -9px; right: 14px; font-size: 11px; font-weight: 900;
  padding: 3px 9px; border-radius: 999px; color: #16110a;
  background: var(--gold);
}

/* на вкладке алмазов заголовок компактнее — пакеты должны быть сразу видны */
#shop-dia .prem-hero { padding: 96px 6px 14px; }
#shop-dia .prem-hero h2 { font-size: 24px; }
#shop-dia .prem-hero p { font-size: 15px; margin-top: 6px; }


/* ================= строгий вид вне витрины =================
   Витрина персонажей остаётся яркой — она продаёт. Всё остальное (магазин,
   предметы, чаты, профиль, шторки покупки) переводим в один фиолетовый без
   розовой половины и без цветных свечений: там человек принимает решения,
   а не залипает на картинки. */
#view-items, #view-chats, #view-profile,
#screen-premium, #sheet-pay, #sheet-items {
  /* почти все градиенты в проекте идут accent → accent-2; приравняв второй
     к первому, разом получаем спокойную одноцветную заливку */
  --accent-2: var(--accent);
}
#view-items .btn, #view-chats .btn, #view-profile .btn,
#screen-premium .btn, #sheet-pay .btn,
#view-profile .promo, #screen-premium .shop-tab.active,
#view-profile .daily-card:not(.claimed) { box-shadow: none; }

/* шапка профиля без сиреневого свечения */
#view-profile .pcard { background: #140f1f; }
#view-profile .pcard::before { display: none; }

/* бейджи тарифов и пакетов — тонкие чипы вместо кричащих плашек */
#screen-premium .plan-badge2 {
  background: #ffffff16; color: var(--text); box-shadow: inset 0 0 0 1px #ffffff26;
}
/* выгода остаётся читаемой — но зелёным чипом, а не кислотной плашкой */
#screen-premium .plan-save2,
#screen-premium .pack-label2 {
  background: #35d07f1a; color: var(--ok); box-shadow: inset 0 0 0 1px #35d07f3d;
}
#screen-premium .pack-row.selected .pk-price { background: var(--accent); }

/* вкладки магазина — сегмент-контрол, а не подсвеченная пилюля */
#screen-premium .shop-tab.active { background: #ffffff1a; color: var(--text); }

/* предметы: цветное марево под карточкой тише, кнопка цены — компактнее и
   глубже по тону, а то ряд ярких плашек читался как детская игра */
#view-items .item-card::before { opacity: .28; }
#view-items .item-btn {
  background: #5a34b0; padding: 11px; font-size: 16px; border-radius: 13px;
}
#view-items .item-btn.owned { background: #ffffff12; }

/* аватар в профиле без сиреневого ореола */
#view-profile .profile-ava { box-shadow: inset 0 0 0 2px #ffffff1f; }

/* ---------------- способ оплаты ---------------- */
.pay-what {
  margin: 0 0 14px; font-size: 15px; font-weight: 600; color: var(--text-2);
}
.pay-row {
  display: flex; align-items: center; gap: 13px; width: 100%; cursor: pointer;
  margin-bottom: 10px; padding: 15px 16px; border-radius: 18px;
  background: #ffffff0a; border: 1px solid var(--line);
  color: var(--text); font-family: inherit; text-align: left;
  transition: border-color .12s ease, background .12s ease;
}
.pay-row:active { background: #ffffff14; border-color: #ffffff2e; }
.pay-ic {
  width: 42px; height: 42px; flex: none; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 21px;
  background: #ffffff10;
}
.pay-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pay-txt b { font-size: 16.5px; font-weight: 800; }
.pay-txt small { font-size: 13px; color: var(--text-2); font-weight: 600; }
.pay-sum { flex: none; font-size: 17px; font-weight: 900; white-space: nowrap; }


/* ================= телефон ================= */
/* Узкие экраны (iPhone SE, старые Android — 360 CSS-пикселей и меньше):
   при базовых отступах карточки каталога сжимались до нечитаемых, а длинные
   заголовки тарифов наезжали на цену. */
@media (max-width: 380px) {
  body { font-size: 16px; }
  .appbar-title { font-size: 27px; }
  #views { padding-left: 13px; padding-right: 13px; }
  .girls-head { margin: 0 -13px; padding-left: 13px; padding-right: 13px; }
  .girls-grid { gap: 10px; }
  .gc-name { font-size: 17px; }
  .gc-tag { font-size: 13px; }
  .card { padding: 15px; }
  .pr-title { font-size: 16px; }
  .pf-line b { font-size: 21px; }
  .shop-tab { font-size: 15px; padding: 10px 6px; }
  .tabbar { left: 12px; right: 12px; }
}

/* Экран с «челюстью» в альбомной ориентации: без этого контент уезжает под вырез */
@supports (padding: env(safe-area-inset-left)) {
  #views, .prem-scroll, .chat-input-bar {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
}

/* ================= планшет и десктоп ================= */
/* Telegram Web и Desktop открывают Mini App в широком окне: растягивать ленту
   на всю ширину бессмысленно — держим колонку по центру. Ширина живёт в
   --app-w, чтобы фиксированные слои (чат, магазин, тосты) не разъезжались с
   основной колонкой: у них свои left/right, и раньше три числа правились
   порознь. */
:root { --app-w: 100%; }

@media (min-width: 620px) {
  :root { --app-w: 560px; }
  #app { max-width: var(--app-w); margin: 0 auto; }
  #screen-chat, #screen-premium {
    left: 50%; right: auto; width: 100%; max-width: var(--app-w);
    transform: translateX(-50%);
    animation: none;    /* slidein сбрасывает transform и дёргает окно вбок */
  }
  .tabbar {
    left: 50%; right: auto; width: 100%;
    max-width: calc(var(--app-w) - 32px); transform: translateX(-50%);
  }
  .sheet-body { max-width: var(--app-w); margin: 0 auto; }
  #toasts { left: 50%; right: auto; width: 100%; max-width: var(--app-w); transform: translateX(-50%); }
}

/* Широкое окно (развёрнутый Desktop, браузер): в двух колонках карточки
   раздувались до половины экрана — на такой ширине витрина читается лучше
   тремя. Карточка персонажа при этом остаётся вертикальной. */
@media (min-width: 900px) {
  :root { --app-w: 760px; }
  .girls-grid, .items-grid { grid-template-columns: repeat(3, 1fr); gap: 15px; }
  .girl-card { contain-intrinsic-size: auto 320px; }
  .appbar-title { font-size: 34px; }
}

/* Мышь и трекпад: на телефоне hover не бывает, а на ПК его отсутствие делает
   интерфейс «мёртвым» — ничего не отзывается на наведение. */
@media (hover: hover) and (pointer: fine) {
  .girl-card { transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
  .girl-card:hover {
    transform: translateY(-3px);
    border-color: #ffffff2b;
    box-shadow: 0 22px 44px -26px #000, 0 0 0 1px #ffffff10;
  }
  .girl-card:hover .gc-img { transform: scale(1.045); }
  .item-card { transition: transform .16s ease, border-color .16s ease; }
  .item-card:hover { transform: translateY(-3px); border-color: #ffffff26; }
  .btn:hover, .item-btn:hover, .wallet-plus:hover, .chat-send:hover { filter: brightness(1.1); }
  .cat:hover:not(.active), .shop-tab:hover:not(.active) { color: var(--text); background: #ffffff14; }
  .tab:hover, .chat-row:hover, .menu-row:hover, .pay-row:hover { background: #ffffff0d; }
  .chat-xtra:hover, .btn-icon:hover, .gs-close:hover { filter: brightness(1.25); }
  a, button { cursor: pointer; }
}

/* Полоса прокрутки в Desktop-клиенте — системная и светлая, поперёк тёмной
   витрины. Красим под интерфейс; на телефонах она оверлейная и правила ниже
   ни на что не влияют. */
* { scrollbar-width: thin; scrollbar-color: #ffffff26 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ffffff1f; border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #ffffff33; background-clip: content-box; }
