:root {
  --bg: #000;
  --fg: #e8d8a0;
  --frame: #2a1c10;
  --frame-hi: #5a3a20;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Courier New", monospace;
  height: 100%;
  width: 100%;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  overscroll-behavior: none;
}

#stage {
  position: fixed;
  left: 0; top: 0;
  width: 100vw; height: 100vh;
  overflow: hidden;
  background: #000;
}

/* The canvas is sized and positioned by JS (fit + optional rotate). */
#game {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  outline: none;
  cursor: crosshair;
  background: #000;
}

#loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: var(--fg);
  font-size: 18px;
  letter-spacing: 2px;
  pointer-events: none;
  z-index: 10;
}
#loading.hidden { opacity: 0; transition: opacity 400ms ease; pointer-events: none; }

#hud {
  position: fixed;
  top: 6px; right: 8px;
  display: flex;
  gap: 4px;
  align-items: center;
  font-size: 11px;
  z-index: 5;
}
#hud button {
  background: rgba(42, 28, 16, 0.85);
  color: var(--fg);
  border: 1px solid var(--frame-hi);
  padding: 4px 8px;
  font-family: inherit;
  cursor: pointer;
  font-size: 11px;
}
#hud button:hover, #hud button:active { background: var(--frame-hi); }
#status {
  background: rgba(0,0,0,0.6);
  padding: 2px 6px;
  opacity: 0.85;
}

/* On really small screens, shrink the HUD chrome further */
@media (max-width: 600px) {
  #hud { top: 4px; right: 4px; gap: 2px; }
  #hud button { padding: 3px 6px; font-size: 10px; }
}
