/* Effetti: le carte da scoprire nel riquadro "Scegli una carta", comparse durante lo scorrimento.
   Tutto si ferma con "riduci movimento". */

/* ---------- riquadro scuro con cielo stellato */
.oracle-box {
  position: relative; overflow: hidden; border-radius: var(--radius); color: #fff; padding: 24px 16px 22px;
  background:
    radial-gradient(70% 80% at 85% 0%, rgba(217, 178, 106, 0.22), transparent 60%),
    linear-gradient(150deg, #155c53 0%, var(--ink) 40%, var(--dark) 100%);
  box-shadow: var(--shadow-lg);
}
.oracle-box .sky { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.oracle-box .oracle-area { position: relative; z-index: 1; }

/* ---------- oracolo: tre carte da scoprire */
.oracle-area { display: grid; gap: 14px; justify-items: center; perspective: 1400px; }
.oracle-title {
  font-size: 0.8rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: #fff;
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.3); padding: 5px 14px; border-radius: 999px;
}
.oracle {
  --cw: clamp(96px, 27vw, 156px);
  --tilt-x: 0deg; --tilt-y: 0deg;
  position: relative; width: 100%; max-width: 470px; height: calc(var(--cw) * 1.95);
  transform-style: preserve-3d; transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y)); transition: transform .4s ease-out;
}
.oracle::after {
  content: ""; position: absolute; left: 8%; right: 8%; bottom: -8%; height: 30%;
  background: radial-gradient(ellipse at center, rgba(217, 178, 106, 0.55), transparent 70%); filter: blur(14px); z-index: -1;
}
.slot {
  --x: 0px; --y: 0px; --r: 0deg; --s: 1;
  position: absolute; left: 50%; top: 50%; width: var(--cw); aspect-ratio: 3 / 5;
  transform: translate(-50%, -50%) translate(var(--x), var(--y)) rotate(var(--r)) scale(var(--s));
  transition: transform .7s cubic-bezier(.2, .8, .2, 1), opacity .5s ease;
}
.slot-0 { --x: calc(var(--cw) * -0.82); --y: calc(var(--cw) * 0.1); --r: -13deg; }
.slot-1 { --y: calc(var(--cw) * -0.08); z-index: 2; }
.slot-2 { --x: calc(var(--cw) * 0.82); --y: calc(var(--cw) * 0.1); --r: 13deg; }
.oracle.is-shuffling .slot { --x: 0px; --y: 0px; --r: 0deg; }
.oracle.is-shuffling .slot-0 { --r: -3deg; }
.oracle.is-shuffling .slot-2 { --r: 3deg; }
.slot.is-chosen { --x: 0px; --y: calc(var(--cw) * -0.04); --r: 0deg; --s: 1.18; z-index: 5; }
.slot.is-dim { --s: 0.86; opacity: 0.3; }
.slot-0.is-dim { --x: calc(var(--cw) * -1.05); --y: calc(var(--cw) * 0.3); }
.slot-2.is-dim { --x: calc(var(--cw) * 1.05); --y: calc(var(--cw) * 0.3); }
.slot-1.is-dim { --y: calc(var(--cw) * 0.35); }

.tarot { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 10px; color: inherit; }
.tarot:focus-visible { outline: 3px solid #fff; outline-offset: 5px; }
.tarot-float { display: block; width: 100%; height: 100%; animation: float 5s ease-in-out infinite; }
.slot-0 .tarot-float { animation-delay: -1.2s; }
.slot-2 .tarot-float { animation-delay: -2.6s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.tarot-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.3, .7, .2, 1); }
.is-chosen .tarot-inner { transform: rotateY(180deg); }
.tarot-face {
  position: absolute; inset: 0; border-radius: 10px; overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 22px 44px -14px rgba(0, 20, 18, 0.75), 0 0 0 1px rgba(255, 220, 160, 0.35);
}
.tarot-face svg { width: 100%; height: 100%; display: block; }
.tarot-front { transform: rotateY(180deg); }
.tarot-face::after {
  content: ""; position: absolute; inset: -40%;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 236, 190, 0.28) 50%, transparent 60%);
  transform: translateX(-60%); animation: sheen 6s ease-in-out infinite;
}
.slot-1 .tarot-face::after { animation-delay: -2s; }
.slot-2 .tarot-face::after { animation-delay: -4s; }
@keyframes sheen { 0%, 60% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }
.oracle:not(.has-pick) .tarot:hover .tarot-float { animation-play-state: paused; transform: translateY(-14px); transition: transform .3s; }
.is-chosen .tarot-face { box-shadow: 0 26px 60px -12px rgba(217, 178, 106, 0.6), 0 0 0 2px rgba(217, 178, 106, 0.85); }

.oracle-msg { width: 100%; max-width: 470px; min-height: 3.2em; text-align: center; display: grid; gap: 10px; justify-items: center; }
.oracle-msg.is-open {
  animation: rise .6s ease both .35s; background: #fff; color: var(--ink); border-radius: 18px; padding: 18px 18px 14px;
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.55);
}
.oracle-hint { color: #e3eee9; font-style: italic; font-family: var(--font-serif); font-size: 1.15rem; }
.oracle-card { font-family: var(--font-caps); font-weight: 600; font-size: 1.3rem; color: var(--primary); text-transform: uppercase; letter-spacing: .04em; }
.oracle-num { font-family: var(--font-serif); font-size: 1rem; letter-spacing: 0.1em; color: var(--primary-2); margin-right: 4px; }
.oracle-msg p { max-width: 34rem; }
.oracle-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 4px; }
.oracle-msg .btn-ghost { color: var(--primary); border-color: var(--line); }
.oracle-note { font-size: 0.82rem; color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- comparsa durante lo scorrimento (gli elementi sono già visibili prima) */
.fx-in { animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.people .fx-in:nth-child(4n + 2), .offers .fx-in:nth-child(2), .steps .fx-in:nth-child(2) { animation-delay: .06s; }
.people .fx-in:nth-child(4n + 3), .steps .fx-in:nth-child(3) { animation-delay: .12s; }
.people .fx-in:nth-child(4n) { animation-delay: .18s; }
.op.is-disponibile .st::before { animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--free) 60%, transparent); } 100% { box-shadow: 0 0 0 6px transparent; } }

/* carte reali del mazzo Rider-Waite */
.tarot-front { background: #fdf8ec; }
.tarot-face img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; }

@media (prefers-reduced-motion: reduce) {
  .tarot-float, .tarot-face::after, .op .st::before, .fx-in, .oracle-msg.is-open { animation: none !important; }
  .slot, .tarot-inner { transition: none; }
}
