body {
  margin: 0;
  padding: 0;
  background: #000;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#game-container {
  position: absolute;
  width: 1600px;
  height: 900px;
  left: 50%;
  top: 50%;
  transform-origin: center center;
  overflow: hidden;

  background-image: url("assets/backgrounds/background-writing-game.png");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}

#worksheet-area {
  position: absolute;
  left: 26.5%;
  top: 19%;
  width: 56%;
  height: 61%;
}

#worksheet {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

#canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.nav-btn,
.tool-btn {
  position: absolute;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  z-index: 30;
}

.nav-btn img {
  width: 70px;
  height: auto;
  display: block;
}

#btn-previous {
  right: 8.7%;
  bottom: 14%;
}

#btn-next {
  right: 2.3%;
  bottom: 14%;
}

#btn-undo {
  left: 2.2%;
  bottom: 4.2%;
}

#btn-redo {
  left: 7.2%;
  bottom: 4.2%;
}

#btn-undo img,
#btn-redo img {
  width: 65px;
  height: auto;
  display: block;
}

#btn-eraser {
  left: 2.1%;
  top: 34.5%;
}

#btn-eraser img {
  width: 120px;
  height: auto;
  display: block;
}

#btn-clear-all {
  left: 13.2%;
  bottom: 3.8%;
}

#btn-clear-all img {
  width: 72px;
  height: auto;
  display: block;
}

#color-palette {
  position: absolute;
  left: 33%;
  bottom: -1%;
  display: flex;
  gap: 10px;
  z-index: 30;
}

.color-btn {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

.color-btn img {
  width: 58px;
  height: auto;
  display: block;
}

#thickness-controls {
  position: absolute;
  right: 21.5%;
  bottom: 2%;
  display: flex;
  gap: 13px;
  align-items: center;
  z-index: 30;
}

.thickness-btn {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

.thickness-btn img {
  height: auto;
  display: block;
}

.thickness-btn:nth-child(1) img {
  width: 14px;
}

.thickness-btn:nth-child(2) img {
  width: 22px;
}

.thickness-btn:nth-child(3) img {
  width: 30px;
}

#letters-bar {
  position: absolute;
  left: 14%;
  top: 2.3%;
  width: 76%;
  display: flex;
  justify-content: center;
  gap: 3px;
  z-index: 35;
}

.letter-btn {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

.letter-btn img {
  width: 38px;
  height: auto;
  display: block;
}

#tools-panel {
  position: absolute;
  left: 2.2%;
  top: 20%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 30;
}

#tools-panel .tool-btn {
  position: relative;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

#tools-panel .tool-btn img {
  width: 250px;
  height: auto;
  display: block;
}

#btn-home {
  position: absolute;
  right: 130px;
  top: 12px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  z-index: 90;
}

#btn-home img {
  width: 62px;
  height: auto;
  display: block;
}

button:active {
  transform: scale(0.95);
}

#worksheet-area {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.worksheet-fade {
  opacity: 0;
  transform: scale(0.97);
}

#characters {
  position: absolute;
  right: 4.5%;
  top: 18%;
  z-index: 25;
}

#characters img {
  width: 170px;
  height: auto;
  display: block;
  transition: transform 0.25s ease;
}

#characters-img.react {
  animation: characterReact 0.5s ease;
}

@keyframes characterReact {
  0% {
    transform: scale(1) rotate(0deg);
  }

  35% {
    transform: scale(1.08) rotate(-3deg);
  }

  70% {
    transform: scale(1.04) rotate(3deg);
  }

  100% {
    transform: scale(1) rotate(0deg);
  }
}

#characters {
  position: absolute;
  right: -1%;
  top: 140px;
  z-index: 100;
}

#characters img {
  width: 300px;
  height: auto;
  display: block;
}

#btn-sound {
  position: absolute;
  right: 50px;
  top: 12px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  z-index: 80;
}

#btn-sound img {
  width: 58px;
  height: auto;
  display: block;
}


@keyframes bounce {
  0% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
  100% { transform: translateY(0); }
}

#btn-free-draw {
  position: absolute;
  left: 60px;
  bottom: 130px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  z-index: 50;
}

#btn-free-draw img {
  width: 190px;
  height: auto;
  display: block;
}