:root {
  --roundness: 0.5rem;
  --font: "Roboto Mono", "Vazirmatn", monospace;
  // scroll-behavior: smooth;
  scroll-padding-top: 2rem;
  font-weight: 400;
  --crt-bg-color-shine: color-mix(
    in oklab,
    var(--main-color) 5%,
    var(--bg-color)
  );
  --crt-bg-color-stripe: color-mix(in oklab, black 50%, var(--bg-color));
  --crt-sub-color-glow: color-mix(in srgb, var(--sub-color) 20%, transparent);
  --crt-sub-alt-color-glow: color-mix(
    in srgb,
    var(--sub-alt-color) 20%,
    transparent
  );
  --crt-text-color-glow: color-mix(in srgb, var(--text-color) 20%, transparent);
  --crt-main-color-glow: color-mix(in srgb, var(--main-color) 20%, transparent);
  --crt-error-color-glow: color-mix(
    in srgb,
    var(--error-color) 20%,
    transparent
  );
  --crt-caret-color-glow: color-mix(
    in srgb,
    var(--caret-color) 20%,
    transparent
  );
}

::placeholder {
  color: var(--sub-color);
  opacity: 1;
  /* Firefox */
}

::selection {
  background-color: var(--main-color);
  color: var(--sub-alt-color);
}

#app {
  min-height: 100vh;
  grid-template-rows: [top-start] auto [content-start] 1fr [content-end] auto [top-end];
  overflow: hidden;
  row-gap: 2rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
  width: 100%;
}

// from an amazing guide by Kevin Powell https://www.youtube.com/watch?v=c13gpBrnGEw
.content-grid {
  --padding-inline: 2rem;
  --content-max-width: 1536px;

  // --breakout-max-width: 1200px;

  // --breakout-size: calc(
  //   (var(--breakout-max-width) - var(--content-max-width)) / 2
  // );

  justify-content: center;
  display: grid;
  grid-template-columns:
    [full-width-start] minmax(0, var(--padding-inline))
    [full-width-padding-start] minmax(0, 1fr)
    // [breakout-start] minmax(0, var(--breakout-size))
    [content-start] min(
      100% - (var(--padding-inline) * 2),
      var(--content-max-width)
    )
    [content-end]
    // minmax(0, var(--breakout-size)) [breakout-end]
    minmax(0, 1fr) [full-width-padding-end]
    minmax(0, var(--padding-inline)) [full-width-end];
}

.content-grid > :not(.breakout, .full-width, .full-width-padding) {
  grid-column: content;
}

// #app > .breakout {
//   grid-column: breakout;
// }

.content-grid > .full-width {
  grid-column: full-width;
}

.content-grid > .full-width-padding {
  grid-column: full-width-padding;
}

#ad-vertical-left-wrapper,
#ad-vertical-right-wrapper {
  grid-row: content;
  margin-right: 2rem;
  position: fixed;
}

#ad-vertical-left-wrapper {
  grid-column: full-width-start/content-start;
  left: 0;
}

#ad-vertical-right-wrapper {
  grid-column: content-end/full-width-end;
  right: -2rem;
}

main {
  display: grid; //stupid fix for stupid safari
}

#nocss {
  display: none !important;
  pointer-events: none;
}

.ffscroll {
  scrollbar-width: thin;
  scrollbar-color: var(--sub-color) transparent;
}

html {
  @extend .ffscroll;
  overflow-y: scroll;
  scroll-behavior: smooth;
  line-height: 1.25;
}

a {
  display: inline-block;
  color: var(--sub-color);
  transition: color 0.125s, opacity 0.125s, background 0.125s;
  &:hover {
    color: var(--text-color);
  }
  &:focus-visible {
    outline: none;
    box-shadow: 0 0 0 0.1rem var(--bg-color), 0 0 0 0.2rem var(--text-color);
    border-radius: calc(var(--roundness) / 2);
  }
}

a[router-link] * {
  pointer-events: none;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text-color);
  overflow-x: hidden;
  background: var(--bg-color);
}

.customBackground {
  content: "";
  width: 100vw;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: -999;
  justify-content: center;
  align-items: center;
  display: flex;
}

#backgroundLoader {
  height: 3px;
  position: fixed;
  width: 100%;
  background: var(--main-color);
  animation: loader 2s cubic-bezier(0.38, 0.16, 0.57, 0.82) infinite;
  z-index: 9999;
}

key {
  color: var(--bg-color);
  background-color: var(--sub-color);
  /* font-weight: bold; */
  padding: 0.1rem 0.3rem;
  margin: 0rem 0rem;
  border-radius: 0.1rem;
  display: inline-block;
  font-size: 0.7rem;
  line-height: 0.7rem;
}

.pageLoading {
  height: 100%;
  display: grid;
  align-items: center;
}

.pageLoading,
.pageAccount {
  .preloader {
    text-align: center;
    justify-self: center;
    display: grid;
    .barWrapper {
      justify-content: center;
      display: grid;
      gap: 1rem;
      grid-row: 1;
      grid-column: 1;
      .bar {
        width: 20rem;
        height: 0.5rem;
        background: var(--sub-alt-color);
        border-radius: var(--roundness);
        .fill {
          height: 100%;
          width: 0%;
          background: var(--main-color);
          border-radius: var(--roundness);
          // transition: 1s;
        }
      }
    }
    .icon {
      grid-row: 1;
      grid-column: 1;
      font-size: 2rem;
      color: var(--main-color);
      margin-bottom: 1rem;
    }
  }
}

.devIndicator {
  position: fixed;
  font-size: 3rem;
  color: var(--sub-color);
  opacity: 0.25;
  z-index: -1;

  &.tl {
    top: 2rem;
    left: 2rem;
  }

  &.tr {
    top: 2rem;
    right: 2rem;
  }

  &.bl {
    bottom: 2rem;
    left: 2rem;
  }

  &.br {
    bottom: 2rem;
    right: 2rem;
  }
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

.invisible {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.scrollToTopButton {
  bottom: 4rem;
  right: 2rem;
  position: fixed;
  font-size: 2rem;
  width: 4rem;
  height: 4rem;
  text-align: center;
  line-height: 4rem;
  background: var(--sub-alt-color);
  border-radius: 99rem;
  z-index: 99;
  cursor: pointer;
  color: var(--sub-color);
  transition: 0.25s;
  &:hover {
    background: var(--text-color);
    color: var(--bg-color);
  }
}

.inputAndIndicator {
  input {
    width: 100%;
  }
  position: relative;
  .statusIndicator {
    width: 2.25em;
    height: 2.25em;
    position: absolute;
    right: 0;
    top: 0;
    /* background: red; */
    display: grid;
    grid-template-columns: 2.25em;
    grid-template-rows: 2.25em;
    place-items: center center;
    cursor: pointer;

    .indicator {
      grid-column: 1/2;
      grid-row: 1/2;
      &.level-1 {
        color: var(--error-color);
      }
      &.level0 {
        color: var(--sub-color);
      }
      &.level1 {
        color: var(--main-color);
      }
    }
  }
}

#devButtons {
  position: fixed;
  left: 0;
  top: 10rem;
  display: grid;
  grid-auto-flow: row;
  gap: 0.5rem;
  text-decoration: none;
  z-index: 999999999;
  border-radius: 0 1rem 1rem 0;

  .button {
    padding: 1rem;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }
}

.avatar {
  transition: opacity 0.125s, filter 0.125s, webkit-filter 0.125s;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 100%;
  background-position: center center;
  background-size: contain;
  background-repeat: no-repeat;
}

.badge {
  background: var(--sub-color);
  color: var(--text-color);
  border-radius: calc(var(--roundness) / 2);
  // padding: 0.15em 0.5em;
  -webkit-user-select: none;
  user-select: none;
  display: grid;
  grid-template-columns: max-content auto;
  align-items: baseline;
  .fas,
  .far {
    margin-right: 0.3rem;
    margin-left: 0.3rem;
    margin-top: 0.3rem;
    margin-bottom: 0.3rem;
    font-size: 0.9em;
  }
  .text {
    margin-right: 0.3rem;
  }
}

.notificationBubble {
  position: absolute;
  background: var(--main-color);
  width: 1em;
  height: 1em;
  font-size: 0.5em;
  line-height: 2em;
  color: transparent;
  border-radius: 100rem;
  right: 0.5em;
  top: 0.5em;
  box-shadow: 0 0 0 0.5em var(--bg-color);
  transition: 0.125s;
}

#fpsCounter {
  position: fixed;
  left: 0;
  top: 0;
  background: var(--sub-alt-color);
  color: rgb(255, 217, 0);
  padding: 0.25rem;
  width: 10ch;
  text-align: center;
  z-index: 999999999;
  &.main {
    color: var(--text-color);
  }
  &.error {
    color: var(--error-color);
  }
}
