/* Dark and plain: neutral greys, one border colour, colour only where it means something (status, players). */
:root {
  --bg: #0e0e10;
  --panel: #151518;
  --raised: #1c1c20;
  --line: #26262b;
  --text: #ededed;
  --muted: #8d8d96;
  --accent: #b69bff;
  --green: #3fbf6f;
  --red: #e5534b;
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0 auto;
  max-width: 1080px;
  padding: 0 20px;
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; text-decoration: none; }
.brand img { border-radius: 7px; }
.discord {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.discord:hover { background: var(--raised); border-color: #34343a; }
.discord svg { width: 18px; height: 14px; color: #8c9eff; }

/* Heading */
h1 { margin: 44px 0 6px; font-size: 30px; font-weight: 650; letter-spacing: -0.015em; line-height: 1.2; }
.lead { margin: 0 0 28px; color: var(--muted); font-size: 16px; }

/* Address, status, players, version: one strip with dividers. */
.info {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.info > div { position: relative; padding: 14px 18px; min-width: 0; }
.info > div + div { border-left: 1px solid var(--line); }
.info dt { color: var(--muted); font-size: 13px; }
.info dd { margin: 2px 0 0; font-size: 16px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.info .muted { font-weight: 400; font-size: 14px; }
.info .address { padding-right: 104px; }
/* Copy: an icon and a word; turns green with a tick for a moment once the address is copied. */
#copy {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 96px;
  height: 32px;
  padding: 0 12px 0 10px;
  border: 1px solid #303036;
  border-radius: 8px;
  background: #1f1f24;
  color: #d6d6dc;
  font-size: 13px;
  font-weight: 500;
  transition: background .15s, border-color .15s, color .15s;
}
#copy:hover { background: #26262c; border-color: #3c3c44; color: var(--text); }
#copy:active { background: #2c2c33; }
#copy svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#copy .icon-done { display: none; }
#copy.copied { border-color: rgba(63, 191, 111, .5); background: rgba(63, 191, 111, .12); color: #7fe0a3; }
#copy.copied .icon-copy { display: none; }
#copy.copied .icon-done { display: block; }
#state::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--muted);
  vertical-align: 1px;
}
#state[data-state="online"]::before { background: var(--green); }
#state[data-state="offline"]::before { background: var(--red); }

/* Players online: a tag each; clicking one follows that player on the map. */
.online { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 16px 2px 0; font-size: 14px; }
#players { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  font-size: 14px;
}
.tag::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #e53935; }
button.tag:hover { border-color: #3a3a40; background: var(--raised); }
.tag[aria-pressed="true"] { border-color: #5a5a62; background: var(--raised); }
.tag[aria-pressed="true"]::before { background: #ffd400; }

/* Map */
.map-section { margin-top: 36px; }
.map-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
h2 { margin: 0; font-size: 17px; font-weight: 600; }
#coords { font-size: 13px; font-variant-numeric: tabular-nums; }
.map {
  position: relative;
  height: min(78vh, 900px);
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #09090b;
  overflow: hidden;
}
.map canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
.map canvas.dragging { cursor: grabbing; }
.map canvas:focus-visible { outline-offset: -2px; }
.map-buttons {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 21, 24, .94);
  overflow: hidden;
}
.map-buttons button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 18px;
  line-height: 1;
}
.map-buttons button + button { border-top: 1px solid var(--line); }
.map-buttons button:hover { background: var(--raised); }
.map-buttons svg { width: 16px; height: 16px; }
.map-note {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 20px;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
}
.map-note[hidden] { display: none; }

footer { margin: 40px 0 32px; color: #5f5f68; font-size: 13px; }
footer p { margin: 0; }

@media (max-width: 760px) {
  body { padding: 0 16px; }
  h1 { margin-top: 32px; font-size: 24px; }
  .info { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .info .address { grid-column: span 3; }
  .info > div { padding: 12px 14px; }
  .info > div + div { border-top: 1px solid var(--line); }
  .info > div:nth-child(2) { border-left: 0; }
  .info dd { font-size: 15px; }
  .map { height: auto; min-height: 0; aspect-ratio: 1 / 1; }
}
