/*----------------------------------------------------------------
//  global.css
//
//  Changelog:
//      Paulinchen  2026-10-16: Created
//
//----------------------------------------------------------------*/

/*-----------------------------------
/   Fonts
/-----------------------------------*/
/* Served from this site, so a visit never tells a font host who is reading. */
@font-face {
    font-display: swap;
    font-family: "Cinzel";
    font-style: normal;
    font-weight: 400 900;
    src: url("../fonts/cinzel-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-display: swap;
    font-family: "Cinzel";
    font-style: normal;
    font-weight: 400 900;
    src: url("../fonts/cinzel-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-display: swap;
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    src: url("../fonts/inter-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-display: swap;
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    src: url("../fonts/inter-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/*-----------------------------------
/   Shared tokens
/-----------------------------------*/
:root {
    /* Featured worlds, as the game and the admin tool colour them. */
    --mgq-gold: #e8b85c;
    /* Raid Worlds. */
    --mgq-crimson: #ff5d78;
    --mgq-radius-lg: 16px;
    --mgq-glow: 0 0 0 1px color-mix(in srgb, var(--mud-palette-primary) 35%, transparent),
                0 12px 40px -12px color-mix(in srgb, var(--mud-palette-primary) 45%, transparent);
}

/*-----------------------------------
/   Page background
/-----------------------------------*/
/* A faint violet sky behind every page; the cards stay readable on top of it. */
.mud-layout {
    background:
        radial-gradient(1200px 600px at 85% -10%, color-mix(in srgb, var(--mud-palette-primary) 16%, transparent), transparent 70%),
        radial-gradient(900px 500px at -10% 10%, color-mix(in srgb, var(--mud-palette-tertiary) 9%, transparent), transparent 70%),
        var(--mud-palette-background);
    min-height: 100vh;
}

/*-----------------------------------
/   Focus
/-----------------------------------*/
:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* FocusOnNavigate moves focus to the heading for screen readers; no visitor tabbed there. */
h1:focus,
h1:focus-visible {
    outline: none;
}

/*-----------------------------------
/   Screen reader only
/-----------------------------------*/
.mgq-visually-hidden {
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

/*-----------------------------------
/   Reduced motion
/-----------------------------------*/
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/*-----------------------------------
/   Character gallery
/-----------------------------------*/
/* A rule rather than an inline style, so the page scrolls again even when the open detail dialog
   is removed without closing, as it is when the visitor leaves the gallery. */
html:has(.mgq-gallery__dialog[open]) {
    overflow: hidden;
}

/*-----------------------------------
/   Blazor Error UI
/-----------------------------------*/
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    font: inherit;
    padding: 0;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
