@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --bg: #0a0710;
  --surface: #19132a;
  --surface-2: #221a37;
  --border: rgba(230, 218, 255, 0.1);
  --border-strong: rgba(230, 218, 255, 0.2);
  --text: #f4efff;
  --muted: #a99fc6;
  --muted-2: #81769f;
  --accent: #c9a6ff;
  --accent-deep: #8f6ee0;
  --gold: #e5c78f;
  --spark-gold: #d4af37;
  --radius: 16px;
  --app-width: min(100%, 480px);
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --font-card: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-scale: 1.1;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 80% at 50% -12%, rgba(122, 82, 200, .18), transparent 62%),
    radial-gradient(ellipse 80% 60% at 12% 6%, rgba(54, 70, 150, .12), transparent 70%);
  z-index: 0;
}

/* Deep velvet sky with slowly drifting golden dust */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 75% at 50% -14%, rgba(126, 86, 205, .22), transparent 62%),
    radial-gradient(ellipse 90% 65% at 12% 4%, rgba(54, 70, 150, .13), transparent 70%),
    repeating-radial-gradient(circle at 18% 24%, rgba(255, 255, 255, .014) 0 1px, transparent 1px 4px),
    repeating-radial-gradient(circle at 72% 68%, rgba(201, 166, 255, .012) 0 1px, transparent 1px 5px);
}

.spark {
  position: absolute;
  top: 100vh;
  left: var(--x);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: var(--spark-gold);
  box-shadow: 0 0 6px rgba(212, 175, 55, .7), 0 0 12px rgba(255, 215, 0, .35);
  opacity: 0;
  will-change: transform, opacity;
  animation: spark-rise var(--duration) linear var(--delay) infinite;
}

@keyframes spark-rise {
  0%   { transform: translate3d(0, 0, 0); opacity: 0; }
  8%   { opacity: var(--opacity); }
  50%  { transform: translate3d(var(--sway), -55vh, 0); }
  88%  { opacity: var(--opacity); }
  100% { transform: translate3d(calc(var(--sway) * -.5), -110vh, 0); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .spark { animation: none; opacity: .12; top: auto; bottom: 18vh; }
}

button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.app {
  position: relative;
  z-index: 1;
  width: var(--app-width);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(14, 10, 26, .72), rgba(8, 6, 15, .92) 46%);
  box-shadow: 0 0 70px rgba(0, 0, 0, .45);
}

@media (min-width: 520px) {
  .app { border-inline: 1px solid var(--border); }
}

/* ---------- Header ---------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 20px 13px;
  background: rgba(15, 11, 26, .86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-text { min-width: 0; }

.brand-mark {
  width: 48px;
  height: 48px;
  flex: none;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}

.brand-text h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: calc(25px * var(--font-scale));
  font-weight: 400;
  letter-spacing: .06em;
  line-height: 1.1;
}

.brand-text p {
  margin: 3px 0 0;
  font-size: calc(11px * var(--font-scale));
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.header-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
}
.header-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(26, 19, 42, .7);
  color: var(--gold);
  -webkit-tap-highlight-color: transparent;
  transition: border-color .18s, background .18s, transform .18s;
}
.header-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.header-icon:hover,
.header-icon:active,
.header-icon[aria-expanded="true"] {
  border-color: rgba(229, 199, 143, .6);
  background: rgba(212, 175, 55, .16);
}
.header-icon--profile.is-authed {
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, .38);
}

@media (max-width: 360px) {
  .brand-text h1 { font-size: calc(21px * var(--font-scale)); }
  .header-icon { width: 34px; height: 34px; }
}

/* ---------- Views ---------- */

.main {
  position: relative;
  z-index: 1;
  padding: 22px 18px calc(104px + env(safe-area-inset-bottom));
}

.view[hidden] { display: none; }
.view.is-active { animation: view-in .28s ease both; }

@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.view-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: calc(27px * var(--font-scale));
  font-weight: 400;
  letter-spacing: .01em;
}

.view-head p {
  margin: 6px 0 0;
  font-size: calc(13px * var(--font-scale));
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- Search & filters ---------- */

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  margin-top: 20px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color .2s;
}

.search:focus-within { border-color: rgba(201, 166, 255, .55); }

.search-icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: var(--muted-2);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: calc(15px * var(--font-scale));
}

.search input::placeholder { color: var(--muted-2); }
.search input::-webkit-search-cancel-button { display: none; }

.search-clear {
  flex: none;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: calc(18px * var(--font-scale));
  line-height: 1;
}

.filters {
  display: flex;
  gap: 8px;
  margin: 14px -18px 0;
  padding: 0 18px 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.filters::-webkit-scrollbar { display: none; }

.filter-btn {
  flex: none;
  min-height: 36px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: calc(13px * var(--font-scale));
  white-space: nowrap;
  transition: color .18s, border-color .18s, background .18s, transform .12s;
}
.filter-btn:active { transform: scale(.96); }
.filter-btn.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, rgba(201, 166, 255, .28), rgba(143, 110, 224, .42));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(201, 166, 255, .28);
}

/* ---------- Suit description ---------- */

.suit-description {
  width: 100%;
  max-width: 800px;
  margin: 16px 0 0;
  padding: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .02));
  border: 1px solid rgba(229, 199, 143, .24);
  border-radius: 14px;
  animation: suit-in .3s ease-in both;
}

.suit-description[hidden] { display: none; }

.suit-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.suit-emoji {
  font-size: calc(24px * var(--font-scale));
  line-height: 1;
}

.suit-name {
  margin: 0;
  font-family: var(--font-serif);
  font-size: calc(20px * var(--font-scale));
  font-weight: 400;
  letter-spacing: .01em;
  color: var(--gold);
}

.suit-short-description,
.suit-section p,
.suit-question {
  font-size: calc(16px * var(--font-scale));
  line-height: 1.6;
}

.suit-short-description {
  margin: 0 0 10px;
  color: var(--text);
}

.suit-question {
  margin: 0 0 16px;
  color: var(--muted);
  font-style: italic;
}

.suit-expand-btn {
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid rgba(229, 199, 143, .5);
  border-radius: 8px;
  background: transparent;
  color: var(--gold);
  font-size: calc(14px * var(--font-scale));
  transition: background .2s, border-color .2s, color .2s;
}

.suit-expand-btn:hover,
.suit-expand-btn:focus-visible {
  background: rgba(229, 199, 143, .12);
  border-color: var(--gold);
}

.suit-full {
  max-height: 0;
  margin-top: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .35s ease, opacity .3s ease, margin-top .35s ease;
}

.suit-full.is-expanded {
  max-height: 2000px;
  margin-top: 18px;
  opacity: 1;
}

.suit-full::before {
  content: "";
  display: block;
  border-top: 1px solid rgba(229, 199, 143, .2);
  margin-bottom: 18px;
}

.suit-section { margin-bottom: 14px; }
.suit-section:last-child { margin-bottom: 0; }

.suit-section h4 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: calc(16px * var(--font-scale));
  font-weight: 400;
  color: var(--gold);
}

.suit-section p {
  margin: 0;
  color: var(--text);
}

.suit-advice {
  color: var(--gold) !important;
  font-weight: 500;
}

.suit-shadow {
  color: var(--muted);
  font-style: italic;
}

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

@media (min-width: 620px) {
  .suit-description { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .suit-description { animation: none; }
  .suit-full { transition: none; }
}

.result-count {
  margin: 15px 0 11px;
  font-size: calc(12px * var(--font-scale));
  letter-spacing: .03em;
  color: var(--muted-2);
}

/* ---------- Card grid ---------- */

/* ---------- Card library ---------- */

.card-groups { display: block; }

.suit-divider {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 44px 0 40px;
  font-family: var(--font-ui);
  font-size: calc(11px * var(--font-scale));
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--gold);
}
.suit-divider-icon {
  font-size: calc(13px * var(--font-scale));
  line-height: 1;
  letter-spacing: 0;
  opacity: .85;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.card-tile {
  --tone: var(--accent);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: 2 / 3;
  min-height: 210px;
  padding: 12px 10px 11px;
  overflow: hidden;
  text-align: left;
  color: var(--text);
  border: 0;
  border-radius: var(--card-radius, 10px);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
  transition: transform .3s ease, box-shadow .3s ease;
}
.card-tile.has-image::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(12, 8, 22, .05) 40%, rgba(12, 8, 22, .78) 78%, rgba(12, 8, 22, .96));
  pointer-events: none;
}
.card-tile > span { position: relative; z-index: 3; }

/* Hover only on devices with a real pointer: on touch, :hover would stick after tap */
@media (hover: hover) {
  .card-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 20px 3px color-mix(in srgb, var(--tone) 35%, transparent);
    z-index: 1;
    will-change: transform;
  }
  .card-tile:hover .tile-image { transform: scale(1.04); }
}
.card-tile:active {
  transform: translateY(-4px);
  box-shadow: 0 0 20px 3px color-mix(in srgb, var(--tone) 35%, transparent);
  z-index: 1;
}
.card-tile:active .tile-image { transform: scale(1.04); }

.tile-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.tile-name {
  margin: 0;
  font-family: var(--font-card);
  font-size: clamp(17px, 4.5vw, 21px);
  font-weight: 700;
  line-height: 1.08;
  color: var(--text);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .95), 0 0 12px rgba(0, 0, 0, .5);
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

.tile-keywords {
  margin-top: 7px;
  font-size: clamp(10px, 2.7vw, 12px);
  font-weight: 400;
  line-height: 1.25;
  color: var(--text);
  opacity: .6;
  text-align: left;
  white-space: normal;
  overflow-wrap: break-word;
}

@media (min-width: 760px) {
  :root { --app-width: min(100%, 720px); }
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile-name { font-size: 20px; }
  .tile-keywords { font-size: 12px; }
}

@media (min-width: 1040px) {
  :root { --app-width: min(100%, 960px); }
  .card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tile-name { font-size: 19px; }
  .tile-keywords { font-size: 11.5px; }
}

/* ---------- Spread list ---------- */

.spread-list { display: flex; flex-direction: column; gap: 11px; }

.spread-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 14px;
  text-align: left;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--surface-2), var(--surface));
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, .04);
  transition: transform .16s, border-color .18s, box-shadow .18s;
}
.spread-item:active { transform: scale(.985); }
.spread-item:hover {
  border-color: rgba(212, 175, 55, .45);
  box-shadow: 0 0 18px rgba(212, 175, 55, .12);
  transform: translateY(-1px);
}

.spread-info { flex: 1; min-width: 0; }

.spread-name {
  display: block;
  font-size: calc(16px * var(--font-scale));
  font-weight: 600;
  line-height: 1.25;
}

.spread-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.meta-chip {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: calc(10px * var(--font-scale));
  letter-spacing: .04em;
  color: var(--muted);
}
.meta-chip.accent { color: var(--accent); border-color: rgba(201, 166, 255, .26); }

.spread-arrow { flex: none; color: var(--gold); font-size: calc(20px * var(--font-scale)); }

/* ---------- Выбор пути и категорий ---------- */

.spread-modes { display: grid; gap: 12px; margin-bottom: 22px; }
.spread-modes[hidden],
.spread-flow[hidden],
.spread-list-stage[hidden] { display: none; }

.spread-mode-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 150px;
  padding: 18px 16px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, .3);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(212, 175, 55, .17), transparent 58%),
    radial-gradient(circle at 8% 100%, rgba(143, 110, 224, .14), transparent 55%),
    linear-gradient(150deg, rgba(41, 32, 60, .95), rgba(20, 15, 32, .97));
  box-shadow: inset 0 1px 0 rgba(229, 199, 143, .1), 0 10px 26px rgba(0, 0, 0, .2);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.spread-mode-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .35;
  background-image: radial-gradient(rgba(229, 199, 143, .3) .6px, transparent .7px);
  background-size: 22px 22px;
}
.spread-mode-card:active { transform: scale(.99); }
.spread-mode-card:hover,
.spread-mode-card:focus-visible {
  border-color: rgba(229, 199, 143, .6);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, .08), 0 12px 30px rgba(0, 0, 0, .28), 0 0 22px rgba(212, 175, 55, .14);
  transform: translateY(-2px);
  outline: none;
}
.spread-mode-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(212, 175, 55, .38);
  border-radius: 16px;
  background: radial-gradient(circle at 35% 25%, rgba(229, 199, 143, .2), rgba(229, 199, 143, .04));
  color: var(--gold);
  box-shadow: inset 0 0 14px rgba(212, 175, 55, .1);
}
.spread-mode-icon svg { width: 31px; height: 31px; }
.spread-mode-copy { position: relative; z-index: 1; flex: 1; min-width: 0; }
.spread-mode-copy strong {
  display: block;
  font-family: var(--font-card);
  font-size: calc(18px * var(--font-scale));
  font-weight: 600;
  line-height: 1.2;
}
.spread-mode-copy small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: calc(11px * var(--font-scale));
  line-height: 1.4;
}
.spread-mode-arrow {
  position: relative;
  z-index: 1;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-left: auto;
  color: rgba(229, 199, 143, .78);
  transition: transform .2s, color .2s;
}
.spread-mode-card:hover .spread-mode-arrow,
.spread-mode-card:focus-visible .spread-mode-arrow { color: var(--gold); transform: translateX(3px); }

.spread-flow { margin-bottom: 22px; }
.flow-head { margin-bottom: 14px; }
.flow-head h3,
.category-title {
  margin: 2px 0 0;
  font-family: var(--font-card);
  font-size: calc(22px * var(--font-scale));
  font-weight: 500;
  letter-spacing: .02em;
}
.flow-note { margin: 6px 0 0; color: var(--muted); font-size: calc(12px * var(--font-scale)); line-height: 1.45; }
.spread-list-stage .category-title { margin-bottom: 12px; }

@media (min-width: 620px) {
  .spread-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spread-mode-card { flex-direction: column; align-items: flex-start; min-height: 185px; }
  .spread-mode-arrow { align-self: flex-end; margin-top: auto; }
}

.category-back {
  display: block;
  margin: 0 0 12px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--gold);
  font: inherit;
  font-size: calc(13px * var(--font-scale));
  cursor: pointer;
}
.category-back[hidden] { display: none; }

.spreads-nav-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}
.spreads-nav-grid[hidden] { display: none; }
.nav-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 142px;
  padding: 14px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 100% 0%, rgba(212, 175, 55, .09), transparent 62%),
    linear-gradient(150deg, var(--surface-2), var(--surface));
  color: var(--text);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .18s ease, border-color .18s ease;
}
.nav-card:active { transform: scale(.98); }
.nav-card:hover,
.nav-card:focus-visible {
  border-color: rgba(229, 199, 143, .55);
  outline: none;
}
.nav-card.love { box-shadow: inset 0 0 18px rgba(240, 183, 198, .08); }
.nav-card.career { box-shadow: inset 0 0 18px rgba(212, 175, 55, .08); }
.nav-card.future { box-shadow: inset 0 0 18px rgba(201, 166, 255, .08); }
.nav-card.soul { box-shadow: inset 0 0 18px rgba(143, 110, 224, .1); }
.nav-icon { font-size: calc(24px * var(--font-scale)); line-height: 1; }
.nav-card h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: calc(17px * var(--font-scale));
  font-weight: 400;
  line-height: 1.2;
}
.nav-card p {
  flex: 1;
  margin: 0;
  font-size: calc(11px * var(--font-scale));
  line-height: 1.4;
  color: var(--muted);
}
.count-badge {
  padding: 3px 8px;
  border: 1px solid rgba(229, 199, 143, .26);
  border-radius: 999px;
  color: var(--gold);
  font-size: calc(10px * var(--font-scale));
  letter-spacing: .04em;
}

.virtual-spread { margin-bottom: 22px; }
.virtual-spread[hidden],
.vs-stage[hidden],
.vs-work[hidden],
.vs-deck-panel[hidden],
.vs-final-panel[hidden] { display: none; }

.vs-back {
  margin: 0 0 16px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--gold);
  font: inherit;
  font-size: calc(13px * var(--font-scale));
  cursor: pointer;
}
.vs-back:active { opacity: .7; }

/* Внутри конкретного расклада остаётся только компактная ссылка назад. */
body.is-spread-reading .vs-work-head { display: none; }
body.is-spread-reading .main { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
body.is-spread-reading .bottom-nav { display: none; }

.vs-work-head { margin-bottom: 14px; text-align: center; }
.vs-work-head h3 {
  margin: 2px 0 4px;
  font-family: var(--font-card);
  font-size: calc(23px * var(--font-scale));
  font-weight: 500;
}
.vs-work-head p { margin: 0; color: var(--gold); font-size: calc(12px * var(--font-scale)); }

.vs-work {
  padding: 18px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
}
.vs-deck-panel { text-align: center; margin-bottom: 18px; }
.vs-counter { margin: 0 0 4px; color: var(--gold); font-size: calc(12px * var(--font-scale)); letter-spacing: .04em; }
.vs-position { margin: 0 0 4px; font-family: var(--font-serif); font-size: calc(22px * var(--font-scale)); font-weight: 400; }
.vs-position-desc { margin: 0 auto 16px; max-width: 320px; font-size: calc(12px * var(--font-scale)); line-height: 1.45; color: var(--muted); }

.vs-deck {
  position: relative;
  width: 118px;
  aspect-ratio: 2 / 3;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .3s ease, transform .2s ease, box-shadow .3s ease;
}
/* Состояние подготовки: колода есть, но тянуть из неё ещё нельзя. */
.vs-deck[disabled] { opacity: .7; cursor: default; }
.vs-deck-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, .5);
}
/* Рубашка карт: готовое изображение с рамкой и подписью. */
.card-back-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.vs-deck-star {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* Ожидание: колода едва заметно дышит и мерцает до тасовки. */
.vs-deck.is-waiting .vs-deck-face {
  animation: vs-deck-idle 3.6s ease-in-out infinite;
}
.vs-deck.is-waiting:hover .vs-deck-face,
.vs-deck.is-waiting:active .vs-deck-face {
  animation-name: vs-deck-idle-strong;
  animation-duration: 2.4s;
}
@keyframes vs-deck-idle {
  0%, 100% {
    transform: translateY(0) rotate(0);
    box-shadow: 0 0 0 0 rgba(229, 199, 143, .06),
      0 0 12px rgba(143, 110, 224, .18), 0 12px 26px rgba(0, 0, 0, .5);
  }
  25% {
    transform: translateY(-1px) rotate(-.45deg);
    box-shadow: 0 0 0 3px rgba(229, 199, 143, .08),
      0 0 18px rgba(143, 110, 224, .22), 0 12px 26px rgba(0, 0, 0, .5);
  }
  50% {
    transform: translateY(-3px) rotate(.7deg);
    box-shadow: 0 0 0 6px rgba(229, 199, 143, .12),
      0 0 26px rgba(212, 175, 55, .3), 0 0 32px rgba(143, 110, 224, .22),
      0 14px 28px rgba(0, 0, 0, .5);
  }
  75% {
    transform: translateY(-1px) rotate(.4deg);
    box-shadow: 0 0 0 3px rgba(229, 199, 143, .08),
      0 0 18px rgba(143, 110, 224, .2), 0 12px 26px rgba(0, 0, 0, .5);
  }
}
@keyframes vs-deck-idle-strong {
  0%, 100% {
    transform: translateY(0) rotate(0);
    box-shadow: 0 0 0 4px rgba(229, 199, 143, .14),
      0 0 24px rgba(212, 175, 55, .4), 0 0 32px rgba(143, 110, 224, .3),
      0 12px 26px rgba(0, 0, 0, .5);
  }
  50% {
    transform: translateY(-4px) rotate(.9deg);
    box-shadow: 0 0 0 9px rgba(229, 199, 143, .18),
      0 0 34px rgba(212, 175, 55, .52), 0 0 44px rgba(143, 110, 224, .36),
      0 16px 30px rgba(0, 0, 0, .5);
  }
}
/* Состояние вытягивания: свечение и дыхание зовут коснуться колоды. */
.vs-deck.is-ready { animation: vs-deck-glow 1.8s ease-in-out infinite; }
.vs-deck.is-ready .vs-deck-face {
  border: 1px solid rgba(229, 199, 143, .45);
  animation: vs-deck-breathe 1.8s ease-in-out infinite;
}
.vs-deck.is-ready:not([disabled]):hover { transform: scale(1.05); }
.vs-deck:not([disabled]):active { transform: scale(.97); }
.vs-deck.is-spent { opacity: .45; cursor: default; animation: none; pointer-events: none; }
.vs-deck.is-spent .vs-deck-face { animation: none; }
.vs-deck.is-shuffling { animation: vs-shuffle .375s ease-in-out 4; }
.vs-deck.is-shuffling .vs-deck-face {
  animation: vs-deck-shuffle-glow .75s ease-in-out infinite;
}
@keyframes vs-deck-shuffle-glow {
  0%, 100% {
    box-shadow: 0 0 14px rgba(143, 110, 224, .32), 0 12px 26px rgba(0, 0, 0, .5);
  }
  50% {
    box-shadow: 0 0 28px rgba(212, 175, 55, .55), 0 0 40px rgba(143, 110, 224, .42),
      0 12px 26px rgba(0, 0, 0, .5);
  }
}
@keyframes vs-shuffle {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-10px) rotate(-3deg); }
  75% { transform: translateX(10px) rotate(3deg); }
}
@keyframes vs-deck-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 199, 143, .08), 0 12px 26px rgba(0, 0, 0, .5); }
  50% { box-shadow: 0 0 0 8px rgba(229, 199, 143, .14), 0 0 24px rgba(229, 199, 143, .32), 0 12px 26px rgba(0, 0, 0, .5); }
}
@keyframes vs-deck-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
.vs-deck-hint {
  max-height: 100px;
  margin: 14px 0 10px;
  min-height: 2.8em;
  font-size: calc(13px * var(--font-scale));
  line-height: 1.4;
  color: var(--text);
  transition: max-height .24s ease, margin .24s ease, opacity .24s ease, transform .24s ease;
}
/* После тасовки подсказка и кнопка сворачиваются, остаётся один статус. */
.vs-deck-hint.is-leaving,
.vs-deck-actions.is-leaving {
  max-height: 0;
  margin: 0;
  opacity: 0;
  transform: translateY(-4px);
  overflow: hidden;
  pointer-events: none;
}
.vs-deck-status {
  margin: 10px 0 0;
  font-size: calc(12px * var(--font-scale));
  line-height: 1.4;
  color: var(--gold);
}
.vs-deck-status[hidden] { display: none; }
.vs-deck-status.is-updating { animation: vs-hint-in .32s ease both; }
.vs-deck-hint.is-updating { animation: vs-hint-in .28s ease both; }
.vs-deck-hint.is-invite {
  color: var(--gold);
  animation: vs-hint-pulse 2.4s ease-in-out infinite;
}
@keyframes vs-hint-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes vs-hint-pulse {
  0%, 100% { opacity: .75; }
  50% { opacity: 1; }
}
.vs-deck-panel:not([hidden]),
.vs-final-panel:not([hidden]) { animation: fade-in .3s ease both; }
.vs-deck-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: 260px;
  max-height: 100px;
  margin: 0 auto;
  transition: max-height .24s ease, margin .24s ease, opacity .24s ease, transform .24s ease;
}
.vs-deck-actions button { width: 100%; }
#vs-shuffle {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid rgba(255, 225, 150, .72);
  border-radius: 999px;
  background: linear-gradient(115deg, #70459f 0%, #b8862f 34%, #f5da9a 52%, #b8862f 70%, #70459f 100%);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, .25), 0 0 22px rgba(212, 175, 55, .38),
    0 8px 20px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .38);
  color: #1b1126;
  font-weight: 700;
  text-align: center;
  transition: opacity .26s ease, transform .26s ease, box-shadow .26s ease;
}
#vs-shuffle > span { position: relative; z-index: 1; }
.vs-shuffle-icon {
  font-size: calc(15px * var(--font-scale));
  line-height: 1;
  text-shadow: 0 0 8px rgba(255, 255, 255, .6);
}
#vs-shuffle::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, .58) 50%, transparent 68%);
  transform: translateX(-120%);
  animation: vs-shuffle-shimmer 4.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes vs-shuffle-shimmer {
  0%, 62% { transform: translateX(-120%); }
  84%, 100% { transform: translateX(120%); }
}
#vs-shuffle:hover,
#vs-shuffle:focus-visible {
  box-shadow: 0 0 0 1px rgba(255, 225, 150, .45), 0 0 30px rgba(212, 175, 55, .55),
    0 0 42px rgba(143, 110, 224, .35), 0 8px 20px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .45);
  transform: translateY(-1px);
}
#vs-shuffle:active { transform: scale(.98); }
#vs-shuffle:disabled { opacity: .78; transform: none; }
#vs-shuffle.is-leaving { opacity: 0; transform: translateY(-4px); pointer-events: none; }

.vs-board {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto 16px;
}

/* Да/Нет и Карта дня: одна крупная карта по центру. */
.vs-board--yesno,
.vs-board--single {
  grid-template-columns: minmax(0, 1fr);
  justify-content: center;
  justify-items: center;
  gap: 14px;
  max-width: min(100%, 360px);
}
.vs-board--yesno .vs-slot,
.vs-board--single .vs-slot { width: 84px; max-width: 84px; }
.vs-yesno-answer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  text-align: center;
}
.vs-yesno-verdict {
  font-family: var(--font-serif);
  font-size: calc(clamp(20px, 6vw, 24px) * var(--font-scale));
  font-weight: 600;
  color: var(--gold);
}
.vs-yesno-note {
  font-size: calc(11px * var(--font-scale));
  line-height: 1.5;
  color: var(--muted);
}

/* Три карты: при нехватке места переносятся на следующую строку. */
.vs-board--three {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
}
.vs-board--three .vs-slot { flex: 0 0 84px; width: 84px; max-width: 84px; }

/* Выбор: два равных варианта, при трёх позициях — совет под ними. */
.vs-board--choice {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-items: center;
  gap: 8px;
  max-width: min(100%, 320px);
}
.vs-board--choice .vs-slot { width: 84px; max-width: 84px; }
.vs-board--choice .position-3 { grid-column: 1 / -1; justify-self: center; }

/* Кельтский крест: сетка и размеры в относительных единицах. */
.vs-board--celtic {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  aspect-ratio: 1 / 1.35;
  max-width: min(100%, 360px);
}
.vs-board--celtic > .vs-slot { aspect-ratio: auto; min-width: 0; }
.vs-board--celtic > .vs-slot .vs-slot-card { width: 100%; height: 100%; aspect-ratio: auto; }
.vs-board--celtic > .vs-slot .vs-slot-orient,
.vs-board--celtic > .vs-slot .vs-slot-keywords { display: none; }

/* Центральный крест: «Суть» вертикальна, «Препятствие» — поверх под 90°. */
.cross-center {
  grid-column: 1 / 3;
  grid-row: 2 / 4;
  position: relative;
  min-width: 0;
  min-height: 0;
  z-index: 3;
}
.cross-center .vs-slot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(78%, 96px);
  min-width: 44px;
  aspect-ratio: 2 / 3;
  height: auto;
  padding: 0;
  transform: translate(-50%, -50%);
  will-change: transform;
}
.cross-center .vs-slot-card { width: 100%; height: 100%; aspect-ratio: auto; }
.cross-center .vs-slot-name,
.cross-center .vs-slot-orient,
.cross-center .vs-slot-keywords { display: none; }
.cross-center .vs-slot-label {
  position: absolute;
  z-index: 3;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(10, 7, 20, .82);
  white-space: nowrap;
  font-size: calc(9px * var(--font-scale));
}
.cross-center .position-1 { z-index: 1; }
.cross-center .position-2 { z-index: 2; transform: translate(-50%, -50%) rotate(90deg); }
.cross-center .position-1.is-placed:active { transform: translate(-50%, -50%) scale(.96); }
.cross-center .position-2.is-placed:active {
  transform: translate(-50%, -50%) rotate(90deg) scale(.96);
}

.vs-board--celtic .position-3 { grid-column: 1; grid-row: 1; }
.vs-board--celtic .position-6 { grid-column: 2; grid-row: 1; }
.vs-board--celtic .position-4 { grid-column: 3; grid-row: 2; }
.vs-board--celtic .position-5 { grid-column: 2; grid-row: 4; }

.staff-column {
  grid-column: 4;
  grid-row: 1 / 5;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 1.8vw, 8px);
  min-width: 0;
  min-height: 0;
}
.staff-column .vs-slot { flex: 1 1 0; min-height: 44px; aspect-ratio: auto; }
.staff-column .vs-slot-card { width: 100%; height: 100%; aspect-ratio: auto; }
.staff-column .vs-slot-orient,
.staff-column .vs-slot-keywords { display: none; }

.vs-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}
/* Карты ряда фиксированного размера (2:3), подписи не растягивают слот. */
.vs-board:not(.vs-board--celtic) .vs-slot { width: 84px; height: 184px; min-height: 184px; }
.vs-slot-label { font-size: calc(10px * var(--font-scale)); line-height: 1.2; color: var(--gold); text-align: center; }
.vs-slot-card {
  position: relative;
  flex: none;
  width: 80px;
  height: 120px;
  aspect-ratio: 2 / 3;
  perspective: 900px;
  transform-style: preserve-3d;
}
/* Текст живёт внизу слота и не растягивает карточку. */
.vs-slot-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  min-width: 0;
  margin-top: auto;
  text-align: center;
}
.vs-slot.is-empty .vs-slot-card {
  border: 1px dashed rgba(229, 199, 143, .3);
  border-radius: 10px;
  background: rgba(10, 7, 20, .3);
}
.vs-slot.is-empty .vs-slot-card::after {
  content: attr(data-num);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(229, 199, 143, .4);
  font-family: var(--font-serif);
  font-size: calc(24px * var(--font-scale));
}
.vs-slot.is-placed { cursor: pointer; }
.vs-slot.is-placed:active { transform: scale(.98); }
.vs-slot-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.62, 0, .3, 1);
  will-change: transform;
}
.vs-slot.is-flipped .vs-slot-inner { transform: rotateY(180deg); }
.vs-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(229, 199, 143, .5);
  border-radius: 10px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .45);
}
.vs-face--back {
  border: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(212, 175, 55, .18), transparent 60%),
    linear-gradient(160deg, #2b1f44, #140f22);
}
.vs-face--front {
  transform: rotateY(180deg);
  background: #1c1530;
}
.vs-face--front img { width: 100%; height: 100%; object-fit: contain; }
.vs-face--front .vs-glyph { color: var(--gold); font-family: var(--font-serif); font-size: calc(38px * var(--font-scale)); }
.vs-face--front.is-reversed img,
.vs-face--front.is-reversed .vs-glyph { transform: rotate(180deg); }
.vs-slot-name {
  width: 100%;
  max-width: 100%;
  font-size: 10px;
  line-height: 1.2;
  color: var(--text);
  text-align: center;
  overflow-wrap: anywhere;
}
.vs-slot-orient { font-size: calc(9px * var(--font-scale)); color: var(--muted); }
.vs-slot-keywords {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font-size: 9px;
  line-height: 1.2;
  color: var(--muted-2);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Компактная сетка результата: все карты собраны в одну целостную картину. */
.vs-board.vs-board--compact,
.vs-board.vs-board--adaptive {
  display: grid;
  justify-content: center;
  justify-items: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  margin-bottom: 8px;
}
.vs-board.vs-board--compact.vs-board--count-1 {
  grid-template-columns: minmax(0, 100px);
  max-width: 100px;
}
.vs-board.vs-board--compact.vs-board--count-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 192px;
}
.vs-board.vs-board--compact.vs-board--count-3,
.vs-board.vs-board--compact.vs-board--count-4,
.vs-board.vs-board--compact.vs-board--count-5 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 272px;
}
.vs-board.vs-board--compact.vs-board--count-4 .vs-slot:nth-child(3) { grid-column: 1; }
.vs-board.vs-board--compact.vs-board--count-4 .vs-slot:nth-child(4) { grid-column: 2; }
.vs-board.vs-board--compact.vs-board--count-5 .position-1 { grid-column: 1; grid-row: 1; }
.vs-board.vs-board--compact.vs-board--count-5 .position-2 { grid-column: 2; grid-row: 1; }
.vs-board.vs-board--compact.vs-board--count-5 .position-3 { grid-column: 3; grid-row: 1; }
.vs-board.vs-board--compact.vs-board--count-5 .position-4 {
  grid-column: 1 / 3;
  grid-row: 2;
  justify-self: center;
}
.vs-board.vs-board--compact.vs-board--count-5 .position-5 {
  grid-column: 2 / 4;
  grid-row: 2;
  justify-self: center;
}
.vs-board.vs-board--adaptive {
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  max-width: 296px;
}
@media (max-width: 360px) {
  .vs-board.vs-board--adaptive { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); }
}
.vs-board.vs-board--compact .vs-slot,
.vs-board.vs-board--adaptive .vs-slot {
  width: 100%;
  max-width: 92px;
  height: auto;
  min-height: 184px;
  gap: 0;
}
.vs-board.vs-board--adaptive .vs-slot { max-width: 88px; }
.vs-board.vs-board--compact .vs-slot-label,
.vs-board.vs-board--adaptive .vs-slot-label {
  display: block;
  max-width: 100%;
  font-size: calc(10px * var(--font-scale));
  line-height: 1;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: normal;
  overflow-wrap: anywhere;
}
.vs-board.vs-board--compact .vs-slot-card,
.vs-board.vs-board--adaptive .vs-slot-card {
  width: 100%;
  height: auto;
  max-height: 140px;
  aspect-ratio: 2 / 3;
}
.vs-board.vs-board--compact .vs-slot-info,
.vs-board.vs-board--adaptive .vs-slot-info { gap: 0; }
.vs-board.vs-board--compact .vs-slot-name,
.vs-board.vs-board--adaptive .vs-slot-name {
  font-size: calc(11px * var(--font-scale));
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vs-board.vs-board--compact .vs-slot-orient,
.vs-board.vs-board--adaptive .vs-slot-orient {
  font-size: calc(9px * var(--font-scale));
  line-height: 1.1;
  white-space: nowrap;
}
.vs-board.vs-board--compact .vs-slot-keywords,
.vs-board.vs-board--adaptive .vs-slot-keywords {
  font-size: calc(9px * var(--font-scale));
  line-height: 1.1;
}

.vs-flying {
  position: fixed;
  z-index: 1100;
  border: 0;
  border-radius: 10px;
  background: #140f22;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .6);
  pointer-events: none;
  will-change: transform;
  transition: transform .62s cubic-bezier(.25, .46, .45, .94);
}
.vs-flying::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../images/card-back.png") center / contain no-repeat;
}

.vs-final-panel { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.vs-note-block label { display: block; margin-bottom: 7px; font-size: calc(13px * var(--font-scale)); }
.vs-note-block[hidden] { display: none; }
.vs-final-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.vs-final-actions button { width: 100%; }
.vs-final-panel .form-status { margin: 8px 0 0; }

/* Готовый расклад: компактная шапка, заметка на втором плане и прижатые кнопки. */
.vs-work.is-result { padding: 10px 6px 12px; }
.vs-work.is-result .vs-work-head { margin-bottom: 6px; }
.vs-work.is-result .vs-work-head h3 { font-size: calc(17px * var(--font-scale)); }
.vs-work.is-result .vs-work-head p { display: none; }
.vs-work.is-result .vs-final-panel {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 8px -6px -12px;
  padding: 8px 6px 12px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(20, 15, 34, 0), rgba(20, 15, 34, .97) 22%);
}
.vs-work.is-result .spread-ai {
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}
.vs-work.is-result .secondary-button.spread-ai-button--primary {
  min-height: 44px;
  padding: 10px 12px;
  font-size: calc(13px * var(--font-scale));
}
.vs-work.is-result .vs-final-actions button { padding-block: 10px; }
.vs-work.is-result .vs-note-block { margin-top: 8px; }
.vs-work.is-result .vs-note-block summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  padding: 2px 0;
  font-size: calc(11px * var(--font-scale));
  color: var(--muted-2);
  cursor: pointer;
}
.vs-work.is-result .vs-note-block summary::-webkit-details-marker { display: none; }
.vs-work.is-result .vs-note-block[open] summary { margin-bottom: 6px; color: var(--gold); }
.vs-note-chevron { transition: transform .2s ease; }
.vs-note-block[open] .vs-note-chevron { transform: rotate(180deg); }
.vs-work.is-result .vs-note-block textarea {
  width: 100%;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(10, 7, 20, .45);
  color: var(--text);
  font: inherit;
  font-size: calc(12px * var(--font-scale));
  resize: vertical;
}

@media (min-width: 600px) {
  .vs-deck-actions { flex-direction: row; }
  .vs-final-actions { flex-direction: row; }
}

@media (prefers-reduced-motion: reduce) {
  .vs-slot-inner,
  .vs-flying,
  .vs-deck { transition: none; }
  .vs-deck.is-shuffling,
  .vs-deck.is-ready,
  .vs-deck.is-ready .vs-deck-face,
  .vs-deck.is-waiting .vs-deck-face,
  .vs-deck.is-shuffling .vs-deck-face,
  #vs-shuffle::after,
  .vs-deck-status.is-updating,
  .vs-deck-hint.is-updating,
  .vs-deck-hint.is-invite,
  .vs-deck-panel:not([hidden]),
  .vs-final-panel:not([hidden]) { animation: none; }
}

/* ---------- Главная: Виспер, карта дня и быстрые входы ---------- */

.whisper-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 2.6vw, 18px);
  margin-bottom: 1.1rem;
  padding: clamp(14px, 4.2vw, 28px);
  border: 1px solid rgba(229, 199, 143, .26);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 92% 88%, rgba(212, 175, 55, .12), transparent 60%),
    linear-gradient(150deg, var(--surface-2), var(--surface));
  text-align: center;
  animation: whisperIn .5s ease-out both;
}

/* Сначала кот, под ним текст, ниже — кнопка. Порядок одинаков на всех экранах. */
.whisper-portrait {
  position: relative;
  flex: 0 0 auto;
  width: min(100%, 24rem, 42vh);
  width: min(100%, 24rem, 42svh);
  display: grid;
  place-items: center;
  margin: 0;
}
.whisper-portrait::before {
  content: '';
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(229, 199, 143, .16), transparent 70%);
  filter: blur(14px);
  pointer-events: none;
}
.whisper-portrait img {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  animation: whisperBreath 3.6s ease-in-out infinite;
}

.whisper-copy { width: 100%; max-width: 34rem; min-width: 0; }
.whisper-copy h3 {
  margin: 0 0 .35rem;
  font-family: var(--font-card);
  font-size: calc(clamp(1.45rem, 6vw, 2.1rem) * var(--font-scale));
  font-weight: 500;
  line-height: 1.15;
}
.whisper-role {
  margin: 0 0 .5rem;
  color: var(--gold);
  font-size: calc(clamp(.7rem, 3vw, .82rem) * var(--font-scale));
  line-height: 1.35;
}
.whisper-speech {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: calc(clamp(.74rem, 3.2vw, .86rem) * var(--font-scale));
  line-height: 1.5;
  opacity: .92;
}
.whisper-guide {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: .6rem 1.3rem;
  border: 1px solid #d4af37;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(46, 31, 78, .92), rgba(94, 67, 40, .72));
  box-shadow: 0 0 15px rgba(212, 175, 55, .4), inset 0 1px 0 rgba(255, 255, 255, .08);
  color: var(--gold);
  font: inherit;
  font-size: calc(clamp(.75rem, 3vw, .86rem) * var(--font-scale));
  letter-spacing: .02em;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .2s ease, box-shadow .2s ease, background .25s ease, color .2s ease;
}
.whisper-guide::before {
  content: "✦";
  margin-right: .5rem;
  color: #d4af37;
  text-shadow: 0 0 8px rgba(212, 175, 55, .65);
}
.whisper-guide:hover,
.whisper-guide:focus-visible,
.whisper-guide:active {
  transform: scale(1.02);
  border-color: #e5c78f;
  background: linear-gradient(120deg, #3a2566 0%, #7d5b2e 55%, #d4af37 120%);
  box-shadow: 0 0 24px rgba(212, 175, 55, .62), 0 6px 18px rgba(0, 0, 0, .32);
  color: #160d24;
  outline: none;
}
.whisper-guide:hover::before,
.whisper-guide:focus-visible::before,
.whisper-guide:active::before { color: #160d24; text-shadow: none; }

@keyframes whisperIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes whisperBreath {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .45))
            drop-shadow(0 0 5px rgba(229, 199, 143, .1));
  }
  50% {
    transform: scale(1.02);
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .5))
            drop-shadow(0 0 13px rgba(229, 199, 143, .24));
  }
}

@media (min-width: 620px) {
  .whisper-hero { gap: 1rem; }
  .whisper-copy h3 { font-size: calc(clamp(1.9rem, 4vw, 2.35rem) * var(--font-scale)); }
}

.whisper-tour {
  position: relative;
  margin: 0 0 20px;
  padding: 18px 16px 16px;
  border: 1px solid rgba(212, 175, 55, .28);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 88% 4%, rgba(212, 175, 55, .16), transparent 42%),
    radial-gradient(circle at 10% 96%, rgba(143, 110, 224, .14), transparent 46%),
    linear-gradient(160deg, rgba(41, 32, 60, .95), rgba(20, 15, 32, .97));
  box-shadow: inset 0 1px 0 rgba(229, 199, 143, .12), 0 10px 30px rgba(0, 0, 0, .22);
  overflow: hidden;
}
.whisper-tour::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .45;
  background-image: radial-gradient(rgba(229, 199, 143, .32) .6px, transparent .7px);
  background-size: 22px 22px;
}
.whisper-tour[hidden] { display: none; }
.tour-head { position: relative; display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.tour-head h3 {
  margin: 2px 0 0;
  font-family: var(--font-card);
  font-size: calc(22px * var(--font-scale));
  font-weight: 500;
  letter-spacing: .03em;
}
.tour-intro {
  margin: 7px 0 0;
  color: var(--muted);
  font-family: var(--font-card);
  font-size: calc(14px * var(--font-scale));
  line-height: 1.45;
}
.tour-close {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin-left: auto;
  padding: 0;
  border: 1px solid rgba(212, 175, 55, .28);
  border-radius: 50%;
  background: rgba(229, 199, 143, .06);
  color: var(--gold);
  font-size: calc(17px * var(--font-scale));
  line-height: 1;
  cursor: pointer;
}
.tour-steps { position: relative; display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tour-steps li {
  position: relative;
  padding: 11px 12px;
  border: 1px solid rgba(229, 199, 143, .12);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(229, 199, 143, .07), rgba(229, 199, 143, .02));
  overflow: hidden;
}
.tour-num {
  position: absolute;
  top: -6px;
  right: 7px;
  color: rgba(212, 175, 55, .14);
  font-family: var(--font-card);
  font-size: calc(46px * var(--font-scale));
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.04em;
  pointer-events: none;
}
.tour-step-copy { position: relative; z-index: 1; display: block; padding-right: 26px; }
.tour-steps strong {
  display: block;
  margin: 0 0 5px;
  font-family: var(--font-card);
  font-size: calc(15px * var(--font-scale));
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: .02em;
  white-space: normal;
  overflow-wrap: anywhere;
}
.tour-steps strong::before { content: "✦"; margin-right: 7px; color: var(--gold); font-size: calc(10px * var(--font-scale)); }
.tour-steps small {
  display: block;
  min-width: 0;
  color: var(--muted);
  font-size: calc(11px * var(--font-scale));
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}
.tour-steps em {
  display: block;
  margin-top: 5px;
  color: rgba(229, 199, 143, .72);
  font-family: var(--font-card);
  font-size: calc(12px * var(--font-scale));
  font-style: italic;
}
.tour-foot {
  position: relative;
  margin: 14px 0 0;
  color: rgba(229, 199, 143, .8);
  font-family: var(--font-card);
  font-size: calc(14px * var(--font-scale));
  font-style: italic;
  line-height: 1.4;
  text-align: right;
}

@media (prefers-reduced-motion: reduce) {
  .whisper-hero,
  .whisper-portrait img,
  .home-link-icon { animation: none; }
  .whisper-guide,
  .spread-mode-card { transition: none; }
}

.home-links { display: grid; gap: 10px; margin: 22px 0 4px; }
.home-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 14px;
  border: 1px solid rgba(212, 175, 55, .3);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .015));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .25s, box-shadow .25s, background .25s, transform .2s;
}
.home-link::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 12% 50%, rgba(212, 175, 55, .18), transparent 56%);
  transition: opacity .3s;
}
.home-link:hover, .home-link:focus-visible {
  border-color: rgba(229, 199, 143, .55);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, .08), 0 8px 24px rgba(0, 0, 0, .28), 0 0 18px rgba(212, 175, 55, .12);
  transform: translateY(-1px);
  outline: none;
}
.home-link:hover::after, .home-link:focus-visible::after { opacity: 1; }
.home-link:active { transform: scale(.99); }
.home-link-glyph {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(212, 175, 55, .35);
  border-radius: 14px;
  background: radial-gradient(circle at 35% 25%, rgba(229, 199, 143, .18), rgba(229, 199, 143, .04));
  color: var(--gold);
  box-shadow: inset 0 0 12px rgba(212, 175, 55, .08);
  transition: box-shadow .3s, transform .3s;
}
.home-link-icon { width: 25px; height: 25px; }
.home-link:hover .home-link-glyph, .home-link:focus-visible .home-link-glyph {
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(212, 175, 55, .3), inset 0 0 14px rgba(212, 175, 55, .14);
  animation: glyphGlow 2.4s ease-in-out infinite;
}
@keyframes glyphGlow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(212, 175, 55, .25)); }
  50% { filter: drop-shadow(0 0 7px rgba(212, 175, 55, .6)); }
}
.home-link-copy { position: relative; z-index: 1; min-width: 0; }
.home-link strong {
  display: block;
  font-family: var(--font-card);
  font-size: calc(15px * var(--font-scale));
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.home-link small { display: block; color: var(--muted); font-size: calc(11px * var(--font-scale)); line-height: 1.35; }
.home-link-arrow {
  position: relative;
  z-index: 1;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-left: auto;
  color: rgba(229, 199, 143, .7);
  transition: transform .25s, color .25s;
}
.home-link:hover .home-link-arrow, .home-link:focus-visible .home-link-arrow {
  color: var(--gold);
  transform: translateX(3px);
}

.home-start-spread {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid rgba(229, 199, 143, .38);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 100% 0%, rgba(212, 175, 55, .18), transparent 62%),
    linear-gradient(150deg, var(--surface-2), var(--surface));
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.home-start-spread:active { transform: scale(.99); }
.home-start-icon {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(229, 199, 143, .32);
  border-radius: 13px;
  background: rgba(229, 199, 143, .1);
  font-size: calc(20px * var(--font-scale));
}
.home-start-copy { flex: 1 1 auto; min-width: 0; max-width: 100%; }
.home-start-copy strong {
  display: block;
  font-family: var(--font-serif);
  font-size: calc(15px * var(--font-scale));
  font-weight: 500;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}
.home-start-copy small {
  display: block;
  color: var(--muted);
  font-size: calc(11px * var(--font-scale));
  line-height: 1.35;
}
.home-start-spread > span:last-child { color: var(--gold); font-size: calc(16px * var(--font-scale)); }

/* ---------- Карта дня на главной ---------- */

.daily-widget {
  margin-bottom: 22px;
  padding: 20px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 0%, rgba(212, 175, 55, .12), transparent 62%),
    linear-gradient(150deg, var(--surface-2), var(--surface));
  text-align: center;
}

.daily-widget-head h3 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: calc(23px * var(--font-scale));
  font-weight: 400;
  line-height: 1.2;
}
.daily-widget-head p {
  margin: 0 0 15px;
  font-size: calc(13px * var(--font-scale));
  line-height: 1.5;
  color: var(--muted);
}

.daily-result { display: flex; flex-direction: column; align-items: center; margin-top: 20px; }
.daily-result .modal-card-image-container { max-width: 224px; }
.daily-result .hero-art { max-width: 224px; }

/* Когда карта уже вытянута, шапка становится компактной и не отодвигает карту вниз. */
.daily-widget.has-card { margin-bottom: 14px; padding: 12px; }
.daily-widget.has-card .daily-widget-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 10px;
  margin-bottom: 0;
  text-align: left;
}
.daily-widget.has-card .eyebrow { display: none; }
.daily-widget.has-card .daily-widget-head h3 {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  font-size: calc(14px * var(--font-scale));
}
.daily-widget.has-card .daily-widget-head > p:not(.draw-lock) { display: none; }
.daily-widget.has-card .draw-button {
  grid-column: 2;
  grid-row: 2;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 8px 10px;
  font-size: calc(11px * var(--font-scale));
}
.daily-widget.has-card .draw-lock {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  font-size: calc(10px * var(--font-scale));
  line-height: 1.25;
  text-align: left;
}
.daily-widget.has-card .daily-result { margin-top: 10px; }

@media (max-width: 360px) {
  .home-start-spread { gap: 8px; padding: 10px; }
  .home-start-icon { flex-basis: 32px; width: 32px; height: 32px; }
  .home-start-copy strong { font-size: calc(13px * var(--font-scale)); }
  .home-start-spread > span:last-child { font-size: calc(14px * var(--font-scale)); }
  .daily-widget.has-card .eyebrow { display: none; }
  .daily-widget.has-card .daily-widget-head h3 { font-size: calc(13px * var(--font-scale)); }
  .daily-widget.has-card .draw-button { padding: 6px 8px; font-size: calc(10px * var(--font-scale)); }
  .daily-widget.has-card .draw-lock { font-size: calc(9px * var(--font-scale)); }
}

/* Клик по карте дня ведёт в полное описание. */
.daily-open {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 10px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.daily-open:focus-visible { outline: 2px solid var(--gold); outline-offset: -4px; }
.daily-open-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: 1px solid rgba(229, 199, 143, .38);
  border-radius: 999px;
  background: rgba(10, 7, 20, .72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--gold);
  font-size: calc(11px * var(--font-scale));
  opacity: .82;
  transition: opacity .18s ease, background .18s ease;
}
.daily-open:hover .daily-open-hint,
.daily-open:focus-visible .daily-open-hint,
.daily-open:active .daily-open-hint {
  opacity: 1;
  background: rgba(212, 175, 55, .22);
}
.daily-result-info { margin-top: 14px; text-align: center; }
.daily-result-info h4 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 400;
}
.daily-orientation {
  margin: -4px 0 9px;
  font-size: calc(11px * var(--font-scale));
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.daily-orientation.is-reversed { color: var(--gold); }
.daily-result-info .hero-keywords { justify-content: center; }
.daily-result-info .primary-button { margin-top: 14px; }
.daily-result-info .form-status { margin-top: 8px; }

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(14px) scale(.96); filter: brightness(.7); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: brightness(1); }
}
.daily-result.is-revealed { animation: cardReveal .55s ease both; }

/* ---------- Церемония выбора карты дня ---------- */

.preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border: 1px dashed rgba(229, 199, 143, .5);
  border-radius: 12px;
  background: rgba(212, 175, 55, .08);
  color: var(--gold);
  font-size: calc(12px * var(--font-scale));
}
.preview-bar[hidden] { display: none; }
.preview-bar button {
  padding: 5px 10px;
  border: 1px solid rgba(229, 199, 143, .4);
  border-radius: 999px;
  background: rgba(10, 7, 20, .5);
  color: var(--gold);
  font-size: calc(12px * var(--font-scale));
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.preview-bar button:active { background: rgba(212, 175, 55, .22); }

.day-sound-row { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.day-sound-toggle,
.day-reveal-sound {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid rgba(229, 199, 143, .36);
  border-radius: 999px;
  background: rgba(10, 7, 20, .58);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--gold);
  font-size: calc(12px * var(--font-scale));
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.day-sound-toggle:active,
.day-reveal-sound:active { background: rgba(212, 175, 55, .22); }
.day-sound-toggle:focus-visible,
.day-reveal-sound:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.day-reveal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(circle at 50% 45%, rgba(35, 24, 62, .93), rgba(6, 4, 12, .97) 72%);
  transition: opacity .5s ease;
}
.day-reveal[hidden] { display: none; }
.day-reveal.is-leaving { opacity: 0; }

.day-reveal-fog {
  position: absolute;
  width: min(104vw, 480px);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(16px);
  opacity: .3;
  will-change: opacity, transform;
  animation: reveal-fog 3s ease-in-out forwards;
}
.day-reveal-fog::before,
.day-reveal-fog::after {
  content: "";
  position: absolute;
  inset: -10%;
  border-radius: 50%;
  filter: blur(20px);
  will-change: transform, opacity;
}
.day-reveal-fog::before {
  background:
    radial-gradient(circle at 32% 44%, rgba(212, 175, 55, .38), transparent 46%),
    radial-gradient(circle at 68% 62%, rgba(160, 120, 255, .3), transparent 52%),
    radial-gradient(circle, rgba(255, 242, 208, .16), transparent 68%);
  animation: smoke-one 3s ease-in-out forwards;
}
.day-reveal-fog::after {
  background:
    radial-gradient(circle at 62% 34%, rgba(229, 199, 143, .34), transparent 48%),
    radial-gradient(circle at 38% 70%, rgba(120, 90, 190, .3), transparent 54%),
    radial-gradient(circle, rgba(255, 248, 222, .12), transparent 70%);
  animation: smoke-two 3s ease-in-out forwards;
}
@keyframes reveal-fog {
  0% { opacity: .3; transform: scale(.86) rotate(0deg); }
  40% { opacity: .7; transform: scale(1.05) rotate(14deg); }
  70% { opacity: .9; transform: scale(1.12) rotate(-10deg); }
  100% { opacity: .75; transform: scale(1.1) rotate(0deg); }
}
@keyframes smoke-one {
  0% { opacity: .25; transform: translate3d(-16%, 10%, 0) scale(.8) rotate(0deg); }
  38% { opacity: .72; transform: translate3d(12%, -8%, 0) scale(1.1) rotate(20deg); }
  68% { opacity: .95; transform: translate3d(-9%, 12%, 0) scale(1.28) rotate(-16deg); }
  100% { opacity: .8; transform: translate3d(0, 0, 0) scale(1.2) rotate(0deg); }
}
@keyframes smoke-two {
  0% { opacity: .2; transform: translate3d(14%, -8%, 0) scale(.85) rotate(0deg); }
  40% { opacity: .68; transform: translate3d(-13%, 10%, 0) scale(1.16) rotate(-22deg); }
  72% { opacity: .9; transform: translate3d(10%, -12%, 0) scale(1.32) rotate(18deg); }
  100% { opacity: .75; transform: translate3d(0, 0, 0) scale(1.22) rotate(0deg); }
}

.day-reveal-stage {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 22px;
  perspective: 1000px;
}
.day-reveal-card {
  position: relative;
  width: min(66vw, 240px);
  aspect-ratio: 2 / 3;
  transform-style: preserve-3d;
  will-change: transform;
}
.day-reveal.is-spinning .day-reveal-card { animation: reveal-turn 5s linear forwards; }
@keyframes reveal-turn {
  0% {
    transform: rotateY(0deg) scale(1.04);
    animation-timing-function: linear;
  }
  40% {
    transform: rotateY(360deg) scale(1.08);
    animation-timing-function: cubic-bezier(.5, 0, .9, .4);
  }
  60% {
    transform: rotateY(720deg) scale(1.14);
    animation-timing-function: cubic-bezier(.16, .84, .24, 1);
  }
  66% {
    transform: rotateY(900deg) scale(1.2);
    animation-timing-function: ease-out;
  }
  90% {
    transform: rotateY(900deg) scale(1.2);
    animation-timing-function: ease-out;
  }
  100% { transform: rotateY(900deg) scale(1); }
}

.day-reveal-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid var(--gold);
  border-radius: 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55), inset 0 0 24px rgba(255, 215, 0, .08);
}
.day-reveal-face--back {
  border: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(212, 175, 55, .18), transparent 60%),
    linear-gradient(160deg, #2b1f44, #140f22);
}
.day-reveal-face--front {
  transform: rotateY(180deg);
  background: linear-gradient(160deg, #251a3c, #151024);
}
.day-reveal-face--front.is-masked {
  background: linear-gradient(160deg, #251a3c, #151024);
}
.day-reveal-face--front img { width: 100%; height: 100%; object-fit: contain; }
.day-reveal-face--front .hero-glyph {
  color: var(--gold);
  font-size: calc(80px * var(--font-scale));
  text-shadow: 0 0 30px rgba(212, 175, 55, .55);
}
.day-reveal-face--front.is-reversed img,
.day-reveal-face--front.is-reversed .hero-glyph { transform: rotate(180deg); }

.day-reveal.is-sparkling .day-reveal-face {
  animation: reveal-sparkle 1s ease-in-out infinite;
}
@keyframes reveal-sparkle {
  0%, 100% {
    box-shadow: 0 0 10px rgba(212, 175, 55, .9), 0 0 20px rgba(212, 175, 55, .55), inset 0 0 22px rgba(255, 215, 0, .1);
  }
  50% {
    box-shadow: 0 0 20px #fff8dc, 0 0 40px var(--gold), 0 0 60px rgba(212, 175, 55, .85), inset 0 0 40px rgba(255, 215, 0, .28);
  }
}

.day-reveal-text {
  margin: 0;
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: calc(17px * var(--font-scale));
  letter-spacing: .04em;
  text-align: center;
  transition: opacity .3s ease;
}
.day-reveal.is-leaving .day-reveal-text { opacity: 0; }

.day-reveal-flash {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, #fff8dc 0%, var(--gold) 45%, transparent 78%);
}
.day-reveal.is-spinning .day-reveal-flash { animation: reveal-flash .3s ease-out 3s forwards; }
@keyframes reveal-flash {
  0% { opacity: 0; }
  50% { opacity: .9; }
  100% { opacity: 0; }
}

.day-reveal-sound {
  position: absolute;
  z-index: 6;
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
  pointer-events: auto;
}

.star-particle {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  color: var(--gold);
  font-size: calc(8px * var(--font-scale));
  line-height: 1;
  pointer-events: none;
  will-change: transform, opacity;
  animation: star-fly var(--dur, 900ms) ease-out var(--delay, 0ms) forwards;
}
@keyframes star-fly {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) translate(0, 0) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) scale(0) rotate(360deg);
  }
}

/* Уважаем системную настройку «Уменьшить движение»: только вспышка. */
.day-reveal.is-reduced .day-reveal-fog { animation: none; opacity: .35; }
.day-reveal.is-reduced .day-reveal-card {
  animation: none;
  transform: rotateY(900deg) scale(1.08);
}
.day-reveal.is-reduced .day-reveal-flash { animation: reveal-flash .3s ease-out forwards; }

/* ---------- Empty state ---------- */

.empty-state {
  padding: 54px 16px;
  text-align: center;
  color: var(--muted);
}
.empty-state[hidden] { display: none; }
.empty-state span { font-size: calc(30px * var(--font-scale)); color: var(--gold); opacity: .6; }
.empty-state p { margin: 12px 0; font-size: calc(14px * var(--font-scale)); }

.link-button {
  border: 0;
  background: none;
  color: var(--accent);
  font-size: calc(14px * var(--font-scale));
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Bottom navigation ---------- */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  z-index: 30;
  display: flex;
  width: var(--app-width);
  transform: translateX(-50%);
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(15, 11, 26, .94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
}

.nav-item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 62px;
  border: 0;
  background: none;
  color: var(--muted-2);
  font-size: calc(11px * var(--font-scale));
  letter-spacing: .03em;
  transition: color .18s;
}
.nav-item svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-item.is-active { color: var(--accent); }
.nav-item.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 34px;
  height: 2px;
  border-radius: 0 0 3px 3px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

@media (max-width: 360px) {
  .nav-item { font-size: calc(10px * var(--font-scale)); }
  .nav-item svg { width: 20px; height: 20px; }
  .nav-item.is-active::before { width: 28px; }
}

/* ---------- Slide-in menu ---------- */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(6, 4, 12, .72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade-in .3s ease both;
}
.drawer-backdrop[hidden] { display: none; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 61;
  display: flex;
  flex-direction: column;
  width: min(86%, 340px);
  height: 100dvh;
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
  border-left: 1px solid var(--border-strong);
  background: linear-gradient(180deg, #1b1430, #120d20);
  box-shadow: -18px 0 60px rgba(0, 0, 0, .55);
  overflow-y: auto;
  overscroll-behavior: contain;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .3s;
}
.drawer.is-open {
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), visibility 0s;
}
.drawer.is-dragging { transition: none; }

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.drawer-head h2 {
  margin: 4px 0 0;
  font-family: var(--font-serif);
  font-size: calc(27px * var(--font-scale));
  font-weight: 400;
}
.drawer-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0 0 3px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: calc(22px * var(--font-scale));
  line-height: 1;
}
.drawer-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 18px;
}
.drawer-list button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 50px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #ded6ef;
  font-size: calc(15px * var(--font-scale));
  text-align: left;
  transition: background .18s, border-color .18s;
}
.drawer-list button > span { width: 24px; font-size: calc(18px * var(--font-scale)); text-align: center; }
.drawer-list button:hover,
.drawer-list button:active {
  border-color: rgba(229, 199, 143, .26);
  background: rgba(212, 175, 55, .1);
}
.drawer-foot {
  margin: auto 0 0;
  padding-top: 24px;
  font-size: calc(11px * var(--font-scale));
  color: var(--muted-2);
  text-align: center;
}

/* ---------- Detail sheet ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(6, 4, 12, .72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade-in .22s ease both;
}
.backdrop[hidden] { display: none; }

.sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  z-index: 50;
  width: var(--app-width);
  max-height: min(90dvh, 820px);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(-50%);
  padding: 0 20px calc(30px + env(safe-area-inset-bottom));
  border: 1px solid var(--border-strong);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  background: #161024;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .55);
  animation: sheet-up .3s cubic-bezier(.2, .8, .2, 1) both;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.sheet[hidden] { display: none; }

/* Свайп вниз: translate отделён от transform, чтобы не ломать центрирование шторки. */
.sheet.is-dragging { transition: none; }
.sheet.is-snapping {
  transition: translate .3s cubic-bezier(.2, 1.4, .4, 1), opacity .25s ease;
}
.sheet.is-closing {
  transition: translate .22s ease-in, opacity .22s ease-in;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { opacity: .6; transform: translate(-50%, 30px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (min-width: 620px) {
  .sheet {
    top: 50%;
    bottom: auto;
    max-height: min(86dvh, 760px);
    border-radius: 24px;
    border-bottom: 1px solid var(--border-strong);
    transform: translate(-50%, -50%);
    animation-name: sheet-center;
  }
  @keyframes sheet-center {
    from { opacity: .6; transform: translate(-50%, calc(-50% + 20px)); }
    to { opacity: 1; transform: translate(-50%, -50%); }
  }
}

.sheet-handle {
  width: 40px;
  height: 4px;
  margin: 10px auto 18px;
  border-radius: 99px;
  background: var(--border-strong);
}

.sheet-close {
  position: absolute;
  z-index: 10;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: calc(21px * var(--font-scale));
  line-height: 1;
}

.sheet-body h3 {
  margin: 0;
  padding-right: 38px;
  font-family: var(--font-card);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.2;
}

.eyebrow {
  display: block;
  margin-bottom: 7px;
  font-size: calc(11px * var(--font-scale));
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- Card detail ---------- */

.card-stage { position: relative; }
.detail-hero {
  --hero-x: 0px;
  --hero-opacity: 1;
  --hero-duration: 220ms;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
  transform: translate3d(var(--hero-x), 0, 0);
  opacity: var(--hero-opacity);
  transition: transform var(--hero-duration) cubic-bezier(.22, .61, .36, 1),
              opacity var(--hero-duration) ease-out;
  will-change: transform, opacity;
}
.detail-hero.is-card-dragging,
.detail-hero.is-card-entering { transition: none; }
.detail-hero.is-card-leaving {
  transition: transform var(--hero-duration) cubic-bezier(.32, 0, .67, 0),
              opacity var(--hero-duration) ease-in;
}
.detail-hero.is-card-snapping {
  transition: transform var(--hero-duration) cubic-bezier(.2, 1.25, .4, 1),
              opacity var(--hero-duration) ease-out;
}

/* Золотистые стрелки по краям открытой карты */
.card-nav {
  position: absolute;
  top: 55%;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(212, 175, 55, .55);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, rgba(212, 175, 55, .2), rgba(10, 7, 20, .76) 72%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45), inset 0 0 12px rgba(212, 175, 55, .12);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  color: var(--spark-gold);
  opacity: .82;
  transform: translateY(-50%);
  transition: opacity .18s ease, border-color .18s ease, background .18s ease,
              box-shadow .18s ease, transform .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.card-nav svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(212, 175, 55, .55));
}
.card-nav--prev { left: -3px; }
.card-nav--next { right: -3px; }
.card-nav:hover,
.card-nav:focus-visible {
  opacity: 1;
  border-color: var(--spark-gold);
  box-shadow: 0 0 18px rgba(212, 175, 55, .42), inset 0 0 14px rgba(212, 175, 55, .22);
  transform: translateY(-50%) scale(1.06);
  outline: none;
}
.card-nav:active {
  opacity: 1;
  transform: translateY(-50%) scale(.94);
}
.card-nav:disabled {
  opacity: .22;
  cursor: default;
  pointer-events: none;
  box-shadow: none;
  filter: saturate(.6);
}

.hero-heading { align-self: stretch; margin-bottom: 12px; }

/* Animated golden frame around the opened card */
@keyframes sparkleGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(212, 175, 55, .3); }
  50% { box-shadow: 0 0 25px rgba(212, 175, 55, .8), 0 0 10px rgba(255, 215, 0, .5); }
}

.modal-card-image-container {
  position: relative;
  width: 100%;
  max-width: 360px;
  border: 2px solid #D4AF37;
  border-radius: 16px;
  animation: sparkleGlow 2s infinite ease-in-out;
  will-change: box-shadow;
  perspective: 1000px;
}
.modal-card-image-container::before {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(255, 215, 0, .5);
  border-radius: 20px;
  pointer-events: none;
  animation: sparkleGlow 2s infinite ease-in-out .5s;
}
.modal-card-image-container .hero-art { border-radius: 16px; }
.modal-card-image-container img { display: block; border-radius: 16px; }

/* Двусторонний переворот: карта физически поворачивается на 180°. */
.card-flip {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  cursor: pointer;
  perspective: 1000px;
  -webkit-tap-highlight-color: transparent;
}
.card-flip:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.card-flip-inner {
  position: relative;
  display: block;
  width: 100%;
  transform-origin: center;
  transform-style: preserve-3d;
  transition: transform .72s cubic-bezier(.62, 0, .3, 1);
  will-change: transform;
}
.card-flip-inner.is-flipped { transform: rotateY(180deg); }
.card-face {
  display: block;
  border-radius: 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.card-face--front { position: relative; width: 100%; }
.card-face--back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  background:
    radial-gradient(circle at 50% 45%, rgba(212, 175, 55, .18), transparent 58%),
    linear-gradient(160deg, #2b1f44, #151024);
}
.card-flip .hero-art { max-width: none; }
.modal-card-image-container .hero-num { z-index: 5; }

/* Подсказка живёт внутри карты, но не участвует в повороте. */
.flip-hint {
  position: absolute;
  z-index: 4;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border-radius: 0 0 16px 16px;
  background: rgba(0, 0, 0, .5);
  color: #d4af37;
  font-family: var(--font-ui);
  font-size: calc(12px * var(--font-scale));
  font-weight: 300;
  letter-spacing: .04em;
  line-height: 1.2;
  animation: flip-hint-pulse 2s ease-in-out infinite;
}
.flip-hint::before {
  content: "✨";
  font-size: calc(13px * var(--font-scale));
  line-height: 1;
}
@keyframes flip-hint-pulse {
  0%, 100% { opacity: .6; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .flip-hint { animation: none; opacity: .85; }
}

/* Оборот показывает ту же карту, но перевёрнутую вниз головой. */
.hero-art--back::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--card-image, none);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transform: rotate(180deg);
}
.hero-art--back .hero-glyph { transform: rotate(180deg); }
.back-mark {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 12px;
  translate: -50% 0;
  padding: 4px 9px;
  border: 1px solid rgba(229, 199, 143, .45);
  border-radius: 999px;
  background: rgba(10, 7, 20, .72);
  color: var(--gold);
  font-size: calc(15px * var(--font-scale));
  line-height: 1;
  box-shadow: 0 0 14px rgba(212, 175, 55, .28);
}

/* Золотой блик пробегает по карте, пока она поворачивается. */
.flip-gleam {
  position: absolute;
  inset: -25%;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(105deg,
    transparent 36%, rgba(255, 224, 154, .18) 44%, rgba(255, 248, 222, .85) 50%,
    rgba(255, 224, 154, .18) 56%, transparent 64%);
  transform: translateX(-115%);
}
.card-flip.is-animating .flip-gleam { animation: flip-gleam .72s cubic-bezier(.3, .1, .2, 1); }
@keyframes flip-gleam {
  0% { opacity: 0; transform: translateX(-115%); }
  28% { opacity: 1; }
  68% { opacity: .75; }
  100% { opacity: 0; transform: translateX(115%); }
}
.card-flip.is-animating .card-flip-inner {
  animation: flip-lift .72s cubic-bezier(.2, .8, .2, 1);
}
@keyframes flip-lift {
  0% { scale: 1; translate: 0 0; }
  46% { scale: 1.05; translate: 0 -8px; }
  100% { scale: 1; translate: 0 0; }
}
.card-flip.is-animating .hero-art { animation: flip-aura .72s ease-out; }
@keyframes flip-aura {
  0%, 100% {
    box-shadow: 0 12px 30px rgba(0, 0, 0, .4), inset 0 0 22px rgba(255, 255, 255, .03);
  }
  50% {
    box-shadow: 0 18px 54px rgba(212, 175, 55, .55), inset 0 0 46px rgba(255, 215, 0, .3);
  }
}

@media (prefers-reduced-motion: reduce) {
  .card-flip-inner { transition: none; }
  .card-flip.is-animating .flip-gleam,
  .card-flip.is-animating .card-flip-inner,
  .card-flip.is-animating .hero-art { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .modal-card-image-container,
  .modal-card-image-container::before {
    animation: none;
    box-shadow: 0 0 10px rgba(212, 175, 55, .3);
  }
  .detail-hero,
  .detail-hero.is-card-dragging,
  .detail-hero.is-card-leaving,
  .detail-hero.is-card-snapping,
  .detail-hero.is-card-entering { transition: none; }
}

.hero-art {
  --tone: var(--accent);
  position: relative;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 2 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--tone) 45%, transparent);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--tone) 30%, transparent), transparent 62%),
    linear-gradient(160deg, #251a3c, #151024);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .4), inset 0 0 22px rgba(255, 255, 255, .03);
}
.hero-art::after {
  content: "";
  position: absolute;
  inset: 5px;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 8px;
}
.hero-art img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center;
  transition: transform .72s cubic-bezier(.62, 0, .3, 1);
  will-change: transform;
}
.hero-art.is-reversed img,
.hero-art.is-reversed .hero-glyph {
  transform: rotate(180deg);
}
.hero-glyph {
  font-size: calc(92px * var(--font-scale));
  line-height: 1;
  color: var(--tone);
  text-shadow: 0 0 30px color-mix(in srgb, var(--tone) 55%, transparent);
  transform-origin: center;
  transition: transform .72s cubic-bezier(.62, 0, .3, 1);
  will-change: transform;
}
.hero-num {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 2;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(10, 7, 20, .72);
  font-family: var(--font-serif);
  font-size: calc(13px * var(--font-scale));
  color: var(--gold);
}

.hero-keywords {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
}
.reading-keywords:not(.is-active) { display: none; }

/* Плавная смена текста и тегов при переключении положения карты. */
.reading-side, .reading-focus, .reading-keywords { transition: opacity .25s ease; }
.reading-side.is-active,
.reading-focus.is-active,
.reading-keywords.is-active { animation: orientation-fade .25s ease both; }

@keyframes orientation-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .reading-side.is-active,
  .reading-focus.is-active,
  .reading-keywords.is-active { animation: none; }
}
.hero-keywords .chip {
  padding: 6px 12px;
  border: 1px solid rgba(201, 166, 255, .26);
  border-radius: 999px;
  background: rgba(201, 166, 255, .09);
  color: #e0d3fa;
  font-size: calc(13px * var(--font-scale));
}

/* Состояние остаётся доступным скринридеру, но больше не выглядит как плашка. */
.orientation-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.meaning-box {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(150deg, var(--surface-2), var(--surface));
}
.box-label {
  display: block;
  margin-bottom: 8px;
  font-size: calc(11px * var(--font-scale));
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
}
.meaning-box p, .advice-box p, .when-box p, .note-box p {
  margin: 0;
  font-size: calc(14px * var(--font-scale));
  line-height: 1.62;
  color: #ded6ef;
}

.advice-box, .when-box, .note-box {
  margin-top: 12px;
  padding: 14px 15px;
  border-left: 2px solid var(--accent-deep);
  border-radius: 0 12px 12px 0;
  background: rgba(201, 166, 255, .06);
}
.note-box { border-left-color: rgba(229, 199, 143, .55); background: rgba(229, 199, 143, .05); }

.essence-box, .symbolism-box {
  margin-bottom: 12px;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(150deg, var(--surface-2), var(--surface));
}
.essence-box { border-left: 2px solid var(--gold); }
.symbolism-box { border-left: 2px solid var(--accent-deep); }

/* В каждый момент видна только одна плашка — прямое ИЛИ перевёрнутое. */
.reading-side { display: none; }
.reading-side.is-active {
  display: block;
  border-color: rgba(212, 175, 55, .5);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, .12);
}

/* Блоки с иконками: сердце, портфель, звезда. */
.reading-focus { display: none; }
.reading-focus.is-active { display: grid; }
.focus-grid {
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}
.focus-card {
  display: flex;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(150deg, var(--surface-2), var(--surface));
}
.focus-icon {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(229, 199, 143, .35);
  border-radius: 50%;
  background: rgba(229, 199, 143, .08);
  color: var(--gold);
}
.focus-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.focus-card .box-label { margin-bottom: 5px; }
.focus-card p {
  margin: 0;
  font-size: calc(13px * var(--font-scale));
  line-height: 1.55;
  color: #ded6ef;
}

.reading-row + .reading-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(201, 166, 255, .14);
}
.reading-label {
  display: block;
  margin-bottom: 4px;
  font-size: calc(11px * var(--font-scale));
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold);
}
.reading-text { margin: 0; font-size: calc(14px * var(--font-scale)); line-height: 1.62; color: #ded6ef; }

/* Глубокий разбор: страница из эзотерической книги. */
.deep-toggle {
  width: 100%;
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(229, 199, 143, .5);
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(229, 199, 143, .12), rgba(201, 166, 255, .06));
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: calc(15px * var(--font-scale));
  letter-spacing: .02em;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s;
}
.deep-toggle:hover,
.deep-toggle.is-open {
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(212, 175, 55, .16);
}
.deep-book-icon { margin-right: 6px; }

.deep-book {
  position: relative;
  margin-top: 10px;
  padding: 16px 15px 12px;
  border: 1px solid rgba(229, 199, 143, .36);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 0, rgba(229, 199, 143, .09), transparent 60%),
    linear-gradient(160deg, #171227, #100c1b);
  box-shadow: inset 0 0 32px rgba(0, 0, 0, .35);
  overflow-wrap: anywhere;
}
.deep-book::before,
.deep-book::after {
  position: absolute;
  left: 16px;
  right: 16px;
  height: 1px;
  content: '';
  background: linear-gradient(90deg, transparent, rgba(229, 199, 143, .45), transparent);
}
.deep-book::before { top: 7px; }
.deep-book::after { bottom: 7px; }

.deep-book-head { position: relative; text-align: center; padding-bottom: 12px; }
.deep-book-head h4 {
  margin: 6px 0 0;
  font-family: var(--font-serif);
  font-size: calc(20px * var(--font-scale));
  font-weight: 400;
  color: #f3e8d0;
}
.deep-ornament { display: block; margin-top: 4px; color: var(--gold); font-size: calc(14px * var(--font-scale)); }

.deep-section { border-top: 1px solid rgba(229, 199, 143, .18); }
.deep-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 2px;
  border: 0;
  background: none;
  color: #f0e6ff;
  text-align: left;
  font-family: var(--font-serif);
  font-size: calc(16px * var(--font-scale));
  cursor: pointer;
}
.deep-num {
  flex: none;
  width: 22px;
  color: var(--gold);
  font-size: calc(11px * var(--font-scale));
  letter-spacing: .08em;
}
.deep-head-text { flex: 1; }
.deep-chevron { flex: none; color: var(--gold); font-size: calc(18px * var(--font-scale)); line-height: 1; }

.deep-panel { padding: 0 2px 14px 32px; }
.deep-panel p {
  margin: 0;
  font-size: calc(13px * var(--font-scale));
  line-height: 1.75;
  color: #ded6ef;
}
.deep-lead::first-letter {
  font-family: var(--font-serif);
  font-size: 1.55em;
  color: var(--gold);
}
.deep-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.deep-list li {
  position: relative;
  padding-left: 14px;
  font-size: calc(13px * var(--font-scale));
  line-height: 1.7;
  color: #ded6ef;
}
.deep-list li::before {
  position: absolute;
  left: 0;
  top: 1px;
  content: '✧';
  color: var(--gold);
  font-size: calc(11px * var(--font-scale));
}
.deep-list strong,
.practice-line strong { color: var(--gold); font-weight: 600; }
.practice-line + .practice-line { margin-top: 10px; }

.spread-ai {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(212, 175, 55, .32);
  border-radius: 14px;
  background: linear-gradient(140deg, rgba(212, 175, 55, .08), var(--surface));
}
.spread-ai-button { margin-top: 0; justify-content: center; }
.spread-ai-button[hidden] { display: none; }
.spread-ai-button.is-loading { opacity: .8; }
.secondary-button.spread-ai-button--primary {
  width: 100%;
  min-height: 52px;
  padding: 13px 15px;
  border-color: rgba(255, 224, 158, .8);
  border-radius: 14px;
  background: linear-gradient(120deg, #a97a24 0%, #f3da93 48%, #c49534 100%);
  box-shadow: 0 10px 28px rgba(212, 175, 55, .32), 0 0 22px rgba(240, 207, 122, .26),
    inset 0 1px 0 rgba(255, 255, 255, .42);
  color: #1d1428;
  font-size: calc(15px * var(--font-scale));
  font-weight: 700;
  letter-spacing: .02em;
  transition: box-shadow .2s ease, transform .2s ease, filter .2s ease;
}
.secondary-button.spread-ai-button--primary:hover,
.secondary-button.spread-ai-button--primary:active {
  border-color: #ffe6a8;
  background: linear-gradient(120deg, #b9872a 0%, #ffe9ad 48%, #d3a344 100%);
  box-shadow: 0 12px 32px rgba(212, 175, 55, .42), 0 0 28px rgba(255, 222, 150, .38),
    inset 0 1px 0 rgba(255, 255, 255, .5);
  transform: translateY(-1px);
}
.secondary-button.spread-ai-button--primary:disabled { opacity: .72; filter: saturate(.5); transform: none; }
.spread-ai-button--primary .spread-ai-spinner {
  border-color: rgba(29, 20, 40, .28);
  border-top-color: #1d1428;
}
.spread-ai-spinner {
  display: none;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(212, 175, 55, .3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spread-ai-spin .8s linear infinite;
}
.spread-ai-button.is-loading .spread-ai-spinner { display: inline-block; }
@keyframes spread-ai-spin { to { transform: rotate(360deg); } }
.spread-ai-loader[hidden] { display: none; }
.spread-ai-loader {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(229, 199, 143, .22);
  border-radius: 12px;
  background: rgba(10, 7, 20, .42);
  font-size: calc(12px * var(--font-scale));
  color: var(--muted);
}
.spread-ai-orb {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(229, 199, 143, .45);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(229, 199, 143, .3), rgba(143, 110, 224, .28));
  font-size: calc(17px * var(--font-scale));
  animation: spread-ai-pulse 1.6s ease-in-out infinite;
}
@keyframes spread-ai-pulse {
  0%, 100% { transform: scale(.94); box-shadow: 0 0 0 rgba(229, 199, 143, 0); }
  50% { transform: scale(1.06); box-shadow: 0 0 18px rgba(229, 199, 143, .32); }
}
.spread-ai-status {
  margin: 10px 0 0;
  font-size: calc(12px * var(--font-scale));
  color: var(--muted);
}
.spread-ai-status.is-error { color: #f0b7c6; }
.spread-ai-result {
  margin-top: 12px;
  padding: 12px;
  border-left: 2px solid var(--gold);
  border-radius: 8px;
  background: rgba(10, 7, 20, .45);
  font-size: calc(13px * var(--font-scale));
  line-height: 1.65;
  color: #ded6ef;
}
.spread-ai-result p { margin: 0 0 8px; }
.spread-ai-result p:last-child { margin-bottom: 0; }
.spread-ai-result strong { color: var(--gold); font-weight: 600; }
.virtual-ai { margin-bottom: 16px; }
.diary-ai {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 2px solid var(--gold);
  border-radius: 8px;
  background: rgba(212, 175, 55, .07);
}
.diary-ai p {
  margin: 6px 0 0;
  font-size: calc(12px * var(--font-scale));
  line-height: 1.6;
  white-space: pre-line;
  color: #ded6ef;
}

.sheet-footnote {
  margin: 18px 0 0;
  font-size: calc(11px * var(--font-scale));
  line-height: 1.5;
  color: var(--muted-2);
  text-align: center;
}

/* ---------- Profile and info sheets ---------- */

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 20px;
  padding: 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: linear-gradient(140deg, var(--surface-2), var(--surface));
}
.profile-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(229, 199, 143, .5);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(229, 199, 143, .28), rgba(143, 110, 224, .22));
  color: var(--gold);
  font-family: var(--font-card);
  font-size: calc(26px * var(--font-scale));
}
.profile-identity { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.profile-identity strong {
  overflow: hidden;
  font-size: calc(17px * var(--font-scale));
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-identity span {
  overflow: hidden;
  font-size: calc(12px * var(--font-scale));
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plus-teaser {
  margin: 0 0 18px;
  padding: 15px;
  border: 1px solid rgba(229, 199, 143, .34);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 100% 0%, rgba(212, 175, 55, .16), transparent 62%),
    linear-gradient(150deg, var(--surface-2), var(--surface));
}
.plus-teaser h4 {
  margin: 4px 0 6px;
  font-family: var(--font-serif);
  font-size: calc(18px * var(--font-scale));
  font-weight: 500;
}
.plus-teaser p { margin: 0 0 12px; color: var(--muted); font-size: calc(12px * var(--font-scale)); line-height: 1.45; }
.plus-teaser .secondary-button { min-height: 40px; font-size: calc(13px * var(--font-scale)); }

.plan-grid { display: grid; gap: 10px; margin: 16px 0 12px; }
.plan-card {
  position: relative;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(150deg, var(--surface-2), var(--surface));
}
.plan-card.is-plus {
  border-color: rgba(229, 199, 143, .44);
  background:
    radial-gradient(circle at 100% 0%, rgba(212, 175, 55, .16), transparent 62%),
    linear-gradient(150deg, var(--surface-2), var(--surface));
}
.plan-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 8px;
  border: 1px solid rgba(229, 199, 143, .32);
  border-radius: 999px;
  color: var(--gold);
  font-size: calc(10px * var(--font-scale));
  letter-spacing: .04em;
}
.plan-card h4 {
  margin: 0 32px 4px 0;
  font-family: var(--font-serif);
  font-size: calc(20px * var(--font-scale));
  font-weight: 500;
}
.plan-price { margin: 0 0 12px; color: var(--muted); font-size: calc(13px * var(--font-scale)); }
.plan-benefits { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.plan-benefits li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: calc(12px * var(--font-scale));
  line-height: 1.4;
}
.plan-benefits li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: calc(11px * var(--font-scale));
}
.plan-card .primary-button { margin-top: 14px; }
.plan-card .primary-button:disabled { cursor: default; }

.ai-quota {
  margin: 8px 0;
  color: var(--muted);
  font-size: calc(11px * var(--font-scale));
  line-height: 1.4;
}
.ai-quota.is-empty { color: var(--gold); }

@media (min-width: 620px) {
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.profile-actions,
.info-actions { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }
.secondary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  color: #ded6ef;
  font-size: calc(14px * var(--font-scale));
  text-align: left;
  transition: border-color .18s, background .18s;
}
.secondary-button:hover,
.secondary-button:active {
  border-color: rgba(229, 199, 143, .5);
  background: rgba(212, 175, 55, .09);
}
.secondary-button small { font-size: calc(11px * var(--font-scale)); color: var(--muted-2); }
.secondary-button.is-danger { color: #f0b7c6; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  color: #ded6ef;
  font-size: calc(14px * var(--font-scale));
  cursor: pointer;
}
.setting-row--select { cursor: default; }
.setting-select {
  flex: 0 0 auto;
  min-width: 88px;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: calc(14px * var(--font-scale));
}
.setting-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 44px;
  height: 26px;
}
.switch input {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.slider {
  position: absolute;
  inset: 0;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  transition: background .18s, border-color .18s;
}
.slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ded6ef;
  transition: transform .18s, background .18s;
}
.switch input:checked + .slider {
  border-color: var(--spark-gold);
  background: rgba(212, 175, 55, .28);
}
.switch input:checked + .slider::after {
  background: var(--spark-gold);
  transform: translateX(18px);
}
.switch input:focus-visible + .slider {
  outline: 2px solid var(--spark-gold);
  outline-offset: 2px;
}

.info-list { margin: 16px 0 0; padding-left: 20px; color: #ded6ef; font-size: calc(14px * var(--font-scale)); line-height: 1.7; }
.info-list li + li { margin-top: 8px; }
.info-box {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: calc(13px * var(--font-scale));
  line-height: 1.6;
  color: var(--muted);
}
.profile-status { min-height: 0; }

/* ---------- Личные арканы: дата рождения и карты года/месяца ---------- */

.birth-date-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
  font-size: calc(13px * var(--font-scale));
  color: #ded6ef;
}
.birth-date-field input {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  color: #ded6ef;
  font-size: calc(16px * var(--font-scale));
  color-scheme: dark;
}
.birth-date-error {
  min-height: 0;
  margin: 9px 0 0;
  font-size: calc(12px * var(--font-scale));
  color: #f0b7c6;
}

.personal-widget {
  display: block;
  width: 100%;
  margin: 0 0 14px;
  padding: 15px;
  border: 1px solid rgba(212, 175, 55, .35);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 100% 0, rgba(212, 175, 55, .14), transparent 55%),
    linear-gradient(140deg, var(--surface-2), var(--surface));
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.personal-widget:hover,
.personal-widget:active { border-color: rgba(229, 199, 143, .7); }
.personal-widget-head { display: block; }
.personal-widget .eyebrow { margin-bottom: 4px; }
.personal-widget-title {
  display: block;
  font-family: var(--font-serif);
  font-size: calc(19px * var(--font-scale));
  color: #f2e6c8;
}
.personal-widget-hint {
  display: block;
  margin-top: 5px;
  font-size: calc(12px * var(--font-scale));
  line-height: 1.45;
  color: var(--muted);
}
.personal-widget-cards { display: flex; gap: 10px; margin-top: 12px; }
.personal-mini-card {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(10, 7, 20, .35);
}
.personal-mini-art {
  flex: 0 0 34px;
  width: 34px;
  aspect-ratio: 2 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, .4);
  border-radius: 6px;
  background: linear-gradient(160deg, #2b2044, #161022);
  color: var(--gold);
  font-size: calc(16px * var(--font-scale));
}
.personal-mini-art img { width: 100%; height: 100%; object-fit: cover; }
.personal-mini-card.is-empty .personal-mini-art { border-color: var(--border); color: var(--muted); }
.personal-mini-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.personal-mini-info small {
  font-size: calc(9px * var(--font-scale));
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gold);
}
.personal-mini-card.is-empty .personal-mini-info small { color: var(--muted); }
.personal-mini-info strong {
  overflow: hidden;
  font-size: calc(12px * var(--font-scale));
  font-weight: 500;
  color: #eee7f7;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.personal-widget-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  font-size: calc(12px * var(--font-scale));
  color: var(--gold);
}

.period-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}
.period-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: linear-gradient(140deg, var(--surface-2), var(--surface));
}
.period-art {
  flex: 0 0 86px;
  width: 86px;
  max-width: none;
  border-radius: 10px;
}
.period-art .hero-num {
  top: 6px;
  left: 6px;
  padding: 2px 6px;
  font-size: calc(11px * var(--font-scale));
}
.period-card-info { min-width: 0; }
.period-card-info .eyebrow { margin-bottom: 4px; font-size: calc(10px * var(--font-scale)); }
.period-card-info h4 {
  margin: 0;
  font-family: var(--font-card);
  font-size: 20px;
  font-weight: 400;
}
.period-keywords { justify-content: flex-start; margin-top: 8px; }
.period-keywords .chip { padding: 4px 8px; font-size: calc(11px * var(--font-scale)); }
.period-essence {
  margin: 10px 0 0;
  font-size: calc(12px * var(--font-scale));
  line-height: 1.55;
  color: var(--muted);
}

/* ---------- Spread detail ---------- */

.detail-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 16px; }
.detail-description { margin: 0 0 16px; font-size: calc(14px * var(--font-scale)); line-height: 1.65; color: #ded6ef; }

.section-title {
  margin: 22px 0 11px;
  font-family: var(--font-serif);
  font-size: calc(19px * var(--font-scale));
  font-weight: 400;
}

.positions { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.position {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .025);
}
.position-num {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(229, 199, 143, .3);
  border-radius: 50%;
  font-family: var(--font-serif);
  font-size: calc(11px * var(--font-scale));
  color: var(--gold);
}
.position-title { display: block; font-size: calc(13px * var(--font-scale)); font-weight: 600; }
.position-text { display: block; margin-top: 2px; font-size: calc(11.5px * var(--font-scale)); line-height: 1.45; color: var(--muted); }

.diagram-wrap {
  margin: 14px 0 4px;
  padding: clamp(8px, 3vw, 14px);
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, .02);
  /* Широкие схемы прокручиваются внутри контейнера, не растягивая страницу. */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.diagram {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  margin: 0 auto;
  gap: 2px;
}
.diagram-lines {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.diagram-cell {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid rgba(201, 166, 255, .26);
  border-radius: 8px;
  background: linear-gradient(150deg, #251b3e, #171129);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
  font-family: var(--font-serif);
  font-size: calc(clamp(11px, 3vw, 14px) * var(--font-scale));
  color: #d9c9f5;
}
.diagram-cell.is-empty {
  border-color: transparent;
  background: none;
  box-shadow: none;
}
.diagram-cell.is-key { border-color: rgba(229, 199, 143, .55); color: var(--gold); }
.diagram-cell.is-cross {
  z-index: 2;
  transform: rotate(90deg);
  border-color: rgba(229, 199, 143, .45);
  color: var(--gold);
  background: rgba(30, 22, 50, .94);
}
.diagram-caption { margin: 10px 0 0; text-align: center; font-size: calc(11px * var(--font-scale)); color: var(--muted-2); }

/* Выбор карт из реальной колоды */
.diagram-cell.is-pick {
  padding: 4px;
  border-color: rgba(229, 199, 143, .42);
  cursor: pointer;
  font-family: inherit;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.diagram-cell.is-pick:hover {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(212, 175, 55, .2);
}
.diagram-cell.has-card {
  gap: 2px;
  overflow: hidden;
  align-content: center;
}
.diagram-cell.is-cross.has-card { transform: none; }
.cell-image {
  width: 100%;
  max-height: 72%;
  object-fit: cover;
  border-radius: 6px;
}
.cell-glyph { font-size: calc(18px * var(--font-scale)); color: var(--gold); }
.cell-name {
  display: block;
  max-width: 100%;
  font-size: 9px;
  line-height: 1.15;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #efe4ff;
}
.cell-num { font-family: var(--font-serif); font-size: calc(14px * var(--font-scale)); color: var(--gold); }
.cell-hint { display: block; font-size: calc(8px * var(--font-scale)); color: var(--muted); }

.picker-hint {
  margin: 0 0 14px;
  font-size: calc(13px * var(--font-scale));
  line-height: 1.55;
  color: var(--muted);
}
.picker-back {
  margin-bottom: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold);
  font-size: calc(13px * var(--font-scale));
}
.picker-search { margin-bottom: 12px; }
.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.picker-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(150deg, var(--surface-2), var(--surface));
  color: var(--text);
  text-align: center;
  transition: border-color .18s, transform .18s;
}
.picker-card:not([disabled]):hover {
  border-color: rgba(229, 199, 143, .55);
  transform: translateY(-2px);
}
.picker-card.is-used { opacity: .4; cursor: not-allowed; }
.picker-art {
  height: 84px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(229, 199, 143, .22);
  border-radius: 8px;
  background: radial-gradient(circle at 50% 25%, rgba(229, 199, 143, .12), rgba(10, 7, 20, .6));
  color: var(--tone, var(--gold));
  font-size: calc(26px * var(--font-scale));
}
.picker-art img { width: 100%; height: 100%; object-fit: cover; }
.picker-name {
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.picker-used { font-size: calc(9px * var(--font-scale)); color: var(--muted-2); }

.spread-selected {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(229, 199, 143, .04);
}
.spread-selected ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.selected-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px 6px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: calc(11px * var(--font-scale));
}
.selected-card img {
  width: 26px;
  height: 34px;
  object-fit: cover;
  border-radius: 5px;
}
.selected-card strong { color: var(--gold); font-weight: 500; }
.selected-card span span { display: block; color: var(--muted); }

/* Главный путь экрана расклада: крупная светящаяся кнопка-действие. */
.spread-virtual-button {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  margin: 4px 0 18px;
  padding: 14px 15px;
  border: 1px solid rgba(229, 199, 143, .62);
  border-radius: 16px;
  background: linear-gradient(120deg, #8f6ee0, #c9a6ff 48%, #e5c78f);
  box-shadow: 0 10px 26px rgba(143, 110, 224, .34), 0 0 22px rgba(229, 199, 143, .18);
  color: #160d24;
  text-align: left;
  transition: transform .18s, box-shadow .18s, filter .18s;
}
.spread-virtual-button:hover,
.spread-virtual-button:active {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 14px 30px rgba(143, 110, 224, .42), 0 0 28px rgba(229, 199, 143, .28);
}
.spread-cta-icon { flex: none; display: grid; place-items: center; width: 26px; height: 26px; }
.spread-cta-icon svg { width: 26px; height: 26px; }
.spread-cta-copy { flex: 1; min-width: 0; }
.spread-cta-copy strong { display: block; font-size: calc(15px * var(--font-scale)); font-weight: 700; }
.spread-cta-copy small { display: block; margin-top: 2px; font-size: calc(11px * var(--font-scale)); opacity: .78; }
.spread-cta-arrow { flex: none; font-size: calc(20px * var(--font-scale)); line-height: 1; opacity: .8; }

/* Ручной ввод открывается кнопкой на детальном экране. */
.manual-mode {
  margin: 20px 0 4px;
  padding: 16px 12px;
  border: 1px solid rgba(212, 175, 55, .24);
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(229, 199, 143, .06), rgba(143, 110, 224, .04));
}
.manual-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.manual-heading { min-width: 0; }
.manual-eyebrow {
  display: block;
  font-size: calc(10px * var(--font-scale));
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
}
.manual-heading h4 {
  margin: 3px 0 0;
  font-family: var(--font-card);
  font-size: calc(17px * var(--font-scale));
  font-weight: 500;
}
.manual-body { margin-top: 12px; }
.manual-body[hidden] { display: none; }
.manual-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.manual-slot {
  position: relative;
  display: block;
  width: clamp(56px, 17vw, 68px);
  aspect-ratio: 2 / 3;
  min-height: 90px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(229, 199, 143, .55);
  border-radius: 7px;
  background: linear-gradient(150deg, #2a1f45, #171129);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .34);
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.manual-slot:hover,
.manual-slot:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(212, 175, 55, .3);
}
.manual-slot-back {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(229, 199, 143, .38);
  font-size: calc(22px * var(--font-scale));
  background:
    repeating-linear-gradient(45deg, rgba(229, 199, 143, .05) 0 5px, transparent 5px 10px),
    radial-gradient(circle at center, rgba(201, 166, 255, .16), transparent 70%);
}
.manual-slot-art,
.manual-slot-art .card-wrapper {
  position: absolute;
  inset: 0;
  display: block;
}
.manual-slot-art .card-image { border-radius: 6px; }
.manual-slot-glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: calc(24px * var(--font-scale));
  color: var(--gold);
}
.manual-slot-overlay {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 3px 5px;
  background: linear-gradient(180deg, transparent, rgba(10, 7, 20, .92) 45%);
  text-align: center;
}
.manual-slot-num {
  font-family: var(--font-serif);
  font-size: calc(10px * var(--font-scale));
  color: var(--gold);
}
.manual-slot-title {
  max-width: 100%;
  font-size: calc(8px * var(--font-scale));
  line-height: 1.12;
  color: #efe4ff;
  overflow-wrap: break-word;
}
.manual-slot-hint {
  font-size: calc(7px * var(--font-scale));
  line-height: 1.1;
  color: var(--muted);
}
.manual-slot.has-card .cell-name {
  position: absolute;
  bottom: 3px;
  left: 3px;
  right: 3px;
  z-index: 4;
  font-size: 8px;
  color: #fff;
  text-shadow: 0 1px 3px #000;
}

.section-title--quiet {
  margin-top: 24px;
  font-size: calc(16px * var(--font-scale));
  color: var(--muted);
}
.spread-actions { margin-top: 18px; }
.spread-actions .primary-button { width: 100%; }
.note-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.note-cards li {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px 5px 5px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: calc(12px * var(--font-scale));
}
.note-cards img { width: 26px; height: 36px; object-fit: cover; border-radius: 5px; }
.spread-note-save { width: 100%; margin-top: 14px; }

.diary-spread {
  margin: 6px 0 0;
  font-size: calc(11px * var(--font-scale));
  color: var(--gold);
}
.diary-note { white-space: pre-line; }
.diary-orientation {
  display: inline-block;
  margin: 7px 0 0;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: calc(10px * var(--font-scale));
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.diary-orientation.is-reversed {
  border-color: rgba(212, 175, 55, .5);
  background: rgba(212, 175, 55, .1);
  color: var(--gold);
}

.steps { margin: 0; padding-left: 19px; color: var(--muted); }
.steps li { margin-bottom: 5px; font-size: calc(12px * var(--font-scale)); line-height: 1.5; }
.steps li::marker { color: var(--gold); font-family: var(--font-serif); font-size: calc(11px * var(--font-scale)); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Карта дня и дневник ---------- */

.auth-panel[hidden],
#day-authed[hidden],
#diary-authed[hidden],
#day-guest[hidden],
.day-card[hidden],
.note-block[hidden],
.home-note-block[hidden],
.home-actions[hidden],
.stats-block[hidden],
.daily-result[hidden],
#home-save[hidden],
#share-home[hidden],
.draw-lock[hidden],
.form-status:empty { display: none; }

.draw-lock {
  margin: 10px 0 0;
  font-size: calc(12px * var(--font-scale));
  line-height: 1.5;
  color: var(--gold);
  text-align: center;
}

.home-actions { margin-top: 14px; }
.home-note-block { margin-top: 14px; text-align: left; }
.home-note-block label {
  display: block;
  margin-bottom: 6px;
  font-size: calc(12px * var(--font-scale));
  color: var(--muted);
}
.home-note-block textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(10, 7, 20, .55);
  color: var(--text);
  font: inherit;
  font-size: calc(13px * var(--font-scale));
  line-height: 1.5;
  resize: vertical;
}
.home-note-block textarea::placeholder { color: var(--muted-2); }
.home-note-block textarea:focus { outline: none; border-color: var(--gold); }

.day-guest-hint {
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(201, 166, 255, .05);
  font-size: calc(12px * var(--font-scale));
  line-height: 1.5;
  text-align: center;
  color: var(--muted);
}
.day-guest-hint a { color: var(--gold); }

.auth-panel {
  margin-top: 20px;
  padding: 24px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: linear-gradient(150deg, var(--surface-2), var(--surface));
  text-align: center;
}
.auth-panel > span {
  display: block;
  margin-bottom: 8px;
  font-size: calc(28px * var(--font-scale));
  color: var(--gold);
  opacity: .75;
}
.auth-panel p {
  margin: 0 0 18px;
  font-size: calc(14px * var(--font-scale));
  line-height: 1.55;
  color: var(--muted);
}

.primary-button {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  padding: 12px 16px;
  border: 1px solid rgba(229, 199, 143, .45);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(143, 110, 224, .42), rgba(201, 166, 255, .2));
  color: #fff;
  font-size: calc(14px * var(--font-scale));
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
  transition: transform .18s, box-shadow .18s;
}
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0, 0, 0, .34); }
.primary-button:disabled { opacity: .55; cursor: wait; transform: none; }

.account-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.account-bar > span {
  min-width: 0;
  overflow: hidden;
  font-size: calc(13px * var(--font-scale));
  color: #ded6ef;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-bar .link-button { flex: none; font-size: calc(12px * var(--font-scale)); }

.day-stage { margin-top: 18px; }
.draw-button { max-width: none; margin-bottom: 18px; }

.day-card .modal-card-image-container { max-width: 280px; margin: 0 auto; }
.day-card .hero-art { max-width: 280px; }
.day-card-info { margin-top: 14px; text-align: center; }
.day-card-info h3 {
  margin: 0;
  font-family: var(--font-card);
  font-size: 26px;
  font-weight: 400;
}
.day-orientation {
  margin: 5px 0 0;
  font-size: calc(11px * var(--font-scale));
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
}
.day-meaning {
  margin: 10px 0 0;
  font-size: calc(14px * var(--font-scale));
  line-height: 1.6;
  color: #ded6ef;
}

.day-actions { margin-top: 14px; }
.share-day,
.share-home {
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-color: rgba(212, 175, 55, .5);
  color: #f0e2bd;
}
.share-day .share-icon,
.share-home .share-icon { color: var(--spark-gold); font-size: calc(17px * var(--font-scale)); line-height: 1; }
.share-day:hover,
.share-day:active,
.share-home:hover,
.share-home:active {
  border-color: var(--spark-gold);
  background: rgba(212, 175, 55, .12);
}

.note-block {
  margin-top: 18px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(150deg, var(--surface-2), var(--surface));
}
.note-block label {
  display: block;
  margin-bottom: 9px;
  font-size: calc(13px * var(--font-scale));
  color: var(--text);
}
.note-block textarea {
  width: 100%;
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: rgba(10, 7, 20, .62);
  color: var(--text);
  font-size: calc(14px * var(--font-scale));
  line-height: 1.5;
  resize: vertical;
}
.note-block textarea::placeholder { color: var(--muted-2); }
.note-block .primary-button { max-width: none; margin-top: 12px; }

.form-status {
  margin: 10px 0 0;
  font-size: calc(12px * var(--font-scale));
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
}

.diary-filter-label {
  display: block;
  margin: 18px 0 8px;
  font-size: calc(11px * var(--font-scale));
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
}
.diary-select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  font-size: calc(14px * var(--font-scale));
  color-scheme: dark;
}

/* ---------- Статистика дневника ---------- */

.stats-block {
  margin-bottom: 20px;
  padding: 16px 14px;
  border: 1px solid rgba(229, 199, 143, .28);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 0%, rgba(212, 175, 55, .12), transparent 62%),
    linear-gradient(150deg, var(--surface-2), var(--surface));
}
.stats-head h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: calc(21px * var(--font-scale));
  font-weight: 400;
}
.stats-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
.stat-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(10, 7, 20, .35);
}
.stat-icon {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(229, 199, 143, .4);
  border-radius: 12px;
  background: rgba(229, 199, 143, .09);
  color: var(--gold);
  font-size: calc(18px * var(--font-scale));
}
.stat-label {
  display: block;
  font-size: calc(10px * var(--font-scale));
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat-value {
  display: block;
  margin-top: 3px;
  font-family: var(--font-serif);
  font-size: calc(18px * var(--font-scale));
  font-weight: 400;
  color: var(--gold);
}
.stat-hint {
  margin: 5px 0 0;
  font-size: calc(12px * var(--font-scale));
  line-height: 1.45;
  color: var(--muted);
}

/* ---------- Экран статистики ---------- */

.stats-loading {
  margin: 16px 0;
  text-align: center;
  font-size: calc(13px * var(--font-scale));
  color: var(--muted);
}
.stats-screen { max-width: 500px; margin: 0 auto; padding: 16px 0 0; }
.stats-grid--screen { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; }
.stat-panel {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 14px 12px;
  border: 1px solid rgba(212, 175, 55, .24);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 0%, rgba(212, 175, 55, .12), transparent 70%),
    rgba(255, 255, 255, .04);
}
.stat-panel--wide { grid-column: 1 / -1; align-items: flex-start; }
.panel-icon {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(212, 175, 55, .38);
  border-radius: 12px;
  background: rgba(212, 175, 55, .1);
  font-size: calc(20px * var(--font-scale));
}
.panel-body { min-width: 0; width: 100%; }
.panel-label {
  display: block;
  font-size: calc(10px * var(--font-scale));
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.panel-value {
  margin-top: 4px;
  font-family: var(--font-serif);
  font-size: calc(28px * var(--font-scale));
  line-height: 1.2;
  color: var(--gold);
}
.panel-value--small { font-size: calc(18px * var(--font-scale)); }
.panel-value--empty { font-size: calc(13px * var(--font-scale)); color: var(--muted); }
.panel-total { font-size: calc(14px * var(--font-scale)); color: var(--muted); }
.panel-hint {
  margin: 5px 0 0;
  font-size: calc(11px * var(--font-scale));
  line-height: 1.45;
  color: var(--muted);
}
.panel-progress {
  width: 100%;
  height: 5px;
  margin-top: 11px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
}
.panel-progress-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #d4af37, #f4d03f);
  box-shadow: 0 0 10px rgba(212, 175, 55, .45);
  transition: width .8s ease;
}
.panel-favorite { display: flex; align-items: center; gap: 10px; }
.panel-favorite .panel-value { margin-top: 0; }
.panel-thumb {
  flex: none;
  width: 42px;
  height: 60px;
  object-fit: cover;
  border: 1px solid rgba(212, 175, 55, .4);
  border-radius: 8px;
  background: rgba(10, 7, 20, .5);
}
.panel-thumb--glyph { display: grid; place-items: center; color: var(--gold); font-size: calc(24px * var(--font-scale)); }
.panel-button { min-height: 40px; margin-top: 10px; font-size: calc(13px * var(--font-scale)); }
.stat-breakdown {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, .035);
}
.stat-breakdown h3 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: calc(18px * var(--font-scale));
  font-weight: 400;
  color: var(--gold);
}
.breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  font-size: calc(13px * var(--font-scale));
  color: #ded6ef;
}
.breakdown-row:last-child { border-bottom: none; }
.breakdown-count { color: var(--gold); font-weight: 600; }
.stats-empty { margin-top: 16px; }
.diary-item.is-highlighted {
  border-color: var(--spark-gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, .25), 0 0 24px rgba(212, 175, 55, .2);
}

@media (max-width: 360px) {
  .stats-grid--screen { grid-template-columns: 1fr; }
}

.diary-list { display: flex; flex-direction: column; gap: 18px; margin-top: 14px; }
.diary-day { display: flex; flex-direction: column; gap: 10px; }
.diary-day-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: calc(15px * var(--font-scale));
  font-weight: 400;
  color: var(--gold);
}
.diary-day-items { display: flex; flex-direction: column; gap: 10px; }
.diary-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(150deg, var(--surface-2), var(--surface));
}
.diary-thumb {
  flex: none;
  width: 56px;
  height: 84px;
  object-fit: cover;
  border: 1px solid rgba(229, 199, 143, .28);
  border-radius: 8px;
  background: rgba(10, 7, 20, .5);
}
.diary-glyph {
  display: grid;
  place-items: center;
  font-size: calc(28px * var(--font-scale));
  color: var(--gold);
}
.diary-content { min-width: 0; flex: 1; }
.diary-top { display: flex; align-items: center; gap: 8px; }
.diary-date { font-size: calc(11px * var(--font-scale)); color: var(--muted-2); }
.diary-time { font-size: calc(11px * var(--font-scale)); color: var(--gold); }
.diary-delete {
  flex: none;
  margin-left: auto;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: calc(11px * var(--font-scale));
  text-decoration: underline;
  text-underline-offset: 2px;
}
.diary-content h3 {
  margin: 6px 0 0;
  font-family: var(--font-card);
  font-size: 20px;
  font-weight: 400;
}
.diary-note {
  margin: 8px 0 0;
  font-size: calc(13px * var(--font-scale));
  line-height: 1.5;
  color: #ded6ef;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: 96px;
  left: 50%;
  z-index: 9999;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border: 1px solid rgba(212, 175, 55, .6);
  border-radius: 24px;
  background: rgba(212, 175, 55, .95);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
  color: #1a1a2e;
  font-size: calc(14px * var(--font-scale));
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Карта без рамки и декора: изображение занимает весь контейнер. */
:root { --card-radius: 10px; }

.card-wrapper {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}
.card-wrapper .card-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--card-radius);
}

.picker-art { position: relative; }
.cell-media {
  position: relative;
  display: block;
  width: 100%;
  max-height: 72%;
  overflow: hidden;
  border-radius: var(--card-radius);
}
.card-tile > span { position: relative; z-index: 3; }
.card-tile > .card-wrapper { position: absolute; z-index: 0; }

/* ---------- Кельтский крест: классическая геометрия ---------- */

.celtic-cross,
.vs-board--celtic.celtic-cross {
  position: relative;
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 14px auto 18px;
  aspect-ratio: 4 / 5;
}

.celtic-slot {
  position: absolute;
  width: 20%;
  aspect-ratio: 2 / 3;
  min-width: 0;
  pointer-events: none;
}

.celtic-slot > .manual-slot,
.celtic-slot > .vs-slot {
  pointer-events: auto;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: auto;
  padding: 0;
}

.celtic-slot > .vs-slot .vs-slot-card { height: 100%; aspect-ratio: auto; }
.celtic-slot > .vs-slot .vs-slot-label,
.celtic-slot > .vs-slot .vs-slot-name,
.celtic-slot > .vs-slot .vs-slot-orient,
.celtic-slot > .vs-slot .vs-slot-keywords { display: none; }

/* Крест: 1 — суть, 2 — препятствие поперёк неё, 3 — основание,
   4 — прошлое, 5 — цель, 6 — будущее. Справа — «посох» 7–10. */
.celtic-slot.pos-1  { left: 25%; top: 38%; z-index: 2; }
.celtic-slot.pos-2  { left: 25%; top: 38%; z-index: 3; }
.celtic-slot.pos-3  { left: 25%; top: 73%; z-index: 2; }
.celtic-slot.pos-4  { left: 2%;  top: 38%; z-index: 2; }
.celtic-slot.pos-5  { left: 25%; top: 2%;  z-index: 2; }
.celtic-slot.pos-6  { left: 49%; top: 38%; z-index: 2; }
.celtic-slot.pos-7  { left: 76%; top: 2%;  z-index: 2; }
.celtic-slot.pos-8  { left: 76%; top: 27%; z-index: 2; }
.celtic-slot.pos-9  { left: 76%; top: 52%; z-index: 2; }
.celtic-slot.pos-10 { left: 76%; top: 76%; z-index: 2; }

.celtic-slot.pos-2 > .manual-slot,
.celtic-slot.pos-2 > .vs-slot { transform: rotate(90deg); }
.celtic-slot.pos-2 > .vs-slot.is-placed:active { transform: rotate(90deg) scale(.96); }
.celtic-slot.pos-2 .manual-slot.is-pick:hover { border-color: var(--gold); }

.celtic-label {
  position: absolute;
  z-index: 5;
  bottom: -16px;
  left: 50%;
  width: max-content;
  max-width: 118px;
  padding: 1px 4px;
  transform: translateX(-50%);
  border-radius: 5px;
  background: rgba(10, 7, 20, .84);
  color: var(--gold);
  font-size: calc(9px * var(--font-scale));
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  pointer-events: none;
}
.celtic-slot.pos-5 .celtic-label,
.celtic-slot.pos-7 .celtic-label,
.celtic-slot.pos-10 .celtic-label { top: -16px; bottom: auto; }
.celtic-slot.pos-4 .celtic-label { left: 0; transform: none; text-align: left; }
.celtic-slot.pos-6 .celtic-label,
.celtic-slot.pos-7 .celtic-label,
.celtic-slot.pos-8 .celtic-label,
.celtic-slot.pos-9 .celtic-label,
.celtic-slot.pos-10 .celtic-label { left: auto; right: 0; transform: none; text-align: right; }

@media (max-width: 360px) {
  .celtic-cross,
  .vs-board--celtic.celtic-cross { max-width: 100%; }
  .celtic-label { font-size: calc(8px * var(--font-scale)); max-width: 100px; }
}
