body,
html {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: Arial, sans-serif;
}

#app-container {
  position: relative;
  height: 100vh;
  background-color: #282c34;
}

#demoCanvas {
  width: 100%;
  height: 100%;
  border: 1px solid #fff;
}

#ui-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  align-items: flex-start;
}

#top-container {
  display: flex;
  justify-content: space-between;
  padding: 10px 10px 0 10px;
  width: 100%;
  box-sizing: border-box;
}

#bottom-container {
  padding: 0 10px 10px 10px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  justify-content: flex-start;
}

#upperPanelContainer {
  margin-right: 5px;
  margin-bottom: 5px;
}

#upperPanelContainer,
#upperRightPanelContainer,
#lowerPanelContainer {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
}

#controlPanel,
#debug,
.legend,
#infoPanel,
#toridPanel,
#enemyPanel {
  background-color: rgba(255, 255, 255, 0.8);
  padding: 10px;
  border-radius: 5px;
  font-size: 14px;
  user-select: none;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  max-width: fit-content;
  align-items: center;
  line-height: 1.5;
}

#controlPanel {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 5px;
}

#controlPanel > * {
  flex-shrink: 0;
}

#underControlPanel {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 5px;
}

#debug {
  font-family: monospace;
  font-size: 12px;
  color: #333;
}

.legend {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.legend h3 {
  margin-bottom: 5px;
  margin-top: 0;
  text-align: center;
  width: 100%;
}

.legend-item {
  display: flex;
  align-items: center;
  padding: 3px;
}

.legend-color {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
  pointer-events: auto;
}

.color-picker {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  padding: 0;
  margin: 0;
  border: none;
}

input,
label,
button {
  pointer-events: auto;
}

input[type="checkbox"] {
  display: none;
}

/* Create a custom rectangular checkbox button */
input[type="checkbox"] + label {
  display: inline-block;
  padding: 5px 10px;
  background-color: red;
  color: white;
  text-align: center;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

input[type="checkbox"]:checked + label {
  background-color: green;
}

.slider-container {
  display: flex;
  align-items: center;
  position: relative;
  column-gap: 5px;
}

.slider-value {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 12px;
}

input[type="text"] {
  width: 30px;
}

@media (max-width: 1000px) {
  #top-container {
    flex-direction: column;
  }
}

@media (max-width: 1000px) and (max-height: 760px) {
  #debug {
    display: none;
  }
}

.show-ui-button,
.hide-ui-button {
  padding: 5px 10px;
  background-color: rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.show-ui-button:hover,
.hide-ui-button:hover {
  background-color: rgba(255, 255, 255, 1);
}

.show-ui-button {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1000;
}

.hide-ui-button {
  margin-bottom: 10px;
}
