src/assets/scss/components/_code.scss
$code-size-xs: 4rem;
$code-size-sm: 3rem;
$code-size-md: 4rem;
$code-size-lg: 5rem;

$code-numbers: (
  0: ($color-yellow, 20%),
  1: ($color-green, 20%),
  2: ($color-greendark, 20%),
  3: ($color-bluelight, 20%),
  4: ($color-bluedark, 40%),
  5: ($color-orange, 20%),
  6: ($color-lavender, 20%),
  7: ($color-turquoise, 25%),
  8: ($color-red, 20%),
  9: ($color-pink, 20%)
);

.code__content {
  display: flex;
}

.code-circle {
  color: white;
  width: 1em;
  height: 1em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 0.05em;

  line-height: 1;
  text-align: center;
  font-weight: 700;
  // border: 1px solid;
  position: relative;
  border-radius: 0.1em;
  // background: rgba(white, 0.1);
  background: rgba(black, 0.1);
  // box-shadow: 0 3px 4px rgba($alt-color, 0.1),
  //             0 0px 2px rgba($alt-color, 0.3);

  &:before {
    content: "";
    position: absolute;
    bottom: 0.05em;
    left: 0.05em;
    right: 0.05em;
    height: 0.1em;
    border-radius: 1em;
    transform-origin: top left;
    // width: 0.15em;
    background: $alt-color-light;
  }
  
  &.contains {
    // border: 1px solid rgba(white, 0.3);
  }
  &.contains.invalid {
    color: $alt-color-light !important;
    border-color: $color-red;
  }

  @each $index, $color in $code-numbers {
    &.code-circle--#{$index} {
      color: lighten(nth($color, 1), nth($color, 2));
      background: rgba(nth($color, 1), 0.1);
      &:before {
        background: nth($color, 1);
      }
    }
  }
  span {
    font-size: 0.50em;
    display: inline-block;
    margin-top: -0.2em;
  }
}

.code {
  font-size: $code-size-xs;
  @include media('sm') {
    font-size: $code-size-sm;
  }
  @include media('md') {
    font-size: $code-size-md;
  }
  @include media('lg') {
    font-size: $code-size-lg;
  }
}

.code__item {
  margin-right: 0.2em;

  @include media('sm') {
    margin-right: $code-margin;
  }

  &:last-child {
    margin-right: 0;
  }
}
