body {
  margin: 0;
  padding: 0;
  background: linear-gradient(to top, #1f4172, #218589);
  font-family: 'Open Sans', sans-serif;
  color: #fff;
  overflow: hidden;
  /* Prevent pull-to-refresh and overscroll on mobile */
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  /* Prevent text selection on mobile */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  /* Prevent callout on touch and hold */
  -webkit-touch-callout: none;
}

#ui {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
  font-size: clamp(16px, 3vw, 22px);
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

canvas {
  display: block;
  background: linear-gradient(to top, #1f4172, #218589);
  /* Prevent tap highlighting on mobile */
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  width: 100%;
  height: 100vh;
  /* Prevent context menu on long press */
  -webkit-touch-callout: none;
}

button {
  background-color: #00008b;
  border: 2px solid #ffef00;
  color: #ffef00;
  /* Ensure minimum touch target size of 44x44px */
  padding: 12px 24px;
  min-width: 100px;
  min-height: 44px;
  cursor: pointer;
  font-size: clamp(16px, 2.5vw, 20px);
  font-weight: bold;
  transition: all 0.3s ease;
  border-radius: 4px;
  /* Prevent double-tap zoom on button */
  touch-action: manipulation;
}

button:hover,
button:active {
  background-color: #218589;
  transform: scale(1.05);
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
  #ui {
    top: 5px;
    left: 5px;
    gap: 10px;
  }
  
  button {
    padding: 10px 20px;
    font-size: 16px;
  }
}

/* Very small screens */
@media (max-width: 480px) {
  #ui {
    font-size: 14px;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  #ui {
    top: 5px;
    left: 5px;
  }
}