/* Page & viewport */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #fff8f0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial;
  -webkit-text-size-adjust: 100%; /* prevent iOS auto-zooming text */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none; /* disable iOS press menu */
}

/* Fill the real mobile viewport */
#game-root {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;     /* modern mobile browsers */
  min-height: 100svh; /* iOS Safari safe viewport */
  touch-action: none; /* avoid gestures stealing input */

  /* Letterbox background image (outside the canvas only) */
  background: #fff8f0 center center / cover no-repeat;
  background-image:
    image-set(
      url("assets/mid-bg-mobile.jpg") 1x,
      url("assets/mid-bg-mobile.jpg") 2x
    );
}

/* Let Phaser control canvas size.
   IMPORTANT: No CSS transforms or manual scaling here. */
#game-root > canvas {
  position: absolute;
  inset: 0;
  margin: 0;
  display: block;
  image-rendering: auto; /* use 'pixelated' if you want chunky pixels */
}

/* Safe-area padding for overlays (not the canvas) */
@supports (padding: env(safe-area-inset-bottom)) {
  .hud, .btnbar, .hint {
    padding-bottom: calc(env(safe-area-inset-bottom) + 0px);
  }
}

/* HUD */
.hud {
  position: fixed;
  left: 10px;
  top: 10px;
  z-index: 20;
  background: rgba(255,255,255,.85);
  padding: 6px 10px;
  border-radius: 12px;
  color: #4b2e83;
  font-weight: 700;
  font-size: clamp(12px, 1.8vh, 16px);
}

/* Controls */
.btnbar {
  position: fixed;
  right: 10px;
  top: 10px;
  z-index: 20;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  cursor: pointer;
  border: 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: #ab3cfc;
  color: #fff;
  font-weight: 700;
  font-size: clamp(12px, 1.8vh, 16px);
}

.btn.alt { background: #f29f05; }

.label-vol {
  margin-left: 8px;
  font-weight: 600;
  color: #4b2e83;
  font-size: clamp(12px, 1.8vh, 16px);
}

#vol { width: min(40vw, 140px); }

/* Hint */
.hint {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 20;
  background: rgba(0,0,0,.5);
  color: #fff;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: clamp(12px, 1.8vh, 16px);
  text-align: center;
}




