:root {
  --ink: #12141a;
  --slate: #1e212b;
  --paper: #f2efe6;
  --magenta: #ff3d7f;
  --cyan: #2fd9c4;
  --muted: #7c8087;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--paper);
  font-family: 'Space Grotesk', sans-serif;
  overflow: hidden;
}

#map {
  position: absolute;
  inset: 0;
  background: #0a0b0f;
}

/* Leaflet's default panes render above our chrome unless we say otherwise */
.leaflet-top, .leaflet-bottom { z-index: 400; }

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: linear-gradient(to bottom, rgba(18,20,26,0.92), rgba(18,20,26,0));
  pointer-events: none;
}

.wordmark {
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--paper);
}
.wordmark span { color: var(--magenta); }

.status {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.status .sep { opacity: 0.4; margin: 0 2px; }
.status #onlineCount { color: var(--cyan); font-weight: 700; }

.dot {
  width: 8px; height: 8px;
  background: var(--magenta);
  display: inline-block;
}
.dot.live { background: var(--cyan); }

.hint {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--slate);
  border: 2px solid var(--magenta);
  color: var(--paper);
  font-size: 12px;
  padding: 8px 14px;
  z-index: 1000;
  transition: opacity 0.15s ease;
}
.hint.hidden { display: none; }

.dock {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: var(--slate);
  border: 2px solid #33374a;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(92vw, 520px);
}

.palette {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 4px;
}

.swatch {
  width: 22px;
  height: 22px;
  border: 2px solid transparent;
  cursor: pointer;
}
.swatch.selected {
  border-color: var(--paper);
  transform: scale(1.12);
}

.charge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.charge-label {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  min-width: 92px;
}

.charge-bar {
  flex: 1;
  height: 6px;
  background: #0a0b0f;
  border: 1px solid #33374a;
}

.charge-fill {
  height: 100%;
  width: 100%;
  background: var(--cyan);
  transition: width 0.2s linear;
}
.charge-fill.charging { background: var(--magenta); }

.pixel-canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}