/* Mini App - стиль «тёмный дамаск»: глубокий изумрудно-чернильный фон
   с золотым орнаментом (bg.jpg), люксовая тёмная гамма + старое золото. */

:root {
  --bg: #14232a;             /* глубокий петроль - база под фото */
  --card: #1c3038;           /* карточки - чуть светлее, полупрозрачные */
  --card-solid: #1e333b;
  --dark: #0c161b;           /* самое тёмное: таббар */
  --ink: #ece4cf;            /* тёплая слоновая кость - основной текст */
  --muted: #9fb0ae;          /* приглушённый серо-бирюзовый */
  --gold: #c9a35c;           /* старое золото */
  --gold-bright: #e6c883;    /* светлое золото - акценты */
  --gold-bg: #2b3d40;        /* подложка пилюль */
  --danger: #d98a93;
  --radius: 16px;
  --border: 1px solid #ffffff14;
  --gold-border: 1px solid #c9a35c4d;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  padding-bottom: 84px;
  min-height: 100vh;
}
/* онбординг: таббар скрыт целиком, чтобы нельзя было переключиться на
   другую вкладку, не заполнив имя и дату рождения */
body.onboarding .tabbar { display: none; }
body.onboarding { padding-bottom: 24px; }

/* Фон-фото фиксированным слоем (background-attachment: fixed глючит в iOS) */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background: url("bg.jpg") center / cover no-repeat var(--bg);
}
/* заморозка серии: второй слой поверх обычного фона, включается классом
   .frozen на body и плавно проявляется - обычный фон никуда не девается,
   просто на время перекрывается */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background: url("frozen-bg.jpg") center / cover no-repeat;
  opacity: 0; transition: opacity .5s ease; pointer-events: none;
}
body.frozen::after { opacity: 1; }
/* текст, лежащий прямо на фоне (без своей карточки), на светлом льде
   терял контраст - подкладываем под него тёмную плашку, только пока
   фон заморожен, обычный вид не трогаем */
body.frozen .frost-plate {
  /* тот же тон, что и у карточек - прежний почти-чёрный (#05070c)
     на глаз читался заметно темнее соседних плашек при той же альфе */
  background: #1c30388c; border-radius: 14px; padding: 12px 16px;
}
/* пока фон заморожен, все карточки становятся полупрозрачными в тот же
   стиль, что и frost-plate - иначе они выглядят непрозрачным чёрным
   пятном поверх ледяной текстуры */
body.frozen .card { background: #1c30388c; }
body.frozen .card-dark { background: linear-gradient(150deg, #0f1d238c, #0a13178c); }
body.frozen .card-tinted { background: #22383f8c; }

/* ——— премиум-вид подписчика «Безлимит» (класс .premium на body) ——— */
/* фиолетовый звёздный фон + затемнение, чтобы текст поверх читался */
body.premium::before {
  background:
    linear-gradient(180deg, #0e0a1fb3, #0b0817d9),
    url("premium-bg.jpg?v=1") center top / cover no-repeat #150a22;
}
/* заморозка серии важнее — если и подписка, и риск серии, лёд перекрывает */
body.premium.frozen::before {
  background: url("bg.jpg") center / cover no-repeat var(--bg);
}
/* золотая рамка + свечение вокруг карточек-фич (расклады, обряды, астро,
   плитки категорий) — один и тот же вид везде, работает и на .card, и на
   .pm-tile: box-shadow не трогает фон элемента и повторяет его скругление */
body.premium .gild-card {
  box-shadow:
    0 0 0 1.5px #e6c883,        /* золотая рамка */
    0 0 20px 1px #e6c88359,     /* золотое свечение */
    0 6px 20px #00000055;       /* глубина */
}
/* текст, лежащий прямо на фоне, получает тёмную подложку — те же плашки,
   что и при заморозке серии, только теперь и в премиум-режиме */
body.premium .frost-plate {
  background: #14222acc; border-radius: 14px; padding: 12px 16px;
}
/* подписи медальонов-ачивок лежат прямо на фоне без плашки — им хватает тени */
body.premium .ach-day { text-shadow: 0 1px 4px #000, 0 0 8px #000000aa; }

/* VIP-бейдж у имени */
.vip-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: linear-gradient(120deg, #f0d488, #c9a35c 55%, #a8813c);
  color: #231803; font-weight: 800; font-size: 10.5px; letter-spacing: .12em;
  padding: 5px 10px 4px; border-radius: 999px; text-transform: uppercase;
  box-shadow: 0 2px 10px #c9a35c55, inset 0 1px 0 #fff6d9;
}
.vip-badge::before { content: "♛"; font-size: 12px; letter-spacing: 0; }

#screen { padding: 18px 16px 12px; max-width: 560px; margin: 0 auto; }

/* --- типографика --- */
h1 { font-size: 29px; line-height: 1.16; margin: 6px 0 8px; font-weight: 700; color: var(--ink); font-family: var(--serif); }
h1 em, .serif-accent { font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--gold-bright); }
.kicker {
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold); font-weight: 700; margin-bottom: 4px;
}
.kicker::before { content: "✦ "; }
/* дата на главной: баланс-чипы вверху справа лежат position:absolute поверх
   контента и перекрывали длинный день недели. Резервируем справа место под
   них, при нехватке ширины дата аккуратно переносится, а не уходит под чипы. */
.kicker.hero-date { padding-right: 128px; line-height: 1.35; }
.sub { color: var(--muted); font-size: 15px; line-height: 1.45; margin-bottom: 14px; }

/* --- карточки: тёмный петроль, фон-орнамент просвечивает между ними --- */
.card {
  background: #1c3038e6; border-radius: var(--radius);
  padding: 18px; margin-bottom: 12px;
  border: var(--gold-border);
  box-shadow: 0 4px 18px #00000042;
}
.card-dark {
  background: linear-gradient(150deg, #0f1d23f0, #0a1317f0); color: var(--ink);
  border: 1px solid #e6c88355;
}
.card-gold {
  background: linear-gradient(120deg, #b28d47ee, #8c6a2fee); color: #fff8e4;
  border: 0;
}
.card-tinted { background: #22383fe8; border: var(--gold-border); }
.card .when {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold-bright); font-weight: 700; margin-bottom: 6px;
}
.card .title { font-size: 18.5px; font-weight: 700; margin-bottom: 6px; color: var(--ink); font-family: var(--serif); }
.card .desc { font-size: 14px; color: var(--muted); line-height: 1.45; }
.card .meta { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.card .meta-info { font-size: 13px; color: var(--muted); }

.price-pill {
  background: var(--gold-bg); border: var(--gold-border); border-radius: 999px;
  padding: 6px 13px; font-weight: 700; font-size: 14px; color: var(--gold-bright);
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; line-height: 1;
}
.price-pill::before {
  content: ""; flex: none; width: 16px; height: 16px;
  background: url("star.png?v=1") center / contain no-repeat;
}
.premium-badge {
  font-size: 10px; letter-spacing: .08em; border: var(--gold-border);
  color: var(--gold-bright); border-radius: 999px; padding: 3px 9px; font-weight: 700;
}
.premium-badge-img { height: 26px; width: auto; object-fit: contain; display: block; }

/* --- кнопки: золото на тёмном --- */
.btn {
  display: block; width: 100%; border: 0; cursor: pointer;
  background: linear-gradient(120deg, #d9b76b, #a8813c); color: #1c1409;
  border-radius: 999px; padding: 16px 20px;
  font-size: 16px; font-weight: 700; font-family: var(--sans);
  margin: 14px 0 6px;
  box-shadow: 0 4px 16px #00000052;
}
.btn:active { transform: scale(.985); }
.btn.gold { background: linear-gradient(120deg, #e6c883, #c9a35c); color: #1c1409; }
.btn.ghost { background: #1c3038cc; color: var(--ink); border: 1.5px solid #c9a35c66; box-shadow: none; }
.btn:disabled { opacity: .45; }

.topbar {
  position: absolute; top: 14px; right: 16px; z-index: 5;
  display: flex; gap: 8px; align-items: center;
}
.balance-chip {
  background: #1c3038f0; border: var(--gold-border); border-radius: 999px;
  padding: 6px 14px; font-weight: 700; font-size: 14px; color: var(--gold-bright);
  display: flex; align-items: center; gap: 6px; cursor: pointer;
}
body.frozen .balance-chip { background: #1c30388c; }

.streak-chip::before { content: none; }
.streak-chip img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }

.back-link { color: var(--muted); font-size: 15px; margin-bottom: 10px; display: inline-block; cursor: pointer; }
body.frozen .back-link {
  color: var(--ink); background: #05070c8c; border-radius: 999px; padding: 5px 12px 5px 10px;
}

/* --- сетка фич --- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: stretch; }
.grid2 .card { display: flex; flex-direction: column; }
.grid2 .card .meta { margin-top: auto; padding-top: 12px; }
.feature {
  background: #1c3038e6; border-radius: var(--radius); padding: 16px; cursor: pointer;
  border: var(--gold-border); box-shadow: 0 4px 18px #00000042;
}
body.frozen .feature { background: #1c30388c; }
.card-compat {
  cursor: pointer; margin-top: 18px;
  background: linear-gradient(110deg, #6e3440, #4b232c); color: #f4e9e2;
}
body.frozen .card-compat { background: linear-gradient(110deg, #6e34408c, #4b232c8c); }
.feature .f-ico {
  width: 52px; height: 52px; object-fit: contain; display: block; margin-bottom: 10px;
}
.feature .f-title { font-weight: 700; font-size: 15.5px; color: var(--ink); font-family: var(--serif); }
.feature .f-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.35; }

/* --- секции-хедеры категорий --- */
.cat-header {
  border-radius: 12px; padding: 12px 16px; margin: 18px 0 10px;
  display: flex; justify-content: space-between; align-items: center;
  color: #f0ead9; font-weight: 700; font-size: 12.5px; letter-spacing: .12em;
  text-transform: uppercase; box-shadow: 0 3px 12px #00000042; border: var(--border);
}
.cat-classic { background: linear-gradient(100deg, #7a5a1e, #4a3610); }
.cat-love { background: linear-gradient(100deg, #5c2b36, #3c1b23); }
.cat-career { background: linear-gradient(100deg, #27405c, #182a3e); }
.cat-money { background: linear-gradient(100deg, #5e4a1c, #3e3010); }
.cat-path { background: linear-gradient(100deg, #46325f, #2d1f3e); }
.cat-past { background: linear-gradient(100deg, #1e4b3c, #133227); }
.cat-header .count { font-size: 12px; opacity: .75; text-transform: none; letter-spacing: 0; }
body.frozen .cat-classic { background: linear-gradient(100deg, #7a5a1e8c, #4a36108c); }
body.frozen .cat-love { background: linear-gradient(100deg, #5c2b368c, #3c1b238c); }
body.frozen .cat-career { background: linear-gradient(100deg, #27405c8c, #182a3e8c); }
body.frozen .cat-money { background: linear-gradient(100deg, #5e4a1c8c, #3e30108c); }
body.frozen .cat-path { background: linear-gradient(100deg, #46325f8c, #2d1f3e8c); }
body.frozen .cat-past { background: linear-gradient(100deg, #1e4b3c8c, #1332278c); }

/* --- «Практическая магия» (вкладка «Обряды») - категория «Любовь» открыта
   всем, остальное только админам (practical_magic_unlocked из /me),
   см. app.js pmRenderCategories --- */
.pm-tile { position: relative; overflow: hidden; }
.pm-tile .pm-stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.pm-tile .f-ico-emoji { font-size: 30px; margin-bottom: 8px; display: block; }
.pm-tile.has-art { padding: 8px 8px 12px; }
.pm-tile .art-img {
  display: block; width: 100%; height: 138px; object-fit: contain;
  margin-bottom: 2px; filter: drop-shadow(0 8px 18px #00000070);
}
.pm-soon-note {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 16px 10px;
}
.pm-soon-title {
  font-family: var(--serif); font-weight: 700; font-size: 15px;
  color: var(--gold-bright); letter-spacing: .05em; margin-bottom: 6px;
}
.pm-soon-sub { font-size: 13px; color: var(--muted); line-height: 1.4; }
.pm-tile.has-art .f-title, .pm-tile.has-art .f-sub { text-align: center; }

.ing-list, .step-list { list-style: none; margin: 0 0 16px; padding: 0; }
.ing-list li {
  font-size: 14px; padding: 9px 0; border-bottom: 1px solid #ffffff14;
  color: var(--ink); display: flex; gap: 9px;
}
.ing-list li:before { content: "•"; color: var(--gold); }
.step-list li { font-size: 14px; line-height: 1.55; padding: 0 0 14px 30px; color: var(--ink); position: relative; }
.step-list li .num {
  position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%;
  background: var(--gold-bg); border: var(--gold-border); color: var(--gold-bright);
  font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.section-label {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold); font-weight: 700; margin: 0 0 10px;
}
.type-badge {
  font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--gold-bright); border: var(--gold-border); border-radius: 999px;
  padding: 3px 9px; font-weight: 700; display: inline-block; margin-bottom: 8px;
}
.item-icon-wrap { display: flex; justify-content: center; margin: 4px 0 -34px; position: relative; z-index: 2; }
.item-icon { display: block; width: 190px; height: 190px; object-fit: contain; filter: drop-shadow(0 10px 22px #000000aa); }
.card-dark.has-icon { padding-top: 52px; }
.lock-note {
  display: flex; gap: 9px; background: #00000030; border-radius: 12px;
  padding: 11px 12px; font-size: 12px; color: var(--muted); margin-bottom: 14px; line-height: 1.5;
}
/* закрытый рецепт (категории вне OPEN_CATS) - шаги/ингредиенты видны
   размытыми под замком, пока не оплачена разблокировка */
.pm-locked-wrap { position: relative; min-height: 180px; overflow: hidden; border-radius: var(--radius); }
.pm-locked-content { filter: blur(7px); user-select: none; pointer-events: none; opacity: .75; }

/* анимация разблокировки: золотая световая волна от точки нажатия «смывает»
   замок. Волна - span с радиальным золотым свечением поверх оверлея. */
.pm-unlock-ripple {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 3;
  transform: translate(-50%, -50%) scale(0);
  /* без mix-blend-mode: он часто не рендерится в мобильном WebView Telegram
     (из-за этого волна не показывалась на телефоне). Берём яркий золотой
     градиент, видимый и при обычной композиции. */
  background: radial-gradient(circle, #fff6de 0%, #f4dc93 22%, #e6c88399 48%, #c9a35c44 66%, transparent 76%);
  will-change: transform, opacity;
}
/* волна прошла - гасим оверлей и убираем блюр (контент проявляется в цвет) */
.pm-unlocking .pm-lock-overlay {
  opacity: 0; transform: scale(1.05);
  transition: opacity .5s ease .12s, transform .5s ease .12s; pointer-events: none;
}
.pm-unlocking .pm-locked-content {
  filter: blur(0); opacity: 1;
  transition: filter .6s ease .1s, opacity .6s ease .1s;
}
.pm-unlocking .pm-lock-icon {
  transform: scale(.4) translateY(-8px); opacity: 0;
  transition: transform .45s ease, opacity .45s ease;
}
@media (prefers-reduced-motion: reduce) {
  /* волну оставляем (в JS она становится мягкой вспышкой без масштабирования),
     убираем только тяжёлые переходы «смывания» замка */
  .pm-unlocking .pm-lock-overlay, .pm-unlocking .pm-locked-content, .pm-unlocking .pm-lock-icon { transition: none; }
}
.pm-lock-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 20px;
}
.pm-lock-icon { width: 34px; height: auto; object-fit: contain; }
.pm-lock-overlay .t { font-family: var(--serif); font-size: 16.5px; font-weight: 700; }
.pm-lock-overlay .sub { font-size: 13.5px; color: var(--muted); max-width: 34ch; line-height: 1.4; }
.pm-unlock-btn {
  margin-top: 6px; border: 0; border-radius: 999px; padding: 13px 24px;
  font-weight: 700; font-size: 14.5px; cursor: pointer; font-family: var(--sans);
  background: linear-gradient(120deg, #d9b76b, #a8813c); color: #1c1409;
  display: inline-flex; align-items: center; gap: 6px;
  touch-action: manipulation;
}
.pm-unlock-btn:active { transform: scale(.96); }
.pm-unlock-btn:disabled { opacity: .85; cursor: default; }
.pm-unlock-btn .spark-ico {
  display: inline-block; width: 18px; height: 18px; flex: none;
  background: url("star.png?v=1") center / contain no-repeat;
}
.pm-action {
  text-align: center; margin: 20px 0 6px; padding: 18px 16px 20px; cursor: pointer;
  background: #1c3038cc; border: 1.5px solid #c9a35c66; border-radius: var(--radius);
  position: relative; overflow: hidden; touch-action: manipulation;
}
.pm-action:active { transform: scale(.985); }
.pm-action img {
  width: 168px; height: 168px; object-fit: contain; display: block; margin: 0 auto 12px;
  filter: drop-shadow(0 8px 18px #00000070);
}
.pm-action .label {
  font-size: 13.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold-bright); font-weight: 700;
}
.pm-action-hint {
  font-size: 13px; color: var(--muted); line-height: 1.4;
  max-width: 240px; margin: 2px auto 0;
}
.pm-stats-row {
  text-align: center; font-size: 12px; color: var(--muted); line-height: 1.7;
  margin: 12px 0 2px;
}
.pm-stats-row b { color: var(--gold-bright); font-weight: 700; }
.pm-vote-row { display: flex; justify-content: center; align-items: center; gap: 26px; margin: 16px 0 4px; }
.pm-vote-ico {
  width: 44px; height: 44px; object-fit: contain; cursor: pointer;
  opacity: .32; filter: grayscale(65%); transition: opacity .2s ease, filter .2s ease, transform .15s ease;
}
.pm-vote-ico.active { opacity: 1; filter: none; }
.pm-vote-ico:active { transform: scale(.9); }

.pm-moon-timer {
  text-align: center; margin: 18px 0 6px; padding: 12px 14px;
  background: #00000030; border-radius: 12px;
}
.pm-moon-timer .t { font-size: 11.5px; color: var(--muted); }
.pm-moon-timer .val {
  font-family: var(--serif); font-size: 16.5px; font-weight: 600;
  color: var(--gold-bright); margin: 4px 0; letter-spacing: .01em;
}
.pm-moon-timer .note { font-size: 11.5px; color: var(--muted); }

/* --- чат --- */
.chat-wrap { display: flex; flex-direction: column; min-height: calc(100vh - 200px); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 4px 0 14px; }
.chat-ava {
  width: 44px; height: 44px; border-radius: 50%; overflow: hidden;
  box-shadow: 0 0 0 1px #c9a35c66;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.chat-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-ava::after {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: #63c98a; border: 2px solid var(--bg);
  position: absolute; bottom: 0; right: 0;
}
.chat-title { font-weight: 700; font-size: 17px; font-family: var(--serif); }
.chat-tariff { font-size: 12.5px; color: var(--muted); }
.messages {
  flex: 1; display: flex; flex-direction: column; gap: 10px;
  /* запас снизу под поле ввода - последнее сообщение видно, но без «дыры» */
  padding-bottom: 88px;
}
.msg {
  max-width: 82%; padding: 12px 15px; border-radius: 16px;
  font-size: 15px; line-height: 1.45; white-space: pre-wrap;
}
.msg.bot { background: #1c3038f0; border: var(--gold-border); border-bottom-left-radius: 5px; align-self: flex-start; }
.msg.me { background: linear-gradient(120deg, #d9b76b, #a8813c); color: #1c1409; border-bottom-right-radius: 5px; align-self: flex-end; }

.typing-msg { display: flex; flex-direction: column; gap: 6px; padding: 13px 15px; }
.typing-dots { display: flex; gap: 5px; }
.typing-dots span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--gold-bright); opacity: .35;
  animation: typingBounce 1.3s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes typingBounce {
  0%, 80%, 100% { opacity: .3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-4px); }
}
.typing-caption { font-size: 12.5px; color: var(--muted); }
.chat-inputbar {
  /* поднимаем над таббаром с учётом безопасной зоны айфона */
  position: fixed; bottom: calc(74px + env(safe-area-inset-bottom)); left: 0; right: 0;
  display: flex; gap: 8px; padding: 10px 14px;
  background: #14232af0; backdrop-filter: blur(8px); max-width: 560px; margin: 0 auto;
}
.chat-inputbar input {
  flex: 1; border: 1.5px solid #c9a35c55; border-radius: 999px;
  padding: 13px 18px; font-size: 15px; background: #1c3038; outline: none; color: var(--ink);
}
.chat-send {
  width: 48px; height: 48px; border-radius: 50%; border: 0;
  background: linear-gradient(120deg, #d9b76b, #a8813c); color: #1c1409; font-size: 19px; cursor: pointer;
}
.chat-send-wrap { position: relative; }
.chat-send-badge {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 6px;
  background: var(--gold-bg); border: var(--gold-border); border-radius: 999px;
  font-size: 11.5px; font-weight: 700; color: var(--gold-bright); padding: 3px 8px;
  white-space: nowrap; pointer-events: none;
}
.free-hint {
  align-self: flex-end; background: var(--gold-bg); border: var(--gold-border); border-radius: 999px;
  font-size: 12.5px; padding: 6px 12px; color: var(--gold-bright);
}

/* --- формы --- */
textarea, input[type=text], input[type=date], input[type=time], select {
  width: 100%; border: 1.5px solid #c9a35c55; border-radius: 13px;
  background: #1c3038; padding: 14px 16px; font-size: 15px; font-family: var(--sans);
  outline: none; resize: vertical; color: var(--ink);
  color-scheme: dark;
}
textarea::placeholder, input::placeholder { color: #6f8280; }
textarea { min-height: 120px; }
/* фиксированная высота - гарантирует, что date/time совпадают по высоте
   с обычным текстовым полем, даже если у нативного виджета свои метрики
   шрифта/line-height, которые не всегда идентичны text-полю в px в px */
input[type=text], input[type=date], input[type=time], select { height: 50px; }
/* в паре "С/По" колонка узкая - меньше горизонтальный паддинг и чуть
   мельче шрифт, чтобы длинная локализованная дата (14 июля 2026 г.)
   помещалась без обрезки внутри нативного виджета */
input[type=date] { padding-left: 10px; padding-right: 8px; font-size: 14px; }
/* iOS/WebKit рисует date и time нативным виджетом со своей высотой и
   игнорирует padding, пока не отключён системный appearance - без этого
   пилюля остаётся раздутой независимо от паддинга в CSS. С отключённым
   appearance обычный паддинг (14px, как у остальных полей) уже работает
   как надо, отдельно уменьшать его не нужно */
input[type=date], input[type=time] {
  -webkit-appearance: none; appearance: none;
}
label.fld { display: block; font-weight: 600; font-size: 14.5px; margin: 14px 0 7px; color: var(--ink); }
.char-count { text-align: right; font-size: 12px; color: var(--muted); margin-top: 4px; }

.segmented { display: flex; background: #1c3038e6; border: var(--gold-border); border-radius: 999px; padding: 4px; gap: 4px; }
.segmented button {
  flex: 1; border: 0; background: transparent; border-radius: 999px;
  padding: 11px 8px; font-size: 14.5px; font-weight: 600; color: var(--muted); cursor: pointer;
  font-family: var(--sans);
}
.segmented button.active { background: linear-gradient(120deg, #d9b76b, #a8813c); color: #1c1409; }

/* --- онбординг внутри приложения --- */
.ob-hero {
  width: 84px; height: 84px; border-radius: 50%; margin: 10px auto 18px;
  background: radial-gradient(circle at 35% 30%, #e6c883, #a8813c);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 40px #e6c88355;
}
.ob-hero img { width: 52px; height: 52px; object-fit: contain; }
.ob-gift-list { display: flex; flex-direction: column; gap: 10px; margin: 20px 0 26px; }
.ob-gift-item { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: var(--gold-border); border-radius: 14px; padding: 13px 14px; }
.ob-gift-ico { flex: none; width: 26px; text-align: center; }
.ob-gift-ico img { width: 24px; height: 24px; object-fit: contain; }
.ob-gift-title { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.ob-gift-desc { font-size: 12.5px; color: var(--muted); line-height: 1.4; }

.ob-disclaimer-block {
  background: #1c3038e6; border: var(--gold-border); border-radius: 14px;
  padding: 14px 15px; margin: 4px 0 14px; box-shadow: 0 4px 18px #00000042;
}
.ob-disc-title { font-weight: 700; color: var(--ink); font-size: 14.5px; margin-bottom: 5px; font-family: var(--serif); }
.ob-disc-text { font-size: 13px; color: var(--muted); line-height: 1.5; }
.ob-help-block {
  text-align: center; margin: 6px 0 18px; padding: 14px;
  background: #1c3038e6; border: var(--gold-border); border-radius: 14px; box-shadow: 0 4px 18px #00000042;
}
.ob-help-block .t { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.ob-help-block a { color: var(--gold-bright); font-weight: 700; font-size: 15px; text-decoration: none; }
.ob-help-block .note { font-size: 11px; color: var(--muted); opacity: .8; margin-top: 2px; }
.ob-legal-link { color: var(--gold-bright); text-decoration: underline; }

/* --- результат / прочитанный текст --- */
.reading { font-size: 15.5px; line-height: 1.62; }
.reading h3 { font-size: 17px; margin: 18px 0 6px; font-weight: 700; color: var(--gold-bright); font-family: var(--serif); }
.reading p { margin: 10px 0; }
.reading b { color: var(--gold-bright); }
.cards-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.mini-card {
  background: #1c3038f0; border: var(--gold-border); color: var(--ink); border-radius: 10px;
  padding: 10px 12px; font-size: 12.5px; text-align: center; min-width: 86px;
  font-family: var(--serif); box-shadow: 0 3px 12px #00000042;
}
.mini-card .pos { font-family: var(--sans); font-size: 10px; color: var(--muted); display: block; margin-bottom: 4px; }
.mini-card.rev { border-bottom: 2px solid var(--danger); }
.mini-card-img { width: 64px; border-radius: 6px; display: block; margin: 0 auto 6px; }
.cod-teaser-img {
  width: 84px; border-radius: 8px; flex: none;
  box-shadow: 0 0 0 1px #c9a35c66, 0 8px 22px #00000066;
}
.cod-img {
  width: 210px; max-width: 70%; border-radius: 10px; margin: 16px auto 6px;
  display: block;
  box-shadow: 0 0 0 1px #c9a35c77, 0 16px 44px #000000aa;
}

/* --- рулетка --- */
.wheel-wrap { text-align: center; padding: 8px 0; }
.wheel {
  width: 262px; height: 262px; margin: 14px auto; display: block;
  transition: transform 3.2s cubic-bezier(.15,.85,.25,1);
  filter: drop-shadow(0 12px 38px #00000090) drop-shadow(0 0 30px #c9a35c33);
}
.wheel-pointer { font-size: 26px; line-height: 0.4; color: var(--gold-bright); }

/* коллекция фаз луны (серия дней) */
.moon-row { display: flex; gap: 6px; justify-content: space-between; margin-top: 10px; }
.moon-slot {
  flex: 1; text-align: center; font-size: 22px; padding: 6px 0;
  border-radius: 10px; border: 1px dashed #c9a35c44; opacity: .3;
  filter: grayscale(1);
}
.moon-slot.on { opacity: 1; filter: none; border: 1px solid #c9a35c88; background: var(--gold-bg); }

/* сундук перед призом: нажать 3 раза */
.chest-reveal { text-align: center; margin-top: 14px; }
.chest-tap-img {
  width: 150px; margin: 12px auto; display: block; cursor: pointer;
  filter: drop-shadow(0 8px 22px #00000070);
}
@keyframes chestShake {
  0%, 100% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(-7px) rotate(-5deg); }
  40% { transform: translateX(7px) rotate(5deg); }
  60% { transform: translateX(-5px) rotate(-3deg); }
  80% { transform: translateX(5px) rotate(3deg); }
}
.chest-shake { animation: chestShake .35s ease; }

/* результат спина: карта аркана */
.arcana-result { text-align: center; margin-top: 14px; }
.arcana-img {
  width: 108px; border-radius: 10px; margin: 4px auto 10px; display: block;
  border: 1px solid #c9a35c66; box-shadow: 0 8px 26px #00000070;
}

/* --- профиль --- */
.profile-head {
  background: linear-gradient(150deg, #21363ef0, #16262cf0); border-radius: var(--radius);
  border: 1px solid #e6c88348;
  padding: 20px; margin-bottom: 12px;
  box-shadow: 0 4px 18px #00000042;
}
body.frozen .profile-head {
  background: linear-gradient(150deg, #21363e8c, #16262c8c);
}
.ava-big {
  width: 62px; height: 62px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e6c883, #a8813c);
  color: #1c1409; font-size: 26px; font-family: var(--serif);
  display: inline-flex; align-items: center; justify-content: center;
}
.trio { display: flex; gap: 8px; margin-top: 14px; }
.trio .slot {
  flex: 1; background: #ffffff0d; border: var(--border); border-radius: 12px; padding: 10px;
  text-align: center; font-size: 11.5px; color: var(--muted);
}
.trio .slot.empty { border: 1.5px dashed #c9a35c55; opacity: .8; }
.trio .slot b { display: block; font-size: 14px; color: var(--gold-bright); font-family: var(--serif); margin-top: 2px; }
.duo { display: flex; gap: 10px; margin-bottom: 12px; }
.duo .card { flex: 1; margin-bottom: 0; display: flex; gap: 10px; align-items: center; }
.stat-ico {
  width: 40px; height: 40px; border-radius: 50%; background: var(--gold-bg); border: var(--gold-border);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.stat-label { font-size: 11px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; font-weight: 700; }
.stat-value { font-size: 17px; font-weight: 700; color: var(--ink); }

/* --- три способа купить звёзды (напрямую / @PremiumBot / СБП) --- */
.buy-guide { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.buy-guide-item {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  background: #1c3038e6; border: var(--gold-border); border-radius: 14px; padding: 12px 14px;
}
.buy-guide-item.soon { cursor: default; opacity: .78; }
.buy-guide-ico {
  flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--gold-bg);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.buy-guide-title { font-weight: 700; font-size: 14.5px; color: var(--ink); }
.buy-guide-handle { color: var(--gold-bright); font-weight: 600; }
.buy-guide-soon {
  font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700;
  color: var(--gold-bright); background: var(--gold-bg); border-radius: 999px; padding: 2px 7px; margin-left: 4px;
}
.buy-guide-desc { font-size: 12.5px; color: var(--muted); line-height: 1.4; margin-top: 2px; }

/* --- переключатель ⭐ Stars / ₽ Рубли на экране покупки (добавлено 08.08, Robokassa) --- */
.currency-toggle {
  display: flex; background: #1c3038e6; border: var(--gold-border); border-radius: 999px;
  padding: 4px; margin: 14px 0; gap: 4px;
}
.ct-btn {
  flex: 1; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font-family: var(--sans); font-weight: 700; font-size: 14px; padding: 10px 12px; border-radius: 999px;
}
.ct-btn.active {
  background: linear-gradient(120deg, #d9b76b, #a8813c); color: #1c1409;
}

.pkg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pkg {
  background: #1c3038e6; border: var(--gold-border); border-radius: var(--radius); padding: 18px; text-align: center;
  cursor: pointer; position: relative; color: var(--ink);
  box-shadow: 0 4px 18px #00000042;
}
.pkg.hit { background: linear-gradient(130deg, #d9b76b, #96722f); color: #1c1409; border: 0; }
.pkg .hit-badge {
  position: absolute; top: -8px; right: 10px; background: #a5484f; color: #fff;
  font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 999px; letter-spacing: .08em;
}
.pkg .n { font-size: 30px; font-family: var(--serif); }
.pkg .n::after {
  content: ""; display: inline-block; width: 18px; height: 18px;
  background: url("star.png?v=1") center / contain no-repeat;
  margin-left: 5px; vertical-align: -1px;
}
.pkg .price { font-weight: 700; margin-top: 6px; }
.pkg .per { font-size: 12px; opacity: .65; margin-top: 3px; }

.settings-list .row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid #ffffff12; font-size: 15px;
}
.settings-list .row:last-child { border-bottom: 0; }
.settings-list .row .val { color: var(--muted); font-size: 14px; max-width: 55%; text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- календарь --- */
.lunar-badge {
  width: 82px; height: 82px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e6c883, #a8813c);
  color: #1c1409; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--serif); flex-shrink: 0; overflow: hidden;
  box-shadow: 0 0 28px #c9a35c3a;
}
.lunar-badge .n { font-size: 24px; line-height: 1.05; }
.lunar-badge .lbl {
  font-size: 7.5px; letter-spacing: .05em; text-transform: uppercase;
  text-align: center; line-height: 1.2; max-width: 86%;
}
.checklists { display: flex; gap: 10px; margin-top: 12px; }
.checklists .cl { flex: 1; background: #ffffff0a; border: var(--border); border-radius: 12px; padding: 12px; }
.cl .cl-title { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-bright); font-weight: 700; margin-bottom: 8px; }
.cl div { font-size: 14px; padding: 3px 0; color: var(--ink); }
.beauty-table .row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #ffffff10; font-size: 14.5px; }
.beauty-table .row span:first-child { color: var(--muted); }
.beauty-table .row span:last-child { font-weight: 600; color: var(--ink); }

/* --- натальное колесо: настоящая геометрия по градусам, не декор --- */
.natal-wheel-chart { position: relative; width: min(88vw, 380px); aspect-ratio: 1; margin: 6px auto 22px; }
.natal-wheel-chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
/* сплошная подложка под всё колесо - иначе тонкие линии и тёмные глифы
   тонут в текстурном фоне приложения */
.wheel-backdrop { fill: #1c3038; stroke: #c9a35c2e; stroke-width: 0.3; }
.wheel-outer-circle { fill: none; stroke: #c9a35c70; stroke-width: 0.4; }
.wheel-inner-circle { fill: #00000030; stroke: #c9a35c55; stroke-width: 0.3; }
/* чередующаяся заливка секторов домов - у Плацидуса дома бывают очень
   неравной ширины (15° против 60°), и без заливки узкий дом сливается
   с соседями в кучу линий; заливка делает границу видимой сама по себе */
.wheel-house-wedge-a { fill: #ffffff05; }
.wheel-house-wedge-b { fill: #00000018; }
.wheel-house-line { stroke: #c9a35c55; stroke-width: 0.3; }
.wheel-house-num { fill: var(--muted); font-size: 3.4px; font-family: var(--sans); }
.wheel-house-num.small { font-size: 2.7px; }
.wheel-house-num.tiny { font-size: 2.1px; fill: #c9c2ae; }
.wheel-leader-tick { stroke: #c9a35c88; stroke-width: 0.4; }
.wheel-sign-badge-bg { fill: #2b3d40; stroke: #c9a35c70; stroke-width: 0.3; }
.wheel-sign-sym { fill: var(--gold-bright); font-size: 4.2px; }
.wheel-planet-bg { fill: #0e1a20; stroke: #e6c883; stroke-width: 0.4; }
.wheel-planet-sym { fill: var(--ink); font-size: 4.4px; font-weight: 700; }
.wheel-planet-retro { fill: #e08a6b; font-size: 2.6px; font-weight: 700; }

/* --- таблица планет: строка иконка + имя + знак/дом --- */
.planet-table .row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #ffffff10; font-size: 14px; }
.planet-table .row:last-child { border-bottom: 0; }
.planet-table .p-glyph {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: #ffffff0f; border: 1px solid #c9a35c33; font-size: 14px; color: var(--gold-bright);
}
.planet-table .p-name { flex: 1; font-weight: 600; color: var(--ink); }
.planet-table .p-pos { color: var(--muted); text-align: right; font-style: italic; font-family: var(--serif); }
.planet-table .p-retro {
  display: inline-block; margin-left: 5px; font-size: 10px; font-weight: 700; font-style: normal;
  color: #e08a6b; border: 1px solid #e08a6b66; border-radius: 4px; padding: 0 3px;
}
.stars { color: var(--gold-bright); letter-spacing: 2px; }

/* --- сплеш-заставка: колода, карты разлетаются --- */
#splash {
  position: fixed; inset: 0; z-index: 100;
  background: radial-gradient(700px 500px at 50% 42%, #1d323b, #0c161b 75%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 26px; transition: opacity .45s ease;
}
#splash.out { opacity: 0; pointer-events: none; }
#splash video {
  width: min(88vw, 440px); aspect-ratio: 1;
  border-radius: 18px;
  animation: deck-in .6s cubic-bezier(.2,.9,.3,1.15) both;
}
@keyframes deck-in {
  from { transform: scale(.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.splash-title {
  font-family: var(--serif); font-style: italic; font-size: 30px;
  color: var(--gold-bright); letter-spacing: .04em;
  animation: title-in .8s ease .35s both;
}
@keyframes title-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .splash-deck, .fly, .splash-title { animation: none; }
}

/* --- сеанс-раскрытие: карты рубашками, 3D-переворот по тапу --- */
.reveal-row {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
  margin: 14px 0 10px;
}
/* геометрия классических техник - карты позиционируются по % (inline style),
   контейнер задаёт только высоту и относительное позиционирование */
.reveal-row.layout-cross,
.reveal-row.layout-horseshoe,
.reveal-row.layout-star,
.reveal-row.layout-circle,
.reveal-row.layout-columns {
  position: relative; display: block; width: 100%; margin: 20px 0 60px;
}
.reveal-row.layout-cross { height: 560px; }
.reveal-row.layout-horseshoe { height: 380px; }
.reveal-row.layout-star { height: 460px; }
.reveal-row.layout-circle { height: 560px; }
.reveal-row.layout-columns { height: 460px; }
.reveal-row .flip-card[style] { width: 78px; }
.reveal-row .flip-card[style] .cap { font-size: 10.5px; }
.reveal-row.tier-dense .flip-card[style] { width: 64px; }
.reveal-row.tier-dense .flip-card[style] .cap { font-size: 9.5px; }
.reveal-row.tier-ultra .flip-card[style] { width: 54px; }
.reveal-row.tier-ultra .flip-card[style] .cap { font-size: 9px; }
.reveal-row.tier-arc .flip-card[style] { width: 44px; }
.reveal-row.tier-arc .flip-card[style] .cap { font-size: 8px; }
/* непрозрачная плашка под подписью - читаема, даже если рядом другая карта */
.reveal-row .flip-card[style] .cap {
  background: #0a1220c7; border-radius: 7px; padding: 4px 3px 3px;
  box-shadow: 0 2px 8px #00000059;
}
.reveal-row .flip-card.crossing { z-index: 3; }
/* подпись «пересекающей» карты вынесена НАД картой (а не под неё) -
   сама карта лежит поверх «Сути вопроса» в той же точке, а под низом
   места слишком мало и точно предсказать высоту двух подписей нельзя
   (длина слов у разных карт разная); сверху перед «Возможным исходом»
   пустого места гораздо больше, и подписи гарантированно не пересекутся */
.reveal-row.layout-cross .flip-card.crossing .cap {
  position: absolute; left: 0; right: 0; bottom: 100%; margin: 0 0 8px;
}
/* долгое нажатие на открытую карту - рассмотреть её крупно */
.reveal-row .flip-card { touch-action: none; }
.card-zoom-ov {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 24px; background: #05070ce6; backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .18s ease;
}
.card-zoom-ov.show { opacity: 1; }
.card-zoom-card {
  width: min(78vw, 320px); aspect-ratio: 2 / 3; border-radius: 14px; overflow: hidden;
  box-shadow: 0 20px 60px #000000a6, 0 0 0 1px #c9a35c55;
  transform: scale(.85); transition: transform .18s ease;
}
.card-zoom-ov.show .card-zoom-card { transform: scale(1); }
.card-zoom-card img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* --- достижения за серию дней подряд --- */
.ach-strip {
  display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.ach-strip::-webkit-scrollbar { display: none; }
body.frozen .ach-strip {
  background: #1c30388c; border-radius: 14px; padding: 12px 10px;
}
.ach-item { flex: none; width: 82px; text-align: center; cursor: pointer; }
.ach-item img { width: 68px; height: 68px; object-fit: contain; display: block; margin: 0 auto; }
.ach-item.got img { filter: drop-shadow(0 0 8px #e6c88366); }
.ach-item.locked img { filter: grayscale(1) brightness(.5); opacity: .75; }
.ach-day {
  font-size: 10.5px; color: var(--muted); margin-top: 4px; line-height: 1.25;
  overflow-wrap: break-word;
}
.ach-item.got .ach-day { color: var(--gold-bright); font-weight: 600; }

/* модалка получения ачивки */
.ach-unlock-ov {
  position: fixed; inset: 0; z-index: 210;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: #05070ce8; backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .25s ease;
}
.ach-unlock-ov.show { opacity: 1; }
.ach-unlock-card { text-align: center; max-width: 320px; }
.ach-unlock-img {
  width: 200px; height: 200px; object-fit: contain;
  filter: drop-shadow(0 0 40px #e6c88377); margin: 0 auto 18px;
  transform: scale(.8); opacity: 0; display: block;
  animation: ach-pop .5s cubic-bezier(.25,1.4,.4,1) .1s forwards;
}
@keyframes ach-pop { to { transform: scale(1); opacity: 1; } }
.ach-unlock-title { font-family: var(--serif); font-size: 24px; color: var(--gold-bright); margin-bottom: 6px; }
.ach-unlock-sub { color: var(--muted); font-size: 14.5px; margin-bottom: 24px; }

/* --- бейдж-таймер на вкладке профиля, пока серия под угрозой --- */
.streak-timer-badge {
  position: absolute; top: -2px; right: 4px; background: #d9772e; color: #fff;
  font-size: 9px; font-weight: 700; padding: 1.5px 5px; border-radius: 999px;
  line-height: 1.4; box-shadow: 0 0 0 2px var(--dark); font-variant-numeric: tabular-nums;
  pointer-events: none; /* чисто индикатор - переход в профиль обрабатывает сама кнопка вкладки */
}

/* --- плашка «серия под угрозой» на экране профиля --- */
.rescue-plate {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border-color: #e69a4a6b;
}
/* бордовая - чтобы сразу бросалась в глаза среди остальных
   полупрозрачных карточек; специфичность .card.rescue-plate нарочно
   выше, чем у общего body.frozen .card, чтобы точно перебить его */
body.frozen .card.rescue-plate {
  background: linear-gradient(135deg, #8c1f34d9, #4a0d1ad9);
  border-color: #e37888ad;
}
.ice-icon-inline { width: 13px; height: 13px; object-fit: contain; vertical-align: -2px; margin-right: 4px; display: inline-block; }
.rescue-plate-timer {
  font-family: var(--serif); font-size: 22px; font-variant-numeric: tabular-nums; color: var(--ink);
}
.rescue-plate .btn { margin: 0; padding: 10px 20px; white-space: nowrap; }

/* --- модалка спасения серии --- */
.rescue-ov {
  position: fixed; inset: 0; z-index: 220;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: #05070ce8; backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .25s ease;
}
.rescue-ov.show { opacity: 1; }
.rescue-card {
  width: 100%; max-width: 340px; border-radius: 20px; overflow: hidden;
  background: var(--card-solid); box-shadow: 0 20px 60px #000000a6, 0 0 0 1px #c9a35c40;
  transform: scale(.92); transition: transform .25s ease;
}
.rescue-ov.show .rescue-card { transform: scale(1); }
.rescue-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.rescue-body { padding: 20px 22px 24px; text-align: center; }
.rescue-title { font-family: var(--serif); font-size: 21px; color: var(--gold-bright); margin-bottom: 12px; }
.rescue-timer {
  font-family: var(--serif); font-size: 34px; font-variant-numeric: tabular-nums;
  color: var(--ink); margin-bottom: 12px; letter-spacing: .02em;
}
.rescue-sub { font-size: 14.5px; color: var(--ink); margin-bottom: 4px; }
.rescue-price { font-size: 13.5px; color: var(--gold-bright); margin-bottom: 18px; }
.rescue-body .btn { margin-bottom: 10px; }
.rescue-body .btn:last-child { margin-bottom: 0; }

/* --- онбординг-экран «Заморозка» (один раз за жизнь аккаунта) --- */
.freeze-intro { text-align: center; padding: 24px 4px 12px; }
.freeze-intro-img {
  width: 190px; height: 190px; object-fit: contain; margin: 0 auto 22px; display: block;
  filter: drop-shadow(0 0 40px #6fa8dc55);
  animation: freeze-intro-in .7s ease both;
}
@keyframes freeze-intro-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }
.freeze-intro-title { font-family: var(--serif); font-size: 25px; margin-bottom: 14px; text-wrap: balance; }
.freeze-intro-text { font-size: 15px; color: var(--muted); line-height: 1.55; margin-bottom: 20px; }
.freeze-intro-gift {
  font-size: 14.5px; color: var(--gold-bright); background: var(--gold-bg);
  border: var(--gold-border); border-radius: 12px; padding: 12px 14px; margin-bottom: 26px;
}
.card-zoom-cap { text-align: center; font-family: var(--serif); font-size: 16px; color: var(--ink); max-width: 320px; }
.card-zoom-cap span {
  display: block; font-family: var(--sans); font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 4px;
}
.flip-card { width: 104px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.flip-card.big { width: 240px; margin: 18px auto 8px; }
.flip-inner {
  position: relative; width: 100%; aspect-ratio: 2 / 3;
  transform-style: preserve-3d; transition: transform .7s cubic-bezier(.3,.7,.3,1);
}
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  -webkit-backface-visibility: hidden; border-radius: 10px; overflow: hidden;
  box-shadow: 0 8px 22px #00000059, 0 0 0 1px #c9a35c44;
}
.flip-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.flip-front img { animation: back-glow 2.2s ease-in-out infinite; }
@keyframes back-glow { 0%,100% { filter: brightness(.92) } 50% { filter: brightness(1.08) } }
.flip-back { transform: rotateY(180deg); background: var(--card); }
.flip-card .cap {
  text-align: center; font-family: var(--serif); font-size: 12.5px;
  margin-top: 7px; color: var(--ink); opacity: 0; transition: opacity .4s .35s;
  line-height: 1.3;
}
.flip-card .cap span {
  display: block; font-family: var(--sans); font-size: 10px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--gold);
}
.flip-card.flipped .cap { opacity: 1; }
#reading-wrap.reveal-in { animation: title-in .7s ease both; }

/* --- ритуал тасовки (видео перед картой дня) --- */
.shuffle-ov {
  position: fixed; inset: 0; z-index: 90;
  background: #0a1220;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; transition: opacity .5s ease;
}
.shuffle-ov.out { opacity: 0; pointer-events: none; }
.shuffle-ov video {
  width: min(92vw, 480px); aspect-ratio: 1;
  border-radius: 18px;
}
/* портретное видео (натальный ритуал) - занимает почти весь экран, без
   пустых полей по бокам; object-fit:cover аккуратно обрезает края */
.shuffle-ov.portrait-ritual video {
  width: min(92vw, 460px); aspect-ratio: 9 / 16; height: auto; max-height: 82vh;
  border-radius: 18px; object-fit: cover;
}
/* премиум-ролик тасовки (вертикальный 652×1412) — сплеш и оверлеи ритуала.
   Размер задаём по высоте в родной пропорции + object-fit:contain, чтобы кадр
   был виден целиком (в т.ч. низ со свечой и книгами), без обрезки. */
.shuffle-ov.premium-shuffle video,
#splash.premium-shuffle video {
  height: min(82vh, 820px); width: auto; max-width: 94vw;
  aspect-ratio: 652 / 1412; object-fit: contain; border-radius: 18px;
}
/* с крупным видео сокращаем зазор до подписи «Колода», чтобы всё поместилось */
#splash.premium-shuffle { gap: 14px; }
.shuffle-hint {
  font-family: var(--serif); font-style: italic; font-size: 17px;
  color: var(--gold-bright); animation: pulse-soft 1.8s ease-in-out infinite;
}
.shuffle-hint2 {
  font-size: 13px; color: var(--muted); margin-top: -10px; text-align: center;
}
@keyframes pulse-soft { 0%,100% { opacity: .55 } 50% { opacity: 1 } }
.pm-video-credit {
  position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 0; right: 0;
  text-align: center; font-size: 9px; color: #ffffff55; letter-spacing: .02em;
}
.pm-video-credit a { color: #ffffff70; }

/* --- тап-игра ожидания --- */
.shuffle-ov.game { justify-content: flex-end; padding-bottom: 90px; }
.game-count {
  position: absolute; top: 18px; right: 18px;
  background: #1c3038f0; border: var(--gold-border); border-radius: 999px;
  padding: 8px 16px; font-size: 16px; color: var(--gold-bright); z-index: 2;
}
.game-hint { position: absolute; bottom: 46px; left: 0; right: 0; text-align: center; }
.tap-deck {
  position: absolute; cursor: pointer; z-index: 1;
  filter: drop-shadow(0 10px 22px #00000088);
  animation: deck-appear .38s cubic-bezier(.25,1.2,.4,1) both;
  transform: rotate(var(--rot, 0deg));
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
@keyframes deck-appear {
  from { transform: rotate(var(--rot, 0deg)) scale(.25); opacity: 0; }
  to   { transform: rotate(var(--rot, 0deg)) scale(1); opacity: 1; }
}
.tap-deck.pop {
  animation: deck-pop .32s ease-in both;
  pointer-events: none;
}
@keyframes deck-pop {
  30% { transform: rotate(var(--rot, 0deg)) scale(1.18); opacity: 1; filter: drop-shadow(0 0 26px #e6c883cc); }
  100% { transform: rotate(var(--rot, 0deg)) scale(.1); opacity: 0; }
}

/* --- игра-созвездие ожидания (натальная карта) --- */
.shuffle-ov.game.natal-game { justify-content: center; padding-bottom: 0; gap: 18px; }
.natal-wheel-wrap {
  position: relative; width: min(84vw, 360px); aspect-ratio: 1;
  touch-action: none; -webkit-tap-highlight-color: transparent;
}
.natal-wheel-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; user-select: none; }
.natal-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.natal-line-done {
  stroke: #e6c883; stroke-width: .6; stroke-linecap: round;
  filter: drop-shadow(0 0 3px #e6c883aa);
  animation: line-draw .35s ease both;
}
@keyframes line-draw { from { opacity: 0 } to { opacity: 1 } }
.natal-node {
  position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 18px; color: var(--gold-bright);
  background: #14232acc; border: 1px solid #c9a35c55;
  cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; z-index: 2;
}
.natal-node.active { transform: scale(1.22); box-shadow: 0 0 16px #e6c883cc; }
.natal-node.lit { color: #14232a; background: var(--gold-bright); box-shadow: 0 0 10px #e6c88399; }
.natal-node.zap { animation: node-zap .38s ease; }
@keyframes node-zap {
  0%, 100% { transform: translate(0, 0) scale(1.22); }
  20% { transform: translate(-2px, 1px) scale(1.3); }
  40% { transform: translate(2px, -1px) scale(1.3); }
  60% { transform: translate(-2px, -1px) scale(1.26); }
  80% { transform: translate(2px, 1px) scale(1.24); }
}

/* вспышка карты на месте пойманной колоды (3 сек) */
.card-flash {
  position: absolute; z-index: 1; border-radius: 8px;
  box-shadow: 0 0 0 1px #e6c88388, 0 10px 30px #000000aa, 0 0 34px #e6c88355;
  pointer-events: none;
  animation: card-flash 3s ease forwards;
  transform: rotate(var(--rot, 0deg));
}
@keyframes card-flash {
  0%   { transform: rotate(var(--rot)) scale(.3); opacity: 0; }
  10%  { transform: rotate(var(--rot)) scale(1.06); opacity: 1; }
  14%  { transform: rotate(var(--rot)) scale(1); }
  86%  { opacity: 1; }
  100% { transform: rotate(var(--rot)) scale(.92); opacity: 0; }
}

/* --- тосты и лоадер --- */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: #e6c883; color: #1c1409; border-radius: 999px;
  padding: 11px 20px; font-size: 14px; z-index: 60; max-width: 90%;
  text-align: center; transition: opacity .3s; font-weight: 600;
}
.loader {
  position: fixed; inset: 0; background: #14232af2; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
.loader-star { font-size: 44px; color: var(--gold-bright); animation: pulse 1.4s ease-in-out infinite; }
#loader-text { color: var(--muted); font-size: 15px; font-family: var(--serif); font-style: italic; }
@keyframes pulse { 0%,100% { transform: scale(1) rotate(0deg); opacity:.7 } 50% { transform: scale(1.25) rotate(22deg); opacity:1 } }
.hidden { display: none !important; }

/* --- таббар --- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  background: #0c161bf5; border-top: 1px solid #c9a35c40;
  display: flex; justify-content: space-around;
  padding: 8px 4px calc(10px + env(safe-area-inset-bottom));
  backdrop-filter: blur(10px);
  transition: background .5s ease;
}
body.frozen .tabbar {
  /* не отдельная картинка - полупрозрачная подложка, сквозь которую
     виден тот же fixed-фон frozen-bg.jpg, что и на всей странице,
     без шва между таббаром и остальным экраном */
  background: #05070c8c;
  border-top-color: #ffffff59;
}
.tab {
  background: transparent; border: 0; color: #5f7573; font-size: 11.5px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-family: var(--sans); cursor: pointer; padding: 4px 10px; position: relative;
}
.tab .tab-ico { font-size: 19px; display: block; position: relative; }
.tab-ico-img { width: 22px; height: 22px; object-fit: contain; display: block; margin: 0 auto; }
.tab-badge-new {
  position: absolute; top: -5px; right: -11px;
  background: #e6483c; color: #fff; font-size: 8px; font-weight: 800;
  letter-spacing: .02em; padding: 1.5px 4px; border-radius: 5px;
  line-height: 1.3; box-shadow: 0 1px 4px #00000060; pointer-events: none;
}
.tab.active { color: var(--gold-bright); }
.tab.active::before {
  content: ""; position: absolute; top: -9px; width: 28px; height: 2.5px;
  border-radius: 2px; background: var(--gold-bright);
}

/* рубашка колоды в тизере карты дня (пока не открыта) */
.cod-back-img {
  width: 84px; aspect-ratio: 2 / 3; object-fit: cover; flex: none;
  border-radius: 8px;
  box-shadow: 0 0 0 1px #c9a35c66, 0 8px 22px #00000066;
  animation: back-glow 2.4s ease-in-out infinite;
}

/* хрустальный шар вместо огня (стрик) */
.streak-inline { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; vertical-align: -5px; }
.streak-ico-img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }

/* звезда-искра (картинка вместо символа ✦) */
.star-i { width: 17px; height: 17px; object-fit: contain; vertical-align: -3px; display: inline-block; }
.balance-chip .star-i { width: 21px; height: 21px; }
.gift-i { width: 18px; height: 18px; object-fit: contain; vertical-align: -4px; display: inline-block; }
.lock-i { width: 13px; height: auto; object-fit: contain; vertical-align: -2px; display: inline-block; }
.star-stat { width: 42px; height: 42px; object-fit: contain; flex: none; }
.star-big { width: 30px; height: 30px; object-fit: contain; display: inline-block; vertical-align: -4px; }
.wheel-inline { width: 24px; height: 24px; object-fit: contain; display: inline-block; vertical-align: -4px; }
.wheel-inline-lg { width: 36px; height: 36px; vertical-align: -7px; }
