/* ============================================
   The Four Paths of Destiny — Core Styles
   ============================================ */

:root {
  --midnight: #0a0a1a;
  --deeppurple: #1a0a2e;
  --mystic: #2d1b4e;
  --gold: #d4af37;
  --goldlight: #f0d77b;
  --rose: #c44569;
  --silver: #a8b5c4;
  --emerald: #2d6a4f;
  --amber: #e9a825;
}

* {
  -webkit-tap-highlight-color: transparent;
}

body {
  background: radial-gradient(ellipse at 50% 0%, #1a0a2e 0%, #0a0a1a 60%, #050510 100%);
  min-height: 100dvh;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Buttons */
.btn-primary {
  @apply font-cinzel font-semibold tracking-wide px-6 py-3 rounded-xl
         bg-gradient-to-r from-gold to-goldlight text-midnight
         shadow-lg hover:shadow-gold/40 hover:scale-[1.02]
         active:scale-[0.98] transition-all duration-200
         disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:scale-100;
}

.btn-secondary {
  @apply font-cinzel font-medium tracking-wide px-6 py-3 rounded-xl
         border border-gold/50 text-gold bg-gold/10
         hover:bg-gold/20 hover:border-gold
         active:scale-[0.98] transition-all duration-200;
}

.btn-ghost {
  @apply font-inter text-sm text-white/60 hover:text-gold transition-colors duration-200;
}

.btn-yes {
  @apply font-cinzel font-semibold text-lg px-10 py-4 rounded-2xl
         bg-gradient-to-br from-emerald-600 to-emerald-800 text-white
         border border-emerald-400/30 shadow-lg
         hover:from-emerald-500 hover:to-emerald-700
         active:scale-[0.97] transition-all duration-200;
}

.btn-no {
  @apply font-cinzel font-semibold text-lg px-10 py-4 rounded-2xl
         bg-gradient-to-br from-rose-700 to-rose-900 text-white
         border border-rose-400/30 shadow-lg
         hover:from-rose-600 hover:to-rose-800
         active:scale-[0.97] transition-all duration-200;
}

/* Door cards */
.door-card {
  @apply relative overflow-hidden rounded-2xl border-2 cursor-pointer
         transition-all duration-300 select-none
         hover:scale-[1.03] active:scale-[0.98];
  min-height: 140px;
}

.door-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.08) 100%);
  pointer-events: none;
}

.door-love {
  border-color: #c44569;
  background: linear-gradient(160deg, #2a0a1a 0%, #4a1528 50%, #1a0a14 100%);
  box-shadow: 0 0 30px rgba(196, 69, 105, 0.25);
}
.door-love:hover, .door-love.selected {
  box-shadow: 0 0 50px rgba(196, 69, 105, 0.5);
  border-color: #e85a7a;
}

.door-career {
  border-color: #6b8cae;
  background: linear-gradient(160deg, #0a1520 0%, #152a40 50%, #0a1018 100%);
  box-shadow: 0 0 30px rgba(107, 140, 174, 0.25);
}
.door-career:hover, .door-career.selected {
  box-shadow: 0 0 50px rgba(107, 140, 174, 0.5);
  border-color: #8eb0d0;
}

.door-health {
  border-color: #2d6a4f;
  background: linear-gradient(160deg, #0a1a14 0%, #153528 50%, #0a1410 100%);
  box-shadow: 0 0 30px rgba(45, 106, 79, 0.25);
}
.door-health:hover, .door-health.selected {
  box-shadow: 0 0 50px rgba(45, 106, 79, 0.5);
  border-color: #40916c;
}

.door-fortune {
  border-color: #e9a825;
  background: linear-gradient(160deg, #1a1408 0%, #3a2a10 50%, #141008 100%);
  box-shadow: 0 0 30px rgba(233, 168, 37, 0.25);
}
.door-fortune:hover, .door-fortune.selected {
  box-shadow: 0 0 50px rgba(233, 168, 37, 0.5);
  border-color: #f0c040;
}

.door-secret {
  border-color: #9b59b6;
  background: linear-gradient(160deg, #150a20 0%, #2a1540 50%, #100818 100%);
  box-shadow: 0 0 30px rgba(155, 89, 182, 0.3);
}
.door-secret:hover, .door-secret.selected {
  box-shadow: 0 0 50px rgba(155, 89, 182, 0.55);
  border-color: #bb79d6;
}

/* Tarot card */
.tarot-card {
  width: 110px;
  height: 180px;
  perspective: 1000px;
  cursor: pointer;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .tarot-card {
    width: 130px;
    height: 210px;
  }
}

.tarot-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
}

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

.tarot-card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 12px;
  border: 2px solid var(--gold);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tarot-card-back {
  background: linear-gradient(145deg, #1a0a2e 0%, #2d1b4e 40%, #1a0a2e 100%);
  background-image:
    radial-gradient(circle at 50% 30%, rgba(212,175,55,0.15) 0%, transparent 50%),
    linear-gradient(145deg, #1a0a2e 0%, #2d1b4e 40%, #1a0a2e 100%);
}

.tarot-card-back::before {
  content: '✦';
  font-size: 2.5rem;
  color: var(--gold);
  opacity: 0.7;
  text-shadow: 0 0 20px rgba(212,175,55,0.5);
}

.tarot-card-front {
  background: linear-gradient(180deg, #1e1235 0%, #0f0a1a 100%);
  transform: rotateY(180deg);
  padding: 8px;
  text-align: center;
}

.tarot-card.selected {
  outline: 3px solid var(--goldlight);
  outline-offset: 4px;
  box-shadow: 0 0 25px rgba(212,175,55,0.5);
}

.tarot-card.golden-glow .tarot-card-front {
  box-shadow: inset 0 0 30px rgba(212,175,55,0.3);
  border-color: #f0d77b;
}

.tarot-card.dark-glow .tarot-card-front {
  box-shadow: inset 0 0 30px rgba(100,50,150,0.4);
}

/* Card face content */
.card-symbol {
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 4px;
  filter: drop-shadow(0 0 8px rgba(212,175,55,0.4));
}

.card-name {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gold);
  line-height: 1.2;
  padding: 0 4px;
}

.card-orientation {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
}

/* Position labels */
.position-label {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.8;
  margin-bottom: 6px;
}

/* Story text */
.story-text {
  font-family: 'Inter', sans-serif;
  line-height: 1.7;
  color: rgba(255,255,255,0.9);
}

.story-text p {
  margin-bottom: 1rem;
}

/* Narrator */
.narrator {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  line-height: 1.65;
  color: rgba(240, 215, 123, 0.95);
  text-align: center;
  max-width: 32rem;
  margin: 0 auto;
}

/* Screen transitions */
.screen {
  animation: fadeIn 0.5s ease-out;
}

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

/* Shuffle animation */
@keyframes shuffle {
  0% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-8px) rotate(-3deg); }
  50% { transform: translateX(8px) rotate(3deg); }
  75% { transform: translateX(-4px) rotate(-1deg); }
  100% { transform: translateX(0) rotate(0); }
}

.shuffling {
  animation: shuffle 0.4s ease-in-out;
}

/* Glow text */
.glow-text {
  text-shadow: 0 0 20px rgba(212,175,55,0.5), 0 0 40px rgba(212,175,55,0.2);
}

/* Scrollable story area */
.story-scroll {
  max-height: 40vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
}

.story-scroll::-webkit-scrollbar {
  width: 4px;
}
.story-scroll::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 2px;
}

/* Mode toggle */
.mode-toggle {
  @apply flex rounded-xl overflow-hidden border border-gold/30;
}
.mode-toggle button {
  @apply flex-1 py-2.5 px-4 font-cinzel text-sm transition-all duration-200;
}
.mode-toggle button.active {
  @apply bg-gold text-midnight font-semibold;
}
.mode-toggle button:not(.active) {
  @apply bg-transparent text-gold/70 hover:text-gold hover:bg-gold/10;
}

/* Progress dots */
.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(212,175,55,0.3);
  transition: all 0.3s;
}
.progress-dot.active {
  background: var(--gold);
  box-shadow: 0 0 8px rgba(212,175,55,0.6);
}
.progress-dot.done {
  background: var(--goldlight);
}

/* Particle styles */
.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0;
  animation: particle linear infinite;
  pointer-events: none;
}

/* Safe area for mobile */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #global-disclaimer {
    padding-bottom: calc(0.375rem + env(safe-area-inset-bottom));
  }
}

/* Focus visible for accessibility */
button:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* Loading spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(212,175,55,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
