﻿/* =====================================================================
   DailyTarotSpin - the Wheel of Fate (wheel.css)
   One slow wheel of face-down cards under a gold marker, and three
   places (Past, Present, Future) that fill as the reader chooses.
   Built by Scripts/wheel.js. Shared by the reading page and the free
   reading page. Uses the site tokens from site.css.
   ===================================================================== */
.wof {
    --wof-card-w: 78px;
    --wof-card-h: 131px;
    --wof-r: 430px;
    position: relative;
}
@media (min-width: 576px) {
    .wof { --wof-card-w: 92px; --wof-card-h: 154px; --wof-r: 520px; }
}

/* ---------- the three places ---------- */
.wof-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 264px; margin: 0 auto; }
@media (min-width: 576px) { .wof-slots { max-width: 350px; gap: 14px; } }
.wof-slot { display: flex; flex-direction: column; gap: 5px; min-width: 0; text-align: center; }
.wof-frame {
    position: relative; width: 100%; aspect-ratio: 500 / 839;
    border: 1.5px dashed var(--dts-border-strong); border-radius: 10px;
    background: linear-gradient(160deg, rgba(40, 32, 84, .55), rgba(19, 16, 46, .55));
    display: grid; place-items: center; overflow: hidden;
    transition: border-color .4s, box-shadow .4s;
}
.wof-slot.next .wof-frame { border-color: var(--dts-gold); box-shadow: 0 0 18px rgba(232, 193, 90, .28); }
.wof-slot.filled .wof-frame { border-style: solid; border-color: var(--dts-gold); }
.wof-num { font-family: var(--dts-font-display); font-size: 1.4rem; color: var(--dts-gold); opacity: .8; }
.wof-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.wof-frame img.rev { transform: rotate(180deg); }
.wof-where { font-family: var(--dts-font-display); font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--dts-muted); }
.wof-slot.next .wof-where, .wof-slot.filled .wof-where { color: var(--dts-gold-light); }
.wof-name { font-size: .74rem; line-height: 1.2; min-height: 1.2em; color: var(--dts-text); overflow-wrap: anywhere; }
.wof-name small { display: block; color: var(--dts-muted); }
.wof-name .rev { color: var(--dts-magenta); font-weight: 600; }

.wof-count {
    width: fit-content; margin: .5rem auto 0;
    font-size: .8rem; color: var(--dts-muted); font-variant-numeric: tabular-nums;
    border: 1px solid var(--dts-border); border-radius: 999px; padding: 2px 12px;
}
.wof-count b { color: var(--dts-gold-light); font-weight: 600; }

/* ---------- the wheel ---------- */
.wof-stage {
    position: relative; display: block; width: 100%; height: 232px; margin-top: .25rem;
    overflow: hidden; border: 0; padding: 0; background: none; color: inherit; cursor: pointer;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16%, #000 84%, transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 16%, #000 84%, transparent 100%);
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
@media (min-width: 576px) { .wof-stage { height: 268px; } }
.wof-stage:focus-visible { outline: 2px solid var(--dts-gold); outline-offset: 2px; border-radius: 12px; }
.wof-stage.resting { cursor: default; }
.wof-stage.resting .wof-ring { opacity: .5; }
.wof-stage.resting .wof-marker { opacity: .35; }
.wof-ring { position: absolute; left: 50%; top: 46px; width: 0; height: 0; transition: opacity .5s; }
.wof-card {
    position: absolute; left: calc(var(--wof-card-w) / -2); top: 0;
    width: var(--wof-card-w); height: var(--wof-card-h);
    border-radius: 7px;
    background: #1a153a url("/Images/Cards/back.jpg") center / cover no-repeat;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .5), 0 0 0 1px rgba(232, 193, 90, .35);
    transform-origin: 50% calc(var(--wof-r) + var(--wof-card-h) / 2);
    will-change: transform;
}
.wof-card.center { box-shadow: 0 8px 22px rgba(0, 0, 0, .55), 0 0 0 1.5px var(--dts-gold), 0 0 22px rgba(232, 193, 90, .45); }
.wof-card.gone { visibility: hidden; }
.wof-marker {
    position: absolute; left: 50%; top: 10px; transform: translateX(-50%);
    width: calc(var(--wof-card-w) + 18px); height: calc(var(--wof-card-h) + 54px);
    pointer-events: none; transition: opacity .5s;
}
.wof-marker::before {            /* the pointer above the card */
    content: ""; position: absolute; left: 50%; top: 4px; width: 14px; height: 14px;
    transform: translateX(-50%) rotate(45deg);
    background: linear-gradient(135deg, var(--dts-gold-light), var(--dts-gold-deep));
    box-shadow: 0 0 14px rgba(232, 193, 90, .7);
}
.wof-marker::after {             /* the frame the chosen card sits in */
    content: ""; position: absolute; left: 3px; right: 3px; top: 30px; height: calc(var(--wof-card-h) + 12px);
    border: 1.5px solid var(--dts-border-strong); border-radius: 12px;
    box-shadow: inset 0 0 18px rgba(232, 193, 90, .12);
}

.wof-guide {
    margin: .6rem 0 0; min-height: 1.6em; text-align: center;
    font-family: var(--dts-font-display); font-size: .92rem; letter-spacing: .1em; text-transform: uppercase;
    color: var(--dts-gold-light); text-wrap: balance;
}
.wof-guide.fate { color: var(--dts-text); animation: wof-pulse 1s ease-in-out infinite alternate; }
@keyframes wof-pulse { from { opacity: .55; } to { opacity: 1; } }

/* ---------- a card in flight from the wheel to its place ---------- */
.wof-flyer { position: fixed; z-index: 1080; pointer-events: none; perspective: 900px; }
.wof-flyer-in { position: absolute; inset: 0; transform-style: preserve-3d; }
.wof-flyer-face {
    position: absolute; inset: 0; border-radius: 8px;
    background-size: cover; background-position: center; background-color: #1a153a;
    backface-visibility: hidden; -webkit-backface-visibility: hidden;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .6), 0 0 0 1.5px var(--dts-gold);
}
.wof-flyer-back { background-image: url("/Images/Cards/back.jpg"); }
.wof-flyer-front { transform: rotateY(180deg); }
.wof-flyer-front.rev { transform: rotateY(180deg) rotate(180deg); }

@media (prefers-reduced-motion: reduce) {
    .wof-guide.fate { animation: none; }
}
