:root {
  --clr-bg: hsl(216, 5%, 21%);
  --clr-text: hsl(55, 12%, 80%);

  --clr-primary-400: hsl(210, 2%, 40%);
  --clr-primary-900: hsl(225, 4%, 18%);

  --incorrect: hsl(354, 55%, 54%);
  --active: hsl(47, 84%, 48%);

  --radius: 0.75rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  color-scheme: light dark;
}

html,
body {
  height: 100%;
}

body {
  line-height: 1.6;
}

input,
button,
textarea,
select {
  font: inherit;
}

h1,
h2,
h3 {
  line-height: 1;
}

body {
  font-family: "Roboto Mono", monospace;
  display: grid;
  place-content: center;
  padding-inline: 1rem;
  background: var(--clr-bg);
  color: var(--clr-text);
  user-select: none;

  @media (min-width: 768px) {
    font-size: 1.25rem;
  }
}

.wrapper {
  max-width: 40em;
  padding: 2rem;
  border: 1px solid var(--clr-primary-400);
  border-radius: var(--radius);
  position: relative;
}

.input-field {
  opacity: 0;
  z-index: -999;
  position: absolute;
  top: 5rem;
  left: 3.5rem;
  width: 85%;
  height: 7rem;
}

.content-container {
  padding: 1rem 1.5rem 0;
}

.time {
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--active);
}

.typing-text-container {
  margin-block-start: 0.5rem;
  /* max-height: 7rem;
  overflow: scroll; */

  &::-webkit-scrollbar {
    width: 0;
  }
}

.typing-text {
  color: var(--clr-primary-400);

  & span {
    position: relative;

    &.correct {
      color: var(--clr-text);
    }

    &.incorrect {
      color: var(--incorrect);
    }

    &.active::before {
      content: "";
      position: absolute;
      height: 100%;
      width: 2px;
      bottom: 0;
      left: 0;
      opacity: 0;
      background: var(--active);
      animation: blink 1s ease-in-out infinite;
    }
  }
}

@keyframes blink {
  50% {
    opacity: 1;
  }
}

.content {
  margin-block-start: 2rem;
  display: grid;
  gap: 2rem;
}

.result-details {
  padding-block: 0.5rem;
  background: hsl(216, 5%, 18%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-radius: var(--radius);

  & li {
    display: grid;
    place-items: center;

    &:not(:last-child) {
      border-right: 2px solid var(--clr-primary-400);
    }
  }

  & .result-title {
    letter-spacing: 1px;
    color: var(--clr-primary-400);
  }

  & .result {
    color: var(--active);
    font-weight: 500;

    @media (min-width: 768px) {
      font-size: 1.5rem;
    }
  }
}

.btn {
  background: none;
  border: none;

  & i {
    color: var(--clr-primary-400);
    cursor: pointer;
    transition: color 250ms ease;

    &:is(:hover, :focus) {
      color: var(--clr-text);
    }
  }
}
