.game-main { gap: 12px; }
.jig-area { position: relative; flex: 1; align-self: stretch; min-height: 0; touch-action: none; }

/* Board (left): the target frame, with a faint ghost of the photo and its grid to help children. */
.jig-board {
  position: absolute; border-radius: 6px; background: var(--sand);
  box-shadow: 0 0 0 8px var(--sea-deep), 0 10px 30px rgba(22,44,51,0.25);
}
.jig-ghost {
  position: absolute; inset: 0; border-radius: 6px; opacity: 0.22;
  background-size: cover; background-position: center; filter: grayscale(0.3);
}
.jig-grid {
  position: absolute; inset: 0; border-radius: 6px; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(22,44,51,0.28) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(22,44,51,0.28) 1px, transparent 1px);
}

/* Tray (right): where the pieces start. */
.jig-tray { position: absolute; border-radius: var(--radius); background: var(--sand); border: 2px dashed var(--rule); }

/* Pieces: absolutely placed in the play area, moved with transform. */
.jig-piece {
  position: absolute; left: 0; top: 0; border-radius: 6px; cursor: grab; touch-action: none;
  background-color: var(--sand-deep); background-repeat: no-repeat;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(255,255,255,0.45);
  transition: box-shadow 0.15s;
}
.jig-piece.is-lifted { cursor: grabbing; box-shadow: 0 14px 30px rgba(0,0,0,0.38), inset 0 0 0 2px rgba(255,255,255,0.7); }
.jig-piece.is-placed { cursor: default; border-radius: 0; box-shadow: none; animation: jig-snap 0.35s ease-out; }
.jig-board.is-done { box-shadow: 0 0 0 8px var(--good), 0 10px 30px rgba(22,44,51,0.25); }
@keyframes jig-snap { 0% { filter: brightness(1.35); } 100% { filter: none; } }
@media (prefers-reduced-motion: reduce) { .jig-piece.is-placed { animation: none; } }
