body {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background-color: var(--color-Neutral-900);
  color: var(--color-Neutral-0);
  font: var(--font-sora-200);
}

.header-main {
  display: flex;
  justify-content: space-between;
  align-items: start;
  padding: 1rem 0.8rem;
}

.logo-small {
  height: 1.5rem;
  width: auto;
}

.logo-large {
  height: 2rem;
  width: auto;
  display: none;
}

.personal-best-txt {
  display: none;
}

.header-main__score {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-Neutral-05);
  position: relative;
}

.reset-best-score {
  position: absolute;
  inset: 0;
  display: none;
  background-color: var(--color-Neutral-0);
  color: var(--color-Neutral-900);
  border: none;
  border-radius: 0.5rem;
}

.reset-best-score:hover {
  cursor: pointer;
}

.header-main__score:hover .reset-best-score {
  display: block;
}

.header-main__score-value {
  font: var(--font-sora-700);
  color: var(--color-Neutral-0);
}

main {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.typing-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0.8rem;
}

.stats-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.stats__stat {
  flex: 1;
  border-right: 1px solid var(--color-Neutral-Border);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--color-Neutral-05)
}

.stats__stat:last-child {
  border-right: none;
}

.stat__value {
  font: var(--font-sora-700);
  color: var(--color-Neutral-0);
  font-size: 1.5rem;
}

.controls {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.controls__control {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  border: 1px solid var(--color-Neutral-Border);
  border-radius: 0.5em;
  padding: 0.2em 0.5em;
  position: relative;
}

.controls__control img {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

#difficulty,
#time-mode {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  text-align: center;
  background-color: transparent;
  color: var(--color-Neutral-0);
  border: none;
  font: var(--font-sora-200);
  font-size: 0.8rem;
}

.difficulty-buttons {
  display: none;
}

.mode-buttons {
  display: none;
}

.typing-area {
  position: relative;
  flex: 1;
  overflow: hidden;
  min-height: 0;
  border-top: 1px solid var(--color-Neutral-Border);
  border-bottom: 1px solid var(--color-Neutral-Border);
}

.go-again-btn {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  margin-top: auto;
  background-color: var(--color-Neutral-800);
  font: var(--font-sora-600);
  color: var(--color-Neutral-0);
  width: 50%;
  align-self: center;
}

.go-again-btn img {
  margin-left: 0.5rem;
  height: 1rem;
  width: auto;
}

.typing-area__backdrop {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background: rgba(255, 255, 255, 0.04);
  z-index: 1;
  border-radius: 0.5rem;
  width: 100%;
  height: 100%;
}

.typing-area__top-layer {
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%;
}

.btn {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  border-radius: 0.5em;
  padding: 0.5em 1em;
  border: none;
}

.restart-btn {
  display: none;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  border-radius: 0.5em;
  padding: 0.5em 1em;
  border: none;
  margin-top: auto;
  background-color: var(--color-Neutral-800);
  font: var(--font-sora-600);
  color: var(--color-Neutral-0);
  width: 50%;
  align-self: center;
}

.btn:hover {
  filter: brightness(1.2);
  cursor: pointer;
}

.typing-area__start-btn {
  background-color: var(--color-Blue-600);
  color: var(--color-Neutral-0);
  font: var(--font-sora-600);
  z-index: 2;
  position: relative;
}

.typing-area__text {
  color: var(--color-Neutral-05);
  font: var(--font-sora-400);
  z-index: 2;
  position: relative;
  margin-block-start: 0.8rem;
}


.typing-area__test-text,
.typing-area__input {
  position: absolute;
  top: 0;
  left: 0;
  box-sizing: border-box;

  width: 100%;
  height: 100%;
  margin: 0;
  padding: 1rem;

  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.typing-area__test-text {
  z-index: 0;
  overflow: hidden;
  color: var(--color-Neutral-0);
  pointer-events: none;
}

.typing-area__input {
  z-index: 1;
  resize: none;
  overflow: hidden;
  border: none;
  outline: none;
  background: transparent;
  color: var(--color-Neutral-0);
  caret-color: transparent;
  Opacity: 0;
}

.dim {
  opacity: 0.5;
}

.correct {
  color: var(--Green-500);
}

.incorrect {
  color: var(--Red-500);
  text-decoration: underline;
}


.red-font {
  color: var(--Red-500);
}

.green-font {
  color: var(--Green-500);
}

.yellow-font {
  color: var(--Yellow-400);
}

.current-char {
  text-decoration: underline;
  background-color: var(--color-Neutral-400);
  text-decoration-thickness: 2px;
}

.results,
.first-result,
.achievement {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
}

.results__header,
.achievement__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  row-gap: 1rem;
  margin: 0.5rem;
  position: relative;
  line-height: 2.5em;
  text-align: center;
}

.results__header h1 {
  font-size: 1.5rem;
  font-weight: 800;
}

.results__header p {
  font-size: 0.9rem;
  text-align: center;
  opacity: 0.5;
  line-height: 1.2em;
  ;
}

.personal-scores {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: start;
  row-gap: 1rem;
  margin-block-start: 2rem;
  align-items: stretch;
  position: relative;
}

.personal-scores__score {
  border: 1px solid var(--color-Neutral-Border);
  border-radius: 1em;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.personal-scores__score-label {
  opacity: 0.5;
  font-weight: 500;
}

.button-container {
  width: 20rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  margin-block-start: 2rem;
}

.beat-score {
  position: relative;
  width: 100%;
  background-color: var(--color-Neutral-0);
  width: clamp(7rem, 60%, 20rem);
  align-self: center;
  padding: 0.8rem 1rem;
  border-radius: 0.8em;
  font-size: 1rem;
  font-weight: 600;
}

.icon-beat-restart {
  height: 1em;
  filter: brightness(0);
  margin-inline-start: 0.5em;
}

.tick-mark-svg,
.new-personal-svg {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background-color: #90e3ae;

  display: flex;
  justify-content: center;
  align-items: center;

  box-shadow:
    0 0 0 8px rgba(74, 222, 128, 0.12),
    0 0 0 16px rgba(74, 222, 128, 0.06);

  margin-block-end: 1rem;
}

.weight-700 {
  font-weight: 700;
}

.star-2-wrapper {
  position: absolute;
  left: 1rem;
  top: 2rem;
  width: 1.25rem;
  height: 1.25rem;
}

.star-2-wrapper::before {
  content: "";
  position: absolute;
  width: 0.6rem;
  height: 0.6rem;
  background: rgb(255 0 0 / 35%);
  border-radius: 50%;
  top: 50%;
  left: 25%;
  z-index: 0;
}

.star-2 {
  position: relative;
  width: 100%;
  height: 100%;
  opacity: 0.7;
  z-index: 1;
}

.star-1 {
  position: absolute;
  bottom: clamp(-3rem, -200%, -2rem);
  right: clamp(-3rem, -100%, -2rem);
  width: 2.5rem;
  height: 2.5rem;
}

.confetti {
  width: 100%;

}