.puzzle{--pad: 5px}.puzzle__defs{position:absolute;width:0;height:0;overflow:hidden}.puzzle__play{display:grid;gap:var(--space-4);justify-items:center;width:100%;overflow-x:clip}.puzzle__board{position:relative;display:grid;grid-template-columns:repeat(var(--cols),1fr);grid-template-rows:repeat(var(--rows),1fr);width:min(100%,22.5rem);aspect-ratio:calc(var(--cols) / var(--rows));padding:var(--pad);border-radius:var(--radius-lg);background:var(--cream-50);border:3px solid var(--cream-300);box-shadow:var(--shadow-card)}.puzzle__board:before,.puzzle__whole{content:"";position:absolute;inset:var(--pad);border-radius:4px;background:var(--img) 0 0 / 100% 100% no-repeat;pointer-events:none}.puzzle__board:before{opacity:.24;filter:grayscale(.55)}.puzzle__whole{z-index:2;opacity:0;transition:opacity var(--dur-slow) var(--ease-out)}.puzzle__slot{position:relative;padding:0;border:0;border-radius:4px;background:none;cursor:pointer;touch-action:manipulation}.puzzle__guide,.puzzle__fill{position:absolute;left:calc(var(--tab-room) * -100%);top:calc(var(--tab-room) * -100%);width:calc((1 + 2 * var(--tab-room)) * 100%);height:calc((1 + 2 * var(--tab-room)) * 100%);max-width:none;overflow:visible;pointer-events:none}.puzzle__outline{fill:none;stroke:#c98b2f8c;stroke-width:2;stroke-linejoin:round;vector-effect:non-scaling-stroke}.puzzle__fill{opacity:0;transform-origin:center}.puzzle__fill .puzzle__edge{fill:none;stroke:#ffffff59;stroke-width:1;vector-effect:non-scaling-stroke}.puzzle__slot[data-filled=true]{cursor:default}.puzzle__slot[data-filled=true] .puzzle__fill{opacity:1}.puzzle__slot[data-filled=true] .puzzle__guide{display:none}.g-root[data-selecting] .puzzle__slot[data-filled=false] .puzzle__outline{fill:#ffd27a38;stroke:var(--gold-500);stroke-width:3;animation:slot-hint 1.2s var(--ease-soft) infinite}@keyframes slot-hint{50%{fill:#ffd27a73}}.puzzle__slot:focus-visible,.puzzle__piece:focus-visible{outline:4px solid var(--focus);outline-offset:3px;z-index:3}.puzzle__slot.is-snapped .puzzle__fill{animation:snap-in .35s var(--ease-bounce)}@keyframes snap-in{0%{transform:scale(1.12)}to{transform:scale(1)}}.g-root[data-complete-board] .puzzle__board{box-shadow:0 0 0 4px var(--gold-300),var(--shadow-card-lift)}.g-root[data-complete-board] .puzzle__whole{opacity:1}.puzzle__box{display:grid;gap:var(--space-2);width:min(100%,24rem);padding:var(--space-3);border-radius:var(--radius-lg);background:#fffbf2d9;border:3px dashed var(--gold-300)}.puzzle__box-label{justify-self:center;font-family:var(--font-display);font-weight:700;font-size:var(--text-xs);letter-spacing:.06em;text-transform:uppercase;color:var(--orange-700)}.g-root[data-complete-board] .puzzle__box{display:none}.puzzle__tray{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--space-2)}.puzzle__piece{display:block;width:100%;aspect-ratio:1;padding:0;border:0;border-radius:16px;background:none;cursor:grab;touch-action:none;transition:transform var(--dur-fast) var(--ease-out)}.puzzle__shape{display:block;width:100%;height:100%;overflow:visible;filter:drop-shadow(0 3px 0 rgb(214 186 140)) drop-shadow(0 7px 6px rgb(61 34 16 / .3));transition:filter var(--dur-fast) var(--ease-out)}.puzzle__shape .puzzle__edge{fill:none;stroke:#fff;stroke-width:3;stroke-linejoin:round;vector-effect:non-scaling-stroke}.puzzle__piece:nth-child(odd){transform:rotate(-2deg)}.puzzle__piece:nth-child(2n){transform:rotate(2deg)}@media(hover:hover)and (pointer:fine){.puzzle__piece:hover{transform:translateY(-3px) rotate(0)}}.puzzle__piece.is-selected{position:relative;z-index:1;transform:translateY(-5px) scale(1.07) rotate(0)}.puzzle__piece.is-selected .puzzle__edge{stroke:var(--gold-400);stroke-width:4}.puzzle__piece.is-selected .puzzle__shape{filter:drop-shadow(0 0 6px rgb(255 200 90 / .95)) drop-shadow(0 10px 8px rgb(61 34 16 / .35))}.puzzle__piece.is-dragging{opacity:.35}.puzzle__piece.is-nudged{animation:miss-nudge .36s var(--ease-soft)}@keyframes miss-nudge{30%{transform:translate(-5px) rotate(-2deg)}70%{transform:translate(5px) rotate(2deg)}}.puzzle__ghost-drag{position:fixed;z-index:100;pointer-events:none;transform:scale(1.1) rotate(-3deg);cursor:grabbing}.puzzle__ghost-drag .puzzle__shape{filter:drop-shadow(0 18px 14px rgb(61 34 16 / .45))}.puzzle__ghost-drag.is-returning{transition:left .3s var(--ease-out),top .3s var(--ease-out)}.puzzle__play>.game-done{width:100%;margin:0;padding:0;background:none;backdrop-filter:none}@media(min-width:40rem){.puzzle{--pad: 6px}.puzzle__play{gap:var(--space-5)}.puzzle__board{width:min(100%,32rem)}.puzzle__box{width:min(100%,32rem);padding:var(--space-4)}.puzzle__tray{gap:var(--space-3)}}@media(min-width:62rem){.puzzle__play{grid-template-columns:auto minmax(0,26rem);justify-content:center;align-items:center;gap:var(--space-6)}.puzzle__board{width:clamp(22rem,calc(100dvh - 17rem),32rem)}.puzzle__box{width:100%}.puzzle__play>.game-done .game-done__card{grid-template-columns:minmax(0,1fr);grid-template-areas:none;justify-items:center;width:100%;padding:var(--space-5) var(--space-4);text-align:center}.puzzle__play>.game-done .game-done__card>*{grid-area:auto;align-self:auto}.puzzle__play>.game-done .game-done__title{font-size:var(--text-xl)}.puzzle__play>.game-done .game-done__actions{flex-direction:column;align-items:stretch;justify-content:center;width:100%}.puzzle__play>.game-done .game-done__actions>.btn{justify-content:center}}@media(prefers-reduced-motion:reduce){.puzzle__piece,.puzzle__piece:nth-child(odd),.puzzle__piece:nth-child(2n),.puzzle__piece.is-selected{transform:none}.g-root[data-selecting] .puzzle__slot[data-filled=false] .puzzle__outline{animation:none}.puzzle__whole{transition:none}}
