/* Экран «Расклады Таро» (views/tarot.js). Только классы с префиксом tarot- (плюс общий «Набор для экранов» из app.css
 * и карта today-tcard из today.css). Телефон — одна колонка; от 760 px — две панели. Без горизонтальной прокрутки на
 * 360 px: стол считает ширину карты от ширины колонки (tarot.js, sizeTable). */
.tarot-page { padding-bottom: 8px; }
.tarot-page [hidden] { display: none !important; }
.tarot-layout { display: grid; gap: 14px; min-width: 0; }
.tarot-side, .tarot-main { min-width: 0; }

/* ── выбор расклада ─────────────────────────────────────────────── */
.tarot-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tarot-chip { font-size: 13px; }
.tarot-chip[aria-pressed="true"] { color: var(--accent); border-color: var(--line-strong); background: rgba(var(--accent-rgb), .14); }
.tarot-list { display: grid; gap: 8px; }
.tarot-spread {
  display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 12px; width: 100%; padding: 12px 14px 12px 10px; text-align: left;
  border-radius: 18px; border: 1px solid var(--glass-line); background: rgba(18,26,58,.42);
  transition: border-color .25s ease, background .25s ease;
}
.tarot-spread[aria-pressed="true"] { border-color: var(--line-strong); background: rgba(var(--accent-rgb), .1); box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .3); }
.tarot-spread.is-locked { opacity: .78; }
.tarot-spread__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tarot-spread__fan { position: relative; height: 50px; }
.tarot-spread__card {
  position: absolute; left: 50%; bottom: 2px; width: 26px; height: 42px; margin-left: -13px; border-radius: 4px;
  background: #1a2350 url("../assets/tarot/back.webp?v=1") center / cover no-repeat;
  box-shadow: 0 0 0 1px var(--line), 0 4px 10px rgba(0, 0, 0, .45);
  transform: rotate(var(--r, 0deg)); transform-origin: 50% 120%;
}
.tarot-spread__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tarot-spread__title { font: 400 17px/1.2 var(--f-head); color: var(--cream); }
.tarot-spread__meta { font-size: 12px; color: var(--gold); letter-spacing: .02em; }
.tarot-spread__about { font-size: 13px; line-height: 1.4; color: var(--muted); }
.tarot-lock {
  flex: none; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
  color: #d6d0ff; background: rgba(var(--violet-rgb), .18); border: 1px solid rgba(var(--violet-rgb), .4);
}
.tarot-spread:focus-visible, .tarot-chip:focus-visible, .tarot-example:focus-visible, .tarot-card:focus-visible,
.tarot-recent__item:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 2px; }

.tarot-current { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; }
.tarot-current__title { grid-column: 1; margin: 0; font: 400 19.5px/1.2 var(--f-head); color: var(--cream); }
.tarot-current__meta { grid-column: 1; margin: 0; }
.tarot-current__change { grid-column: 2; grid-row: 1 / span 2; }

/* ── вопрос ─────────────────────────────────────────────────────── */
.tarot-ask__label { display: block; margin: 0 2px 8px; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.tarot-field { position: relative; margin-bottom: 10px; }
.tarot-field__input {
  display: block; width: 100%; min-height: 84px; max-height: 180px; resize: none; padding: 12px 14px 24px;
  border-radius: 16px; border: 1px solid var(--glass-line); background: rgba(11,16,38,.45); color: var(--text);
  font: 400 16px/1.45 var(--sans); outline: 0; transition: border-color .3s ease, box-shadow .3s ease;
}
.tarot-field__input:focus { border-color: var(--gold-soft); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .08); }
.tarot-field__input::placeholder { color: rgba(var(--text-rgb), .42); font-style: italic; }
.tarot-field__input:disabled { opacity: .55; }
.tarot-field__count { position: absolute; right: 13px; bottom: 7px; font-size: 11.5px; color: rgba(var(--text-rgb), .42); pointer-events: none; }
.tarot-field__count.is-near { color: var(--gold); }
.tarot-examples { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tarot-example { max-width: 100%; text-align: left; line-height: 1.3; white-space: normal; overflow-wrap: anywhere; }
.tarot-cost { margin: 8px 4px 0; text-align: center; }
.tarot-left { margin: 6px 4px 0; text-align: center; font-size: 13.5px; font-weight: 600; color: var(--cream); }

/* ── «Мои расклады» ─────────────────────────────────────────────── */
.tarot-recent__list { display: grid; gap: 6px; }
.tarot-recent__item {
  display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 10px 14px; text-align: left;
  border-radius: 16px; border: 1px solid rgba(var(--accent-rgb), .14); background: rgba(18,26,58,.32);
}
.tarot-recent__title { font: 500 14.5px/1.25 var(--f-body); color: var(--cream); }
.tarot-recent__meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── стол ───────────────────────────────────────────────────────── */
.tarot-modes { margin-bottom: 12px; }
.tarot-stage { min-width: 0; }
.tarot-asked { margin: 2px 8px 12px; text-align: center; font: italic 400 15.5px/1.4 var(--f-body); color: var(--muted); overflow-wrap: anywhere; }
.tarot-table-wrap { display: flex; justify-content: center; padding: 6px 0 10px; overflow: hidden; }
.tarot-table { position: relative; flex: none; --cw: 90px; --ch: 135px; }
.tarot-slot { position: absolute; width: var(--cw); height: var(--ch); }
.tarot-slot .today-tcard { width: 100%; }
.tarot-slot.is-across { transform: rotate(90deg); z-index: 2; }
.tarot-slot__num {
  position: absolute; top: -7px; left: -7px; z-index: 3; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--on-accent);
  background: var(--grad-accent); box-shadow: 0 2px 8px rgba(5,8,24,.5);
}
.tarot-slot.is-across .tarot-slot__num { transform: rotate(-90deg); }
.tarot-table-wrap.is-empty .tarot-card { opacity: .5; }
.tarot-table-wrap.is-shuffling .tarot-card { animation: tarot-breathe 2.4s ease-in-out infinite; }
.tarot-table-wrap.is-shuffling .tarot-slot:nth-child(2n) .tarot-card { animation-delay: .4s; }
@keyframes tarot-breathe { 50% { transform: translateY(-4px); } }
.tarot-phrase { min-height: 1.4em; margin: 6px 0 0; text-align: center; font: 400 16px var(--f-head); color: var(--muted); }
.tarot-legend {
  margin: 4px 0 0; padding: 0 0 0 1.6em; display: grid; gap: 3px;
  font: 400 13.5px/1.4 var(--f-body); color: var(--text-2);
}
.tarot-legend b { font-weight: 500; color: var(--gold); }

/* позиция карты по тапу (в «Столе») */
.tarot-pop { margin: 12px 0 0; text-align: center; }
.tarot-pop__pos { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.tarot-pop__hint { margin-top: 2px; font-size: 13px; color: var(--muted); }
.tarot-pop__name { margin: 6px 0 0; font: 400 19.5px/1.2 var(--f-head); color: var(--cream); }
.tarot-pop__orient { margin: 2px 0 8px; font-size: 12px; color: var(--muted); }
.tarot-pop__close { margin-top: 10px; }

/* «По картам» */
.tarot-bycard { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tarot-bycard__item { display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: start; margin: 0; }
.tarot-bycard__body { min-width: 0; }
.tarot-bycard__body .tarot-pop__name { margin-top: 4px; font-size: 19px; }
.tarot-bycard__body .card__text { font-size: 15.5px; }

/* ── чтение и связи ─────────────────────────────────────────────── */
.tarot-reading-box { margin-top: 12px; }
.tarot-reading__title { margin: 0 0 8px; font: 400 19.5px/1.2 var(--f-head); color: var(--cream); }
.tarot-lean { margin: 0 0 10px; }
.tarot-links { border-color: rgba(var(--accent-rgb), .42); background: linear-gradient(180deg, rgba(var(--accent-rgb), .09), rgba(18,26,58,.46)); }
.tarot-links__title { margin: 0 0 10px; font: 500 12px var(--f-head); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.tarot-links__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tarot-link { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.tarot-link__icon {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; line-height: 1;
  color: var(--gold); background: rgba(var(--accent-rgb), .12); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .3);
}
.tarot-link__text { font: 400 14.5px/1.45 var(--f-body); color: var(--text-2); }
.tarot-link.is-locked .tarot-link__text { color: var(--muted); font-style: italic; }
.tarot-link.is-locked .tarot-link__icon { color: var(--muted); background: rgba(255,255,255,.04); box-shadow: none; }
.tarot-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.tarot-actions__note { margin: 8px 4px 0; text-align: center; }
.tarot-soft { margin-top: 4px; }

/* ── шторка выбора (телефон) ────────────────────────────────────── */
.tarot-sheet { position: fixed; inset: 0; z-index: 10; display: grid; align-items: end; background: rgba(5,8,24,.55); }
.tarot-sheet[hidden] { display: none; }
.tarot-sheet__card {
  max-height: 82vh; overflow-y: auto; overscroll-behavior: contain;
  margin: 0 10px calc(10px + var(--safe-b)); padding: 16px 16px 18px; border-radius: 26px;
  background: linear-gradient(180deg, rgba(26,36,78,.97), rgba(14,22,50,.99)); border: 1px solid var(--glass-line);
}
.tarot-sheet__head { margin-bottom: 10px; }
.tarot-sheet__title { margin: 0; font: 300 22.5px var(--f-head); color: var(--cream); }

.tarot-error { display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* ── широкий экран: две панели ──────────────────────────────────── */
@media (min-width: 760px) and (max-width: 959.98px), (min-width: 1200px) {
  .tarot-layout { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 22px; align-items: start; }
  .tarot-side { position: sticky; top: 0; }
  .tarot-current { display: none; }
  .tarot-picker--side { margin-bottom: 12px; }
  .tarot-list { max-height: 46vh; overflow-y: auto; padding-right: 4px; }
  .tarot-pop { max-width: 420px; margin-left: auto; margin-right: auto; }
}
@media (max-width: 759.98px), (min-width: 960px) and (max-width: 1199.98px) {
  .tarot-picker--side { display: none; }
}
@media (max-width: 380px) {
  .tarot-actions { grid-template-columns: 1fr; }
  .tarot-bycard__item { grid-template-columns: 60px 1fr; gap: 10px; }
}

@media (prefers-reduced-motion: no-preference) {
  .tarot-pop, .tarot-reading, .tarot-links { animation: rise .45s ease both; }
}
@media (prefers-reduced-motion: reduce) {
  .tarot-table-wrap.is-shuffling .tarot-card { animation: none; }
  .tarot-spread { transition: none; }
}
