/* Оформление сайта. Палитра та же, что у мини-аппки в теме «Лунное небо»:
   человек приходит из поиска на сайт, нажимает кнопку и попадает в бота —
   и не должен почувствовать, что попал в другое место.

   Верстается от телефона: почти весь поисковый трафик по таро мобильный,
   и десктоп здесь — частный случай, который добирается медиазапросами внизу.
   Ни одного внешнего файла: ни шрифтов, ни библиотек. Страница должна
   открываться на плохом мобильном интернете быстрее, чем человек передумает. */

:root {
  --bg: #0b1224;
  --bg-deep: #05080f;
  --bg-top: #101a30;
  --panel: #131c31;
  --panel-hi: #182339;
  --line: #26314a;
  --gold: #e8d9a8;
  --gold-dim: #6b7a9c;
  --gold-wash: rgba(232, 217, 168, .07);
  --text: #eaeff9;
  --text-dim: #94a2bd;
  --text-faint: #63708a;
  --shadow: rgba(0, 0, 0, .62);
  --radius: 18px;
  --serif: Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(.22, .75, .28, 1);
  --bar: 76px;              /* высота липкой кнопки внизу */
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  /* Луна в правом верхнем углу — тот же приём, что в теме аппки: сначала
     диск, потом ореол, потом небо. Ни одной картинки. */
  background:
    radial-gradient(circle 26px at 86% 90px, #fdf8e8 0%, #f2e9cd 72%, rgba(242,233,205,0) 74%),
    radial-gradient(circle 80px at 86% 90px, rgba(232,224,190,.20) 0%, rgba(232,224,190,0) 72%),
    radial-gradient(circle 240px at 86% 90px, rgba(150,180,255,.15) 0%, rgba(150,180,255,0) 70%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 44%, var(--bg-deep) 100%);
  background-attachment: fixed;
  color: var(--text);
  font: 17px/1.62 -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(var(--bar) + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px; }

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* ---------------------------------------------------------------- шапка */

.top {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 10px;
  max-width: 680px; margin: 0 auto;
}
.top .crest {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 34% 34%, #fdf8e8, #d9cfa8 70%, #9a9070);
  box-shadow: 0 0 18px rgba(232, 217, 168, .22);
}
.top b { font: 600 17px/1 var(--serif); letter-spacing: .04em; }
.top span { color: var(--text-faint); font-size: 13px; margin-left: auto; }

/* хлебные крошки: и человеку понятно, где он, и поиск строит по ним цепочку */
.crumbs {
  font-size: 13px; color: var(--text-faint);
  padding: 2px 0 14px; display: flex; flex-wrap: wrap; gap: 6px;
}
.crumbs a { color: var(--text-dim); }
.crumbs i { font-style: normal; opacity: .5; }

/* ---------------------------------------------------------------- текст */

h1 {
  font: 400 30px/1.2 var(--serif);
  margin: 6px 0 14px;
  letter-spacing: -.01em;
}
h2 {
  font: 400 22px/1.3 var(--serif);
  margin: 34px 0 12px;
  color: var(--gold);
}
h3 { font: 600 17px/1.4 -apple-system, "Segoe UI", Roboto, sans-serif; margin: 22px 0 8px; }

p { margin: 0 0 14px; }

.lead { color: var(--text-dim); font-size: 18px; }

.muted { color: var(--text-faint); font-size: 14px; line-height: 1.55; }

/* ---------------------------------------------------------------- блоки */

.panel {
  background: linear-gradient(180deg, var(--panel-hi), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin: 18px 0;
  box-shadow: 0 10px 26px var(--shadow);
}
.panel h2, .panel h3 { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }

.block { margin: 26px 0; }
.block h2 { margin-bottom: 10px; }

/* ---------------------------------------------------------------- карта */

.hero-card {
  display: flex; gap: 16px; align-items: flex-start;
  margin: 4px 0 18px;
}
.hero-card img {
  width: 132px; flex: none;
  border-radius: 10px;
  border: 1px solid #8a7d5c;
  box-shadow: 0 12px 30px rgba(0,0,0,.6), 0 0 22px rgba(232,217,168,.10);
}
.hero-card .meta { padding-top: 2px; }
.hero-card .meta div { font-size: 14px; color: var(--text-faint); margin-bottom: 6px; }
.tag {
  display: inline-block; font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--gold-dim);
  border: 1px solid var(--line); border-radius: 99px;
  padding: 3px 10px; margin: 0 6px 6px 0;
}

/* сетка карт: на телефоне три в ряд, дальше — сколько влезет */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 10px;
  margin: 14px 0 8px;
}
.grid a { text-align: center; color: var(--text-dim); font-size: 13px; line-height: 1.3; }
.grid img {
  border-radius: 8px; border: 1px solid var(--line); margin-bottom: 6px;
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.grid a:hover { text-decoration: none; color: var(--gold); }
.grid a:hover img { transform: translateY(-3px); border-color: #8a7d5c; }

/* ---------------------------------------------------------------- кнопки */

.btn {
  display: block; width: 100%;
  padding: 15px 18px;
  border: 0; border-radius: 14px;
  background: linear-gradient(180deg, #f0e3bb, #d9c691);
  color: #241d0d;
  font: 600 17px/1 -apple-system, "Segoe UI", Roboto, sans-serif;
  text-align: center; cursor: pointer;
  box-shadow: 0 8px 22px rgba(232, 217, 168, .18);
}
.btn:hover { text-decoration: none; filter: brightness(1.04); }
.btn:active { transform: translateY(1px); }
.btn.ghost {
  background: transparent; color: var(--gold);
  border: 1px solid var(--line); box-shadow: none;
}

/* ---------------------------------------------------------------- виджет расклада */

.draw { text-align: center; }
.draw .deck {
  width: 118px; height: 202px; margin: 6px auto 14px;
  border-radius: 10px; cursor: pointer;
  border: 1px solid #8a7d5c;
  background:
    repeating-linear-gradient(45deg, rgba(232,217,168,.06) 0 6px, transparent 6px 12px),
    linear-gradient(180deg, #1b2540, #121a2e);
  box-shadow: 0 12px 30px rgba(0,0,0,.6);
  display: grid; place-items: center;
  color: var(--gold-dim); font: 300 34px/1 var(--serif);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.draw .deck:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(0,0,0,.7); }
.draw .deck.busy { animation: shuffle .5s var(--ease) infinite alternate; cursor: wait; }
@keyframes shuffle {
  from { transform: translateX(-4px) rotate(-1.5deg); }
  to   { transform: translateX(4px) rotate(1.5deg); }
}

.result { display: none; text-align: left; }
.result.on { display: block; animation: rise .45s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.result .top-row { display: flex; gap: 14px; margin-bottom: 12px; }
.result .top-row img { width: 104px; flex: none; border-radius: 9px; border: 1px solid #8a7d5c; }
.result h3 { margin: 0 0 4px; font: 400 20px/1.25 var(--serif); color: var(--gold); }
.result .pos { font-size: 13px; color: var(--text-faint); margin-bottom: 8px; }
.result .rev { color: #d99a8a; }
.result p { font-size: 16px; }

.picker { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.picker button {
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 99px;
  padding: 7px 14px; font-size: 14px; cursor: pointer;
}
.picker button.on { color: #241d0d; background: var(--gold); border-color: var(--gold); }

.qfield {
  width: 100%; padding: 12px 14px; margin-bottom: 12px;
  background: rgba(4,7,14,.66); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  font: 16px/1.4 inherit; resize: none;
}
.qfield::placeholder { color: var(--text-faint); }

/* ---------------------------------------------------------------- сочетания и FAQ */

.combo {
  border-top: 1px solid var(--line);
  padding: 14px 0 2px;
  display: flex; gap: 12px;
}
.combo img { width: 52px; flex: none; border-radius: 6px; border: 1px solid var(--line); }
.combo b { display: block; font-weight: 600; margin-bottom: 3px; }
.combo p { font-size: 15px; color: var(--text-dim); margin: 0; }

details {
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
}
details summary {
  cursor: pointer; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; gap: 12px;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; color: var(--gold-dim); font-size: 20px; line-height: 1; }
details[open] summary::after { content: "–"; }
details p { margin: 10px 0 0; color: var(--text-dim); font-size: 16px; }

/* ---------------------------------------------------------------- ссылки-списки */

.links { list-style: none; padding: 0; margin: 12px 0; }
.links li { border-bottom: 1px solid var(--line); }
.links a {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 13px 2px; color: var(--text);
}
.links a:hover { text-decoration: none; color: var(--gold); }
.links small { color: var(--text-faint); font-size: 13px; text-align: right; flex: none; max-width: 46%; }

/* ---------------------------------------------------------------- призыв в бота */

.cta {
  background: linear-gradient(180deg, rgba(232,217,168,.10), rgba(232,217,168,.03));
  border: 1px solid rgba(232, 217, 168, .28);
  border-radius: var(--radius);
  padding: 20px 16px;
  margin: 28px 0;
  text-align: center;
}
.cta h2 { margin: 0 0 8px; color: var(--gold); font-size: 21px; }
.cta p { color: var(--text-dim); font-size: 16px; }
.cta .btn { margin-top: 14px; }
.cta .fine { font-size: 13px; color: var(--text-faint); margin: 10px 0 0; }

/* липкая кнопка снизу — единственный элемент, который виден всегда */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(5,8,15,.72), rgba(5,8,15,.96));
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  transform: translateY(140%);
  transition: transform .35s var(--ease);
}
.bar.on { transform: none; }
.bar .inner { max-width: 680px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.bar .txt { font-size: 14px; color: var(--text-dim); line-height: 1.35; }
.bar .btn { width: auto; flex: none; padding: 13px 20px; font-size: 16px; }

/* ---------------------------------------------------------------- уведомления */

.toasts {
  position: fixed; left: 12px; bottom: calc(var(--bar) + 14px + env(safe-area-inset-bottom));
  z-index: 30; display: flex; flex-direction: column; gap: 8px;
  max-width: min(330px, calc(100vw - 24px));
  pointer-events: none;
}
.toast {
  background: rgba(19, 28, 49, .93);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 11px 14px;
  font-size: 14px; line-height: 1.4; color: var(--text-dim);
  box-shadow: 0 10px 26px var(--shadow);
  backdrop-filter: blur(10px);
  animation: toast-in .4s var(--ease) both;
}
.toast b { color: var(--text); font-weight: 600; }
.toast.out { animation: toast-out .35s var(--ease) both; }
@keyframes toast-in  { from { opacity: 0; transform: translateX(-16px) scale(.96); } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(8px) scale(.96); } }

/* ---------------------------------------------------------------- модалка */

.veil {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(3, 6, 12, .72);
  backdrop-filter: blur(6px);
  display: none; align-items: flex-end; justify-content: center;
  padding: 16px;
}
.veil.on { display: flex; animation: fade .25s var(--ease) both; }
@keyframes fade { from { opacity: 0; } }

.sheet {
  background: linear-gradient(180deg, var(--panel-hi), var(--panel));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
  width: 100%; max-width: 460px;
  box-shadow: 0 -12px 40px var(--shadow);
  animation: sheet-up .38s var(--ease) both;
  text-align: center;
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
.sheet h3 { font: 400 22px/1.3 var(--serif); color: var(--gold); margin: 0 0 10px; }
.sheet p { color: var(--text-dim); font-size: 16px; }
.sheet .btn { margin-top: 6px; }
.sheet .close {
  background: none; border: 0; color: var(--text-faint);
  font-size: 15px; margin-top: 12px; cursor: pointer; padding: 6px;
}

/* ---------------------------------------------------------------- подвал */

.foot {
  border-top: 1px solid var(--line);
  margin-top: 40px; padding: 20px 0 28px;
  color: var(--text-faint); font-size: 13px; line-height: 1.6;
}
.foot a { color: var(--text-dim); }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 14px; }

/* ---------------------------------------------------------------- экраны пошире */

@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  h1 { font-size: 36px; }
  .hero-card img { width: 170px; }
}

@media (min-width: 820px) {
  body { font-size: 18px; }
  .grid { grid-template-columns: repeat(6, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
