:root {
    color-scheme: dark;
    --bg: #000;
    --surface: #111;
    --surface-2: #1a1a1a;
    --text: #fff;
    --muted: #d1d5db;
    --border: #6b7280;
    --border-strong: #9ca3af;
    --link: #8bd3ff;
    --visited: #d8b4fe;
    --focus: #ffdd00;
    --danger: #ff7b72;
    --pad: clamp(1rem, 2.5vw, 2rem);
    --page-max: 1600px;
    --content-max: 86ch;
    --radius: .5rem;
    --lh: 1.6;
}

html {
    min-height: 100%;
    background: var(--bg);
    scroll-padding-top: 1rem;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 1rem;
    line-height: var(--lh);
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: 100%;
}

.error-title {
    color: #ff8a80;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

img,
svg,
video,
audio,
canvas,
iframe {
    max-width: 100%;
}

img,
svg,
video,
canvas {
    height: auto;
}

p,
ul,
ol,
dl {
    margin: 0 0 1rem;
}

ul,
ol {
    padding-left: 1.35rem;
}

li {
    margin: .45rem 0;
}

hr {
    margin: 2rem 0;
    border: 0;
    border-top: 1px solid var(--border);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0 0 .75rem;
    color: var(--text);
    font: inherit;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
    scroll-margin-top: 1rem;
}

h1 {
    font-size: clamp(2rem, 5vw, 2.75rem);
}

h2 {
    font-size: clamp(1.45rem, 3vw, 1.8rem);
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.1rem;
}

a {
    color: var(--link);
    text-decoration: underline;
    text-decoration-thickness: .08em;
    text-underline-offset: .16em;
    overflow-wrap: anywhere;
}

a:visited {
    color: var(--visited);
}

a:hover {
    color: #c7edff;
    text-decoration-thickness: .14em;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

::selection {
    background: #fff;
    color: #000;
}

.skip-link {
    position: fixed;
    top: -10rem;
    left: 1rem;
    z-index: 5000;
    padding: .75rem 1rem;
    background: #fff;
    color: #000;
    border: 2px solid #000;
    border-radius: var(--radius);
    font-weight: 700;
}

.skip-link:visited {
    color: #000;
}

.skip-link:focus,
.skip-link:focus-visible {
    top: 1rem;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.muted,
.empty {
    color: var(--muted);
}

.empty {
    font-style: italic;
}

button,
.button,
input,
textarea,
select,
summary {
    font: inherit;
}

button,
.button {
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: .6rem .9rem;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    cursor: pointer;
}

button:hover,
.button:hover {
    background: var(--surface-2);
    border-color: #fff;
}

label {
    display: block;
    margin-bottom: .4rem;
}

input,
textarea,
select {
    width: 100%;
    max-width: 100%;
    min-height: 2.75rem;
    padding: .65rem .75rem;
    background: #000;
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
    opacity: 1;
}

input:disabled,
textarea:disabled,
select:disabled {
    opacity: .7;
    cursor: not-allowed;
}

summary {
    min-height: 2.75rem;
    padding: .65rem .75rem;
    cursor: pointer;
    font-weight: 700;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: .65rem;
    text-align: left;
    vertical-align: top;
    border: 1px solid var(--border);
}

th {
    background: var(--surface-2);
}

code,
pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: .95em;
}

pre {
    max-width: 100%;
    padding: .75rem;
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: var(--page-max);
    min-height: 4.25rem;
    margin: 0 auto;
    padding: .65rem var(--pad);
}

.site-brand {
    flex: 0 0 auto;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .12em;
}

.site-brand-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    color: var(--text);
    text-decoration: none;
}

.site-brand-link:visited {
    color: var(--text);
}

.site-brand-link:hover {
    color: var(--text);
    text-decoration: underline;
}

.site-header-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .25rem;
}

.site-header-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: .55rem .75rem;
    color: var(--text);
    border: 1px solid transparent;
    border-radius: var(--radius);
    text-decoration: none;
}

.site-header-link:visited {
    color: var(--text);
}

.site-header-link:hover {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border);
    text-decoration: underline;
}

.site-main {
    width: 100%;
    max-width: var(--page-max);
    min-height: calc(100vh - 11rem);
    margin: 0 auto;
    padding: 0 var(--pad) 3rem;
}

.site-main:focus-visible {
    outline-offset: -3px;
}

.site-footer {
    background: var(--bg);
    border-top: 1px solid var(--border);
}

.site-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.25rem;
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 1rem var(--pad) 1.5rem;
}

.site-footer-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
}

.container {
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 0 var(--pad);
}

.nav-list {
    display: grid;
    gap: .15rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-item {
    margin: 0;
    min-width: 0;
}

.nav-link,
.nav-text {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding: .5rem .65rem;
    color: var(--muted);
    border: 1px solid transparent;
    border-radius: var(--radius);
    text-decoration: none;
    line-height: 1.35;
}

.nav-link:visited {
    color: var(--muted);
}

.nav-link:hover {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
    text-decoration: underline;
}

.nav-link.is-current {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border-strong);
    border-left: .25rem solid #fff;
    font-weight: 700;
}

.nav-list--nested {
    margin: .25rem 0 .75rem .7rem;
    padding-left: .7rem;
    border-left: 1px solid var(--border);
}

.nav-group {
    display: block;
    margin: 1rem 0 .35rem;
    padding: 0 .65rem;
    color: var(--text);
    font-size: .875rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.docs-not-found {
    max-width: var(--content-max);
    padding: 2rem 0;
}

.docs-shell {
    display: grid;
    grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr) minmax(17rem, 20rem);
    gap: clamp(1rem, 2.5vw, 2rem);
    align-items: start;
    width: 100%;
    padding: 1.5rem 0;
}

.docs-left,
.docs-right {
    position: sticky;
    top: 1rem;
    align-self: start;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.docs-left-inner,
.docs-right-inner {
    padding: .25rem;
}

.docs-right {
    padding-left: 1rem;
    border-left: 1px solid var(--border);
}

.docs-right-inner {
    display: grid;
    gap: 1.5rem;
}

.docs-sidebar-title {
    margin-bottom: .75rem;
    color: var(--text);
    font-size: 1rem;
    letter-spacing: .02em;
}

.docs-mobile-nav,
.docs-mobile-toc {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.docs-mobile-nav-body,
.docs-mobile-toc .docs-otp {
    padding: 0 .75rem .75rem;
}

.docs-main {
    min-width: 0;
    padding: 0 clamp(0rem, 1vw, 1rem);
}

.docs-main:focus-visible {
    outline-offset: .25rem;
}

.docs-breadcrumb {
    margin-bottom: 1rem;
    color: var(--muted);
    font-size: .9rem;
}

.docs-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.docs-breadcrumb li {
    display: inline-flex;
    gap: .5rem;
    min-width: 0;
    margin: 0;
}

.docs-breadcrumb a {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
}

.docs-breadcrumb-sep {
    color: var(--muted);
}

.docs-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.docs-h1 {
    margin-bottom: .5rem;
}

.docs-lead {
    max-width: var(--content-max);
    margin-bottom: .75rem;
    color: var(--muted);
    font-size: 1.05rem;
}

.docs-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .75rem;
}

.docs-action {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: .55rem .8rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    text-decoration: none;
}

.docs-action:visited {
    color: var(--text);
}

.docs-action:hover {
    color: var(--text);
    background: var(--surface-2);
    border-color: #fff;
    text-decoration: underline;
}

.docs-content {
    max-width: var(--content-max);
    padding-bottom: 1rem;
}

.prose h2 {
    margin-top: 2.75rem;
    padding-bottom: .45rem;
    border-bottom: 1px solid var(--border);
}

.prose h3 {
    margin-top: 2rem;
}

.prose h4 {
    margin-top: 1.5rem;
}

.prose p,
.prose ul,
.prose ol {
    margin-bottom: 1.1rem;
}

.prose img {
    display: block;
    height: auto;
    margin: 1rem auto;
    border: 1px solid var(--border);
}

.prose figure {
    margin: 1.5rem 0;
}

.prose figcaption {
    margin-top: .5rem;
    color: var(--muted);
    font-size: .95rem;
    text-align: center;
}

.prose blockquote {
    margin: 1.25rem 0;
    padding: .75rem 1rem;
    background: var(--surface);
    border-left: .25rem solid var(--border-strong);
}

.prose blockquote > :last-child {
    margin-bottom: 0;
}

.prose :not(pre) > code {
    padding: .1rem .3rem;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: .25rem;
    overflow-wrap: anywhere;
}

.video-embed {
    display: block;
    width: 100%;
    height: auto;
    margin: 1.5rem 0;
    aspect-ratio: 16 / 9;
    background: var(--surface);
    border: 1px solid var(--border);
}

.table-scroll {
    max-width: 100%;
    margin: 1rem 0;
    overflow-x: auto;
    border: 1px solid var(--border);
}

.table-scroll table {
    min-width: 36rem;
    margin: 0;
    border: 0;
}

.table-scroll:focus-visible {
    outline-offset: 2px;
}

.animated-media {
    margin: 1rem 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.animated-media img {
    margin: 0 auto 1rem;
}

.docs-footer {
    max-width: var(--content-max);
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.docs-on-this-page {
    min-width: 0;
}

.docs-otp {
    display: grid;
    gap: .15rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.docs-otp-item {
    margin: 0;
}

.docs-otp-link {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding: .45rem .6rem;
    color: var(--muted);
    border-left: .2rem solid transparent;
    text-decoration: none;
    line-height: 1.35;
}

.docs-otp-link:visited {
    color: var(--muted);
}

.docs-otp-link:hover {
    color: var(--text);
    background: var(--surface);
    border-left-color: var(--border-strong);
    text-decoration: underline;
}

.docs-otp-item.is-h3 .docs-otp-link {
    padding-left: 1.2rem;
}

del {
    text-decoration-thickness: .12em;
}

.blazor-error-boundary {
    padding: 1rem;
    background: #5f0000;
    color: #fff;
    border: 2px solid #fff;
}

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

@media (max-width: 1200px) {
    .docs-shell {
        grid-template-columns: minmax(12rem, 14rem) minmax(0, 1fr);
    }

    .docs-right {
        position: static;
        grid-column: 2;
        max-height: none;
        padding: 1.5rem 0 0;
        overflow: visible;
        border-top: 1px solid var(--border);
        border-left: 0;
    }

    .docs-on-this-page {
        display: none;
    }

    .docs-mobile-toc {
        display: block;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 860px) {
    .docs-shell {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
    }

    .docs-left {
        display: none;
    }

    .docs-mobile-nav {
        display: block;
    }

    .docs-main,
    .docs-right {
        grid-column: 1;
    }

    .docs-main {
        padding: 0;
    }

    .docs-right--toc-only {
        display: none;
    }
}

@media (max-width: 600px) {
    :root {
        --pad: 1rem;
    }

    .site-header-inner {
        flex-wrap: wrap;
        min-height: auto;
    }

    .site-header-nav {
        flex: 1 1 auto;
    }

    .docs-actions,
    .site-footer-nav {
        align-items: stretch;
    }

    .docs-action {
        justify-content: center;
    }

    .table-scroll table {
        min-width: 30rem;
    }
}

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

@media (prefers-contrast: more) {
    :root {
        --border: #9ca3af;
        --border-strong: #fff;
    }
}

@media (forced-colors: active) {
    :focus-visible {
        outline-color: Highlight;
    }

    button,
    .button,
    input,
    textarea,
    select,
    .docs-action,
    .nav-link,
    .game-card {
        border: 1px solid ButtonText;
    }
}

@media print {
    .skip-link,
    .site-header-nav,
    .site-footer,
    .docs-left,
    .docs-right,
    .docs-mobile-nav,
    .docs-mobile-toc,
    .docs-actions {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .site-header {
        border-color: #000;
    }

    .site-brand-link,
    a,
    a:visited,
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        color: #000;
    }

    .site-main,
    .docs-shell {
        max-width: none;
        padding: 0;
    }

    .docs-shell {
        display: block;
    }
}
