* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Courier New", monospace;
  overflow: hidden;
  color: white;
}

#loadingScreen,
#gameScreen {
  width: 100vw;
  height: 100vh;
  background-image: url("background.jpg");
  background-size: cover;
  background-position: center;
}

#loadingScreen {
  display: flex;
  justify-content: center;
  align-items: center;
}

.loadingBox {
  width: 85%;
  max-width: 380px;
  background: rgba(0, 0, 0, 0.65);
  border: 3px solid white;
  border-radius: 18px;
  padding: 25px;
  text-align: center;
  backdrop-filter: blur(4px);
}

h1 {
  font-size: 2.5rem;
  margin: 0;
}

.bar {
  width: 100%;
  height: 18px;
  border: 2px solid white;
  margin: 20px 0;
  border-radius: 20px;
  overflow: hidden;
}

.fill {
  height: 100%;
  width: 100%;
  background: white;
  animation: load 2s ease forwards;
}

button {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: white;
  color: black;
  font-family: "Courier New", monospace;
  font-weight: bold;
  font-size: 1rem;
}

#gameScreen {
  display: none;
  position: relative;
}

.character {
  position: absolute;
  bottom: 150px;
  left: 50%;
  width: 260px;
  max-width: 75vw;
  transform: translateX(-50%) translateY(100vh);
  opacity: 0;
}

.character.enter {
  animation: slideBounce 1.2s ease-out forwards, hover 2.2s ease-in-out infinite 1.2s;
}

.dialogue {
  position: absolute;
  bottom: 20px;
  left: 50%;
  width: 90%;
  max-width: 430px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.72);
  border: 3px solid white;
  border-radius: 18px;
  padding: 18px;
  opacity: 0;
}

.dialogue.show {
  animation: fadeUp 0.8s ease forwards 0.8s;
}

@keyframes load {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

@keyframes slideBounce {
  0% {
    transform: translateX(-50%) translateY(100vh);
    opacity: 0;
  }
  70% {
    transform: translateX(-50%) translateY(-15px);
    opacity: 1;
  }
  85% {
    transform: translateX(-50%) translateY(10px);
  }
  100% {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

@keyframes hover {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-12px);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@media (max-width: 480px) {
  .character {
    width: 230px;
    bottom: 180px;
  }

  h1 {
    font-size: 2rem;
  }
}