:root {
  color-scheme: dark;
  --bg: #181818;
  --panel: #232323;
  --panel-soft: #2b2b2b;
  --text: #f1eee8;
  --muted: #aaa59d;
  --line: #44413d;
  --accent: #e59836;
  --accent-hover: #ffb04f;
  --good: #77c987;
  --warn: #e7b65b;
  --bad: #e07a70;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; color: var(--text); background: var(--bg); line-height: 1.55; }
a { color: var(--accent); text-decoration-thickness: .08em; text-underline-offset: .16em; }
a:hover { color: var(--accent-hover); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
h1, h2, h3 { line-height: 1.15; }
h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 1rem; }
h2 { margin-top: 2.25rem; }
code, pre { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
code { overflow-wrap: anywhere; }

.shell { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); background: #151515; }
.nav { display: flex; align-items: center; min-height: 64px; gap: 1.25rem; }
.brand { display: inline-flex; align-items: center; gap: .45rem; margin-right: auto; color: var(--text); font-weight: 750; font-size: 1.2rem; line-height: 1; text-decoration: none; }
.brand-title { position: relative; top: -1px; color: var(--text); }
.brand-title span { color: var(--accent); }
.brand-mark { width: 2rem; height: 2rem; flex: none; }
.nav-links { display: flex; gap: .9rem; flex-wrap: wrap; }
.nav-links a { color: var(--muted); text-decoration: none; }
.nav-links a:hover { color: var(--text); }
main { padding-block: 2.5rem 4rem; min-height: calc(100vh - 130px); }
.site-footer { padding: 1.5rem 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }

.hero { padding: 3rem 0 1rem; }
.hero p { max-width: 700px; color: var(--muted); font-size: 1.12rem; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin: 2rem 0; }
.stat, .panel, .result-card, .map-card { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; }
.stat { padding: 1rem; }
.stat strong { display: block; color: var(--accent); font-size: 1.5rem; }
.stat span, .muted { color: var(--muted); }
.panel { padding: 1.25rem; }

.command { display: flex; gap: .5rem; align-items: stretch; margin: .75rem 0; }
.command pre { margin: 0; flex: 1; padding: .85rem 1rem; overflow-x: auto; background: #101010; border: 1px solid var(--line); border-radius: 5px; }
button, .button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: .55rem .9rem;
  border: 1px solid #b56d18;
  border-radius: 5px;
  background: #9a5912;
  color: white;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button:hover { background: #b56d18; color: white; }
.button.secondary { background: transparent; border-color: var(--line); color: var(--text); }
.button.disabled { pointer-events: none; opacity: .55; }

.filters { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: .75rem; align-items: end; margin-bottom: 1.25rem; }
.cpu-filters { grid-template-columns: repeat(6, minmax(120px, 1fr)); }
label { display: grid; gap: .3rem; color: var(--muted); font-size: .9rem; }
.filter-field { display: grid; gap: .3rem; }
.version-picker { position: relative; }
.version-picker input { padding-right: 2.65rem; }
.version-toggle {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 2.5rem;
  min-height: calc(100% - 2px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}
.version-toggle:hover { background: var(--panel-soft); color: var(--text); }
.version-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + .3rem);
  left: 0;
  width: 100%;
  max-height: min(32rem, 65vh);
  overflow-y: auto;
  padding: .3rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #121212;
  box-shadow: 0 .75rem 2rem #0009;
}
.version-menu[hidden] { display: none; }
.version-option {
  display: flex;
  width: 100%;
  min-height: 34px;
  justify-content: flex-start;
  padding: .35rem .55rem;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--text);
  font-size: .9rem;
  font-weight: 600;
}
.version-option[hidden] { display: none; }
.version-option:hover, .version-option:focus-visible, .version-option[aria-selected="true"] { background: var(--panel-soft); }
input, select, textarea {
  width: 100%;
  padding: .62rem .7rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #121212;
  color: var(--text);
  font: inherit;
}
textarea { resize: vertical; }
.helptext { color: var(--muted); font-size: .88rem; }
.errorlist, .errors { color: #ffaaa2; }

.result-list { display: grid; gap: .75rem; }
.result-card { position: relative; padding: 1rem 1.2rem; }
.result-card h2, .result-card h3 { margin: 0 7rem .4rem 0; font-size: 1.25rem; }
.result-card p { margin: .25rem 0; }
.result-card time { position: absolute; right: 1.2rem; top: 1.1rem; color: var(--muted); font-size: .85rem; }
.module-list { margin: .5rem 0 0; padding: .45rem .75rem; list-style: none; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); }

.map-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.map-card { overflow: hidden; }
.map-card img, .map-placeholder { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #101010; }
.map-placeholder { display: grid; place-items: center; color: var(--muted); }
.map-body { padding: 1rem; }
.map-body h2 { font-size: 1.1rem; margin: 0 0 .4rem; }
.map-body h2 a { display: block; }
.map-body p { margin: .4rem 0; }
.badge { display: inline-block; padding: .15rem .48rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .78rem; }
.badge.available, .badge.ready { color: var(--good); }
.badge.missing, .badge.failed, .badge.quarantined, .badge.rejected { color: var(--bad); }
.badge.pending, .badge.pending_worker, .badge.pending_mods, .badge.pending_validation, .badge.processing, .badge.queued, .badge.rendering { color: var(--warn); }

.map-heading { display: grid; grid-template-columns: minmax(240px, 420px) 1fr; gap: 1.5rem; }
.map-heading img, .detail-placeholder { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line); border-radius: 7px; background: #101010; }
.detail-placeholder { display: grid; place-items: center; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: .65rem; margin: 1rem 0; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: .7rem .65rem; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .86rem; }
.number { text-align: right; font-variant-numeric: tabular-nums; }
.table-sort { display: block; color: inherit; text-decoration: none; }
.table-sort:hover { color: var(--text); }
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; }

@media (max-width: 800px) {
  .nav { align-items: flex-start; padding-block: .9rem; }
  .nav-links { justify-content: flex-end; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-heading { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; }
}

@media (max-width: 520px) {
  .nav { display: block; }
  .nav-links { margin-top: .7rem; }
  .stats, .filters, .map-grid { grid-template-columns: 1fr; }
  .result-card time { position: static; display: block; margin-bottom: .3rem; }
  .result-card h2, .result-card h3 { margin-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
