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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0d0d1a;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

#app {
  position: relative;
  width: 405px;
  height: 720px;
  overflow: hidden;
  background: #1a1a2e;
  flex-shrink: 0;
}

#game-canvas {
  display: block;
  width: 405px;
  height: 720px;
  touch-action: none;
}

#controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

#joystick {
  position: absolute;
  left: 24px;
  bottom: 28px;
  width: 120px;
  height: 120px;
  pointer-events: auto;
}

#joystick-base {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

#joystick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: background 0.1s;
}

#joystick.active #joystick-knob {
  background: rgba(255, 255, 255, 0.85);
}

#jump-btn {
  position: absolute;
  right: 24px;
  bottom: 36px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  pointer-events: auto;
  background: rgba(255, 107, 157, 0.35);
  border: 2px solid rgba(255, 107, 157, 0.75);
  color: #fff;
  font: bold 18px "Microsoft JhengHei", "PingFang TC", sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(255, 107, 157, 0.35);
}

#jump-btn.pressed {
  background: rgba(255, 107, 157, 0.65);
  transform: scale(0.94);
}

#loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a2e;
  color: #ff6b9d;
  font: bold 20px "Microsoft JhengHei", "PingFang TC", sans-serif;
  z-index: 20;
}

#loading.hidden {
  display: none;
}
