/* The Sovereign Wheel (templates/partials/sovereign_wheel.html + static/js/sovereign_wheel.js). */
.sw-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.sw-gold-grad { background: linear-gradient(180deg, #fff7d1 0%, #fcd34d 38%, #d97706 72%, #fde68a 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Stage ---------- */
.sw-stage { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 1.25rem; }
.sw-spot {
    position: absolute; left: 50%; top: -3rem; width: 150%; height: 115%; transform: translateX(-50%);
    background: radial-gradient(ellipse 34% 58% at 50% 0%, rgba(255, 228, 160, 0.20), rgba(255, 214, 120, 0.06) 55%, transparent 75%);
    pointer-events: none; transition: opacity .6s ease;
}
.sw-stage.tension .sw-spot { opacity: .55; }
.sw-floor {
    position: absolute; left: 50%; bottom: 2.5rem; width: 78%; height: 12%; transform: translateX(-50%);
    background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(245, 180, 60, 0.22), rgba(245, 180, 60, 0.05) 55%, transparent 72%);
    pointer-events: none;
}

#sw-wheel { position: relative; width: min(100%, 520px); aspect-ratio: 1; user-select: none; }
#sw-wheel > svg.sw-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
#sw-rotator { transform-origin: 50% 50%; will-change: transform; }
.sw-peg-lit { transform: rotate(calc(var(--rot, 0) * -1deg)); }

/* Fine radial machining on the face (rotation invariant, so it stays static). */
.sw-texture {
    position: absolute; inset: 10.5%; border-radius: 50%; pointer-events: none; mix-blend-mode: overlay;
    background: repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,0.05) 0 1px, transparent 1px 3px);
}
/* Speed smear: fades in with angular velocity (set per frame from JS). */
.sw-smear {
    position: absolute; inset: 10.5%; border-radius: 50%; pointer-events: none; opacity: 0;
    background: radial-gradient(circle, transparent 20%, rgba(26, 21, 8, 0.85) 38%, rgba(40, 30, 10, 0.6) 70%, transparent 76%);
}

/* The ticker flapper pivots at its top pin. */
#sw-ticker {
    position: absolute; left: 45.4%; top: -1.2%; width: 9.2%; height: 15%;
    transform-origin: 50% 14%; will-change: transform; filter: drop-shadow(0 4px 4px rgba(0,0,0,.7));
}

.sw-jp-edge { animation: swEdge 1.8s ease-in-out infinite; }
@keyframes swEdge { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.sw-spark { animation: swTwinkle 2.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes swTwinkle { 0%,100% { opacity: .2; transform: scale(.6); } 50% { opacity: 1; transform: scale(1.1); } }
.sw-stage.tension .sw-jp-edge { animation-duration: .6s; }

#sw-win-wedge { opacity: 0; transition: opacity .35s ease; }
#sw-win-wedge.on { opacity: 1; animation: swWinPulse 1.1s ease-in-out .35s infinite; }
@keyframes swWinPulse { 0%,100% { opacity: .75; } 50% { opacity: 1; } }

.sw-shake { animation: swShake .24s linear; }
@keyframes swShake {
    0%,100% { transform: translate(0,0); } 20% { transform: translate(-3px, 1px); } 40% { transform: translate(3px,-1px); }
    60% { transform: translate(-2px,-1px); } 80% { transform: translate(2px, 1px); }
}

/* ---------- Hub ---------- */
#sw-hub {
    position: absolute; left: 50%; top: 50%; width: 96px; height: 96px; transform: translate(-50%, -50%);
    border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: transform .15s ease, box-shadow .3s ease, filter .3s ease; z-index: 3;
}
#sw-hub.ready {
    background: radial-gradient(circle at 38% 28%, #fff1b8 0%, #fcd34d 22%, #f59e0b 58%, #b45309 100%);
    border: 2px solid #fde68a; color: #000; cursor: pointer;
    box-shadow: 0 0 0 5px #3a2a08, 0 0 0 7px #caa045, 0 0 25px rgba(245,158,11,.6), 0 10px 18px rgba(0,0,0,.7),
                inset 0 -6px 10px rgba(120, 53, 15, .55), inset 0 4px 6px rgba(255, 255, 255, .55);
    animation: swHubAura 2.4s ease-in-out infinite;
}
#sw-hub.ready:hover { transform: translate(-50%, -50%) scale(1.05); }
#sw-hub.ready:active { transform: translate(-50%, -50%) scale(.95); }
@keyframes swHubAura {
    0%,100% { filter: drop-shadow(0 0 0 rgba(245,158,11,0)); }
    50% { filter: drop-shadow(0 0 14px rgba(245,158,11,.75)); }
}
#sw-hub.spinning {
    background: radial-gradient(circle at 38% 28%, #fde68a 0%, #d97706 60%, #78350f 100%);
    border: 2px solid #b8862b; color: rgba(0,0,0,.6); cursor: default;
    box-shadow: 0 0 0 5px #3a2a08, 0 0 0 7px #8a6b1d, 0 10px 18px rgba(0,0,0,.7), inset 0 -6px 10px rgba(0,0,0,.4);
}
#sw-hub.locked {
    background:
        repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,.035) 0 1px, transparent 1px 2.5px),
        radial-gradient(circle at 38% 28%, #52525b 0%, #27272a 55%, #111113 100%);
    border: 2px solid #3f3f46; color: #d4d4d8; cursor: not-allowed;
    box-shadow: 0 0 0 5px #141416, 0 0 0 7px #6b5a2e, 0 10px 18px rgba(0,0,0,.75),
                inset 0 2px 3px rgba(255,255,255,.18), inset 0 -4px 8px rgba(0,0,0,.6);
}
.sw-led { width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 6px #f59e0b, 0 0 12px rgba(245,158,11,.6); animation: swLed 1.4s ease-in-out infinite; }
@keyframes swLed { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
@media (max-width: 420px) { #sw-hub { width: 84px; height: 84px; } }

/* ---------- Odds drawer (slide-over) ---------- */
#sw-odds { position: fixed; inset: 0; z-index: 65; pointer-events: none; }
#sw-odds .sw-odds-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.6); opacity: 0; transition: opacity .25s ease; }
#sw-odds .sw-odds-panel {
    position: absolute; top: 4rem; right: 0; bottom: 0; width: min(420px, 100vw); overflow-y: auto;
    transform: translateX(105%); transition: transform .32s cubic-bezier(.2,.8,.2,1);
}
#sw-odds.open { pointer-events: auto; }
#sw-odds.open .sw-odds-scrim { opacity: 1; }
#sw-odds.open .sw-odds-panel { transform: none; }
/* Closed, the drawer sits off-screen: its loops (the jackpot tier's breath and stars) hold still there (comfort plan phase 3). */
#sw-odds:not(.open) * { animation-play-state: paused !important; }

.sw-tier { position: relative; transition: transform .2s ease, border-color .3s ease; }
.sw-tier.jackpot { animation: swBreathe 3.2s ease-in-out infinite; }
@keyframes swBreathe {
    0%,100% { box-shadow: 0 0 0 0 rgba(251,191,36,0), 0 0 18px rgba(251,191,36,.10); }
    50% { box-shadow: 0 0 0 1px rgba(251,191,36,.35), 0 0 30px rgba(251,191,36,.28); }
}
.sw-tier.hit { border-color: #fbbf24 !important; box-shadow: 0 0 0 2px rgba(251,191,36,.5), 0 0 28px rgba(251,191,36,.35) !important; animation: swHit 1.6s ease-in-out infinite; }
@keyframes swHit { 0%,100% { background-color: rgba(251,191,36,.06); } 50% { background-color: rgba(251,191,36,.16); } }
.sw-tier.hit::after {
    content: ''; position: absolute; inset: -2px; border-radius: 14px; border: 2px solid rgba(251,191,36,.9);
    animation: swRingOut 1.2s ease-out 3; pointer-events: none;
}
@keyframes swRingOut { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(1.06, 1.35); } }
.sw-crown-wrap { position: relative; }
.sw-star { position: absolute; width: 5px; height: 5px; background: #fde68a; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: swFloat 2.6s ease-in-out infinite; }
@keyframes swFloat { 0% { opacity: 0; transform: translateY(4px) scale(.5); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px) scale(1); } }

/* ---------- Celebration dossier (shared with the rewards page's streak grant) ---------- */
.sw-modal { position: fixed; inset: 0; z-index: 70; display: none; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; background: rgba(0,0,0,.78); }
.sw-modal.show { display: flex; }
.sw-dossier { animation: swDrop .7s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes swDrop { from { opacity: 0; transform: translateY(-80px) scale(.94); } to { opacity: 1; transform: none; } }
.sw-amount { animation: swAmount 1.3s ease-in-out infinite; }
@keyframes swAmount { 0%,100% { transform: scale(1); text-shadow: 0 0 18px rgba(251,191,36,.35); } 50% { transform: scale(1.06); text-shadow: 0 0 34px rgba(251,191,36,.7); } }
.sw-shine { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.14) 50%, transparent 65%); transform: translateX(-120%); animation: swSweep 3s ease-in-out .5s infinite; }
@keyframes swSweep { 0% { transform: translateX(-120%); } 55%,100% { transform: translateX(120%); } }

html.calm-motion .sw-jp-edge, html.calm-motion .sw-spark, html.calm-motion #sw-hub.ready, html.calm-motion .sw-tier.jackpot, html.calm-motion .sw-amount, html.calm-motion .sw-shine, html.calm-motion .sw-star, html.calm-motion .sw-led { animation: none !important; }
