body {
  margin: 0;
  background: linear-gradient(to top, #0d1b2a, #1b263b);
  color: white;
  font-family: "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
}
canvas {
  background-color: #1e2a38;
  margin-top: 20px;
  border: 4px solid #f4a261;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}
#hud {
  display: flex;
  justify-content: space-between;
  width: 90vw;
  max-width: 600px;
  margin-top: 10px;
}
#hud div {
  background-color: #264653;
  padding: 10px 20px;
  border-radius: 10px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.4);
}
button {
  background-color: #f4a261;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
}
#game-wrapper {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  align-items: flex-start;
}
#gameCanvas {
  background-color: transparent;
  background-image: url("assets/tree-trunk.png");
  background-size: cover;
  background-position: center;
  border-radius: 16px;
  border: 4px solid #f4a261;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}
#chip {
  position: absolute;
  bottom: 58px;
  left: 50%;
  transform: translateX(40px); /* Push slightly right from center */
  width: 100px;
}

#moon {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(90px); /* Push further right from center */
  width: 80px;
  opacity: 0.9;
}

#sidebar {
  background-color: #1e2a38;
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
  color: white;
  width: 160px;
}

#pieces-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shape-piece {
  display: inline-block;
  cursor: grab;
}

.shape-piece:active {
  cursor: grabbing;
}
.shape-piece.selected {
  outline: 3px solid #f7dbc4;
  box-shadow: 0 0 10px #f4a261;
  border-radius: 4px;
}
.shape-piece {
  display: inline-block;
  position: relative;
  cursor: grab;
  background-image: url("assets/shape-texture.png"),
    linear-gradient(
      to bottom right,
      rgba(255, 255, 255, 0.15),
      rgba(0, 0, 0, 0.05)
    );
  background-blend-mode: overlay;
  background-size: cover;
  border-radius: 6px;
  box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.2);
}

#acorn {
  width: 24px;
  height: 24px;
  vertical-align: middle;
  margin-right: 6px;
  transform: translateY(-2px); /* Optional fine-tune for alignment */
}
#hud img#acorn {
  width: 24px;
  vertical-align: middle;
  margin-right: 5px;
  transform: translateY(-1px);
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0) translateX(40px);
  }
  50% {
    transform: translateY(-10px) translateX(40px);
  }
}

#chip {
  animation: bounce 2s infinite ease-in-out;
}
.parallax {
  position: fixed;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-attachment: fixed;
  z-index: -1;
}
#final-scene {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  transform: translate(-50%, -50%);
  z-index: 1000;
}
#final-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: black;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 1000;
  animation: fadeIn 1s ease-in-out forwards;
}

#final-scene {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

#play-again-btn {
  margin-top: 20px;
  padding: 12px 24px;
  font-size: 1.1em;
  background-color: #f4a261;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
