/* Base page styling */
body {
  font-family: sans-serif;
  margin: 0;
  padding: 0;
  border-width: 0;
  cursor: pointer;
  overflow: hidden; /* Prevent scrolling during piece drag */
  background-color: #f0f0f0;
}

/* Static horizontal menu bar at the top */
#menu {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 10px 0;
  list-style: none;
  background: #515E70;
  display: flex;
  justify-content: center;
  gap: 15px;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#menu li {
  color: #fff;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.2s ease;
  user-select: none;
  font-size: 14px;
  font-weight: bold;
}

#menu li:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Centered puzzle container using absolute positioning */
#forPuzzle {
  position: absolute;
  width: 90vw;
  height: 85vh; 
  top: calc(50% + 20px); /* Centered with a slight offset for the menu bar */
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  background: transparent;
}

.polypiece {
  display: block;
  overflow: hidden;
  position: absolute;
}

.moving {
  transition-property: top, left;
  transition-duration: 1s;
  transition-timing-function: linear;
}

.gameCanvas {
  display: none;
  overflow: hidden;
  position: absolute;
}