/* ============================================
   TarotRamses — Professional Tarot Reader
   Design: Dark premium + gold + deep burgundy
   ============================================ */

/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #08080a;
  --bg-surface: #111113;
  --bg-card: #18181b;
  --bg-elevated: #1f1f23;
  --text: #fafaf9;
  --text-secondary: #a8a29e;
  --text-muted: #6b6560;
  --gold: #d4a047;
  --gold-light: #e8c46a;
  --gold-dim: rgba(212, 160, 71, 0.15);
  --gold-glow: rgba(212, 160, 71, 0.35);
  --burgundy: #7a1a2e;
  --burgundy-dim: rgba(122, 26, 46, 0.15);
  --border: #252528;
  --border-light: #353538;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
  --font-display: 'Cinzel', serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-accent: 'Playfair Display', serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 840px; margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }

/* Ambient bg */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 800px 500px at 20% 30%, rgba(212,160,71,0.04) 0%, transparent 70%),
    radial-gradient(ellipse 600px 400px at 80% 70%, rgba(122,26,46,0.04) 0%, transparent 70%),
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.006) 2px, rgba(255,255,255,0.006) 3px);
  pointer-events: none;
  z-index: 0;
}

/* Top gold line */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  z-index: 100;
}

.screen {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 48px 0;
}
.screen.active { display: flex; align-items: center; }

.divider {
  width: 60px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 0 auto;
}

/* ===== HERO ===== */
#screen-hero { text-align: center; min-height: 100vh; }
.hero-content { max-width: 620px; margin: 0 auto; padding: 80px 0 60px; }

.logo { margin-bottom: 32px; }
.logo-icon { display: block; font-size: 3.4rem; margin-bottom: 12px; filter: drop-shadow(0 0 20px var(--gold-glow)); }
.logo-text { font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; letter-spacing: 6px; text-transform: uppercase; color: var(--text); line-height: 1.2; }
.logo-text .accent { color: var(--gold); }

.subtitle { font-family: var(--font-accent); font-size: 1.05rem; color: var(--text-muted); margin-bottom: 28px; font-style: italic; letter-spacing: 2px; }
.description { font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 48px; line-height: 1.8; }
.description strong { color: var(--gold); font-weight: 600; }

.hero-features { display: flex; flex-direction: column; gap: 10px; margin-bottom: 48px; max-width: 400px; margin-left: auto; margin-right: auto; }
.feature { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; color: var(--text-secondary); transition: all 0.3s ease; }
.feature:hover { border-color: rgba(212, 160, 71, 0.3); background: var(--bg-card); transform: translateX(6px); }
.feature-icon { font-size: 1.1rem; flex-shrink: 0; }

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 40px; background: linear-gradient(135deg, var(--gold), #b8922e);
  color: #0a0a0a; border: none; border-radius: var(--radius);
  font-family: var(--font-body); font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: all 0.25s ease; text-decoration: none;
  letter-spacing: 1px; text-transform: uppercase;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px var(--gold-glow); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: all 0.2s ease;
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }
.btn-full { width: 100%; justify-content: center; }
.btn-arrow { transition: transform 0.25s ease; display: inline-block; }
.btn-primary:hover .btn-arrow { transform: translateX(4px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-reveal { margin-top: 28px; padding: 18px 52px; font-size: 1rem; letter-spacing: 2px; }

/* ===== FORM ===== */
.form-container { padding-top: 32px; }
.form-header { margin-bottom: 36px; text-align: center; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--text-muted); cursor: pointer; font-size: 0.8rem; margin-bottom: 16px; transition: color 0.2s; text-transform: uppercase; letter-spacing: 1px; }
.back-link:hover { color: var(--gold); }
.form-header h2 { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 8px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; }
.form-subtitle { color: var(--text-muted); font-size: 0.88rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.72rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 1.5px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 14px 16px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-family: var(--font-body); font-size: 0.92rem; transition: all 0.2s ease; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 20px var(--gold-dim); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%23a8a29e' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; cursor: pointer; }
.field-hint { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }

.ritual-info { display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px; background: var(--bg-surface); border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: var(--radius); margin-bottom: 24px; }
.ritual-info-icon { font-size: 1.2rem; flex-shrink: 0; }
.ritual-info-text { font-size: 0.86rem; color: var(--text-secondary); line-height: 1.6; }
.ritual-info-text strong { color: var(--gold); }

/* ===== RITUAL ===== */
.ritual-container { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 80vh; }
.ritual-animation { max-width: 440px; width: 100%; padding: 0 20px; }
.ritual-main-icon { font-size: 4rem; margin-bottom: 32px; display: block; animation: ritualPulse 2s ease-in-out infinite; }
@keyframes ritualPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.06); opacity: 0.7; } }
.ritual-title { font-size: 1.4rem; font-weight: 600; margin-bottom: 14px; color: var(--text); letter-spacing: 2px; text-transform: uppercase; }
.ritual-instruction { font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 36px; line-height: 1.7; }
.ritual-instruction strong { color: var(--gold); }
.ritual-timer { font-size: 3.5rem; font-weight: 700; color: var(--gold); margin-bottom: 12px; font-variant-numeric: tabular-nums; animation: timerPulse 1s ease-in-out infinite; }
@keyframes timerPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.ritual-progress { width: 220px; height: 3px; background: var(--border); border-radius: 2px; margin: 0 auto 28px; overflow: hidden; }
.ritual-progress-bar { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-light)); border-radius: 2px; width: 0%; transition: width 0.3s linear; }
.ritual-hint { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 4px; }
.ritual-hint-blink { animation: blink 1.5s step-end infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ===== HAND SHUFFLE ===== */
.shuffle-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-bottom: 28px;
  min-height: 110px;
  flex-wrap: wrap;
}

.shuffle-hand {
  position: absolute;
  font-size: 2.8rem;
  z-index: 10;
  animation: handMove 1.6s ease-in-out infinite;
  filter: drop-shadow(0 0 12px var(--gold-glow));
  pointer-events: none;
}

@keyframes handMove {
  0%   { transform: translateX(-80px) translateY(0) rotate(0deg); }
  25%  { transform: translateX(-20px) translateY(-15px) rotate(-10deg); }
  50%  { transform: translateX(40px) translateY(5px) rotate(5deg); }
  75%  { transform: translateX(80px) translateY(-10px) rotate(-5deg); }
  100% { transform: translateX(-80px) translateY(0) rotate(0deg); }
}

.shuffle-card {
  width: 44px;
  height: 64px;
  background: linear-gradient(145deg, #1c1c24, #2a2a34);
  border: 1.5px solid var(--gold);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  opacity: 0.9;
  animation: cardBounce 0.5s ease-in-out infinite alternate;
  position: relative;
  overflow: hidden;
}

.shuffle-card::before {
  content: '★';
  font-size: 1.2rem;
  color: var(--gold);
  opacity: 0.4;
}

.shuffle-card:nth-child(odd) { animation-delay: 0s; }
.shuffle-card:nth-child(even) { animation-delay: 0.15s; }
.shuffle-card:nth-child(3n) { animation-delay: 0.3s; }

@keyframes cardBounce {
  0%   { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-8px) rotate(3deg); }
}

/* ===== CARD THROW ===== */
.card-throw-area {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
  min-height: 100px;
  perspective: 1000px;
}

.throw-card {
  width: 60px;
  height: 84px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
  animation: throwCard 0.5s ease-out forwards;
  opacity: 0;
}

.throw-card.flipped { transform: rotateY(180deg); }

.throw-card:nth-child(1) { animation-delay: 0s; }
.throw-card:nth-child(2) { animation-delay: 0.12s; }
.throw-card:nth-child(3) { animation-delay: 0.24s; }
.throw-card:nth-child(4) { animation-delay: 0.36s; }
.throw-card:nth-child(5) { animation-delay: 0.48s; }
.throw-card:nth-child(6) { animation-delay: 0.6s; }
.throw-card:nth-child(7) { animation-delay: 0.72s; }
.throw-card:nth-child(8) { animation-delay: 0.84s; }
.throw-card:nth-child(9) { animation-delay: 0.96s; }
.throw-card:nth-child(10) { animation-delay: 1.08s; }

@keyframes throwCard {
  0% {
    opacity: 1;
    transform: translateY(-60px) rotate(-15deg) scale(0.5);
  }
  50% { transform: translateY(10px) rotate(5deg) scale(1.05); }
  100% {
    opacity: 1;
    transform: translateY(0) rotate(var(--rot, 0deg)) scale(1);
  }
}

.throw-card .card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 600;
  text-align: center;
  padding: 4px;
  line-height: 1.2;
}

.throw-card .card-back {
  background: linear-gradient(145deg, #1c1c24, #2a2a34);
  border: 1.5px solid var(--gold);
  z-index: 2;
}

.throw-card .card-back::after {
  content: '★';
  font-size: 1rem;
  color: var(--gold);
  opacity: 0.4;
}

.throw-card .card-front {
  background: var(--bg-card);
  border: 1.5px solid var(--gold);
  transform: rotateY(180deg);
  color: var(--gold);
  flex-direction: column;
  gap: 2px;
}

.throw-card .card-front .cf-name {
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-display);
}

.throw-card .card-front .cf-type {
  font-size: 0.45rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== RESULT ===== */
.result-container { padding-top: 32px; }
.result-header { margin-bottom: 32px; text-align: center; }
.result-header h2 { font-family: var(--font-display); font-size: 1.4rem; margin-bottom: 6px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; }
.reading-for { font-size: 0.88rem; color: var(--text-muted); }

.synthesis-card { padding: 24px 28px; background: var(--bg-surface); border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: var(--radius-lg); margin-bottom: 28px; display: flex; align-items: flex-start; gap: 16px; }
.synthesis-icon { font-size: 1.6rem; flex-shrink: 0; }
.synthesis-card p { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.8; }

.numerology-card { padding: 16px 22px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 28px; }
.numerology-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 0.85rem; color: var(--text-secondary); }
.numerology-icon { font-size: 1.1rem; }
.numerology-header strong { font-size: 1.2rem; color: var(--gold); }
.numerology-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }

.cards-grid { display: flex; flex-direction: column; gap: 16px; margin-bottom: 40px; }

.card-result {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
  transition: all 0.3s ease;
  animation: cardEntry 0.4s ease-out forwards;
  opacity: 0;
}
.card-result:nth-child(1) { animation-delay: 0s; }
.card-result:nth-child(2) { animation-delay: 0.1s; }
.card-result:nth-child(3) { animation-delay: 0.2s; }
.card-result:nth-child(4) { animation-delay: 0.3s; }
.card-result:nth-child(5) { animation-delay: 0.4s; }
.card-result:nth-child(6) { animation-delay: 0.5s; }
.card-result:nth-child(7) { animation-delay: 0.6s; }
.card-result:nth-child(8) { animation-delay: 0.7s; }
.card-result:nth-child(9) { animation-delay: 0.8s; }
.card-result:nth-child(10) { animation-delay: 0.9s; }

.card-result:hover { border-color: rgba(212, 160, 71, 0.3); }

@keyframes cardEntry {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

.card-header {
  padding: 14px 20px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 6px;
}
.card-position { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 2px; color: var(--gold); font-weight: 500; }
.card-title-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-name { font-family: var(--font-display); font-size: 1rem; font-weight: 700; }
.card-suit-tag { font-size: 0.6rem; padding: 2px 8px; border-radius: 3px; background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); text-transform: uppercase; letter-spacing: 0.5px; }
.card-status-reversed { display: inline-flex; align-items: center; gap: 4px; font-size: 0.65rem; color: var(--burgundy); font-weight: 600; }
.card-body { padding: 18px 20px; }
.card-keywords { font-size: 0.78rem; color: var(--gold); margin-bottom: 10px; letter-spacing: 0.3px; }
.card-interpretation { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.7; }

.result-actions { display: flex; gap: 12px; margin-bottom: 28px; flex-wrap: wrap; }
.result-disclaimer { padding: 14px 20px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 40px; }
.result-disclaimer p { font-size: 0.75rem; color: var(--text-muted); text-align: center; line-height: 1.5; }

.site-footer { text-align: center; padding: 40px 0 24px; border-top: 1px solid var(--border); }
.site-footer p { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 4px; }
.footer-tagline { font-style: italic; font-size: 0.7rem; color: rgba(107, 101, 96, 0.5); }

.loading-spinner { display: inline-block; width: 28px; height: 28px; border: 2px solid rgba(212,160,71,0.15); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== AUTH / DASHBOARD ===== */
.auth-container { display:flex; align-items:center; justify-content:center; min-height:100vh; }
.auth-box { max-width:400px; width:100%; text-align:center; padding:40px 24px; }
.auth-subtitle { color:var(--text-muted); font-size:0.9rem; }
.auth-error { padding:10px 14px; background:rgba(220,38,38,0.1); border:1px solid rgba(220,38,38,0.2); border-radius:var(--radius); color:#ef4444; font-size:0.85rem; margin-bottom:16px; }
.auth-link { margin-top:20px; font-size:0.85rem; color:var(--text-muted); }
.auth-link a { color:var(--gold); text-decoration:none; font-weight:600; }
.auth-link a:hover { text-decoration:underline; }

.dash-container { padding-top:40px; }
.dash-header { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:32px; flex-wrap:wrap; gap:12px; }
.dash-header h2 { font-family:var(--font-display); font-size:1.3rem; font-weight:700; letter-spacing:1px; }
.dash-user { font-size:0.85rem; color:var(--text-muted); margin-top:4px; }
.dash-credits { display:flex; gap:16px; margin-bottom:20px; flex-wrap:wrap; }
.credits-card { flex:1; min-width:160px; display:flex; align-items:center; gap:16px; padding:20px 24px; background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius-lg); }
.credits-icon { font-size:2rem; }
.credits-label { display:block; font-size:0.75rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:1px; }
.credits-count { display:block; font-family:var(--font-display); font-size:2.2rem; font-weight:700; color:var(--gold); }
.credits-btn { flex:1; min-width:160px; display:flex; align-items:center; justify-content:center; gap:10px; padding:20px 24px; background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius-lg); text-decoration:none; color:var(--text); font-size:0.9rem; font-weight:500; transition:all 0.2s; }
.credits-btn:hover { border-color:var(--gold); background:var(--gold-dim); color:var(--gold); }
.dash-info { font-size:0.82rem; color:var(--text-muted); margin-bottom:28px; line-height:1.6; }
.dash-info strong { color:var(--gold); }
.dash-start { margin-top:12px; }

.reading-credits { font-size:0.8rem; color:var(--gold); margin-top:4px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .container { padding: 0 18px; }
  .logo-text { font-size: 1.8rem; letter-spacing: 4px; }
  .logo-icon { font-size: 2.8rem; }
  .subtitle { font-size: 0.92rem; }
  .hero-content { padding: 50px 0 40px; }
  .form-row { grid-template-columns: 1fr; }
  .ritual-title { font-size: 1.2rem; }
  .ritual-timer { font-size: 2.8rem; }
  .ritual-main-icon { font-size: 3rem; }
  .btn-reveal { padding: 16px 36px; font-size: 0.9rem; }
  .shuffle-card { width: 36px; height: 52px; }
  .throw-card { width: 48px; height: 68px; }
  .throw-card .card-front .cf-name { font-size: 0.5rem; }
  .throw-card .card-front .cf-type { font-size: 0.4rem; }
  @keyframes handMove {
    0%   { transform: translateX(-50px) translateY(0) rotate(0deg); }
    25%  { transform: translateX(-10px) translateY(-10px) rotate(-8deg); }
    50%  { transform: translateX(25px) translateY(3px) rotate(4deg); }
    75%  { transform: translateX(50px) translateY(-8px) rotate(-4deg); }
    100% { transform: translateX(-50px) translateY(0) rotate(0deg); }
  }
}

@media (max-width: 600px) {
  .result-actions { flex-direction: column; }
  .result-actions .btn-primary, .result-actions .btn-secondary { width: 100%; justify-content: center; }
  .card-header { flex-direction: column; align-items: flex-start; gap: 4px; }
  .form-header h2 { font-size: 1.2rem; }
  .result-header h2 { font-size: 1.2rem; }
  .logo-text { font-size: 1.4rem; letter-spacing: 3px; }
  .description { font-size: 0.88rem; }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
::selection { background: rgba(212, 160, 71, 0.25); color: var(--text); }
