html,
body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  font-family: "Pixelify Sans", monospace;
  color: white;
  background-color: rgb(35, 17, 2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hidden {
  display: none;
}

button {
  cursor: pointer;
  background-color: transparent;
  border-width: 0;
}

#game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  position: relative;
}

.clock {
  background-image: url("./assets/clock.png");
  width: 30px;
  height: 30px;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 100;
  position: absolute;
  left: 60px;
}

.shelf {
  background-image: url("./assets/shelf.png");
  width: 150px;
  height: 50px;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 100;
  position: absolute;
  left: 90px;
  top: 10px;
  transform: scale(0.9);
}

.desk {
  background-image: url("./assets/desk.png");
  width: 60px;
  height: 50px;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 100;
  position: absolute;
  left: 160px;
  top: -5px;
  transform: scale(1.2);
}

.wardrobe {
  background-image: url("./assets/wardrobe.png");
  width: 50px;
  height: 200px;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 100;
  position: absolute;
  left: -5px;
  top: -30px;
  transform: scaleX(0.8);
}

.cake {
  background-image: url("./assets/cake.png");
  width: 50px;
  height: 50px;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  left: 100px;
  bottom: 0;
  z-index: 222;
  position: absolute;
}

.window {
  background-image: url("./assets/window.png");
  width: 80px;
  height: 120px;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 100;
  position: absolute;
  right: -6px;
  top: -5px;
  transform: scale(0.85);
}

.door {
  background-image: url("./assets/door.png");
  width: 50px;
  height: 60px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom center;
  z-index: 100;
  position: absolute;
  left: 50px;
  top: 30px;
  transform: scaleX(1.2);
}

.bed {
  background-image: url("./assets/bed.png");
  width: 125px;
  height: 50px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom right;
  z-index: 100;
  position: absolute;
  right: 0;
  bottom: 0;
}

.floor-grid {
  position: relative;
  display: grid;
  background-image: url("./assets/wooden_floor.jpg");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  width: 30px;
  height: 30px;
}

.wall-grid {
  position: relative;
  display: grid;
  background-image: url("./assets/pink_wall.png");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  width: 30px;
  height: 30px;
}

.concrete-grid {
  display: grid;
  background-image: url("./assets/concrete_wall.jpg");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  width: 30px;
  height: 30px;
}

.game-row {
  display: flex;
  height: 30px;
  position: relative;
}

.top-row {
  border-top: solid 2px white;
}

.dialogue {
  width: 300px;
  height: 60px;
  line-height: 5px;
  background-color: black;
  display: flex;
  flex-direction: column;
}

#textbox {
  margin: 0;
  font-size: small;
  padding: 10px;
  width: calc(100% - 20px);
  display: flex;
  flex-wrap: wrap;
  word-wrap: break-word;
  white-space: pre-wrap;
  line-height: 16px;
}

.option {
  color: white;
  font-family: "Pixelify Sans", monospace;
  border: 2px solid white;
}

#menu {
  width: 300px;
  display: flex;
  justify-content: end;
}

#sound {
  width: 30px;
  height: 30px;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

#sound.on {
  background-image: url("./assets/sound_on.png");
}

#sound.off {
  background-image: url("./assets/sound_off.png");
  width: 30px;
  height: 30px;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

.hat {
  position: absolute;
  z-index: 200;
  width: 150px;
  height: 150px;
  background-image: url("./assets/hat_2.png");
  background-repeat: no-repeat;
  background-position: 0 0px;
  background-size: contain;
  top: -99px;
  left: 88px;
}

.player {
  width: 350px;
  height: 512px;
  background-image: url("./assets/character.png");
  background-repeat: no-repeat;
  background-position: 0 0px;
  animation: idleAnimationDown 1s steps(4) infinite;
  transform: scale(0.15);
  position: absolute;
  z-index: 200;
  display: flex;
  justify-content: center;
}

.player.moving-down {
  animation: moveDown 0.5s steps(4) forwards;
}

.player.moving-up {
  animation: moveUp 0.5s steps(4) forwards;
}

.player.moving-right {
  animation: moveRight 0.5s steps(4) forwards;
}

.player.moving-left {
  animation: moveLeft 0.5s steps(4) forwards;
}

.player.idle-down {
  animation: idleAnimationDown 1s steps(1) infinite;
}

.player.idle-up {
  animation: idleAnimationUp 1s steps(1) infinite;
}

.player.idle-right {
  animation: idleAnimationRight 1s steps(1) infinite;
}

.player.idle-left {
  animation: idleAnimationLeft 1s steps(1) infinite;
}

@keyframes idleAnimationDown {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 0 0;
  }
}

@keyframes idleAnimationUp {
  from {
    background-position: 0 -512px;
  }
  to {
    background-position: 0 -512px;
  }
}

@keyframes idleAnimationRight {
  from {
    background-position: 0 -1024px;
  }
  to {
    background-position: 0 -1024px;
  }
}

@keyframes idleAnimationLeft {
  from {
    background-position: 0 -1536px;
  }
  to {
    background-position: 0 -1536px;
  }
}

@keyframes moveDown {
  from {
    background-position: 0 0;
  }

  to {
    background-position: -1400px 0;
  }
}

@keyframes moveUp {
  from {
    background-position: 0 -512px;
  }

  to {
    background-position: -1400px -512px;
  }
}

@keyframes moveRight {
  from {
    background-position: 0 -1024px;
  }

  to {
    background-position: -1400px -1024px;
  }
}

@keyframes moveLeft {
  from {
    background-position: 0 -1536px;
  }

  to {
    background-position: -1400px -1536px;
  }
}

#backdrop {
  position: absolute;
  top: 0;
  width: 300px;
  height: 240px;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 888;
}

#book {
  background-image: url("./assets/open_book.png");
  width: 280px;
  height: 200px;
  position: absolute;
  top: 8%;
  z-index: 999;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.page-container {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 30px 1fr 1fr 30px;
  color: black;
  justify-items: center;
  align-items: center;
}

.arrow-btn {
  width: 30px;
  height: 30px;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 1000;
}

#left-arrow {
  background-image: url("./assets/arrow_left.png");
}

#right-arrow {
  background-image: url("./assets/arrow_right.png");
}

#book img {
  max-width: 100px;
  max-height: 130px;
  object-fit: cover;
}

#page-text {
  padding: 0 5px;
  max-height: 150px;
  overflow-y: auto;
}
