::selection {
  background: #f6e58d;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Raleway', sans-serif;
  background: #fff;
}

.flex {
  display: flex;
}

.center {
  text-align: center;
}

.middle {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.relative {
  position: relative;
}

h1 {
  font-size: 50px;
  text-align: center;
}

.fault {
  padding: 10px;
  background: rgba(214, 48, 49,0.4);
  color: #fff;
  text-align: center;
  margin-bottom: 10px;
  font-weight: bold;
  border-radius: 5px;
  letter-spacing: 2px;
  display: none;
  position: relative;
}

.fault i {
  right: 5px;
  top: 5px;
  position: absolute;
  cursor: pointer;
}

input[type="text"] {
  height: 50px;
  border-radius: 6px;
  border: 3px solid #999;
  width: 450px;
  font-size: 25px;
  padding: 0 10px;
  outline: none;
  transition: 0.3s;
}

input[type="text"]:hover {
  border-color: #3498db;
}

input[type="text"]:focus {
  border-color: #2980b9;
}

button {
  height: 55px;
  width: 100px;
  background: #2ecc71;
  color: #fff;
  outline: none;
  border: none;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
  border-radius: 3px;
  position: relative;
  margin-left: 5px;
  overflow: hidden;
}

button:before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 4px;
  background: #27ae60;
  transition: 0.2s;
}

button:after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 0;
  background: #27ae60;
  transition: 0.2s;
}

button:active {
  box-shadow: inset 0 0 5px #666;
}

button:active:before {
  height: 0;
}

button:active:after {
  height: 4px;
}

button span {
  transition: 0.2s;
  display: block;
}

button:active span{
 transform: translateY(2px);
}


.box {
  height: 200px;
  width: 300px;
  margin: 20px auto;
  overflow-x: hidden;
}

.bar {
  height: 40px;
  line-height: 40px;
  border-top: 1px solid #999;
  padding: 0 10px;
  box-sizing: border-box;
  transition: 0.2s;
}

.bar:hover {
  background: #f1f1f1;
}

.name {
  font-size: 20px;
}

.random-btn {
  width: 150px;
  height: 50px;
  margin: auto;
  cursor: pointer;
  text-align: center;
  line-height: 50px;
  background: #3498db;
  border-radius: 7px;
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  transition: 0.3s;
  display: none;
  position: relative;
  overflow: hidden;
}

.random-btn:active {
  transform: scale(0.95);
}

.random-btn-text {
  width: 100%;
  height: 100%;
  background: transparent;
  z-index: 10;
  position: absolute;
}

.loading {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: #2980b9;
  z-index: 0;
}

@keyframes loading {
  0%{
    width: 0;
  }
  40%{
    width: 40%;
  }
  70%{
    width: 70%;
  }
  80%{
    width: 80%;
  }
  90%{
    width: 90%;
  }
  100%{
    width: 100%;
  }
}

.counter {
  position: absolute;
  left: 0;
  font-size: 25px;
  width: 50px;
  height: 50px;
  text-align: center;
  line-height: 50px;
  border: 2px solid #888;
  border-radius: 7px;
  cursor: default;
  transition: 0.3s;
}

.counter:hover {
  border-color: #333;
}

.clear {
  position: absolute;
  right: 0;
  width: 50px;
  height: 50px;
  border-radius: 5px;
  background: #ff3838;
  text-align: center;
  line-height: 50px;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  transition: 0.3s;
}

.clear:hover {
  background: #ff1838;
}

.random-bar {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 250px;
  height: 170px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 5px #000;
  z-index: 100;
  display: none;
}

.closebar {
  position: absolute;
  right: 7px;
  top: 5px;
  cursor: pointer;
  font-size: 18px;
}

.result {
  font-size: 22px;
  color: #3498db;
  font-weight: bold;
  margin: 25px 0;
}

.again {
  width: 60px;
  height: 33px;
  background: #2ecc71;
  border-radius: 5px;
  text-align: center;
  line-height: 33px;
  font-size: 20px;
  color: #fff;
  cursor: pointer;
  transition: 0.3s;
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
}

.again:hover {
  background: #27ae60;
}

.dark {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
}
