/* Gameficate cartridge — Map puzzle: the piece tray (in the question panel's answer box) and the piece being dragged. */
.quizbox.pz {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--navy);
  font-weight: 900;
}
.pz-count b {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
}
.pz-count span {
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}
.pz-mis {
  padding: 3px 12px;
  border-radius: calc(999px * var(--rs, 1));
  background: color-mix(in srgb, var(--red) 10%, var(--card));
  color: color-mix(in srgb, var(--red) 62%, #000);
  font-size: 15px;
}
.pz-grid {
  flex: 1 1 auto;
  min-height: 140px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
  gap: 8px;
  align-content: start;
  padding: 3px;
}
.pz-piece {
  position: relative;
  height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 6px 6px;
  border-radius: calc(14px * var(--rs, 1));
  background: var(--soft2);
  border: 2px solid var(--line);
  cursor: grab;
  touch-action: none;
  transition:
    transform 0.12s,
    border-color 0.12s,
    box-shadow 0.12s,
    opacity 0.15s;
}
.pz-piece svg {
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  overflow: visible;
}
.pz-piece path {
  fill: var(--pc);
  stroke: color-mix(in srgb, var(--pc) 55%, #000);
  stroke-width: 1.2;
  stroke-linejoin: round;
}
.pz-piece .nm {
  max-width: 100%;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  color: var(--navy);
  text-align: center;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.pz-piece:hover {
  border-color: color-mix(in srgb, var(--orange) 45%, var(--card));
  transform: translateY(-1px);
}
.pz-piece:active {
  cursor: grabbing;
}
.pz-piece.sel {
  border-color: var(--orange);
  background: color-mix(in srgb, var(--orange) 10%, var(--card));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 30%, transparent);
}
.pz-piece.dragging {
  opacity: 0.25;
}
.pz-help {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--muted);
}
.pz-done,
.pz-wait {
  padding: 16px;
  border-radius: calc(14px * var(--rs, 1));
  background: var(--soft2);
  border: 2px solid var(--line);
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
}
.pz-done {
  background: color-mix(in srgb, var(--green) 10%, var(--card));
  border-color: color-mix(in srgb, var(--green) 35%, var(--card));
}

/* The dragged piece, drawn at the map's current size. */
.pz-ghost {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 60;
  pointer-events: none;
  transform-origin: 0 0;
  filter: drop-shadow(0 12px 18px rgba(10, 25, 40, 0.35));
}
.pz-ghost svg {
  display: block;
  overflow: visible;
}
.pz-ghost path {
  fill: var(--pc);
  fill-opacity: 0.9;
  stroke: #fff;
  stroke-width: 2;
  stroke-linejoin: round;
}
.pz-ghost .nm {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translate(-50%, 8px);
  padding: 3px 10px;
  border-radius: calc(999px * var(--rs, 1));
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}
/* Tiny pieces (a small island or city state) get a ring so they can be seen under the finger. */
.pz-ghost.tiny::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  border: 3px dashed color-mix(in srgb, var(--pc) 70%, #000);
  background: color-mix(in srgb, var(--pc) 22%, transparent);
}
.pz-ghost.back {
  transition:
    transform 0.35s ease,
    opacity 0.35s ease;
  opacity: 0;
}
.pz-ghost.snap,
.pz-ghost.gone {
  transition: opacity 0.25s ease;
  opacity: 0;
}
