@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Raleway:ital,wght@0,300;0,400;0,500;1,400&display=swap');

:root {
  --bg: #0a0a18;
  --bg2: #10102200;
  --bg3: #181830;
  --accent: #c9a84c;
  --accent2: #7c5cbf;
  --text: #ece6f4;
  --text-muted: #9488b0;
  --card-bg: #14142a;
  --border: #28284a;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --glow-gold: 0 0 20px rgba(201,168,76,0.2);
  --glow-purple: 0 0 20px rgba(124,92,191,0.2);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Raleway', 'Georgia', serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(124,92,191,0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(201,168,76,0.03) 0%, transparent 50%);
}

h1, h2, h3, h4 { font-family: 'Cinzel', 'Georgia', serif; }

/* NAV */
nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1.3rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 3px;
  font-weight: 700;
  flex-shrink: 0;
  text-shadow: 0 0 20px rgba(201,168,76,0.3);
}

.nav-links { display: flex; gap: 24px; list-style: none; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; transition: color 0.2s; font-family: 'Raleway', sans-serif; letter-spacing: 0.5px; }
.nav-links a:hover, .nav-links a.active { color: var(--accent); }

.nav-right { display: flex; align-items: center; gap: 12px; }

.nav-cta {
  background: var(--accent);
  color: #1a1000;
  padding: 8px 20px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.85rem;
  font-family: sans-serif;
  font-weight: bold;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.nav-cta:hover { opacity: 0.85; }

/* BURGER */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.burger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* MOBILE NAV BACKDROP */
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 64px 0 0 0;
  background: rgba(0,0,0,0.5);
  z-index: 98;
  backdrop-filter: blur(2px);
}
.nav-backdrop.open { display: block; }

/* HERO */
.hero {
  text-align: center;
  padding: 90px 24px 70px;
  background: radial-gradient(ellipse at center top, #1e1040 0%, var(--bg) 65%);
  position: relative;
  overflow: hidden;
}

/* Звёздное небо */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 15% 20%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 60%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 50% 15%, rgba(201,168,76,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 40%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 25%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 10% 75%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 90% 70%, rgba(201,168,76,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 85%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 40% 35%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 75% 10%, rgba(255,255,255,0.6) 0%, transparent 100%);
  animation: starTwinkle 6s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes starTwinkle {
  0% { opacity: 0.4; }
  100% { opacity: 0.9; }
}

.hero-badge {
  display: inline-block;
  background: rgba(201,168,76,0.12);
  border: 1px solid rgba(201,168,76,0.35);
  color: var(--accent);
  padding: 5px 18px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-family: 'Cinzel', serif;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero h1 {
  font-family: 'Cinzel', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.2;
  font-weight: 600;
}

.hero h1 span { color: var(--accent); text-shadow: 0 0 30px rgba(201,168,76,0.4); }

.hero p {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 36px;
  font-family: 'Raleway', sans-serif;
  font-weight: 300;
  line-height: 1.8;
}

.hero-btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent2), #5a3d9a);
  color: white;
  padding: 14px 32px;
  border-radius: 30px;
  text-decoration: none;
  font-size: 1rem;
  font-family: sans-serif;
  font-weight: bold;
  transition: transform 0.2s, opacity 0.2s;
  border: none;
  cursor: pointer;
}
.btn-primary:hover { transform: translateY(-2px); opacity: 0.9; }

.btn-secondary {
  background: transparent;
  color: var(--accent);
  padding: 14px 32px;
  border-radius: 30px;
  text-decoration: none;
  font-size: 1rem;
  font-family: sans-serif;
  border: 1px solid var(--accent);
  transition: background 0.2s;
  cursor: pointer;
}
.btn-secondary:hover { background: rgba(201,168,76,0.1); }

/* SECTIONS */
.section { padding: 60px 24px; max-width: 1100px; margin: 0 auto; }
.section-title { font-size: 1.8rem; color: var(--text); margin-bottom: 8px; }
.section-sub { color: var(--text-muted); font-family: sans-serif; margin-bottom: 40px; }

/* GRID */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(480px, 1fr)); gap: 20px; }

/* CARD */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  overflow: hidden;
}
.card::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent2), var(--accent));
  opacity: 0;
  transition: opacity 0.3s;
  border-radius: var(--radius) 0 0 var(--radius);
}
.card:hover { border-color: rgba(124,92,191,0.5); transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.3), var(--glow-purple); }
.card:hover::after { opacity: 1; }
.card-icon { font-size: 2.2rem; margin-bottom: 14px; filter: drop-shadow(0 0 8px rgba(201,168,76,0.3)); }
.card h3 { color: var(--text); margin-bottom: 8px; font-size: 1.05rem; font-family: 'Cinzel', serif; font-weight: 600; letter-spacing: 0.5px; }
.card p { color: var(--text-muted); font-size: 0.88rem; font-family: 'Raleway', sans-serif; }
.card-badge { display: inline-block; background: rgba(124,92,191,0.2); color: #a88de0; padding: 3px 12px; border-radius: 10px; font-size: 0.72rem; font-family: 'Raleway', sans-serif; margin-top: 14px; letter-spacing: 0.5px; }

/* TAROT CARD VISUAL */
.tarot-card {
  background: linear-gradient(160deg, #241c44 0%, #130f2e 50%, #0d0b1e 100%);
  border: 1.5px solid rgba(201,168,76,0.5);
  border-radius: 10px;
  aspect-ratio: 2/3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 12px 10px;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  position: relative;
  overflow: hidden;
}
/* Декоративная внутренняя рамка */
.tarot-card::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(201,168,76,0.18);
  border-radius: 6px;
  pointer-events: none;
}
.tarot-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 16px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(201,168,76,0.3), var(--glow-gold);
  border-color: var(--accent);
}
.tarot-card .card-number { font-family: 'Cinzel', serif; font-size: 0.65rem; color: rgba(201,168,76,0.5); letter-spacing: 2px; padding-top: 4px; }
.tarot-card .card-symbol { font-size: 2.8rem; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5)); }
.tarot-card .card-name { font-family: 'Cinzel', serif; font-size: 0.6rem; color: var(--accent); text-align: center; letter-spacing: 1.5px; text-transform: uppercase; padding-bottom: 4px; }
.tarot-card.face-down {
  background: linear-gradient(160deg, #1c1538, #0d0b1e);
  background-image: repeating-linear-gradient(
    45deg, transparent, transparent 8px,
    rgba(201,168,76,0.025) 8px, rgba(201,168,76,0.025) 16px
  );
}
.tarot-card.face-down::after {
  content: '✦';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3.5rem;
  color: rgba(201,168,76,0.2);
  text-shadow: 0 0 20px rgba(201,168,76,0.15);
}

/* SPREAD AREA */
.spread-container {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
}
.spread-title { font-size: 1.2rem; color: var(--accent); margin-bottom: 24px; letter-spacing: 1px; }
.spread-cards { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }
.spread-cards .tarot-card { width: 110px; }

/* QUESTION INPUT */
/* FLOATING LABEL */
.question-wrap {
  position: relative;
  margin-bottom: 16px;
}
.question-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 18px 10px;
  color: var(--text);
  font-size: 1rem;
  font-family: 'Georgia', serif;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 0;
}
.question-input:focus { border-color: var(--accent2); }
.question-label {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  font-family: 'Georgia', serif;
  pointer-events: none;
  transition: top 0.2s, font-size 0.2s, color 0.2s, transform 0.2s;
  white-space: nowrap;
}
.question-input:focus ~ .question-label,
.question-input:not(:placeholder-shown) ~ .question-label {
  top: 9px;
  transform: none;
  font-size: 0.72rem;
  color: var(--accent2);
}
.q-optional { opacity: 0.7; }
@media (max-width: 768px) {
  .q-optional { display: none; }
  .question-label { font-size: 0.9rem; }
}

/* PRICING */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.pricing-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  position: relative;
}
.pricing-card.featured { border-color: var(--accent); }
.pricing-card.featured::before {
  content: 'Популярный';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #1a1000;
  padding: 2px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-family: sans-serif;
  font-weight: bold;
}
.price { font-size: 2.5rem; color: var(--accent); font-weight: bold; }
.price span { font-size: 1rem; color: var(--text-muted); font-family: sans-serif; }
.price-features { list-style: none; text-align: left; margin: 20px 0; font-family: sans-serif; font-size: 0.9rem; }
.price-features li { padding: 6px 0; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.price-features li::before { content: '✓ '; color: var(--accent); }

/* BIG CARD (страницы арканов) */
.big-card {
  background: linear-gradient(160deg, #241c44 0%, #130f2e 60%, #0d0b1e 100%) !important;
  border: 1.5px solid rgba(201,168,76,0.45) !important;
  border-radius: 14px !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), var(--glow-gold);
  position: relative;
  overflow: hidden;
}
.big-card::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 8px;
  pointer-events: none;
}
.big-card::after {
  content: '';
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(201,168,76,0.07);
  border-radius: 5px;
  pointer-events: none;
}
.big-card .num {
  font-family: 'Cinzel', serif !important;
  font-size: 0.7rem !important;
  color: rgba(201,168,76,0.5) !important;
  letter-spacing: 2px;
}
.big-card .sym { filter: drop-shadow(0 4px 12px rgba(0,0,0,0.6)); }
.big-card .cname {
  font-family: 'Cinzel', serif !important;
  font-size: 0.75rem !important;
  letter-spacing: 3px;
  text-shadow: 0 0 15px rgba(201,168,76,0.4);
}

/* Заголовки секций */
.section-title { font-family: 'Cinzel', Georgia, serif; font-size: 1.8rem; }
.spread-title { font-family: 'Cinzel', Georgia, serif; }

/* FOOTER */
footer {
  background: linear-gradient(0deg, #080812, var(--bg2));
  border-top: 1px solid var(--border);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  font-family: 'Raleway', sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.3px;
}
footer a { color: var(--text-muted); text-decoration: none; }
footer a:hover { color: var(--accent); }

/* SPREAD RESULT */
.spread-result {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-top: 24px;
  text-align: left;
  display: none;
}
.spread-result.visible { display: block; }
.spread-result h4 { color: var(--accent); margin-bottom: 12px; font-size: 1rem; letter-spacing: 1px; }
.spread-result p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.8; font-family: sans-serif; }

/* ARCANA GRID */
.arcana-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 14px; }
.arcana-item {
  background: linear-gradient(160deg, #1c1838 0%, #100e24 100%);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 10px;
  aspect-ratio: 2/3;
  padding: 14px 10px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
/* Декоративная внутренняя рамка — как у настоящих карт */
.arcana-item::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(201,168,76,0.12);
  border-radius: 5px;
  pointer-events: none;
  transition: border-color 0.3s;
}
/* Нижний орнамент */
.arcana-item::after {
  content: '· ✦ ·';
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.45rem;
  color: rgba(201,168,76,0.3);
  letter-spacing: 2px;
  white-space: nowrap;
}
.arcana-item:hover {
  border-color: rgba(201,168,76,0.7);
  transform: translateY(-5px);
  box-shadow: 0 14px 40px rgba(0,0,0,0.4), var(--glow-gold);
}
.arcana-item:hover::before { border-color: rgba(201,168,76,0.25); }
.arcana-item .num {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  color: rgba(201,168,76,0.5);
  letter-spacing: 2px;
  padding-top: 2px;
}
.arcana-item .symbol { font-size: 2.2rem; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5)); flex: 1; display: flex; align-items: center; }
.arcana-item .name {
  font-family: 'Cinzel', serif;
  font-size: 0.58rem;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
  padding-bottom: 20px;
  line-height: 1.3;
}

/* AUTH MODAL */
#auth-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.auth-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}
.auth-modal-box {
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
  z-index: 1;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.2s;
}
.auth-modal-close:hover { color: var(--text); }
.auth-modal-error {
  color: #ff8080;
  font-family: sans-serif;
  font-size: 0.82rem;
  margin-top: 10px;
  min-height: 1.2em;
}

/* SAVE SPREAD BUTTON */
.btn-save-spread {
  background: rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.3);
  color: var(--accent);
  padding: 6px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-family: sans-serif;
  font-size: 0.82rem;
  transition: background 0.2s, border-color 0.2s;
}
.btn-save-spread:hover { background: rgba(201,168,76,0.25); }
.btn-save-login {
  background: rgba(124,92,191,0.15);
  border-color: rgba(124,92,191,0.3);
  color: var(--accent2);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  nav { padding: 0 16px; }
  .burger { display: flex; }
  .nav-links {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 24px 24px;
    gap: 4px;
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-bottom: 1px solid var(--border); }
  .nav-links a { display: block; padding: 12px 0; font-size: 1rem; }
  .hero { padding: 60px 16px 40px; }
  .section { padding: 40px 16px; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* LOCK OVERLAY */
.locked { position: relative; }
.locked-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13,13,26,0.85);
  backdrop-filter: blur(4px);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 10;
}
.locked-overlay .lock-icon { font-size: 2rem; }
.locked-overlay p { color: var(--text-muted); font-family: sans-serif; font-size: 0.9rem; }
