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

body {
  background-color: #352f44;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  user-select: none;

  /* stuff that sass won't compile to */
  -webkit-touch-callout: none;
  -khtml-user-select: none;
}

#canvasJoystick {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

#container {
  display: flex;
  justify-content: center;
}

#canvasWrapper {
  display: flex;
  position: relative;
}

#settingsButton {
  position: absolute;
  z-index: 999;
  width: 2.5%;
  height: 2.5%;
  background-image: url(./assets/icons/cogwheel.png);
  background-repeat: no-repeat;
  background-size: cover;
  border-radius: 50%;
  cursor: pointer;
  top: 4px;
  right: 4px;
  animation: rotation 10s infinite linear;
  display: none;
}

@media only screen and (max-width: 768px) {
  #settingsButton {
    width: 5%;
    height: 5%;
  }
}

#settingsMenu {
  position: absolute;
  z-index: 999;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(255, 255, 255, 0.2509803922);
  color: white;
  border-radius: 4px;
  display: none;
  user-select: none;
}

#settingsMenu .inner {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

@keyframes rotation {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

#canvas1 {
  cursor: url(./assets/images/crosshair.png) 16 16, auto;
}

.hidden {
  display: none;
}

/* CSS */
.button {
  align-items: center;
  appearance: none;
  background-color: #fcfcfd;
  border-radius: 4px;
  border-width: 0;
  box-shadow: rgba(45, 35, 66, 0.4) 0 2px 4px,
    rgba(45, 35, 66, 0.3) 0 7px 13px -3px, #d6d6e7 0 -3px 0 inset;
  box-sizing: border-box;
  color: #36395a;
  cursor: pointer;
  display: inline-flex;
  font-family: "JetBrains Mono", monospace;
  justify-content: center;
  line-height: 1;
  list-style: none;
  overflow: hidden;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 16px;
  padding-right: 16px;
  position: relative;
  text-align: left;
  text-decoration: none;
  transition: box-shadow 0.15s, transform 0.15s;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  white-space: nowrap;
  will-change: box-shadow, transform;
  font-size: 18px;
}

.button:focus {
  box-shadow: #d6d6e7 0 0 0 1.5px inset, rgba(45, 35, 66, 0.4) 0 2px 4px,
    rgba(45, 35, 66, 0.3) 0 7px 13px -3px, #d6d6e7 0 -3px 0 inset;
}

.button:hover {
  box-shadow: rgba(45, 35, 66, 0.4) 0 4px 8px,
    rgba(45, 35, 66, 0.3) 0 7px 13px -3px, #d6d6e7 0 -3px 0 inset;
  transform: translateY(-2px);
}

.button:active {
  box-shadow: #d6d6e7 0 3px 7px inset;
  transform: translateY(2px);
}

input[type="range"] {
  cursor: pointer;
}

/* Auto shoot switch */

/* The switch - the box around the slider */
:root {
  --container-width: 26px;
  --container-height: 16px;
}

.switch-container {
  width: var(--container-width);
  height: var(--container-height);
  position: relative;
}

/* Hide default HTML checkbox */
.checkbox {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch {
  width: 100%;
  height: 100%;
  display: block;
  background-color: #e9e9eb;
  border-radius: var(--container-height);
  cursor: pointer;
  transition: all 0.2s ease-out;
}

/* The slider */
.slider {
  width: var(--container-height);
  height: var(--container-height);
  position: absolute;
  left: calc(50% - var(--container-height) / 2 - 10px);
  top: calc(50% - var(--container-height) / 2);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.15), 0px 3px 1px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease-out;
  cursor: pointer;
}

.checkbox:checked + .switch {
  background-color: #0074fd;
}

.checkbox:checked + .switch .slider {
  left: calc(50% - var(--container-height) / 2 + 10px);
  top: calc(50% - var(--container-height) / 2);
}
