body {
  font-family: sans-serif;
  margin: 0;
  padding: 0;
  background: #fff;
}
.top-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 20px 10px 10px 10px;
  background: #f7f7f7;
  border-bottom: 1px solid #ddd;
}
.top-bar button {
  padding: 12px 20px;
  font-size: 18px;
  margin: 0;
}
#battery {
  font-size: 20px;
  margin-left: 15px;
}
.main-content {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  margin: 30px auto 0 auto;
  max-width: 1100px;
  width: 100%;
  gap: 40px;
  padding: 0 10px;
}
#joystick {
  border: 1px solid #ccc;
  touch-action: none;
  background-color: #f9f9f9;
  display: block;
  margin: 0 auto;
  width: 300px;
  height: 300px;
  max-width: 90vw;
  max-height: 90vw;
}
.controls {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: 0;
  width: 320px;
  max-width: 100%;
  gap: 10px;
}
.controls label {
  font-size: 20px;
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.controls input[type="checkbox"] {
  width: 28px;
  height: 28px;
  accent-color: #007bff;
}
#moreBtn {
  font-size: 18px;
  padding: 10px 18px;
  margin-top: 10px;
}
#extras button {
  font-size: 16px;
  margin-right: 10px;
  margin-bottom: 5px;
  padding: 8px 14px;
}
#log {
  margin-top: 30px;
  width: 95%;
  max-width: 600px;
  height: 150px;
  border: 1px solid #ccc;
  padding: 10px;
  overflow-y: scroll;
  text-align: left;
  background: #f0f0f0;
  margin-left: auto;
  margin-right: auto;
  white-space: pre-line;
  font-size: 15px;
}

/* Responsive styles */
@media (max-width: 900px) {
  .main-content {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }
  #joystick {
    width: 90vw;
    height: 90vw;
    max-width: 400px;
    max-height: 400px;
  }
  .controls {
    width: 100%;
    max-width: 500px;
    align-items: stretch;
  }
  .controls label {
    font-size: 22px;
  }
  .controls input[type="checkbox"] {
    width: 36px;
    height: 36px;
  }
}
@media (max-width: 600px), (orientation: portrait) {
  .main-content {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
  }
  #joystick {
    width: 98vw;
    height: 98vw;
    max-width: 98vw;
    max-height: 98vw;
  }
  .controls {
    width: 100%;
    max-width: 100vw;
    align-items: stretch;
    gap: 14px;
  }
  .controls label {
    font-size: 26px;
    padding: 10px 0;
  }
  .controls input[type="checkbox"] {
    width: 44px;
    height: 44px;
  }
  #log {
    font-size: 16px;
  }
}
