/* style.css — HD layout, fullscreen canvas, modern monospace fonts */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', Menlo, Consolas, 'Liberation Mono', monospace;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

#canvas-wrapper {
  position: relative;
  /* Aspect ratio 640:350 — fill viewport while preserving ratio */
  width: min(100vw, calc(100vh * 640 / 350));
  height: min(100vh, calc(100vw * 350 / 640));
  aspect-ratio: 640 / 350;
}

#bg-canvas,
#fg-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Smooth interpolation for HD canvas — no pixelated scaling */
}

#bg-canvas {
  z-index: 1;
}

#fg-canvas {
  z-index: 2;
}

/* Touch controls overlay — hidden on desktop */
#touch-controls {
  display: none;
  position: absolute;
  z-index: 10;
  bottom: 10px;
  left: 0;
  right: 0;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
}

#touch-controls button {
  pointer-events: auto;
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', Menlo, Consolas, 'Liberation Mono', monospace;
  font-size: 16px;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: 2px solid #fff;
  cursor: pointer;
  touch-action: manipulation;
}

#touch-controls button:active {
  background: rgba(255, 255, 255, 0.3);
}

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