:root  {
  --c-correct: #4CAF50;
  --c-correct-faint: #e7f7e9;
  --c-incorrect: #F44336;
  --c-incorrect-faint: #fde8e6;
}

html {
  background: url(background-red.webp);
  background-size: cover;
  display: flex;
  min-height: 100dvh;
  justify-content: center;
}

body {
  background-color: white;
  box-shadow: 0 0 .5rem #00000080;
  font-family: "M PLUS 1", sans-serif;
  display: grid;
  gap: 1rem;
  grid-template-rows: auto 1fr;
  margin: 0;
  max-width: 40rem;
  width: 100%;
}

header {
  background-color: #eee;
  padding: 1rem;
  text-align: center;

  a {
    display: inline-block;
  }

  .logo {
    height: 2rem;
  }

  h1 {
    text-align: center;
    margin: 0;
  }
}

main {
  display: grid;
  gap: 2rem;
  grid-template-rows: auto 1fr auto auto;
  padding: 0 1rem;
}

.status {
  align-items: center;
  display: flex;
  gap: 1rem;
}

#progress-wrap {
  border: 2px solid;
  border-radius: 10px;
  height: 10px;
  overflow: hidden;
  width: 100%;
}

#progress-bar {
  background: black;
  height: 100%;
  transition: width .4s;
  width: 0;
}

#counter {
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

#quiz-area {
  align-items: center;
  display: grid;
  gap: 3rem;
  grid-template-rows: 1fr auto;
}

.question {
  display: block;
  font-size: 8rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.answers {
  display: flex;
  gap: .5rem;
  justify-content: space-between;
}

.answers__item {
  border: 2px solid;
  border-radius: 1rem;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 700;
  padding-block: 1rem;
  text-align: center;
  transition: all 100ms;
  width: 20%;

  input {
    position: absolute;
    opacity: 0;
  }

  &:hover {
    background: #eee;
  }

  &:has(:checked) {
    color: white;
    background-color: black;
    border-color: black;
  }
}

#next {
  appearance: none;
  background: black;
  border: none;
  border-radius: 10rem;
  color: white;
  cursor: pointer;
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  padding: 1.5rem;
  text-transform: uppercase;
  transition: opacity .3s;
  width: 100%;

  &:disabled {
    cursor: not-allowed;
    opacity: .2;
  }
}


/* Summary */

#summary {
  display: grid;
  font-size: 1.2rem;
  font-weight: 700;
  gap: 2rem;
  text-align: center;
}

.result {
  margin: 0;
}

.summary__answers {
  display: grid;
  gap: 1rem;
}

.summary__item {
  border: 2px solid;
  border-radius: 1rem;
  display: grid;
  gap: 2rem;
  padding: 2rem 0;
}

.summary__item.correct  {
  background: var(--c-correct-faint);
  border-color: var(--c-correct);
}

.summary__item.incorrect  {
  background: var(--c-incorrect-faint);
  border-color: var(--c-incorrect);
}
