/* Ensure full-page canvas with scrolling if needed */
body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: auto;
}

/* Container for canvases */
#container {
  position: relative;
}

/* Canvases positioned absolutely */
canvas {
  position: absolute;
  top: 0;
  left: 0;
  touch-action: none;  /* Disable default touch gestures */
}

/* The grid canvas should not intercept pointer events */
#gridCanvas {
  pointer-events: none;
}

/* Floating, movable control panel */
#controls {
  position: absolute;
  left: 10px;
  top: 10px;
  width: 80px; /* Thinner panel */
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 5px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Drag handle styling */
#dragHandle {
  background: #ddd;
  padding: 3px;
  cursor: move;
  text-align: center;
  font-weight: bold;
  border-bottom: 1px solid #ccc;
}

/* Tool buttons stacked vertically */
#toolButtons {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Color buttons arranged in a 2x6 grid */
#colorButtons {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 5px;
  justify-items: center; 
}

#thicknessSlider {
  width: 65px;
  margin: 0 auto;
}

#toolButtons {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 columns */
  gap: 5px;
}

/* General button styling */
button {
  border: none;
  background: #eee;
  padding: 5px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.9em;
}

button:active {
  background: #ccc;
}

/* Color buttons: small squares */
.color-btn {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid #000;
}

/* Highlight selected color with a thicker border */
.color-btn.selected {
  border: 3px solid #000;
}
