
/* ----- The actual thing ----- */

/* Variables */

:root {
  --scoring-size: 3rem;
  --bar-size: 0.5rem;
  --background-color: #e7f2fa;
  --scoring-color-default: #2980b9;
  --scoring-color-background: #c7e1f3;
  --scoring-color-good: #27ae60;
  --scoring-color-meh: #f1c40f;
  --scoring-color-bad: #e74c3c;
}

/* scoring item */
.scoring {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 100%;
  overflow: hidden;

  background: var(--scoring-color-default);
  color: var(--scoring-color-default);
  width: var(--scoring-size);
  height: var(--scoring-size);

  /* Basic style for the text */
  font-size: calc(var(--scoring-size) / 3);
  line-height: 1;
}

/* scoring circle content */
.scoring span {
  position: relative;
  display: flex;
  font-weight: bold;
  z-index: 2;
}

.scoring span small {
  font-size: 0.5em;
  font-weight: 900;
  align-self: center;
}

/* Bar mask, creates an inner circle with the same color as thee background */
.scoring::after {
  content: "";
  position: absolute;
  top: var(--bar-size);
  right: var(--bar-size);
  bottom: var(--bar-size);
  left: var(--bar-size);
  background: var(--background-color);
  border-radius: inherit;
  z-index: 1;
}

/* Bar background */
.scoring::before {
  content: "";
  position: absolute;
  top: var(--bar-size);
  right: var(--bar-size);
  bottom: var(--bar-size);
  left: var(--bar-size);
  border-radius: inherit;
  box-shadow: 0 0 0 1rem var(--scoring-color-background);
  z-index: -1;
}

/* Classes to give different colors to scorings, based on their score */
.scoring.good {
  background: var(--scoring-color-good);
  color: var(--scoring-color-good);
}

.scoring.meh {
  background: var(--scoring-color-meh);
  color: var(--scoring-color-meh);
}

.scoring.bad {
  background: var(--scoring-color-bad);
  color: var(--scoring-color-bad);
}
