/*
 * Таро онлайн — стили. Все правила ограничены контейнером .tarot-app,
 * чтобы не конфликтовать со стилями шаблона Joomla.
 */

.tarot-app {
  --tr-bg: #0a090d;
  --tr-bg-2: #120d1c;
  --tr-violet: #1d1430;
  --tr-graphite: #17151c;
  --tr-surface: rgba(24, 20, 32, .72);
  --tr-surface-2: rgba(32, 26, 44, .8);
  --tr-gold: #c9a961;
  --tr-gold-hi: #e6cf94;
  --tr-gold-lo: #8e7136;
  --tr-line: rgba(201, 169, 97, .28);
  --tr-line-soft: rgba(201, 169, 97, .14);
  --tr-text: #ece6d9;
  --tr-muted: #a39cae;
  --tr-focus: #f0d999;
  --tr-radius: 14px;
  --tr-serif: 'Cormorant Garamond', 'Cormorant', Georgia, 'Times New Roman', serif;
  --tr-sans: 'Manrope', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  --tr-ratio: 300 / 527;
  --tr-ease: cubic-bezier(.22, .7, .2, 1);

  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--tr-text);
  font-family: var(--tr-sans);
  font-size: 16px;
  line-height: 1.65;
  background:
    radial-gradient(900px 520px at 50% -6%, rgba(201, 169, 97, .10), transparent 60%),
    radial-gradient(1200px 700px at 50% 0%, rgba(70, 48, 110, .30), transparent 65%),
    radial-gradient(900px 700px at 100% 60%, rgba(40, 28, 70, .30), transparent 60%),
    linear-gradient(180deg, var(--tr-bg) 0%, #0f0c16 45%, var(--tr-bg) 100%);
  padding: clamp(28px, 6vw, 72px) clamp(16px, 4vw, 40px) clamp(40px, 6vw, 80px);
  -webkit-font-smoothing: antialiased;
}
.tarot-app *, .tarot-app *::before, .tarot-app *::after { box-sizing: border-box; }
.tarot-app [hidden] { display: none !important; }
.tarot-app img { max-width: 100%; display: block; }
.tarot-app button, .tarot-app input { font: inherit; color: inherit; }
.tarot-page { margin: 0; background: #0a090d; }

/* Звёздное небо: лёгкий фон без тяжёлых изображений */
.tr-sky {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .55;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 12%, #fff6 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 34% 42%, #e6cf9480 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 48%, #fff5 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 22% 72%, #e6cf9466 50%, transparent 51%),
    radial-gradient(1px 1px at 64% 82%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 26%, #fff4 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 6% 92%, #fff4 50%, transparent 51%);
  background-size: 420px 420px;
}

/* ---------- Типографика ---------- */
.tr-hero { text-align: center; max-width: 820px; margin: 0 auto clamp(28px, 5vw, 48px); }
.tr-hero__emblem { width: 240px; height: 120px; max-width: 80%; color: var(--tr-gold); margin: 0 auto 10px; display: block; filter: drop-shadow(0 0 14px rgba(230, 200, 130, .35)); }
.tr-hero__title {
  font-family: var(--tr-serif); font-weight: 600; letter-spacing: .01em;
  font-size: clamp(34px, 6vw, 62px); line-height: 1.08; margin: 0 0 16px;
  background: linear-gradient(180deg, #f3e3b6 0%, var(--tr-gold) 70%, #a88848 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tr-hero__lead { color: var(--tr-muted); font-size: clamp(16px, 2.2vw, 19px); margin: 0 auto !important; max-width: 640px; text-align: center; text-wrap: balance; }

.tr-h2 {
  font-family: var(--tr-serif); font-weight: 600; color: var(--tr-gold-hi);
  font-size: clamp(26px, 3.6vw, 36px); line-height: 1.15; margin: 0 0 18px; letter-spacing: .01em;
}
.tr-h3 { font-family: var(--tr-serif); font-weight: 600; color: var(--tr-gold-hi); font-size: clamp(21px, 2.6vw, 25px); line-height: 1.2; margin: 22px 0 8px; }
.tr-muted { color: var(--tr-muted); font-weight: 400; }
.tr-hint { color: var(--tr-muted); font-size: 13.5px; margin: 8px 0 0; }
:where(.tarot-app) p { margin: 0 0 12px; }

/* ---------- Панели ---------- */
.tr-panel {
  position: relative; max-width: 1080px; margin: 0 auto clamp(24px, 4vw, 40px);
  padding: clamp(22px, 4vw, 44px);
  background: linear-gradient(180deg, rgba(28, 22, 40, .66), rgba(16, 13, 22, .7));
  border: 1px solid var(--tr-line-soft); border-radius: var(--tr-radius);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .03);
}
.tr-panel::before {
  content: ''; position: absolute; inset: 7px; border: 1px solid var(--tr-line-soft);
  border-radius: calc(var(--tr-radius) - 5px); pointer-events: none;
}
.tr-panel > * { position: relative; }
.tr-setup .tr-h2, .tr-table__head { text-align: center; }

/* ---------- Форма ---------- */
.tr-fieldset { border: 0; padding: 0; margin: 0 0 28px; min-width: 0; }
.tr-legend { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; letter-spacing: .04em; margin-bottom: 14px; padding: 0; }
.tr-step {
  font-family: var(--tr-serif); color: var(--tr-gold); font-size: 18px; width: 30px; height: 30px; flex: none;
  display: inline-grid; place-items: center; border: 1px solid var(--tr-line); border-radius: 50%;
}

.tr-spreads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tr-option { position: relative; display: block; cursor: pointer; }
.tr-option input, .tr-chip input, .tr-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tr-option__box {
  display: grid; gap: 6px; height: 100%; padding: 22px 22px 20px; border-radius: 12px;
  border: 1px solid var(--tr-line-soft); background: rgba(10, 9, 14, .45);
  transition: border-color .25s, background .25s, box-shadow .25s, transform .25s var(--tr-ease);
}
.tr-option:hover .tr-option__box { border-color: var(--tr-line); transform: translateY(-2px); }
.tr-option input:checked + .tr-option__box {
  border-color: var(--tr-gold); background: linear-gradient(180deg, rgba(201, 169, 97, .1), rgba(10, 9, 14, .4));
  box-shadow: 0 0 0 1px rgba(201, 169, 97, .25), 0 12px 40px -18px rgba(201, 169, 97, .45);
}
.tr-option input:focus-visible + .tr-option__box { outline: 2px solid var(--tr-focus); outline-offset: 3px; }
.tr-option__title { font-family: var(--tr-serif); font-size: 25px; font-weight: 600; color: var(--tr-gold-hi); line-height: 1.1; }
.tr-option__text { color: var(--tr-muted); font-size: 14.5px; }
.tr-option__icon { display: flex; gap: 6px; height: 46px; margin-bottom: 6px; }
.tr-option__icon i {
  display: block; width: 26px; height: 46px; border-radius: 4px; border: 1px solid var(--tr-gold);
  background: url("../../common/images/card-back.svg") center / cover;
}
.tr-option__icon--three i:nth-child(1) { transform: rotate(-8deg) translateY(3px); }
.tr-option__icon--three i:nth-child(3) { transform: rotate(8deg) translateY(3px); }

.tr-topics { display: flex; flex-wrap: wrap; gap: 10px; }
.tr-chip { position: relative; cursor: pointer; }
.tr-chip span {
  display: inline-flex; align-items: center; gap: 9px; min-height: 46px; padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--tr-line-soft); background: rgba(10, 9, 14, .45); font-size: 15px;
  transition: border-color .2s, background .2s, color .2s;
}
.tr-chip b { color: var(--tr-gold); font-weight: 400; }
.tr-chip:hover span { border-color: var(--tr-line); }
.tr-chip input:checked + span { border-color: var(--tr-gold); background: rgba(201, 169, 97, .12); color: var(--tr-gold-hi); }
.tr-chip input:focus-visible + span { outline: 2px solid var(--tr-focus); outline-offset: 3px; }

.tr-input {
  width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 10px;
  border: 1px solid var(--tr-line-soft); background: rgba(8, 7, 12, .65); color: var(--tr-text);
  transition: border-color .2s, box-shadow .2s;
}
.tr-input::placeholder { color: #756f80; }
.tr-input:focus { outline: none; border-color: var(--tr-gold); box-shadow: 0 0 0 3px rgba(201, 169, 97, .2); }

.tr-setup__footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--tr-line-soft); padding-top: 24px; }
.tr-switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 15px; color: var(--tr-muted); }
.tr-switch__track { position: relative; width: 44px; height: 24px; border-radius: 999px; border: 1px solid var(--tr-line); background: rgba(10, 9, 14, .6); transition: background .2s; flex: none; }
.tr-switch__track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--tr-muted); transition: transform .25s var(--tr-ease), background .2s; }
.tr-switch input:checked + .tr-switch__track { background: rgba(201, 169, 97, .25); }
.tr-switch input:checked + .tr-switch__track::after { transform: translateX(20px); background: var(--tr-gold-hi); }
.tr-switch input:focus-visible + .tr-switch__track { outline: 2px solid var(--tr-focus); outline-offset: 3px; }

/* ---------- Кнопки ---------- */
.tr-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 11px 22px; border-radius: 999px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--tr-line); background: rgba(10, 9, 14, .5); color: var(--tr-text) !important;
  font-weight: 600; font-size: 15px; letter-spacing: .02em; line-height: 1.2;
  transition: border-color .2s, background .2s, box-shadow .25s, transform .2s var(--tr-ease), opacity .2s;
}
.tr-btn:hover { border-color: var(--tr-gold); background: rgba(201, 169, 97, .08); }
.tr-btn:active { transform: translateY(1px); }
.tr-btn:disabled { opacity: .45; cursor: not-allowed; }
.tr-btn--primary {
  color: #1a1408 !important; border-color: transparent;
  background: linear-gradient(180deg, #ecd79f 0%, #c9a961 55%, #a98a48 100%);
  box-shadow: 0 10px 30px -12px rgba(201, 169, 97, .6), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.tr-btn--primary:hover { background: linear-gradient(180deg, #f3e2b2 0%, #d4b56d 55%, #b39350 100%); box-shadow: 0 14px 36px -12px rgba(201, 169, 97, .75), inset 0 1px 0 rgba(255, 255, 255, .5); }
.tr-btn--ghost { border-color: transparent; background: transparent; color: var(--tr-muted) !important; font-weight: 500; }
.tr-btn--ghost:hover { color: var(--tr-text) !important; background: transparent; border-color: var(--tr-line-soft); }
.tr-btn--lg { min-height: 54px; padding: 14px 34px; font-size: 16px; }

.tarot-app :focus-visible { outline: 2px solid var(--tr-focus); outline-offset: 3px; }
.tarot-app .tr-btn:focus-visible { outline-offset: 4px; }

/* ---------- Стол ---------- */
.tr-table__meta { color: var(--tr-muted); margin-top: -8px; font-size: 14.5px; }
.tr-status { text-align: center; color: var(--tr-gold-hi); font-family: var(--tr-serif); font-size: clamp(19px, 2.4vw, 23px); min-height: 1.5em; margin: 10px 0 18px !important; }

.tr-slots { display: flex; justify-content: center; gap: clamp(12px, 3vw, 40px); margin: 0 auto 22px; }
.tr-slot { display: flex; flex-direction: column; align-items: center; gap: 10px; width: var(--slot-w); }
.tr-slots[data-spread="1"] { --slot-w: clamp(140px, 38vw, 230px); }
.tr-slots[data-spread="3"] { --slot-w: clamp(94px, 27vw, 190px); }
.tr-slot__label { font-family: var(--tr-serif); color: var(--tr-gold); font-size: clamp(15px, 2vw, 19px); letter-spacing: .03em; text-align: center; line-height: 1.2; }
.tr-slot__place {
  position: relative; width: 100%; aspect-ratio: var(--tr-ratio); border-radius: 10px;
  border: 1px dashed var(--tr-line); background: rgba(201, 169, 97, .03);
  display: grid; place-items: center;
}
.tr-slot__place::after { content: '✦'; color: var(--tr-line); font-size: 20px; }
.tr-slot__place.is-filled { border-color: transparent; background: none; }
.tr-slot__place.is-filled::after { display: none; }
.tr-slot__name { text-align: center; font-size: 14px; line-height: 1.35; min-height: 2.7em; color: var(--tr-text); }
.tr-slot__name small { display: block; color: var(--tr-muted); font-size: 12.5px; }

/* Карта с 3D-переворотом */
.tr-card { position: absolute; inset: 0; perspective: 1400px; border: 0; padding: 0; background: none; cursor: default; border-radius: 10px; }
button.tr-card { cursor: pointer; }
.tr-card__inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 1s var(--tr-ease); border-radius: inherit; }
.tr-card.is-flipped .tr-card__inner { transform: rotateY(180deg); }
.tr-card__face {
  position: absolute; inset: 0; border-radius: inherit; overflow: hidden;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .9), 0 0 0 1px rgba(201, 169, 97, .35);
}
.tr-card__back { background: #0a0e22 url("../../common/images/card-back.svg") center / cover; }
.tr-card__front { transform: rotateY(180deg); background: #f3ead2; }
.tr-card__front img { width: 100%; height: 100%; object-fit: cover; }
.tr-card.is-reversed .tr-card__front img { transform: rotate(180deg); }
.tr-card.is-flipped .tr-card__front { box-shadow: 0 20px 50px -18px rgba(0, 0, 0, .9), 0 0 0 1px rgba(201, 169, 97, .6), 0 0 38px -6px rgba(201, 169, 97, .45); }
button.tr-card:hover .tr-card__front { box-shadow: 0 20px 50px -18px rgba(0, 0, 0, .9), 0 0 0 2px var(--tr-gold), 0 0 44px -4px rgba(201, 169, 97, .6); }

/* Колода (перемешивание) */
.tr-stage { position: relative; min-height: 220px; display: grid; place-items: center; }
.tr-deck { position: relative; width: 120px; aspect-ratio: var(--tr-ratio); margin: 10px auto 20px; }
.tr-deck__card {
  position: absolute; inset: 0; border-radius: 9px;
  background: #0a0e22 url("../../common/images/card-back.svg") center / cover;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .6), 0 0 0 1px rgba(201, 169, 97, .3);
}
.tr-deck::after { content: ''; position: absolute; inset: -30%; z-index: -1; background: radial-gradient(closest-side, rgba(201, 169, 97, .2), transparent); }

/* Лента / веер карт */
.tr-fan-wrap {
  width: 100%; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: var(--tr-gold-lo) transparent; padding: 34px 0 8px;
  mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}
.tr-fan { position: relative; height: var(--fan-h, 200px); margin: 0 auto; }
.tr-fan__card {
  filter: brightness(var(--dim, 1));
  position: absolute; top: 0; left: 0; width: var(--fan-w, 78px); aspect-ratio: var(--tr-ratio);
  padding: 0; border: 0; border-radius: 7px; cursor: pointer;
  background: #0a0e22 url("../../common/images/card-back.svg") center / cover;
  box-shadow: -3px 0 10px -4px rgba(0, 0, 0, .8), 0 0 0 1px rgba(201, 169, 97, .32);
  transform-origin: 50% 100%;
  transform: translate(var(--x), var(--y)) rotate(var(--rot));
  transition: transform .45s var(--tr-ease), box-shadow .25s, opacity .4s;
}
.tr-fan__card:hover, .tr-fan__card:focus-visible {
  transform: translate(var(--x), calc(var(--y) - 22px)) rotate(var(--rot));
  box-shadow: 0 10px 26px -8px rgba(0, 0, 0, .9), 0 0 0 1.5px var(--tr-gold), 0 0 26px -2px rgba(201, 169, 97, .55);
  z-index: 200 !important; outline: none;
}
.tr-fan__card.is-taken { opacity: 0; pointer-events: none; }
.tr-fan.is-dealing .tr-fan__card { transform: translate(var(--cx), 20px) rotate(0deg); opacity: 0; }
.tr-fan.is-done .tr-fan__card { pointer-events: none; }
.tr-fan-hint { text-align: center; color: var(--tr-muted); font-size: 13.5px; margin: 8px 0 0 !important; }
.tr-fly { position: fixed; z-index: 1000; pointer-events: none; border-radius: 8px; background: #0a0e22 url("../../common/images/card-back.svg") center / cover; box-shadow: 0 20px 50px -10px rgba(0, 0, 0, .9), 0 0 0 1px var(--tr-gold); transition: transform .65s var(--tr-ease); transform-origin: 0 0; }

.tr-table__actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- Результат ---------- */
.tr-result { animation: tr-rise .8s var(--tr-ease) both; }
.tr-result > .tr-h2 { text-align: center; }
.tr-result > .tr-h2:focus { outline: none; }
.tr-result__question { text-align: center; color: var(--tr-muted); font-style: italic; font-family: var(--tr-serif); font-size: 20px; margin-top: -6px !important; }
.tr-notice { text-align: center; font-size: 14px; color: var(--tr-gold-hi); border: 1px solid var(--tr-line); border-radius: 999px; padding: 8px 18px; margin: 0 auto 18px; width: fit-content; max-width: 100%; background: rgba(201, 169, 97, .06); }

.tr-readings { display: grid; gap: 22px; margin: 26px 0; }
.tr-reading {
  display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: clamp(18px, 3vw, 32px); align-items: start;
  padding: clamp(18px, 3vw, 28px); border-radius: 12px; border: 1px solid var(--tr-line-soft); background: rgba(8, 7, 12, .42);
  animation: tr-rise .7s var(--tr-ease) both;
}
.tr-reading:nth-child(2) { animation-delay: .12s; }
.tr-reading:nth-child(3) { animation-delay: .24s; }
.tr-readings[data-spread="1"] .tr-reading { grid-template-columns: minmax(200px, 280px) minmax(0, 1fr); }
.tr-reading__img { position: relative; border: 0; padding: 0; background: none; cursor: zoom-in; border-radius: 10px; }
.tr-reading__img img { width: 100%; aspect-ratio: var(--tr-ratio); object-fit: cover; border-radius: 10px; box-shadow: 0 18px 40px -18px #000, 0 0 0 1px rgba(201, 169, 97, .55); }
.tr-reading__img.is-reversed img { transform: rotate(180deg); }
.tr-pos { font-size: 12.5px; text-transform: uppercase; letter-spacing: .16em; color: var(--tr-gold); margin: 0 0 4px !important; }
.tr-reading__title { font-family: var(--tr-serif); font-size: clamp(26px, 3.4vw, 34px); font-weight: 600; color: var(--tr-gold-hi); margin: 0 0 4px; line-height: 1.1; }
.tr-reading__meta { color: var(--tr-muted); font-size: 14px; }
.tr-badge { display: inline-block; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--tr-line); color: var(--tr-gold-hi); margin-left: 6px; vertical-align: 1px; white-space: nowrap; }
.tr-badge--rev { border-color: rgba(170, 140, 220, .45); color: #cdb8f0; }
.tr-kw { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 14px; padding: 0; list-style: none; }
.tr-kw li { font-size: 13px; padding: 4px 11px; border-radius: 999px; background: rgba(201, 169, 97, .09); color: var(--tr-gold-hi); }
.tr-block-title { font-weight: 600; color: var(--tr-text); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; margin: 16px 0 4px !important; opacity: .8; }
.tr-frame { color: var(--tr-gold-hi); font-family: var(--tr-serif); font-size: 19px; line-height: 1.4; }
.tr-advice { margin-top: 16px !important; padding: 12px 16px; border-left: 2px solid var(--tr-gold); background: rgba(201, 169, 97, .06); border-radius: 0 8px 8px 0; font-family: var(--tr-serif); font-size: 19px; font-style: italic; }
.tr-link { background: none; border: 0; padding: 0; margin-top: 12px; color: var(--tr-gold); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 14.5px; }
.tr-link:hover { color: var(--tr-gold-hi); }

.tr-summary { padding: clamp(20px, 3.4vw, 34px); border-radius: 12px; border: 1px solid var(--tr-line); background: linear-gradient(180deg, rgba(201, 169, 97, .07), rgba(8, 7, 12, .3)); }
.tr-summary .tr-h3 { margin-top: 0; text-align: center; font-size: clamp(25px, 3vw, 30px); }
.tr-summary .tr-h3::after { content: ''; display: block; width: 80px; height: 1px; margin: 12px auto 4px; background: linear-gradient(90deg, transparent, var(--tr-gold), transparent); }
#tr-summary-body p { font-size: 16.5px; }
.tr-disclaimer { font-size: 13px; color: var(--tr-muted); margin: 18px 0 0 !important; padding-top: 14px; border-top: 1px solid var(--tr-line-soft); }

.tr-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 26px 0 8px; }
.tr-share { max-width: 620px; margin: 10px auto 0; }
.tr-share__row { display: flex; gap: 8px; margin-top: 6px; }

.tr-consult {
  text-align: center; margin: 34px auto 0; max-width: 760px; padding: clamp(24px, 4vw, 40px);
  border-radius: 14px; border: 1px solid var(--tr-line);
  background: radial-gradient(600px 220px at 50% 0, rgba(201, 169, 97, .12), transparent 70%), rgba(10, 9, 14, .5);
}
.tr-consult__ornament { color: var(--tr-gold); font-size: 20px; letter-spacing: .6em; }
.tr-consult .tr-h3 { margin-top: 6px; font-size: clamp(24px, 3.2vw, 32px); }
.tr-consult p { color: var(--tr-muted); max-width: 560px; margin: 0 auto 22px; }

/* ---------- Информационный блок ---------- */
.tr-info__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 48px); margin-bottom: 18px; }
.tr-info p { color: #cfc8d8; }
.tr-info .tr-h3 { margin-top: 4px; }
.tr-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.tr-steps li { counter-increment: s; position: relative; padding: 0 0 14px 44px; color: #cfc8d8; }
.tr-steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--tr-line); border-radius: 50%; font-family: var(--tr-serif); color: var(--tr-gold); font-size: 17px; }
.tr-steps b { color: var(--tr-text); }

/* ---------- Модальное окно ---------- */
.tr-modal {
  width: min(900px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border-radius: 16px;
  border: 1px solid var(--tr-line); background: #110e17; color: var(--tr-text); font-family: var(--tr-sans);
  box-shadow: 0 40px 120px -20px #000;
}
.tr-modal::backdrop { background: rgba(5, 4, 8, .78); backdrop-filter: blur(3px); }
.tr-modal[open] { animation: tr-rise .4s var(--tr-ease); }
.tr-modal__inner { position: relative; padding: clamp(20px, 4vw, 36px); }
.tr-modal__close { position: sticky; top: 0; float: right; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--tr-line); background: #110e17; color: var(--tr-gold-hi); font-size: 26px; line-height: 1; cursor: pointer; z-index: 2; }
.tr-modal__close:hover { border-color: var(--tr-gold); }
.tr-detail { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; }
.tr-detail__img img { border-radius: 10px; box-shadow: 0 0 0 1px rgba(201, 169, 97, .5); width: 100%; }
.tr-detail__img.is-reversed img { transform: rotate(180deg); }
.tr-detail h3 { font-family: var(--tr-serif); font-size: 34px; color: var(--tr-gold-hi); margin: 0 0 4px; line-height: 1.1; padding-right: 50px; }
.tr-detail h4 { font-family: var(--tr-serif); font-size: 21px; color: var(--tr-gold); margin: 18px 0 6px; }
.tr-detail p { margin: 0 0 8px; }
.tr-detail__topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
.tr-detail__topic { padding: 14px; border-radius: 10px; border: 1px solid var(--tr-line-soft); background: rgba(255, 255, 255, .02); font-size: 14.5px; }
.tr-detail__topic h5 { margin: 0 0 6px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--tr-gold-hi); }
.tr-detail__topic p { margin: 0 0 6px; }
.tr-detail__topic em { color: var(--tr-muted); font-style: normal; font-size: 12.5px; display: block; }
.tr-detail .is-current { color: var(--tr-gold-hi); }

.tr-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1100; padding: 12px 20px; border-radius: 999px; background: #1d1729; border: 1px solid var(--tr-gold); color: var(--tr-gold-hi); font-size: 14.5px; box-shadow: 0 20px 50px -10px #000; max-width: calc(100vw - 32px); text-align: center; }

@keyframes tr-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- Адаптив ---------- */
@media (max-width: 760px) {
  .tr-spreads { grid-template-columns: 1fr; gap: 10px; }
  .tr-option__box { grid-template-columns: 56px 1fr; grid-template-rows: auto auto; column-gap: 14px; padding: 16px; }
  .tr-option__icon { grid-row: span 2; margin: 0; align-self: center; }
  .tr-option--spread .tr-option__icon i { width: 20px; height: 36px; }
  .tr-option__icon { height: 40px; gap: 3px; }
  .tr-option__title { font-size: 22px; }
  .tr-chip { flex: 1 1 calc(50% - 10px); }
  .tr-chip span { width: 100%; font-size: 14px; padding: 10px 12px; }
  .tr-setup__footer { flex-direction: column; align-items: stretch; }
  .tr-setup__footer .tr-btn { width: 100%; }
  .tr-reading, .tr-readings[data-spread="1"] .tr-reading { grid-template-columns: 1fr; }
  .tr-reading__img { width: min(200px, 60%); margin: 0 auto; }
  .tr-readings[data-spread="1"] .tr-reading__img { width: min(250px, 72%); }
  .tr-reading__body { text-align: left; }
  .tr-info__grid { grid-template-columns: 1fr; }
  .tr-detail { grid-template-columns: 1fr; }
  .tr-detail__img { width: min(200px, 60%); margin: 0 auto; }
  .tr-detail__topics { grid-template-columns: 1fr; }
  .tr-actions .tr-btn { flex: 1 1 calc(50% - 10px); padding-left: 12px; padding-right: 12px; }
  .tr-actions .tr-btn--primary { flex-basis: 100%; }
  .tr-slot__name { font-size: 12.5px; }
}
@media (max-width: 420px) {
  .tr-chip { flex-basis: 100%; }
  .tr-share__row { flex-direction: column; }
}

/* ---------- Уменьшение движения ---------- */
@media (prefers-reduced-motion: reduce) {
  .tarot-app *, .tarot-app *::before, .tarot-app *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}

/* ---------- Печать ---------- */
@media print {
  @page { margin: 14mm; }
  body.tarot-page, .tarot-page { background: #fff !important; }
  .tarot-app { background: #fff !important; color: #111 !important; padding: 0 !important; overflow: visible; }
  .tarot-app .tr-sky, .tarot-app .tr-setup, .tarot-app .tr-info, .tarot-app .tr-actions, .tarot-app .tr-share,
  .tarot-app .tr-consult, .tarot-app .tr-table__actions, .tarot-app .tr-stage, .tarot-app .tr-status,
  .tarot-app .tr-notice, .tarot-app .tr-link, .tarot-app .tr-hero__emblem, .tarot-app .tr-modal, .tarot-app .tr-toast { display: none !important; }
  .tarot-app .tr-panel { border: 0; box-shadow: none; background: none; padding: 0; margin: 0 0 12px; }
  .tarot-app .tr-panel::before { display: none; }
  .tarot-app .tr-hero { margin-bottom: 10px; }
  .tarot-app .tr-hero__title { color: #222 !important; background: none; -webkit-text-fill-color: #222; font-size: 26pt; }
  .tarot-app .tr-hero__lead { display: none; }
  .tarot-app .tr-h2, .tarot-app .tr-h3, .tarot-app .tr-reading__title, .tarot-app .tr-slot__label, .tarot-app .tr-frame, .tarot-app .tr-pos { color: #5a4413 !important; }
  .tarot-app p, .tarot-app li, .tarot-app .tr-slot__name, .tarot-app .tr-reading__meta, .tarot-app .tr-muted { color: #222 !important; }
  .tarot-app .tr-table { display: block !important; }
  .tarot-app .tr-slots { display: none; }
  .tarot-app .tr-reading, .tarot-app .tr-summary { background: none; border: 1px solid #ccc; break-inside: avoid; animation: none; }
  .tarot-app .tr-reading { grid-template-columns: 34mm 1fr !important; }
  .tarot-app .tr-reading__img { width: 34mm !important; }
  .tarot-app .tr-kw li, .tarot-app .tr-badge { background: none; border: 1px solid #bbb; color: #333 !important; }
  .tarot-app .tr-advice { background: none; }
  .tarot-app .tr-result { animation: none; }
}

/* Выравнивание подписей слотов, если «Возможное развитие» переносится на две строки */
.tr-slots[data-spread="3"] .tr-slot__label { min-height: 2.4em; display: flex; align-items: flex-end; justify-content: center; }

/* ---------- Улучшения оформления (по референсам) ---------- */
.tr-geo { position: absolute; z-index: -1; color: var(--tr-gold); opacity: .09; pointer-events: none; width: min(560px, 80vw); height: auto; }
.tr-geo--tr { top: -140px; right: -160px; }
.tr-geo--bl { bottom: -160px; left: -180px; width: min(520px, 75vw); }

.tr-panel { background: linear-gradient(180deg, rgba(30, 28, 34, .78), rgba(18, 16, 22, .82)); border-color: rgba(201, 169, 97, .2); border-radius: 22px; }
.tr-panel::before { border-radius: 16px; }

.tr-h2--caps { text-transform: uppercase; letter-spacing: .16em; font-weight: 500;
  background: linear-gradient(180deg, #f6e6bb, #c9a961 70%, #9c7c3e); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* лучи за картами */
.tr-slots { position: relative; padding: 18px 0 6px; }
.tr-slots::before {
  content: ''; position: absolute; left: 50%; top: 50%; width: min(900px, 140%); aspect-ratio: 1; transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 0deg, rgba(225, 195, 125, .22) 0 .35deg, transparent .35deg 5deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 18%, rgba(0, 0, 0, .55) 42%, transparent 72%);
  mask-image: radial-gradient(closest-side, #000 18%, rgba(0, 0, 0, .55) 42%, transparent 72%);
  pointer-events: none; z-index: 0;
}
.tr-slot { position: relative; z-index: 1; }
.tr-slot__place { border-color: rgba(201, 169, 97, .32); background: rgba(14, 12, 20, .55); }
.tr-card.is-flipped .tr-card__front { animation: tr-glow 1.6s var(--tr-ease) both; }
@keyframes tr-glow { 0% { box-shadow: 0 0 0 1px rgba(201,169,97,.6), 0 0 0 0 rgba(240,210,140,0); } 40% { box-shadow: 0 0 0 1px rgba(201,169,97,.9), 0 0 70px 6px rgba(240,210,140,.55); } 100% { box-shadow: 0 20px 50px -18px rgba(0,0,0,.9), 0 0 0 1px rgba(201,169,97,.6), 0 0 38px -6px rgba(201,169,97,.45); } }

.tr-deck { width: 150px; }
.tr-deck::after { inset: -60%; background: radial-gradient(closest-side, rgba(225, 195, 125, .25), transparent); }
.tr-fan__card { box-shadow: -4px 0 12px -5px rgba(0, 0, 0, .9), 0 0 0 1px rgba(201, 169, 97, .45); border-radius: 8px; }
.tr-fan__card:hover, .tr-fan__card:focus-visible { filter: brightness(1.12); }

.tr-actions--top { position: relative; z-index: 1; margin: 26px 0 0; }
.tr-status:empty { display: none; }
.tr-reading { background: rgba(10, 9, 14, .5); border-color: rgba(201, 169, 97, .16); border-radius: 16px; }
.tr-summary { border-radius: 16px; }
.tr-consult { border-radius: 18px; position: relative; overflow: hidden; }
.tr-consult::before { content: ''; position: absolute; left: 50%; top: 0; width: 700px; aspect-ratio: 1; transform: translate(-50%, -55%);
  background: repeating-conic-gradient(rgba(225, 195, 125, .16) 0 .3deg, transparent .3deg 6deg);
  -webkit-mask-image: radial-gradient(closest-side, #000, transparent 75%); mask-image: radial-gradient(closest-side, #000, transparent 75%); pointer-events: none; }
.tr-consult > * { position: relative; }
.tr-option__icon i { width: 28px; height: 49px; box-shadow: 0 6px 14px -6px #000; }

@media (max-width: 760px) {
  .tr-actions--top .tr-btn { flex: 1 1 calc(50% - 10px); }
  .tr-geo { opacity: .07; }
  .tr-hero__emblem { width: 200px; height: 100px; }
}
@media print { .tarot-app .tr-geo, .tarot-app .tr-actions--top { display: none !important; } }

