.play { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .play { grid-template-columns: 1fr; } }

.jboard {
  --n: 3;
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line-hi);
  background: #0a1a15;
  box-shadow: var(--shadow);
  touch-action: manipulation;
}
.jboard::before { /* faint picture underneath, to help */
  content: ""; position: absolute; inset: 0;
  background: var(--img) center / cover;
  opacity: .16; transition: opacity .3s;
}
.jboard.peek::before { opacity: 1; }
.slot { position: relative; border: 1px dashed rgba(255, 255, 255, .22); cursor: pointer; transition: background .2s; }
.slot.filled { border-color: transparent; cursor: default; }
.slot.target { background: rgba(233, 196, 106, .28); border-color: var(--gold); box-shadow: inset 0 0 0 3px var(--gold); }
.slot.nope { animation: nope .35s; }
.slot .placed { position: absolute; inset: 0; background: var(--img) no-repeat; animation: snap .35s cubic-bezier(.2, 1.4, .4, 1); }
.jboard.done .slot { border-color: transparent; }
@keyframes snap { from { transform: scale(1.12); filter: brightness(1.5); } to { transform: none; filter: none; } }
@keyframes nope { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.tray {
  display: flex; flex-wrap: wrap; gap: .6rem;
  align-content: flex-start; justify-content: center;
  min-height: 140px; padding: 1rem;
  border: 1px solid var(--line); border-radius: 20px;
  background: var(--glass);
}
.piece {
  --size: 96px;
  width: var(--size); height: var(--size);
  padding: 0; border: 2px solid rgba(255, 255, 255, .25); border-radius: 10px;
  background: var(--img) no-repeat; cursor: grab;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .85);
  transition: transform .2s, border-color .2s;
}
@media (hover: hover) { .piece:hover { transform: translateY(-3px); } }
.piece.selected { border-color: var(--gold); transform: translateY(-4px) scale(1.06); box-shadow: 0 0 0 3px rgba(233, 196, 106, .6); }
.piece.drag { position: fixed; z-index: 60; pointer-events: none; cursor: grabbing; transform: scale(1.12) rotate(-3deg); box-shadow: 0 24px 40px -10px rgba(0, 0, 0, .9); transition: none; }
.piece:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 3px; }

.pictures { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.pic {
  aspect-ratio: 1; padding: 0; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); border-radius: 18px; background: var(--art) center / cover;
  color: var(--ink); font: 600 1rem var(--display); display: flex; align-items: flex-end;
  box-shadow: var(--shadow); transition: transform .25s, border-color .25s;
}
.pic span { width: 100%; padding: 1.2rem .8rem .6rem; background: linear-gradient(180deg, transparent, rgba(7, 18, 15, .88)); text-align: left; }
@media (hover: hover) { .pic:hover { transform: translateY(-4px); border-color: var(--line-hi); } }
.pic:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 3px; }
