/* puzzle.css — puzzle à vraies pièces (tenons et mortaises) à glisser depuis un bac (portrait) */
.puzzle { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: calc(62px + env(safe-area-inset-top)) 8px calc(10px + env(safe-area-inset-bottom)); background: var(--fond); overflow: hidden; touch-action: none; }
.puzzle__haut { width: 100%; max-width: 460px; display: flex; align-items: center; gap: 10px; flex: none; }
.puzzle__modele { flex: none; width: 54px; height: 54px; padding: 3px; border: 0; border-radius: 12px; background: #fff; box-shadow: var(--ombre); cursor: zoom-in; }
.puzzle__modele span { display: block; width: 100%; height: 100%; border-radius: 9px; background: center/cover no-repeat; }
.puzzle__aide { margin: 0; font-family: var(--police-titre); font-weight: 700; font-size: 15px; line-height: 1.3; color: var(--encre); }
.puzzle__table { position: relative; width: 100%; max-width: 480px; flex: none; }
.puzzle__plateau { position: absolute; left: 50%; top: 0; transform: translateX(-50%); border-radius: 6px; background: color-mix(in srgb, var(--primaire) 14%, #fff); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primaire) 45%, transparent), 0 6px 18px rgba(0,0,0,.12); overflow: hidden; }
.puzzle__guide { position: absolute; inset: 0; background: center/cover no-repeat; opacity: .18; filter: grayscale(.4); pointer-events: none; }
.puzzle__bac { position: absolute; left: 0; right: 0; border-radius: 14px; background: repeating-linear-gradient(45deg, rgba(0,0,0,.035) 0 10px, transparent 10px 20px), color-mix(in srgb, var(--secondaire) 18%, #fff); box-shadow: inset 0 2px 8px rgba(0,0,0,.12); }
.puzzle__piece { position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: visible; cursor: grab; touch-action: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); z-index: 3; }
.puzzle__table--pret .puzzle__piece { transition: transform .18s ease, filter .18s ease; }   /* pas d'animation au placement de départ */
.puzzle__contour { fill: none; stroke: rgba(255,255,255,.75); stroke-width: 1.4; }
.puzzle__table--pret .puzzle__piece--tenue, .puzzle__piece--tenue { cursor: grabbing; transition: none; filter: drop-shadow(0 12px 16px rgba(0,0,0,.45)); }
.puzzle__piece--ok { cursor: default; filter: none; transition: transform .22s cubic-bezier(.2, 1.4, .4, 1); }
.puzzle__piece--ok .puzzle__contour { stroke: rgba(255,255,255,.25); }
.puzzle__piece--auto { transition: transform .45s ease; }
.puzzle--fini .puzzle__contour { stroke: transparent; }
.puzzle__offre {
  position: absolute; left: 16px; right: 16px; top: 40%; transform: translateY(-50%); text-align: center; pointer-events: none; z-index: 60;
  background: rgba(255,255,255,.95); border-radius: var(--rayon); padding: 16px; box-shadow: var(--ombre); animation: mc-pop .35s cubic-bezier(.2, 1.4, .4, 1);
}
.puzzle__offre b { display: block; font-family: var(--police-titre); font-weight: 800; font-size: clamp(30px, 10vw, 48px); line-height: 1.05; color: var(--primaire); }
.puzzle__offre span { display: block; margin-top: 4px; font-weight: 700; color: var(--encre); }
.puzzle__offre[hidden], .puzzle__grand[hidden] { display: none; }
.puzzle__grand { position: absolute; inset: 0; z-index: 70; background: rgba(0,0,0,.75); display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.puzzle__grand span { width: min(100%, 460px); aspect-ratio: 1; border-radius: 16px; background: center/cover no-repeat; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
@media (prefers-reduced-motion: reduce) { .puzzle__piece, .puzzle__piece--ok, .puzzle__piece--auto { transition: none; } .puzzle__offre { animation: none; } }
