
@font-face {
  font-family: "game";
  src: url("https://fonts.googleapis.com/css2?family=Poppins:wght@500;800&display=swap");
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

button:focus {
  outline: 0;
}

html,
body {
  height: 100%;
  font-family: "Poppins", sans-serif;
  color: #6e7888;
}

body {
  background-color: #1c2030;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #6e7888;
}

.wrapper {
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  
  /*border: 2px solid red;*/
}

canvas {
  background-color: #181825;
}

.container {
  display: flex;
  width: 100%;
  height: 100%;
  flex-flow: column wrap;
  justify-content: center;
  align-items: center;


  /*border: 3px solid yellow;*/
}

#ui {
  display: flex;
  align-items: center;
  font-size: 10px;
  flex-flow: column;
  margin-left: 10px;
}

h2 {
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 8px;
  margin-bottom: 30px;
  transform: rotate(270deg);
}

#score {
  margin-top: 20px;
  font-size: 35px;
  font-weight: 800;
  transform: rotate(-90deg);
}

#replay {
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  background: #6e7888;
  color: #222738;
  border: none;
  border-radius: 40px;
  transform: rotate(270deg);
  cursor: pointer;
  transition: all 200ms ease-in-out;
  letter-spacing: 1px;
}

#replay:hover {
  background: #a6aab5;
  background: #4cffd7;
  transition: all 200ms ease-in-out;
}

#replay svg {
  margin-right: 8px;
}

.hidden {
  display: none !important;
}

.start-screen {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 15px;
}

.start-screen input {
  background: #b0b0c0;
  color: #333;
  padding: 12px 18px;
  font-size: 18px;
  border: 2px solid #4cffd7;
  border-radius: 8px;
  outline: none;
  transition: 0.2s ease-in-out;
}

.start-screen input::placeholder {
  color: #6e7888;
}

.start-screen input:focus {
  box-shadow: 0 0 10px #4cffd7;
  border-color: #4cffd7;
}

.start-screen button {
  background: #4cffd7;
  padding: 12px 20px;
  font-size: 18px;
  font-weight: 700;
  color: #222738;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s ease-in-out;
}

.start-screen button:hover {
  background: #37bfa8;
  transform: scale(1.05);
}

.start-screen button:active {
  transform: scale(0.98);
}

#leaderboard {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #181825;
  padding: 30px 40px;
  border-radius: 20px;
  box-shadow: 0 0 25px rgba(76, 255, 215, 0.4);
  color: #4cffd7;
  text-align: center;
  min-width: 300px;
  animation: fadeIn 0.4s ease;
  z-index: 99;
}

#leaderboard h2 {
  transform: rotate(0deg);
  font-size: 22px;
  margin-bottom: 20px;
}

#leaderboard ul {
  list-style: none;
  padding: 0;
}

#leaderboard li {
  padding: 8px 0;
  font-size: 16px;
  color: #eee;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 10px;
}

#leaderboard li:last-child {
  border-bottom: none;
}

#lb-replay {
  margin-top: 20px;
  padding: 10px 20px;
  font-size: 16px;
  font-weight: 600;
  background: #6e7888;
  color: #222738;
  border: none;
  border-radius: 40px;
  cursor: pointer;
  transition: all 200ms ease-in-out;
}

#lb-replay:hover {
  background: #a6aab5;
  background: #4cffd7;
  transition: all 200ms ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -45%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@media (max-width: 600px) {
  #replay {
    margin-bottom: 20px;
    font-size: 18px;
  }

  #replay,
  h2 {
    transform: rotate(0deg);
  }

  #ui {
    flex-flow: row wrap;
    margin-bottom: 20px;
  }

  #ui h2 {
    font-size: 16px;
    margin-top: 30px;
  }

  #score {
    margin-top: 0;
    margin-left: 20px;
    transform: rotate(0deg)
  }

  .container {
    flex-flow: column wrap;
  }
  
  .start-screen {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }
}
