/* Rubidus website styles. Colours, radii and the focus ring are tokens: change them here. */
:root {
    color-scheme: dark;
    --bg: #09090B;
    --panel: #18181B;
    --raised: #27272A;
    --line: #27272A;
    --line-strong: #52525B;
    --field-line: #71717A;
    --text: #F4F4F5;
    --muted: #A1A1AA;
    --accent: #E11D48;
    --danger: #FB7185;
    --ok: #4ADE80;
    --warn: #FBBF24;
    --action: #248046;
    --action-hover: #1A6334;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }

/* Base */
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1.0625rem/1.7 var(--font); }
a { color: inherit; text-underline-offset: .3125rem; }
a:hover { color: var(--accent); }

/* Page frame */
.skip {
    position: absolute;
    left: 1.25rem;
    top: -6.25rem;
    background: var(--text);
    color: var(--bg);
    padding: .625rem;
    z-index: 5;
}
.skip:focus { top: .625rem; }
header, main, footer { max-width: 77.5rem; margin: auto; padding: 0 3rem; }
header {
    height: 7rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    border-bottom: 1px solid var(--line);
}
.brand {
    font-weight: 800;
    letter-spacing: .18em;
    text-decoration: none;
    font-size: 1rem;
    display: flex;
    gap: .75rem;
    align-items: center;
}
.mark { width: 2.75rem; height: 2.75rem; object-fit: contain; }
nav { display: flex; gap: 1.75rem; align-items: center; font-size: .875rem; }
nav a { text-decoration: none; }
.nav-login {
    border: 1px solid var(--line);
    padding: .5625rem 1.125rem;
    border-radius: var(--radius-sm);
}

/* Home */
.hero {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
    gap: 2.75rem;
    min-height: 38.75rem;
    padding: 5rem 0;
}
.eyebrow, .number {
    color: var(--accent);
    font-size: .6875rem;
    font-weight: 750;
    letter-spacing: .18em;
}
.eyebrow { margin: 0 0 1.5rem; }
h1 {
    font-size: clamp(2.625rem,5.2vw,4.25rem);
    line-height: 1.06;
    letter-spacing: -.055em;
    font-weight: 650;
    margin: 0 0 1.75rem;
}
h1 em { font-style: normal; color: var(--accent); }
.lead { font-size: 1.1875rem; line-height: 1.7; color: var(--muted); max-width: 35.625rem; }
.actions {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin: 2.125rem 0 1rem;
}

/* Buttons and links */
.button, button {
    display: inline-block;
    background: var(--action);
    color: #fff;
    border: 0;
    border-radius: var(--radius-sm);
    padding: .875rem 1.375rem;
    font: 700 .875rem/1.6 var(--font);
    text-decoration: none;
    cursor: pointer;
}
.button:hover, button:hover { background: var(--action-hover); color: #fff; }
/* Variants: add to a <button>, or alongside .button on a link. The inset shadow draws the
   outline so every variant keeps the same size. */
.button-secondary, .button-danger { background: transparent; }
.button-secondary { color: var(--text); box-shadow: inset 0 0 0 1px var(--field-line); }
.button-danger { color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.button-secondary:hover { background: var(--raised); color: var(--text); }
.button-danger:hover { background: var(--accent); color: #fff; box-shadow: none; }
.text-link { font-size: .875rem; }
.note { font-size: .75rem; color: var(--muted); }

/* Home artwork */
.orbit {
    height: 24.375rem;
    position: relative;
    display: grid;
    place-items: center;
    background: radial-gradient(ellipse,var(--raised) 0%,transparent 65%);
}
.orbit-ring {
    position: absolute;
    width: 20rem;
    height: 20rem;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    transform: rotate(-28deg) scaleY(.6);
}
.orbit-ring:after {
    content: '';
    position: absolute;
    inset: -2.1875rem;
    border: 1px solid var(--line);
    border-radius: 50%;
}
.orbit-core {
    width: 13.75rem;
    height: 13.75rem;
    object-fit: contain;
    filter: drop-shadow(0 1.5rem 2.1875rem #0008);
}
.orbit-label {
    position: absolute;
    font-size: .5625rem;
    letter-spacing: .2em;
    color: var(--muted);
}
.top { top: 1.875rem; right: 1.875rem; }
.bottom { bottom: 1.5625rem; left: 1.5625rem; }

/* Home cards */
.principles { padding: 1.25rem 0 5.625rem; }
.cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.125rem; }
.card {
    padding: 1.875rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    text-decoration: none;
    display: flex;
    flex-direction: column;
}
.card:hover { border-color: var(--accent); color: var(--text); }
.card h2 {
    font-size: 1.6875rem;
    line-height: 1.2;
    letter-spacing: -.035em;
    margin: 1.75rem 0 .875rem;
}
.card p { font-size: .875rem; color: var(--muted); margin: 0 0 1.5rem; }
.arrow { font-size: .75rem; color: var(--accent); margin-top: auto; }

/* Footer */
footer {
    border-top: 1px solid var(--line);
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
}
footer p, footer small { color: var(--muted); font-size: .75rem; margin: 0; }
footer div { display: flex; gap: 1.5rem; font-size: .75rem; grid-column: 2; grid-row: 1; }
footer small { grid-column: 2; grid-row: 2; }

/* Articles */
.legal { max-width: 51.25rem; margin: 4.375rem auto 6.25rem; }
.legal h1 { font-size: 3.5rem; }
.legal h2 { font-size: 1.4375rem; margin: 2.625rem 0 .75rem; }
.legal p, .legal li { color: var(--muted); }
.legal .eyebrow { color: var(--accent); }
.legal strong { color: var(--text); }

/* Notices */
.draft, .notice {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--panel);
    padding: 1.125rem 1.375rem;
    font-size: .875rem;
    margin: 2rem 0;
}
.draft p { margin: .375rem 0 0; }

/* Messages: pages mark errors with role='alert' and other notices with role='status'. */
[role='alert'], [role='status'] {
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--muted);
    border-radius: var(--radius-sm);
    background: var(--panel);
    padding: .75rem 1rem;
    margin: 1.25rem 0;
    font-size: .9375rem;
}
[role='alert'], [role='status'], .legal [role='alert'], .legal [role='status'] { color: var(--text); }
[role='alert'] { border-left-color: var(--danger); }
[role='status'].saved { border-left-color: var(--ok); }
[role='alert'] > :first-child, [role='status'] > :first-child { margin-top: 0; }
[role='alert'] > :last-child, [role='status'] > :last-child { margin-bottom: 0; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
td, th {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
th { color: var(--accent); }
td { color: var(--muted); }

/* Sign-in */
.login-panel { max-width: 40.625rem; text-align: center; margin: 5.625rem auto 6.875rem; }
.login-panel .lead { margin-inline: auto; }
.login-panel .actions { justify-content: center; }
.login-box {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin: 2.25rem 0;
}
.login-box h2 { font-size: 1.4375rem; }
.login-box>p { color: var(--muted); font-size: .9375rem; }
code { font-family: ui-monospace,monospace; }
@media (max-width: 800px) {
    header, main, footer { padding-left: 1.5rem; padding-right: 1.5rem; }
    header {
        height: auto;
        padding-top: 1.375rem;
        padding-bottom: 1.375rem;
        flex-wrap: wrap;
        gap: 1.125rem;
    }
    nav { gap: 1rem; flex-wrap: wrap; font-size: .75rem; }
    .hero { grid-template-columns: 1fr; padding: 3.4375rem 0; gap: .625rem; }
    .orbit { height: 17.5rem; }
    .orbit-ring { width: 15.625rem; height: 15.625rem; }
    .cards { grid-template-columns: 1fr; }
    .card h2 br { display: none; }
    .legal h1 { font-size: 2.625rem; }
    .legal { margin-top: 2.8125rem; }
    footer { grid-template-columns: 1fr; gap: 1.125rem; }
    footer div, footer small { grid-column: auto; grid-row: auto; }
    .login-panel { margin-top: 3.4375rem; }
    .login-box { padding: 1.375rem; }
}

/* Forms */
.request-form label, .settings-form label { display: block; margin: 1.5rem 0; font-size: .875rem; }
.request-form input, .request-form select, .request-form textarea,
.settings-form input, .settings-form select, .settings-form textarea {
    display: block;
    width: 100%;
    margin-top: .5rem;
    background: var(--panel);
    border: 1px solid var(--field-line);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: .75rem;
    font: inherit;
}

.settings-form .permission-options { display: grid; gap: .5rem; padding: 1rem; border: 1px solid var(--border); border-radius: .75rem; }
.settings-form .permission-options h3 { margin: .5rem 0 0; }
.settings-form .permission-options label { display: flex; align-items: center; gap: .5rem; margin: .25rem 0; }
.settings-form .permission-options input[type="checkbox"] { width: auto; min-height: 0; margin: 0; padding: 0; accent-color: var(--accent); }

.request-form button, .settings-form button { margin: 0 .75rem .5rem 0; }

/* Settings pages: the signed-in pages for one server, one bot or the account. They share the
   server picker's frame and left edge; text and forms keep a readable measure. */
.settings { max-width: 72rem; margin: 2rem auto 5rem; }
.settings > * { max-width: 44rem; }
.settings h1 { font-size: clamp(1.65rem, 4vw, 2.4rem); margin-bottom: 1.25rem; }
.settings h2 { font-size: 1.2rem; margin: 2.25rem 0 .75rem; }
.settings p, .settings li, .settings dd { color: var(--muted); }
.settings strong, .settings dt { color: var(--text); }
.settings [role='alert'], .settings [role='status'] { color: var(--text); }
.settings .eyebrow { color: var(--accent); }
.settings dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; margin: 1rem 0; }
.settings dt { font-size: .875rem; }
.settings dd { margin: 0; overflow-wrap: anywhere; }
.settings-form { margin: 1.25rem 0; }
.crumbs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; font-size: .875rem; color: var(--muted); }
.crumbs a { overflow-wrap: anywhere; }
/* Command management: a summary, links to each group, a filter, then one panel per group
   with a row per command. Each group saves on its own. */
.settings.commands > * { max-width: 52rem; }
.commands-summary { margin: 0 0 1rem; }
.group-jump { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: .5rem; padding: .6rem 0; background: var(--bg); }
.group-jump a {
    padding: .3rem .7rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-size: .8125rem;
    text-decoration: none;
    white-space: nowrap;
}
.group-jump a:hover { border-color: var(--text); color: var(--text); }
.group-jump span { color: var(--muted); margin-left: .2rem; }
.command-filter { margin: 1rem 0 .5rem; }
.command-filter label { font-size: .9rem; }
.command-filter input { width: 100%; min-width: 0; background: var(--panel); color: var(--text); border: 1px solid var(--field-line); border-radius: var(--radius-sm); padding: .5rem .75rem; font: inherit; }
.command-default, .command-group { margin: 1.25rem 0; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--panel); }
.command-default { padding: 1rem 1.1rem; }
.command-default h2 { margin-top: 0; }
.command-default select, .command-list select, .group-bulk select { background: var(--bg); }
.command-group { scroll-margin-top: 4rem; }
.command-default { scroll-margin-top: 4rem; }
.command-group summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; padding: .9rem 1.1rem; cursor: pointer; list-style: none; }
.command-group summary::-webkit-details-marker { display: none; }
.command-group summary::before { content: '▸'; color: var(--muted); }
.command-group[open] summary::before { content: '▾'; }
.command-group[open] summary { border-bottom: 1px solid var(--line); }
.group-name { font-size: 1.1rem; font-weight: 650; }
.group-count { font-size: .8125rem; color: var(--muted); }
.command-group .settings-form { margin: 0; padding: .25rem 1.1rem 1rem; }
.group-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .75rem 0; margin: 0; border-bottom: 1px solid var(--line); }
.settings-form .group-bulk select, .settings-form .command-list select { display: inline-block; width: auto; max-width: 100%; margin: 0; padding: .45rem .6rem; }
.command-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.command-list li { display: grid; grid-template-columns: minmax(9rem, 1fr) minmax(8rem, 1fr) auto; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.command-list code { color: var(--text); overflow-wrap: anywhere; }
.command-state { font-size: .8125rem; color: var(--muted); }
.command-state.set { color: var(--text); }
.command-state.set::before { content: ''; display: inline-block; width: .45rem; height: .45rem; margin-right: .4rem; border-radius: 50%; background: var(--accent); }
@media (max-width: 560px) {
    .command-list li { grid-template-columns: 1fr auto; }
    .command-list select { grid-column: 1 / -1; width: 100%; }
    .settings-form .command-list select { width: 100%; }
    .group-jump { position: static; }
}

/* A member's linked game accounts: a panel per game, a row per account. */
.account-game { margin: 1.25rem 0; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--panel); padding: .25rem 1.1rem; }
.account-game h2 { margin: .9rem 0 .25rem; }
.account-links { list-style: none; margin: 0; padding: 0; }
.account-links li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; padding: .8rem 0; border-top: 1px solid var(--line); }
.account-link-name { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; min-width: 0; }
.account-link-name strong { overflow-wrap: anywhere; }
.account-link-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.account-link-actions form { margin: 0; }
.account-link-actions .button, .account-link-actions button { padding: .5rem .9rem; }
.tag { padding: .1rem .5rem; border: 1px solid var(--field-line); border-radius: 999px; font-size: .75rem; color: var(--text); }

/* A bot's menu: one row per settings page. */
.settings-menu { list-style: none; margin: 1.25rem 0; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--panel); }
.settings-menu li + li { border-top: 1px solid var(--line); }
.settings-menu a { display: block; padding: .85rem 1rem; color: var(--text); text-decoration: none; }
.settings-menu a::after { content: '›'; float: right; color: var(--muted); }
.settings-menu a:hover { background: var(--raised); color: var(--text); }
.settings-menu a:focus-visible { outline-offset: -3px; }

/* Signed-in navigation */
.nav-account {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-width: 0;
    max-width: 100%;
}
.nav-account img { border-radius: 50%; }
.nav-account span { overflow-wrap: anywhere; }

/* Server picker */
.portal { margin: 2rem auto; max-width: 72rem; }
.portal h1 { font-size: clamp(1.65rem, 4vw, 2.4rem); margin-bottom: 1.25rem; }
.portal h2 { font-size: 1.2rem; }
.portal-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 1rem 1.5rem;
    margin-block: 1.25rem;
}
.portal-tools > a { min-height: 2.75rem; align-content: center; }
.portal-tools form { flex: 0 1 30rem; min-width: 0; }
.portal-tools label { font-size: .9rem; }
.portal-search { display: flex; gap: .5rem; }
.portal-search input {
    width: 100%;
    min-width: 0;
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--field-line);
    border-radius: var(--radius-sm);
    padding: .5rem .75rem;
    font: inherit;
}
.portal-search input, .portal-search button { min-height: 2.75rem; }
.portal-search button, .portal-card .button { padding: .55rem .9rem; }
.portal-group { margin-block: 1.75rem; }
.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
    gap: 1rem;
}
.portal-card {
    min-width: 0;
    overflow: hidden;
    background: var(--panel);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
}
.portal-card-body { padding: .8rem 1rem 1rem; }
.portal-card h2, .portal-card h3 {
    font-size: 1.1rem;
    margin: .4rem 0 .25rem;
    overflow-wrap: anywhere;
}
.portal-card p { margin: 0 0 .75rem; }
/* Bot state on a server page. The marker shape differs as well as its colour. */
.state { display: flex; align-items: center; gap: .45rem; font-size: .875rem; color: var(--muted); }
.state::before {
    content: '';
    flex: none;
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    background: var(--warn);
}
.state-ok { color: var(--text); }
.state-ok::before { background: var(--ok); }
.state-off::before { background: transparent; box-shadow: inset 0 0 0 1px var(--muted); }
.state-unknown::before { border-radius: 1px; }
.portal-banner, .portal-icon {
    overflow: hidden;
    background: var(--raised) url('/logo-small.png') center / 2.2rem no-repeat;
}
.portal-banner { aspect-ratio: 3 / 1; background-size: 3rem; }
.portal-icon {
    width: 3rem;
    height: 3rem;
    margin: -.8rem 0 0 1rem;
    position: relative;
    border: 2px solid var(--panel);
    border-radius: var(--radius-md);
}
.portal-server-art { max-width: 28rem; margin-block: 1rem; }
.portal-server-art .portal-banner { border-radius: var(--radius-lg); }
.portal-banner { position: relative; }
.portal-art { display: block; position: relative; width: 100%; height: 100%; object-fit: cover; }
/* A still that fails to load would show the browser's broken-image mark; cover it with the
   placeholder. Pseudo-elements only render on an image that did not load. */
.portal-art::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--raised) url('/logo-small.png') center / 2.2rem no-repeat;
}
/* Animated artwork lies over the still and is not rendered until it is wanted. A lazy image
   that is not rendered is not downloaded, so an idle list costs nothing. */
.portal-art-motion { display: none; position: absolute; inset: 0; }
@media (prefers-reduced-motion: no-preference) {
    .portal-grid .portal-card:hover .portal-art-motion,
    .portal-grid .portal-card:focus-within .portal-art-motion,
    .portal-server-art .portal-art-motion { display: block; }
}
.portal-refresh { margin-left: .75rem; font-size: .875rem; }
@media (max-width: 560px) {
    .settings dl { grid-template-columns: 1fr; gap: .1rem; }
    .settings dd { margin-bottom: .6rem; }
    .portal-tools { align-items: start; }
    .portal-tools form { flex-basis: 100%; }
}
.portal-banner-note { display: none; color: var(--muted); }
.portal-server-art:has([data-banner-status="unavailable"]) .portal-banner-note { display: block; }

/* One look for every drop-down, whatever the browser's own control would do. Safari ignores
   padding on a native select, which made them thinner than the text fields beside them. */
select {
    -webkit-appearance: none;
    appearance: none;
    background-color: var(--panel);
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: right 1.05rem center, right .75rem center;
    background-size: .3rem .3rem, .3rem .3rem;
    background-repeat: no-repeat;
    border: 1px solid var(--field-line);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    line-height: 1.5;
    padding: .75rem 2.25rem .75rem .75rem;
    min-height: 3rem;
    text-overflow: ellipsis;
}
.settings-form select, .request-form select { padding-right: 2.25rem; }
.settings-form .group-bulk select, .settings-form .command-list select { padding: .45rem 2rem .45rem .6rem; min-height: 0; }
.command-default select, .command-list select, .group-bulk select { background-color: var(--bg); }

/* Bricks: one bordered panel per game launcher or hub. */
.launcher-grid, .hub-grid { list-style: none; margin: 1.25rem 0 2rem; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.launcher-brick, .hub-brick { border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--panel); overflow: hidden; display: flex; flex-direction: column; }
.launcher-brick[aria-current='true'] { border-color: var(--accent); }
.launcher-art { display: block; width: 100%; height: auto; aspect-ratio: 2160 / 562; object-fit: cover; background: var(--raised); border-bottom: 1px solid var(--line); }
.launcher-body, .hub-brick { padding: 1rem; }
.launcher-body { display: flex; flex-direction: column; flex: 1; }
.launcher-body h3, .hub-brick h3 { margin: 0 0 .5rem; font-size: 1.1rem; }
.launcher-body .state { margin: 0 0 .75rem; }
.launcher-facts { display: grid; grid-template-columns: auto 1fr; gap: .25rem .75rem; margin: 0 0 1rem; font-size: .875rem; }
.launcher-facts dt { color: var(--muted); }
.launcher-facts dd { margin: 0; overflow-wrap: anywhere; }
.launcher-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: auto 0 0; font-size: .875rem; }
.launcher-actions .button { margin: 0; }
.hub-fact { color: var(--muted); font-size: .875rem; margin: 0 0 .75rem; }
.hub-members { list-style: none; margin: 0 0 1rem; padding: 0; font-size: .9rem; }
.hub-members li { padding: .65rem 0; border-top: 1px solid var(--line); }
.hub-members .state { margin-left: .35rem; }
.steps { padding-left: 1.25rem; }
.steps li { margin: .35rem 0; }

/* Home: the four bots. */
.bots { padding: 0 0 4rem; }
.bots-title { font-size: clamp(1.6rem, 3vw, 2.25rem); letter-spacing: -.03em; margin: .5rem 0 1.5rem; }
.bot-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.125rem; }
.bot { border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--panel); padding: 1.75rem; }
.bot h3 { font-size: 1.5rem; line-height: 1.15; letter-spacing: -.02em; margin: .9rem 0 .6rem; }
.bot p { font-size: .9rem; color: var(--muted); margin: 0 0 1rem; }
.bot ul { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.bot ul li { padding: .55rem 0 .55rem 1.1rem; border-top: 1px solid var(--line); position: relative; }
.bot ul li::before { content: ''; position: absolute; left: 0; top: 1.1rem; width: .35rem; height: .35rem; border-radius: 50%; background: var(--accent); }
@media (max-width: 760px) { .bot-grid { grid-template-columns: 1fr; } }

/* Destiny 2 stats. A dashboard in the shadcn/ui idiom, built from plain HTML and CSS: zinc
   surfaces with hairline borders, a segmented tab list, KPI cards (muted label over a large
   tabular figure), and chart cards with a dashed grid. Ruby is kept for the data itself. */
.settings.stats { max-width: 66rem; --ruby: #E11D2E; --ruby-deep: #9F1224; --surface: #09090B; --surface-2: #0F0F12; --muted-surface: #18181B; --border: #27272A; --fg: #FAFAFA; --fg-muted: #A1A1AA; }
.settings.stats > * { max-width: 62.5rem; }
.badge { display: inline-flex; align-items: center; border: 1px solid var(--border, var(--line-strong)); border-radius: 99rem; padding: .125rem .625rem; font-size: .75rem; font-weight: 600; color: var(--fg-muted, var(--muted)); line-height: 1.4; }
.stat-state { margin: .75rem 0 0; }
.stat-guardian { margin-top: .75rem; padding: 0 0 1.25rem; border-bottom: 1px solid var(--border); }
.stat-guardian .eyebrow { color: var(--fg-muted); letter-spacing: .08em; }
.stat-guardian h1 { margin: .25rem 0; font-size: 1.875rem; font-weight: 600; letter-spacing: -.025em; }
.stat-sub { color: var(--fg-muted); margin: 0; font-size: .875rem; }
.stat-sub b { color: var(--fg); font-weight: 600; }
/* Account switcher and section links: shadcn's tab list, a muted well holding pill triggers. */
.stat-accounts, .stat-nav { display: inline-flex; flex-wrap: wrap; gap: .125rem; margin: 1rem 0 0; padding: .25rem; list-style: none; background: var(--muted-surface); border-radius: .625rem; }
.stat-accounts a, .stat-nav a { display: block; padding: .375rem .75rem; border-radius: .425rem; color: var(--fg-muted); text-decoration: none; font-size: .875rem; font-weight: 500; white-space: nowrap; }
.stat-accounts [aria-current], .stat-nav a:hover, .stat-accounts a:hover { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,.5); }
.stat-nav { position: sticky; top: .5rem; z-index: 2; box-shadow: 0 0 0 1px var(--border); }
.dash { position: relative; overflow: hidden; isolation: isolate; margin-top: 1.5rem; padding: 1.5rem; border-radius: .75rem; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(0,0,0,.4); scroll-margin-top: 4rem; }
.dash-head h2 { font-size: 1.125rem; font-weight: 600; letter-spacing: -.015em; color: var(--fg); margin: 0; }
.dash-head p { font-size: .875rem; color: var(--fg-muted); margin: .125rem 0 1.25rem; }
.dash h3 { font-size: .875rem; font-weight: 500; color: var(--fg); margin: 1.5rem 0 .625rem; display: flex; align-items: center; gap: .75rem; }
.dash h3::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.dash-heading { margin-top: 2.5rem; scroll-margin-top: 4rem; font-size: 1.125rem; font-weight: 600; }
#sherpa { scroll-margin-top: 4rem; }
/* Bungie's artwork for the most-run activity, as a dim band behind the card header. */
.dash-art { position: absolute; inset: 0 0 auto 0; height: 7.5rem; z-index: -1; opacity: .3; }
.dash-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dash-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9,9,11,.1), var(--surface)); }
/* KPI cards: label first, figure beneath. The markup keeps value-then-label, so reverse it. */
.stats .dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .75rem; margin: 0; }
.stats .dash-cards div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: .375rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: .75rem; padding: 1rem; min-height: 5.25rem; }
.stats .dash-cards dt { font-size: .8125rem; font-weight: 500; color: var(--fg-muted); margin: 0; }
.stats .dash-cards dd { margin: 0; font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; color: var(--fg); font-variant-numeric: tabular-nums; line-height: 1.15; overflow-wrap: anywhere; }
/* The lead figure of each card row carries the ruby accent. */
.stats .dash-cards div:first-child { border-color: rgba(225,29,46,.35); background: linear-gradient(180deg, rgba(225,29,46,.10), var(--surface-2) 70%); }
.stats .dash-cards div:first-child dd { font-size: 1.875rem; }
.dash-chart { margin: .75rem 0 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: .75rem; padding: 1rem 1rem 1.125rem; }
.dash-chart figcaption { font-size: .875rem; font-weight: 500; color: var(--fg); margin-bottom: 1rem; }
.dash-bars { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(3.25rem, 5.5rem); justify-content: start; gap: .75rem; overflow-x: auto; }
.dash-bars li { display: grid; grid-template-rows: auto 11rem auto; gap: .5rem; text-align: center; min-width: 0; }
.dash-val { font-size: .75rem; font-weight: 500; color: var(--fg); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Dashed horizontal grid lines at each quarter, as a chart's cartesian grid. */
.dash-track { position: relative; border-bottom: 1px solid var(--border); background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(25% - 1px), rgba(161,161,170,.16) calc(25% - 1px), rgba(161,161,170,.16) 25%); }
.dash-bar { position: absolute; inset: auto 12% 0 12%; border-radius: .375rem .375rem 0 0; background: linear-gradient(180deg, var(--ruby), var(--ruby-deep)); transform-origin: bottom; }
.dash-bars li:hover .dash-bar { filter: brightness(1.2); }
.dash-label { font-size: .6875rem; color: var(--fg-muted); line-height: 1.25; overflow-wrap: anywhere; }
.dash-bar.h-0{height:0%}.dash-bar.h-5{height:5%}.dash-bar.h-10{height:10%}.dash-bar.h-15{height:15%}.dash-bar.h-20{height:20%}.dash-bar.h-25{height:25%}.dash-bar.h-30{height:30%}.dash-bar.h-35{height:35%}.dash-bar.h-40{height:40%}.dash-bar.h-45{height:45%}.dash-bar.h-50{height:50%}.dash-bar.h-55{height:55%}.dash-bar.h-60{height:60%}.dash-bar.h-65{height:65%}.dash-bar.h-70{height:70%}.dash-bar.h-75{height:75%}.dash-bar.h-80{height:80%}.dash-bar.h-85{height:85%}.dash-bar.h-90{height:90%}.dash-bar.h-95{height:95%}.dash-bar.h-100{height:100%}
@media (max-width: 640px) { .dash { padding: 1rem; } .dash-bars li { grid-template-rows: auto 8rem auto; } .stat-nav { position: static; } }
/* Plays once when the page opens, then rests on the final state. */
@media (prefers-reduced-motion: no-preference) {
    .stat-guardian > *, .dash-head > *, .dash-cards div { animation: dash-rise .5s cubic-bezier(.2,.7,.2,1) both; }
    .dash-cards div:nth-child(2) { animation-delay: .05s; }
    .dash-cards div:nth-child(3) { animation-delay: .1s; }
    .dash-cards div:nth-child(4) { animation-delay: .15s; }
    .dash-cards div:nth-child(5) { animation-delay: .2s; }
    .dash-cards div:nth-child(6) { animation-delay: .25s; }
    .dash-cards div:nth-child(7) { animation-delay: .3s; }
    .dash-bar { animation: dash-grow .9s cubic-bezier(.2,.7,.2,1) .3s both; }
    .dash-bars li:nth-child(2) .dash-bar { animation-delay: .36s; }
    .dash-bars li:nth-child(3) .dash-bar { animation-delay: .42s; }
    .dash-bars li:nth-child(4) .dash-bar { animation-delay: .48s; }
    .dash-bars li:nth-child(5) .dash-bar { animation-delay: .54s; }
    .dash-bars li:nth-child(n+6) .dash-bar { animation-delay: .6s; }
    .dash-val { animation: dash-rise .4s ease-out .9s both; }
    .dash-art { animation: dash-fade 1.4s ease-out both; }
}
@keyframes dash-rise { from { opacity: 0; transform: translateY(.5rem); } to { opacity: 1; transform: none; } }
@keyframes dash-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes dash-fade { from { opacity: 0; } to { opacity: .3; } }

/* Stats pages: the current tab, translucent cards over the panel artwork, and the weapon list. */
.stat-nav [aria-current] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,.5); }
.stat-nav { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; }
.dash { background: rgba(9,9,11,.72); }
.dash-art { height: 100%; opacity: .34; }
.dash-art::after { background: linear-gradient(180deg, rgba(9,9,11,.15) 0%, rgba(9,9,11,.82) 60%, rgba(9,9,11,.96) 100%); }
.stats .dash-cards div { background: rgba(24,24,27,.42); border-color: rgba(255,255,255,.10); -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2); }
.stats .dash-cards div:first-child { background: linear-gradient(180deg, rgba(225,29,46,.18), rgba(24,24,27,.42) 75%); border-color: rgba(225,29,46,.45); }
.dash-chart { background: rgba(24,24,27,.42); border-color: rgba(255,255,255,.10); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.weapon-list { list-style: none; margin: 0; padding: 0; }
.weapon-list li { display: grid; grid-template-columns: 1.75rem 3rem minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: .875rem; row-gap: .5rem; align-items: center; padding: .875rem 0; border-top: 1px solid rgba(255,255,255,.08); }
.weapon-list li:first-child { border-top: 0; }
.weapon-rank { color: var(--fg-muted); font-size: .8125rem; font-variant-numeric: tabular-nums; text-align: right; }
.weapon-list img, .weapon-blank { width: 3rem; height: 3rem; border-radius: .5rem; border: 1px solid var(--border); background: var(--muted-surface); display: block; }
.weapon-name, .weapon-figures { display: flex; flex-direction: column; min-width: 0; }
.weapon-name b { font-weight: 600; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.weapon-figures { text-align: right; }
.weapon-figures b { font-size: 1.125rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--fg); }
.weapon-list small { color: var(--fg-muted); font-size: .75rem; }
.weapon-bar { grid-column: 3 / -1; height: .3rem; border-radius: 99rem; background: rgba(161,161,170,.16); overflow: hidden; }
.weapon-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--ruby-deep), var(--ruby)); transform-origin: left; }
.weapon-bar .w-0{width:0%}.weapon-bar .w-5{width:5%}.weapon-bar .w-10{width:10%}.weapon-bar .w-15{width:15%}.weapon-bar .w-20{width:20%}.weapon-bar .w-25{width:25%}.weapon-bar .w-30{width:30%}.weapon-bar .w-35{width:35%}.weapon-bar .w-40{width:40%}.weapon-bar .w-45{width:45%}.weapon-bar .w-50{width:50%}.weapon-bar .w-55{width:55%}.weapon-bar .w-60{width:60%}.weapon-bar .w-65{width:65%}.weapon-bar .w-70{width:70%}.weapon-bar .w-75{width:75%}.weapon-bar .w-80{width:80%}.weapon-bar .w-85{width:85%}.weapon-bar .w-90{width:90%}.weapon-bar .w-95{width:95%}.weapon-bar .w-100{width:100%}
@media (prefers-reduced-motion: no-preference) {
    .weapon-list li { animation: dash-rise .45s cubic-bezier(.2,.7,.2,1) both; }
    .weapon-list li:nth-child(2) { animation-delay: .04s; } .weapon-list li:nth-child(3) { animation-delay: .08s; }
    .weapon-list li:nth-child(4) { animation-delay: .12s; } .weapon-list li:nth-child(n+5) { animation-delay: .16s; }
    .weapon-bar span { animation: weapon-grow .9s cubic-bezier(.2,.7,.2,1) .25s both; }
}
@keyframes weapon-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes dash-fade { from { opacity: 0; } to { opacity: .34; } }
.settings.stats .stat-nav { position: static; flex-wrap: wrap; overflow: visible; }

/* Per-place cards: each raid, strike or map under its own Bungie artwork. */
.place-grid { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.place { position: relative; overflow: hidden; isolation: isolate; border: 1px solid var(--border); border-radius: .75rem; background: var(--surface); min-height: 13.5rem; display: flex; flex-direction: column; justify-content: flex-end; }
.place-art { position: absolute; inset: 0; z-index: -1; background: linear-gradient(135deg, #1c1c22, var(--surface)); }
.place-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.place-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9,9,11,.05) 0%, rgba(9,9,11,.55) 45%, rgba(9,9,11,.94) 100%); }
.place-body { padding: 1rem; }
.place-body h3 { margin: 0 0 .625rem; font-size: 1rem; font-weight: 600; color: var(--fg); letter-spacing: -.01em; text-shadow: 0 1px 8px rgba(0,0,0,.7); }
.stats .place-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin: 0; }
.stats .place-facts div { background: rgba(24,24,27,.45); border: 1px solid rgba(255,255,255,.10); border-radius: .5rem; padding: .5rem .625rem; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.stats .place-facts dt { font-size: .6875rem; color: var(--fg-muted); margin: 0; }
.stats .place-facts dd { margin: .125rem 0 0; font-size: 1rem; font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; }
.stats .place-facts div:first-child { grid-column: 1 / -1; border-color: rgba(225,29,46,.45); background: linear-gradient(90deg, rgba(225,29,46,.20), rgba(24,24,27,.45)); }
.stats .place-facts div:first-child dd { font-size: 1.5rem; }
@media (prefers-reduced-motion: no-preference) {
    .place { animation: dash-rise .5s cubic-bezier(.2,.7,.2,1) both; }
    .place:nth-child(2) { animation-delay: .05s; } .place:nth-child(3) { animation-delay: .1s; }
    .place:nth-child(4) { animation-delay: .15s; } .place:nth-child(n+5) { animation-delay: .2s; }
    .place-art img { animation: place-push 2.4s cubic-bezier(.16,.7,.2,1) both; }
}
@keyframes place-push { from { transform: scale(1.12); } to { transform: scale(1); } }
.place-body { padding-top: 6.5rem; }
