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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #5a8a3c;
  font-family: system-ui, sans-serif;
  touch-action: none;
  user-select: none;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #5a8a3c;
  color: #2d5a27;
  font-size: 14px;
  z-index: 100;
}

#ui-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

#minimap {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 140px;
  height: 140px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  background: #5a8a3c;
  image-rendering: pixelated;
}

#hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
}

#joy-zone {
  display: none;
  position: absolute;
  left: 16px;
  bottom: 16px;
  width: 120px;
  height: 120px;
  pointer-events: auto;
}

#joy-outer {
  position: absolute;
  left: 10px;
  top: 10px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.2);
}

#joy-inner {
  position: absolute;
  left: 43px;
  top: 43px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
}

#jump-btn,
#sprint-btn {
  display: none;
  position: absolute;
  width: 72px;
  height: 72px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: #1a2e1a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  pointer-events: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#jump-btn {
  right: 20px;
  bottom: 36px;
}

#sprint-btn {
  right: 104px;
  bottom: 36px;
}

#jump-btn:active,
#sprint-btn:active,
#sprint-btn.active {
  transform: scale(0.94);
  background: #fff;
}

.hidden { display: none !important; }

@media (max-width: 767px) {
  #joy-zone { display: block; }
  #jump-btn,
  #sprint-btn { display: block; }
  #hint { bottom: 140px; }
}
