* {
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
}

body {
  counter-reset: fav;
}
form {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
      flex-wrap: wrap;
  width: 800px;
  height: auto;
  margin: 0 auto;
  padding: 16px;
	font-size: 16px;
}

form fieldset {
  position: relative;
  width: 6rem;
  height: 40px;
  text-align: center;
  line-height: 35px;
  margin-right: .5rem;
  margin-bottom: .5rem;
}
form fieldset:last-child {
  margin-right: 0;
}
form fieldset label {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 1;
  top: 0;
  left: 0;
  border: 1px solid #ccc;
  border-radius: 2px;
  -webkit-transition: .32s;
  transition: .32s;
  text-transform: uppercase;
  font-size: .75rem;
  font-weight: 700;
}
form fieldset input {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
form fieldset input:checked {
  counter-increment: fav;
}
form fieldset input:hover + label {
  border: 1px solid #999;
  color: #999;
}
form fieldset input:checked + label {
  background: #59f;
  border: 1px solid #597;
  color: #fff;
}
form .result {
  position: relative;
  -ms-flex-preferred-size: 100%;
      flex-basis: 100%;
  margin-top: .5rem;
}
form .result:after {
  content: counter(fav);
}
