:root {
  --bg: #1e1f22;
  --surface: #2b2d31;
  --surface-raised: #313338;
  --line: #3f4147;
  --text: #f2f3f5;
  --muted: #b5bac1;
  --accent: #39ff14;
  --accent-ink: #10240a;
  --mention-bg: rgba(88, 101, 242, 0.3);
  --mention-text: #c9cdfb;
  --link: #8dff70;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.6 var(--font); }
img { max-width: 100%; }
a { color: var(--link); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .9em; background: #1a1b1e; padding: .1em .35em; border-radius: 4px; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.muted { color: var(--muted); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: .5rem; background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; border-radius: 6px; z-index: 20; }
.skip-link:focus { left: .5rem; }

.btn { display: inline-block; padding: .7rem 1.2rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-raised); color: var(--text); font-weight: 600; text-decoration: none; transition: transform .12s, background .12s; }
.btn:hover { background: var(--line); transform: translateY(-1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #6bff4d; }
.btn-small { padding: .4rem .85rem; font-size: .95rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.site-header { position: sticky; top: 0; z-index: 10; background: rgba(30, 31, 34, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.site-header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; padding-block: .6rem; }
.brand { display: flex; align-items: center; gap: .55rem; color: var(--text); font-weight: 800; font-size: 1.2rem; text-decoration: none; }
.brand img { border-radius: 9px; }
.version { font-size: .72rem; font-weight: 700; color: var(--accent); border: 1px solid var(--accent); border-radius: 99px; padding: 0 .45em; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; }
.site-nav a:not(.btn) { color: var(--muted); text-decoration: none; font-weight: 600; padding-block: .25rem; }
.site-nav a:not(.btn):hover, .site-nav a[aria-current] { color: var(--text); }
.site-nav a[aria-current] { box-shadow: inset 0 -2px 0 var(--accent); }

.hero { padding-block: clamp(2.5rem, 6vw, 5rem); background: radial-gradient(60rem 28rem at 15% -10%, rgba(57, 255, 20, .16), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; align-items: center; gap: clamp(2rem, 5vw, 4rem); }
.hero-logo { border-radius: 24px; box-shadow: 0 0 44px rgba(57, 255, 20, .35); margin-bottom: 1.25rem; display: block; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -.02em; }

.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section-alt { background: #232428; }
.section-lead { color: var(--muted); margin-bottom: 2rem; font-size: 1.1rem; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1rem; }
.feature-card { display: block; padding: 1.4rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; transition: transform .12s, border-color .12s; }
.feature-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.feature-card p { color: var(--muted); margin: 0; }
.feature-emoji { font-size: 1.9rem; display: block; margin-bottom: .5rem; }
.showcase { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; align-items: start; }

.dc-window { background: var(--surface-raised); border-radius: var(--radius); padding: 1rem; border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0, 0, 0, .3); display: grid; gap: 1rem; min-width: 0; }
.dc-message { display: flex; gap: .75rem; min-width: 0; }
.dc-avatar { border-radius: 50%; flex: none; }
.dc-body { min-width: 0; flex: 1; }
.dc-author { font-weight: 600; margin: 0 0 .25rem; }
.dc-tag { background: #5865f2; color: #fff; font-size: .62rem; font-weight: 700; border-radius: 3px; padding: .05em .35em; vertical-align: middle; }
.dc-embed { background: var(--surface); border-left: 4px solid var(--accent); border-radius: 4px; padding: .7rem .9rem; font-size: .93rem; }
.dc-embed p { margin: 0 0 .5em; }
.dc-link { color: #00a8fc; }
.dc-title { font-weight: 700; }
.dc-field { font-weight: 700; margin-top: .6em !important; margin-bottom: .1em !important; }
.dc-footer { color: var(--muted); font-size: .75rem; margin: .5em 0 0 !important; }
.dc-mention { background: var(--mention-bg); color: var(--mention-text); border-radius: 3px; padding: 0 .2em; }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 2rem 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.steps li { counter-increment: step; padding: 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 2rem; height: 2rem; margin-bottom: .7rem; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.steps p { color: var(--muted); margin: 0; }
.note { padding: .85rem 1.1rem; border-left: 4px solid #f0b232; background: var(--surface); border-radius: 4px; }
.cta { padding-block: 3.5rem; text-align: center; background: linear-gradient(180deg, transparent, rgba(57, 255, 20, .12)); }
.cta .actions { justify-content: center; }

.page-head { padding-block: clamp(2rem, 5vw, 3.5rem) 1.5rem; background: radial-gradient(50rem 18rem at 10% -20%, rgba(57, 255, 20, .13), transparent 70%); }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 800; }
.page-body { padding-block: 1rem 4rem; }

.command-tools { position: sticky; top: 3.6rem; z-index: 5; background: var(--bg); padding-block: .75rem; }
#command-search { width: 100%; padding: .7rem 1rem; margin-bottom: .75rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { padding: .2rem .7rem; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; font-size: .9rem; }
.chip:hover { border-color: var(--accent); }
.command-group { margin-top: 2.25rem; scroll-margin-top: 11rem; }
.command-group h2 { margin-bottom: .1em; }
.command { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: .5rem; scroll-margin-top: 11rem; }
.command[open] { border-color: var(--accent); }
.command summary { display: grid; grid-template-columns: minmax(10rem, max-content) 1fr auto; gap: .25rem 1rem; align-items: baseline; padding: .7rem 1rem; cursor: pointer; }
.command-name { color: var(--accent); background: none; padding: 0; font-weight: 700; }
.command-summary { color: var(--muted); font-size: .95rem; }
.command-short { color: var(--muted); }
.command-body { padding: 0 1rem 1rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.command dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; }
.command dt { color: var(--muted); font-weight: 600; }
.command dd { margin: 0; min-width: 0; }
code.block { display: block; width: fit-content; max-width: 100%; margin-bottom: .3rem; }

.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.tab { font: inherit; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .5rem 1rem; cursor: pointer; }
.tab[aria-selected="true"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.board-table { width: 100%; border-collapse: collapse; background: var(--surface); font-variant-numeric: tabular-nums; }
.board-table th, .board-table td { padding: .6rem .9rem; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
.board-table tr:last-child td { border-bottom: 0; }
.board-table th { background: var(--surface-raised); font-size: .9rem; }
.board-table th button { all: unset; cursor: pointer; font-weight: 700; color: var(--text); }
.board-table th button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.board-table th[aria-sort] button { color: var(--accent); }
.board-table .rank { text-align: center; width: 3rem; }
.board-table .player { text-align: left; font-weight: 600; }

.version-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.6rem; margin-bottom: 1rem; }
.version-card:first-of-type { border-color: var(--accent); }
.version-card h2 { color: var(--accent); font-size: 1.5rem; }
.version-card ul { padding-left: 1.2rem; margin: 0; }
.version-card li { margin-bottom: .4rem; }
.version-card ins { text-decoration: none; font-weight: 700; }

.site-footer { border-top: 1px solid var(--line); padding-block: 1.75rem; font-size: .92rem; }
.site-footer p { margin-bottom: .3em; }

@media (max-width: 820px) {
  .site-header { position: static; }
  .site-nav { gap: .25rem .8rem; font-size: .95rem; }
  .board-table { font-size: .85rem; }
  .board-table th, .board-table td { padding: .55rem .5rem; }
  .board-table .rank { width: 2.25rem; }
  .board-table td.player { max-width: 8rem; overflow: hidden; text-overflow: ellipsis; }
  html { scroll-padding-top: 1rem; }
  .command, .command-group { scroll-margin-top: 1rem; }
  .hero-grid { grid-template-columns: 1fr; }
  .command-tools { position: static; }
  .command summary { grid-template-columns: 1fr auto; }
  .command-summary { grid-column: 1 / -1; grid-row: 2; }
  .command dl { grid-template-columns: 1fr; gap: .1rem; }
  .command dd { margin-bottom: .6rem; }
}
