:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --text: #1f2421;
  --muted: #5f6762;
  --border: #dedcd4;
  --accent: #3d7a3a;
  --accent-text: #ffffff;
  --accent-soft: #e3efe1;
  --danger: #a3322a;
  --danger-soft: #f8e4e1;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161917;
    --surface: #1f2421;
    --text: #e8ebe8;
    --muted: #9aa49d;
    --border: #333a35;
    --accent: #6fb36a;
    --accent-text: #0f1a0e;
    --accent-soft: #23331f;
    --danger: #ef8a80;
    --danger-soft: #3a211e;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--accent); }
h1, h2 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; margin-top: 1.5rem; }
code { font-size: .9em; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem;
  padding: .75rem 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: .5rem; }
.brand-mark {
  width: 18px; height: 18px; border-radius: 3px;
  background: linear-gradient(var(--accent) 0 40%, #7a5a3a 40% 100%);
}
nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
nav a { color: var(--text); text-decoration: none; }
nav a:hover { color: var(--accent); }
nav form { margin: 0; }

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 16px 3rem; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head form { margin: 0; }
.crumbs { margin: 0 0 .5rem; color: var(--muted); font-size: .9rem; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.empty { color: var(--muted); padding: 2rem 0; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.25rem; margin-bottom: 1rem;
}
.card > h2:first-child, .card > h1:first-child { margin-top: 0; }
.narrow { max-width: 460px; margin-inline: auto; }
details.card summary { cursor: pointer; font-weight: 600; }
details.card[open] summary { margin-bottom: .75rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.world-card { display: flex; flex-direction: column; gap: .5rem; margin: 0; }
.world-card .button { margin-top: auto; align-self: flex-start; }
.world-link { color: var(--text); text-decoration: none; }
.world-link:hover h2 { color: var(--accent); }
.world-card h2 { margin: .75rem 0 0; }
.hidden-world { opacity: .7; }
.preview {
  width: 100%; aspect-ratio: 16 / 9; border-radius: 6px; object-fit: contain;
  image-rendering: pixelated; background: var(--accent-soft);
}
.placeholder {
  display: grid; place-items: center; font-size: 2.5rem; font-weight: 700; color: var(--accent);
  background: repeating-linear-gradient(45deg, var(--accent-soft) 0 12px, transparent 12px 24px), var(--accent-soft);
}
.facts { display: grid; grid-template-columns: auto 1fr; gap: .1rem .75rem; margin: 0; font-size: .9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.badge {
  display: inline-block; font-size: .75rem; font-weight: 600; padding: .05rem .5rem; margin: 0;
  border-radius: 99px; background: var(--accent-soft); color: var(--accent); vertical-align: middle;
}

table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .85rem; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td form { margin: 0; }
@media (max-width: 640px) {
  .versions th:nth-child(3), .versions td:nth-child(3) { display: none; }
  th, td { padding: .5rem; }
}

button, .button {
  font: inherit; font-size: .95rem; cursor: pointer; text-decoration: none; display: inline-block;
  padding: .45rem .9rem; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); white-space: nowrap;
}
button:hover, .button:hover { border-color: var(--accent); }
.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.primary:hover { filter: brightness(1.08); }
button.link { border: 0; background: none; padding: 0; color: var(--text); }
button.link:hover { color: var(--accent); }

input, select, textarea {
  font: inherit; width: 100%; padding: .45rem .6rem; border-radius: 7px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
label { display: block; font-size: .9rem; font-weight: 600; }
label > input, label > select, label > textarea { margin-top: .25rem; font-weight: 400; }
label.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
label.check input { width: auto; margin: 0; }
.stack { display: grid; gap: .9rem; }
.stack button { justify-self: start; }

.notice, .error { padding: .6rem .9rem; border-radius: 7px; margin: 0 0 1rem; }
.notice { background: var(--accent-soft); }
.error { background: var(--danger-soft); color: var(--danger); }

.share-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; align-items: end; margin-bottom: 1rem; }
.share-form button { justify-self: start; }
.shares { list-style: none; margin: 0; padding: 0; }
.shares li { padding: .75rem 0; border-top: 1px solid var(--border); display: grid; gap: .5rem; }
.shares li.inactive { opacity: .6; }
.share-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.share-url { flex: 1 1 260px; width: auto; font-family: ui-monospace, monospace; font-size: .85rem; }

.table-wrap { overflow-x: auto; }
.players td { white-space: nowrap; }
.player { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; }
.head { width: 32px; height: 32px; border-radius: 4px; image-rendering: pixelated; flex: none; }
.head-placeholder {
  display: inline-grid; place-items: center; font-size: .8rem; font-weight: 700;
  background: var(--accent-soft); color: var(--accent);
}

.timeline { list-style: none; margin: 0; padding: 0; }
.entry {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .75rem 1rem; margin-bottom: .75rem;
}
.entry-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.changes { list-style: none; margin: .75rem 0 0; padding: .75rem 0 0; border-top: 1px solid var(--border); display: grid; gap: .75rem; }
.changes li { display: flex; gap: .75rem; align-items: flex-start; }
.facts-inline { margin-left: .25rem; }
.advancements, .sessions { font-size: .9rem; margin-top: .2rem; }
.advancements span[title] { border-bottom: 1px dotted var(--muted); cursor: help; }
.advancements summary { cursor: pointer; }
.advancements[open] summary { margin-bottom: .2rem; }

.server-line { margin: 0; font-size: .9rem; color: var(--muted); }
.server h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.server details { margin-top: 1rem; }
.server summary { cursor: pointer; font-weight: 600; }
.addons { columns: 2 220px; margin: .4rem 0 0; padding-left: 1.1rem; font-size: .9rem; }
.addons li { break-inside: avoid; }
.server-changes { margin: .5rem 0 0; font-size: .9rem; color: var(--accent); }

.preview.map { object-fit: cover; image-rendering: auto; background: var(--accent-soft); }
.hero-link { display: block; margin-bottom: 1rem; }
.hero {
  display: block; width: 100%; max-height: 520px; object-fit: contain;
  background: var(--accent-soft); border: 1px solid var(--border); border-radius: var(--radius);
  image-rendering: pixelated;
}
.entry-title { flex: 1; }
.entry-preview {
  width: 72px; height: 72px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--border); background: var(--accent-soft); display: block;
}
.upload { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .5rem; }
.upload input[type=file] { width: auto; flex: 1 1 220px; }
details.card h3 { font-size: 1rem; margin: 1.25rem 0 .25rem; }
