/* ============================================================
   «12 энергий» — стили мини-приложения
   Светлая тёплая палитра, без эзотерики. Шрифты: Cormorant
   Garamond (заголовки), Inter (текст и интерфейс).
   ============================================================ */

/* ───────── Переменные ───────── */
:root {
  --bg-top: #FDFBF7;
  --bg-bottom: #F3EDE2;
  --surface: #FFFFFF;
  --primary: #CC7C5E;
  --primary-hover: #B5654A;
  --secondary: #9DAE9C;
  --sand: #E8DECE;
  --bronze: #C9A66B;
  --text: #3B3329;
  --text-soft: #837868;
  --line: rgba(232, 222, 206, 0.85);

  --gold: #E0B765;
  --pearl: #BCB4A6;
  --terra: #C77F6A;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-soft: 0 8px 26px rgba(120, 95, 70, 0.10);
  --shadow-card: 0 12px 32px rgba(120, 95, 70, 0.16);
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ───────── Сброс ───────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  color: var(--text);
  background: linear-gradient(178deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
input, textarea { font-family: inherit; }
svg { display: block; }

/* ───────── Каркас приложения ───────── */
.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
}

@media (min-width: 520px) {
  .app {
    box-shadow: 0 0 80px rgba(120, 95, 70, 0.14);
  }
}

/* ───────── Шапка ───────── */
.app-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(253, 251, 247, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text);
}

.help-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  font-size: 13px;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.help-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.help-btn:hover { background: rgba(204, 124, 94, 0.10); color: var(--primary); }

/* ───────── Основная область ───────── */
.app-main {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 22px 20px 28px;
}

/* ───────── Экраны ───────── */
.screen { display: none; }
.screen.is-active {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100%;
  animation: screen-in 0.45s var(--ease) both;
}
.screen-register.is-active {
  justify-content: center;
  align-items: center;
  text-align: center;
}
.screen-register .form { width: 100%; max-width: 360px; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ───────── Типографика экранов ───────── */
.screen-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.18;
  color: var(--text);
}

.screen-lead {
  font-size: 15px;
  line-height: 1.62;
  color: var(--text-soft);
}

.hint {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-soft);
  padding-left: 12px;
  border-left: 2px solid var(--sand);
}

.callout {
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-size: 14.5px;
  line-height: 1.58;
  color: var(--text);
  background: #f2eee6;
  border: 1px solid rgba(201, 166, 107, 0.45);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
}
.callout-question {
  background: #f2eee6;
  border-color: rgba(201, 166, 107, 0.45);
  text-align: center;
  color: var(--text);
}

/* ───────── Кнопки ───────── */
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 8px; }
.actions-grid { gap: 9px; }

.btn {
  width: 100%;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 14px;
  transition: transform 0.2s var(--ease), background 0.25s var(--ease),
              box-shadow 0.25s var(--ease), color 0.25s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn:disabled:active { transform: none; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 20px rgba(204, 124, 94, 0.30);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }

.btn-soft {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
}
.btn-soft:hover:not(:disabled) { background: #FFFDF9; border-color: var(--bronze); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover:not(:disabled) { background: rgba(201, 166, 107, 0.12); }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ───────── Обложка (заглушка) ───────── */
.cover {
  position: relative;
  height: 188px;
  border-radius: var(--radius);
  background: linear-gradient(140deg, #F4E7D4 0%, #E9D9C2 60%, #E2CDB0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cover-banner {
  height: auto;
  aspect-ratio: 16 / 9;
  background: #F4E7D4;
}
.cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cover::before {
  content: '';
  position: absolute;
  width: 220px; height: 220px;
  top: -90px; right: -60px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55), transparent 70%);
}
.cover-title {
  position: relative;
  font-family: 'Cormorant Garamond', serif;
  font-size: 44px;
  font-weight: 600;
  line-height: 1.0;
  text-align: center;
  color: var(--text);
  letter-spacing: 0.5px;
}

/* ───────── Слот под видео ───────── */
.media-slot {
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.media-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  aspect-ratio: 16 / 9;
  background: rgba(255, 255, 255, 0.55);
  border: 1.5px dashed var(--bronze);
  border-radius: var(--radius-sm);
}
.media-play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
}
.media-play svg { width: 20px; height: 20px; fill: currentColor; margin-left: 3px; }
.media-text { font-size: 13px; color: var(--text-soft); }
.media-slot iframe, .media-slot video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  display: block;
}

/* ───────── Слот под аудио ───────── */
.audio-slot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: #F4ECD8;
  border: 1px solid rgba(201, 166, 107, 0.45);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
}
.audio-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--text);
}
.audio-slot audio {
  width: 100%;
  height: 40px;
}

/* ───────── Формы ───────── */
.form { display: flex; flex-direction: column; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-label { font-size: 13px; font-weight: 500; color: var(--text-soft); }

.field input, .field textarea, textarea[data-input] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  padding: 13px 14px;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field textarea, textarea[data-input] { resize: vertical; min-height: 80px; line-height: 1.5; }
.field input:focus, .field textarea:focus, textarea[data-input]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(204, 124, 94, 0.14);
}
.field input::placeholder, textarea::placeholder { color: #B6AB9B; }
.field input[readonly] { background: #F7F2E9; color: var(--text-soft); }

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 12px;
  cursor: pointer;
}
.checkbox input {
  width: 18px; height: 18px;
  margin-top: 1px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.form-note { font-size: 13px; color: var(--text-soft); margin-bottom: 14px; }
.form-note a { color: var(--primary); }
.form-error {
  font-size: 13px;
  color: var(--terra);
  margin-bottom: 12px;
}

/* ───────── Шаги инструкции ───────── */
.steps { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.step-num {
  flex-shrink: 0;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px; font-weight: 600;
  color: var(--primary);
  background: rgba(204, 124, 94, 0.12);
  border-radius: 50%;
}
.steps li div { font-size: 15px; line-height: 1.5; padding-top: 3px; }
.steps b { color: var(--text); font-weight: 600; }

/* ───────── Примеры запросов ───────── */
.examples {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  box-shadow: var(--shadow-soft);
}
.examples-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 10px;
}
.examples ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.examples li {
  position: relative;
  padding-left: 16px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
}
.examples li::before {
  content: '';
  position: absolute;
  left: 0; top: 9px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--bronze);
}

/* ───────── Колоды карт ───────── */
.deck-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}
.deck-row {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.deck-row .deck-tile { flex: 1; max-width: 130px; }

/* Карта-рубашка (общий вид) */
.cardback {
  position: relative;
  background: linear-gradient(155deg, #F2E5D2 0%, #E7D6BE 100%);
  border: 1px solid var(--sand);
}
.cardback::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(201, 166, 107, 0.5);
  border-radius: 9px;
}

/* Когда у группы есть готовая обложка-картинка — используем её
   вместо CSS-градиента. Путь к картинке прописывается inline. */
.cardback.has-cover {
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #FAF5EB;
  border-color: transparent;
}
.cardback.has-cover::before { display: none; }

.states-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 8px 0 4px;
}
.state-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.6;
}
.state-info > div { line-height: 1.6; }
.state-info b { display: block; margin-bottom: 2px; }
.state-dot {
  flex-shrink: 0;
  width: 12px; height: 12px;
  border-radius: 50%;
  margin-top: 7px;
}

.tile-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* На экране выбора сферы заголовок и подсказку делаем
   крупнее и плотнее — текст становится главным акцентом
   рядом с одинаковыми рубашками карт. */
[data-screen="sphere-pick"] .screen-title {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.12;
}

[data-screen="instruction"] .screen-title,
[data-screen="request"] .screen-title,
[data-screen="sphere-pick"] .screen-title,
[data-screen="energy"] .screen-title,
[data-screen="state-result"] .screen-title,
[data-screen="gift-result"] .screen-title,
[data-screen="summary"] .screen-title {
  text-align: center;
}
[data-screen="sphere-pick"] .screen-lead {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

.deck-tile {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.deck-tile:hover { transform: translateY(-5px); box-shadow: var(--shadow-card); }
.deck-tile:active { transform: translateY(-2px) scale(0.98); }

.tile-num {
  position: relative;
  font-family: 'Cormorant Garamond', serif;
  font-size: 27px;
  font-weight: 600;
  color: var(--primary);
}
.tile-emblem {
  position: relative;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1.6px solid rgba(204, 124, 94, 0.55);
}
.tile-emblem::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1.6px solid rgba(204, 124, 94, 0.55);
}

.tile-name {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 8px;
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #FFF7EA;
  text-shadow: 0 1px 4px rgba(40, 26, 12, 0.75),
               0 0 10px rgba(40, 26, 12, 0.45);
  pointer-events: none;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-3.5deg); }
  75% { transform: rotate(3.5deg); }
}
.is-shuffling .deck-tile,
.is-shuffling .deck-card { animation: wiggle 0.42s var(--ease); }

/* ───────── Карта результата (переворот) ───────── */
.result-card-wrap { display: flex; justify-content: center; }

.flip-card {
  width: 196px;
  aspect-ratio: 3 / 4.15;
  perspective: 1300px;
}
.flip-card-inner {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.75s var(--ease);
}
.flip-card.is-open .flip-card-inner { transform: rotateY(180deg); }

.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 16px;
  overflow: hidden;
}
.flip-back {
  display: flex;
  align-items: center;
  justify-content: center;
}
.flip-back .tile-emblem { width: 46px; height: 46px; }
.flip-back .tile-emblem::after { inset: 9px; }

.flip-front {
  transform: rotateY(180deg);
  background: transparent;
  display: flex;
  flex-direction: column;
}
/* Если у карты нет картинки (заглушка) — даём ей мягкую рамку,
   чтобы плейсхолдер не выглядел голым. */
.flip-card:not(.has-image) .flip-front {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.card-img {
  flex: 1;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}
.card-img.is-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #F6EEE0, #EDE0CC);
}
.card-caption {
  padding: 10px 12px 12px;
  text-align: center;
}
.card-kicker {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 3px;
}
.card-title {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--text);
}

/* ───────── Тело результата ───────── */
.result-body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 42vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--bronze) transparent;
}
.result-body::-webkit-scrollbar { width: 6px; }
.result-body::-webkit-scrollbar-thumb {
  background: var(--bronze);
  border-radius: 999px;
  opacity: 0.5;
}
.info-block { display: flex; flex-direction: column; gap: 4px; }
.info-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--secondary);
}
.info-block p { font-size: 14.5px; line-height: 1.58; color: var(--text); }
.reflection-q {
  font-size: 14.5px;
  line-height: 1.58;
  color: var(--text);
}

/* ───────── Заглушка голосового сообщения ───────── */
.voice-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #F4ECD8;
  border: 1px solid rgba(201, 166, 107, 0.45);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
}
.voice-play {
  flex-shrink: 0;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: 0;
  opacity: 0.85;
  cursor: default;
}
.voice-play svg { width: 18px; height: 18px; fill: currentColor; margin-left: 2px; }
.voice-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.voice-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 22px;
}
.voice-wave span {
  display: block;
  flex: 1;
  background: rgba(204, 124, 94, 0.55);
  border-radius: 2px;
}
.voice-wave span:nth-child(1)  { height: 30%; }
.voice-wave span:nth-child(2)  { height: 55%; }
.voice-wave span:nth-child(3)  { height: 75%; }
.voice-wave span:nth-child(4)  { height: 45%; }
.voice-wave span:nth-child(5)  { height: 90%; }
.voice-wave span:nth-child(6)  { height: 60%; }
.voice-wave span:nth-child(7)  { height: 40%; }
.voice-wave span:nth-child(8)  { height: 80%; }
.voice-wave span:nth-child(9)  { height: 55%; }
.voice-wave span:nth-child(10) { height: 35%; }
.voice-wave span:nth-child(11) { height: 65%; }
.voice-wave span:nth-child(12) { height: 85%; }
.voice-wave span:nth-child(13) { height: 50%; }
.voice-wave span:nth-child(14) { height: 70%; }
.voice-wave span:nth-child(15) { height: 40%; }
.voice-wave span:nth-child(16) { height: 60%; }
.voice-wave span:nth-child(17) { height: 30%; }
.voice-wave span:nth-child(18) { height: 50%; }
.voice-wave span:nth-child(19) { height: 35%; }
.voice-wave span:nth-child(20) { height: 25%; }
.voice-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: var(--text-soft);
}
.voice-label { font-weight: 500; }
.voice-time { font-variant-numeric: tabular-nums; }

/* ───────── Шапка результата (дар) ───────── */
.result-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.result-head-kicker {
  font-family: 'Cormorant Garamond', serif;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 6px;
}
.result-head-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}

/* ───────── Колода дара ───────── */
.gift-deck {
  position: relative;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.deck-card {
  position: absolute;
  width: 168px;
  aspect-ratio: 3 / 4;
  border-radius: 15px;
  background: linear-gradient(155deg, #F2E5D2 0%, #E7D6BE 100%);
  border: 1px solid var(--sand);
  box-shadow: 0 6px 18px rgba(120, 95, 70, 0.10);
  transition: transform 0.4s var(--ease), opacity 0.4s var(--ease);
}
.deck-card::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(201, 166, 107, 0.5);
  border-radius: 10px;
}
.deck-card.has-cover {
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #FAF5EB;
  border-color: transparent;
}
.deck-card.has-cover::before { display: none; }
.deck-card:nth-child(1) { transform: rotate(-8deg) translateX(-10px); }
.deck-card:nth-child(2) { transform: rotate(-3deg) translateX(-4px); }
.deck-card:nth-child(3) { transform: rotate(3deg) translateX(4px); }
.deck-card-top { transform: rotate(0); }
.gift-deck.is-drawing .deck-card-top {
  transform: translateY(-30px) scale(1.04);
  box-shadow: var(--shadow-card);
}

/* ───────── Итоговая карточка ───────── */
.summary-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.summary-head {
  padding: 16px 18px;
  background: linear-gradient(135deg, #F4E7D4, #EAD9C0);
  text-align: center;
}
.summary-head-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}
.summary-head-date { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.summary-rows { padding: 6px 18px 12px; }
.summary-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.summary-row:last-child { border-bottom: 0; }
.summary-key {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 3px;
}
.summary-val { display: block; font-size: 15px; line-height: 1.5; color: var(--text); }
.summary-row.is-gift .summary-val {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--primary-hover);
}

/* ───────── Текст для агента ───────── */
.agent-text-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.agent-text-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--secondary);
}
.agent-text {
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  background: #F8F3EA;
  border-radius: var(--radius-sm);
  padding: 14px;
}

/* ───────── Что дальше ───────── */
.next-list { display: flex; flex-direction: column; gap: 10px; }
.next-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  padding: 15px 17px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease),
              border-color 0.22s var(--ease);
}
.next-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); border-color: var(--bronze); }
.next-title { font-size: 15px; font-weight: 600; color: var(--text); }
.next-desc { font-size: 13px; color: var(--text-soft); }

/* ───────── История раскладов ───────── */
.history-note {
  background: rgba(157, 174, 156, 0.16);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
}
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-soft);
}
.history-date { font-size: 12px; color: var(--text-soft); }
.history-request {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 17px;
  line-height: 1.35;
  color: var(--text);
  margin: 4px 0 10px;
}
.history-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(201, 166, 107, 0.16);
  color: var(--text);
}
.chip-gift { background: rgba(204, 124, 94, 0.16); color: var(--primary-hover); }

.empty-state {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
  padding: 30px 10px;
  color: var(--text-soft);
}
.empty-state p { font-size: 15px; line-height: 1.55; }
.empty-state .btn { max-width: 260px; }

/* ───────── Нижнее меню ───────── */
.bottom-nav {
  flex-shrink: 0;
  display: flex;
  background: rgba(253, 251, 247, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px 4px 10px;
  background: transparent;
  border: 0;
  color: var(--text-soft);
  transition: color 0.22s var(--ease);
}
.nav-item svg {
  width: 24px; height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-item span { font-size: 11px; font-weight: 600; letter-spacing: 0.1px; }
.nav-item { color: var(--text); }
.nav-item.is-active { color: var(--primary); }
.nav-item.is-active svg { stroke-width: 2.6; }
.nav-item:hover { color: var(--primary); }

/* ───────── Тост ───────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  max-width: 340px;
  width: max-content;
  padding: 12px 20px;
  font-size: 13.5px;
  text-align: center;
  color: #FFF7EE;
  background: rgba(59, 51, 41, 0.96);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(59, 51, 41, 0.28);
  z-index: 60;
  animation: toast-in 0.3s var(--ease) both;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ───────── Диалог ───────── */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(59, 51, 41, 0.42);
  z-index: 70;
  animation: fade-in 0.25s var(--ease) both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.dialog {
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-card);
  animation: pop-in 0.28s var(--ease) both;
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
.dialog-text { font-size: 15px; line-height: 1.55; color: var(--text); margin-bottom: 18px; }
.dialog-actions { display: flex; gap: 10px; }
.dialog-actions .btn { padding: 12px 16px; }

/* ───────── Адаптив ───────── */
@media (max-width: 360px) {
  .app-main { padding: 18px 16px 24px; }
  .screen-title { font-size: 27px; }
  .deck-grid { gap: 7px; }
  .flip-card { width: 172px; }
}

/* ───────── Документ PDF (вне экрана, для html2pdf) ───────── */
.pdf-doc {
  box-sizing: border-box;
  width: 718px;
  background: #FFFFFF;
  color: #3B3329;
  font-family: 'Inter', sans-serif;
  padding: 18px 30px 26px;
}
.pdf-doc *, .pdf-doc *::before, .pdf-doc *::after { box-sizing: border-box; }
.pdf-top { text-align: center; padding-bottom: 16px; border-bottom: 2px solid #E8DECE; }
.pdf-brand { font-family: 'Cormorant Garamond', serif; font-size: 30px; font-weight: 600; }
.pdf-sub {
  font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase;
  color: #9DAE9C; margin-top: 3px;
}
.pdf-meta { font-size: 13px; color: #837868; margin-top: 9px; }

.pdf-request {
  margin: 20px 0;
  padding: 14px 18px;
  background: #F8F3EA;
  border-radius: 12px;
}
.pdf-req-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.6px;
  text-transform: uppercase; color: #9DAE9C;
}
.pdf-req-text {
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: 19px; line-height: 1.4; margin-top: 4px;
}

.pdf-section {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #EFE7D9;
  page-break-inside: avoid;
}
.pdf-section:last-of-type { border-bottom: 0; }
.pdf-sec-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.pdf-card-img {
  width: 58px; height: 78px; border-radius: 8px; flex-shrink: 0;
  background-size: cover; background-position: center;
}
.pdf-card-img--ph {
  background: linear-gradient(155deg, #F2E5D2, #E7D6BE);
  display: flex; align-items: center; justify-content: center;
}
.pdf-card-img--ph span {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.6px solid rgba(204, 124, 94, 0.55);
}
.pdf-sec-kicker {
  font-size: 11px; font-weight: 600; letter-spacing: 0.6px;
  text-transform: uppercase; color: #9DAE9C;
}
.pdf-sec-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 23px; font-weight: 600; line-height: 1.15;
}
.pdf-field { font-size: 13.5px; line-height: 1.6; margin-top: 6px; }

.pdf-question {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 18px;
  text-align: center;
  color: #B5654A;
  padding: 14px 20px;
  background: rgba(204, 124, 94, 0.10);
  border-radius: 12px;
  margin-top: 6px;
}
.pdf-footer { text-align: center; font-size: 12px; color: #837868; margin-top: 20px; }

/* ───────── Уменьшенная анимация ───────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .flip-card.is-open .flip-card-inner { transition: none; }
}
