@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
  --primary-color: #516dff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  font-family: 'Press Start 2P', sans-serif;
  text-align: center;
  background-color: var(--primary-color);
  color: #fff;
  overflow: hidden;
}

h1 {
  line-height: 1.4;
}

button {
  appearance: none;
  font-family: inherit;
  cursor: pointer;
}

.screen {
  display: grid;
  place-content: center;
  place-items: center;
  min-height: 100vh;
  width: 100vw;
  transition: margin 0.5s ease-out;
  &.up {
    margin-top: -100vh;
  }
}

.btn {
  padding: 15px 20px;
  color: var(--primary-color);
  border: 0;
  background: #fff;
  &:hover {
    opacity: 0.9;
  }
  &:focus {
    outline: 0;
  }
}

.insect-list {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.choose-insect-btn {
  width: 150px;
  height: 150px;
  color: #fff;
  background-color: transparent;
  border: 2px solid #fff;
  &:hover {
    background-color: #fff;
    color: var(--primary-color);
  }
  &:active {
    background-color: rgba(255, 255, 255, 0.7);
  }
  span {
    font-size: 64px;
  }
}

.game-container {
  position: relative;
}

.time,
.score {
  position: absolute;
  top: 20px;
}
.time {
  left: 20px;
}
.score {
  right: 20px;
}

.message {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 100;
  width: 100%;
  padding: 20px;
  line-height: 1.7;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translate(-50%, -150%);
  transition: transform 0.4s ease-in;
  &.visible {
    opacity: 1;
    transform: translate(-50%, 150%);
  }
}

.insect {
  position: absolute;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  transform: translate(-50%, -50%) scale(1);
  transition: transform 0.3s ease-in-out;
  cursor: pointer;
  &.caught {
    transform: translate(-50%, -50%) scale(0);
  }
  span {
    font-size: 64px;
    pointer-events: none;
  }
}
