/* Keep FocusOnNavigate (Routes.razor) for screen readers, but hide the outline on the page heading. */
h1:focus,
h1:focus-visible {
    outline: none;
}

/* Every other keyboard-focused control keeps a clearly visible ring on the dark theme. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:not(h1):focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* File input hidden inside a styled label; the label keeps keyboard focus via the input. */
.visually-hidden-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.avatar-upload, .image-upload {
    position: relative;
    cursor: pointer;
    padding: 5px 15px;
}

    .avatar-upload:focus-within, .image-upload:focus-within {
        outline: 2px solid var(--mud-palette-primary);
        outline-offset: 2px;
    }

/* Brand in the app bar */
.brand-link { display: inline-flex; align-items: center; gap: 10px; }
.brand-logo { border-radius: 7px; display: block; }

/* Store and library tiles */
.game-card { height: 100%; display: flex; flex-direction: column; }
.game-card-link { display: block; }
.game-card-cover { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #0e141b; }
.game-card-cover-empty { display: flex; align-items: center; justify-content: center; color: var(--mud-palette-text-secondary); }
.game-card-title { font-weight: 500; }
.game-card-description { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Game page */
.game-hero-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--mud-default-borderradius); background: #0e141b; }
.game-description { white-space: pre-line; }
.screenshot-thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--mud-default-borderradius); cursor: zoom-in; }
.screenshot-large { width: 100%; height: auto; border-radius: var(--mud-default-borderradius); }

/* Achievements (game page, profile, developer editor) */
.achievement-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.achievement-row { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: var(--mud-default-borderradius); background: var(--mud-palette-surface); }
.achievement-row.locked .achievement-icon { filter: grayscale(1); opacity: .45; }
.achievement-icon { flex: 0 0 56px; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: #0e141b; overflow: hidden; }
.achievement-icon img { width: 100%; height: 100%; object-fit: cover; }
.achievement-icon .mud-icon-root { font-size: 32px; color: var(--mud-palette-warning); }
.achievement-text { flex: 1 1 auto; min-width: 0; }
.achievement-meta { flex: 0 0 auto; text-align: right; }
.achievement-progress { max-width: 260px; }
.achievement-icon-small { width: 40px; height: 40px; flex-basis: 40px; }

/* Friends and presence */
.presence { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--mud-palette-text-secondary); }
.presence-dot { width: 9px; height: 9px; border-radius: 50%; background: #6b7682; flex: 0 0 9px; }
.presence-online { color: #66c0f4; }
.presence-online .presence-dot { background: #66c0f4; }
.presence-ingame { color: #a3cf4b; }
.presence-ingame .presence-dot { background: #a3cf4b; }
.person-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.person-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--mud-default-borderradius); background: var(--mud-palette-surface); }
.person-row .person-name { flex: 1 1 auto; min-width: 0; }
.compare-table td, .compare-table th { vertical-align: middle; }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

#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 {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }
