/* Ocean — HUD overlay styling */
html, body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #0a1420;
}

canvas#scene {
  display: block;
  width: 100vw;
  height: 100vh;
}

/* HUD: fixed overlay, top-left */
#hud {
  position: fixed;
  top: 18px;
  left: 20px;
  z-index: 10;
  pointer-events: none;      /* clicks pass through to the canvas */
  user-select: none;
  color: #f4f9fc;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  text-shadow: 0 1px 4px rgba(5, 20, 30, 0.85), 0 0 2px rgba(5, 20, 30, 0.6);
}

#topbar {
  display: flex;
  gap: 18px;
  align-items: baseline;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

#cammode {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.85;
  border: 1px solid rgba(244, 249, 252, 0.45);
  border-radius: 3px;
  padding: 2px 7px;
}

#help {
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.75;
  opacity: 0.88;
}

#help b {
  font-weight: 600;
  color: #ffffff;
}

/* ============================ touch controls ========================== */
/* Hidden by default; body.touch (added in JS) reveals them on phones. */
body.touch #touchpad { display: flex; }
body.touch #cambtn   { display: block; }
body.touch #help     { display: none; }

#touchpad {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: none;                      /* base state: off on desktops */
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 18px calc(16px + env(safe-area-inset-bottom)) 18px;
  pointer-events: none;   /* only the buttons themselves are interactive */
}

/* cross-shaped D-pad, bottom-left */
.dpad {
  --cell: 58px;
  display: grid;
  grid-template-columns: repeat(3, var(--cell));
  grid-template-rows: repeat(3, var(--cell));
  gap: 6px;
}
.dp-up    { grid-area: 1 / 2; }
.dp-left  { grid-area: 2 / 1; }
.dp-right { grid-area: 2 / 3; }
.dp-down  { grid-area: 3 / 2; }

.tp-btn {
  pointer-events: auto;
  touch-action: none;                 /* no scroll/zoom gestures from buttons */
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  appearance: none;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  background: rgba(8, 28, 44, 0.45);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.tp-btn.held {
  background: rgba(255, 255, 255, 0.4);
  border-color: #fff;
}

/* boost sits alone at the bottom-right */
.tp-boost {
  width: 116px;
  height: 56px;
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 0.12em;
  font-weight: 600;
}

#cambtn {
  position: fixed;
  top: calc(18px + env(safe-area-inset-top));
  right: 18px;
  z-index: 20;
  display: none;                     /* base state: off on desktops */
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  appearance: none;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  background: rgba(8, 28, 44, 0.45);
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.08em;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
#cambtn.held { background: rgba(255, 255, 255, 0.4); }
