nav {
  font-size: 1rem;
  line-height: 1rem;
  color: var(--sub-color);
  display: grid;
  grid-auto-flow: column;
  gap: 0.5rem;
  // margin-bottom: -0.4rem;
  width: -moz-fit-content;
  width: fit-content;
  width: 100%;
  grid-template-columns: auto auto auto auto 1fr auto;

  button.showAlerts {
    position: relative;
  }

  .textButton {
    .text {
      font-size: 0.75em;
      align-self: center;
      .fas {
        margin-left: 0.33em;
      }
    }

    .icon,
    .loading,
    .user {
      width: 1.25em;
      height: 1.25em;
      // background: red;
      display: grid;
      place-content: center center;
    }
  }

  .accountButtonAndMenu {
    position: relative;
    .view-account {
      position: relative;
      align-items: center;
      gap: 0.33em;
      display: grid;
      grid-auto-flow: column;
      .loading,
      .user,
      .avatar {
        grid-column: 1/2;
        grid-row: 1/2;
        width: 1.25em;
        height: 1.25em;
      }

      // .loading,
      // .user {
      //   // margin-top: 0.1rem;
      // }

      .levelAndBar {
        transition: 0.125s;
      }

      .level {
        transition: 0.125s;
        width: max-content;
        font-size: 0.65em;
        line-height: 0.65em;
        align-self: center;
        color: var(--bg-color);
        background: var(--sub-color);
        padding: 0.4em 0.4em;
        border-radius: calc(var(--roundness) / 2);
      }

      .xpBar {
        opacity: 0;
        pointer-events: none;
        position: absolute;
        height: 0.25em;
        bottom: -0.5em;
        width: 100%;
        left: 0;
        background: var(--sub-alt-color);
        border-radius: var(--roundness);
        .bar {
          left: 0;
          width: 0%;
          height: 100%;
          background: var(--main-color);
          border-radius: var(--roundness);
        }
        .xpGain {
          position: absolute;
          left: 100%;
          margin-left: 0.5em;
          top: 0.2em;
          transform: translateY(-50%);
          font-size: 0.75em;
          color: var(--main-color);
        }
        .xpBreakdown {
          position: absolute;
          color: var(--text-color);
          display: grid;
          justify-items: center;
          width: 100%;
          margin-top: 0.75em;
          .text {
            width: max-content;
            font-size: 0.75em;
            position: absolute;
          }
        }
      }
      &:hover {
        .level {
          background-color: var(--text-color);
        }
        .userFlags {
          color: var(--text-color);
        }
      }
      &:focus-within {
        z-index: 10;
      }
    }
    .menu {
      // display: none;
      pointer-events: none;
      z-index: 5;
      opacity: 0;
      position: absolute;
      top: 99%;
      right: 0;
      font-size: 0.75rem;
      min-width: 23ch;
      width: 100%;
      transition: opacity 0.125s;

      .spacer {
        width: 100%;
        height: 0.5em;
        background: transparent;
      }

      .items {
        box-shadow: 0 0 0 0.5em var(--bg-color);
        background: var(--sub-alt-color);
        display: grid;
        border-radius: var(--roundness);
        gap: 0.25em;

        * {
          justify-content: left;
          padding-left: 0;
          border-radius: 0;
          gap: 0;
          i {
            margin-right: 0.7em;
            margin-left: 0.9em;
          }
          &:last-child {
            border-radius: 0 0 var(--roundness) var(--roundness);
          }
          &:first-child {
            border-radius: var(--roundness) var(--roundness) 0 0;
          }
          &:focus-visible {
            border-radius: var(--roundness);
          }
        }
      }
    }
    &:hover,
    &:focus-within {
      & .menu {
        pointer-events: all;
        opacity: 1;
      }
      // .view-account {
      // background: var(--sub-alt-color);
      // }
    }
  }

  .separator {
    width: 2px;
    height: 1rem;
    background-color: var(--sub-color);
  }
}

header {
  grid-template-areas: "logo menu";
  line-height: 2.3rem;
  font-size: 2.3rem;
  /* text-align: center; */
  // transition: 0.25s;
  // padding: 0 5px;
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: auto 1fr;
  z-index: 2;
  align-items: center;
  gap: 0.5rem;
  -webkit-user-select: none;
  user-select: none;

  #logo {
    // margin-bottom: 0.6rem;
    cursor: pointer;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem;
    transition: none;
    text-decoration: none;
    color: var(--text-color);
    padding: 0.35rem 0.25rem;
    margin-left: -0.25rem;
    margin-right: -0.25rem;

    .icon {
      width: 2.5rem;
      display: grid;
      align-items: center;
      background-color: transparent;
      // margin-bottom: 0.15rem;
      svg path {
        transition: 0.25s;
        fill: var(--main-color);
      }
    }
    .text {
      .top {
        position: absolute;
        left: 0.35em;
        font-size: 0.325em;
        line-height: 0.325em;
        color: var(--sub-color);
        transition: color 0.125s, opacity 0.125s;
      }
      position: relative;
      font-size: 2rem;
      line-height: 2rem;
      font-family: "Lexend Deca", sans-serif;
      transition: color 0.25s;
      font-weight: unset;
      margin-block-start: unset;
      margin-block-end: unset;
      margin-top: -0.23em;
    }
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;

    .bottom {
      margin-left: -0.15rem;
      color: var(--main-color);
      transition: 0.25s;
      cursor: pointer;
    }
    &:focus-visible {
      outline: none;
      box-shadow: 0 0 0 0.1rem var(--bg-color), 0 0 0 0.2rem var(--text-color);
      border-radius: var(--roundness);
      .text .top {
        opacity: 0;
        transition: none;
      }
    }
  }

  .config {
    grid-area: config;
    transition: 0.125s;
    .mobileConfig {
      display: none;
      .textButton {
        margin-right: -1rem;
        padding: 0.5rem 1rem;
        font-size: 2rem;
      }
    }

    .desktopConfig {
      justify-self: right;
      display: grid;
      // grid-auto-flow: row;
      grid-template-rows: 0.7rem 0.7rem 0.7rem;
      grid-gap: 0.2rem;
      // width: min-content;
      // width: -moz-min-content;
      // transition: 0.25s;
      /*   margin-bottom: 0.1rem; */
      justify-items: self-end;

      .group {
        // transition: 0.25s;

        .title {
          color: var(--sub-color);
          font-size: 0.5rem;
          line-height: 0.5rem;
          margin-bottom: 0.15rem;
        }

        .buttons {
          display: flex;
          .textButton {
            font-size: 0.7rem;
            line-height: 0.7rem;
            padding: 0px 0.15rem;
          }
        }
        &.disabled {
          pointer-events: none;
          opacity: 0.25;
        }
      }

      .punctuationMode {
        margin-bottom: -0.1rem;
      }

      .numbersMode {
        margin-bottom: -0.1rem;
      }
    }
  }
  //top focus
  &.focus {
    color: var(--sub-color) !important;

    .notificationBubble {
      opacity: 0;
    }

    .result {
      opacity: 0 !important;
    }

    .icon svg path {
      fill: var(--sub-color) !important;
    }

    #logo .text {
      color: var(--sub-color) !important;
      // opacity: 0 !important;
    }

    #logo .top {
      opacity: 0 !important;
    }

    .config {
      opacity: 0 !important;
    }

    nav {
      color: transparent;

      .textButton,
      button {
        color: transparent;
      }
      .avatar,
      .levelAndBar {
        opacity: 0 !important;
      }
    }
  }
}
