:root {
  --bg: #0d1117;
  --bg-alt: #12181f;
  --panel: #161b22;
  --border: #2a313c;
  --text: #c9d1d9;
  --text-dim: #8b949e;
  --accent: #39d353;
  --accent-dim: #2ea043;
  --warn: #f85149;
  --font-mono: "Cascadia Code", "Fira Code", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }

/* The footer belongs at the bottom of the viewport even when the page content
   is short. Without this it sat directly under whatever the page happened to
   contain - on the front page, right beneath the server cards. */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 40px 0 28px;
}

.site-header h1 {
  margin: 0;
  font-size: 1.8rem;
  letter-spacing: 0.5px;
}

/* The wordmark is a link home on every page. It should read as the site name,
   not as a link, until pointed at. */
.site-header h1 a {
  color: inherit;
  text-decoration: none;
}
.site-header h1 a:hover .dot,
.site-header h1 a:focus-visible .dot {
  text-shadow: 0 0 8px var(--accent);
}

.bracket { color: var(--text-dim); }
.dot { color: var(--accent); }

.tagline {
  margin: 6px 0 0;
  color: var(--text-dim);
}

/* flex: 1 is the other half of the sticky footer: main takes whatever height
   the content does not use, pushing the footer to the bottom. */
main {
  padding: 40px 0 60px;
  flex: 1;
  width: 100%;
}

h2 {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 20px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px;
}

.card h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  color: var(--text);
}

.card .desc {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 0 0 12px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  margin-bottom: 12px;
  color: var(--text-dim);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  display: inline-block;
}
.status-dot.online { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.status-dot.offline { background: var(--warn); }

.addr-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
  margin-bottom: 12px;
}

.addr-row code {
  flex: 1;
  overflow-x: auto;
  white-space: nowrap;
  color: var(--accent);
  font-size: 0.85rem;
}

button.copy-btn {
  background: var(--accent-dim);
  color: #04160a;
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
button.copy-btn:hover { background: var(--accent); }

.saves-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
}

.saves-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  border-top: 1px dashed var(--border);
}
.saves-list li:first-child { border-top: none; }

.saves-list a { color: var(--text); text-decoration: none; }
.saves-list a:hover { color: var(--accent); text-decoration: underline; }

.saves-list .meta { color: var(--text-dim); white-space: nowrap; }

.no-saves, .loading { color: var(--text-dim); font-size: 0.85rem; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent);
  color: #04160a;
  padding: 10px 18px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- Suggestions form (appended for the suggestions feature) --- */

.suggestion-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 520px;
}

.suggestion-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.suggestion-form select,
.suggestion-form textarea,
.suggestion-form input[type="file"] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.suggestion-form textarea {
  resize: vertical;
}

/* Honeypot field: invisible to real visitors, present in the DOM for bots
   that fill in every field automatically. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.suggestion-form button.copy-btn {
  align-self: flex-start;
  padding: 8px 16px;
}

.suggestion-status {
  min-height: 1.2em;
  font-size: 0.85rem;
  margin: 0;
}

.suggestion-status.success { color: var(--accent); }
.suggestion-status.error { color: var(--warn); }

/* --- Download listings (the unlisted downloads page and the RPG page) ----- */

/* One downloadable thing per row: what it is and its details on the left, a
   single unmistakable action on the right. */
.dl-list {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 18px;
  margin: 0 0 14px;
}

.dl-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.dl-row:first-child { border-top: none; }

.dl-info { min-width: 0; flex: 1; }

.dl-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.dl-meta {
  margin-top: 3px;
  color: var(--text-dim);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.btn {
  flex: none;
  display: inline-block;
  background: var(--accent-dim);
  color: #04160a;
  border: none;
  border-radius: 4px;
  padding: 9px 18px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover, .btn:focus-visible { background: var(--accent); }

.btn.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.btn-ghost:hover, .btn.btn-ghost:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  background: transparent;
}

@media (max-width: 520px) {
  .dl-row { flex-direction: column; align-items: stretch; }
  .btn { text-align: center; }
}

/* Fine print that most visitors never need: checksums, the unsigned-binary
   explanation, launcher edge cases. Present for whoever wants it, one folded
   line for everyone else. */
details.fineprint {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 14px;
  margin: 0 0 10px;
  font-size: 0.85rem;
}

details.fineprint summary {
  cursor: pointer;
  padding: 11px 0;
  color: var(--text-dim);
  font-size: 0.82rem;
  letter-spacing: 0.3px;
  list-style-position: inside;
}
details.fineprint summary:hover { color: var(--text); }
details.fineprint[open] summary { border-bottom: 1px solid var(--border); }

details.fineprint > :not(summary) { margin-left: 2px; }
details.fineprint p { color: var(--text-dim); }
details.fineprint p strong { color: var(--text); }

.section-note {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 0 0 16px;
}

/* Command blocks and hashes, shared by the downloads page and the RPG playtest
   page (which historically carried its own copies in rpg.css). */
.cmd {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  overflow-x: auto;
  margin: 0.8rem 0;
}

.cmd code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  white-space: pre;
}

.hash {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  word-break: break-all;
  line-height: 1.5;
}

/* --- How to join, rendered from status.json's per-server join info ------- */

.join-note {
  margin: 10px 0 0;
  color: var(--text-dim);
  font-size: 0.8rem;
}

details.join-mods {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 10px;
  font-size: 0.8rem;
}

details.join-mods summary {
  cursor: pointer;
  padding: 7px 0;
  color: var(--text-dim);
}
details.join-mods summary:hover { color: var(--text); }
details.join-mods[open] summary { border-bottom: 1px solid var(--border); }

details.join-mods ul {
  list-style: none;
  margin: 6px 0 8px;
  padding: 0;
  max-height: 180px;
  overflow-y: auto;
  color: var(--text-dim);
}
details.join-mods li { padding: 1px 0; overflow-wrap: anywhere; }
