canvas.frogger {
  display: block;
  margin: 5px auto;
  border: 2px solid #0f0;
  image-rendering: pixelated;
  background: black;
  max-width: 90vw;    /* scale down on small screens */
  z-index: 1;
}

.hud {
  display: flex;
  gap: 12px;
  margin: 2px;
  justify-content: center;
  margin-top: 0px;
  color: var(--panel);
}

.controls {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
}

button {
  margin-top: 10px;
  margin-bottom: 10px;
  padding: 8px 16px;
  background-color: transparent;
  color: #ffb86b;
  border: 1px solid #ffb86b;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  image-rendering: pixelated;
  transition: all 0.2s ease-in-out;
}

/* Mobile controls container */
#mobile-controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 10px auto;
  text-align: center;
}

/* Buttons default size */
#mobile-controls button {
  width: 80px;
  height: 80px;
  margin-top: 10px;
  padding: 8px 16px;
  background-color: transparent;
  color: #ffb86b;
  border: 1px solid #ffb86b;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  image-rendering: pixelated;
  transition: all 0.2s ease-in-out;
}

#mobile-controls button:active {
  background-color: blue;
}

/* --- Mobile scaling --- */
@media screen and (max-width: 800px) {
  /* Mobile buttons */
  #mobile-controls {
    display: flex !important;          /* show buttons on small screens */
    justify-content: center;
    gap: 10vw;
  }

  #mobile-controls button {
    width: 25vw;
    height: 25vw;
    font-size: 5vw;
  }

  /* Hide header on mobile */
  h1, .controls {
    display: none;
  }
}