:root {
  --purple-900: #2a0a4a;
  --purple-700: #5b21b6;
  --purple-500: #8b5cf6;
  --purple-200: #ddd6fe;
  --purple-50: #faf5ff;
  --text: #1f1235;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Vazirmatn", Tahoma, sans-serif;
  background: var(--purple-50);
  color: var(--text);
  line-height: 1.9;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hero {
  background: linear-gradient(135deg, var(--purple-900), var(--purple-700));
  color: #fff;
  text-align: center;
  padding: 2.5rem 1rem;
}
.hero h1 { font-size: 2rem; margin-bottom: .3rem; }
.hero p { opacity: .9; }
.site-title { color: #fff; text-decoration: none; font-size: 1.4rem; font-weight: 700; }

/* ---- Home: 2 columns on phone (2x4), 4 columns on desktop (4x2) ---- */
.home { max-width: 1000px; width: 100%; margin: 2rem auto; padding: 0 1rem; flex: 1; }
.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
}
@media (min-width: 768px) {
  .tiles { grid-template-columns: repeat(4, 1fr); gap: 1rem; }
}
.tile {
  position: relative;
  display: flex;
  align-items: flex-end;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  background-color: var(--purple-700);
  background-image: linear-gradient(135deg, var(--purple-900), var(--purple-500));
  background-size: cover;
  background-position: center;
  box-shadow: 0 4px 14px rgba(91, 33, 182, .18);
  transition: transform .15s;
}
.tile:hover { transform: translateY(-3px); }
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(42, 10, 74, .85), rgba(42, 10, 74, 0) 60%);
}
.tile-label {
  position: relative;
  z-index: 1;
  color: #fff;
  font-weight: 700;
  padding: .7rem;
  font-size: .95rem;
  line-height: 1.5;
}

/* ---- Inner pages ---- */
.page { max-width: 800px; width: 100%; margin: 2rem auto; padding: 0 1rem; flex: 1; }
.back {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--purple-700);
  text-decoration: none;
  font-weight: 700;
}
.card {
  background: #fff;
  border: 1px solid var(--purple-200);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 16px rgba(91, 33, 182, .08);
}
.card h1 { color: var(--purple-700); font-size: 1.5rem; margin-bottom: .75rem; }

.btn {
  display: inline-block;
  background: var(--purple-700);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .6rem 1.2rem;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s;
}
.btn:hover { background: var(--purple-500); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-outline { background: transparent; color: var(--purple-700); border: 2px solid var(--purple-700); }
.btn-outline:hover { background: var(--purple-50); }

.result {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--purple-50);
  border-radius: 12px;
  min-height: 3rem;
  text-align: center;
  font-size: 1.1rem;
  color: var(--purple-700);
}
.wheel-box { text-align: center; }

/* ---- گردونه ---- */
.wheel-box { text-align: center; padding: .25rem 0; }

.wheel-stage {
  position: relative;
  width: min(320px, 82vw);
  aspect-ratio: 1;
  margin: 1.75rem auto 1.5rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #fff6cf, #d4af37 42%, #8a6d1d 100%);
  box-shadow: 0 0 0 4px #2e1065, 0 12px 32px rgba(91, 33, 182, .45);
}

/* چراغ‌های دور گردونه */
.wheel-lights { position: absolute; inset: 0; border-radius: 50%; }
.wheel-lights span {
  position: absolute;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: #fffbe8;
  box-shadow: 0 0 6px 2px rgba(255, 240, 180, .9);
  animation: wheel-blink 1.2s infinite ease-in-out;
}
@keyframes wheel-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

/* صفحه‌ی اصلی گردونه */
.wheel-disc {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35), inset 0 0 18px rgba(0, 0, 0, .25);
  transition: transform 4s cubic-bezier(.17, .67, .12, .99);
}
.wheel-label {
  position: absolute;
  inset: 0;
  transform: rotate(var(--a));          /* متن از مرکز به سمت لبه می‌ره */
  pointer-events: none;
}
.wheel-label span {
  position: absolute;
  left: 62%;                            /* بعد از دکمه‌ی مرکزی شروع می‌شه */
  top: 50%;
  transform: translateY(-50%);
  width: 30%;
  direction: rtl;
  text-align: center;
  font-size: .62rem;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}
.wheel-label.flip span { transform: translateY(-50%) rotate(180deg); }  /* نیمه‌ی پایین: متن برعکس نشه */
.wheel-label.gold span { color: #2e1065; text-shadow: none; }

/* دکمه‌ی مرکزی */
.wheel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #d4af37;
  background: radial-gradient(circle at 35% 30%, #a78bfa, #2e1065 75%);
  box-shadow: 0 0 0 4px #d4af37, 0 4px 12px rgba(0, 0, 0, .4);
  z-index: 3;
}

/* نشانگر */
.wheel-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 30px solid #dc2626;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .4));
  z-index: 4;
}

/* دکمه و نتیجه */
#spin-btn {
  padding: .7rem 2.2rem;
  font-size: 1.05rem;
  box-shadow: 0 4px 14px rgba(91, 33, 182, .35);
  transition: transform .15s, opacity .2s;
}
#spin-btn:hover:not(:disabled) { transform: translateY(-2px); }
#spin-btn:disabled { opacity: .65; cursor: not-allowed; }

.result.pop { animation: wheel-pop .45s ease-out; }
@keyframes wheel-pop {
  0% { transform: scale(.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.placeholder {
  padding: 1.5rem;
  border: 2px dashed var(--purple-200);
  border-radius: 12px;
  text-align: center;
  color: #6b5b8a;
}

.contact-links { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }

.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.service { border: 1px solid var(--purple-200); border-radius: 12px; padding: 1rem; }
.service h3 { color: var(--purple-700); margin-bottom: .3rem; }
.price { font-size: .85rem; color: #6b5b8a; }

.steps { padding-right: 1.5rem; }
.steps li { margin-bottom: .4rem; }

footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--purple-700);
  font-size: .9rem;
}

/* ---- Tarot ---- */
[hidden] { display: none !important; }
.tarot-actions { text-align: center; margin: 1rem 0; }

/* فن کارت‌ها: کارت‌ها روی هم و کمی چرخیده */
.tarot-fan {
  position: relative;
  width: 100%;
  margin-top: 1rem;
}
.tarot-card {
  position: absolute;
  display: block;
  object-fit: contain;           /* هیچ کراپ/زوم */
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(42, 10, 74, .35);
  transform-origin: 50% 50%;
  transform: rotate(var(--r, 0deg)) translateY(var(--lift, 0px));
  transition: transform .2s, box-shadow .2s;
}
.tarot-card:hover { --lift: -6px; }
.tarot-card {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.tarot-card.selected {
  --lift: -18px;
  box-shadow: 0 0 0 3px #d4af37, 0 6px 14px rgba(212, 175, 55, .5);
}

.tarot-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: 1rem;
  color: var(--purple-700);
  font-weight: 700;
}

/* صفحه‌ی نتیجه */
.reveal-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .6rem;
  margin-top: 1rem;
}
.reveal-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  text-align: center;
  font-size: .95rem;
}
.reveal-item img {
  width: 100%;
  max-width: 150px;
  height: auto;                   /* نسبت اصلی کارت حفظ می‌شود */
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(42, 10, 74, .3);
}
.reveal-item img.reversed { transform: rotate(180deg); }
.interp { color: #4a3a66; font-size: .9rem; margin-top: .3rem; }
.code {
  font-family: monospace;
  direction: ltr;
  display: inline-block;
  background: var(--purple-50);
  padding: .1rem .5rem;
  border-radius: 6px;
}
.note { margin-top: 1rem; color: #6b5b8a; text-align: center; }

@media (max-width: 600px) {
  .reveal-grid { gap: .35rem; }
  .reveal-item { font-size: .75rem; }
  .reveal-item .interp { display: none; }
}

/* تفسیر کامل فال */
.reading-summary {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: var(--purple-50, #faf5ff);
  border: 1px solid var(--purple-200);
}
.reading-summary h2 { color: var(--purple-700); font-size: 1.1rem; margin-bottom: .4rem; }
.reading-section { margin-top: 1.25rem; }
.reading-section h2 {
  color: var(--purple-700);
  font-size: 1.05rem;
  padding-bottom: .3rem;
  border-bottom: 1px solid var(--purple-200);
  margin-bottom: .6rem;
}
.reading-section p { margin-bottom: .6rem; line-height: 1.9; }

.summary-headline { font-weight: 700; line-height: 1.9; margin-bottom: .8rem; }
.summary-meter { margin-bottom: .9rem; }
.meter-label { display: flex; justify-content: space-between; font-size: .9rem; color: var(--purple-700); margin-bottom: .3rem; }
.meter-bar { height: 10px; border-radius: 999px; background: var(--purple-200); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 999px; background: var(--purple-700); }
.summary-list { list-style: none; margin: 0; padding: 0; }
.summary-list li { display: flex; gap: .7rem; padding: .65rem 0; border-top: 1px dashed var(--purple-200); }
.summary-list .s-icon { font-size: 1.3rem; line-height: 1.6; }
.summary-list strong { color: var(--purple-700); font-size: .95rem; }
.summary-list p { margin: .1rem 0 0; line-height: 1.9; }


/* ---- استخاره‌ی قرآنی ---- */
.ist-intro, .ist-stage { text-align: center; }
.ist-intro p { margin-bottom: 1rem; }
.ist-stage { padding: .5rem 0 1rem; }
.ist-prompt {
  color: var(--purple-700);
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 1.25rem;
}
.ist-circle {
  position: relative;
  width: min(220px, 62vw);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #ffffff, var(--purple-50) 70%);
  box-shadow: 0 8px 28px rgba(91, 33, 182, .25);
  animation: ist-breathe 3s ease-in-out infinite;
}
.ist-circle svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ist-ring-bg, .ist-ring { fill: none; stroke-width: 6; }
.ist-ring-bg { stroke: var(--purple-200); }
.ist-ring { stroke: var(--purple-700); stroke-linecap: round; }
.ist-count {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  font-weight: 700;
  color: var(--purple-700);
}
.ist-count.tick { animation: ist-tick .9s ease-out; }
@keyframes ist-tick {
  0%   { transform: scale(1.5); opacity: 0; }
  25%  { transform: scale(1);   opacity: 1; }
  100% { transform: scale(.92); opacity: .85; }
}
@keyframes ist-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  .ist-circle, .ist-count.tick { animation: none; }
}

/* صفحه‌ی نتیجه */
.ist-result { --tone: var(--purple-700); --tone-bg: var(--purple-50); }
.ist-result.tone-good { --tone: #15803d; --tone-bg: #f0fdf4; }
.ist-result.tone-bad  { --tone: #b91c1c; --tone-bg: #fef2f2; }
.ist-result.tone-mid  { --tone: #b45309; --tone-bg: #fffbeb; }
.ist-verdict {
  margin: 1rem 0 .5rem;
  padding: 1.1rem 1rem;
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--tone);
  background: var(--tone-bg);
  border: 2px solid var(--tone);
  border-radius: 14px;
}
.ist-ref { text-align: center; color: #6b5b8a; margin-bottom: 1rem; }
.ist-item {
  padding: .9rem 1rem;
  margin-bottom: .75rem;
  border-radius: 12px;
  background: var(--purple-50);
  border: 1px solid var(--purple-200);
}
.ist-item h2 { color: var(--purple-700); font-size: 1.05rem; margin-bottom: .25rem; }
.ist-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1.25rem; }
