:root {
  --bg: #06070c;
  --fg: #d9e0ea;
  --accent: #66e3ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 35%, #141b2d 0%, var(--bg) 62%);
  color: var(--fg);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

canvas {
  width: min(96vw, 960px);
  height: auto;
  border: 2px solid #273149;
  background: transparent;
}

.hud {
  position: fixed;
  top: 14px;
  width: min(96vw, 960px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.hud button {
  padding: 0.35rem 0.7rem;
  border: 1px solid #66e3ff;
  background: rgba(102, 227, 255, 0.12);
  color: #d9e0ea;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
}

.hud button:hover {
  background: rgba(102, 227, 255, 0.2);
}

.help {
  position: fixed;
  bottom: 14px;
  text-align: center;
  font-size: 0.9rem;
  color: #9ca8bd;
}

.touch-controls {
  display: none;
  position: fixed;
  bottom: calc(54px + env(safe-area-inset-bottom, 0px));
  width: min(96vw, 960px);
  justify-content: space-between;
  pointer-events: auto;
  z-index: 30;
}

.touch-left,
.touch-right {
  display: flex;
  gap: 14px;
}

.touch-controls button {
  width: 96px;
  height: 72px;
  border: 1px solid rgba(102, 227, 255, 0.8);
  background: rgba(6, 16, 29, 0.72);
  color: #d9e0ea;
  border-radius: 14px;
  font: 700 1.05rem/1 "Trebuchet MS", "Segoe UI", sans-serif;
  letter-spacing: 0.03em;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.touch-controls button:active,
.touch-controls button.pressed {
  background: rgba(102, 227, 255, 0.28);
}

@media (hover: none) and (pointer: coarse) {
  .touch-controls {
    display: flex;
  }

  .help {
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    font-size: 0.82rem;
    width: 95vw;
  }

  .hud {
    font-size: 0.9rem;
  }
}
