* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1a1a2e;
  touch-action: none;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

/* Touch Controls */
.controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 140px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 10px 20px;
  pointer-events: none;
  z-index: 10;
}

.controls.hidden {
  display: none;
}

.controls-left {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  pointer-events: auto;
}

.controls-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: auto;
}

.ctrl-btn {
  border: none;
  border-radius: 16px;
  font-weight: bold;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.dpad-btn {
  width: 70px;
  height: 70px;
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
  font-size: 28px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.dpad-btn:active {
  background: rgba(255, 255, 255, 0.4);
}

.action-btn {
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 16px;
  letter-spacing: 1px;
}

.jump-btn {
  width: 90px;
  height: 90px;
  background: rgba(76, 175, 80, 0.4);
  border-radius: 50%;
  font-size: 18px;
}

.jump-btn:active {
  background: rgba(76, 175, 80, 0.6);
}

.throw-btn {
  width: 70px;
  height: 50px;
  background: rgba(255, 152, 0, 0.4);
}

.throw-btn:active {
  background: rgba(255, 152, 0, 0.6);
}

/* Pause Button */
.pause-btn {
  position: fixed;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.3);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.pause-btn.hidden {
  display: none;
}

.pause-btn:active {
  background: rgba(0, 0, 0, 0.5);
}

/* Force landscape hint */
@media (orientation: portrait) {
  body::after {
    content: 'Please rotate your device to landscape mode';
    position: fixed;
    inset: 0;
    background: #1a1a2e;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: sans-serif;
    font-size: 20px;
    text-align: center;
    padding: 40px;
    z-index: 9999;
  }
}
