@font-face {
  font-family: "Press Start 2P";
  src: url("PressStart2P-Regular.ttf") format("truetype");
  font-display: block;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Press Start 2P", monospace;
}

#game {
  display: block;
  width: 960px;
  height: 540px;
  touch-action: none;
  background: #0a0f14;
}

/* ── on-screen buttons: touch devices, while flying ── */

#touch {
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: none;
  box-sizing: border-box;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  --strip: 70px;
}

body.touch.playing #touch { display: block; }

/* one strip down each side of the picture, never over it */
.cluster {
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--strip);
  box-sizing: border-box;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cluster.left { left: env(safe-area-inset-left); }
.cluster.right { right: env(safe-area-inset-right); }

.btn {
  pointer-events: auto;
  touch-action: none;
  flex: 1;
  min-height: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(100, 255, 200, 0.55);
  border-radius: 12px;
  background: #0a0f14;
  color: rgba(100, 255, 200, 0.85);
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
}

.btn[data-btn="left"],
.btn[data-btn="right"],
.btn[data-btn="thrust"] {
  font-family: system-ui, sans-serif;
  font-size: 32px;
}

.btn.small {
  flex: 0 0 40px;
  font-size: 8px;
}

.btn.on {
  background: rgba(100, 255, 200, 0.35);
  color: #fff;
  border-color: #fff;
}

/* ── portrait phones: ask for landscape ── */

#rotate {
  display: none;
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
  padding: 24px;
  line-height: 2;
  background: #0a0f14;
  color: rgb(100, 255, 200);
  font-size: min(16px, 5vw);
  z-index: 10;
}

@media (orientation: portrait) {
  body.touch #rotate { display: flex; }
}

#rotate small { font-size: 1em; color: rgb(255, 140, 60); }
