* {
  box-sizing: border-box;
}
html {
  color-scheme: dark;
  background: #111c1d;
  color: #e5e8dd;
  font:
    16px/1.5 'Barlow',
    'PingFang SC',
    system-ui,
    sans-serif;
}
body {
  margin: 0;
}
main {
  max-width: 1250px;
  margin: auto;
}
header,
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  gap: 10px;
  background: #1b2b2c;
}
h1 {
  font-size: 18px;
  margin: 0;
}
.hud,
.controls > div {
  display: flex;
  gap: 10px;
  align-items: center;
}
.hud {
  font:
    600 13px ui-monospace,
    monospace;
  color: #bad4bd;
}
.scene {
  line-height: 0;
  position: relative;
}
canvas {
  width: 100%;
  height: auto;
  display: block;
}
#overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #13202980;
  line-height: 1.45;
  padding: 10px;
}
#overlay[hidden] {
  display: none;
}
#overlay > div {
  background: #1a2929f2;
  border-top: 3px solid #9bd7ad;
  max-width: 400px;
  text-align: center;
  padding: 18px 24px;
}
h2 {
  font-size: 25px;
  margin: 0 0 5px;
}
p {
  margin: 0 0 9px;
  font-size: 14px;
}
button {
  font: inherit;
  font-weight: 700;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 15px;
  color: #e4eade;
  background: #293c3c;
  border: 1px solid #667f78;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.go,
#start {
  background: #a9d7aa;
  color: #172e27;
  border-color: #d1eaca;
}
button:focus-visible {
  outline: 2px solid #ddd8a1;
  outline-offset: -4px;
}
button:active,
button.held {
  background: #48675b;
}
.controls {
  border-top: 2px solid #759482;
}
.help {
  font-size: 12px;
  padding: 7px 15px;
  color: #b0bdb5;
}
.controls button:disabled {
  opacity: 0.5;
}
@media (max-width: 570px) {
  header,
  .controls {
    padding: 7px;
    gap: 5px;
  }
  .controls > div {
    gap: 4px;
  }
  .controls button {
    padding: 7px 10px;
  }
  .hud {
    font-size: 11px;
    gap: 7px;
  }
  h1 {
    font-size: 15px;
  }
  .scene canvas {
    min-height: 175px;
  }
  #overlay > div {
    padding: 8px 12px;
  }
  h2 {
    font-size: 18px;
  }
  p {
    font-size: 12px;
  }
}

@media (max-width: 370px) {
  .controls { padding: 6px 3px; gap: 2px; }
  .controls > div { gap: 2px; }
  .controls button { min-width: 38px; padding: 6px; font-size: 14px; }
}
