:root {
  --bg0: #060a0f;
  --bg1: #0c1419;
  --ink: #f0e8d4;
  --muted: #9a8f78;
  --gold: #d4af6a;
  --gold-dim: #8b6530;
  --violet: #3d2a5c;
  --teal: #1a4a42;
  --line: rgba(212, 175, 106, 0.35);
  --glow: rgba(212, 175, 106, 0.35);
  --glass: rgba(12, 20, 25, 0.72);
  --font-display: "Cinzel", serif;
  --font-body: "Cormorant Garamond", serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  min-height: 100%;
  background: var(--bg0);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.45;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 106, 0.55) rgba(12, 20, 25, 0.35);
}

/* Тонкий видимый скролл — чтобы было понятно: можно тянуть */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 106, 0.55) rgba(12, 20, 25, 0.25);
}

*::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

*::-webkit-scrollbar-track {
  background: rgba(12, 20, 25, 0.35);
  border-radius: 99px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(212, 175, 106, 0.75), rgba(139, 101, 48, 0.55));
  border-radius: 99px;
  border: 1px solid rgba(212, 175, 106, 0.25);
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(232, 200, 120, 0.9);
}

body {
  padding-top: calc(52px + var(--safe-top));
  padding-bottom: var(--safe-bottom);
}

/* На раскладе верхняя панель остаётся — кнопки «Назад» и «Звук» всегда под рукой */
body.ritual-open {
  padding-top: calc(2.75rem + var(--safe-top));
}

body.ritual-open .topbar {
  display: flex;
}

#cosmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(61, 42, 92, 0.4), transparent 55%),
    radial-gradient(ellipse 70% 45% at 90% 20%, rgba(26, 74, 66, 0.35), transparent 50%),
    radial-gradient(ellipse 90% 55% at 50% 105%, rgba(212, 175, 106, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(139, 58, 47, 0.22), transparent 55%);
  animation: auroraShift 14s ease-in-out infinite alternate;
}

.veil {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 40%, rgba(6, 10, 15, 0.55) 75%, rgba(6, 10, 15, 0.92)),
    radial-gradient(ellipse 100% 40% at 50% 100%, rgba(106, 154, 143, 0.12), transparent 70%);
  animation: veilPulse 10s ease-in-out infinite alternate;
}

@keyframes veilPulse {
  from { opacity: 0.85; }
  to { opacity: 1; }
}

@keyframes auroraShift {
  from { opacity: 0.75; transform: scale(1); }
  to { opacity: 1; transform: scale(1.05) translateY(-2%); }
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(0.55rem + var(--safe-top)) 1rem 0.55rem;
  background: linear-gradient(180deg, rgba(6, 10, 15, 0.95), transparent);
  backdrop-filter: blur(8px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

#backBtn {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1;
  letter-spacing: 0;
}

.top-title {
  font-family: var(--font-display);
  letter-spacing: 0.35em;
  font-size: 0.72rem;
  color: var(--gold);
}

.icon-btn {
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--glass);
  color: var(--ink);
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.icon-btn:active { transform: scale(0.92); }
.icon-btn.off { opacity: 0.45; }

.app {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  min-height: calc(100dvh - 52px - var(--safe-top));
}

.screen { display: none; animation: fadeIn 0.5s ease; }
.screen.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.top-title.hall-logo {
  letter-spacing: 0.2em;
  font-size: 0.68rem;
  text-shadow: 0 0 12px var(--glow);
}

/* ─── Hero: фото зала + лёгкие живые эффекты (без дублей свечей/дыма на фото) ─── */
.hero-hall {
  margin: 0.4rem 1rem 0;
  position: relative;
}

.hall-frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(198, 161, 91, 0.45);
  box-shadow:
    0 0 0 1px rgba(198, 161, 91, 0.1) inset,
    0 12px 40px rgba(0, 0, 0, 0.6),
    0 0 56px rgba(212, 175, 106, 0.14);
  animation: hallBreath 5s ease-in-out infinite;
}

@keyframes hallBreath {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(198, 161, 91, 0.1) inset, 0 12px 40px rgba(0,0,0,0.6), 0 0 48px rgba(212,175,106,0.12);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(198, 161, 91, 0.2) inset, 0 16px 48px rgba(0,0,0,0.65), 0 0 72px rgba(255,180,80,0.18);
  }
}

.hall-bg-wrap {
  position: relative;
  overflow: hidden;
}

.hall-bg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 960 / 528;
  object-fit: cover;
  object-position: center 42%;
  animation: hallKenBurns 24s ease-in-out infinite;
}

@keyframes hallKenBurns {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.hall-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 85% 75% at 50% 45%, transparent 35%, rgba(6, 10, 15, 0.45) 100%),
    linear-gradient(180deg, rgba(6, 10, 15, 0.15) 0%, transparent 28%, rgba(6, 10, 15, 0.35) 100%);
}

.hall-live {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.hall-shimmer {
  position: absolute;
  left: 38%;
  top: 22%;
  width: 24%;
  height: 38%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120, 230, 210, 0.18), transparent 70%);
  animation: hallShimmer 4s ease-in-out infinite;
  mix-blend-mode: screen;
}

@keyframes hallShimmer {
  0%, 100% { opacity: 0.35; transform: scale(0.92); }
  50% { opacity: 0.75; transform: scale(1.08); }
}

.hall-mist {
  position: absolute;
  bottom: -10%;
  left: -8%;
  width: 116%;
  height: 45%;
  background: radial-gradient(ellipse 60% 50% at 50% 85%, rgba(168, 232, 220, 0.07), transparent 70%);
  animation: mistDrift 10s ease-in-out infinite;
}

@keyframes mistDrift {
  0%, 100% { transform: translateX(0); opacity: 0.4; }
  50% { transform: translateX(3%); opacity: 0.7; }
}

.hall-spark {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px var(--gold), 0 0 14px rgba(255, 200, 100, 0.5);
  animation: sparkFloat 4.5s ease-in-out infinite;
  animation-delay: var(--d);
  opacity: 0;
}

@keyframes sparkFloat {
  0%, 100% { transform: translateY(0) scale(0.6); opacity: 0; }
  15% { opacity: 0.85; }
  50% { transform: translateY(-10px) scale(1); opacity: 0.6; }
  85% { opacity: 0.15; }
}

@media (prefers-reduced-motion: reduce) {
  .hall-bg,
  .hall-shimmer,
  .hall-mist,
  .hall-spark,
  .hall-frame {
    animation: none !important;
  }
}

.hero-text {
  text-align: center;
  margin: 1rem 0 1.2rem;
}

.sigil {
  color: var(--gold);
  letter-spacing: 0.5em;
  font-size: 0.85rem;
  opacity: 0.7;
}

.hero-text h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 0 50px var(--glow);
  margin: 0.3rem 0;
}

.tagline {
  color: var(--muted);
  font-style: italic;
  font-size: 1rem;
}

/* ─── Tabs & panels ─── */
.tabs {
  position: sticky;
  top: calc(52px + var(--safe-top));
  z-index: 45;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.28rem;
  padding: 0.35rem 0.85rem 0.55rem;
  margin-bottom: 0.85rem;
  background: linear-gradient(180deg, rgba(6, 10, 15, 0.96) 70%, rgba(6, 10, 15, 0.82));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  min-height: 3.55rem;
  font-family: var(--font-display);
  padding: 0.5rem 0.15rem 0.45rem;
  border: 1px solid rgba(212, 175, 106, 0.35);
  border-radius: 10px;
  background: linear-gradient(165deg, rgba(28, 36, 48, 0.92) 0%, rgba(8, 12, 18, 0.95) 100%);
  color: var(--ink);
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s, box-shadow 0.3s, background 0.3s, transform 0.25s;
  white-space: normal;
  overflow: visible;
  text-align: center;
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -3px 8px rgba(0, 0, 0, 0.35);
}

.tab:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.45),
    0 0 20px rgba(212, 175, 106, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.tab-label {
  display: block;
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  line-height: 1.2;
  color: var(--ink);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.tab.active {
  color: var(--gold);
  border-color: rgba(212, 175, 106, 0.75);
  background: linear-gradient(165deg, rgba(212, 175, 106, 0.22) 0%, rgba(61, 42, 92, 0.35) 55%, rgba(8, 12, 18, 0.9) 100%);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.5),
    0 0 28px rgba(212, 175, 106, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -2px 6px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.tab.active .ico-3d {
  animation: icoGlow 2.5s ease-in-out infinite;
}

.tab.active .tab-label {
  color: var(--gold);
}

.panels {
  padding: 0 1rem 2.5rem;
  max-height: none;
}

.screen-home.active,
.screen-ritual.active {
  overflow: visible;
}

.panel { display: none; gap: 0.55rem; flex-direction: column; }
.panel.active { display: flex; }

.panel-hint {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.panel-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.15rem 0 0.75rem;
  padding: 0.65rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(26, 74, 66, 0.25), rgba(61, 42, 92, 0.2)),
    var(--glass);
  transform: perspective(600px) rotateX(4deg);
  transform-style: preserve-3d;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.panel-banner.banner-3d:hover {
  transform: perspective(600px) rotateX(0deg) translateY(-2px);
  box-shadow: 0 14px 36px rgba(212, 175, 106, 0.15);
}

.panel-banner img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(198, 161, 91, 0.35);
  filter: drop-shadow(0 0 12px var(--glow));
  transform: translateZ(12px);
}

.panel-hero {
  position: relative;
  margin: 0.15rem 0 0.9rem;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(198, 161, 91, 0.35);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 28px rgba(212, 175, 106, 0.12);
}

.panel-hero img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
  object-position: center 45%;
}

.panel-hero-text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.1rem 0.85rem 0.7rem;
  background: linear-gradient(180deg, transparent, rgba(6, 10, 15, 0.92));
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.panel-hero-text span {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.9rem;
  letter-spacing: 0;
}

.panel-banner .banner-text {
  text-align: left;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  line-height: 1.35;
}

.panel-banner .banner-text span {
  display: block;
  color: var(--muted);
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.85rem;
  letter-spacing: 0;
  font-weight: 400;
}

.section-divider {
  display: block;
  width: 100%;
  height: 28px;
  margin: 0.35rem 0 0.55rem;
  background: url("assets/divider.svg") center/contain no-repeat;
  opacity: 0.7;
}

.path {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* ─── Ярлычки-иконки (Telegram WebView: без translateZ / preserve-3d) ─── */
@keyframes icoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes icoGlow {
  0%, 100% {
    box-shadow:
      0 2px 0 rgba(212, 175, 106, 0.55),
      0 8px 18px rgba(0, 0, 0, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.14);
  }
  50% {
    box-shadow:
      0 2px 0 rgba(212, 175, 106, 0.75),
      0 12px 24px rgba(0, 0, 0, 0.6),
      0 0 18px rgba(212, 175, 106, 0.35),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
}

.ico-3d {
  position: relative;
  flex-shrink: 0;
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: icoFloat 4.5s ease-in-out infinite;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.1) 0%, transparent 40%),
    linear-gradient(165deg, #3a4458 0%, #1a2230 45%, #0a0e14 100%);
  border: 1.5px solid rgba(212, 175, 106, 0.6);
  box-shadow:
    0 2px 0 rgba(212, 175, 106, 0.4),
    0 8px 20px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -4px 10px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ico-3d::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.18) 0%, transparent 42%, rgba(0, 0, 0, 0.12) 100%);
}

.ico-3d img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 10px;
}

.ico-3d > span {
  position: relative;
  z-index: 1;
  font-size: 1.35rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.65));
}

.path:hover .ico-3d,
.zodiac:hover .ico-3d {
  animation: none;
  transform: translateY(-4px) scale(1.06);
  box-shadow:
    0 3px 0 rgba(212, 175, 106, 0.65),
    0 14px 28px rgba(0, 0, 0, 0.65),
    0 0 20px rgba(212, 175, 106, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.tab:hover .ico-3d {
  animation: none;
  transform: scale(1.08);
}

.ico-3d--tab {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  animation: none;
}

.tab .ico-3d--tab img {
  border-radius: 6px;
}

.ico-3d--triple {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 4px;
}

.ico-3d--triple img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  border-radius: 3px;
}

.ico-3d--cross {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  padding: 3px;
}

.ico-3d--cross img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  border-radius: 2px;
  background: rgba(8, 12, 18, 0.5);
}

.ico-3d--cross img:nth-child(1) { grid-area: 2 / 2; z-index: 1; }
.ico-3d--cross img:nth-child(2) { grid-area: 1 / 2; }
.ico-3d--cross img:nth-child(3) { grid-area: 3 / 2; }
.ico-3d--cross img:nth-child(4) { grid-area: 2 / 1; }
.ico-3d--cross img:nth-child(5) { grid-area: 2 / 3; }

.ico-3d--period {
  width: 2.1rem;
  height: 2.1rem;
  margin: 0 auto 0.25rem;
  animation: none;
}

.ico-3d--period > span {
  font-size: 1.1rem;
}

.period-btn:hover .ico-3d--period,
.period-btn.active .ico-3d--period {
  transform: scale(1.08);
}

.ico-3d--chip {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 8px;
  animation: none;
  display: inline-flex;
  vertical-align: middle;
  margin-right: 0.35rem;
}

.ico-3d--chip > span {
  font-size: 0.95rem;
}

.ico-3d--zodiac {
  width: 2.35rem;
  height: 2.35rem;
  margin: 0 auto 0.3rem;
  animation: icoFloat 4.5s ease-in-out infinite;
  animation-delay: calc(var(--ico-delay, 0) * 0.15s);
}

.ico-3d--zodiac .sign-glyph {
  font-size: 1.2rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(212, 175, 106, 0.45));
}

@media (prefers-reduced-motion: reduce) {
  .ico-3d,
  .ico-3d--triple,
  .ico-3d--cross,
  .ico-3d--zodiac {
    animation: none;
  }
}

.path .path-label {
  flex: 1;
  line-height: 1.35;
}

.path .path-label small {
  display: block;
  color: var(--muted);
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.85rem;
  letter-spacing: 0;
  margin-top: 0.1rem;
}

.path, .cta, .ghost, .zodiac {
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  border: 1px solid rgba(212, 175, 106, 0.32);
  background: linear-gradient(148deg, rgba(32, 58, 52, 0.55) 0%, rgba(14, 20, 28, 0.92) 55%, rgba(8, 12, 18, 0.98) 100%);
  color: var(--ink);
  padding: 0.95rem 1.05rem;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
  text-align: left;
  font-size: 0.78rem;
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.38),
    0 2px 0 rgba(212, 175, 106, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -4px 12px rgba(0, 0, 0, 0.35);
}

.path:hover {
  transform: translateY(-3px);
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.48),
    0 0 20px rgba(212, 175, 106, 0.14),
    0 3px 0 rgba(212, 175, 106, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-color: rgba(212, 175, 106, 0.6);
}

.path:active, .cta:active { transform: scale(0.98); }

.path.accent {
  border-color: rgba(212, 175, 106, 0.65);
  background: linear-gradient(148deg, rgba(212, 175, 106, 0.28) 0%, rgba(61, 42, 92, 0.45) 50%, rgba(12, 18, 28, 0.95) 100%);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.42),
    0 0 28px rgba(212, 175, 106, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.period-row {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.period-btn {
  flex: 1;
  min-width: 4.2rem;
  padding: 0.45rem 0.3rem 0.5rem;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 106, 0.35);
  background: linear-gradient(165deg, rgba(22, 30, 42, 0.9) 0%, rgba(8, 12, 18, 0.95) 100%);
  color: var(--ink);
  font-size: 0.62rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.period-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.42);
}

.period-label {
  display: block;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.period-btn.active {
  background: linear-gradient(165deg, rgba(212, 175, 106, 0.38) 0%, rgba(90, 60, 120, 0.55) 55%, rgba(18, 24, 36, 0.92) 100%);
  border-color: rgba(212, 175, 106, 0.8);
  color: #fff;
  transform: translateY(-2px);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.45),
    0 0 22px rgba(212, 175, 106, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.zodiac-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.zodiac {
  padding: 0.6rem 0.2rem 0.65rem;
  text-align: center;
  font-size: 0.62rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.zodiac:hover {
  transform: translateY(-3px);
}

.zodiac::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/assets/stars-banner.jpg") center/cover no-repeat;
  opacity: 0.12;
  pointer-events: none;
}

.zodiac-label {
  position: relative;
  display: block;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.plain-scene {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
  perspective: 700px;
}

.plain-scene img {
  width: min(280px, 85vw);
  height: auto;
  max-height: 180px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(198, 161, 91, 0.35);
  filter: drop-shadow(0 0 24px var(--glow));
  animation: numPulse 2.5s ease-in-out infinite;
}

.plain-scene.float-3d img {
  animation: float3d 5s ease-in-out infinite;
  transform-style: preserve-3d;
}

@keyframes float3d {
  0%, 100% { transform: rotateY(-8deg) rotateX(4deg) translateY(0); }
  50% { transform: rotateY(8deg) rotateX(-4deg) translateY(-8px); }
}

.scene-3d {
  perspective: 1400px;
  perspective-origin: 50% 40%;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.25rem 0 1rem;
  padding-top: 0.35rem;
  position: relative;
  z-index: 1;
  background:
    radial-gradient(ellipse 70% 50% at 50% 70%, rgba(212, 175, 106, 0.08), transparent 60%);
}

/* ─── Ritual screen ─── */
.screen-ritual {
  padding: 0 1rem 2rem;
  min-height: calc(100dvh - 60px);
}

.ritual-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
  padding: 0.1rem 0 0.35rem;
  background: transparent;
  border: none;
  backdrop-filter: none;
  /* не перекрывает карты — обычный поток, без sticky/fixed */
  pointer-events: none;
}

.ritual-top .back-btn {
  pointer-events: auto;
}

.back-btn {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  font-size: 0.68rem;
  color: rgba(212, 175, 106, 0.85);
  background: transparent;
  border: 1px solid rgba(212, 175, 106, 0.28);
  border-radius: 4px;
  padding: 0.28rem 0.55rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
  transition: color 0.2s, border-color 0.2s, opacity 0.2s;
  opacity: 0.9;
}

.back-btn:active {
  transform: none;
  opacity: 0.65;
}

.ritual-top-spacer {
  display: none;
}

.ghost {
  background: none;
  border: none;
  color: var(--muted);
  padding: 0.5rem 0;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}

.ritual-title {
  font-family: var(--font-display);
  text-align: right;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: rgba(240, 232, 212, 0.7);
  margin: 0;
  font-weight: 500;
  background: transparent;
  border: none;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-3d {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
  max-width: 100%;
}

.table-3d.celtic {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.45rem;
  max-width: 340px;
}

.table-3d.celtic .card-3d:nth-child(1) { grid-column: 2; grid-row: 1; }
.table-3d.celtic .card-3d:nth-child(2) { grid-column: 2; grid-row: 2; }
.table-3d.celtic .card-3d:nth-child(3) { grid-column: 2; grid-row: 3; }
.table-3d.celtic .card-3d:nth-child(4) { grid-column: 1; grid-row: 3; }
.table-3d.celtic .card-3d:nth-child(5) { grid-column: 3; grid-row: 3; }
.table-3d.celtic .card-3d:nth-child(6) { grid-column: 2; grid-row: 4; }
.table-3d.celtic .card-3d:nth-child(7) { grid-column: 4; grid-row: 3; }
.table-3d.celtic .card-3d:nth-child(8) { grid-column: 2; grid-row: 5; }
.table-3d.celtic .card-3d:nth-child(9) { grid-column: 5; grid-row: 3; }
.table-3d.celtic .card-3d:nth-child(10) { grid-column: 2; grid-row: 6; }

/* ─── Cards: рубашка → лицо с рисунком ─── */
.card-3d {
  width: 120px;
  height: 188px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}

.card-3d.small { width: 78px; height: 122px; }

.card-flipper {
  width: 100%;
  height: 100%;
  position: relative;
}

.card-3d.deal {
  animation: dealIn 0.35s cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes dealIn {
  from { opacity: 0; transform: translateY(16px) scale(0.88); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.card-3d.facedown {
  filter: drop-shadow(0 0 12px rgba(212, 175, 106, 0.2));
}

.card-3d.scattering {
  animation: scatterDeal 0.55s cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes scatterDeal {
  0% { transform: translateY(-18px) rotate(-8deg) scale(0.9); }
  40% { transform: translateY(8px) rotate(6deg) scale(1.04); }
  100% { transform: translateY(0) rotate(0) scale(1); }
}

.card-3d.shuffling {
  animation: shuffle3d 0.5s ease-in-out infinite alternate;
}

@keyframes shuffle3d {
  from { transform: translateY(-6px) rotate(-3deg); }
  to { transform: translateY(6px) rotate(3deg); }
}

.card-face {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid var(--line);
  box-shadow:
    0 15px 35px rgba(0, 0, 0, 0.55),
    0 0 20px rgba(212, 175, 106, 0.08);
  transition:
    transform 0.55s cubic-bezier(0.23, 1, 0.32, 1),
    opacity 0.35s ease;
}

.card-back {
  background: url("/assets/card-back.svg") center/cover no-repeat, #0f1815;
  z-index: 2;
  opacity: 1;
  transform: rotateY(0deg);
}

.card-back::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), transparent 40%, rgba(0,0,0,0.2));
}

.card-front {
  z-index: 1;
  opacity: 0;
  transform: rotateY(90deg) scale(0.92);
  display: block;
  padding: 0;
  text-align: center;
  background: #0c1018;
  pointer-events: none;
}

/* Открытая карта — только рисунок лица */
.card-3d.flipped .card-back {
  opacity: 0;
  transform: rotateY(-90deg) scale(0.92);
  pointer-events: none;
  z-index: 1;
}

.card-3d.flipped .card-front {
  opacity: 1;
  transform: rotateY(0deg) scale(1);
  pointer-events: auto;
  z-index: 3;
}

.card-3d.rev.flipped .card-front {
  transform: rotateY(0deg) rotateZ(180deg) scale(1);
}

.face-art {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #0c1018;
  overflow: hidden;
}

.tarot-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.tarot-photo.broken { display: none; }

.tarot-photo-fallback {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 2rem;
  color: var(--gold);
  background: radial-gradient(circle at 50% 35%, #2a2040, #0a0c10);
  text-align: center;
  padding: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.65rem;
}

.tarot-photo-fallback.show { display: flex; }

.rune-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.rune-photo.broken { display: none; }

.rune-photo-fallback {
  position: absolute;
  inset: 0;
  display: none;
}

.rune-photo-fallback.show { display: block; }

.rune-stone {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse 80% 70% at 50% 45%, #3a3048, #12081c);
}

.rune-glow {
  position: absolute;
  inset: 15%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 106, 0.25), transparent 70%);
  animation: numPulse 2.5s ease-in-out infinite;
}

.rune-symbol {
  position: relative;
  z-index: 2;
  font-size: 3.2rem;
  color: var(--gold);
  text-shadow: 0 0 24px var(--glow);
}

.rune-name {
  position: relative;
  z-index: 2;
  margin-top: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.55rem;
  color: var(--muted);
}

.face-art .face-svg,
.face-art svg { display: none; }

.emoji-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2.8rem;
  z-index: 2;
}

.card-shine {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(125deg, transparent 35%, rgba(255,255,255,0.12) 50%, transparent 65%);
  mix-blend-mode: screen;
  opacity: 0.7;
}

.card-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 0.25rem 0.3rem 0.35rem;
  background: linear-gradient(180deg, transparent 0%, rgba(6, 10, 15, 0.75) 55%, rgba(6, 10, 15, 0.95) 100%);
  pointer-events: none;
}

.card-front .emoji {
  display: none;
}

.card-front .rune-glyph {
  display: none;
}

.card-front .name {
  position: relative;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  color: var(--gold);
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.card-front .pos {
  position: relative;
  z-index: 2;
  font-size: 0.52rem;
  color: var(--muted);
  font-style: italic;
}

.card-3d.small .card-meta .name { font-size: 0.45rem; }
.card-3d.small .card-meta .pos { font-size: 0.4rem; }
.card-3d.small .card-meta { padding: 0.2rem 0.15rem 0.3rem; }

.card-3d.is-rune .face-art svg {
  filter: drop-shadow(0 0 8px rgba(180, 140, 80, 0.3));
}

.card-3d.flipped .card-front {
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.6),
    0 0 28px rgba(212, 175, 106, 0.25),
    inset 0 0 20px rgba(212, 175, 106, 0.08);
}

.card-sparks {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.card-sparks span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #f0e0a0;
  box-shadow: 0 0 8px #d4af6a;
  animation: sparkFly var(--d, 0.5s) ease-out forwards;
  transform: rotate(var(--a)) translateY(0);
}

@keyframes sparkFly {
  0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(1); }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(-70px) scale(0.2); }
}

.magic-table {
  position: relative;
}

.magic-table::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 55%;
  width: 280px;
  height: 120px;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, rgba(212, 175, 106, 0.18), transparent 70%);
  pointer-events: none;
  animation: tablePulse 3s ease-in-out infinite;
}

@keyframes tablePulse {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}

.card-art {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.85;
}

.card-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(6, 10, 15, 0.92) 85%);
}

/* Art gradients per arcana */
.art-major {
  background:
    url("assets/art-major.svg") center/cover no-repeat,
    radial-gradient(circle at 50% 30%, #4a3060, #0a1210 70%);
}
.art-cups {
  background:
    url("assets/art-cups.svg") center/cover no-repeat,
    radial-gradient(circle at 50% 30%, #1a4a5c, #0a1210 70%);
}
.art-wands {
  background:
    url("assets/art-wands.svg") center/cover no-repeat,
    radial-gradient(circle at 50% 30%, #5c2a1a, #0a1210 70%);
}
.art-swords {
  background:
    url("assets/art-swords.svg") center/cover no-repeat,
    radial-gradient(circle at 50% 30%, #2a3a5c, #0a1210 70%);
}
.art-pentacles {
  background:
    url("assets/art-pentacles.svg") center/cover no-repeat,
    radial-gradient(circle at 50% 30%, #3a4a1a, #0a1210 70%);
}
.art-rune {
  background:
    url("assets/art-rune.svg") center/cover no-repeat,
    radial-gradient(circle at 50% 40%, #2a1a4a, #0a1210 75%);
}

/* ─── Crystal ball ─── */
.orb-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.orb-scene {
  width: 240px;
  height: 260px;
  perspective: 900px;
  position: relative;
  display: grid;
  place-items: center;
  animation: orbScene 0.8s ease-out;
}

@keyframes orbScene {
  from { opacity: 0; transform: scale(0.7) rotateY(-30deg); }
  to { opacity: 1; transform: scale(1) rotateY(0); }
}

.orb-aura {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(100, 180, 160, 0.4), transparent 65%);
  animation: auraPulse 2.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes auraPulse {
  0%, 100% { transform: scale(0.9); opacity: 0.5; }
  50% { transform: scale(1.15); opacity: 1; }
}

.orb-3d {
  width: 190px;
  height: 190px;
  position: relative;
  transform-style: preserve-3d;
  animation: orbFloat 4s ease-in-out infinite;
  z-index: 2;
}

@keyframes orbFloat {
  0%, 100% { transform: rotateY(-12deg) rotateX(6deg) translateY(0); }
  50% { transform: rotateY(12deg) rotateX(-6deg) translateY(-8px); }
}

.orb-scene.spinning .orb-3d {
  animation: orbWhirl 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes orbWhirl {
  0% { transform: rotateY(0) rotateX(8deg) scale(1); }
  40% { transform: rotateY(540deg) rotateX(-10deg) scale(1.08); }
  100% { transform: rotateY(1080deg) rotateX(6deg) scale(1); }
}

.orb-scene.idle .orb-3d {
  animation: orbFloat 3.5s ease-in-out infinite;
}

.orb-3d img {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 40px rgba(100, 180, 160, 0.55));
}

.orb-mist {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 40%, rgba(180, 255, 230, 0.35), transparent 55%),
    radial-gradient(circle at 60% 60%, rgba(100, 160, 200, 0.25), transparent 50%);
  animation: mistShift 3s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes mistShift {
  from { opacity: 0.4; transform: scale(0.9) rotate(0deg); }
  to { opacity: 0.85; transform: scale(1.1) rotate(20deg); }
}

.orb-glint {
  position: absolute;
  top: 22%;
  left: 24%;
  width: 28%;
  height: 18%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  filter: blur(2px);
  animation: glint 2.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes glint {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.7; }
}

.orb-ring {
  position: absolute;
  width: 200px;
  height: 60px;
  border: 1px solid rgba(212, 175, 106, 0.35);
  border-radius: 50%;
  top: 58%;
  transform: rotateX(72deg);
  animation: ringPulse 2.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes ringPulse {
  0%, 100% { opacity: 0.3; box-shadow: 0 0 10px transparent; }
  50% { opacity: 0.8; box-shadow: 0 0 24px rgba(212, 175, 106, 0.35); }
}

.orb-scene.revealed .orb-3d {
  animation: orbReveal 0.8s ease forwards;
}

@keyframes orbReveal {
  to { transform: rotateY(0) rotateX(0) scale(1.05); filter: brightness(1.15); }
}

.orb-answer {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--gold);
  letter-spacing: 0.06em;
  margin-top: 1rem;
  animation: fadeIn 0.8s ease;
  text-shadow: 0 0 20px rgba(212, 175, 106, 0.4);
}

.orb-hint {
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
  z-index: 3;
  padding: 0 0.5rem;
}

/* ─── Moon scene ─── */
.moon-scene {
  text-align: center;
  padding: 1.5rem;
  display: grid;
  place-items: center;
}

.moon-photo {
  width: min(220px, 70vw);
  border-radius: 12px;
  border: 1px solid rgba(198, 161, 91, 0.4);
  box-shadow: 0 0 40px rgba(168, 232, 220, 0.25);
  object-fit: cover;
  aspect-ratio: 2 / 3;
}

.moon-3d {
  width: 140px;
  height: 140px;
  margin: 0 auto;
  background: url("/assets/tarot/18_moon.jpg") center/cover no-repeat;
  border-radius: 12px;
  animation: moonFloat 4s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(212, 175, 106, 0.4));
}

.moon-3d.emoji-fallback {
  font-size: 5rem;
  background: none;
  width: auto;
  height: auto;
  display: inline-block;
}

@keyframes moonFloat {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-10px) rotate(5deg); }
}

/* ─── Numerology scene ─── */
.num-scene {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto;
  background: url("/assets/tarot/10_wheel.jpg") center/cover no-repeat;
}

.num-core {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  animation: numPulse 2s ease-in-out infinite;
}

.num-orbit {
  display: none;
}

@keyframes numPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.85; }
}

/* ─── Oracle panel ─── */
.oracle-panel {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 0.65rem 1rem 1rem;
  backdrop-filter: blur(12px);
  max-height: 38vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 106, 0.7) rgba(6, 10, 15, 0.45);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.oracle-panel.plain-scroll {
  max-height: min(72vh, calc(100dvh - 220px));
  min-height: 8rem;
}

body.plain-oracle .scene-3d {
  min-height: auto;
  margin-bottom: 0.5rem;
}

body.plain-oracle .plain-scene img {
  max-height: 110px;
  width: min(220px, 72vw);
}

body.plain-oracle .plain-table {
  min-height: 0;
}

.oracle-panel::-webkit-scrollbar {
  width: 6px;
}

.oracle-panel::-webkit-scrollbar-track {
  background: rgba(6, 10, 15, 0.45);
  border-radius: 99px;
  margin: 6px 0;
}

.oracle-panel::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #d4af6a, #8b6530);
  border-radius: 99px;
}

.oracle-panel::after {
  content: "↕ листать";
  position: sticky;
  bottom: 0;
  left: 0;
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.35rem 0 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  color: rgba(212, 175, 106, 0.55);
  background: linear-gradient(180deg, transparent, rgba(6, 10, 15, 0.88) 40%);
  pointer-events: none;
}

.oracle-text {
  white-space: pre-wrap;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s, transform 0.6s;
}

.oracle-text.show {
  opacity: 1;
  transform: none;
}

.oracle-text .oracle-preface {
  display: block;
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.75rem;
  border-left: 2px solid rgba(212, 175, 106, 0.55);
  color: var(--muted);
  font-style: italic;
  font-size: 0.98rem;
  line-height: 1.55;
}

.oracle-text .line-title {
  display: block;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  margin-top: 0.75rem;
}

.oracle-text .line-title:first-child { margin-top: 0; }

.oracle-text .line-body {
  display: block;
  margin-top: 0.35rem;
  margin-bottom: 0.55rem;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.6;
}

.oracle-text .line-hint {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-style: italic;
  font-size: 0.92rem;
}

.rune-reading-block {
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 106, 0.22);
  background: linear-gradient(145deg, rgba(28, 36, 48, 0.45), rgba(8, 12, 18, 0.55));
}

.rune-reading-block .line-title {
  margin-top: 0;
}

.rune-keywords {
  display: block;
  margin-top: 0.2rem;
  color: rgba(212, 175, 106, 0.85);
  font-size: 0.88rem;
  letter-spacing: 0.03em;
}

.oracle-text .spread-summary {
  display: block;
  margin-top: 1.1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(212, 175, 106, 0.25);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
}

.oracle-text .spread-text {
  display: block;
  margin-top: 0.45rem;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.65;
}

.actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0.5rem;
  z-index: 5;
  padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(6, 10, 15, 0.92) 30%);
}

.cta {
  min-width: 10rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(212, 175, 106, 0.35), rgba(61, 42, 92, 0.5));
  border-color: var(--gold);
}

.cta.deal-cta {
  min-width: 12rem;
  font-size: 1.05rem;
  padding: 0.85rem 1.4rem;
  box-shadow: 0 0 28px rgba(212, 175, 106, 0.35);
  animation: dealPulse 1.6s ease-in-out infinite;
}

@keyframes dealPulse {
  0%, 100% { box-shadow: 0 0 18px rgba(212, 175, 106, 0.25); transform: scale(1); }
  50% { box-shadow: 0 0 36px rgba(212, 175, 106, 0.5); transform: scale(1.03); }
}

.cta.secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

/* ─── Loader ─── */
.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(6, 10, 15, 0.88);
  backdrop-filter: blur(6px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  display: none;
}

.loader.visible {
  display: flex;
}

.loader[hidden] {
  display: none !important;
}

.loader-orbs {
  display: flex;
  gap: 0.6rem;
}

.loader-orbs span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  animation: loaderBounce 0.9s ease-in-out infinite;
  box-shadow: 0 0 16px var(--glow);
}

.loader-orbs span:nth-child(2) { animation-delay: 0.15s; }
.loader-orbs span:nth-child(3) { animation-delay: 0.3s; }

@keyframes loaderBounce {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.5; }
  50% { transform: translateY(-16px) scale(1.2); opacity: 1; }
}

.loader p {
  font-family: var(--font-display);
  letter-spacing: 0.15em;
  color: var(--gold);
  font-size: 0.8rem;
}

/* ─── Birth date modal ─── */
.birth-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(6, 10, 15, 0.92);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.birth-modal.visible {
  display: flex;
}

.birth-modal[hidden] {
  display: none !important;
}

.birth-card {
  width: min(100%, 320px);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem;
  text-align: center;
}

.birth-art {
  width: 88px;
  height: 88px;
  margin: 0 auto 0.75rem;
  display: block;
  filter: drop-shadow(0 0 16px var(--glow));
}

.birth-card h3 {
  font-family: var(--font-display);
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.birth-hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.birth-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  font-size: 1.1rem;
  text-align: center;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.birth-input.error {
  border-color: #c44;
}

.birth-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.birth-actions .cta {
  min-width: 7rem;
  flex: 1;
}

.question-input {
  width: 100%;
  margin: 0.65rem 0 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 106, 0.35);
  background: rgba(6, 10, 15, 0.75);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.45;
  resize: vertical;
  min-height: 4.5rem;
}

.question-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 106, 0.15);
}

.question-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin: 0.5rem 0 0.25rem;
}

.q-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.35rem 0.65rem 0.35rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 106, 0.35);
  background: rgba(212, 175, 106, 0.08);
  color: var(--gold-soft, #e8d4a8);
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transform: perspective(300px) translateZ(0);
  transition: background 0.2s, transform 0.2s;
}

.q-chip:active, .q-chip:hover {
  background: rgba(212, 175, 106, 0.2);
  transform: perspective(300px) translateY(-1px);
}

/* ─── Paywall modal ─── */
.pay-modal {
  position: fixed;
  inset: 0;
  z-index: 320;
  background: rgba(6, 10, 15, 0.94);
  backdrop-filter: blur(10px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
}

.pay-modal.visible { display: flex; }
.pay-modal[hidden] { display: none !important; }

.pay-card {
  width: min(100%, 420px);
  max-height: min(88dvh, 640px);
  overflow: auto;
  background:
    linear-gradient(165deg, rgba(61, 42, 92, 0.35), rgba(6, 10, 15, 0.95)),
    var(--glass);
  border: 1px solid rgba(212, 175, 106, 0.35);
  border-radius: 18px 18px 12px 12px;
  padding: 1.25rem 1.1rem 1.1rem;
  text-align: center;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.45);
}

.pay-sigil {
  color: var(--gold);
  letter-spacing: 0.35em;
  margin: 0 0 0.35rem;
  opacity: 0.85;
}

.pay-card h3 {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 1.15rem;
  margin: 0 0 0.55rem;
}

.pay-lead {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  margin: 0 0 0.65rem;
}

.pay-balance {
  color: rgba(240, 232, 212, 0.85);
  font-size: 0.82rem;
  margin: 0 0 0.85rem;
}

.pay-packs {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.pay-pack {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-align: left;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-display);
}

.pay-pack:active { transform: scale(0.98); }
.pay-pack.best {
  border-color: rgba(212, 175, 106, 0.55);
  box-shadow: 0 0 18px rgba(212, 175, 106, 0.12);
}

.pay-pack .ptitle { font-size: 0.78rem; letter-spacing: 0.04em; }
.pay-pack .psub {
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.15rem;
  letter-spacing: 0;
}
.pay-pack .pprice {
  color: var(--gold);
  font-size: 0.9rem;
  white-space: nowrap;
}

.balance-chip {
  position: fixed;
  top: calc(0.55rem + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: rgba(212, 175, 106, 0.9);
  background: rgba(6, 10, 15, 0.55);
  border: 1px solid rgba(212, 175, 106, 0.25);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  cursor: pointer;
  max-width: 70vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.ritual-open .balance-chip { display: none; }

.topup-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin: 0 1rem 0.85rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 106, 0.28);
  background: linear-gradient(135deg, rgba(61, 42, 92, 0.28), rgba(26, 74, 66, 0.18));
}

.topup-info {
  font-size: 0.78rem;
  color: rgba(240, 232, 212, 0.88);
  line-height: 1.3;
  flex: 1;
}

.topup-btn {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: #1a1208;
  background: linear-gradient(180deg, #e8c878, #c6a15b);
  border: none;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(212, 175, 106, 0.25);
}

.topup-btn:active { transform: scale(0.97); }

.topup-bar.locked {
  border-color: rgba(200, 80, 80, 0.45);
  background: linear-gradient(135deg, rgba(90, 30, 40, 0.4), rgba(61, 42, 92, 0.25));
}

.topup-bar.locked .topup-info { color: #f0c0b8; }

.pay-step[hidden] { display: none !important; }

.pay-chosen {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
}

.pay-method {
  display: block;
  width: 100%;
  margin: 0 0 0.45rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 106, 0.35);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.pay-method:active { transform: scale(0.98); }

#payBackPacks { margin-top: 0.35rem; margin-bottom: 0.55rem; }

.promo-row {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.promo-input {
  flex: 1;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.promo-btn {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  padding: 0 0.9rem;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 106, 0.4);
  background: rgba(212, 175, 106, 0.15);
  color: var(--gold);
  cursor: pointer;
}

.promo-hint {
  margin: 0.4rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.promo-hint b { color: var(--gold); font-weight: 600; }

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@media (max-width: 380px) {
  .card-3d { width: 92px; height: 144px; }
  .table-3d.celtic { max-width: 300px; }
  .table-3d.celtic .card-3d { width: 56px; height: 88px; }
  .zodiac-grid { grid-template-columns: repeat(3, 1fr); }
}
