/* ============================================
   Tarot screens — общая «лунная» палитра + карты
   ============================================ */

/* ---- Intro: выбор расклада + поле вопроса ---- */

.tarot-intro {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tarot-intro__hint {
  text-align: center;
  color: rgba(220, 220, 240, 0.7);
  font-size: 0.95rem;
  margin: 0;
}

.tarot-phase-tip {
  margin: -0.2rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(248, 217, 132, 0.18);
  background: rgba(248, 217, 132, 0.08);
  color: rgba(245, 240, 255, 0.9);
  font-size: 0.88rem;
  line-height: 1.45;
  text-align: left;
}

.tarot-question {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(198, 156, 255, 0.25);
  border-radius: 14px;
  background: rgba(15, 12, 30, 0.65);
  color: rgba(245, 240, 255, 0.95);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s, background 0.18s;
}
/* Скрываем явно: [hidden] у инпутов легко перебивается любым правилом с
   display, а поле прячется при заходе по мосту (тема уже названа строкой). */
.tarot-question[hidden] {
  display: none;
}
.tarot-question:focus {
  border-color: rgba(248, 217, 132, 0.5);
  background: rgba(25, 18, 50, 0.75);
}

/* Просьба назвать ситуацию перед платным раскладом (03.08.2026).
   Тон реплики Люмиоры — тот же, что у .tarot-phase-tip, но с акцентом:
   это не подсказка мимоходом, а вопрос, на который ждут ответа. */
.tarot-ask {
  margin: -0.35rem 0 0;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(248, 217, 132, 0.35);
  background: rgba(248, 217, 132, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}
.tarot-ask__line {
  margin: 0;
  color: rgba(245, 240, 255, 0.92);
  font-size: 0.88rem;
  line-height: 1.45;
  text-align: left;
}
.tarot-ask__skip {
  background: none;
  border: none;
  padding: 0;
  color: rgba(220, 220, 240, 0.62);
  font-family: inherit;
  font-size: 0.82rem;
  text-decoration: underline;
  cursor: pointer;
}
.tarot-ask__skip:hover {
  color: rgba(245, 240, 255, 0.9);
}

.tarot-intro__error {
  margin: -0.35rem 0 0;
  color: #ff8e8e;
  font-size: 0.88rem;
  line-height: 1.4;
  text-align: center;
}

.tarot-spreads {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.tarot-spread-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(198, 156, 255, 0.18);
  border-radius: 14px;
  background: rgba(20, 16, 40, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s, border-color 0.18s, background 0.18s;
  font-family: inherit;
}
.tarot-spread-card:active {
  transform: scale(0.985);
  background: rgba(35, 25, 60, 0.7);
  border-color: rgba(198, 156, 255, 0.4);
}

.tarot-spread-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}
.tarot-spread-card__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(245, 240, 255, 0.95);
}
.tarot-spread-card__desc {
  font-size: 0.83rem;
  color: rgba(220, 220, 240, 0.6);
  line-height: 1.35;
}
.tarot-spread-card__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
}
.tarot-spread-card__icon { display: none; }
.tarot-spread-card__count {
  font-size: 0.8rem;
  color: rgba(248, 217, 132, 0.85);
  padding: 0.3rem 0.6rem;
  border: 1px solid rgba(248, 217, 132, 0.3);
  border-radius: 999px;
  white-space: nowrap;
}
.tarot-spread-card__price {
  font-size: 0.78rem;
  color: rgba(245, 240, 255, 0.92);
  background: rgba(248, 217, 132, 0.12);
  border: 1px solid rgba(248, 217, 132, 0.22);
  border-radius: 999px;
  padding: 0.32rem 0.65rem;
  white-space: nowrap;
}

/* ---- Spread view: карты + чат ---- */

/* Мобилка: колонка на всю высоту экрана. На десктопе .tarot-view — тот же
   элемент, что и .tool-desk (T-2.x доработка, см. комментарий ниже) —
   без max-width сюда полез бы display:flex этого правила (та же
   специфичность, но объявлено позже style.css) и перебивал бы
   .tool-desk{display:grid}, схлопывая карты/луну/чат в одну колонку слева. */
@media (max-width: 1023px) {
  .tarot-view {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 60px);
  }
}

.tarot-cards {
  padding: 1rem;
  display: flex;
  gap: 0.7rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.tarot-cards::-webkit-scrollbar { display: none; }
.tarot-cards { scrollbar-width: none; }

/* ---- Одна карта ---- */

.tarot-card {
  flex: 0 0 auto;
  width: 130px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  /* --i выставляется из JS: animation-delay = i * 80ms; масштабируется на любое число карт */
  animation: cardIn 0.5s ease-out backwards;
  animation-delay: calc(var(--i, 0) * 80ms);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) rotateX(40deg); }
  to   { opacity: 1; transform: translateY(0) rotateX(0); }
}

.tarot-card__position {
  font-size: 0.72rem;
  text-align: center;
  color: rgba(220, 220, 240, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tarot-card__face {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  border: 1.5px solid rgba(248, 217, 132, 0.35);
  background:
    radial-gradient(circle at 50% 25%, rgba(198, 156, 255, 0.18), transparent 60%),
    linear-gradient(160deg, #1a1438 0%, #0d0b22 100%);
  padding: 0.9rem 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
  font-family: inherit;
}

.tarot-card__face::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(248, 217, 132, 0.2);
  border-radius: 8px;
  pointer-events: none;
}

.tarot-card--reversed .tarot-card__face {
  border-color: rgba(248, 217, 132, 0.7);
  box-shadow: inset 0 0 0 1px rgba(248, 217, 132, 0.18);
}

.tarot-card__face:active {
  transform: scale(0.97);
  border-color: rgba(248, 217, 132, 0.7);
}

.tarot-card__number {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  color: rgba(248, 217, 132, 0.9);
  font-style: italic;
  line-height: 1;
}

.tarot-card__name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.05rem;
  text-align: center;
  color: rgba(245, 240, 255, 0.95);
  line-height: 1.15;
}

.tarot-card__meta {
  font-size: 0.7rem;
  text-align: center;
  color: rgba(220, 220, 240, 0.5);
}
.tarot-card--reversed .tarot-card__meta::before {
  content: '↻ ';
  color: rgba(248, 217, 132, 0.7);
}

/* ---- Подсветка активной карты в раскладе ---- */
.tarot-card.is-active .tarot-card__face {
  border-color: rgba(248, 217, 132, 0.9);
  box-shadow: 0 0 16px rgba(248, 217, 132, 0.35);
}

/* Мост после результата — общий .tool-bridge в style.css (Этап С3). */

/* ≥1024px: расклад встаёт в общий .tool-desk (T-2.x доработка) — карты
   слева, луна по центру, чат справа, как везде в приложении. Раньше у
   .tarot-view была своя грид-раскладка на 2 колонки без луны — заменена
   на общий каркас для единообразия с матрицей/астрологией/сонником. */
@media (min-width: 1024px) {
  .tarot-cards {
    flex-wrap: wrap;
    overflow: auto;
    justify-content: center;
    align-content: flex-start;
  }

  /* Выбор расклада: минималистичные квадратные плитки, все вместе в левой
     колонке — там же, где потом появятся разложенные карты (.tarot-cards
     в tarotSpreadScreen), чтобы клик по плитке справа не «перепрыгивал»
     результат налево. Вопрос — в правой колонке (см. .tarot-intro), там же,
     где после расклада появляется чат. */
  .tarot-spreads {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  .tarot-spread-card {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 150px;
    min-height: 150px;
    border-radius: 22px;
    gap: 0.5rem;
  }
  .tarot-spread-card__icon {
    display: block;
    color: var(--accent, #8b7cf7);
    opacity: 0.85;
  }
  .tarot-spread-card__icon svg { width: 26px; height: 26px; }
  .tarot-spread-card__body { align-items: center; text-align: center; flex: none; }
  .tarot-spread-card__desc { display: none; }
  .tarot-spread-card__meta { flex-direction: column; align-items: center; gap: 0.3rem; }
}
