* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  overflow: hidden;
  background-color: #111;
  color: white;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

#controls {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 15px;
  border-radius: 10px;
  z-index: 10;
  width: 300px;
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

#controls h1 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  text-align: center;
}

#controls label {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
  font-size: 0.9rem;
}

#controls input[type="range"] {
  margin: 8px 0;
  width: 100%;
  appearance: none;
  background: #333;
  border-radius: 4px;
  height: 6px;
  outline: none;
  cursor: pointer;
}

#controls input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffcc00;
  border: none;
  margin-top: -4px;
}

.tooltip {
  background-color: #333;
  padding: 2px 6px;
  border-radius: 3px;
  align-self: flex-end;
}

#infoBtn {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 10;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
}

#infoBtn:hover {
  background-color: #0056b3;
}

.dialog {
  display: none;
  position: fixed;
  z-index: 20; 
  left: 0;
  top: 0;
  width: 100%; 
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7); 
}

.dialog-content {
  background-color: #222;
  margin: 10% auto;
  padding: 20px;
  border-radius: 10px;
  width: 80%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: white;
  text-decoration: none;
  cursor: pointer;
}

@media (max-width: 768px) {
  #controls {
    top: auto;
    bottom: 10px;
    right: 10px;
    max-height: 50vh;
  }
  
  .dialog-content {
    margin: 5% auto;
    width: 90%;
    padding: 15px;
  }
  
  #infoBtn {
    bottom: 10px;
    left: 10px;
    padding: 8px 12px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  #controls {
    width: calc(100% - 20px);
    right: 10px;
  }
  
  #controls h1 {
    font-size: 1.2rem;
  }
  
  label {
    font-size: 0.8rem;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  #controls {
    top: 10px;
    bottom: auto;
    right: 10px;
    max-height: 80vh;
    width: 250px;
  }
  
  #controls h1 {
    font-size: 1rem;
    margin-bottom: 10px;
  }
  
  label {
    margin-bottom: 8px;
  }
}
