@font-face {
  font-family: Fredoka;
  src: url("fonts/Fredoka.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: #fffbeb;
  color: #78350f;
  font: 600 1rem/1.4 Fredoka, system-ui, sans-serif;
}
main { text-align: center; padding: 1.5rem 1rem; }
h1 { margin: 0 0 1.5rem; font-size: 1.875rem; line-height: 1.2; }
form { display: flex; align-items: center; justify-content: center; gap: .75rem; flex-wrap: wrap; }
input, button { height: 4rem; border-radius: .75rem; font: inherit; font-weight: 700; }
input {
  width: 5rem;
  border: .25rem solid #fbbf24;
  background: white;
  color: inherit;
  text-align: center;
  font-size: 1.875rem;
  appearance: textfield;
}
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button { appearance: none; }
input::placeholder { color: #717986; opacity: 1; }
.plus { font-size: 2.25rem; color: #b45309; line-height: 1; }
button { border: 0; padding: 0 1.5rem; color: white; font-size: 1.25rem; cursor: pointer; }
.go { background: #15803d; }
.reset { background: #bc3f60; }
button:hover { filter: brightness(.92); }
button:active { transform: translateY(1px); }
:focus-visible { outline: .18rem solid #78350f; outline-offset: .2rem; }
figure {
  position: relative;
  width: min(calc(100% - 2.5rem), 45.5rem);
  margin: 2rem auto 0;
  height: 8rem;
}
#line { position: absolute; top: 5rem; width: 100%; height: 3px; background: currentColor; }
.tick { position: absolute; top: -.5rem; transform: translateX(-50%); padding-top: 1.25rem; font-size: .9375rem; }
.tick::before { content: ""; position: absolute; top: 0; left: 50%; height: 1.125rem; border-left: 2px solid; transform: translateX(-50%); }
.car { position: absolute; top: .25rem; left: var(--end); transform: translateX(-50%); animation: drive var(--duration) ease-in-out both; }
.track { position: absolute; top: 2.375rem; left: var(--start); width: calc(var(--end) - var(--start)); height: 4px; background: repeating-linear-gradient(to right, #332d28 0 6px, transparent 6px 10px); animation: trail var(--duration) ease-in-out both; }
@keyframes drive { from { left: var(--start); } to { left: var(--end); } }
@keyframes trail { from { width: 0; } to { width: calc(var(--end) - var(--start)); } }
@media (prefers-reduced-motion: reduce) { .car, .track { animation: none; } }
#hint { color: #92400e; font-size: 1.125rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 35rem) {
  main { padding-inline: .5rem; }
  form { gap: .4rem; }
  input { width: 3.5rem; }
  button { padding-inline: .8rem; }
  figure { width: calc(100% - 2.25rem); }
  #line.dense .tick:nth-child(even) { padding-top: 2.4rem; }
}
