html,
body {
  margin: 0;
  height: 100%;
  background: #1c2832;
  color: #e7eee6;
  font-family: "Segoe UI", sans-serif;
  overflow: hidden;
}

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

canvas.dragging {
  cursor: grabbing;
}

.hud {
  position: fixed;
  top: 16px;
  left: 16px;
  width: min(280px, calc(100vw - 32px));
  padding: 14px 16px 12px;
  border-radius: 16px;
  background: rgba(18, 26, 32, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.hud header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.hud h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.02em;
}

.sub {
  margin: 2px 0 0;
  color: #b7c4b8;
  font-size: 13px;
}

.clock {
  font-variant-numeric: tabular-nums;
  font-size: 18px;
  color: #d5e2d4;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin: 12px 0;
  font-size: 14px;
}

.stats div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.stats span {
  color: #b7c4b8;
}

.controls {
  display: grid;
  grid-template-columns: auto auto auto 1fr;
  gap: 8px;
  align-items: center;
}

#add {
  grid-column: 1 / -1;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: #e7efe4;
  color: #1c2832;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

button:hover {
  background: #ffffff;
}

#rate {
  margin-left: auto;
  color: #d5e2d4;
  font-variant-numeric: tabular-nums;
}

.hint {
  margin: 10px 0 0;
  color: #93a396;
  font-size: 12px;
  line-height: 1.4;
}

.legend {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.legend img {
  width: 28px;
  height: auto;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}
