:root {
  --bg-0: #04071a;
  --bg-1: #070d2b;
  --bg-2: #0b1440;
  --panel: rgba(10, 18, 52, 0.72);
  --panel-solid: #0a1234;
  --line: rgba(146, 164, 232, 0.22);
  --ink: #e6eafb;
  --ink-dim: #a4adda;
  --ink-faint: #7c86bb;
  --gold: #d9b45b;
  --gold-bright: #f4dda4;
  --violet: #8c7bff;
  --rose: #ff8fb1;
  --radius: 18px;
  --card-ratio: 350 / 600;
  --card-w: clamp(140px, 19vw, 205px);
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Philosopher', 'Trebuchet MS', sans-serif;
  --script: 'Marck Script', cursive;
  --shadow: 0 24px 60px rgba(2, 5, 20, 0.65);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg-0);
  overflow-x: hidden;
}

img {
  max-width: 100%;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

/* ——— Космический фон ——— */

.cosmos {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(76, 64, 176, 0.35), transparent 60%),
    radial-gradient(900px 600px at 10% 15%, rgba(23, 58, 146, 0.35), transparent 65%),
    linear-gradient(180deg, #04071a 0%, #070d2b 40%, #060b24 75%, #04071a 100%);
}

.cosmos__stars {
  position: absolute;
  inset: -50%;
  background-repeat: repeat;
  background-size: 340px 340px;
}

.cosmos__stars--far {
  opacity: 0.55;
  background-image:
    radial-gradient(1.4px 1.4px at 40px 60px, #fff, transparent 60%),
    radial-gradient(1px 1px at 180px 120px, #cdd8ff, transparent 60%),
    radial-gradient(1.2px 1.2px at 260px 40px, #fff, transparent 60%),
    radial-gradient(1px 1px at 90px 240px, #b9c6ff, transparent 60%),
    radial-gradient(1.6px 1.6px at 300px 280px, #ffe9b8, transparent 60%);
  animation: starDrift 220s linear infinite;
}

.cosmos__stars--near {
  opacity: 0.85;
  background-size: 520px 520px;
  background-image:
    radial-gradient(2px 2px at 120px 180px, #ffffff, transparent 65%),
    radial-gradient(1.6px 1.6px at 420px 90px, #ffe9c4, transparent 65%),
    radial-gradient(2.2px 2.2px at 300px 430px, #cfe0ff, transparent 65%),
    radial-gradient(1.4px 1.4px at 60px 400px, #fff, transparent 65%);
  animation: starDrift 130s linear infinite reverse, twinkle 7s ease-in-out infinite alternate;
}

.cosmos__moon {
  position: absolute;
  top: -90px;
  right: -60px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(244, 221, 164, 0.5), rgba(217, 180, 91, 0.12) 55%, transparent 70%);
  filter: blur(2px);
  opacity: 0.75;
}

.cosmos__haze {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 40% at 50% 100%, rgba(8, 14, 45, 0.9), transparent 70%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.014) 0 2px, transparent 2px 4px);
}

@keyframes starDrift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-340px, 170px, 0); }
}

@keyframes twinkle {
  from { opacity: 0.45; }
  to { opacity: 0.95; }
}

/* ——— Шапка ——— */

.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.4rem clamp(1rem, 4vw, 3.5rem);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.brand__sigil {
  color: var(--gold);
  font-size: 1.3rem;
  text-shadow: 0 0 14px rgba(217, 180, 91, 0.8);
}

.brand__name {
  font-family: var(--serif);
  font-size: 1.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand__tag {
  font-family: var(--script);
  color: var(--ink-faint);
  font-size: 1.05rem;
}

.site-nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2.4rem);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.site-nav a {
  position: relative;
  padding-bottom: 3px;
  transition: color 0.25s ease;
}

.site-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.site-nav a:hover {
  color: var(--gold-bright);
}

.site-nav a:hover::after {
  transform: scaleX(1);
}

/* ——— Общие контейнеры ——— */

main {
  position: relative;
  z-index: 1;
}

.screen {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.screen.is-active {
  opacity: 1;
  transform: translateY(0);
}

.screen[hidden] {
  display: none;
}

.hero,
.stage,
.reading,
.legal,
.about,
.types,
.compat,
.faq,
.page__actions {
  width: min(1180px, 100% - 2rem);
  margin-inline: auto;
}

.section-head {
  text-align: center;
  margin-bottom: 2.6rem;
}

.section-head__eyebrow,
.hero__eyebrow {
  font-family: var(--script);
  font-size: 1.15rem;
  color: var(--gold);
  letter-spacing: 0.05em;
  margin: 0 0 0.6rem;
}

.section-head__title {
  font-size: clamp(2rem, 4vw, 2.9rem);
}

.section-head__lead {
  max-width: 44rem;
  margin: 1rem auto 0;
  color: var(--ink-dim);
}

/* ——— Герой и форма ——— */

.hero {
  padding: 0 0 clamp(2.5rem, 6vw, 4rem);
  text-align: center;
}

.hero__title {
  font-size: clamp(2.7rem, 8vw, 5.2rem);
  letter-spacing: 0.01em;
  margin-bottom: 1rem;
}

.hero__title-accent {
  display: block;
  font-family: var(--script);
  color: var(--gold-bright);
  font-size: 0.72em;
  text-shadow: 0 0 34px rgba(217, 180, 91, 0.45);
}

.hero__how {
  display: inline-flex;
  margin: 0 auto 2.4rem;
}

.ritual {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  text-align: left;
  padding: clamp(1.4rem, 4vw, 2.6rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.ritual__label {
  font-family: var(--serif);
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
  padding: 0;
}

.ritual__field {
  border: 0;
  margin: 0.4rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ritual__input {
  width: 100%;
  resize: vertical;
  min-height: 96px;
  padding: 1.1rem 1.3rem;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.6vw, 1.55rem);
  line-height: 1.5;
  color: var(--ink);
  background: rgba(6, 11, 34, 0.82);
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.ritual__input::placeholder {
  color: var(--ink-faint);
  opacity: 0.85;
}

.ritual__input:focus {
  border-color: rgba(217, 180, 91, 0.75);
  box-shadow: 0 0 0 4px rgba(217, 180, 91, 0.14), 0 0 34px rgba(140, 123, 255, 0.18);
}

@keyframes fieldShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}

.ritual__input.is-shaking {
  animation: fieldShake 0.4s ease;
  border-color: rgba(255, 143, 177, 0.65);
}

.ritual__error {
  margin: 0;
  color: var(--rose);
  font-size: 0.95rem;
}

/* ——— Анализ вопроса ——— */

.verdict {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 2.2rem;
}

.verdict__hint {
  margin: 0;
  color: var(--ink-faint);
  font-size: 0.93rem;
}

.verdict__ok {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  color: #b9f0c6;
}

.verdict__warn {
  margin: 0;
  color: var(--rose);
  font-size: 0.95rem;
}

.spreads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.9rem;
}

.spreads__loading {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--ink-faint);
}

.spread-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.1rem;
  text-align: left;
  color: var(--ink-dim);
  background: rgba(7, 13, 40, 0.75);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.spread-option:hover {
  transform: translateY(-3px);
  border-color: rgba(217, 180, 91, 0.5);
  color: var(--ink);
}

.spread-option.is-active {
  color: var(--ink);
  border-color: var(--gold);
  background: linear-gradient(160deg, rgba(217, 180, 91, 0.16), rgba(12, 20, 58, 0.9));
  box-shadow: 0 0 0 1px rgba(217, 180, 91, 0.35), 0 14px 34px rgba(3, 7, 25, 0.6);
}

.spread-option__title {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: inherit;
}

.spread-option__sub {
  font-size: 0.92rem;
  color: var(--ink-faint);
}

.spread-option__count {
  position: absolute;
  top: 0.75rem;
  right: 0.9rem;
  font-family: var(--serif);
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: var(--gold);
}

.spread-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* ——— Кнопки ——— */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 1rem 2.4rem;
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.btn--primary {
  align-self: center;
  margin-top: 0.6rem;
  color: #14100a;
  font-weight: 700;
  background: linear-gradient(135deg, #f4dda4, #d9b45b 55%, #b8933f);
  box-shadow: 0 12px 40px rgba(217, 180, 91, 0.32);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 48px rgba(217, 180, 91, 0.45);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--ghost {
  color: var(--gold-bright);
  background: rgba(217, 180, 91, 0.08);
  border-color: rgba(217, 180, 91, 0.55);
}

.btn--ghost:hover {
  background: rgba(217, 180, 91, 0.18);
  transform: translateY(-2px);
}

.btn[disabled] {
  opacity: 0.72;
  cursor: default;
  transform: none;
}

.btn.is-blocked {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
}

.btn.is-blocked:hover {
  transform: none;
}

.btn__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(20, 16, 10, 0.35);
  border-top-color: #14100a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn.is-loading .btn__spinner {
  display: block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ——— Лента с вопросом (липнет к верху) ——— */

.ribbon {
  position: sticky;
  top: 0;
  z-index: 30;
  width: min(1180px, 100% - 2rem);
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.4rem;
  background: rgba(6, 11, 34, 0.9);
  border: 1px solid rgba(217, 180, 91, 0.35);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 40px rgba(2, 5, 20, 0.6);
  animation: ribbonIn 0.6s ease both;
}

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

.ribbon__moon {
  color: var(--gold);
  font-size: 1.35rem;
  text-shadow: 0 0 16px rgba(217, 180, 91, 0.8);
}

.ribbon__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ribbon__body small {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.ribbon__body strong {
  font-family: var(--serif);
  font-size: clamp(1.02rem, 2.4vw, 1.32rem);
  font-weight: 600;
  color: var(--gold-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ribbon__spread {
  margin-left: auto;
  padding: 0.3rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  white-space: nowrap;
}

/* ——— Сцена расклада ——— */

.stage {
  padding: 0 0 3rem;
}

.stage__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.stage__title {
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
}

.stage__status {
  margin: 0;
  font-family: var(--script);
  font-size: 1.2rem;
  color: var(--gold);
  min-height: 1.6em;
}

.stage__head-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.8rem;
}

.stage__how {
  margin-left: auto;
}

.stage__hint {
  margin: 1.4rem 0 0;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--gold-bright);
  animation: hintIn 0.6s ease both;
}

@keyframes hintIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.stage__table {
  display: flex;
  align-items: flex-start;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1.2rem, 3vw, 2.4rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(140, 123, 255, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(9, 16, 47, 0.94), rgba(6, 11, 32, 0.94));
  box-shadow: var(--shadow), inset 0 0 90px rgba(6, 11, 34, 0.9);
}

/* Колода */

.deck {
  position: relative;
  flex: 0 0 auto;
  width: clamp(84px, 11vw, 124px);
  aspect-ratio: var(--card-ratio);
  filter: drop-shadow(0 18px 30px rgba(2, 5, 20, 0.75));
}

.deck__pile {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  border: 1px solid rgba(217, 180, 91, 0.5);
  background:
    url('/images/front.png') center / cover no-repeat,
    repeating-linear-gradient(45deg, rgba(217, 180, 91, 0.14) 0 2px, transparent 2px 9px),
    radial-gradient(circle at 50% 45%, rgba(140, 123, 255, 0.4), transparent 60%),
    linear-gradient(160deg, #101a4d, #070d2b);
}

.deck__pile--1 {
  transform: translate(0, 0) rotate(-3deg);
  display: grid;
  place-items: center;
  animation: deckBreathe 4.5s ease-in-out infinite;
}

.deck__pile--2 { transform: translate(-5px, 5px) rotate(-7deg); opacity: 0.85; }
.deck__pile--3 { transform: translate(-9px, 10px) rotate(-11deg); opacity: 0.7; }
.deck__pile--4 { transform: translate(-12px, 15px) rotate(-15deg); opacity: 0.55; }

.deck__sigil {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--gold-bright);
  text-shadow: 0 0 18px rgba(217, 180, 91, 0.9);
}

.deck__ring {
  position: absolute;
  inset: 14%;
  border: 1px dashed rgba(244, 221, 164, 0.55);
  border-radius: 50%;
  animation: slowSpin 26s linear infinite;
}

@keyframes deckBreathe {
  0%, 100% { transform: translate(0, 0) rotate(-3deg); }
  50% { transform: translate(-2px, -4px) rotate(-1deg); }
}

@keyframes slowSpin {
  to { transform: rotate(360deg); }
}

/* Слоты и карты */

.slots {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(var(--count, 3), minmax(0, var(--card-w)));
  justify-content: center;
  align-items: start;
  gap: clamp(0.8rem, 2vw, 1.6rem);
}

.slot {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.slot__pos {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  width: min(100%, var(--card-w));
  margin: 0 auto 0.7rem;
  text-align: center;
}

.slot__pos strong {
  font-family: var(--serif);
  font-size: clamp(0.95rem, 1.6vw, 1.14rem);
  letter-spacing: 0.08em;
  color: var(--gold-bright);
}

.slot__pos span {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.slot__frame {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  border: 1px dashed rgba(146, 164, 232, 0.32);
  background: rgba(146, 164, 232, 0.05);
}

.slot__holder {
  position: relative;
  z-index: 2;
  aspect-ratio: var(--card-ratio);
}

.slot.is-active {
  z-index: 45;
}

.card {
  position: absolute;
  inset: 0;
  perspective: 1400px;
  opacity: 0;
  cursor: default;
  pointer-events: none;
}

.card.is-laid,
.card.no-anim {
  opacity: 1;
}

.card.no-anim .card__inner {
  transition: none;
}

.slots.is-ready .card:not(.is-flipped) {
  cursor: pointer;
  pointer-events: auto;
}

.slots.is-ready .card:not(.is-flipped) .card__back {
  animation: invite 2.6s ease-in-out infinite;
}

.slots.is-ready .card:not(.is-flipped):hover .card__back,
.slots.is-ready .card:not(.is-flipped):focus-visible .card__back {
  animation: none;
  border-color: var(--gold-bright);
  box-shadow: 0 0 30px rgba(217, 180, 91, 0.45);
}

.slots.is-ready .card:not(.is-flipped):hover,
.slots.is-ready .card:not(.is-flipped):focus-visible {
  transform: translateY(-5px);
  transition: transform 0.25s ease;
}

.slots.is-ready .card.is-flipped {
  pointer-events: none;
}

@keyframes invite {
  0%, 100% { box-shadow: 0 0 0 rgba(217, 180, 91, 0); }
  50% { box-shadow: 0 0 26px rgba(217, 180, 91, 0.5); }
}

.card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.95s cubic-bezier(0.35, 0.1, 0.2, 1);
}

.card.is-flipped .card__inner {
  transform: rotateY(180deg);
}

.card__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 14px;
  overflow: hidden;
}

.card__back {
  border: 1px solid rgba(217, 180, 91, 0.55);
  background:
    url('/images/front.png') center / cover no-repeat,
    repeating-linear-gradient(45deg, rgba(217, 180, 91, 0.12) 0 2px, transparent 2px 10px),
    repeating-linear-gradient(-45deg, rgba(140, 123, 255, 0.12) 0 2px, transparent 2px 10px),
    radial-gradient(circle at 50% 40%, rgba(140, 123, 255, 0.45), transparent 65%),
    linear-gradient(160deg, #101a4d, #060b24);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.card__back-hint {
  position: absolute;
  left: 50%;
  bottom: 0.65rem;
  transform: translateX(-50%);
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  background: rgba(4, 7, 26, 0.78);
  border: 1px solid rgba(217, 180, 91, 0.45);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(244, 221, 164, 0.92);
  white-space: nowrap;
}

.card__front {
  transform: rotateY(180deg);
  border: 1px solid rgba(217, 180, 91, 0.6);
  background: linear-gradient(170deg, #0d1546 0%, #070d2b 60%, #05091f 100%);
}

.card__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.card.is-reversed .card__art {
  transform: rotate(180deg);
}

.card__plate {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 1.1rem 0.5rem 0.6rem;
  text-align: center;
  background: linear-gradient(
    180deg,
    rgba(4, 7, 26, 0) 0%,
    rgba(4, 7, 26, 0.82) 55%,
    rgba(4, 7, 26, 0.95) 100%
  );
}

.card__name {
  font-family: var(--serif);
  font-size: clamp(0.78rem, 1.7vw, 1.05rem);
  line-height: 1.15;
  color: var(--gold-bright);
}

.card__meta {
  font-size: clamp(0.55rem, 1.1vw, 0.7rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.card.is-flipped.is-reversed .card__front {
  border-color: rgba(140, 123, 255, 0.75);
}

.card__glow {
  position: absolute;
  inset: -18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 221, 164, 0.55), transparent 65%);
  opacity: 0;
  pointer-events: none;
}

.card.is-glow .card__glow {
  animation: flipGlow 1.1s ease-out both;
}

@keyframes flipGlow {
  0% { opacity: 0; transform: scale(0.6); }
  35% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(1.3); }
}

/* ——— Пояснение у открытой карты: плашка справа, по наведению ——— */

.slot__detail {
  position: absolute;
  left: calc(100% + 0.75rem);
  top: var(--detail-top, 0);
  width: clamp(180px, 18vw, 260px);
  z-index: 40;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: none;
}

.slot.is-active .slot__detail {
  opacity: 1;
  transform: translateX(0);
}

.dcard {
  padding: 1rem 1.1rem 1.15rem;
  border-radius: 14px;
  border: 1px solid rgba(217, 180, 91, 0.4);
  background: linear-gradient(165deg, rgba(21, 30, 74, 0.96), rgba(8, 14, 42, 0.97));
  box-shadow:
    inset 0 16px 24px -18px rgba(2, 5, 20, 0.95),
    0 16px 34px rgba(2, 5, 20, 0.55);
  opacity: 0;
  transform: translateY(14px);
  animation: dcardIn 0.45s 0.1s ease both;
}

@keyframes dcardIn {
  to { opacity: 1; transform: translateY(0); }
}

.dcard__pos {
  margin: 0 0 0.6rem;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.dcard__titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-bottom: 0.55rem;
}

.dcard__titles strong {
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.2;
  color: var(--ink);
}

.dcard__titles em {
  font-style: normal;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.dcard__titles em.is-reversed {
  color: #b9aeff;
}

.dcard__text {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--ink-dim);
}

.dcard__bridge {
  margin: 0.65rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--line);
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--gold-bright);
}

/* Узкие экраны: плашка выезжает снизу по центру карты, всё так же поверх страницы */

@media (max-width: 1149px) {
  .slot__detail {
    left: 50%;
    right: auto;
    top: calc(100% + 0.6rem);
    width: min(320px, calc(100vw - 3rem));
    transform: translate(-50%, 8px);
  }

  .slot.is-active .slot__detail {
    transform: translate(-50%, 0);
  }
}

/* Сенсорные устройства: наведения нет — пояснение остаётся под картой */

@media (hover: none) {
  .slot__detail {
    position: static;
    width: auto;
    transform: none;
    opacity: 0;
    pointer-events: auto;
    transition: none;
  }

  .slot.is-open .slot__detail {
    opacity: 1;
  }
}

/* ——— Частые вопросы ——— */

.faq {
  padding: clamp(2.5rem, 6vw, 4rem) 0 0;
  text-align: left;
}

.faq__eyebrow {
  font-family: var(--script);
  font-size: 1.15rem;
  color: var(--gold);
  letter-spacing: 0.05em;
  margin: 0 0 0.6rem;
  text-align: center;
}

.faq__title {
  margin: 0 0 1.8rem;
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  text-align: center;
}

.faq__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.1rem;
}

.faq__item {
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(9, 15, 45, 0.72);
}

.faq__q {
  margin: 0 0 0.55rem;
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.3;
  color: var(--gold-bright);
}

.faq__a {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink-dim);
}

/* ——— Трактовка ——— */

.reading {
  padding: 1rem 0 4rem;
}

.reading__panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2.2rem;
}

.panel {
  padding: 1.6rem 1.7rem;
  border-radius: var(--radius);
  border: 1px solid rgba(217, 180, 91, 0.4);
  background:
    radial-gradient(100% 80% at 0% 0%, rgba(217, 180, 91, 0.14), transparent 60%),
    rgba(9, 15, 45, 0.9);
  box-shadow: var(--shadow);
}

.panel--outcome {
  border-color: rgba(140, 123, 255, 0.5);
  background:
    radial-gradient(100% 80% at 100% 0%, rgba(140, 123, 255, 0.2), transparent 60%),
    rgba(9, 15, 45, 0.9);
}

.panel__title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  margin-bottom: 0.7rem;
  color: var(--gold-bright);
}

.panel--outcome .panel__title {
  color: #cfc7ff;
}

.panel__mark {
  color: var(--gold);
}

.panel__text {
  margin: 0;
  color: var(--ink-dim);
}

.reading__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
}

.reading__share {
  display: inline-block;
  padding: 0.62rem 1.3rem;
  border: 1px solid rgba(217, 180, 91, 0.45);
  border-radius: 999px;
  color: var(--gold-bright);
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.reading__share:hover,
.reading__share:focus-visible {
  background: rgba(217, 180, 91, 0.14);
  border-color: var(--gold-bright);
}

.reading__share[hidden] {
  display: none;
}

/* ——— Правовые страницы ——— */

.legal {
  padding: 2rem 0 3rem;
}

.legal__updated {
  margin: 0 0 1.6rem;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.legal__body {
  max-width: 46rem;
  margin: 0 auto;
}

.legal__body h2 {
  margin: 2.2rem 0 0.7rem;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--gold-bright);
  letter-spacing: 0.02em;
}

.legal__body p {
  margin: 0 0 1rem;
  line-height: 1.75;
  color: var(--ink-dim);
}

.legal__body ul {
  margin: 0 0 1rem;
  padding-left: 1.3rem;
}

.legal__body li {
  margin: 0.45rem 0;
  line-height: 1.7;
  color: var(--ink-dim);
}

.legal__body a {
  color: var(--gold-bright);
  text-decoration: underline;
  text-decoration-color: rgba(217, 180, 91, 0.4);
  text-underline-offset: 3px;
}

.legal__body a:hover {
  text-decoration-color: var(--gold-bright);
}

.legal__body strong {
  color: var(--ink);
}

/* ——— О ритуале ——— */

.about {
  padding: 2rem 0 4rem;
}

.about__steps {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.4rem;
  counter-reset: step;
}

.about__steps li {
  position: relative;
  padding: 1.8rem 1.6rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.about__steps h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.about__steps p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.97rem;
}

.about__num {
  position: absolute;
  top: 0.4rem;
  right: 1rem;
  font-family: var(--serif);
  font-size: 3.4rem;
  color: rgba(217, 180, 91, 0.16);
}

.about__note {
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.92rem;
  max-width: 52rem;
  margin: 0 auto;
}

/* ——— Стартовая страница: выбор гадания ——— */

.landing {
  padding-bottom: 2rem;
}

.types__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: clamp(1rem, 2.2vw, 1.8rem);
  align-items: stretch;
}

.type-card {
  --rx: 0deg;
  --ry: 0deg;
  position: relative;
  display: flex;
  flex-direction: column;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(14, 22, 62, 0.92), rgba(7, 12, 36, 0.96));
  overflow: hidden;
  box-shadow: 0 22px 50px rgba(2, 5, 20, 0.55);
  transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.type-card:hover,
.type-card:focus-visible {
  border-color: rgba(217, 180, 91, 0.55);
  box-shadow: 0 34px 66px rgba(2, 5, 20, 0.7), 0 0 46px rgba(217, 180, 91, 0.16);
  outline: none;
}

.type-card__art {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(230px, 32vw, 310px);
  overflow: hidden;
  background:
    radial-gradient(65% 65% at 50% 42%, rgba(140, 123, 255, 0.38), transparent 72%),
    linear-gradient(180deg, rgba(10, 17, 52, 0.95), rgba(6, 11, 32, 0.98));
  border-bottom: 1px solid var(--line);
}

.type-card__art img {
  height: 86%;
  width: auto;
  border-radius: 10px;
  border: 1px solid rgba(217, 180, 91, 0.55);
  box-shadow: 0 18px 40px rgba(2, 5, 20, 0.7);
  transform: translateY(8px) rotate(-4deg);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.3, 1), box-shadow 0.5s ease;
}

.type-card--compat .type-card__art img {
  transform: translateY(8px) rotate(4deg);
}

.type-card:hover .type-card__art img,
.type-card:focus-visible .type-card__art img {
  transform: translateY(-4px) rotate(0deg) scale(1.05);
  box-shadow: 0 28px 56px rgba(2, 5, 20, 0.75), 0 0 46px rgba(217, 180, 91, 0.35);
}

.type-card__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    240px circle at var(--mx, 50%) var(--my, 50%),
    rgba(244, 221, 164, 0.22),
    transparent 62%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.type-card:hover .type-card__glow,
.type-card:focus-visible .type-card__glow {
  opacity: 1;
}

.type-card__badge {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 2;
  padding: 0.24rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 143, 177, 0.65);
  background: rgba(6, 11, 32, 0.92);
  color: var(--rose);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(2, 5, 20, 0.6);
}

.type-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.4rem 1.5rem 1.6rem;
}

.type-card__num {
  font-family: var(--serif);
  font-size: 0.92rem;
  letter-spacing: 0.26em;
  color: var(--gold);
}

.type-card__title {
  font-size: clamp(1.5rem, 2.4vw, 1.95rem);
}

.type-card__text {
  display: block;
  color: var(--ink-dim);
  font-size: 0.95rem;
}

.type-card__cta {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-bright);
  opacity: 0.7;
  transform: translateX(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.type-card:hover .type-card__cta,
.type-card:focus-visible .type-card__cta {
  opacity: 1;
  transform: translateX(0);
}

.type-card__cta--soon {
  color: var(--ink-faint);
  opacity: 1;
  transform: none;
}

.type-card--soon {
  cursor: pointer;
}

.type-card--soon.is-nudge {
  animation: nudge 0.45s ease;
}

@keyframes nudge {
  0%, 100% { margin-left: 0; }
  25% { margin-left: -7px; }
  75% { margin-left: 7px; }
}

.types__note {
  margin: 2.4rem auto 0;
  max-width: 40rem;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.9rem;
}

/* ——— Рекламный блок ——— */

.ad {
  margin: 1.4rem auto 2.2rem;
  max-width: 100%;
  overflow: hidden;
  text-align: center;
}

.ad__label {
  margin: 0 0 0.55rem;
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(146, 164, 232, 0.55);
}

.ad__slot {
  min-height: 0;
}

/* ——— Общие страницы ——— */

.page {
  padding-top: clamp(1.2rem, 3vw, 2.4rem);
}

.page__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  padding: 2.4rem 0 3rem;
}

/* ——— Выдвижной блок «Как проходит расклад» ——— */

.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(2, 4, 16, 0.68);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.drawer-scrim.is-open {
  opacity: 1;
}

.drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  transform: translateY(100%);
  transition: transform 0.42s cubic-bezier(0.3, 0.9, 0.3, 1);
}

.drawer.is-open {
  transform: translateY(0);
}

.drawer__inner {
  width: min(1180px, 100% - 1.5rem);
  margin: 0 auto 0.9rem;
  padding: clamp(1.3rem, 3vw, 2.4rem);
  max-height: min(82vh, 780px);
  overflow-y: auto;
  border: 1px solid rgba(217, 180, 91, 0.4);
  border-radius: 24px;
  background: linear-gradient(165deg, rgba(12, 20, 58, 0.98), rgba(6, 11, 32, 0.99));
  box-shadow: 0 -26px 70px rgba(2, 5, 20, 0.75);
}

.drawer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.drawer__title {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
}

.drawer__close {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(217, 180, 91, 0.5);
  background: rgba(217, 180, 91, 0.1);
  color: var(--gold-bright);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease;
}

.drawer__close:hover,
.drawer__close:focus-visible {
  transform: rotate(90deg);
  background: rgba(217, 180, 91, 0.22);
  outline: none;
}

/* ——— Совместимость ——— */

.compat {
  padding-bottom: 3rem;
}

.compat__form {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(1rem, 2vw, 1.6rem);
  align-items: stretch;
  padding: clamp(1.3rem, 3vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.compat__side {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin: 0;
  padding: 1.2rem;
  border: 1px dashed rgba(146, 164, 232, 0.3);
  border-radius: 16px;
  background: rgba(9, 15, 45, 0.5);
}

.compat__legend {
  padding: 0 0.4rem;
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--gold-bright);
}

.compat__field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.compat__field span {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.compat__input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--ink);
  background: rgba(4, 7, 26, 0.72);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.compat__input:focus {
  outline: none;
  border-color: rgba(217, 180, 91, 0.6);
  box-shadow: 0 0 0 3px rgba(217, 180, 91, 0.14);
}

.compat__amp {
  align-self: center;
  font-family: var(--serif);
  font-size: 2.4rem;
  color: var(--rose);
  text-shadow: 0 0 24px rgba(255, 143, 177, 0.55);
}

.compat__error {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--rose);
  text-align: center;
}

.compat__actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.compat__result {
  margin-top: 2.2rem;
  padding: clamp(1.5rem, 3vw, 2.4rem);
  border: 1px solid rgba(217, 180, 91, 0.42);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(18, 28, 76, 0.92), rgba(8, 14, 42, 0.96));
  box-shadow: var(--shadow);
  text-align: center;
}

.compat__score {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.15rem;
}

.compat__score-value {
  font-family: var(--serif);
  font-size: clamp(3.2rem, 9vw, 5rem);
  line-height: 1;
  color: var(--gold-bright);
}

.compat__score-unit {
  font-family: var(--serif);
  font-size: 2rem;
  color: var(--gold);
}

.compat__score-label {
  flex-basis: 100%;
  text-align: center;
  font-family: var(--script);
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  color: var(--gold);
}

.compat__pair {
  margin: 0.8rem 0 1.8rem;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  color: var(--ink);
}

.compat__bars {
  display: grid;
  gap: 0.95rem;
  max-width: 44rem;
  margin: 0 auto 1.8rem;
  text-align: left;
}

.compat__bar-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.compat__bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(146, 164, 232, 0.16);
  overflow: hidden;
}

.compat__bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--violet), var(--gold-bright));
  transition: width 0.9s cubic-bezier(0.3, 0.9, 0.3, 1);
}

.compat__verdict {
  max-width: 46rem;
  margin: 0 auto 1.1rem;
  padding: 1.2rem 1.4rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  line-height: 1.55;
  color: var(--ink);
  text-align: left;
  border-left: 3px solid rgba(217, 180, 91, 0.65);
  border-radius: 0 14px 14px 0;
  background: rgba(9, 15, 45, 0.55);
}

.compat__advice {
  max-width: 46rem;
  margin: 0 auto 1.4rem;
  color: var(--ink-dim);
  text-align: left;
}

.compat__note {
  max-width: 46rem;
  margin: 0 auto 1.6rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

/* ——— Подвал ——— */

.site-footer {
  position: relative;
  z-index: 1;
  padding: 2.4rem 1rem 3rem;
  text-align: center;
  color: var(--ink-faint);
  border-top: 1px solid rgba(146, 164, 232, 0.14);
}

.site-footer__sigil {
  display: block;
  color: var(--gold);
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 16px rgba(217, 180, 91, 0.7);
}

.site-footer p {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: center;
  margin-top: 1rem;
}

.site-footer__links a {
  color: var(--ink-faint);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.site-footer__links a:hover,
.site-footer__links a:focus-visible {
  color: var(--gold-bright);
  border-bottom-color: rgba(217, 180, 91, 0.55);
}

/* ——— Адаптив ——— */

@media (max-width: 900px) {
  .slots {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .site-header {
    flex-direction: column;
    gap: 0.8rem;
    padding-top: 1.1rem;
  }

  .site-nav {
    gap: 1.3rem;
    font-size: 0.84rem;
  }

  .stage__table {
    flex-direction: column;
    align-items: stretch;
  }

  .deck {
    width: 88px;
    align-self: center;
  }

  .ribbon {
    border-radius: 20px;
    flex-wrap: wrap;
  }

  .ribbon__spread {
    margin-left: 0;
  }

  .ribbon__body strong {
    white-space: normal;
  }

  .dcard {
    padding: 0.8rem 0.85rem 0.9rem;
  }

  .dcard__text {
    font-size: 0.82rem;
  }

  .slot__pos strong {
    font-size: 0.98rem;
  }

  .stage__hint {
    font-size: 0.98rem;
  }

  .compat__form {
    grid-template-columns: 1fr;
  }

  .compat__amp {
    justify-self: center;
  }

  .type-card__art {
    height: 240px;
  }

  .drawer__inner {
    width: calc(100% - 0.8rem);
    max-height: 84vh;
    border-radius: 20px 20px 0 0;
  }
}

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

  html {
    scroll-behavior: auto;
  }
}
