:root {
  /* HEKTA: kosmiline lilla ja kuld */
  --bg: #0a0618;
  --bg-2: #170f33;
  --panel: rgba(23, 14, 52, 0.74);
  --line: rgba(242, 196, 109, 0.24);
  --gold: #e9bd6a;
  --gold-2: #ffe0a0;
  --violet: #8b5cf6;
  --text: #efe9f7;
  --muted: #ab9fc4;
  --danger: #e8a39c;
  --fire: #e58a6b;
  --earth: #8cbf8a;
  --air: #a9c7e8;
  --water: #7f9ee6;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --card-w: 112px;
  --card-h: 186px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(10, 6, 24, 0.84), rgba(10, 6, 24, 0.93)),
    url("img/hekta-taust.webp") center / cover fixed,
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
}

.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 68% 9%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 84% 32%, #fff7 50%, transparent 51%),
    radial-gradient(1px 1px at 33% 62%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 91% 78%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 6% 88%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 50% 40%, #fff4 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 90%, #fff5 50%, transparent 51%);
}

a { color: var(--gold); }

/* ---------- Ülemine riba ja sammud ---------- */
.topbar {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brand { display: flex; flex-direction: column; text-decoration: none; line-height: 1.05; }
.brand-name {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 60%, #b98a3c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-tag { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }
.prefs { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pref { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
select, input[type="text"], input[type="date"], input[type="time"] {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  font: 15px var(--sans);
  outline: none;
  color-scheme: dark;
}
select:focus, input:focus { border-color: var(--gold); }
.chip {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: 13px var(--sans);
  cursor: pointer;
}
.chip[aria-pressed="false"] { color: var(--muted); }

.steps {
  position: relative;
  max-width: 1100px;
  margin: 6px auto 0;
  padding: 0 16px;
  list-style: none;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  counter-reset: step;
}
.steps li {
  flex: 1 0 auto;
  padding: 8px 10px;
  border-top: 2px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.steps li::before { counter-increment: step; content: counter(step) ". "; }
.steps li.done { border-color: var(--gold); color: var(--text); }
.steps li.current { border-color: var(--gold-2); color: var(--gold-2); }

/* ---------- Üldine ---------- */
.main { position: relative; max-width: 1100px; margin: 0 auto; padding: 16px 16px 32px; }
.step-panel { animation: rise 0.45s ease both; }
.card-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  backdrop-filter: blur(10px);
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; }
.section-title { font-size: clamp(28px, 4vw, 40px); margin: 8px 0 16px; color: var(--gold-2); }
.subtitle { font-size: 24px; margin: 28px 0 12px; color: var(--gold-2); }
.actions { display: flex; justify-content: center; gap: 12px; margin-top: 24px; }
.actions.wrap { flex-wrap: wrap; }
.btn-gold, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font: 500 15px var(--sans);
  cursor: pointer;
  text-decoration: none;
}
.btn-gold {
  border: 0;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #1a1408;
  box-shadow: 0 6px 24px rgba(214, 186, 128, 0.25);
}
.btn-gold:disabled { opacity: 0.45; cursor: default; box-shadow: none; }
.btn-ghost { border: 1px solid var(--line); background: transparent; color: var(--text); }
.btn-ghost.small, .btn-gold.small { padding: 8px 14px; font-size: 13px; }
.error { color: var(--danger); margin: 8px 0 0; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 14px; }

/* ---------- 1. Sünniandmed ---------- */
#s-birth { display: grid; gap: 24px; justify-items: center; padding-top: 8px; }
.hero-banner {
  position: relative;
  width: 100%;
  min-height: clamp(360px, 52vw, 520px);
  border-radius: 28px;
  overflow: hidden;
  display: grid;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(10, 6, 24, 0.62) 0%, rgba(10, 6, 24, 0.25) 45%, rgba(10, 6, 24, 0.55) 100%),
    url("img/hekta-taust.webp") center / cover;
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(60, 20, 140, 0.35);
}
.hero-inner { padding: 28px 16px; max-width: 760px; }
.eyebrow { margin: 0 0 6px; color: var(--gold); font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; }
.brand-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(68px, 13vw, 150px);
  line-height: 0.95;
  letter-spacing: 0.06em;
  background: linear-gradient(180deg, #fff6dc 0%, var(--gold-2) 35%, var(--gold) 65%, #a8772e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 24px rgba(255, 200, 110, 0.45));
}
.tagline { margin: 10px 0 0; font-size: clamp(16px, 2.4vw, 24px); color: #fbf3e2; text-shadow: 0 2px 12px #000a; }
.tag-rule { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 12px auto 4px; color: var(--gold-2); }
.tag-rule::before, .tag-rule::after { content: ""; width: 90px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.tag-rule::after { transform: scaleX(-1); }
.lead { margin: 10px 0 4px; font-family: var(--serif); font-size: clamp(20px, 2.6vw, 28px); line-height: 1.25; text-shadow: 0 2px 12px #000c; }
.persona-line { margin: 0; color: var(--gold-2); font-size: 15px; text-shadow: 0 2px 10px #000c; }
.sub { margin: 0; color: var(--muted); max-width: 46ch; }
.daily { width: 100%; max-width: 560px; text-align: center; }
.daily h2 { margin: 0 0 6px; font-size: 28px; color: var(--gold-2); }
.daily-lead { margin: 0 0 14px; color: var(--muted); }
.daily-msg { margin: 14px 0 0; color: var(--muted); }
.daily-msg.error { color: var(--danger); }
.daily-result { display: grid; justify-items: center; gap: 14px; margin-top: 16px; }
.daily-card .tarot { --card-w: 120px; --card-h: 200px; }
.daily-card { filter: drop-shadow(0 10px 28px rgba(214, 186, 128, 0.22)); }
.daily-result:not([hidden]) { animation: rise 0.5s ease both; }
.daily-text { margin: 0; max-width: 46ch; font: 500 clamp(19px, 2.4vw, 22px)/1.45 var(--serif); }
.daily-more { margin-top: 18px; }
.birth-form { width: 100%; max-width: 560px; }
.birth-form h2 { margin: 0 0 14px; font-size: 28px; color: var(--gold-2); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; flex: 1; min-width: 0; }
.field label { font-size: 14px; color: var(--muted); }
.field input, .field select { width: 100%; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.birth-form .btn-gold { width: 100%; }

/* ---------- 2. Sünnikaart ---------- */
.chart-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
.wheel-wrap { display: grid; place-items: center; }
#wheel { width: 100%; max-width: 380px; height: auto; }
.wheel-sign { font-size: 15px; fill: var(--gold-2); }
.wheel-planet { font-size: 17px; fill: var(--text); }
.big-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 12px;
  text-align: center;
}
.tile .glyph { font-size: 30px; color: var(--gold-2); line-height: 1.1; }
.tile .k { font-size: 12px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.tile .v { font-family: var(--serif); font-size: 21px; font-weight: 600; }
.tile .d { font-size: 12px; color: var(--muted); }
.elements { display: grid; gap: 8px; margin-bottom: 14px; }
.el-row { display: grid; grid-template-columns: 70px 1fr 26px; gap: 10px; align-items: center; font-size: 14px; }
.el-bar { height: 8px; border-radius: 99px; background: #ffffff12; overflow: hidden; }
.el-bar span { display: block; height: 100%; border-radius: 99px; transition: width 0.8s ease; }
.fact-list { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.fact-list dt { color: var(--muted); }
.fact-list dd { margin: 0; }
.voice-panel { margin-top: 18px; }
.voice-head { display: flex; gap: 14px; align-items: flex-start; }
.voice-orb {
  flex: none;
  width: 34px;
  height: 34px;
  margin-top: 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #3a4672, #141a33 70%);
  border: 1px solid var(--gold);
  box-shadow: 0 0 calc(8px + var(--level, 0) * 30px) rgba(214, 186, 128, calc(0.2 + var(--level, 0) * 0.6));
}
.voice-text { margin: 0; font-size: 17px; white-space: pre-wrap; }
.voice-text.loading { color: var(--muted); font-style: italic; }
.birth-cards { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.birth-card { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 104px; text-align: center; font-size: 12px; color: var(--muted); }
.birth-card .tarot { --card-w: 92px; --card-h: 152px; }

/* ---------- 3. Teema ---------- */
.topics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.topic {
  --glow: var(--gold);
  position: relative;
  padding: 10px 14px 20px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  text-align: center;
  cursor: pointer;
  font: inherit;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.topic[data-topic="armastus"] { --glow: #ff6fae; }
.topic[data-topic="tervis"] { --glow: #3fe08f; }
.topic[data-topic="perekond"] { --glow: #a77bff; }
.topic[data-topic="too"] { --glow: #ffb340; }
.topic:hover { transform: translateY(-4px); border-color: var(--glow); }
.topic[aria-checked="true"] { border-color: var(--glow); box-shadow: 0 0 0 1px var(--glow), 0 12px 40px color-mix(in srgb, var(--glow) 35%, transparent); }
.topic img {
  display: block;
  width: 100%;
  max-width: 190px;
  aspect-ratio: 400 / 440;
  margin: 0 auto 6px;
  object-fit: contain;
  /* Kerad hõljuvad õhus, igaüks oma rütmis */
  animation: float 5.5s ease-in-out infinite;
  transition: scale 0.35s ease, filter 0.35s ease;
}
.topic[data-topic="tervis"] img { animation-delay: -1.4s; animation-duration: 6.2s; }
.topic[data-topic="perekond"] img { animation-delay: -2.8s; animation-duration: 5.8s; }
.topic[data-topic="armastus"] img { animation-delay: -4.1s; animation-duration: 6.6s; }
.topic:hover img { scale: 1.05; filter: brightness(1.12); }
.topic[aria-checked="true"] img { scale: 1.08; animation-duration: 3.4s; filter: brightness(1.18) drop-shadow(0 0 22px var(--glow)); }
.topic[aria-checked="true"]::after {
  content: "✓";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--glow);
  color: #160c2c;
  font-weight: 700;
  box-shadow: 0 0 16px var(--glow);
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.start-hint { text-align: center; color: var(--muted); font-size: 14px; margin: 10px 0 0; min-height: 1.4em; }
.topic .t { display: block; font-family: var(--serif); font-size: 23px; font-weight: 600; }
.topic .s { display: block; font-size: 13px; color: var(--muted); }
.love-status { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { padding: 8px 18px; background: transparent; border: 0; color: var(--text); font: 14px var(--sans); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--gold); color: #1a1408; }
.question-box { margin-top: 16px; display: grid; gap: 8px; }
.question-box label { color: var(--muted); font-size: 14px; }

/* ---------- 4. Rituaal ---------- */
.question-banner { text-align: center; margin: 4px auto 10px; max-width: 760px; }
.question-banner .label { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); }
.question-banner p { margin: 4px 0 0; font-family: var(--serif); font-size: clamp(21px, 3vw, 28px); font-style: italic; color: var(--gold-2); }
.question-banner .note { font-family: var(--sans); font-size: 14px; font-style: normal; color: var(--muted); }

.stage { position: relative; min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.stage-hint { margin: 0; text-align: center; color: var(--muted); max-width: 56ch; }

.shuffle-deck { position: relative; width: var(--card-w); height: var(--card-h); }
.shuffle-deck .tarot { position: absolute; inset: 0; animation: riffle 1.1s ease-in-out infinite; }
.shuffle-deck .tarot:nth-child(2n) { animation-name: riffle-r; }
.shuffle-deck .tarot:nth-child(1) { animation-delay: 0s; }
.shuffle-deck .tarot:nth-child(2) { animation-delay: 0.12s; }
.shuffle-deck .tarot:nth-child(3) { animation-delay: 0.24s; }
.shuffle-deck .tarot:nth-child(4) { animation-delay: 0.36s; }
.shuffle-deck .tarot:nth-child(5) { animation-delay: 0.48s; }
.shuffle-deck .tarot:nth-child(6) { animation-delay: 0.6s; }
.shuffle-deck.settle .tarot { animation: none; transition: transform 0.4s ease; transform: none; }
@keyframes riffle { 0%, 100% { transform: translateX(0) rotate(0); } 40% { transform: translateX(-70px) rotate(-8deg); } 60% { transform: translateX(-70px) rotate(-8deg); } }
@keyframes riffle-r { 0%, 100% { transform: translateX(0) rotate(0); } 40% { transform: translateX(70px) rotate(8deg); } 60% { transform: translateX(70px) rotate(8deg); } }

.piles { display: flex; gap: clamp(16px, 5vw, 48px); }
.pile {
  position: relative;
  width: var(--card-w);
  height: calc(var(--card-h) + 8px);
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.pile .tarot { position: absolute; left: 0; }
.pile .tarot:nth-child(1) { top: 8px; }
.pile .tarot:nth-child(2) { top: 4px; }
.pile .tarot:nth-child(3) { top: 0; }
.pile:hover { transform: translateY(-8px); }
.pile.chosen { transform: translateY(-40px) scale(1.05); }
.piles.done .pile:not(.chosen) { opacity: 0.4; }

.fan-wrap { width: 100%; padding: 40px 0 20px; }
.fan {
  --card-w: 80px;
  --card-h: 132px;
  --fan-row: 56px;
  --fan-pad: 4px;
  --fan-step-min: 26px;
  --fan-step-max: 32px;
  --fan-tilt: 3;
  --fan-arc: 12px;
  --fan-lift: 10px;
  /* Veerud (--fan-cols) ja samm (--fan-step) tulevad layoutFan()-ist vaate laiuse järgi */
  display: grid;
  grid-template-columns: repeat(var(--fan-cols), var(--fan-step));
  grid-auto-rows: var(--fan-row);
  justify-content: center;
  /* Parem täidis kompenseerib viimase veeru kaardi üleulatuse, alumine hoiab viimase rea ja kaare wrap'i sees */
  padding: 0 calc(var(--fan-pad) + var(--card-w) - var(--fan-step)) calc(var(--card-h) - var(--fan-row) + var(--fan-arc)) var(--fan-pad);
}
.fan .tarot {
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  transform: translateY(var(--y, 0)) rotate(var(--r, 0deg));
  transition: transform 0.25s ease, opacity 0.3s ease;
  animation: deal 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i) * 8ms);
}
.fan .tarot:hover, .fan .tarot:focus-visible { transform: translateY(calc(var(--y, 0px) - var(--fan-lift))) rotate(var(--r, 0deg)); z-index: 2; outline: none; }
.fan .tarot.taken { opacity: 0; pointer-events: none; }
.fan.locked .tarot { pointer-events: none; }
@keyframes deal { from { opacity: 0; transform: translateY(40px) rotate(0); } }

.slots { display: flex; justify-content: center; gap: clamp(12px, 4vw, 40px); margin-top: 8px; flex-wrap: wrap; }
.slot { display: flex; flex-direction: column; align-items: center; gap: 8px; width: calc(var(--card-w) + 24px); }
.slot .place {
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 10px;
  border: 1px dashed var(--line);
  display: grid;
  place-items: center;
}
.slot .place .tarot { animation: rise 0.3s ease both; }
.slot .lbl { font-size: 13px; color: var(--muted); text-align: center; letter-spacing: 0.04em; }
.slot.active .lbl { color: var(--gold-2); }
.pick-count { text-align: center; color: var(--muted); font-size: 14px; min-height: 1.5em; }

/* Kaardi jagamine: lendav kaart seisab sihtkohas, deal-path toob ta lehviku kohalt (--dx, --dy,
   --r0, --s0 paneb ennustus.js) mööda kaart kohale. Sisemine kiht tõuseb lauast üles ja kaldub,
   vari laual jääb maha ja hajub, maandumisel vajub kaart tasaseks. Kestus = DEAL_MS ennustus.js-is. */
.tarot.flying {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  transform-origin: 50% 50%;
  animation: deal-path 0.82s cubic-bezier(0.55, 0.05, 0.3, 1) both;
}
.tarot.flying .tarot-inner {
  animation:
    deal-tilt 0.82s cubic-bezier(0.4, 0, 0.3, 1) both,
    deal-lift 0.82s linear both;
}
.tarot.flying::before { animation: deal-shadow 0.82s linear both; }
@keyframes deal-path {
  from { transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(var(--r0, 0deg)) scale(var(--s0, 1)); }
  to { transform: translate(0px, 0px) rotate(0deg) scale(1); }
}
@keyframes deal-tilt {
  0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
  25% { transform: rotateX(9deg) rotateY(-16deg) rotateZ(-4deg); }
  55% { transform: rotateX(6deg) rotateY(-7deg) rotateZ(2.5deg); }
  86% { transform: rotateX(-1.5deg) rotateY(1.5deg) rotateZ(-0.5deg); }
  100% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
}
/* Tõus: alguses kiireneb (käsi tõstab), tipus aeglustub, kukub kiirenedes lauale ja põrkub korra */
@keyframes deal-lift {
  0% { translate: 0 0 0; scale: 1; animation-timing-function: cubic-bezier(0.3, 0.5, 0.45, 1); }
  45% { translate: 0 -26px 70px; scale: 1.05; animation-timing-function: cubic-bezier(0.55, 0, 0.85, 0.4); }
  88% { translate: 0 1px -3px; scale: 0.995; animation-timing-function: ease-out; }
  100% { translate: 0 0 0; scale: 1; }
}
@keyframes deal-shadow {
  0% { opacity: 0.45; transform: translate(0, 6px) scale(0.97); filter: blur(6px); animation-timing-function: cubic-bezier(0.3, 0.5, 0.45, 1); }
  45% { opacity: 0.22; transform: translate(16px, 54px) scale(1.1); filter: blur(20px); animation-timing-function: cubic-bezier(0.55, 0, 0.85, 0.4); }
  88% { opacity: 0.6; transform: translate(1px, 5px) scale(0.98); filter: blur(5px); animation-timing-function: ease-out; }
  100% { opacity: 0; transform: translate(0, 6px) scale(0.97); filter: blur(8px); }
}
/* Maandunud kaart jätkab lendava kaardi lõppasendist, ilma uue sissetõusuta. Negatiivne
   ääris tasub pesa 1px piirjoone: muidu jääb kaart sisukasti ja hüppab lendava kaardi
   lõppasendist (pesa välisserv) 1px paremale ja alla. */
.slot .place .tarot.landed { animation: none; margin: -1px; }

/* ---------- Taro kaart ---------- */
.tarot { position: relative; width: var(--card-w); height: var(--card-h); perspective: 900px; display: block; }
.tarot-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
/* Vari laual kaardi all. Tavaolekus nähtamatu (kaardil on oma vari), jagamise ja pööramise
   ajal jääb lauale, kui kaart tõuseb, ning hajub ja nihkub kaardi kõrguse järgi */
.tarot::before {
  content: "";
  position: absolute;
  inset: 4px 6px;
  border-radius: 12px;
  background: rgba(4, 2, 12, 0.85);
  opacity: 0;
  pointer-events: none;
}
/* Kaart pööratakse küljelt nagu raamatuleht, et suund säiliks (METOODIKA.md 1, samm 7) */
.tarot.flipped .tarot-inner { transform: rotateY(180deg); }
/* Pööre raskusega: kaart tõuseb lauast (translate/scale), pöörleb ainult ümber Y-telje
   (transform), läheb servapidi läbi ja vajub tasaseks. Lõppasend on ülemine rotateY(180deg).
   Kestus = FLIP_MS ennustus.js-is. */
.tarot.flipped .tarot-inner {
  animation:
    flip-turn 1.15s both,
    flip-lift 1.15s linear both;
}
.tarot.flipped::before { animation: flip-shadow 1.15s linear both; }
@keyframes flip-turn {
  0% { transform: rotateY(0deg); animation-timing-function: cubic-bezier(0.55, 0, 0.3, 1); }
  84% { transform: rotateY(183deg); animation-timing-function: ease-in-out; }
  100% { transform: rotateY(180deg); }
}
@keyframes flip-lift {
  0% { translate: 0 0 0; scale: 1; animation-timing-function: cubic-bezier(0.3, 0.5, 0.45, 1); }
  42% { translate: 0 -14px 60px; scale: 1.03; animation-timing-function: cubic-bezier(0.55, 0, 0.85, 0.4); }
  84% { translate: 0 1px -2px; scale: 0.995; animation-timing-function: ease-out; }
  100% { translate: 0 0 0; scale: 1; }
}
@keyframes flip-shadow {
  0% { opacity: 0; transform: translate(0, 6px) scale(0.97); filter: blur(6px); animation-timing-function: cubic-bezier(0.3, 0.5, 0.45, 1); }
  42% { opacity: 0.3; transform: translate(10px, 34px) scale(1.06); filter: blur(18px); animation-timing-function: cubic-bezier(0.55, 0, 0.85, 0.4); }
  84% { opacity: 0.55; transform: translate(1px, 5px) scale(0.98); filter: blur(5px); animation-timing-function: ease-out; }
  100% { opacity: 0; transform: translate(0, 6px) scale(0.97); filter: blur(8px); }
}
/* Kaardi paksus: kaks kitsast kuldset serva pikkadel külgedel, risti kaardi tasapinnaga.
   Pöörde ajal paistavad laiusega paksus × sin(nurk). Serv on suunatud väljapoole ja tagakülg
   peidetud: nii paistab ainult vaataja poole tulev serv, mitte kauge serv läbi kaardi, ja
   otse vaates (alla ~4°) pole pikal küljel kuldset joont. */
.tarot-edge { position: absolute; inset: 0; transform-style: preserve-3d; pointer-events: none; }
.tarot-edge::before, .tarot-edge::after {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: -2.5px;
  width: 5px;
  background: linear-gradient(180deg, #b98a3c, var(--gold-2) 30%, var(--gold) 55%, #8a6327);
  transform: rotateY(-90deg);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.tarot-edge::after { left: auto; right: -2.5px; transform: rotateY(90deg); }
.tarot.face-only .tarot-edge { display: none; }
.tarot-back, .tarot-front {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}
.tarot-back, .tarot-front { box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(236, 192, 110, 0.15); }
.tarot-back svg, .tarot-front svg { display: block; width: 100%; height: 100%; }
.tarot-front { transform: rotateY(180deg); }
.tarot.face-only .tarot-front { transform: none; }
.tarot.face-only .tarot-back { display: none; }
/* Tagurpidi kaart on laual tervenisti tagurpidi, nagu päris taros */
.tarot.reversed .tarot-front { transform: rotateY(180deg) rotate(180deg); }
.tarot.face-only.reversed .tarot-front { transform: rotate(180deg); }
.tarot.flipped .tarot-front { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 26px rgba(236, 192, 110, 0.25); }

/* ---------- 5. Ennustus ---------- */
.reading-area { margin-top: 28px; }
.reading-controls { display: flex; justify-content: flex-end; }
.readings { display: grid; gap: 14px; margin-top: 10px; }
.reading-block { animation: rise 0.45s ease both; }
.reading-block h3 { margin: 0 0 4px; font-size: 22px; color: var(--gold-2); }
.reading-block h3 small { font-family: var(--sans); font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.reading-block p { margin: 0; font-size: 17px; }
.reading-block.speaking { border-color: var(--gold); }
.reading-block.summary { border-color: #d6ba8066; background: linear-gradient(180deg, rgba(214, 186, 128, 0.08), var(--panel)); }
.after { margin-top: 24px; }
.ask-form label { display: block; margin-bottom: 8px; font-family: var(--serif); font-size: 22px; color: var(--gold-2); }
.ask-row { display: flex; gap: 10px; }
.ask-row input { flex: 1; min-width: 0; }
.thread { display: grid; gap: 10px; margin-top: 12px; }
.thread .q { color: var(--muted); margin: 0; }
.thread .q b { color: #9fb2e6; font-weight: 500; }
.thread .a { margin: 0; font-size: 16px; }
.thread .a b { color: var(--gold); font-weight: 500; }

.disclaimer { position: relative; max-width: 760px; margin: 0 auto; padding: 8px 16px 36px; color: var(--muted); font-size: 13px; text-align: center; }
.disclaimer p { margin: 0 0 4px; }
.disclaimer .star { color: var(--gold); }
.disclaimer .support { color: #8f84a8; font-size: 12px; }

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

@media (max-width: 860px) {
  #s-birth { grid-template-columns: 1fr; gap: 20px; padding-top: 8px; }
  .chart-grid { grid-template-columns: 1fr; }
  .topics { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  :root { --card-w: 92px; --card-h: 152px; }
  .big-three { grid-template-columns: 1fr; }
  .topics { grid-template-columns: 1fr; }
  .fan { --card-w: 56px; --card-h: 92px; --fan-row: 34px; --fan-pad: 3px; --fan-arc: 6px; --fan-lift: 6px; }
  .slots { gap: 10px; }
  .slot { width: calc(var(--card-w) + 8px); }
  .ask-row { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body.talking .voice-orb { animation: talk 1.2s ease-in-out infinite; }
@keyframes talk { 50% { box-shadow: 0 0 34px rgba(214, 186, 128, 0.75); transform: scale(1.08); } }
