/* ==========================================================================
   Make-Her Hack — "Fix the Powerpuff!" mini puzzle, right under the arcade
   ========================================================================== */

.pz {
  --pz-c: var(--blossom);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.25rem, 4vw, 2.5rem);
  width: min(640px, 100%);
  margin: clamp(1.5rem, 4vw, 2.25rem) auto 0;
  padding: clamp(1rem, 3vw, 1.5rem);
  color: #1a1020;
  background:
    radial-gradient(rgba(0, 0, 0, .07) 1.2px, transparent 1.6px) 0 0 / 12px 12px,
    var(--paper, #fff5fa);
  border: 4px solid #000;
  border-radius: 24px;
  box-shadow: 8px 8px 0 var(--pz-c), 8px 8px 0 3px #000;
}
.pz[data-girl-on="bubbles"] { --pz-c: var(--bubbles); }
.pz[data-girl-on="buttercup"] { --pz-c: var(--buttercup); }

.pz__intro { flex: 1; min-width: 0; }
.pz__kicker {
  display: inline-block;
  margin: 0 0 .4rem;
  padding: .15rem .65rem;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: var(--yellow);
  border: 2px solid #000;
  border-radius: 999px;
}
.pz__title {
  margin: 0 0 .35rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 400;
  line-height: 1.1;
}
.pz__status { margin: 0 0 .75rem; font-size: .9rem; line-height: 1.45; opacity: .85; }
.pz.is-solved .pz__status { font-weight: 700; opacity: 1; }

.pz__girls { display: flex; gap: .4rem; margin-bottom: .75rem; }
.pz__girl {
  width: 40px;
  height: 40px;
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 3px solid #000;
  border-radius: 50%;
  cursor: pointer;
  opacity: .55;
  transition: opacity .2s, transform .2s;
}
.pz__girl img { display: block; width: 100%; height: 100%; }
.pz__girl[aria-checked="true"] { opacity: 1; transform: scale(1.1); box-shadow: 0 0 0 3px var(--pz-c); }
.pz__girl:hover { opacity: 1; }

.pz__bar { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.pz__moves { margin-right: .3rem; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.pz__moves b { font-family: var(--font-display); font-size: 1.15rem; font-weight: 400; }
.pz__btn {
  padding: .35rem .8rem;
  font: 700 .78rem/1 var(--font-body, inherit);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #000;
  background: #fff;
  border: 2.5px solid #000;
  border-radius: 999px;
  box-shadow: 2px 2px 0 #000;
  cursor: pointer;
}
.pz__btn:active { transform: translate(2px, 2px); box-shadow: none; }
.pz__btn--go { background: var(--pz-c); }

/* ---------- Board ---------- */

.pz__board {
  position: relative;
  flex: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  width: clamp(190px, 30vw, 230px);
  aspect-ratio: 1;
  padding: 3px;
  background: #000;
  border-radius: 14px;
  touch-action: none;
  transition: gap .4s, padding .4s;
}
.pz__peek {
  position: absolute;
  inset: 3px;
  border-radius: 11px;
  background: center / cover no-repeat;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.pz.is-peek .pz__peek { opacity: 1; }

.pz__tile {
  position: relative;
  padding: 0;
  background-color: #ffe9f3;
  background-size: 300% 300%;
  border: 0;
  border-radius: 6px;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.pz__tile:focus-visible { outline: 3px solid var(--yellow); outline-offset: -3px; z-index: 1; }
.pz__tile.is-picked { outline: 3px solid var(--yellow); outline-offset: -3px; z-index: 1; filter: brightness(1.1); }
.pz__tile.is-over { outline: 3px dashed #fff; outline-offset: -4px; }
.pz__tile.is-dragging { z-index: 2; cursor: grabbing; scale: 1.08; box-shadow: 0 8px 18px rgba(0, 0, 0, .45); }
.pz__tile.is-pop { animation: pz-pop .3s ease-out; }
@keyframes pz-pop { 50% { scale: .9; } }

.pz.is-solved .pz__board { gap: 0; padding: 3px; }
.pz.is-solved .pz__tile { border-radius: 0; cursor: default; }
.pz.is-solved .pz__board { animation: pz-win .6s ease-out; box-shadow: 0 0 0 4px var(--pz-c), 0 0 30px var(--pz-c); }
@keyframes pz-win { 40% { scale: 1.06; rotate: -2deg; } }

/* Phones: the board on top, then the controls */
@media (max-width: 560px) {
  .pz { flex-direction: column; gap: .9rem; text-align: center; box-shadow: 6px 6px 0 var(--pz-c), 6px 6px 0 3px #000; }
  .pz__board { order: -1; width: min(210px, 62vw); }
  .pz__girls, .pz__bar { justify-content: center; }
  .pz__status { font-size: .85rem; margin-bottom: .6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .pz__tile.is-pop, .pz.is-solved .pz__board { animation: none; }
}
