:root {
  color-scheme: dark;
  --panel: rgba(12, 18, 32, 0.82);
  --line: rgba(154, 214, 255, 0.32);
  --text: #ecf7ff;
  --muted: #8fb2c8;
  --accent: #71f3c4;
  --danger: #ff6b8b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 15%, rgba(45, 134, 188, 0.34), transparent 28rem),
    radial-gradient(circle at 82% 24%, rgba(167, 78, 142, 0.22), transparent 26rem),
    linear-gradient(145deg, #08111f 0%, #120f25 50%, #06171b 100%);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  display: grid;
  place-items: center;
  padding: 20px;
}

.shell {
  width: min(100%, 1040px);
  display: grid;
  gap: 12px;
}

.hud,
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
}

.hud {
  min-height: 62px;
}

.hud div {
  min-width: 82px;
}

.label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

strong {
  display: block;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  font-size: clamp(18px, 2.6vw, 28px);
  line-height: 1;
}

canvas {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: calc(100vh - 160px);
  border: 1px solid var(--line);
  background: #050916;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
  image-rendering: crisp-edges;
}

.controls {
  flex-wrap: wrap;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}

button {
  min-width: 86px;
  min-height: 36px;
  border: 1px solid rgba(113, 243, 196, 0.5);
  background: rgba(113, 243, 196, 0.12);
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
}

button:hover,
button:focus-visible {
  outline: none;
  border-color: var(--accent);
  background: rgba(113, 243, 196, 0.22);
}

@media (max-width: 620px) {
  body {
    padding: 10px;
  }

  .hud {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hud div {
    min-width: 0;
  }

  .controls {
    align-items: stretch;
  }

  button {
    flex: 1 1 42%;
  }
}
