/* Royal Armies — gauntlet pointer cursor + fingertip click burst */
/* Native cursor hide rules are injected last via custom-cursor.js (beats #id .class pointer rules). */

/* Scrollbars use OS pointer hit targets; hide them while gauntlet is active (wheel scroll still works). */
html.royal-armies-custom-cursor,
html.royal-armies-custom-cursor * {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

html.royal-armies-custom-cursor *::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}

#royal-armies-custom-cursor {
    position: fixed;
    left: 0;
    top: 0;
    width: 56px;
    height: 56px;
    margin: 0;
    padding: 0;
    pointer-events: none;
    z-index: 2147483647;
    opacity: 0;
    transition: opacity 0.08s ease;
    will-change: left, top;
}

#royal-armies-custom-cursor.is-visible {
    opacity: 1;
}

.royal-armies-cursor-stack {
    position: relative;
    width: 56px;
    height: 56px;
    /* Shared knuckle pivot — palm and fingertip layer rotate together on click. */
    transform-origin: 14px 11px;
    transition: transform 0.08s ease;
}

.royal-armies-cursor-hand,
.royal-armies-cursor-finger {
    display: block;
    width: 56px;
    height: 56px;
    image-rendering: auto;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

#royal-armies-custom-cursor.is-clicking .royal-armies-cursor-stack {
    transform: rotate(-4deg);
}

/* Palm + gauntlet body — fingertip tip is drawn on the finger layer only. */
.royal-armies-cursor-hand {
    clip-path: polygon(
        18px 0,
        56px 0,
        56px 56px,
        0 56px,
        0 14px,
        18px 14px
    );
}

/* Index fingertip only — small clip high on the sprite; subtle press on click. */
.royal-armies-cursor-finger {
    position: absolute;
    left: 0;
    top: 0;
    clip-path: inset(0 calc(100% - 18px) calc(100% - 14px) 0);
    /* Pivot near the knuckle so the tip dips downward on click, not the palm end. */
    transform-origin: 14px 11px;
    transition: transform 0.08s ease, filter 0.08s ease;
}

#royal-armies-custom-cursor.is-clicking .royal-armies-cursor-finger {
    transform: rotate(-13deg) translateY(3px) scale(0.94);
    filter: brightness(1.08);
}

#cursor-click-fx-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2147483646;
    overflow: visible;
}

.cursor-fingertip-click-burst {
    position: fixed;
    width: 12px;
    height: 12px;
    margin-left: -6px;
    margin-top: -6px;
    border-radius: 50%;
    pointer-events: none;
    border: 2px solid rgba(232, 197, 71, 0.95);
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.75) 0%,
        rgba(201, 162, 39, 0.35) 45%,
        transparent 72%
    );
    box-shadow:
        0 0 6px rgba(241, 224, 172, 0.85),
        0 0 14px rgba(201, 162, 39, 0.45);
    animation: cursor-fingertip-click-burst 0.45s ease-out forwards;
}

.cursor-fingertip-click-burst::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 4px;
    height: 4px;
    margin: -2px 0 0 -2px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 4px #f1e0ac;
}

@keyframes cursor-fingertip-click-burst {
    0% {
        transform: scale(0.4);
        opacity: 1;
    }
    70% {
        opacity: 0.55;
    }
    100% {
        transform: scale(2.6);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .royal-armies-cursor-stack,
    .royal-armies-cursor-finger {
        transition: none;
    }

    #royal-armies-custom-cursor.is-clicking .royal-armies-cursor-stack {
        transform: rotate(-2deg);
    }

    #royal-armies-custom-cursor.is-clicking .royal-armies-cursor-finger {
        transform: rotate(-7deg) translateY(2px) scale(0.96);
    }

    .cursor-fingertip-click-burst {
        animation-duration: 0.2s;
    }
}
