/* Arkenum — interactive tarot cards (single source of truth) */

/* cards step: full width, break out of narrow quiz column */
.quiz-step[data-step="cards"] {
  max-width: min(1080px, 100vw) !important;
  width: calc(100vw - 24px);
  margin-inline: calc(50% - 50vw + 12px);
  padding-inline: 0;
}
@media (min-width: 720px) {
  .quiz-step[data-step="cards"] {
    width: 100%;
    margin-inline: auto;
    padding-inline: 0;
  }
}
.quiz-step[data-step="cards"] .step-icon { width: 44px; height: 44px; margin-bottom: 12px; }
.quiz-step[data-step="cards"] .step-title { margin-bottom: 10px; }
.quiz-step[data-step="cards"] .step-lead {
  max-width: 44ch;
  margin-bottom: 16px;
  font-size: 1.05rem;
}

/* 6 cards: 2 cols phone, 3 cols desktop — big art */
#pick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 3.5vw, 28px);
  margin: 16px auto 8px;
  width: 100%;
  max-width: 960px;
  perspective: 1800px;
}
@media (min-width: 720px) {
  #pick-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(20px, 2.5vw, 32px);
    max-width: 1020px;
  }
}

#pick-grid .pick-card {
  position: relative;
  aspect-ratio: 2 / 3;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.2,.9,.3,1), opacity .4s;
  animation: pickIn .5s cubic-bezier(.2,.9,.3,1) both, cardFloat 6s ease-in-out infinite;
  animation-delay: calc(var(--d, 0) * 70ms), calc(var(--d, 0) * -0.8s);
}
@keyframes cardFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

#pick-grid .pick-card__inner {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transition: transform .7s cubic-bezier(.4,.15,.2,1);
  will-change: transform;
}
#pick-grid .pick-card__face {
  position: absolute; inset: 0;
  border-radius: clamp(12px, 2vw, 18px);
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 14px 34px rgba(0,0,0,.5), 0 0 0 1px rgba(231,196,99,.12);
}
#pick-grid .pick-card__face img {
  width: 100%; height: 100%; display: block; object-fit: cover;
}
#pick-grid .pick-card__face--front {
  transform: rotateY(180deg);
}

#pick-grid .pick-card__glow {
  position: absolute; inset: 0; border-radius: clamp(12px, 2vw, 18px);
  pointer-events: none; opacity: 0;
  background: radial-gradient(140px 140px at var(--gx,50%) var(--gy,50%), rgba(255,240,200,.35), transparent 60%);
  transition: opacity .3s;
  mix-blend-mode: screen;
}
#pick-grid .pick-card:hover .pick-card__glow { opacity: 1; }
#pick-grid .pick-card:hover {
  animation-play-state: paused;
  z-index: 3;
}
#pick-grid .pick-card:hover .pick-card__face {
  box-shadow: 0 22px 48px rgba(0,0,0,.55), 0 0 26px rgba(231,196,99,.4), 0 0 0 1px rgba(231,196,99,.45);
}

#pick-grid .pick-card.is-flipped { animation-play-state: paused; z-index: 5; }
#pick-grid .pick-card.is-flipped .pick-card__inner { transform: rotateY(180deg); }
#pick-grid .pick-card.is-picked { animation-play-state: paused; z-index: 4; }
#pick-grid .pick-card.is-picked .pick-card__face--front {
  box-shadow: 0 22px 54px rgba(0,0,0,.6), 0 0 34px rgba(231,196,99,.55), 0 0 0 2px var(--gold);
}
#pick-grid .pick-card.is-dim { opacity: .3; filter: saturate(.6); pointer-events: none; animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  #pick-grid .pick-card { animation: none; }
  #pick-grid .pick-card__inner { transition: transform .3s; }
}
