body {
  margin: 0;
  font-family: 'Arial', sans-serif;
  text-align: center;
  background-color: #222;
  color: white;
}

#game {
  margin: 20px auto;
  width: 90vw;
  max-width: 800px;
  background: #000;
  border: 4px solid #444;
  position: relative;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  max-width: 800px;
  background: url('assets/background.png') repeat-x;
  background-size: cover;
}

#mobile-controls {
  position: static;
  margin: 16px auto 0 auto;
  display: flex;
  gap: 20px;
  justify-content: center;
  z-index: 10;
}
#mobile-controls button {
  font-size: 2rem;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  background: #444;
  color: #fff;
  box-shadow: 2px 2px 8px #222;
  opacity: 0.9;
}
@media (max-width: 600px) {
  body {
    font-size: 1.1rem;
    padding: 0;
    margin: 0;
  }
  h1 {
    font-size: 1.1rem;
    margin-top: 10px;
    margin-bottom: 8px;
  }
  #game {
    width: 100vw;
    max-width: 100vw;
    height: 50vh;
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border-width: 2px;
    border-radius: 0;
    box-sizing: border-box;
    padding: 0;
  }
  canvas {
    width: 98vw;
    max-width: 98vw;
    height: 55vh;
    max-height: 55vh;
    min-height: 180px;
    margin: 0 auto;
    display: block;
    border-radius: 10px;
  }
  p {
    font-size: 1rem;
    margin: 8px 0 4px 0;
    padding: 0 8px;
  }
  #mobile-controls {
    margin-top: 10px;
    margin-bottom: 18px;
    position: static;
    width: 100vw;
    max-width: 100vw;
    display: flex;
    justify-content: center;
    gap: 10vw;
  }
  #mobile-controls button {
    font-size: 2.2rem;
    padding: 12px 18px;
    border-radius: 14px;
    min-width: 56px;
    min-height: 56px;
    background: #444;
    color: #fff;
    border: none;
    box-shadow: 2px 2px 8px #222;
    opacity: 0.95;
    margin: 0 2vw;
    touch-action: manipulation;
  }
  #mobile-controls button:active {
    background: #666;
  }
}