:root {
  color-scheme: light;
}

body {
  font-family: system-ui, sans-serif;
  margin: 0;
  padding: 2rem 1rem;
  background: #fff;
  color: #000;
}

main {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

textarea,
input[type="number"],
input[type="submit"] {
  font: inherit;
  color: #000;
  background: #fff;
  border: 2px solid #000;
  border-radius: 0;
}

textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem;
}

:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

input[type="number"] {
  width: 5.5rem;
  padding: 0.5rem;
}

input[type="submit"] {
  padding: 0.5rem 1.5rem;
  cursor: pointer;
}

input[type="submit"]:hover {
  background: #000;
  color: #fff;
}

.result {
  padding: 0.75rem;
  border: 2px solid #000;
}

.result.blocked {
  background: #000;
  color: #fff;
}

.scores {
  margin-top: 1.5rem;
  padding: 0.75rem;
  border: 2px solid #000;
  display: grid;
  grid-template-columns: max-content 1fr 3rem;
  gap: 0.75rem;
  align-items: center;
  text-align: left;
}

.score {
  display: contents;
}

.score-bar {
  position: relative;
  height: 1rem;
  border: 2px solid #000;
}

.score-fill {
  display: block;
  height: 100%;
  max-width: 100%;
  background: #000;
}

.score-threshold {
  position: absolute;
  top: -6px;
  bottom: -6px;
  width: 2px;
  margin-left: -1px;
  background: #000;
}

.score-value {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

@media (max-width: 480px) {
  .scores {
    grid-template-columns: 1fr 3rem;
    row-gap: 0.5rem;
  }

  .score-label {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
  }

  .score:first-child .score-label {
    margin-top: 0;
  }
}
