/* Puzzle Gambar: potongan gambar yang ditukar (seret atau sentuh dua potongan) */
.pz-body { flex: 1; min-height: 0; display: flex; gap: clamp(8px, 2vw, 24px); padding: clamp(8px, 1.6vw, 20px); background: linear-gradient(135deg, var(--sky-50), var(--amber-100) 80%); }
.pz-boards { flex: 1; min-width: 0; min-height: 0; display: flex; gap: clamp(8px, 2vw, 24px); justify-content: center; align-items: stretch; }
.pz-board { flex: 1 1 0; min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pz-board header { display: flex; align-items: baseline; gap: 10px; justify-content: center; flex-wrap: wrap; font-family: var(--font); color: var(--ink); }
.pz-board h2 { margin: 0; font-size: clamp(14px, 2vw, 26px); }
.pz-board.a h2 { color: var(--team-a); } .pz-board.b h2 { color: var(--team-b); }
.pz-board h2:empty { display: none; }
.pz-board .mv, .pz-board .tm { font-weight: 800; font-size: clamp(13px, 1.7vw, 22px); background: #fff; border: 3px solid var(--line); border-radius: 999px; padding: 2px 12px; }
.pz-board.a .mv, .pz-board.a .tm { border-color: var(--team-a); } .pz-board.b .mv, .pz-board.b .tm { border-color: var(--team-b); }
.pz-board .pz-grid {
  --n: 3; flex: 0 0 auto; width: 200px; height: 200px;
  display: grid; grid-template-columns: repeat(var(--n), 1fr); grid-template-rows: repeat(var(--n), 1fr); gap: 3px; padding: 4px; border-radius: 18px; background: #fff; border: 4px solid var(--sky-d); touch-action: none;
}
.pz-board.a .pz-grid { border-color: var(--team-a); } .pz-board.b .pz-grid { border-color: var(--team-b); }
.piece {
  padding: 0; border: 0; border-radius: 6px; background-color: #e0f2fe; background-repeat: no-repeat; cursor: grab; position: relative; min-width: 0; min-height: 0;
  box-shadow: inset 0 0 0 2px rgba(15,23,42,.14); touch-action: none; transition: transform .12s ease;
}
.piece.ok { box-shadow: inset 0 0 0 3px var(--ok); }
.piece.sel { box-shadow: inset 0 0 0 4px var(--amber), 0 0 0 3px var(--amber); z-index: 2; }
.piece.lift { z-index: 5; transition: none; cursor: grabbing; box-shadow: 0 10px 20px rgba(0,0,0,.3), inset 0 0 0 3px var(--amber); }
.piece.flash { animation: pz-flash .5s; }
@keyframes pz-flash { 50% { transform: scale(1.12); } }
.pz-board.done .piece { box-shadow: inset 0 0 0 3px var(--ok); cursor: default; }
.pz-board.done .pz-grid { gap: 0; border-color: var(--ok); }

.pz-preview { flex: 0 0 clamp(90px, 16%, 190px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; font-weight: 700; color: var(--muted); font-size: clamp(11px, 1.3vw, 16px); }
.pz-preview[hidden] { display: none; }
.pz-preview img { width: 100%; max-width: 160px; height: auto; background: #e0f2fe; border: 4px solid #fff; border-radius: 16px; box-shadow: 0 6px 14px rgba(14,165,233,.25); }
b#contoh img.ex { height: 44px; width: 44px; vertical-align: middle; }
@media (max-width: 700px) and (orientation: portrait) {
  .pz-body { flex-direction: column; }
  .pz-boards { flex-direction: column; }
  .pz-preview { flex: 0 0 auto; flex-direction: row; }
  .pz-preview img { width: 56px; }
}
@media (max-height: 520px) {
  .pz-body { padding: 6px 10px; gap: 8px; }
  .pz-board { gap: 3px; }
  .pz-board .mv, .pz-board .tm { border-width: 2px; padding: 0 8px; }
  .pz-board .pz-grid { border-width: 3px; padding: 3px; border-radius: 12px; gap: 2px; }
  .pz-preview { flex-basis: 72px; }
  b#contoh img.ex { height: 32px; width: 32px; }
}
@media (prefers-reduced-motion: reduce) { .piece { transition: none; } .piece.flash { animation: none; } }
