/* ==========================================================================
   RuneCake — floating prize-wheel shortcut + wheel lustre
   The floating control mirrors the Live Support button's placement and feel.
   ========================================================================== */

/* ---------- Floating wheel shortcut ---------- */
#rs-wheel-fab {
    position: fixed;
    right: 18px;
    bottom: 76px; /* directly above the Live Support pill */
    z-index: 898;
    width: 58px;
    height: 58px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid #f5e6be;
    background:
        radial-gradient(circle at 34% 28%, rgba(255, 250, 220, 0.42), transparent 55%),
        linear-gradient(145deg, #4a2c20, #140c07);
    cursor: pointer;
    display: grid;
    place-items: center;
    overflow: visible;
    box-shadow:
        inset 0 0 0 2px rgba(20, 12, 7, 0.85),
        0 8px 22px rgba(0, 0, 0, 0.6),
        0 0 18px rgba(212, 175, 55, 0.42);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s, opacity 0.25s;
}

/* Soft outer halo that breathes like polished gold catching candlelight. */
#rs-wheel-fab::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid rgba(255, 236, 170, 0.55);
    box-shadow: 0 0 22px rgba(255, 214, 110, 0.35);
    pointer-events: none;
    animation: rsWheelHalo 3.4s ease-in-out infinite;
}

/* Rotating specular sheen — the "lustre". */
#rs-wheel-fab::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: conic-gradient(from 0deg,
        transparent 0deg,
        rgba(255, 250, 225, 0.02) 24deg,
        rgba(255, 250, 225, 0.34) 42deg,
        rgba(255, 250, 225, 0.02) 60deg,
        transparent 120deg,
        transparent 360deg);
    mix-blend-mode: screen;
    pointer-events: none;
    animation: rsWheelSheen 5s linear infinite;
}

#rs-wheel-fab .rs-wheel-art {
    width: 46px;
    height: 46px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.7));
    animation: rsWheelTurn 36s linear infinite;
}

#rs-wheel-fab .rs-wheel-tip {
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    transform: translate(6px, -50%);
    white-space: nowrap;
    padding: 0.38rem 0.65rem;
    border: 1px solid var(--gold, #d4af37);
    background: linear-gradient(145deg, #2d1810, #140c07);
    color: var(--parchment, #f0e68c);
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

#rs-wheel-fab:hover .rs-wheel-tip,
#rs-wheel-fab:focus-visible .rs-wheel-tip {
    opacity: 1;
    visibility: visible;
    transform: translate(0, -50%);
}

#rs-wheel-fab:hover,
#rs-wheel-fab:focus-visible {
    transform: translateY(-3px) scale(1.05);
    box-shadow:
        inset 0 0 0 2px rgba(20, 12, 7, 0.85),
        0 12px 26px rgba(0, 0, 0, 0.65),
        0 0 30px rgba(255, 214, 110, 0.75);
}

#rs-wheel-fab:hover .rs-wheel-art { animation-duration: 5s; }

/* Step aside when the support chat panel is open so the two never overlap. */
body:has(#rs-support-panel.open) #rs-wheel-fab,
body:has(#rs-support-panel.open) #rs-to-top {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);
}

/* The wheel page already shows a large wheel — no need for the shortcut. */
body.rs-wheel-page #rs-wheel-fab { display: none; }

@keyframes rsWheelHalo {
    0%, 100% { opacity: 0.55; transform: scale(0.97); }
    50% { opacity: 1; transform: scale(1.03); }
}

@keyframes rsWheelSheen {
    to { transform: rotate(360deg); }
}

@keyframes rsWheelTurn {
    to { transform: rotate(360deg); }
}

/* ---------- Lustre on the full wheel (/wheel) ---------- */
.wheel-stage { isolation: isolate; }

/* A slow light sweep across the whole disc. */
.wheel-stage::before {
    content: '';
    position: absolute;
    inset: 3.5%;
    z-index: 3;
    border-radius: 50%;
    background: conic-gradient(from 0deg,
        transparent 0deg,
        rgba(255, 248, 214, 0.03) 26deg,
        rgba(255, 248, 214, 0.22) 44deg,
        rgba(255, 248, 214, 0.03) 62deg,
        transparent 120deg,
        transparent 360deg);
    mix-blend-mode: screen;
    pointer-events: none;
    animation: rsWheelSheen 7s linear infinite;
}

/* A fixed specular glint in the upper-left, like glass under a lamp. */
.wheel-stage::after {
    content: '';
    position: absolute;
    inset: 3.5%;
    z-index: 4;
    border-radius: 50%;
    background:
        radial-gradient(ellipse 44% 26% at 30% 16%, rgba(255, 255, 240, 0.28), transparent 70%),
        radial-gradient(ellipse 24% 14% at 72% 86%, rgba(255, 226, 150, 0.10), transparent 72%);
    pointer-events: none;
}

.wheel-stage .wheel-glow {
    box-shadow:
        0 0 70px rgba(212, 175, 55, 0.42),
        0 0 26px rgba(255, 226, 150, 0.28),
        inset 0 0 46px rgba(255, 230, 160, 0.16);
    animation: rsWheelBreathe 3.8s ease-in-out infinite;
}

@keyframes rsWheelBreathe {
    0%, 100% { opacity: 0.78; transform: scale(0.99); }
    50% { opacity: 1; transform: scale(1.015); }
}

/* Rim bulbs twinkle out of phase. */
#wheelLights circle { animation: rsBulbTwinkle 2.1s ease-in-out infinite; }
#wheelLights circle:nth-child(2n) { animation-delay: 0.5s; }
#wheelLights circle:nth-child(3n) { animation-delay: 1s; }

@keyframes rsBulbTwinkle {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@media (max-width: 620px) {
    #rs-wheel-fab {
        right: 14px;
        bottom: 72px;
        width: 52px;
        height: 52px;
    }

    #rs-wheel-fab .rs-wheel-art { width: 42px; height: 42px; }
    #rs-wheel-fab .rs-wheel-tip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    #rs-wheel-fab::before,
    #rs-wheel-fab::after,
    #rs-wheel-fab .rs-wheel-art,
    .wheel-stage::before,
    .wheel-stage .wheel-glow,
    #wheelLights circle { animation: none; }

    #rs-wheel-fab::after { opacity: 0.5; }
}
