Pressing on a face-up card picks it up: drag remembers which pile and which card. Letting go will make the move in the
next step. That split is what dragging will be built on later.
```js
let drag // { from, index, dx, dy, x, y, moved } while a card is held
const pile = piles[h.key]
if (h.index < 0 || !pile[h.index] || !pile[h.index].up) return
if (h.key === 'waste' || h.key[0] === 'f') h.index = pile.length - 1 // only the top card of these
drag = { from: h.key, index: h.index }
```
What it means
let drag is empty until a card is held.
A press on an empty place (index −1), or on a face-down card, does nothing.
In the waste and the foundations only the top card may be taken.
drag stores the pile's name and the card's index.
Your turn
Under let piles ... write let drag ... with its comment.
In the pointerdown listener, under the stock line, write the four lines.