:root {
  --bg: #071526;
  --bg-2: #0a1d33;
  --panel: #0e2744;
  --panel-2: #133255;
  --ink: #f7fbff;
  --muted: #d5e4f5;
  --yellow: #ffd34e;
  --yellow-2: #ffe58a;
  --blue: #3d8fd9;
  --blue-2: #7eb8e8;
  --ok: #5bd68a;
  --down: #ff6b6b;
  --line: rgba(255, 211, 78, 0.28);
  --shadow: 0 18px 50px rgba(3, 10, 22, 0.55);
  --sans: "AZP Futura", Futura, "Futura PT", "Century Gothic", Jost, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --focus: 0 0 0 3px var(--bg), 0 0 0 6px var(--yellow);
  --radius: 2px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  font-feature-settings: "ss01" 1;
  background:
    radial-gradient(1200px 500px at 8% -8%, rgba(61, 143, 217, 0.28), transparent 55%),
    radial-gradient(900px 420px at 110% 0%, rgba(255, 211, 78, 0.16), transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, #04101c 100%);
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  z-index: 0;
}

.bg-video {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.bg-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bg-video::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 21, 38, 0.62) 0%, rgba(4, 16, 28, 0.82) 55%, rgba(4, 16, 28, 0.92) 100%);
}
body.home::before { opacity: 0.03; }

code {
  font-family: var(--mono);
  font-size: 0.92em;
  color: var(--yellow-2);
}

a { color: var(--yellow); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--yellow-2); }

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

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 100;
  background: var(--yellow);
  color: var(--bg);
  font-weight: 700;
  padding: 8px 12px;
}
.skip:focus { top: 12px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  margin: 0;
  padding: max(12px, env(safe-area-inset-top, 0px)) max(16px, calc(50vw - 550px)) 12px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}
.brand:hover { color: var(--yellow); }

.mark {
  width: 42px;
  height: 42px;
  border: 2px solid var(--yellow);
  background: linear-gradient(160deg, #1a4a86, #071526);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 3px #071526, 0 0 0 1px #3d8fd9;
}

.mark span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--yellow);
}

.top-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.livecount {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--yellow-2);
  letter-spacing: 0.04em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 14px;
  font-weight: 700;
  flex: 1;
  min-width: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav a.active, .nav a:hover { color: var(--yellow); }
.nav a.active { text-decoration: underline; text-underline-offset: 6px; }

.nav-toggle {
  display: none;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 12px;
  background: transparent;
  color: var(--yellow);
  outline: 2px solid var(--yellow);
  outline-offset: -2px;
  font-family: var(--sans);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 0;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  align-items: center;
  padding: 28px 0 12px;
  min-height: calc(100svh - 120px);
}

h1, h2, h3 { margin: 0 0 10px; letter-spacing: 0.02em; text-transform: uppercase; }
h1 { font-size: clamp(2.1rem, 6vw, 4.1rem); line-height: 0.95; color: var(--ink); }
body.home .hero h1 { text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55); }
body.home .hero p { text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5); }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.15rem; }
p { color: var(--muted); line-height: 1.6; }

.kicker {
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.hero-art {
  margin: 0;
  position: relative;
  min-height: 220px;
}

.hero-art img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.hero-art figcaption {
  margin-top: 8px;
  text-align: right;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--yellow);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.btn, button.copy {
  appearance: none;
  border: 0;
  cursor: pointer;
  background: var(--yellow);
  color: var(--bg);
  font-weight: 800;
  padding: 12px 16px;
  min-height: 44px;
  font-family: var(--sans);
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.btn.ghost, button.copy.ghost {
  background: transparent;
  color: var(--yellow);
  outline: 2px solid var(--yellow);
  outline-offset: -2px;
}

.btn.donate {
  background: var(--yellow);
  color: var(--bg);
}

.btn:hover, button.copy:hover { filter: brightness(1.06); }
.btn:hover { color: var(--bg); }
.btn.ghost:hover, button.copy.ghost:hover {
  color: var(--yellow-2);
  filter: none;
}

.steps {
  list-style: none;
  counter-reset: join;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.steps li {
  counter-increment: join;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 18px;
  box-shadow: var(--shadow);
}
.steps li::before {
  content: counter(join);
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  background: var(--yellow);
  color: var(--bg);
  font-weight: 800;
}
.steps strong { display: block; color: var(--ink); margin-bottom: 6px; text-transform: uppercase; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  padding: 10px 0 40px;
}

.card, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 18px;
  box-shadow: var(--shadow);
}

.card h3 { color: var(--yellow); }

iframe { border: 0; max-width: 100%; }

.ipbox {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  background: var(--panel-2);
  padding: 12px;
  margin: 10px 0;
  font-family: var(--mono);
  color: var(--ink);
}

.list { padding: 8px 0 48px; }
.player {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.player img { width: 32px; height: 32px; image-rendering: pixelated; }
.player .name { font-weight: 800; color: var(--ink); }
.player .meta { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.ghost .name { color: var(--blue-2); }

.page { padding: 18px 0 60px; }
.footer {
  border-top: 1px solid var(--line);
  padding: 22px 0 40px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.footer a { min-height: 44px; display: inline-flex; align-items: center; }

.note {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--yellow);
}

.mapframe {
  overflow: hidden;
  position: relative;
  height: 72vh;
  min-height: 320px;
  padding: 0;
  background: #04101c;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.mapframe.is-dragging { cursor: grabbing; }
.mapframe:focus { outline: none; box-shadow: var(--focus); }
.mapframe img {
  position: absolute;
  left: 0;
  top: 0;
  width: 2048px;
  height: 2048px;
  max-width: none;
  display: block;
  image-rendering: pixelated;
  transform-origin: 0 0;
  pointer-events: none;
  will-change: transform;
}

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  padding: 18px 0 40px;
}
.shot {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.shot img, .shot video {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #04101c;
}
.shot figcaption { padding: 10px 12px 14px; }
.shot figcaption strong { display: block; font-size: 14px; color: var(--ink); }
.shot .meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}
.shot { cursor: pointer; }
.shot:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }

.lite {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(4, 16, 28, 0.92);
  overflow: auto;
  padding: 18px 16px 40px;
}
.lite-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.lite-close {
  float: right;
  margin: 0 0 12px 12px;
}
.lite-inner img,
.lite-inner video {
  display: block;
  width: 100%;
  max-height: 68vh;
  height: auto;
  object-fit: contain;
  background: #04101c;
  image-rendering: auto;
}
.lite-meta {
  margin: 12px 0 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
}
.lite-meta strong { color: var(--ink); display: block; font-family: var(--sans); font-size: 18px; }
.lite-chat {
  margin: 16px 0 0;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
}
.lite-chat h2 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--yellow);
}
.lite-line { margin: 0 0 6px; }
.lite-line .who { color: var(--yellow-2); }
.lite-line .when { color: var(--muted); font-size: 11px; }

.cmp {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 13px;
  margin: 12px 0 18px;
}
.cmp th, .cmp td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.cmp th { color: var(--yellow); font-weight: 700; }
.cmp td:nth-child(n+2) { white-space: nowrap; }
.cmp .off { color: var(--yellow-2); }

pre.config {
  margin: 12px 0 20px;
  padding: 14px 16px;
  overflow-x: auto;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
}
pre.config mark {
  background: rgba(255, 211, 78, 0.18);
  color: var(--yellow-2);
  padding: 0 3px;
  font-weight: 700;
}

.config-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 24px;
}

.rank-block {
  margin: 0 0 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.rank-block summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  min-height: 44px;
}
.rank-block summary::-webkit-details-marker { display: none; }
.rank-block .rank-name { font-weight: 800; }
.rank-block .rank-count { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.rank-block .rank-blurb {
  margin: 0;
  padding: 0 14px 10px;
  color: var(--muted);
  font-size: 13px;
}
.rank-block .rank-people { padding: 0 14px 8px; }
.rank-legend .rank-name { color: #ff5555; }
.rank-untouchable .rank-name { color: #00aa00; }
.rank-hardcore .rank-name { color: #5555ff; }
.rank-deadly .rank-name { color: #aa0000; }
.rank-pyramid .rank-name { color: #aa00aa; }
.rank-pillar .rank-name { color: #aaaaaa; }
.rank-addict .rank-name { color: #ffaa00; }
.rank-veteran .rank-name { color: #55ffff; }
.rank-gamer .rank-name { color: #ff55ff; }
.rank-regular .rank-name { color: #55ff55; }
.rank-peasant .rank-name { color: #ffff55; }


.year-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 18px 0 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.year-jump a {
  color: var(--yellow);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.year-jump a:hover { color: var(--yellow-2); }

.tl-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 28px;
}
.tl-filters .btn {
  padding: 8px 12px;
  font-size: 12px;
}
.tl-filters .btn.is-on {
  background: var(--yellow);
  color: var(--bg);
  outline: 0;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 18px;
  border-left: 2px solid var(--line);
}
.timeline > li {
  position: relative;
  padding: 0 0 28px 22px;
}
.timeline > li::before {
  content: "";
  position: absolute;
  left: -23px;
  top: 6px;
  width: 10px;
  height: 10px;
  background: var(--yellow);
  box-shadow: 0 0 0 3px var(--bg);
}
.timeline .tl-year {
  padding-bottom: 12px;
}
.timeline .tl-year::before {
  top: 12px;
  width: 14px;
  height: 14px;
  left: -25px;
  background: var(--ink);
  outline: 2px solid var(--yellow);
}
.timeline .tl-year h2 {
  margin: 0;
  color: var(--yellow);
}
.timeline time {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--yellow);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.tl-tag {
  display: inline-block;
  margin: 0 0 8px;
  padding: 2px 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--blue);
}
.tl-tag.founding { background: var(--yellow); }
.tl-tag.drama { background: #c45c4a; color: var(--ink); }
.tl-tag.funny { background: var(--blue-2); color: var(--bg); }
.tl-tag.build { background: #3a6b4a; color: var(--ink); }
.tl-tag.server { background: var(--panel-2); color: var(--yellow-2); outline: 1px solid var(--line); }
.timeline h3 {
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  font-size: 1.2rem;
}
.timeline blockquote {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--yellow);
  background: var(--panel);
}
.timeline blockquote p {
  margin: 0;
  color: var(--ink);
  font-style: italic;
}
.timeline blockquote cite {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-style: normal;
  color: var(--yellow);
}

.help-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 28px;
}
.help-toc a {
  color: var(--yellow);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 8px 12px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.help-toc a:hover { color: var(--yellow-2); background: var(--panel-2); }
.help-doc .panel { margin-bottom: 14px; }
.help-doc .panel h2 {
  color: var(--yellow);
  scroll-margin-top: 84px;
}
.help-doc .panel ul {
  color: var(--muted);
  line-height: 1.55;
  padding-left: 1.2em;
  margin: 8px 0 0;
}
.help-doc .panel li { margin: 0.35em 0; }
.help-doc .ingame {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--yellow-2);
  letter-spacing: 0.04em;
  margin: 0 0 8px;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  margin-right: 8px;
  vertical-align: 1px;
}
.status-dot.up { background: var(--ok); box-shadow: 0 0 8px rgba(91, 214, 138, 0.6); }
.status-dot.down, .status-dot.crash-loop { background: var(--down); box-shadow: 0 0 8px rgba(255, 107, 107, 0.55); }
.status-dot.unknown { background: var(--yellow); }

.status-machine {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 140px;
}
.status-machine .state {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--yellow-2);
}
.status-rows {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 28px;
  font-size: 15px;
}
.status-rows th, .status-rows td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.status-rows th {
  color: var(--yellow);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.status-rows .reason {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}
.status-stale { color: var(--yellow); font-family: var(--mono); font-size: 13px; }

@media (max-width: 1100px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    width: 100%;
    flex: none;
    flex-basis: 100%;
  }
  .nav.open {
    display: flex;
    flex-direction: column;
    max-height: calc(100svh - 5.5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .top { align-items: center; }
  .livecount { display: none; }
}

@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .steps { grid-template-columns: 1fr; }
  .timeline { padding-left: 12px; }
  .timeline > li { padding-left: 16px; padding-bottom: 22px; }
}

@media (max-width: 560px) {
  .top-actions .btn.donate { display: none; }
}

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