:root {
  --bg: #0e1320;
  --panel: rgba(14, 19, 32, 0.72);
  --text: #e8ecf5;
  --muted: #8a93a8;
  --accent: #5ee0a0;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
}

canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  touch-action: none;
  cursor: crosshair;
}

#menu {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(8, 11, 20, 0.55);
  backdrop-filter: blur(3px);
}
#menu[hidden] { display: none; }

.card {
  width: min(320px, 100%);
  padding: 28px 24px 20px;
  border-radius: 16px;
  background: #161d2e;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  text-align: center;
}

h1 {
  margin: 0;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.tagline { margin: 4px 0 20px; color: var(--muted); }

input, button {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 0;
  font: inherit;
  font-size: 16px;
}

input {
  margin-bottom: 10px;
  background: #0e1320;
  color: var(--text);
  outline: 2px solid transparent;
}
input:focus { outline-color: var(--accent); }

button {
  background: var(--accent);
  color: #0b1a12;
  font-weight: 700;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }

#status { min-height: 1.4em; margin: 12px 0 0; color: var(--muted); font-size: 13px; }

#hud { position: fixed; inset: 0; pointer-events: none; }
#hud[hidden] { display: none; }

.panel {
  position: absolute;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--panel);
  font-variant-numeric: tabular-nums;
}

#mass { top: 12px; left: 12px; font-weight: 700; font-size: 16px; }

#net {
  bottom: 12px;
  left: 12px;
  color: var(--muted);
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre;
}

#leaderboard {
  top: 12px;
  right: 12px;
  margin: 0;
  min-width: 170px;
  padding-left: 32px;
}
#leaderboard li { white-space: nowrap; }
#leaderboard li span { float: right; margin-left: 16px; color: var(--muted); }
#leaderboard li.me { color: var(--accent); }
#leaderboard:empty { display: none; }
