/* ══════════════════════════════════════════════════
   MOONSPREAD — Stylesheet
   Aesthetic: Celestial Gothic · Dark Luxury
   Fonts: Cinzel Decorative (display) + EB Garamond (body)
   ══════════════════════════════════════════════════ */

/* ── Variables ───────────────────────────────────── */
:root {
  --bg:           #070b14;
  --bg-card:      #0d1422;
  --bg-card2:     #111927;
  --border:       rgba(180, 140, 80, 0.25);
  --border-glow:  rgba(180, 140, 80, 0.6);
  --gold:         #c9a84c;
  --gold-light:   #e8c97a;
  --gold-dim:     rgba(201, 168, 76, 0.4);
  --text:         #e8dfc8;
  --text-muted:   #8a7d6a;
  --moon:         #d4c4a0;
  --accent:       #7c5cbf;
  --accent-glow:  rgba(124, 92, 191, 0.3);
  --radius:       12px;
  --radius-lg:    20px;
}

/* ── Reset & Base ────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 18px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Starfield ───────────────────────────────────── */
.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  animation: twinkle var(--dur, 3s) ease-in-out infinite var(--delay, 0s);
}
@keyframes twinkle {
  0%, 100% { opacity: var(--min-op, 0.2); }
  50%       { opacity: var(--max-op, 1); }
}

/* ── Moon glow ───────────────────────────────────── */
.moon-glow {
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(180,140,80,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Header ──────────────────────────────────────── */
.site-header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3rem 1rem 1.5rem;
}
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.logo-text {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: var(--gold-light);
  letter-spacing: 0.1em;
  text-shadow: 0 0 40px var(--gold-dim), 0 0 80px rgba(201,168,76,0.2);
}
.logo-symbol {
  font-size: 1.5rem;
  color: var(--gold);
  opacity: 0.7;
}
.tagline {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Main Layout ─────────────────────────────────── */
.main {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ── Sections ────────────────────────────────────── */
.section { animation: fadeUp 0.6s ease both; }
.hidden  { display: none !important; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Oracle Card (input panel) ───────────────────── */
.oracle-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: 0 0 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.04);
}

.section-title {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  color: var(--gold-light);
  text-align: center;
  margin-bottom: 0.5rem;
  letter-spacing: 0.1em;
}
.section-desc {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 2rem;
  font-size: 1rem;
}

/* ── Textarea ────────────────────────────────────── */
.input-group { position: relative; margin-bottom: 2rem; }
.question-input {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  line-height: 1.6;
  padding: 1rem 1.25rem;
  resize: vertical;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.question-input::placeholder { color: var(--text-muted); font-style: italic; }
.question-input:focus {
  outline: none;
  border-color: var(--border-glow);
  box-shadow: 0 0 20px var(--gold-dim);
}
.char-count {
  position: absolute;
  bottom: 0.5rem;
  right: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Spread Selector ─────────────────────────────── */
.spread-label {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1rem;
}
.spread-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}
.spread-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.3s;
}
.spread-btn:hover {
  border-color: var(--border-glow);
  color: var(--text);
  background: rgba(201,168,76,0.05);
}
.spread-btn.active {
  border-color: var(--gold);
  background: rgba(201,168,76,0.08);
  color: var(--gold-light);
  box-shadow: 0 0 20px var(--gold-dim);
}
.spread-icon { font-size: 1rem; letter-spacing: 0.3em; }
.spread-name { font-family: 'Cinzel', serif; font-size: 0.9rem; }
.spread-desc { font-size: 0.75rem; color: var(--text-muted); font-style: italic; }
.spread-btn.active .spread-desc { color: var(--gold); opacity: 0.7; }

/* ── Draw Button ─────────────────────────────────── */
.draw-btn {
  width: 100%;
  background: linear-gradient(135deg, #1a1200, #2a1e00);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  color: var(--gold-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  letter-spacing: 0.2em;
  padding: 1.1rem;
  transition: all 0.3s;
  text-transform: uppercase;
  box-shadow: 0 0 30px rgba(201,168,76,0.15);
}
.draw-btn:hover {
  background: linear-gradient(135deg, #241a00, #362800);
  box-shadow: 0 0 50px rgba(201,168,76,0.3);
  transform: translateY(-1px);
}
.draw-btn:active { transform: translateY(0); }
.draw-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.draw-btn-icon { font-size: 0.8rem; animation: spin-slow 8s linear infinite; }
@keyframes spin-slow { to { transform: rotate(360deg); } }

/* ── Loading ─────────────────────────────────────── */
.section--loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  gap: 2rem;
}
.loading-orb {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--gold-light), var(--accent));
  box-shadow: 0 0 60px var(--gold-dim), 0 0 100px var(--accent-glow);
  animation: pulse-orb 2s ease-in-out infinite;
}
@keyframes pulse-orb {
  0%, 100% { transform: scale(1); box-shadow: 0 0 60px var(--gold-dim), 0 0 100px var(--accent-glow); }
  50%       { transform: scale(1.1); box-shadow: 0 0 80px rgba(201,168,76,0.6), 0 0 140px rgba(124,92,191,0.5); }
}
.loading-text {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
  animation: fade-text 2s ease-in-out infinite;
}
@keyframes fade-text { 0%,100%{opacity:0.4} 50%{opacity:1} }

/* ── Reading Section ─────────────────────────────── */
.reading-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.6rem;
  color: var(--gold-light);
  text-align: center;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 30px var(--gold-dim);
}
.reading-question-echo {
  text-align: center;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-size: 1rem;
}

/* ── Cards Row ───────────────────────────────────── */
.cards-row {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.tarot-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  width: 160px;
  flex-shrink: 0;
  animation: card-appear 0.5s ease both;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  transition: transform 0.3s, box-shadow 0.3s;
}
.tarot-card:nth-child(2) { animation-delay: 0.15s; }
.tarot-card:nth-child(3) { animation-delay: 0.3s; }
.tarot-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.6), 0 0 30px var(--gold-dim);
}
@keyframes card-appear {
  from { opacity: 0; transform: translateY(30px) rotateY(20deg); }
  to   { opacity: 1; transform: translateY(0) rotateY(0); }
}
.tarot-card__img-wrap {
  width: 100%;
  aspect-ratio: 2/3;
  background: linear-gradient(135deg, #1a1330, #0d1422);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.tarot-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.tarot-card__img.reversed { transform: rotate(180deg); }
.tarot-card__img-placeholder {
  font-size: 3rem;
  opacity: 0.3;
}
.tarot-card__info {
  padding: 0.75rem;
  text-align: center;
}
.tarot-card__position {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.25rem;
}
.tarot-card__name {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.3;
}
.tarot-card__orientation {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.2rem;
}

/* ── Interpretation Box ──────────────────────────── */
.interpretation-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  animation: fadeUp 0.6s 0.4s ease both;
}
.interpretation-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.interpretation-header h3 {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}
.interp-star { color: var(--gold-dim); font-size: 0.7rem; }
.interpretation-text {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.85;
  white-space: pre-wrap;
}

/* ── Action Buttons ──────────────────────────────── */
.reading-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  animation: fadeUp 0.6s 0.5s ease both;
}
.action-btn {
  border-radius: var(--radius);
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  padding: 0.85rem 2rem;
  text-transform: uppercase;
  transition: all 0.3s;
}
.action-btn--save {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
}
.action-btn--save:hover {
  background: rgba(201,168,76,0.1);
  box-shadow: 0 0 20px var(--gold-dim);
}
.action-btn--share {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.action-btn--share:hover {
  background: rgba(124,92,191,0.1);
  box-shadow: 0 0 20px var(--accent-glow);
}
.action-btn--new {
  background: linear-gradient(135deg, #1a1200, #2a1e00);
  border: 1px solid var(--gold);
  color: var(--gold-light);
  box-shadow: 0 0 20px rgba(201,168,76,0.1);
}
.action-btn--new:hover {
  box-shadow: 0 0 40px var(--gold-dim);
  transform: translateY(-1px);
}

/* ── Footer ──────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  border-top: 1px solid rgba(255,255,255,0.04);
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 560px) {
  .oracle-card { padding: 1.75rem 1.25rem; }
  .spread-options { grid-template-columns: 1fr; }
  .tarot-card { width: 130px; }
  .reading-actions { flex-direction: column; }
  .action-btn { text-align: center; width: 100%; }
}
