.as-centered-row {
  display: flex;
  justify-content: center;

  & > div {
    width: 100%;
  }
}

.as-centered {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.as-space-around {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  height: 100%;
}
.as-space-between {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  height: 100%;
}
.as-row {
  flex-direction: row;
}

.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}
.pad-top-10 {
  padding-top: 10px;
}
.pad-bottom-10 {
  padding-bottom: 10px;
}
.pad-top-20 {
  padding-top: 20px;
}
.pad-bottom-20 {
  padding-bottom: 20px;
}

.hidden {
  display: none;
}
.canvas-hidden {
  /* PREVENT PIXI CANVAS DIMENSIONS FROM CHANGING WHEN HIDDEN.
   * (USING `display: none;` CAUSES ELEMENTS TO HAVE NO WIDTH/HEIGHT, THUS PIXI CANVAS DIMENSIONS ARE 0 x 0.)
   */
  visibility: hidden;
  pointer-events: none;
}
.hide-mobile {
  @media screen and (max-width: $mobile-max-width) {
    display: none;
  }
}
.hide-desktop {
  @media screen and (min-width: $desktop-min-width) {
    display: none;
  }
}

.container {
  margin: 0 auto;
}

.navigation {
  justify-items: center;
}

.actions {
  display: flex;
  justify-content: center;
  margin-left: 40px;
  margin-right: 40px;

  button {
    margin: 0 8px;
    width: 100%;
    font-size: 11px;
    cursor: pointer;

    &:focus,
    &:hover {
      background-color: $color-highlight;
      color: $color-light;
      border-color: $color-highlight;
    }
  }
}

.highlight {
  color: $color-light;
  text-transform: capitalize;
}
.highlight-yellow {
  color: $color-yellow;
}

.subtext {
  color: $color-xLightGrey !important;
  margin-bottom: 18px;
}

.arrows {
  margin-top: 15px;

  .row {
    width: 168px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
  }
  .row:nth-child(2) {
    justify-content: space-between;
    flex-direction: row;
  }

  .arrow {
    display: block;
    width: 64px;
    height: 48px;
    background: $color-dark;
    border: 1px solid $color-grey;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    color: $color-highlight;

    &:focus,
    &:hover {
      background-color: $color-highlight;
      border-color: $color-highlight;
      color: $color-light;
    }

    &[disabled] {
      cursor: auto;
      color: rgba($color-grey, 0.5);
      border-color: $color-grey;
      background-color: inherit;
    }

    svg {
      display: block;
      width: 18px;
      height: 18px;
      margin: 0 auto 3px auto;
      fill: currentColor;
    }

    &.arrow-south svg {
      transform: rotate(180deg);
    }
    &.arrow-east svg {
      transform: rotate(90deg);
    }
    &.arrow-west svg {
      transform: rotate(-90deg);
    }
  }
}

.tag {
  display: inline-block;
  font-size: 16px;
  padding: 3px 6px;
  margin-right: 4px;
  border-radius: 2px;
  color: $color-xLightGrey;
  line-height: 1em;
  background-color: rgba($color-lightGrey, 0.1);

  &.tag--light {
    color: $color-dark;
    background-color: $color-lightGrey;
  }
}

.spacer {
  &.line {
    border: 1px solid rgba($color-grey, 0.2);
    &.light {
      border-color: rgba($color-grey, 0.6);
    }
  }
  &.horizontal {
    width: 100%;
    height: 0;
    margin-top: 10px;
    margin-bottom: 10px;
  }
  &.vertical {
    margin-left: 10px;
    margin-right: 10px;
  }
}


a.highlight,
button.highlight {
  position: relative;
  display: inline-block;
  // Done this way to get around overflow hidden in parent elements, otherwise would just use `outline`.
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    border: 1px solid $color-blue;
    border-radius: 1px;
  }
}

@media screen and (min-width: $desktop-min-width) {
  .with-desktop-scrollbars {
    @include with-scrollbars;
  }
}

// BoxButton
a.btn {
  display: inline-block;

  &.secondary {
    display: inline-flex;
    vertical-align: top;
  }
}
.btn {
  height: 40px;
  width: 40px;
  box-sizing: border-box;
  border: 1px solid $color-light;
  align-items: center;
  justify-content: center;
  margin: 0;
  border-radius: 1px;
  appearance: none;
  -webkit-appearance: none;
  background: none;
  color: $color-light;
  cursor: pointer;
  font-size: 14px;
  line-height: 1em;
  pointer-events: all;
  -moz-user-select: none;
  -webkit-user-select: none;
  user-select: none;
  transition: opacity 0.12s ease-out, filter 0.12s ease-out;

  &:focus,
  &:hover {
    opacity: 0.82;
  }

  &:disabled,
  &[disabled] {
    opacity: 0.2 !important;
    filter: alpha(opacity=50);
    cursor: not-allowed;
  }

  &.tab {
    width: 100%;
    height: 100%;
    border: none;
  }
  &.slot {
    width: 100%;
    height: auto;
    border: none;
  }
  &.plain {
    width: auto;
    // safari bugs out with "auto"
    height: 1.3em;
    border: none;

    &.underline {
      text-decoration: underline;
    }

    &.link {
      padding: 0;
      color: $color-highlight;

      &:focus,
      &:hover {
        opacity: 0.6;
      }
    }
  }
  &.primary.subtle {
    border: none;
    background: lighten($color-dark, 8);
  }
  &.secondary-small {
    height: 26px;
    width: auto;
    min-width: 26px;
    background: $color-dark;
    border: 1px solid $color-btn-grey;
    padding: 2px;

    &-wide {
      height: 24px;
      border: 1px solid $color-btn-grey;
      width: 100px;
      font-size: 10px;
    }
  }
  &.secondary {
    position: relative;
    height: 40px;
    width: 40px;
    background: $color-dark;
    border: 0px solid $color-xLightGrey;
    padding: 2px;
  }
  &.secondary-action {
    position: relative;
    height: 32px;
    width: auto;
    min-width: 25%;
    font-size: 12px;
    color: $color-xLightGrey;
    border: 1px solid $color-grey;
    padding: 2px 12px;
  }
  &.loot-action {
    width: 100%;
    min-height: 32px;
    border: 1px solid $color-grey;
    font-size: 12px;

    &.selected {
      background: $color-grey;
    }

    &:hover,
    &:focus {
      background: lighten($color-dark, 18);
    }
  }
  &.full {
    width: 100%;
    max-width: unset;
    border: 1px solid $color-grey;
    background: $color-light;
    color: $color-black;
  }
  &.wide {
    width: 100%;
    max-width: 260px;

    &.selected {
      background: $color-light;
      color: $color-dark;
    }

    &.full {
      max-width: unset;
    }
  }
  &.nav {
    border-color: $color-grey;
    border-radius: 1px;
  }
  // @media (max-width: 375px) {
  //   &.wide {
  //     width: 100%;
  //   }
  // }
  &.large {
    width: 60px;
    height: 60px;
  }
  &.map-footer-icon {
    border: 1px solid $color-btn-grey;

    @media screen and (max-width: $mobile-max-width) {
      width: 30px;
      height: 30px;
    }
  }
  &.quick-action {
    padding: 2px 6px;
    border-color: $color-grey;
    font-size: 12px;
    border-radius: 2px;
    // &:not(.emphasize) {
    //   filter: grayscale(1);
    // }
    // &:hover {
    //   filter: grayscale(0);
    // }
  }
  &.badge {
    position: relative;

    &:after {
      content: '';
      position: absolute;
      display: block;
      top: -1px;
      right: -1px;
      z-index: 2;
      width: 6px;
      height: 6px;
      border-radius: 6px;
      background-color: $color-highlight;
    }
  }
}

.flex.tabs {
  margin: 12px 0 6px 0;
  border: 1px solid $color-light;
  border-radius: 1px;

  &.with-arrows button {
    position: relative;
    width: 50%;
    height: 32px;
    border: none;

    &.selected {
      &:after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        left: 100%;
        width: 12px;
        background: transparent;
        border: 16px solid transparent;
        border-left-width: 12px;
        border-right-width: 0;
        border-left-color: $color-light;
      }
      &:last-child {
        &:after {
          left: auto;
          right: 100%;
          border-right-width: 12px;
          border-left-width: 0;
          border-right-color: $color-light;
          border-left-color: transparent;
        }
      }
    }
  }

  .btn {
    max-width: unset;
  }

  img {
    height: 16px;
    mix-blend-mode: difference;
    vertical-align: text-bottom;
  }
}

.selectable {
  user-select: text;
}

.highlight {
  color: $color-light;
  font-style: normal;
}
