/* ============================================
   Oracle Cards - Spiritual Design System
   ============================================ */

:root {
  --bg-deep: #0a0612;
  --bg-dark: #110b1f;
  --bg-card: #1a1030;
  --purple-dark: #2d1b69;
  --purple-mid: #6b3fa0;
  --purple-light: #9b6dd7;
  --gold: #d4a843;
  --gold-light: #f0d68a;
  --gold-glow: #d4a84380;
  --pink: #e8a0bf;
  --cyan: #7fdbda;
  --white-soft: #ede6f5;
  --text-primary: #f0e6ff;
  --text-secondary: #b8a0d8;
  --text-dim: #7a6899;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Serif JP', serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#app {
  position: relative;
  z-index: 1;
}

/* ============================================
   Screens
   ============================================ */

.screen {
  display: none;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.screen.active {
  display: flex;
  opacity: 1;
}

.screen.fade-in {
  animation: fadeIn 1s ease forwards;
}

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

/* ============================================
   Landing Screen
   ============================================ */

#landing {
  position: relative;
  overflow: hidden;
}

.sacred-geometry {
  position: absolute;
  width: 600px;
  height: 600px;
  border: 1px solid rgba(107, 63, 160, 0.15);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: sacredRotate 60s linear infinite;
}

.sacred-geometry::before,
.sacred-geometry::after {
  content: '';
  position: absolute;
  border: 1px solid rgba(107, 63, 160, 0.1);
  border-radius: 50%;
}

.sacred-geometry::before {
  width: 450px;
  height: 450px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: sacredRotate 45s linear infinite reverse;
}

.sacred-geometry::after {
  width: 300px;
  height: 300px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: sacredRotate 30s linear infinite;
}

@keyframes sacredRotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.landing-content {
  text-align: center;
  z-index: 2;
  animation: landingAppear 1.5s ease forwards;
}

@keyframes landingAppear {
  0% { opacity: 0; transform: scale(0.95) translateY(30px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.oracle-symbol {
  font-size: 3rem;
  color: var(--gold);
  margin-bottom: 1rem;
  animation: symbolPulse 3s ease-in-out infinite;
  text-shadow: 0 0 30px var(--gold-glow), 0 0 60px var(--gold-glow);
}

@keyframes symbolPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}

.title-main {
  font-family: 'Cinzel', 'Noto Serif JP', serif;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  text-shadow: none;
  filter: drop-shadow(0 0 20px var(--gold-glow));
}

.title-sub {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  font-weight: 300;
  color: var(--text-secondary);
  letter-spacing: 0.3em;
  margin-bottom: 1rem;
}

.title-desc {
  font-size: clamp(0.85rem, 1.8vw, 1rem);
  color: var(--text-dim);
  font-weight: 300;
  margin-bottom: 3rem;
  letter-spacing: 0.05em;
}

/* ============================================
   Oracle Buttons
   ============================================ */

.spread-choices {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-oracle {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(145deg, rgba(45, 27, 105, 0.6), rgba(26, 16, 48, 0.8));
  border: 1px solid rgba(155, 109, 215, 0.3);
  border-radius: 16px;
  padding: 2rem 2.5rem;
  color: var(--text-primary);
  cursor: pointer;
  font-family: 'Noto Serif JP', serif;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  backdrop-filter: blur(10px);
  min-width: 180px;
}

.btn-oracle::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, var(--gold-glow), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.btn-oracle:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow:
    0 8px 32px rgba(212, 168, 67, 0.15),
    0 0 60px rgba(212, 168, 67, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-oracle:hover::before {
  opacity: 1;
}

.btn-oracle:active {
  transform: translateY(-2px) scale(0.98);
}

.btn-icon {
  font-size: 1.5rem;
  color: var(--gold);
  z-index: 1;
}

.btn-label {
  font-size: 1.1rem;
  font-weight: 500;
  z-index: 1;
  letter-spacing: 0.1em;
}

.btn-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
  z-index: 1;
}

/* ============================================
   Scroll Hint
   ============================================ */

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  animation: hintFloat 3s ease-in-out infinite;
}

.hint-glow {
  width: 40px;
  height: 40px;
  margin: 0.5rem auto 0;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-glow), transparent);
  animation: hintPulse 2s ease-in-out infinite;
}

@keyframes hintFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 0.7; transform: scale(1.2); }
}

/* ============================================
   Screen Header
   ============================================ */

.screen-header {
  text-align: center;
  margin-bottom: 2rem;
}

.screen-title {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 400;
  color: var(--gold-light);
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 20px var(--gold-glow);
}

.screen-subtitle {
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* ============================================
   Card Fan (Selection)
   ============================================ */

.card-fan {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 900px;
  perspective: 1000px;
  padding: 1rem;
}

.card-slot {
  width: 90px;
  height: 140px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  position: relative;
}

.card-slot:hover {
  transform: translateY(-15px) scale(1.05);
  z-index: 10;
}

.card-slot.selected {
  transform: translateY(-25px) scale(1.1);
  z-index: 20;
}

.card-slot.selected .card-back {
  border-color: var(--gold);
  box-shadow:
    0 0 30px var(--gold-glow),
    0 0 60px rgba(212, 168, 67, 0.2),
    0 10px 40px rgba(0, 0, 0, 0.5);
}

.card-slot.disabled {
  opacity: 0.4;
  pointer-events: none;
  transform: scale(0.95);
}

.card-back {
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, var(--purple-dark), var(--bg-card));
  border: 1px solid var(--purple-mid);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.card-back::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(155, 109, 215, 0.2);
  border-radius: 6px;
}

.card-back::after {
  content: '✦';
  font-size: 1.5rem;
  color: var(--gold);
  opacity: 0.6;
  text-shadow: 0 0 10px var(--gold-glow);
}

.card-back-pattern {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(155, 109, 215, 0.15);
  border-radius: 4px;
  background:
    repeating-conic-gradient(
      rgba(155, 109, 215, 0.03) 0% 25%,
      transparent 0% 50%
    ) 0 0 / 20px 20px;
}

/* ============================================
   Card Reveal Animation
   ============================================ */

.card-reveal-enter {
  animation: cardRevealIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes cardRevealIn {
  0% { opacity: 0; transform: scale(0.5) rotateY(180deg); }
  60% { transform: scale(1.05) rotateY(0deg); }
  100% { opacity: 1; transform: scale(1) rotateY(0deg); }
}

/* ============================================
   Reading Screen
   ============================================ */

.reading-area {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  perspective: 1000px;
}

.reading-card {
  width: 220px;
  text-align: center;
  animation: readingCardAppear 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}

.reading-card:nth-child(2) { animation-delay: 0.3s; }
.reading-card:nth-child(3) { animation-delay: 0.6s; }

@keyframes readingCardAppear {
  0% { opacity: 0; transform: translateY(40px) scale(0.8); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.reading-card-position {
  font-size: 0.8rem;
  color: var(--gold);
  letter-spacing: 0.2em;
  margin-bottom: 0.8rem;
  text-transform: uppercase;
}

.reading-card-image-wrapper {
  position: relative;
  width: 180px;
  height: 270px;
  margin: 0 auto 1rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 40px var(--gold-glow);
  border: 2px solid var(--gold);
}

.reading-card-image-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    rgba(212, 168, 67, 0.2) 0%,
    transparent 50%,
    rgba(212, 168, 67, 0.1) 100%
  );
  z-index: 1;
  pointer-events: none;
}

.reading-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.reading-card:hover .reading-card-image {
  transform: scale(1.05);
}

.reading-card-name {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--gold-light);
  margin-bottom: 0.3rem;
}

.reading-card-keyword {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 300;
}

/* ============================================
   Reading Message
   ============================================ */

.reading-message {
  max-width: 700px;
  text-align: center;
  margin-bottom: 3rem;
  opacity: 0;
  animation: messageAppear 1s ease 1.2s forwards;
}

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

.reading-message .message-title {
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: 1rem;
  letter-spacing: 0.15em;
}

.reading-message .message-body {
  font-size: 0.95rem;
  line-height: 2;
  color: var(--text-secondary);
  font-weight: 300;
}

.reading-message .message-divider {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 1.5rem auto;
}

/* ============================================
   Again Button
   ============================================ */

.btn-again {
  padding: 1.2rem 3rem;
  margin-bottom: 3rem;
  opacity: 0;
  animation: messageAppear 1s ease 1.8s forwards;
}

/* ============================================
   Sparkle Burst Effect
   ============================================ */

.sparkle-burst {
  position: fixed;
  pointer-events: none;
  z-index: 100;
}

.sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--gold), 0 0 12px var(--gold-glow);
  animation: sparkleFly 1s ease-out forwards;
}

@keyframes sparkleFly {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); }
}

/* ============================================
   Light Rays
   ============================================ */

.light-ray-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.light-ray {
  position: absolute;
  top: -50%;
  width: 2px;
  height: 200%;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(155, 109, 215, 0.05),
    rgba(212, 168, 67, 0.03),
    transparent
  );
  animation: rayDrift 20s linear infinite;
}

@keyframes rayDrift {
  from { transform: translateX(-100vw) rotate(15deg); }
  to { transform: translateX(200vw) rotate(15deg); }
}

/* ============================================
   Glow Orbs
   ============================================ */

.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 15s ease-in-out infinite;
}

.glow-orb:nth-child(1) {
  width: 400px;
  height: 400px;
  background: var(--purple-mid);
  top: 10%;
  left: -10%;
  animation-duration: 18s;
}

.glow-orb:nth-child(2) {
  width: 300px;
  height: 300px;
  background: var(--pink);
  top: 60%;
  right: -5%;
  animation-duration: 22s;
  animation-delay: -5s;
}

.glow-orb:nth-child(3) {
  width: 250px;
  height: 250px;
  background: var(--cyan);
  bottom: 10%;
  left: 30%;
  animation-duration: 20s;
  animation-delay: -10s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(30px, -20px); }
  50% { transform: translate(-20px, 30px); }
  75% { transform: translate(20px, 20px); }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 640px) {
  .spread-choices {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .btn-oracle {
    width: 100%;
    max-width: 250px;
    padding: 1.5rem 2rem;
  }

  .card-slot {
    width: 65px;
    height: 100px;
  }

  .card-back::after {
    font-size: 1rem;
  }

  .reading-card {
    width: 160px;
  }

  .reading-card-image-wrapper {
    width: 140px;
    height: 210px;
  }

  .reading-area {
    gap: 1rem;
  }

  .sacred-geometry {
    width: 350px;
    height: 350px;
  }
}
