/* Night Collective: sodium street light on a city at night.
   One memorable thing: the licence plate that carries the live player count.
   Everything else stays quiet: indigo night, warm sodium amber for actions,
   condensed signage type for headings, a plain sans for reading. */

:root {
  --night: #10142e;        /* the sky over the city */
  --block: #181e40;        /* a raised surface: tables, panels */
  --line: #2b3366;         /* rules and outlines */
  --ink: #ece8f7;          /* reading text */
  --dim: #a3a8cf;          /* secondary text */
  --sodium: #ffae2b;       /* street light: actions, highlights */
  --sodium-ink: #241400;   /* text on sodium */
  --tail: #ff4b5c;         /* tail lights: danger, bans */
  --go: #5fe0a8;           /* online */
  --plate: #f3f1ea;        /* the plate's face */
  --plate-ink: #1d3a8f;    /* its stamped characters */
  --plate-red: #c8202f;    /* its state line */
  --display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 68ch;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
}
a { color: var(--ink); text-decoration-color: var(--sodium); text-underline-offset: 3px; }
a:hover { color: var(--sodium); }
:focus-visible { outline: 3px solid var(--sodium); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; display: block; }
code { font: 500 0.92em ui-monospace, "Cascadia Mono", Consolas, monospace; color: #cfd6ff; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 560px) { .wrap { padding: 0 16px; } }

/* ---- header ---- */
.top { display: flex; align-items: center; gap: 24px; padding-top: 20px; padding-bottom: 20px; }
.mark {
  font: 800 26px/1 var(--display);
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--ink);
}
.mark:hover { color: var(--ink); }
.top .logo { display: block; flex: none; border-radius: 8px; }
.top .logo img { display: block; width: 40px; height: 40px; }
.top nav { display: flex; gap: 24px; flex-wrap: wrap; }
.top nav a { text-decoration: none; color: var(--dim); font-weight: 600; font-size: 15px; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--ink); }
.top nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--sodium); text-decoration-thickness: 2px; text-underline-offset: 6px; }
@media (max-width: 560px) { .top nav { gap: 16px; } }

/* ---- type ---- */
h1, h2, h3 { font-family: var(--display); line-height: 1.05; margin: 0; }
h1 { font-weight: 900; }
h2 { font-weight: 800; font-size: clamp(32px, 4.4vw, 48px); margin-bottom: 18px; }
h3 { font-weight: 700; font-size: 24px; margin-bottom: 6px; }
p { margin: 0 0 1em; max-width: var(--measure); }
.lede { font-size: 20px; color: var(--ink); max-width: 34ch; }
.dim { color: var(--dim); }
.small { font-size: 14px; }

section { padding: 72px 0; border-top: 1px solid var(--line); }
@media (max-width: 560px) { section { padding: 52px 0; } }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 700 16px/1 var(--body);
  padding: 13px 20px;
  border-radius: 6px;
  border: 2px solid var(--sodium);
  background: var(--sodium); color: var(--sodium-ink);
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: #ffc35c; border-color: #ffc35c; color: var(--sodium-ink); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--sodium); color: var(--sodium); }
.btn.danger { background: transparent; color: var(--tail); border-color: color-mix(in srgb, var(--tail) 55%, transparent); }
.btn.danger:hover { background: var(--tail); color: #fff; border-color: var(--tail); }
.btn.small { padding: 7px 12px; font-size: 14px; border-width: 1.5px; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---- the plate: the live player count, stamped ---- */
.plate {
  --w: 340px;
  width: var(--w);
  max-width: 100%;
  aspect-ratio: 2 / 1;
  background: var(--plate);
  border-radius: 14px;
  border: 3px solid #c9c5b8;
  box-shadow: inset 0 0 0 5px var(--plate), inset 0 0 0 7px #b8b4a6, 0 18px 50px -18px rgba(255, 174, 43, 0.35);
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  padding: 14px 18px 12px;
  color: var(--plate-ink);
  position: relative;
}
.plate::before, .plate::after {   /* the bolts */
  content: ""; position: absolute; top: 12px; width: 9px; height: 9px; border-radius: 50%;
  background: #b9b4a3; box-shadow: inset 0 0 0 2px #9d9888;
}
.plate::before { left: 22%; }
.plate::after { right: 22%; }
.plate .state { font: italic 700 19px/1 var(--display); color: var(--plate-red); letter-spacing: 0.04em; }
.plate .num {
  font: 900 clamp(64px, 11vw, 92px)/1 var(--display);
  letter-spacing: 0.06em;
  align-self: center;
  font-variant-numeric: tabular-nums;
}
.plate .foot { font: 700 14px/1 var(--display); letter-spacing: 0.08em; }

/* ---- hero ---- */
.hero { position: relative; padding: 56px 0 96px; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; align-items: center; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(64px, 11vw, 150px); letter-spacing: -0.01em; line-height: 0.88; margin-bottom: 24px; }
.hero h1 span { display: block; }
.hero .lede { margin-bottom: 28px; }
.hero .live { display: grid; gap: 14px; justify-items: start; }
.hero .live p { font-size: 15px; color: var(--dim); margin: 0; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; gap: 40px; } .hero { padding-bottom: 72px; } }

/* long-exposure light trails along the bottom of the hero: drawn once on load */
.trails { position: absolute; left: 0; right: 0; bottom: 18px; height: 60px; pointer-events: none; }
.trails i {
  position: absolute; left: -40%; height: 2px; width: 70%; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--c) 60%, #fff 100%);
  opacity: 0.85;
  animation: trail 1.6s cubic-bezier(.2,.7,.2,1) both;
}
.trails i:nth-child(1) { top: 8px;  --c: var(--sodium); animation-delay: .15s; width: 85%; }
.trails i:nth-child(2) { top: 22px; --c: var(--tail);   animation-delay: .35s; height: 3px; }
.trails i:nth-child(3) { top: 34px; --c: var(--sodium); animation-delay: .5s;  width: 55%; opacity: .6; }
.trails i:nth-child(4) { top: 48px; --c: var(--tail);   animation-delay: .7s;  width: 95%; opacity: .5; }
@keyframes trail { from { transform: translateX(0); opacity: 0; } 20% { opacity: .9; } to { transform: translateX(150%); opacity: .55; } }
@media (prefers-reduced-motion: reduce) {
  .trails i { animation: none; left: 0; width: 100%; opacity: .35; }
}

/* ---- two-column feature list (not cards) ---- */
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 56px; margin-top: 32px; }
.features div { border-left: 3px solid var(--sodium); padding-left: 18px; }
.features p { color: var(--dim); margin: 0; }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 32px; } }

.note {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px;
  background: var(--block);
}
.note p:last-child { margin-bottom: 0; }

/* ---- tables ---- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 600; color: var(--dim); font-size: 14px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); margin-right: 8px; vertical-align: 1px; }
.dot.on { background: var(--go); box-shadow: 0 0 8px var(--go); }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--dim); }
.tag.star { color: var(--sodium); border-color: color-mix(in srgb, var(--sodium) 50%, transparent); }

/* ---- the chart ---- */
.chart { width: 100%; height: 260px; display: block; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .grid text, .chart .axis text { fill: var(--dim); font: 12px var(--body); }
.chart .area { fill: url(#sodiumfade); }
.chart .stroke { fill: none; stroke: var(--sodium); stroke-width: 2; stroke-linejoin: round; }
.chart .hover line { stroke: var(--dim); stroke-dasharray: 3 3; }
.chart .hover circle { fill: var(--sodium); stroke: var(--night); stroke-width: 2; }
.tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.tabs button {
  font: 600 14px var(--body); color: var(--dim); background: none; border: 0; padding: 8px 14px; cursor: pointer;
}
.tabs button[aria-pressed="true"] { background: var(--block); color: var(--ink); box-shadow: inset 0 -2px 0 var(--sodium); }
.figures { display: flex; gap: 40px; flex-wrap: wrap; margin: 8px 0 24px; }
.figures div { display: grid; }
.figures b { font: 800 40px/1 var(--display); font-variant-numeric: tabular-nums; }
.figures span { color: var(--dim); font-size: 14px; }

/* ---- forms (operators) ---- */
label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
input, select {
  font: 400 16px var(--body); color: var(--ink);
  background: var(--night); border: 1.5px solid var(--line); border-radius: 6px;
  padding: 10px 12px; width: 100%;
}
input:focus, select:focus { border-color: var(--sodium); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--sodium) 30%, transparent); }
form.stack { display: grid; gap: 16px; max-width: 420px; }
.err { color: var(--tail); font-weight: 600; min-height: 1.2em; margin: 0; }
.ok { color: var(--go); font-weight: 600; }

footer { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--dim); font-size: 14px; }
footer p { max-width: 90ch; }
footer nav { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 14px; }

[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Join buttons in the server tables ---- */
td.join, th.join-head { width: 1%; white-space: nowrap; text-align: right; }
tr.join-hint td { background: var(--block); border-left: 3px solid var(--sodium); }
tr.join-hint p { margin: 0; font-size: 15px; max-width: 80ch; }
/* narrow screens: the Join button stays in view; the address drops (the
   hint under a Join that opened nothing still names it) */
@media (max-width: 760px) {
  .servers-table th:nth-child(4), .servers-table td:nth-child(4) { display: none; }
}
@media (max-width: 480px) {
  .servers-table th:nth-child(2), .servers-table td:nth-child(2) { display: none; }
}
.join-pair { display: inline-flex; gap: 6px; }
@media (max-width: 480px) { .join-pair { flex-direction: column; align-items: stretch; } }
