* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  color: #e8f6ff;
  background: radial-gradient(circle at 20% 20%, #202a45, #0b111f 60%);
}

body {
  position: relative;
}

#universe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#hud {
  position: absolute;
  top: 0;
  left: 0;
  padding: 16px;
  display: grid;
  gap: 12px;
  pointer-events: none;
  max-width: 420px;
}

.section {
  background: rgba(10, 16, 32, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  backdrop-filter: blur(6px);
}

h1 {
  margin: 0 0 2px;
  font-size: 24px;
  letter-spacing: 0.5px;
}

.subtitle {
  margin: 0;
  color: #a9c1d8;
}

.counts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
  font-size: 14px;
}

.counter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 6px currentColor;
}

.controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

button {
  pointer-events: auto;
  background: linear-gradient(135deg, #1f7aff, #7c4dff);
  color: #f0f5ff;
  border: none;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

button:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.legend {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #d1e3ff;
}

.legend .rule {
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge {
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 700;
  color: #0b111f;
}

@media (max-width: 640px) {
  h1 {
    font-size: 20px;
  }
  #hud {
    max-width: 100%;
  }
}
