:root {
  --red: #a61d23;
  --clone-opacity: 0.4;
}

body {
  font-family: sans-serif;
  padding: 2rem 1rem;
  margin: 0;
  background-color: #2d3436;
  color: #fff;
}

.title {
  text-align: center;
  margin-bottom: 1em;
}

.main__map {
  flex-grow: 1;
  max-width: 640px;
}

.main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
  margin-inline: auto;
  max-width: 600px;
}

.mfd {
  background-color: #111;
  padding: 30px 50px;
  width: fit-content;
  border-radius: 10px;
}

.form {
  padding-top: 24px;
  gap: 1rem;
  display: flex;
  flex-direction: column;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group__inline {
  display: flex;
  align-items: center;
  gap: 1rem;

  input {
    flex-grow: 1;
    max-width: calc(100% - 6ch);
  }
}

.scope {
  border: 2px solid #fff;
  aspect-ratio: 1;
  position: relative;
  color: #fff;
  min-width: 300px;
}

.scope__azimuth {
  z-index: 10;
  > span {
    transform: translateX(-50%);
  }
}

.scope__azimuth-up {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;

  > span {
    --offset: 16.66%;

    position: absolute;
    top: 0;
    display: block;
    width: 2px;
    height: 8px;
    background-color: #fff;

    &:nth-child(1) {
      left: calc(1 * var(--offset));
    }

    &:nth-child(2) {
      left: calc(2 * var(--offset));
    }

    &:nth-child(3) {
      left: calc(3 * var(--offset));
      height: 16px;
    }

    &:nth-child(4) {
      left: calc(4 * var(--offset));
    }

    &:nth-child(5) {
      left: calc(5 * var(--offset));
    }
  }
}

.scope__azimuth-down {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;

  > span {
    --offset: 16.66%;

    position: absolute;
    bottom: 0;
    display: block;
    width: 2px;
    height: 8px;
    background-color: #fff;

    &:nth-child(1) {
      left: calc(1 * var(--offset));
    }

    &:nth-child(2) {
      left: calc(2 * var(--offset));
    }

    &:nth-child(3) {
      left: calc(3 * var(--offset));
      height: 16px;
    }

    &:nth-child(4) {
      left: calc(4 * var(--offset));
    }

    &:nth-child(5) {
      left: calc(5 * var(--offset));
    }
  }
}

.scope__range {
  position: absolute;
  bottom: 0;
  right: 0;
  height: 100%;

  > span {
    --offset: 25%;

    position: absolute;
    right: 0;
    display: block;
    width: 16px;
    height: 2px;
    background-color: #fff;
    transform: translateY(-50%);

    &:nth-child(1) {
      top: calc(1 * var(--offset));
    }

    &:nth-child(2) {
      top: calc(2 * var(--offset));
    }

    &:nth-child(3) {
      top: calc(3 * var(--offset));
    }

    &:nth-child(4) {
      top: calc(4 * var(--offset));
    }
  }
}

.scope__highlight {
  position: absolute;
  width: 2px;
  height: 100%;
  background-color: var(--red);
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.scope__highlight--clone {
  opacity: var(--clone-opacity, 0.4);
}

.scope__target {
  position: absolute;
  left: 50%;
  transform: translate(-50%, 26px) rotate(var(--ta, 0));
  transform-origin: 10px 10px;
  color: var(--red);
  transition: all 0.1s linear;
}

.scope__toolbox {
  position: absolute;
  right: 2px;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 2px;
}


.fighter {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 18px;
}

.bandit {
  position: absolute;
  bottom: 0;
  left: 0;
  transform: translate(-50%, 50%) scaleY(-1) rotate(var(--hdg, 0));
  width: 12px;
  height: 18px;
  transition: all 0.1s linear;
}

.bandit--clone {
  opacity: 0.4;
}
