* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: black; }
canvas {
  display: block;
  width: 100vw;
  height: 100vh;
}
#controls {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 1;
}
#controls button {
  background: #222;
  color: #fff;
  border: 1px solid #555;
  padding: 6px 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  cursor: pointer;
}
#stats {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  gap: 24px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 1px;
}
#stats span { color: #888; }
#stats b { color: #fff; font-weight: 200; }
#panel {
  position: fixed;
  top: 40px;
  right: 16px;
  width: 280px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  z-index: 3;
  background: rgba(10, 10, 10, 0.9);
  border: 1px solid #444;
  color: #fff;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  padding: 12px;
  display: none;
}
#panel h3 {
  font-weight: 200;
  letter-spacing: 1px;
  margin-bottom: 10px;
  color: #aaa;
  font-size: 13px;
}
#panel .row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px solid #222;
}
#panel .row span { color: #888; }
#panel .row b { font-weight: 200; color: #fff; }
#panel .bar {
  height: 4px;
  background: #222;
  margin: 2px 0 6px;
}
#panel .bar .fill {
  height: 100%;
  background: #4a4;
}
#panel .close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: #888;
  font-size: 16px;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
}
#panel .close:hover { color: #fff; }

#menuBtnWrap {
  position: fixed;
  top: 40px;
  left: 16px;
  z-index: 4;
}
#menuBtn {
  background: #222;
  color: #fff;
  border: 1px solid #555;
  width: 36px;
  height: 36px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 18px;
  cursor: pointer;
}
#menu {
  display: none;
  margin-top: 4px;
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid #444;
}
#menu.open { display: block; }
#menu button {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #fff;
  text-align: left;
  padding: 8px 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  border-bottom: 1px solid #222;
}
#menu button:hover { background: #222; }

.list-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #222;
  cursor: pointer;
  color: #4a4;
}
.list-item:hover { background: #111; }

