/* Tirradyn desktop cursors */
@media (hover: hover) and (pointer: fine) {
    body {
        cursor: url('/assets/cursors/small-shield.png') 8 8, auto;
    }

    a,
    button,
    .btn,
    input[type="submit"],
    input[type="button"],
    [role="button"] {
        cursor: url('/assets/cursors/small-sword.png') 2 2, pointer;
    }
}

/* Tirradyn scrollbar */
html {
    scrollbar-width: thin;
    scrollbar-color: #7e3a8a #09050d;
}

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #09050d;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #9b5aa0, #54245f);
    border: 2px solid #d4af37;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #d4af37, #8b4b96);
}

::-webkit-scrollbar-corner {
    background: #09050d;
}

/* Footer and sitemap navigation */
.footer-link,
.sitemap-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.footer-link {
    justify-content: center;
}

.sitemap-link {
    padding: 0.65rem 0.75rem;
    border-radius: 0.375rem;
    transition: background-color 150ms ease, color 150ms ease;
}

.sitemap-link:hover,
.sitemap-link:focus-visible {
    background: rgba(126, 58, 138, 0.18);
}

/* Give touch users a comfortable target without enlarging desktop links. */
@media (hover: none), (pointer: coarse) {
    .footer-link {
        min-height: 44px;
        padding: 0.5rem 0.4rem;
    }

    .sitemap-link {
        min-height: 44px;
    }
}

/* Shared Back-to-Top control for long pages. */
.back-to-top {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 40;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 48px;
    min-height: 48px;
    padding: 0.65rem 0.85rem;
    border: 1px solid rgba(126, 58, 138, 0.9);
    border-radius: 9999px;
    background: rgba(9, 5, 13, 0.88);
    color: #67e8f9;
    font-weight: 700;
    line-height: 1;
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.75rem);
    pointer-events: none;
    transition:
        opacity 180ms ease,
        transform 180ms ease,
        visibility 180ms ease,
        color 150ms ease,
        border-color 150ms ease,
        background-color 150ms ease;
}

.back-to-top.is-visible {
    opacity: 0.82;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover,
.back-to-top:focus-visible {
    opacity: 1;
    color: #fde047;
    border-color: #fde047;
    background: rgba(20, 10, 24, 0.96);
}

.back-to-top:focus-visible {
    outline: 2px solid #fde047;
    outline-offset: 3px;
}

@media (max-width: 639px) {
    .back-to-top {
        width: 48px;
        height: 48px;
        padding: 0;
        font-size: 1.25rem;
    }

    .back-to-top-label {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .back-to-top {
        transition: none;
    }
}
