* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  width: 100%;
  height: 100%;
  background: #04050a;
  overflow: hidden;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#game-wrap {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 30%, #16183a 0%, #07080f 60%, #04050a 100%);
}

canvas {
  display: block;
  height: 100vh;
  width: calc(100vh * 16 / 9);
  max-width: 100vw;
  max-height: calc(100vw * 9 / 16);
  background: #000;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(120,140,255,0.15), 0 18px 60px rgba(0,0,0,0.7);
  image-rendering: auto;
}

#rotate-hint {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  text-align: center;
  color: #cdd6ff;
  font-size: 5vw;
  background: #04050a;
  z-index: 50;
  padding: 8vw;
}

/* Touch controls */
#touch-controls {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
}
#touch-controls.hidden { display: none; }
#touch-controls .pad-left,
#touch-controls .pad-right {
  position: absolute;
  bottom: 3vh;
  display: flex;
  gap: 2.2vh;
  pointer-events: none;
}
#touch-controls .pad-left { left: 2.5vw; }
#touch-controls .pad-right { right: 2.5vw; }
.tbtn {
  pointer-events: auto;
  min-width: 11vh;
  height: 11vh;
  padding: 0 2vh;
  border-radius: 50%;
  border: 2px solid rgba(180,200,255,0.5);
  background: rgba(30,40,80,0.55);
  color: #eaf0ff;
  font-size: 3.4vh;
  font-weight: bold;
  backdrop-filter: blur(3px);
}
.tbtn:active { background: rgba(90,120,255,0.7); transform: scale(0.94); }

@media (orientation: portrait) and (max-width: 920px) {
  #rotate-hint { display: grid; }
}
