{"title":"Award-Winning Puzzles","description":"\u003cp\u003eEvery year the world's mechanical puzzle designers send their newest work to the Nob Yoshigahara Puzzle Design Competition, held at the International Puzzle Party. A jury of designers and collectors solves everything, and the entrants vote. Only a handful of puzzles come away with anything.\u003c\/p\u003e\n\u003cp\u003eThese are the ones in this shop that did. Not \"award-winning\" in the way a label on a box means it. Each puzzle here was judged against the best new designs of its year and placed.\u003c\/p\u003e\n\u003ch2\u003eWhere to start\u003c\/h2\u003e\n\u003cp\u003e\u003ca href=\"\/products\/identical-twins\"\u003eIdentical Twins\u003c\/a\u003e by \u003ca href=\"\/collections\/osanori-yamamoto\"\u003eOsanori Yamamoto\u003c\/a\u003e is the highest honour on the shelf: it won the Puzzlers' Award in 2017, voted by the designers themselves. Two pieces, one cube, and far more resistance than two pieces should offer.\u003c\/p\u003e\n\u003cp\u003e\u003ca href=\"\/products\/four-fit\"\u003eFour Fit\u003c\/a\u003e is a \u003ca href=\"\/collections\/stewart-coffin\"\u003eStewart Coffin\u003c\/a\u003e design from 2007 and the oldest winner here. \u003ca href=\"\/products\/burr-bot-sequential-discovery-puzzle\"\u003eBurr Bot\u003c\/a\u003e is the most involved, and \u003ca href=\"\/products\/one-way-or-another-move-the-disc-corner-to-corner\"\u003eOne Way or Another\u003c\/a\u003e is the newest, placing in 2026.\u003c\/p\u003e\n\u003ch2\u003eWhat the awards mean\u003c\/h2\u003e\n\u003cp\u003eThe \u003cstrong\u003ePuzzlers' Award\u003c\/strong\u003e is voted by the competitors themselves, which makes it the one designers care about most. \u003cstrong\u003eTop 10 Vote Getter\u003c\/strong\u003e means the puzzle finished in the ten most popular entries of its year. A \u003cstrong\u003eJury Honorable Mention\u003c\/strong\u003e is awarded by the judging panel for a design they thought stood out.\u003c\/p\u003e\n\u003ch2\u003eBest for\u003c\/h2\u003e\n\u003cp\u003eCollectors who want provenance behind a purchase rather than a shelf of unrelated puzzles. Gift buyers looking for something with a story attached. Solvers who have worked through the classics and want to see what the field thinks is genuinely new.\u003c\/p\u003e\n\u003ch2\u003eFrequently Asked Questions\u003c\/h2\u003e\n\u003ch3\u003eWhat is the Nob Yoshigahara Puzzle Design Competition?\u003c\/h3\u003e\n\u003cp\u003eAn annual competition held at the International Puzzle Party, named after the Japanese puzzle designer Nob Yoshigahara. Designers submit new mechanical puzzles, which are solved and judged by a jury and voted on by attendees.\u003c\/p\u003e\n\u003ch3\u003eAre these the original competition entries?\u003c\/h3\u003e\n\u003cp\u003eNo. The competition entries are usually one-off pieces in wood, made by the designer or a specialist craftsman. These are 3D-printed productions of the same designs, made under licence so the design reaches more people at a workable price.\u003c\/p\u003e\n\u003ch3\u003eDoes an award mean the puzzle is hard?\u003c\/h3\u003e\n\u003cp\u003eNot necessarily. The competition rewards originality of design, not difficulty. Several winners here are solvable in under an hour. What they share is an idea nobody had used before.\u003c\/p\u003e\n\u003ch3\u003eWhich award is the most significant?\u003c\/h3\u003e\n\u003cp\u003eThe Puzzlers' Award, because it is voted by the other designers in the competition. Identical Twins is the one puzzle in this shop that has won it.\u003c\/p\u003e","products":[{"product_id":"4l-puzzle","title":"4L Puzzle | Pack 4 L Pieces In Box","description":"\u003cp\u003eThe goal of the 4L Puzzle is to fit the 4 L-shaped pieces inside the restricted box. How hard can it be?\u003c\/p\u003e\u003cp\u003eWell - it's much harder than it looks. Putting three pieces inside is easy, but most people will struggle for HOURS to fit the 4th piece...\u003c\/p\u003e\u003cp\u003e...That is, if they ever do.\u003c\/p\u003e\u003cp\u003eThe 4L puzzle was awarded an honorable mention in the 2015 International Puzzle Party for its ingenious design.\u003c\/p\u003e\u003cp\u003eDesigned by \u003ca href=\"\/collections\/yasuhiro-hashimoto\"\u003eYasuhiro Hashimoto\u003c\/a\u003e.\u003c\/p\u003e\u003cp\u003eUpdate 1.1: Color changed from Wood \u0026amp; Red to Marble \u0026amp; Turquoise, strengthened lid durability.\u003c\/p\u003e\u003ch2\u003eWho Is This For?\u003c\/h2\u003e\u003cp\u003ePerfect for adults who love a deceptively simple challenge. A crowd-pleasing gift that fits in a pocket but delivers hours of frustration. If you know someone who thinks they are good at puzzles - this is the one to test that theory.\u003c\/p\u003e\u003ch2\u003ePuzzle Specs\u003c\/h2\u003e\u003cul\u003e\n\u003cli\u003e\n\u003cstrong\u003eDifficulty:\u003c\/strong\u003e Expert\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003ePieces:\u003c\/strong\u003e 4 L-shaped pieces\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eMaterial:\u003c\/strong\u003e 3D-printed PLA\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eBest For:\u003c\/strong\u003e Ages 14+\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eAward:\u003c\/strong\u003e Honorable Mention, 2015 International Puzzle Party\u003c\/li\u003e\n\u003c\/ul\u003e\u003ch2\u003eWhat Makes It Hard?\u003c\/h2\u003e\u003cp\u003eFour identical L-shaped pieces. One small box. It sounds like it should work - until it doesn't. Every time you get three pieces settled, the fourth refuses to cooperate. The geometry feels wrong in every orientation you try.\u003c\/p\u003e\u003cp\u003eThat's not an accident. The solution requires a spatial insight that most people never consider - because nothing in everyday experience prepares you for it. When it finally clicks, the reaction is always the same: disbelief, then a big grin.\u003c\/p\u003e\u003cp\u003eThat moment is the whole point of this puzzle. It's not about brute force. It's about seeing something you couldn't see before.\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eThink you can crack it? Add to cart and prove it.\u003c\/strong\u003e\u003c\/p\u003e\u003cp\u003eIf you like packing puzzles, \u003ca href=\"\/products\/osanori-essentials-6-osanori-puzzles-free-shipping\"\u003eOsanori Essentials\u003c\/a\u003e collects six Osanori Yamamoto puzzles, Loach Bed and Waltz among them, in one set.\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":46200056348839,"sku":"GP-4L","price":34.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/4l_puzzle_marble.png?v=1781968139"},{"product_id":"galette","title":"Galette | Pack 5 Tetrominoes in Frame","description":"\u003cp\u003eGalette is a 3D packing puzzle with a simple goal - pack all 5 tetromino pieces inside the box. But a simple goal doesn't mean an easy solution.\u003c\/p\u003e\u003cp\u003eA tetromino piece is made of 4 voxels, or 4 cubes attached together.\u003c\/p\u003e\u003cp\u003eThere are 2 openings - a wide one from the top and a small one from the side.\u003c\/p\u003e\u003cp\u003eHowever, this small restriction changes everything: not only is it blocking the pieces' way inside, but also restricts their path inside the box while hiding them from your vision.\u003c\/p\u003e\u003cp\u003eThis simple addition turns Galette into a considerable challenge. Do you think you can solve it?\u003c\/p\u003e\u003ch2\u003ePuzzle Specs\u003c\/h2\u003e\u003cul\u003e\n\u003cli\u003e\n\u003cstrong\u003eDifficulty:\u003c\/strong\u003e Hard\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003ePieces:\u003c\/strong\u003e 5 tetromino pieces (4 voxels each)\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eMaterial:\u003c\/strong\u003e 3D-printed PLA\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eOpenings:\u003c\/strong\u003e 2 (top wide, side narrow)\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eBest For:\u003c\/strong\u003e Ages 14+\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eRecommended for:\u003c\/strong\u003e puzzle gift, desk toy, brain teaser\u003c\/li\u003e\n\u003c\/ul\u003e\u003ch2\u003eWho Is This For?\u003c\/h2\u003e\u003cp\u003eGalette is a perfect gift for math lovers, fans of block-stacking games, and puzzle collectors - anyone who appreciates a clean design hiding a genuinely difficult challenge. If you know someone who thinks they've seen every packing puzzle, this one will surprise them. It belongs on a desk, a shelf, or under a gift wrap.\u003c\/p\u003e\u003ch2\u003eWhy Is It So Hard?\u003c\/h2\u003e\u003cp\u003eThe top opening looks generous enough - and for the first few pieces, it is. But the side opening changes the rules entirely. It forces certain pieces through a narrow path, which means your usual stacking instincts stop working. Pieces that fit perfectly from above simply won't cooperate when the side constraint is in play. You have to think in three dimensions, rethink orientations you've already dismissed, and stay patient when every attempt seems almost right. Almost.\u003c\/p\u003e\u003cp\u003e\u003cem\u003eDesigned by \u003ca href=\"\/collections\/osanori-yamamoto\"\u003eOsanori Yamamoto\u003c\/a\u003e\u003c\/em\u003e\u003cbr\u003eThe puzzle measures 8.5 cm x 8.5 cm x 2.5 cm\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eReady to be stumped? Add Galette to your cart.\u003c\/strong\u003e\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":46500536615079,"sku":"GP-GALE","price":29.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/galette_marble.png?v=1782028494"},{"product_id":"four-fit-puzzle","title":"Four Fit | Brutal 4-Piece Packing","description":"\u003cp\u003e\u003cstrong\u003eQuick answer:\u003c\/strong\u003e Four Fit is a 4-piece packing puzzle by \u003ca href=\"\/collections\/stewart-coffin\"\u003eStewart Coffin\u003c\/a\u003e, one of the most influential mechanical puzzle designers in history. Hard difficulty, 1-4 hour solve. Four pieces, one frame, and a single ingenious solution that punishes assumption and rewards patient spatial thinking.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eBest for:\u003c\/strong\u003e experienced solvers who want a compact puzzle that'll actually stump them for hours, collectors adding a Stewart Coffin design to their shelf, and puzzle enthusiasts drawn to puzzles where the piece count looks trivial but the solve isn't.\u003c\/p\u003e\n\u003cp\u003eThis 4-piece packing puzzle also packs a punch.\u003c\/p\u003e\n\u003cp\u003eIt took me YEARS to figure it out, and now it's your turn to try. \u003c\/p\u003e\n\u003cp\u003eThe goal of this classic puzzle is very simple - pack the four pieces inside the frame.\u003c\/p\u003e\n\u003cp\u003eThink you can do it?\u003c\/p\u003e\n\u003cp\u003eWhat's special about this puzzle?\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003eSurprisingly Difficult\u003c\/li\u003e\n\u003cli\u003eHours of Challenging fun\u003c\/li\u003e\n\u003cli\u003eIngenious solution\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003eDesigned by Stewart Coffin\u003c\/p\u003e\n\u003ch2\u003eFrequently Asked Questions\u003c\/h2\u003e\n\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWhat is Four Fit?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eFour Fit is a Hard-difficulty packing puzzle designed by Stewart Coffin. Four oddly-shaped pieces must be packed into a small frame. The setup looks trivial - it isn't. Most solvers spend 1-4 hours finding the one arrangement that works.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWho is Stewart Coffin?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eStewart Coffin is one of the most celebrated mechanical puzzle designers of the past century. His designs are known for elegant single-solution puzzles where a seemingly simple setup hides a genuinely difficult challenge. Four Fit is a textbook example of his style.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWhy is Four Fit so hard?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eWith only 4 pieces, nearly every arrangement you try will look like it should work - until it doesn't quite fit. The frame adds a geometric constraint that defeats trial-and-error. The only way through is spatial reasoning: understanding how the pieces relate to each other before you commit to a position.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eIs Four Fit a good gift for a puzzle enthusiast?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eYes - especially for someone who already enjoys packing puzzles or Stewart Coffin's work. It's compact, looks great on a desk, and the Hard difficulty means the recipient will spend real time with it rather than solving it in one sitting. It's a puzzle they'll keep coming back to.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\n\u003cdiv class=\"gptr\" data-handle=\"four-fit-puzzle\"\u003e\n\u003cstyle\u003e\n.gptr{--gptr-fg:rgb(var(--color-foreground,18,18,18));\n --gptr-line:rgba(var(--color-foreground,18,18,18),.18);\n --gptr-muted:rgba(var(--color-foreground,18,18,18),.7);\n --gptr-accent:#0B7FA8;\n font-family:inherit;color:var(--gptr-fg);margin:1.2em 0;max-width:30em;outline:none}\n.gptr:focus{outline:none}\n.gptr:focus-visible{outline:none}\n.gptr:focus-visible .gptr-board svg{outline:2px solid var(--gptr-accent);outline-offset:2px;border-radius:4px}\n.gptr *{box-sizing:border-box}\n.gptr .gptr-h{font-family:inherit;font-size:1.2em;line-height:1.3;font-weight:600;\n letter-spacing:normal;margin:0 0 .3em;color:var(--gptr-fg)}\n.gptr .gptr-intro{font-size:.92em;line-height:1.5;margin:0 0 .8em;color:var(--gptr-muted);max-width:36em}\n.gptr .gptr-stage{display:flex;flex-direction:column;align-items:flex-start}\n.gptr .gptr-board{width:100%;max-width:24em;direction:ltr}\n.gptr .gptr-board svg{display:block;width:100%;height:auto;max-width:none;\n \/* a finger on the empty tray still scrolls the page; a finger on a piece drags it *\/\n touch-action:pan-y}\n.gptr .gptr-board,.gptr .gptr-rack,.gptr .gptr-ctl button{-webkit-tap-highlight-color:transparent;\n -webkit-touch-callout:none;-webkit-user-select:none;user-select:none}\n.gptr .gptr-rack{display:flex;flex-wrap:wrap;gap:.6em;align-items:center;direction:ltr;\n width:100%;max-width:24em;min-height:3.4em;margin-top:.7em;padding:.6em .7em;\n border:1px solid var(--gptr-line);border-radius:7px}\n.gptr[dir=rtl] .gptr-rack{justify-content:flex-end}\n.gptr .gptr-rack svg{display:block;flex:none;touch-action:none;cursor:grab;border-radius:4px;max-width:none}\n.gptr .gptr-rack svg[data-sel]{outline:2px solid var(--gptr-accent);outline-offset:2px}\n.gptr .gptr-none{display:inline-block;min-height:1em}\n.gptr .gptr-ctl{display:flex;flex-wrap:wrap;gap:.45em;margin-top:.8em}\n.gptr .gptr-ctl button{appearance:none;-webkit-appearance:none;margin:0;border:1px solid var(--gptr-line);\n background:transparent;color:var(--gptr-fg);font-family:inherit;font-size:.85em;line-height:1.2;\n letter-spacing:normal;text-transform:none;min-height:2.9em;padding:.6em 1em;border-radius:6px;\n cursor:pointer;box-shadow:none}\n.gptr .gptr-ctl button:hover{border-color:var(--gptr-accent)}\n.gptr .gptr-ctl button:disabled{opacity:.38;cursor:default}\n.gptr .gptr-ctl button:disabled:hover{border-color:var(--gptr-line)}\n.gptr .gptr-say{font-size:.88em;line-height:1.45;color:var(--gptr-muted);min-height:1.45em;margin:.7em 0 0}\n.gptr .gptr-best{font-size:.95em;line-height:1.45;font-weight:600;color:var(--gptr-fg);margin:.3em 0 0}\n.gptr .gptr-end{font-size:1em;line-height:1.45;font-weight:600;color:var(--gptr-accent);margin:.45em 0 0}\n.gptr .gptr-end[hidden]{display:none}\n\u003c\/style\u003e\n\u003c\/div\u003e\n\u003cscript\u003e\n\/* Greg Puzzles tray teaser (.gptr) - engine.\n   The real tray and the real pieces, quarter turns and flips only. The page\n   carries shapes and nothing else: no positions that finish the puzzle, no\n   finish check, no network calls, and no finished state is ever shown.\n\n   Written to live inside a Shopify product description:\n   - every DOM node is made with createElement \/ createElementNS, so no closing\n     tag ever appears inside a JS string (Shopify reparses body_html);\n   - SVG attributes are set with setAttribute, so viewBox keeps its case;\n   - nothing relies on an empty div being visible (the theme hides div:empty);\n   - hit tests go through the SVG's own screen matrix, never restated numbers.\n\n   Three modes, chosen by the config:\n   - \"place\": pieces come from a rack and go anywhere inside the tray grid.\n   - \"free\": pieces come from a rack and sit anywhere in the true cavity, still\n     square to the walls, sliding against walls and each other (Four Fit, whose\n     cavity is not a whole number of squares).\n   - \"slide\": pieces start outside the tray and get in only by sliding through\n     the opening one square at a time; they turn only while fully outside. *\/\n(function () {\n  \"use strict\";\n  if (window.GPTR) return;\n\n  var NS = \"http:\/\/www.w3.org\/2000\/svg\";\n  var S = 10;                     \/* one grid square in SVG units *\/\n  var seq = 0, clipSeq = 0;\n  var COL = [\"#2E93C4\", \"#17678F\", \"#4FAAD0\", \"#0F4D69\"];\n  var LIGHT = [\"#58B3DD\", \"#2E88B2\", \"#78C6E4\", \"#2A6E8E\"];\n  var PLAY_GAP_CAP = 12000;       \/* idle time between touches counts up to this *\/\n  var EFFORT_MS = 45000;          \/* about 45 seconds of real play *\/\n  var EFFORT_OUTS = 3;            \/* or three pieces taken back out *\/\n\n  var TXT = {\n    en: {\n      title: \"Try it yourself\",\n      introPlace: \"Tap a piece, then tap a square in the tray. Dragging works too.\",\n      introSlide: \"Pieces go in only through the gap in the wall, one square at a time. Tap a piece, then tap where it should slide. Dragging works too.\",\n      rotate: \"Rotate\", flip: \"Flip\", take: \"Take out\", empty: \"Empty the tray\", reset: \"Start over\",\n      best: \"Best so far: {n} of {m} in\",\n      end: \"Still won't fit? That's the puzzle.\",\n      nofit: \"That will not fit there.\",\n      noturn: \"No room to turn it there.\",\n      blocked: \"That piece has nowhere to go that way.\",\n      board: \"Puzzle tray\", rack: \"Pieces\"\n    },\n    he: {\n      title: \"נסו בעצמכם\",\n      introPlace: \"הקישו על חלק ואז על משבצת במגש. אפשר גם לגרור.\",\n      introSlide: \"החלקים נכנסים רק דרך הפתח בדופן, משבצת אחת בכל פעם. הקישו על חלק ואז על המקום שאליו הוא אמור להחליק. אפשר גם לגרור.\",\n      rotate: \"סיבוב\", flip: \"היפוך\", take: \"הוצאה\", empty: \"ריקון המגש\", reset: \"התחלה מחדש\",\n      best: \"השיא עד עכשיו: {n} מתוך {m} בפנים\",\n      end: \"עדיין לא נכנס? זה הפאזל.\",\n      nofit: \"זה לא נכנס שם.\",\n      noturn: \"אין שם מקום לסובב אותו.\",\n      blocked: \"לחלק הזה אין לאן לזוז לכיוון הזה.\",\n      board: \"מגש הפאזל\", rack: \"החלקים\"\n    },\n    ja: {\n      title: \"試してみてください\",\n      introPlace: \"ピースをタップしてから、トレイのマスをタップしてください。ドラッグでも動かせます。\",\n      introSlide: \"ピースは壁のすき間からしか入りません。1マスずつです。ピースをタップしてから、すべらせたい先をタップしてください。ドラッグでも動かせます。\",\n      rotate: \"回転\", flip: \"裏返す\", take: \"取り出す\", empty: \"トレイを空にする\", reset: \"最初から\",\n      best: \"これまでの最高：{m}個中{n}個が入りました\",\n      end: \"まだ入らない？それがこのパズルです。\",\n      nofit: \"そこには入りません。\",\n      noturn: \"そこでは回す余地がありません。\",\n      blocked: \"そのピースはその方向へ動けません。\",\n      board: \"パズルのトレイ\", rack: \"ピース\"\n    }\n  };\n\n  function langOf() {\n    var l = (document.documentElement.getAttribute(\"lang\") || \"\").toLowerCase();\n    if (l.indexOf(\"he\") === 0 || l.indexOf(\"iw\") === 0) return \"he\";\n    if (l.indexOf(\"ja\") === 0) return \"ja\";\n    return \"en\";\n  }\n  function fmt(s, o) {\n    return s.replace(\/\\{(\\w+)\\}\/g, function (m, k) { return (k in o) ? String(o[k]) : m; });\n  }\n  function el(tag, cls, txt) {\n    var e = document.createElement(tag);\n    if (cls) e.className = cls;\n    if (txt != null) e.textContent = txt;\n    return e;\n  }\n  function sv(tag, attrs) {\n    var e = document.createElementNS(NS, tag);\n    for (var k in attrs) if (Object.prototype.hasOwnProperty.call(attrs, k)) e.setAttribute(k, attrs[k]);\n    return e;\n  }\n  function clear(node) { while (node.firstChild) node.removeChild(node.firstChild); }\n\n  \/* ---------- shapes: cells are [row, col], rows run down ---------- *\/\n  function norm(cs) {\n    var r0 = Infinity, c0 = Infinity;\n    cs.forEach(function (c) { if (c[0] \u003c r0) r0 = c[0]; if (c[1] \u003c c0) c0 = c[1]; });\n    return cs.map(function (c) { return [c[0] - r0, c[1] - c0]; });\n  }\n  \/* order is kept by both, so a marked cell (the fish's eye) stays marked *\/\n  function rot(cs) { return norm(cs.map(function (c) { return [c[1], -c[0]]; })); }\n  function flp(cs) { return norm(cs.map(function (c) { return [c[0], -c[1]]; })); }\n  function dims(cs) {\n    var h = 0, w = 0;\n    cs.forEach(function (c) { if (c[0] + 1 \u003e h) h = c[0] + 1; if (c[1] + 1 \u003e w) w = c[1] + 1; });\n    return [h, w];\n  }\n  function shift(cs, at) { return cs.map(function (c) { return [c[0] + at[0], c[1] + at[1]]; }); }\n  function copy(cs) { return cs.map(function (c) { return [c[0], c[1]]; }); }\n  function key(r, c) { return r + \",\" + c; }\n  function nearestCell(shape, rel) {\n    var best = shape[0], bd = Infinity;\n    shape.forEach(function (c) {\n      var d = Math.abs(c[0] - rel[0]) + Math.abs(c[1] - rel[1]);\n      if (d \u003c bd) { bd = d; best = c; }\n    });\n    return [best[0], best[1]];\n  }\n\n  \/* ---------- outlines: one rounded path per piece ---------- *\/\n  function outline(cells) {\n    var has = {};\n    cells.forEach(function (c) { has[key(c[0], c[1])] = 1; });\n    var seg = [];\n    cells.forEach(function (c) {\n      var r = c[0], k = c[1];\n      if (!has[key(r - 1, k)]) seg.push([[k, r], [k + 1, r]]);\n      if (!has[key(r + 1, k)]) seg.push([[k, r + 1], [k + 1, r + 1]]);\n      if (!has[key(r, k - 1)]) seg.push([[k, r], [k, r + 1]]);\n      if (!has[key(r, k + 1)]) seg.push([[k + 1, r], [k + 1, r + 1]]);\n    });\n    return seg;\n  }\n  function loops(cells) {\n    var segs = outline(cells).map(function (e) { return [e[0].slice(), e[1].slice()]; });\n    var out = [];\n    while (segs.length) {\n      var ring = [segs[0][0], segs[0][1]];\n      segs.splice(0, 1);\n      var guard = 0;\n      while (guard++ \u003c 400) {\n        var head = ring[ring.length - 1], found = -1;\n        for (var i = 0; i \u003c segs.length; i++) {\n          if (segs[i][0][0] === head[0] \u0026\u0026 segs[i][0][1] === head[1]) { ring.push(segs[i][1]); found = i; break; }\n          if (segs[i][1][0] === head[0] \u0026\u0026 segs[i][1][1] === head[1]) { ring.push(segs[i][0]); found = i; break; }\n        }\n        if (found \u003c 0) break;\n        segs.splice(found, 1);\n        var a = ring[0], b = ring[ring.length - 1];\n        if (a[0] === b[0] \u0026\u0026 a[1] === b[1]) { ring.pop(); break; }\n      }\n      if (ring.length \u003e 2) out.push(ring);\n    }\n    return out;\n  }\n  function roundedPath(ring, r) {\n    \/* drop collinear points first so long straight edges stay one segment *\/\n    var pts = ring.filter(function (p1, i) {\n      var p0 = ring[(i - 1 + ring.length) % ring.length], p2 = ring[(i + 1) % ring.length];\n      return (p1[0] - p0[0]) * (p2[1] - p1[1]) - (p1[1] - p0[1]) * (p2[0] - p1[0]) !== 0;\n    });\n    var d = \"\", n = pts.length;\n    for (var i = 0; i \u003c n; i++) {\n      var p0 = pts[(i - 1 + n) % n], p1 = pts[i], p2 = pts[(i + 1) % n];\n      var v1 = [p1[0] - p0[0], p1[1] - p0[1]], v2 = [p2[0] - p1[0], p2[1] - p1[1]];\n      var l1 = Math.hypot(v1[0], v1[1]) || 1, l2 = Math.hypot(v2[0], v2[1]) || 1;\n      var rr = Math.min(r, l1 \/ 2, l2 \/ 2);\n      var a = [p1[0] - v1[0] \/ l1 * rr, p1[1] - v1[1] \/ l1 * rr];\n      var b = [p1[0] + v2[0] \/ l2 * rr, p1[1] + v2[1] \/ l2 * rr];\n      d += (i === 0 ? \"M\" : \"L\") + a[0].toFixed(2) + \" \" + a[1].toFixed(2);\n      d += \"Q\" + p1[0].toFixed(2) + \" \" + p1[1].toFixed(2) + \" \" + b[0].toFixed(2) + \" \" + b[1].toFixed(2);\n    }\n    return d + \"Z\";\n  }\n  function piecePath(cells) {\n    return loops(cells).map(function (ring) {\n      return roundedPath(ring.map(function (p) { return [p[0] * S, p[1] * S]; }), S * 0.17);\n    }).join(\" \");\n  }\n\n  \/* screen point -\u003e SVG user units, through the element's own matrix *\/\n  function toView(svgEl, x, y) {\n    var m = svgEl.getScreenCTM();\n    if (!m) return { x: NaN, y: NaN };\n    var inv = m.inverse(), q;\n    if (typeof DOMPoint === \"function\") q = new DOMPoint(x, y).matrixTransform(inv);\n    else { var pt = svgEl.createSVGPoint(); pt.x = x; pt.y = y; q = pt.matrixTransform(inv); }\n    return { x: q.x, y: q.y };\n  }\n\n  function mount(root, C) {\n    if (!root || root.getAttribute(\"data-gptr-on\")) return;\n    root.setAttribute(\"data-gptr-on\", \"1\");\n    var L = langOf(), t = TXT[L];\n    root.setAttribute(\"dir\", L === \"he\" ? \"rtl\" : \"ltr\");\n    root.setAttribute(\"lang\", L);\n    root.tabIndex = 0;\n\n    var W = C.grid[0], H = C.grid[1];\n    var SLIDE = C.mode === \"slide\", FREE = C.mode === \"free\";\n    var uid = \"gptr\" + (++seq) + Math.floor(Math.random() * 1e8).toString(36);\n    var Z = C.zone || null;\n    var OPEN = {};\n    if (C.opening) C.opening.cols.forEach(function (c) { OPEN[c] = 1; });\n\n    var pieces = C.pieces.map(function (p, i) {\n      return {\n        i: i, base: copy(p.cells), shape: copy(p.cells), at: null,\n        hole: p.hole ? p.hole[0] : -1, holeR: p.hole ? p.hole[1] : 0,\n        grab: [p.cells[0][0], p.cells[0][1]], wasIn: false\n      };\n    });\n    function home(p) { return C.start ? [C.start[p.i][0], C.start[p.i][1]] : null; }\n    if (SLIDE) pieces.forEach(function (p) { p.at = home(p); });\n\n    var sel = null, drag = null, tap = null, msg = \"\";\n    var best = 0, outs = 0, playMs = 0, lastAct = 0, endOn = false;\n\n    \/* ---------- rules ---------- *\/\n    function free(r, c) {\n      if (r \u003e= 0 \u0026\u0026 r \u003c H \u0026\u0026 c \u003e= 0 \u0026\u0026 c \u003c W) return true;          \/* the tray grid *\/\n      if (!SLIDE) return false;\n      if (r === -1) return OPEN[c] === 1;                             \/* the wall: only its gap *\/\n      return r \u003e= Z.top \u0026\u0026 r \u003c= -2 \u0026\u0026 c \u003e= Z.left \u0026\u0026 c \u003c= Z.right;    \/* the table outside *\/\n    }\n    function occupied(skip) {\n      var o = {};\n      pieces.forEach(function (q) {\n        if (q === skip || !q.at) return;\n        shift(q.shape, q.at).forEach(function (c) { o[key(c[0], c[1])] = 1; });\n      });\n      return o;\n    }\n    function legal(p, shape, at) {\n      var o = occupied(p), cs = shift(shape, at);\n      for (var i = 0; i \u003c cs.length; i++) {\n        if (!free(cs[i][0], cs[i][1]) || o[key(cs[i][0], cs[i][1])]) return false;\n      }\n      return true;\n    }\n    function cellsOf(p) { return p.at ? shift(p.shape, p.at) : null; }\n    function allOutside(cs) { return cs.every(function (c) { return c[0] \u003c= -2; }); }\n    function isIn(p) {\n      if (FREE) return !!p.at;                     \/* free mode only ever holds a piece fully inside *\/\n      var cs = cellsOf(p);\n      return !!cs \u0026\u0026 cs.every(function (c) { return c[0] \u003e= 0 \u0026\u0026 c[0] \u003c H \u0026\u0026 c[1] \u003e= 0 \u0026\u0026 c[1] \u003c W; });\n    }\n    function isOut(p) { return SLIDE ? allOutside(cellsOf(p)) : !p.at; }\n    function engaged(p) { return SLIDE ? !isOut(p) : !!p.at; }\n\n    \/* ---------- free mode ----------\n       Positions are whole thousandths of a unit from the cavity's top left corner,\n       so every overlap and wall test is an exact integer comparison. Two unit\n       squares overlap when they are less than one unit apart on both axes; a piece\n       is in when every square lies inside the cavity.\n\n       Why all four can still never go in: take any legal arrangement and group the\n       pieces by the fractional part of their x. Slide one group with a nonzero\n       fraction left until its fraction equals the next lower one present, or zero.\n       On the way, squares from different groups are never a whole number apart, so\n       a gap of one unit or more can only close to exactly one: pieces at most\n       touch, and none passes the wall because x never drops below its own\n       fraction. Repeat until every x is whole, then do the same for y. Every piece\n       now sits on whole squares, and since the cavity is under 6 by 5 units they\n       all lie inside the 5 by 4 grid, where the shape search found no way to hold\n       all four. So no arrangement in the true cavity holds all four either. *\/\n    var Q = 1000, SNAP = 150;\n    var CWQ = Math.floor(C.cavity[0] * Q + 1e-6), CHQ = Math.floor(C.cavity[1] * Q + 1e-6);\n    function units(at) { return FREE ? [at[0] \/ Q, at[1] \/ Q] : at; }\n    function qCells(shape, at) { return shape.map(function (c) { return [c[0] * Q + at[0], c[1] * Q + at[1]]; }); }\n    function qOthers(p) {\n      var o = [];\n      pieces.forEach(function (q) { if (q !== p \u0026\u0026 q.at) o.push.apply(o, qCells(q.shape, q.at)); });\n      return o;\n    }\n    function qHit(mine, others) {\n      for (var i = 0; i \u003c mine.length; i++) {\n        for (var j = 0; j \u003c others.length; j++) {\n          if (Math.abs(mine[i][0] - others[j][0]) \u003c Q \u0026\u0026 Math.abs(mine[i][1] - others[j][1]) \u003c Q) return true;\n        }\n      }\n      return false;\n    }\n    function qMax(shape) { var dm = dims(shape); return [CHQ - dm[0] * Q, CWQ - dm[1] * Q]; }\n    function qInside(shape, at) {\n      var m = qMax(shape);\n      return at[0] \u003e= 0 \u0026\u0026 at[1] \u003e= 0 \u0026\u0026 at[0] \u003c= m[0] \u0026\u0026 at[1] \u003c= m[1];\n    }\n    function qClamp(shape, at) {\n      var m = qMax(shape);\n      return [Math.max(0, Math.min(m[0], Math.round(at[0]))), Math.max(0, Math.min(m[1], Math.round(at[1])))];\n    }\n    function qLegal(p, shape, at) { return qInside(shape, at) \u0026\u0026 !qHit(qCells(shape, at), qOthers(p)); }\n    \/* slide along one axis (0 rows, 1 columns) toward v, stopping flush at a wall\n       or at the first piece in the way; `at` is never overlapping to begin with *\/\n    function qSweep(p, at, ax, v) {\n      var o = 1 - ax, cur = at[ax];\n      v = Math.max(0, Math.min(qMax(p.shape)[ax], Math.round(v)));\n      if (v === cur) return at;\n      var dir = v \u003e cur ? 1 : -1, stop = v, mine = qCells(p.shape, at), others = qOthers(p);\n      mine.forEach(function (a) {\n        others.forEach(function (b) {\n          if (Math.abs(a[o] - b[o]) \u003e= Q) return;            \/* they pass each other *\/\n          var gap = (b[ax] - a[ax]) * dir;\n          if (gap \u003c Q) return;                               \/* behind it, not ahead *\/\n          var st = cur + dir * (gap - Q);\n          if (dir \u003e 0 ? st \u003c stop : st \u003e stop) stop = st;\n        });\n      });\n      var r = at.slice();\n      r[ax] = stop;\n      return r;\n    }\n    \/* follow the hand: the bigger pull first, then the other axis, a few rounds so\n       a piece slides along whatever stops it *\/\n    function qMove(p, target) {\n      var at = p.at.slice();\n      for (var i = 0; i \u003c 4; i++) {\n        var before = at[0] + \",\" + at[1];\n        var ax = Math.abs(target[1] - at[1]) \u003e= Math.abs(target[0] - at[0]) ? 1 : 0;\n        at = qSweep(p, at, ax, target[ax]);\n        at = qSweep(p, at, 1 - ax, target[1 - ax]);\n        if (at[0] + \",\" + at[1] === before) break;\n      }\n      return at;\n    }\n    \/* an edge within SNAP of a wall or of another piece's facing edge closes up flush *\/\n    function qSnap(p, shape, at) {\n      var others = qOthers(p), m = qMax(shape);\n      at = at.slice();\n      for (var ax = 1; ax \u003e= 0; ax--) {\n        var o = 1 - ax, mine = qCells(shape, at), cands = [0, m[ax]];\n        mine.forEach(function (a) {\n          others.forEach(function (b) {\n            if (Math.abs(a[o] - b[o]) \u003e= Q) return;\n            cands.push(at[ax] + b[ax] + Q - a[ax], at[ax] + b[ax] - Q - a[ax]);\n          });\n        });\n        var bestV = null, bd = SNAP + 1;\n        for (var i = 0; i \u003c cands.length; i++) {\n          var dd = Math.abs(cands[i] - at[ax]);\n          if (dd \u003e SNAP || dd \u003e= bd) continue;\n          var tr = at.slice();\n          tr[ax] = cands[i];\n          if (qInside(shape, tr) \u0026\u0026 !qHit(qCells(shape, tr), others)) { bd = dd; bestV = cands[i]; }\n        }\n        if (bestV !== null) at[ax] = bestV;\n      }\n      return at;\n    }\n\n    function step(p, dr, dc) {\n      var at = [p.at[0] + dr, p.at[1] + dc];\n      if (!legal(p, p.shape, at)) return false;\n      p.at = at;\n      return true;\n    }\n    \/* slide one square at a time toward a target, the bigger pull first and\n       the other axis when that is blocked *\/\n    function toward(p, target, grab) {\n      var moved = 0;\n      for (var g = 0; g \u003c 40; g++) {\n        var dr = target[0] - grab[0] - p.at[0], dc = target[1] - grab[1] - p.at[1];\n        if (!dr \u0026\u0026 !dc) break;\n        var sr = dr \u003e 0 ? 1 : (dr \u003c 0 ? -1 : 0), sc = dc \u003e 0 ? 1 : (dc \u003c 0 ? -1 : 0);\n        var tries = Math.abs(dr) \u003e= Math.abs(dc) ? [[sr, 0], [0, sc]] : [[0, sc], [sr, 0]];\n        var ok = false;\n        for (var i = 0; i \u003c 2; i++) {\n          if (!tries[i][0] \u0026\u0026 !tries[i][1]) continue;\n          if (step(p, tries[i][0], tries[i][1])) { ok = true; break; }\n        }\n        if (!ok) break;\n        moved++;\n      }\n      return moved;\n    }\n    \/* tap-to-place: the touched square of the piece lands on the tapped square\n       if it can; otherwise any other square of the piece that lets it fit *\/\n    function placeNear(p, cell) {\n      var anchors = p.shape.map(function (c, i) {\n        return { c: c, i: i, d: Math.abs(c[0] - p.grab[0]) + Math.abs(c[1] - p.grab[1]) };\n      });\n      anchors.sort(function (a, b) { return (a.d - b.d) || (a.i - b.i); });\n      for (var k = 0; k \u003c anchors.length; k++) {\n        var at = [cell[0] - anchors[k].c[0], cell[1] - anchors[k].c[1]];\n        if (legal(p, p.shape, at)) { p.at = at; return true; }\n      }\n      return false;\n    }\n    function turn(p, fn) {\n      var ns = fn(p.shape);\n      if (!p.at) { p.shape = ns; return true; }\n      if (FREE) {\n        \/* a quarter turn or flip about the piece's middle; a wall nudges it back in *\/\n        var e0 = dims(p.shape), e1 = dims(ns);\n        var fa = qClamp(ns, [p.at[0] + (e0[0] - e1[0]) * Q \/ 2, p.at[1] + (e0[1] - e1[1]) * Q \/ 2]);\n        if (!qLegal(p, ns, fa)) return false;\n        p.shape = ns;\n        p.at = fa;\n        return true;\n      }\n      if (SLIDE \u0026\u0026 !isOut(p)) return false;\n      var d0 = dims(p.shape), d1 = dims(ns);\n      var base = [p.at[0] + Math.round((d0[0] - d1[0]) \/ 2), p.at[1] + Math.round((d0[1] - d1[1]) \/ 2)];\n      var offs = [];\n      for (var dr = -2; dr \u003c= 2; dr++) for (var dc = -2; dc \u003c= 2; dc++) offs.push([dr, dc]);\n      offs.sort(function (a, b) {\n        return (Math.abs(a[0]) + Math.abs(a[1])) - (Math.abs(b[0]) + Math.abs(b[1]));\n      });\n      for (var i = 0; i \u003c offs.length; i++) {\n        var at = [base[0] + offs[i][0], base[1] + offs[i][1]];\n        if (legal(p, ns, at) \u0026\u0026 (!SLIDE || allOutside(shift(ns, at)))) { p.shape = ns; p.at = at; return true; }\n      }\n      return false;\n    }\n    \/* slide mode: lift a piece out and set it down on the table, near its start *\/\n    function sendHome(p) {\n      var h = home(p), shapes = [p.shape, p.base];\n      for (var s = 0; s \u003c shapes.length; s++) {\n        var sh = shapes[s], dm = dims(sh), bestAt = null, bd = Infinity;\n        for (var r = Z.top; r + dm[0] - 1 \u003c= -2; r++) {\n          for (var c = Z.left; c + dm[1] - 1 \u003c= Z.right; c++) {\n            if (!legal(p, sh, [r, c])) continue;\n            var d = Math.abs(r - h[0]) + Math.abs(c - h[1]);\n            if (d \u003c bd) { bd = d; bestAt = [r, c]; }\n          }\n        }\n        if (bestAt) { p.shape = copy(sh); p.at = bestAt; return true; }\n      }\n      return false;\n    }\n\n    \/* ---------- effort and the best count ---------- *\/\n    function act() {\n      var now = Date.now();\n      if (lastAct) playMs += Math.min(Math.max(0, now - lastAct), PLAY_GAP_CAP);\n      lastAct = now;\n    }\n    function settle() {\n      var n = 0;\n      pieces.forEach(function (p) {\n        if (isIn(p)) { n++; p.wasIn = true; }\n        else if (p.wasIn \u0026\u0026 isOut(p)) { outs++; p.wasIn = false; }\n      });\n      if (n \u003e best) best = n;\n      if (!endOn \u0026\u0026 (outs \u003e= EFFORT_OUTS || playMs \u003e= EFFORT_MS)) endOn = true;\n      render();\n    }\n\n    \/* ---------- DOM ---------- *\/\n    root.appendChild(el(\"h3\", \"gptr-h\", t.title));\n    root.appendChild(el(\"p\", \"gptr-intro\", SLIDE ? t.introSlide : t.introPlace));\n    var stage = el(\"div\", \"gptr-stage\");\n    var boardEl = el(\"div\", \"gptr-board\");\n    boardEl.setAttribute(\"dir\", \"ltr\");\n    stage.appendChild(boardEl);\n    var rackEl = null;\n    if (!SLIDE) {\n      rackEl = el(\"div\", \"gptr-rack\");\n      rackEl.setAttribute(\"dir\", \"ltr\");\n      rackEl.setAttribute(\"role\", \"group\");\n      rackEl.setAttribute(\"aria-label\", t.rack);\n      stage.appendChild(rackEl);\n    }\n    root.appendChild(stage);\n    var ctl = el(\"div\", \"gptr-ctl\");\n    function button(label, name) {\n      var b = el(\"button\", \"gptr-btn\", label);\n      b.type = \"button\";\n      b.setAttribute(\"data-act\", name);\n      ctl.appendChild(b);\n      return b;\n    }\n    var bRot = button(t.rotate, \"rotate\"), bFlip = button(t.flip, \"flip\"),\n        bTake = button(t.take, \"take\"), bEmpty = button(t.empty, \"empty\"), bReset = button(t.reset, \"reset\");\n    root.appendChild(ctl);\n    var sayEl = el(\"p\", \"gptr-say\", \" \");\n    sayEl.setAttribute(\"aria-live\", \"polite\");\n    var bestEl = el(\"p\", \"gptr-best\", \"\");\n    var endEl = el(\"p\", \"gptr-end\", t.end);\n    endEl.hidden = true;\n    root.appendChild(sayEl);\n    root.appendChild(bestEl);\n    root.appendChild(endEl);\n\n    \/* ---------- the board SVG: built once, only the piece layer is redrawn ---------- *\/\n    var cw = C.cavity[0], ch = C.cavity[1];\n    var offX = FREE ? 0 : (cw - W) \/ 2, offY = FREE ? 0 : (ch - H) \/ 2;   \/* grid centred in the cavity *\/\n    var R = C.rim * S;\n    var cx = -offX * S, cy = -offY * S;\n    var wallT = SLIDE ? C.opening.wall * S : R;\n    var vb;\n    if (SLIDE) {\n      var M = 1.5;\n      vb = [Z.left * S - M, Z.top * S - M, (Z.right - Z.left + 1) * S + 2 * M, (H - Z.top) * S + R + 2 * M];\n    } else {\n      vb = [cx - R, cy - R, cw * S + 2 * R, ch * S + 2 * R];\n    }\n    var svgEl = sv(\"svg\", { width: \"100%\", role: \"img\", \"aria-label\": t.board, \"data-s\": String(S) });\n    svgEl.setAttribute(\"viewBox\", vb.map(function (v) { return +v.toFixed(3); }).join(\" \"));\n    svgEl.style.aspectRatio = vb[2].toFixed(3) + \" \/ \" + vb[3].toFixed(3);\n    var defs = sv(\"defs\", {});\n    COL.forEach(function (c, k) {\n      var g = sv(\"linearGradient\", { id: uid + \"g\" + k, x1: \"0\", y1: \"0\", x2: \"0\", y2: \"1\" });\n      g.appendChild(sv(\"stop\", { offset: \"0\", \"stop-color\": LIGHT[k] }));\n      g.appendChild(sv(\"stop\", { offset: \"1\", \"stop-color\": c }));\n      defs.appendChild(g);\n    });\n    var soft = sv(\"filter\", { id: uid + \"soft\", x: \"-20%\", y: \"-20%\", width: \"140%\", height: \"140%\" });\n    soft.appendChild(sv(\"feGaussianBlur\", { stdDeviation: \"0.5\" }));\n    defs.appendChild(soft);\n    var grain = sv(\"filter\", { id: uid + \"grain\", x: \"0\", y: \"0\", width: \"100%\", height: \"100%\" });\n    grain.appendChild(sv(\"feTurbulence\", { type: \"fractalNoise\", baseFrequency: \"0.9\", numOctaves: \"3\", seed: \"4\" }));\n    grain.appendChild(sv(\"feColorMatrix\", { type: \"saturate\", values: \"0\" }));\n    var ct = sv(\"feComponentTransfer\", {});\n    ct.appendChild(sv(\"feFuncA\", { type: \"discrete\", tableValues: \"0 0 0 0 .5\" }));\n    grain.appendChild(ct);\n    defs.appendChild(grain);\n    svgEl.appendChild(defs);\n\n    var trayG = sv(\"g\", { \"data-layer\": \"tray\" });\n    function speckled(x, y, w, h, rx, base, op) {\n      trayG.appendChild(sv(\"rect\", { x: x, y: y, width: w, height: h, rx: rx, fill: base }));\n      trayG.appendChild(sv(\"rect\", { x: x, y: y, width: w, height: h, rx: rx, fill: \"#8A8275\",\n        \"fill-opacity\": op, filter: \"url(#\" + uid + \"grain)\" }));\n    }\n    if (SLIDE) {\n      \/* the table the pieces wait on, and the strip that leads into the gap *\/\n      var gx0 = cx + C.opening.from * S, gx1 = cx + C.opening.to * S;\n      var mat = { fill: \"#8A8275\", \"fill-opacity\": \".07\", stroke: \"rgba(80,74,64,.22)\",\n        \"stroke-width\": \".4\", \"stroke-dasharray\": \"1.6 1.4\" };\n      var m1 = { x: Z.left * S, y: Z.top * S, width: (Z.right - Z.left + 1) * S, height: (-1 - Z.top) * S, rx: \"2\" };\n      for (var mk in mat) m1[mk] = mat[mk];\n      trayG.appendChild(sv(\"rect\", m1));\n      trayG.appendChild(sv(\"rect\", { x: gx0, y: -S - 0.2, width: gx1 - gx0, height: S - wallT + 0.4,\n        fill: \"#8A8275\", \"fill-opacity\": \".07\" }));\n    }\n    speckled(cx - R, cy - wallT, cw * S + 2 * R, ch * S + R + wallT, \"3\", \"#EDEAE3\", \".5\");\n    speckled(cx, cy, cw * S, ch * S, \"1.6\", \"#F6F4EF\", \".28\");\n    trayG.appendChild(sv(\"rect\", { x: cx, y: cy, width: cw * S, height: ch * S, rx: \"1.6\", fill: \"none\",\n      stroke: \"rgba(80,74,64,.30)\", \"stroke-width\": \".5\" }));\n    if (SLIDE) {\n      \/* the gap in the wall: floor runs through it *\/\n      var g0 = cx + C.opening.from * S, g1 = cx + C.opening.to * S;\n      speckled(g0, cy - wallT - 0.01, g1 - g0, wallT + 1.2, \"0\", \"#F6F4EF\", \".28\");\n      trayG.appendChild(sv(\"path\", { d: \"M\" + g0 + \" \" + (cy - wallT) + \"V\" + cy + \"M\" + g1 + \" \" + (cy - wallT) + \"V\" + cy,\n        stroke: \"rgba(80,74,64,.30)\", \"stroke-width\": \".5\", fill: \"none\" }));\n    }\n    svgEl.appendChild(trayG);\n    var pieceG = sv(\"g\", { \"data-layer\": \"pieces\" });\n    svgEl.appendChild(pieceG);\n    boardEl.appendChild(svgEl);\n\n    function num(v) { return String(+v.toFixed(3)); }\n    \/* the outline is built from the whole-square shape and moved into place, so a\n       piece sitting between grid lines draws exactly like one on them *\/\n    function pieceNode(p, shape, at, opts) {\n      var k = p.i % COL.length;\n      var g = sv(\"g\", { \"data-p\": String(p.i), style: \"cursor:grab;touch-action:none\",\n        transform: \"translate(\" + num(at[1] * S) + \",\" + num(at[0] * S) + \")\" });\n      g.setAttribute(\"data-cells\", shape.map(function (c) { return num(c[0] + at[0]) + \",\" + num(c[1] + at[1]); }).join(\" \"));\n      if (opts.sel) g.setAttribute(\"data-sel\", \"1\");\n      var d = piecePath(shape);\n      if (opts.ghost) {\n        g.setAttribute(\"data-ghost\", \"1\");\n        g.setAttribute(\"data-bad\", opts.bad ? \"1\" : \"0\");\n        g.setAttribute(\"pointer-events\", \"none\");\n      } else {\n        g.appendChild(sv(\"path\", { d: d, fill: \"rgba(18,32,40,.22)\", transform: \"translate(0.5,0.9)\",\n          filter: \"url(#\" + uid + \"soft)\", \"pointer-events\": \"none\" }));\n      }\n      g.appendChild(sv(\"path\", { d: d, fill: \"url(#\" + uid + \"g\" + k + \")\",\n        \"fill-opacity\": opts.ghost ? \".45\" : \"1\",\n        stroke: opts.bad ? \"#C2544C\" : (opts.sel ? \"#0B7FA8\" : \"rgba(10,26,34,.42)\"),\n        \"stroke-width\": opts.sel || opts.bad ? \"1.1\" : \".45\", \"stroke-linejoin\": \"round\" }));\n      if (!opts.ghost) {\n        var cid = uid + \"c\" + (++clipSeq);\n        var clip = sv(\"clipPath\", { id: cid });\n        clip.appendChild(sv(\"path\", { d: d }));\n        g.appendChild(clip);\n        g.appendChild(sv(\"path\", { d: d, fill: \"none\", stroke: \"rgba(255,255,255,.34)\", \"stroke-width\": \".5\",\n          \"stroke-linejoin\": \"round\", transform: \"translate(0,0.45)\", \"clip-path\": \"url(#\" + cid + \")\",\n          \"pointer-events\": \"none\" }));\n      }\n      if (p.hole \u003e= 0 \u0026\u0026 shape[p.hole]) {\n        var hc = shape[p.hole];\n        g.appendChild(sv(\"circle\", { cx: (hc[1] + 0.5) * S, cy: (hc[0] + 0.5) * S, r: (p.holeR * S).toFixed(2),\n          fill: \"#E9E5DC\", \"fill-opacity\": opts.ghost ? \".5\" : \"1\", stroke: \"rgba(10,26,34,.45)\", \"stroke-width\": \".45\" }));\n      }\n      return g;\n    }\n\n    function drawPieces() {\n      clear(pieceG);\n      pieces.forEach(function (p) {\n        if (!p.at) return;\n        if (!SLIDE \u0026\u0026 !FREE \u0026\u0026 drag \u0026\u0026 drag.live \u0026\u0026 drag.p === p) return;   \/* lifted: the ghost shows it *\/\n        pieceG.appendChild(pieceNode(p, p.shape, units(p.at), { sel: sel === p }));\n      });\n      if (!SLIDE \u0026\u0026 drag \u0026\u0026 drag.live \u0026\u0026 !drag.off \u0026\u0026 (!FREE || drag.fromRack)) {\n        pieceG.appendChild(pieceNode(drag.p, drag.p.shape, units(drag.at), { ghost: true, bad: !drag.ok }));\n      }\n    }\n    var rackEm = 1.4;\n    if (rackEl) {\n      var tw = 0;\n      pieces.forEach(function (p) { tw += dims(p.base)[1]; });\n      rackEm = Math.max(0.95, Math.min(1.4, 18 \/ tw));\n    }\n    function drawRack() {\n      if (!rackEl) return;\n      clear(rackEl);\n      var any = false;\n      pieces.forEach(function (p) {\n        if (p.at) return;\n        any = true;\n        var dm = dims(p.shape);\n        var s = sv(\"svg\", { \"data-p\": String(p.i), \"data-s\": String(S), role: \"img\" });\n        s.setAttribute(\"viewBox\", \"-0.6 -0.6 \" + (dm[1] * S + 1.2) + \" \" + (dm[0] * S + 1.2));\n        s.style.width = (dm[1] * rackEm).toFixed(3) + \"em\";\n        s.style.height = (dm[0] * rackEm).toFixed(3) + \"em\";\n        if (sel === p) s.setAttribute(\"data-sel\", \"1\");\n        if (drag \u0026\u0026 drag.live \u0026\u0026 drag.p === p) s.style.opacity = \".35\";\n        s.appendChild(pieceNode(p, p.shape, [0, 0], { sel: sel === p }));\n        rackEl.appendChild(s);\n      });\n      if (!any) rackEl.appendChild(el(\"span\", \"gptr-none\", \" \"));\n    }\n    function turnTarget() {\n      if (sel) return (SLIDE \u0026\u0026 !isOut(sel)) ? null : sel;\n      for (var i = 0; i \u003c pieces.length; i++) {\n        if (SLIDE ? isOut(pieces[i]) : !pieces[i].at) return pieces[i];\n      }\n      return null;\n    }\n    function render() {\n      drawPieces();\n      drawRack();\n      var tt = turnTarget(), had = document.activeElement;\n      bRot.disabled = bFlip.disabled = !tt;\n      bTake.disabled = !(sel \u0026\u0026 engaged(sel));\n      bEmpty.disabled = !pieces.some(engaged);\n      \/* a button that just went disabled drops focus to the page, and the\n         arrow keys with it: keep them working on the board *\/\n      if (had \u0026\u0026 had.parentNode === ctl \u0026\u0026 had.disabled) focusRoot();\n      sayEl.textContent = msg || \" \";\n      bestEl.textContent = fmt(t.best, { n: best, m: pieces.length });\n      endEl.hidden = !endOn;\n    }\n\n    \/* ---------- input ---------- *\/\n    function focusRoot() { try { root.focus({ preventScroll: true }); } catch (e) { \/* old browsers *\/ } }\n    function boardCell(ev) {\n      var q = toView(svgEl, ev.clientX, ev.clientY);\n      var r = Math.floor(q.y \/ S), c = Math.floor(q.x \/ S);\n      if (!SLIDE \u0026\u0026 q.x \u003e= cx \u0026\u0026 q.x \u003c= cx + cw * S \u0026\u0026 q.y \u003e= cy \u0026\u0026 q.y \u003c= cy + ch * S) {\n        \/* inside the cavity but in its slack around the grid: snap to the edge squares *\/\n        r = Math.max(0, Math.min(H - 1, r));\n        c = Math.max(0, Math.min(W - 1, c));\n      }\n      return [r, c];\n    }\n    \/* free mode: the pointer in thousandths of a unit from the cavity corner *\/\n    function boardQ(ev) {\n      var q = toView(svgEl, ev.clientX, ev.clientY);\n      return [(q.y - cy) \/ S * Q, (q.x - cx) \/ S * Q];\n    }\n    function overBoard(ev) {\n      var b = svgEl.getBoundingClientRect();\n      return ev.clientX \u003e= b.left \u0026\u0026 ev.clientX \u003c= b.right \u0026\u0026 ev.clientY \u003e= b.top \u0026\u0026 ev.clientY \u003c= b.bottom;\n    }\n    function startDrag(p, ev, fromRack, grab, fallTap, downCell) {\n      if (ev.cancelable) ev.preventDefault();\n      try { (fromRack ? rackEl : svgEl).setPointerCapture(ev.pointerId); } catch (e) { \/* synthetic pointer *\/ }\n      drag = { p: p, fromRack: fromRack, grab: grab, sx: ev.clientX, sy: ev.clientY, pid: ev.pointerId,\n        live: false, off: true, ok: false, at: null, cells: null, fallTap: fallTap, downCell: downCell };\n      window.addEventListener(\"pointermove\", onMove);\n      window.addEventListener(\"pointerup\", onUp);\n      window.addEventListener(\"pointercancel\", onCancel);\n    }\n    function endListen() {\n      window.removeEventListener(\"pointermove\", onMove);\n      window.removeEventListener(\"pointerup\", onUp);\n      window.removeEventListener(\"pointercancel\", onCancel);\n    }\n    function onMove(ev) {\n      if (!drag || ev.pointerId !== drag.pid) return;\n      if (!drag.live) {\n        if (Math.abs(ev.clientX - drag.sx) + Math.abs(ev.clientY - drag.sy) \u003c 6) return;\n        drag.live = true;\n        if (drag.fromRack) drawRack();\n      }\n      if (FREE) {\n        var pq = boardQ(ev), want = [pq[0] - drag.goff[0], pq[1] - drag.goff[1]];\n        if (drag.fromRack) {\n          if (!overBoard(ev)) { drag.off = true; drawPieces(); return; }\n          drag.off = false;\n          drag.at = qSnap(drag.p, drag.p.shape, qClamp(drag.p.shape, want));\n          drag.ok = !qHit(qCells(drag.p.shape, drag.at), qOthers(drag.p));\n        } else {\n          \/* a piece in the tray moves with the hand, held in by the walls and\n             stopped by the pieces it meets *\/\n          drag.p.at = qSnap(drag.p, drag.p.shape, qMove(drag.p, want));\n          msg = \"\";\n        }\n        drawPieces();\n        return;\n      }\n      var cell = boardCell(ev);\n      if (SLIDE) {\n        if (toward(drag.p, cell, drag.grab)) msg = \"\";\n        drawPieces();\n        return;\n      }\n      if (!overBoard(ev)) { drag.off = true; drag.cells = null; drawPieces(); return; }\n      drag.off = false;\n      drag.at = [cell[0] - drag.grab[0], cell[1] - drag.grab[1]];\n      drag.cells = shift(drag.p.shape, drag.at);\n      drag.ok = legal(drag.p, drag.p.shape, drag.at);\n      drawPieces();\n    }\n    function onUp(ev) {\n      if (!drag || ev.pointerId !== drag.pid) return;\n      endListen();\n      var d = drag;\n      drag = null;\n      act();\n      if (!d.live) {                                  \/* a tap, not a drag *\/\n        if (d.fallTap) { boardTap(d.downCell, d.downQ); return; }\n        d.p.grab = d.grab;\n        sel = (sel === d.p) ? null : d.p;\n        msg = \"\";\n        settle();\n        return;\n      }\n      if (SLIDE) { sel = d.p; d.p.grab = d.grab; settle(); return; }\n      if (FREE \u0026\u0026 !d.fromRack) { sel = null; settle(); return; }\n      if (d.off) {\n        if (d.p.at) d.p.at = null;                    \/* dragged off the board: back with the pieces *\/\n        msg = \"\";\n      } else if (d.ok) {\n        d.p.at = d.at;\n        sel = null;\n        msg = \"\";\n      } else {\n        msg = t.nofit;\n      }\n      settle();\n    }\n    function onCancel(ev) {\n      if (!drag || ev.pointerId !== drag.pid) return;\n      endListen();\n      drag = null;\n      settle();\n    }\n    function boardTap(cell, q) {\n      if (!sel) { render(); return; }\n      if (FREE) {\n        \/* the touched square of the piece centres on the tap, kept inside the walls *\/\n        var gc = nearestCell(sel.shape, sel.grab);\n        var at = qSnap(sel, sel.shape, qClamp(sel.shape, [q[0] - (gc[0] + 0.5) * Q, q[1] - (gc[1] + 0.5) * Q]));\n        if (qLegal(sel, sel.shape, at)) { sel.at = at; sel = null; msg = \"\"; } else msg = t.nofit;\n        settle();\n        return;\n      }\n      if (SLIDE) {\n        msg = toward(sel, cell, sel.grab) ? \"\" : t.blocked;\n      } else if (placeNear(sel, cell)) {\n        sel = null;\n        msg = \"\";\n      } else {\n        msg = t.nofit;\n      }\n      settle();\n    }\n\n    svgEl.addEventListener(\"pointerdown\", function (ev) {\n      if (ev.button \u003e 0) return;\n      act();\n      focusRoot();\n      var hit = ev.target.closest ? ev.target.closest(\"[data-p]\") : null;\n      var cell = boardCell(ev);\n      if (hit \u0026\u0026 !hit.getAttribute(\"data-ghost\")) {\n        var p = pieces[+hit.getAttribute(\"data-p\")];\n        var pq = FREE ? boardQ(ev) : null, goff = null, grab;\n        if (FREE) {\n          goff = [pq[0] - p.at[0], pq[1] - p.at[1]];\n          grab = nearestCell(p.shape, [Math.floor(goff[0] \/ Q), Math.floor(goff[1] \/ Q)]);\n        } else {\n          grab = nearestCell(p.shape, [cell[0] - p.at[0], cell[1] - p.at[1]]);\n        }\n        \/* a piece in hand from the rack wants to be placed: a tap on a piece in\n           the tray is an attempt to put it there *\/\n        var fall = !SLIDE \u0026\u0026 !!sel \u0026\u0026 !sel.at \u0026\u0026 sel !== p;\n        startDrag(p, ev, false, grab, fall, cell);\n        drag.goff = goff;\n        drag.downQ = pq;\n        return;\n      }\n      tap = { x: ev.clientX, y: ev.clientY, pid: ev.pointerId, cell: cell, q: FREE ? boardQ(ev) : null };\n    });\n    svgEl.addEventListener(\"pointerup\", function (ev) {\n      if (!tap || ev.pointerId !== tap.pid) return;\n      var t0 = tap;\n      tap = null;\n      if (Math.abs(ev.clientX - t0.x) + Math.abs(ev.clientY - t0.y) \u003e 10) return;\n      act();\n      boardTap(t0.cell, t0.q);\n    });\n    svgEl.addEventListener(\"pointercancel\", function () { tap = null; });\n    \/* a finger that lands on a piece drags it; anywhere else the page still scrolls *\/\n    svgEl.addEventListener(\"touchstart\", function (ev) {\n      var h = ev.target.closest ? ev.target.closest(\"[data-p]\") : null;\n      if (h \u0026\u0026 ev.cancelable) ev.preventDefault();\n    }, { passive: false });\n\n    if (rackEl) {\n      rackEl.addEventListener(\"pointerdown\", function (ev) {\n        if (ev.button \u003e 0) return;\n        var s = ev.target.closest ? ev.target.closest(\"svg[data-p]\") : null;\n        if (!s) return;\n        act();\n        focusRoot();\n        var p = pieces[+s.getAttribute(\"data-p\")];\n        var q = toView(s, ev.clientX, ev.clientY);\n        startDrag(p, ev, true, nearestCell(p.shape, [Math.floor(q.y \/ S), Math.floor(q.x \/ S)]), false, null);\n        drag.goff = [q.y \/ S * Q, q.x \/ S * Q];      \/* the exact point held, for free mode *\/\n      });\n      rackEl.addEventListener(\"touchstart\", function (ev) {\n        var s = ev.target.closest ? ev.target.closest(\"svg[data-p]\") : null;\n        if (s \u0026\u0026 ev.cancelable) ev.preventDefault();\n      }, { passive: false });\n    }\n\n    root.addEventListener(\"keydown\", function (e) {\n      var d = { ArrowUp: [-1, 0], ArrowDown: [1, 0], ArrowLeft: [0, -1], ArrowRight: [0, 1] }[e.key];\n      if (!d || !sel || !sel.at) return;\n      e.preventDefault();\n      act();\n      if (SLIDE) {\n        msg = step(sel, d[0], d[1]) ? \"\" : t.blocked;\n      } else if (FREE) {\n        \/* one unit, or less if a wall or a piece is closer *\/\n        var ax = d[0] ? 0 : 1, na = qSweep(sel, sel.at, ax, sel.at[ax] + (d[0] + d[1]) * Q);\n        if (na[ax] === sel.at[ax]) msg = t.nofit; else { sel.at = na; msg = \"\"; }\n      } else {\n        var at = [sel.at[0] + d[0], sel.at[1] + d[1]];\n        if (legal(sel, sel.shape, at)) { sel.at = at; msg = \"\"; } else msg = t.nofit;\n      }\n      settle();\n    });\n\n    function turnBtn(fn) {\n      return function () {\n        act();\n        var p = turnTarget();\n        if (!p) { render(); return; }\n        if (turn(p, fn)) { sel = p; msg = \"\"; } else msg = t.noturn;\n        settle();\n      };\n    }\n    bRot.addEventListener(\"click\", turnBtn(rot));\n    bFlip.addEventListener(\"click\", turnBtn(flp));\n    bTake.addEventListener(\"click\", function () {\n      act();\n      if (!sel || !engaged(sel)) { render(); return; }\n      if (SLIDE) sendHome(sel); else sel.at = null;\n      msg = \"\";\n      settle();\n    });\n    bEmpty.addEventListener(\"click\", function () {\n      act();\n      pieces.forEach(function (p) {\n        if (!engaged(p)) return;\n        if (SLIDE) sendHome(p); else p.at = null;\n      });\n      sel = null;\n      msg = \"\";\n      settle();\n    });\n    bReset.addEventListener(\"click\", function () {\n      act();\n      pieces.forEach(function (p) { p.shape = copy(p.base); p.at = home(p); p.grab = [p.base[0][0], p.base[0][1]]; });\n      sel = null;\n      msg = \"\";\n      settle();\n    });\n\n    settle();\n  }\n\n  window.GPTR = { mount: mount, v: 1 };\n})();\n(function(){var C={\"v\":1,\"mode\":\"free\",\"grid\":[5,4],\"rim\":0.3,\"pieces\":[{\"cells\":[[0,1],[1,1],[2,0],[2,1],[2,2]]},{\"cells\":[[0,1],[1,0],[1,1],[1,2],[2,0]]},{\"cells\":[[0,1],[0,2],[1,1],[2,0],[2,1]]},{\"cells\":[[0,2],[1,0],[1,1],[1,2],[1,3]]}],\"cavity\":[5.8138,4.9193]};var s=document.currentScript,r=s\u0026\u0026s.previousElementSibling;if(!r||(\" \"+r.className+\" \").indexOf(\" gptr \")\u003c0)r=document.querySelector(\".gptr:not([data-gptr-on])\");if(r\u0026\u0026window.GPTR)window.GPTR.mount(r,C);})();\n\u003c\/script\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":46738770952359,"sku":"GP-FOURFIT","price":26.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/four_fit_marble.png?v=1782069709"},{"product_id":"shrinking-soma","title":"Shrinking Soma | Anti-Slide Puzzle","description":"\u003cp\u003e\u003cstrong\u003eShrinking Soma is a 7-piece expert-level anti-slide packing puzzle designed by \u003ca href=\"\/collections\/dr-volker-latussek\"\u003eDr. Volker Latussek\u003c\/a\u003e. Using standard Soma Cube pieces, you must fill a 4x4x4 space so the opening is sealed and the structure won't shift when shaken. Difficulty: Expert. Solve time: 4+ hours. Trains: Creativity.\u003c\/strong\u003e\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eBest for:\u003c\/strong\u003e experienced puzzle solvers who have already conquered standard Soma Cubes and want a structural challenge that adds a physics constraint to a familiar format.\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eSpecs at a Glance:\u003c\/strong\u003e 7 pieces + 1 box | Expert | 4+ hrs solve time | Trains: Creativity.\u003c\/p\u003e\u003ch2\u003eThe Concept\u003c\/h2\u003e\u003cp\u003eShrinking Soma is a brilliant idea by Dr. Volker Latussek. Using standard Soma Cube pieces, create a structure that will fill a 4x4x4 space.\u003c\/p\u003e\u003cp\u003eTo solve the puzzle, 2 conditions must be met: first, the opening needs to be completely filled. Second, if you shake the puzzle to the sides, the structure must not fall apart.\u003c\/p\u003e\u003cp\u003eThis limitation creates a peculiar experience for a seemingly simple problem. Harder than it looks!\u003c\/p\u003e\u003cp\u003eSize: 65mm x 65mm x 65mm\u003c\/p\u003e\u003ch2\u003eWhat Makes It Different\u003c\/h2\u003e\u003cp\u003eMost packing puzzles ask one question: does it fit? Shrinking Soma asks two at once. You need complete coverage of the opening AND a structure stable enough to survive shaking. That dual-condition requirement makes brute-force trial and error close to useless. You have to think about weight distribution, piece orientation, and structural integrity simultaneously - not just whether the geometry works out on paper. That changes everything about how you approach the solve.\u003c\/p\u003e\u003ch2\u003eFrequently Asked Questions\u003c\/h2\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eHow hard is Shrinking Soma?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eExpert level - rated 4+ hours. The dual-condition requirement (seal the opening AND prevent sliding) makes it significantly harder than typical 7-piece packing puzzles.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWhat is the Soma Cube format?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eSoma Cube pieces are irregular 3D shapes made from unit cubes. Shrinking Soma uses these familiar pieces in an unfamiliar challenge: packing them so the result is structurally stable, not just geometrically complete.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eIs Shrinking Soma a good gift for a puzzle expert?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eYes - it's one of the most conceptually inventive puzzles in the Greg Puzzles catalog, ideal for solvers who want something beyond a standard packing challenge.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":47128862392487,"sku":"GP-SHRISOMA","price":31.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/shrinking_soma_marble.png?v=1782034736"},{"product_id":"chain-store","title":"Chain Store Puzzle | Pack Chain in Box","description":"\u003ch2\u003ePack a Chain Flush in the Box\u003c\/h2\u003e\u003cp\u003eChain Store is a packing puzzle designed by \u003ca href=\"\/collections\/goh-pit-khiam\"\u003eGoh Pit Khiam\u003c\/a\u003e. Your goal is simple to state: take a chain of five identical linked pieces and pack it flush into the box. No hidden mechanisms, no trick releases, no shortcuts.\u003c\/p\u003e\u003cp\u003eWell - it sounds straightforward. But the chain changes everything.\u003c\/p\u003e\u003cp\u003eBecause the pieces are linked together and cannot be separated, you can't just place them one at a time. Move one link and you move the whole chain. Try to fold it one way and the geometry fights you. Every adjustment you make to fit one section creates a new problem somewhere else. The chain's limits are real - and figuring out exactly how to work within them is where the puzzle lives.\u003c\/p\u003e\u003cp\u003ePure spatial reasoning. No luck involved.\u003c\/p\u003e\u003ch2\u003eQuick Summary\u003c\/h2\u003e\u003cul\u003e\n\u003cli\u003e\n\u003cstrong\u003eType:\u003c\/strong\u003e Packing puzzle\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eDesigner:\u003c\/strong\u003e Goh Pit Khiam\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003ePieces:\u003c\/strong\u003e One chain of five identical linked pieces plus box\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eGoal:\u003c\/strong\u003e Pack the chain flush inside the box\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eDifficulty:\u003c\/strong\u003e Harder than it looks\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eBox size:\u003c\/strong\u003e 55mm x 65mm x 75mm\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eDisassembly:\u003c\/strong\u003e Chain cannot be taken apart\u003c\/li\u003e\n\u003c\/ul\u003e\u003ch2\u003eBest For\u003c\/h2\u003e\u003cul\u003e\n\u003cli\u003eSolvers who love finding the missing link in a puzzle\u003c\/li\u003e\n\u003cli\u003eChain-of-logic thinkers who prefer geometry over gimmicks\u003c\/li\u003e\n\u003cli\u003eThe person who says \"I can figure this out\" and then discovers they cannot\u003c\/li\u003e\n\u003cli\u003ePuzzlers who like their brain teasers linked, locked, and layered\u003c\/li\u003e\n\u003cli\u003eAnyone drawn to constrained packing problems where the constraint is built into the object itself\u003c\/li\u003e\n\u003cli\u003eA clean desk gift for the engineer or designer who thinks spatially\u003c\/li\u003e\n\u003c\/ul\u003e\u003ch2\u003eHow It Works\u003c\/h2\u003e\u003cp\u003eThe five pieces are identical in shape and permanently linked in sequence - like a physical chain. The box is sized to fit them exactly when packed correctly. There is one solution. The challenge is that you cannot manipulate the pieces independently. The chain bends, but only so much. It folds, but only in certain ways. You have to find the configuration that respects every link at once.\u003c\/p\u003e\u003cp\u003eThere are no tricks. The puzzle is entirely about understanding the geometry of the chain and the volume of the box. When it clicks, it clicks cleanly - and you will know immediately.\u003c\/p\u003e\u003ch2\u003eFrequently Asked Questions\u003c\/h2\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eCan the chain be taken apart?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eNo. The five links are permanently connected. The puzzle is solved with the chain intact.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eIs there more than one solution?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eNo. There is one correct configuration that packs the chain flush into the box.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eHow difficult is it?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eMore difficult than the premise suggests. The constraint of the linked pieces makes spatial trial-and-error much harder than a standard loose-piece packing puzzle. Expect a real challenge.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWho designed Chain Store?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eChain Store was designed by Goh Pit Khiam, a puzzle designer known for elegant packing and interlocking designs.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWhat is the box size?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eThe box measures 55mm x 65mm x 75mm.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":47305048522919,"sku":"GP-CHAISTOR","price":31.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/chain_store_marble.png?v=1782034054"},{"product_id":"petit-ring-puzzle","title":"Petit Ring | Hide the Holes","description":"\u003cp\u003ePetit Ring is a seemingly easy packing puzzle from \u003ca href=\"\/collections\/osanori-yamamoto\"\u003eOsanori Yamamoto\u003c\/a\u003e. I repeat. Seemingly Easy.\u003c\/p\u003e\n\u003cp\u003eUsing only 3 pieces, this puzzle may be harder than you think. It is solved when all the pieces are inside the cage with all entrances covered.\u003c\/p\u003e\n\u003cp\u003eSize: Approx. 40mm X 55mm X 55mm\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":47964830007463,"sku":"GP-PETIRING","price":25.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/petit_ring_marble.png?v=1782068295"},{"product_id":"shutout-puzzle","title":"Shutout Puzzle | Hide the Holes","description":"\u003cp\u003eShutout is another challenging packing puzzle from \u003ca href=\"\/collections\/osanori-yamamoto\"\u003eOsanori Yamamoto\u003c\/a\u003e.\u003c\/p\u003e\n\u003cp\u003eUsing 6 identical T-Shaped Pieces, you must build an apparent cube inside the frame. The puzzle is solved when all the pieces are inside the cage with all entrances covered.  \u003c\/p\u003e\n\u003cp\u003eCreating a packing puzzle with identical pieces is a significant design challenge. Making it a great puzzle is even harder. This puzzle manages to do both, making you explore it until the sequence finally reveals itself to the strongest.\u003c\/p\u003e\n\u003cp\u003eSize: 55mm X 55mm X 55mm\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":47964870934695,"sku":"GP-SHUT","price":29.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/shutout_marble.png?v=1782067998"},{"product_id":"waltz","title":"Waltz | Pack Only 2 Pieces","description":"\u003cp\u003e\u003cstrong\u003eQuick answer:\u003c\/strong\u003e Waltz is a 2-piece packing puzzle by \u003ca href=\"\/collections\/osanori-yamamoto\"\u003eOsanori Yamamoto\u003c\/a\u003e, one of Japan's foremost mechanical puzzle designers. Medium difficulty, 30-60 minute solve time. Just two pieces and a compact 40x40x55mm box - and yet finding the sequence that packs them in cleanly is the exact kind of aha moment Osanori's minimalist designs are famous for.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eBest for:\u003c\/strong\u003e solvers who already enjoy Osanori's minimalist packing style, first-time packing puzzle buyers who want to feel what \"minimal pieces, maximum challenge\" actually means, and gift buyers hunting for a small object that punches above its weight.\u003c\/p\u003e\n\u003cp\u003eWaltz is an unusual packing puzzle from Osanori Yamamoto. \u003c\/p\u003e\n\u003cp\u003eIt uses only 2 pieces, but fitting them inside the box is nothing like you may imagine.\u003c\/p\u003e\n\u003cp\u003eLet the solution unravel itself to you as you hold the pieces in your hands!\u003c\/p\u003e\n\u003cp\u003eSize: Approx. 40mm X 40mm X 55mm\u003c\/p\u003e\n\u003ch2\u003eFrequently Asked Questions\u003c\/h2\u003e\n\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWhat is the Waltz puzzle?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eWaltz is a 2-piece packing puzzle designed by Osanori Yamamoto. The goal is to fit both pieces inside a compact box so they land in a specific arrangement. It's rated Medium difficulty with a 30-60 minute typical solve time.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWhy is a 2-piece puzzle Medium difficulty?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eWith only 2 pieces, most people assume Waltz should be trivial - and that's exactly the trap. The small number of pieces means the entire challenge is in finding the right rotation and insertion sequence. Osanori is a master of hiding real difficulty inside minimal geometry, and Waltz is a textbook example.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eHow does Waltz compare to other Osanori packing puzzles?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eWaltz sits between his easier entry-point puzzles like Galette and harder Expert-level puzzles like A6L. If you've solved Galette and want to step up, Waltz is a natural next puzzle. If you've done a few Osanori puzzles already, expect the familiar \"how can 2 pieces be this tricky\" experience.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eIs Waltz a good gift for a puzzle lover?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eYes, especially for someone who already enjoys mechanical puzzles. Its small footprint and clean 40x40x55mm form makes it desk-friendly, and the Medium difficulty means the recipient will actually engage with it rather than solving it in one sitting or getting frustrated and shelving it.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":47964896985255,"sku":"GP-WALT","price":26.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/waltz_marble.png?v=1782066417"},{"product_id":"identical-twins","title":"Identical Twins | Assemble 2 Pieces in a Cube","description":"\u003cp\u003eGoal: assemble the two identical pieces inside the cube frame.\u003c\/p\u003e\n\u003cp\u003eSolution level 6.2. Rotations required.\u003c\/p\u003e\n\u003cp\u003eShips disassembled.\u003c\/p\u003e\n\u003cp\u003eTop 3 Osanori puzzles by the Mechanical Puzzle Discord. Won puzzlers' award in IPP37.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eWhat's special about Identical Twins?\u003c\/strong\u003e\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003eTwo identical pieces, one deceptive frame\u003c\/li\u003e\n\u003cli\u003eDevelops 3D spatial imagination\u003c\/li\u003e\n\u003cli\u003eSatisfying 'aha' moment when it clicks\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003eDesigned by \u003ca href=\"\/collections\/osanori-yamamoto\"\u003eOsanori Yamamoto\u003c\/a\u003e\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":50973123805351,"sku":"GP-IDENTWIN","price":22.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/identical_twins_marble_v2.png?v=1784194440"},{"product_id":"lucida","title":"Lucida | Assemble 2 Pieces in a Frame","description":"\u003cp\u003eGoal: assemble the two pieces in the frame to form a cube shape.\u003c\/p\u003e\n\u003cp\u003eSolution level 10.3. Rotations required.\u003c\/p\u003e\n\u003cp\u003eShips disassembled.\u003c\/p\u003e\n\u003cp\u003eVoted #1 Osanori by the Mechanical Puzzle Discord. A favorite of many puzzlers.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eWhat's special about Lucida?\u003c\/strong\u003e\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003eElegant design with a deceptive solution\u003c\/li\u003e\n\u003cli\u003eDevelops 3D spatial imagination\u003c\/li\u003e\n\u003cli\u003eSatisfying, repeatable challenge\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003eDesigned by \u003ca href=\"\/collections\/osanori-yamamoto\"\u003eOsanori Yamamoto\u003c\/a\u003e\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":50973124133031,"sku":"GP-LUCI","price":26.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/lucida_marble.png?v=1784193711"},{"product_id":"burr-bot-sequential-discovery-puzzle","title":"Burr Bot | Sequential Discovery Puzzle","description":"\u003cp\u003eBurr Bot has swallowed something he should not have. Your job is to get it out of him.\u003c\/p\u003e\n\u003cp\u003eGoal: work through the robot's interlocking shell, find the tools hidden along the way, and free what is stuck inside.\u003c\/p\u003e\n\u003cp\u003eNo force or external tools are allowed or needed to solve it.\u003c\/p\u003e\n\u003cp\u003eThis is Andrew Crowell's first hybrid of a burr and a sequential discovery puzzle, and it took a Jury Honorable Mention at the 2021 Nob Yoshigahara Puzzle Design Competition. The burr sticks you can see are only the opening move. After that it becomes a chain of small discoveries, each one handing you what you need for the next.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003ePRODUCED IN LIMITED BATCHES.\u003c\/strong\u003e\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eWhat's special about Burr Bot?\u003c\/strong\u003e\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003eA burr and a sequential discovery puzzle in the same cube\u003c\/li\u003e\n\u003cli\u003eEvery tool you need is hidden inside the puzzle itself\u003c\/li\u003e\n\u003cli\u003eJury Honorable Mention, 2021 Nob Yoshigahara Puzzle Design Competition\u003c\/li\u003e\n\u003cli\u003eResets without reversing every step, so it is ready for the next person\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003eBest for: collectors who know Andrew Crowell from his TIC series and want his discovery work, and experienced solvers who like a puzzle that keeps opening up instead of ending at one answer.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eLimited to 2 per customer.\u003c\/strong\u003e \u003c\/p\u003e\n\u003cp\u003eDesigned by \u003ca href=\"\/collections\/andrew-crowell\"\u003eAndrew Crowell\u003c\/a\u003e\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":51517373481127,"sku":"GP-BURRBOT","price":89.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/burr_bot___sequential_discovery_puzzle_marble.png?v=1792040341"},{"product_id":"one-way-or-another-move-the-disc-corner-to-corner","title":"One Way or Another | Move the Disc Corner to Corner","description":"\u003cdiv class=\"gpow\"\u003e\n\u003cstyle\u003e\n.gpow{--fg:rgb(var(--color-foreground,18,18,18));\n --line:rgba(var(--color-foreground,18,18,18),.14);\n --muted:rgba(var(--color-foreground,18,18,18),.64);--accent:#02A9F7;\n font-family:var(--font-body-family,inherit);margin:2.4rem 0;max-width:46rem}\n.gpow *{box-sizing:border-box}\n.gpow h3{font-family:var(--font-heading-family,inherit);font-size:1.9rem;\n line-height:1.3;margin:0 0 .5rem;color:var(--fg)}\n.gpow p{font-size:1.45rem;line-height:1.65;margin:0 0 1.1rem;color:var(--muted);max-width:60ch}\n.gpow #owPhase{font-size:1.15rem;letter-spacing:.04em;color:var(--muted);margin-bottom:.4rem}\n.gpow #owBoard{width:100%;max-width:34rem}\n.gpow #owBoard svg{display:block;width:100%;height:auto;\n \/* The player sets touch-action:none inline because a dedicated page wants\n    full control. On a product page a finger landing here must still scroll,\n    so this overrides it: horizontal drags work, vertical ones scroll past,\n    and the whole puzzle is playable by tapping either way. *\/\n touch-action:pan-y !important}\n\/* iOS: no grey flash on every tap, no text selection while dragging a piece,\n   and no callout menu when a finger rests on the board *\/\n.gpow #owBoard,.gpow #owTray,.gpow .ctl button{-webkit-tap-highlight-color:transparent;\n -webkit-touch-callout:none;-webkit-user-select:none;user-select:none}\n.gpow .row{display:flex;gap:1.2rem;align-items:flex-start;flex-wrap:wrap;margin-top:.9rem}\n.gpow #owTray{display:flex;gap:.7rem;align-items:center;flex-wrap:wrap;padding:.7rem .8rem;\n border:1px solid var(--line);border-radius:7px;min-height:3.6rem;min-width:12rem}\n.gpow #owTray .empty{font-size:1.2rem;color:var(--muted)}\n.gpow .ctl{display:flex;gap:.5rem;flex-wrap:wrap}\n.gpow .ctl button{appearance:none;border:1px solid var(--line);background:transparent;\n color:var(--muted);font-family:inherit;font-size:1.2rem;padding:.55rem 1.1rem;\n border-radius:5px;cursor:pointer}\n.gpow .ctl button:hover{border-color:var(--accent);color:var(--fg)}\n.gpow .ctl button:disabled{opacity:.38;cursor:default}\n.gpow .ctl button:disabled:hover{border-color:var(--line);color:var(--muted)}\n.gpow #owSay{font-size:1.3rem;color:var(--muted);min-height:2rem;margin-top:.7rem}\n\u003c\/style\u003e\n\u003ch3\u003eTry it before you buy it\u003c\/h3\u003e\n\u003cp\u003ePack the four pieces in so the disc keeps its corner, then move the disc to the far\ncorner. Pieces push each other, so sliding one can shove the next along. Plenty of packings\nfit the tray. Far fewer leave the disc anywhere to go, and that is the whole puzzle.\u003c\/p\u003e\n\u003cp\u003eTap a piece to pick it up, then tap a square to nudge it that way. Dragging works too,\nand so do the arrow keys.\u003c\/p\u003e\n\u003cdiv id=\"owPhase\"\u003e\u003c\/div\u003e\n\u003cdiv id=\"owBoard\"\u003e\u003c\/div\u003e\n\u003cdiv class=\"row\"\u003e\n  \u003cdiv id=\"owTray\"\u003e\u003c\/div\u003e\n  \u003cdiv class=\"ctl\"\u003e\n    \u003cbutton type=\"button\" id=\"owRotate\"\u003eRotate\u003c\/button\u003e\n    \u003cbutton type=\"button\" id=\"owFlip\"\u003eFlip\u003c\/button\u003e\n    \u003cbutton type=\"button\" id=\"owTake\"\u003eTake out\u003c\/button\u003e\n    \u003cbutton type=\"button\" id=\"owUnpack\"\u003eEmpty the tray\u003c\/button\u003e\n    \u003cbutton type=\"button\" id=\"owReset\"\u003eStart over\u003c\/button\u003e\n  \u003c\/div\u003e\n\u003c\/div\u003e\n\u003cdiv id=\"owSay\"\u003e\u003c\/div\u003e\n\u003c\/div\u003e\n\u003cscript\u003e\n(function(){\nvar D={\"w\":5,\"h\":4,\"order\":[\"tromino\",\"square\",\"tee\",\"ell\"],\"shapes\":{\"tromino\":[[0,0],[0,1],[1,0]],\"square\":[[0,0],[0,1],[1,0],[1,1]],\"tee\":[[0,0],[0,1],[0,2],[1,1]],\"ell\":[[0,0],[1,0],[2,0],[2,1]]},\"start\":[0,0],\"goal\":[3,4]};\n\/* ---------- One Way or Another: pack, then slide ---------- *\/\n(function(){\nvar W=D.w, H=D.h, ORDER=D.order, SHAPES=D.shapes;\nvar START=D.start, GOAL=D.goal, S=10;\nvar slideFrom=null;         \/* where the disc stood when the last piece went in *\/\nvar $=function(i){return document.getElementById(i);};\nvar NS=\"http:\/\/www.w3.org\/2000\/svg\";\nvar phase=\"pack\", placed={}, shapeOf={}, tray={}, disc=null, msg=\"\";\nvar drag=null, svgEl=null, picked=null;\nvar COL={tromino:\"#2E93C4\",square:\"#17678F\",tee:\"#4FAAD0\",ell:\"#0F4D69\"};\nvar LIGHT={tromino:\"#58B3DD\",square:\"#2E88B2\",tee:\"#78C6E4\",ell:\"#2A6E8E\"};\n\nfunction norm(cs){\n  var r0=Math.min.apply(null,cs.map(function(c){return c[0];}));\n  var c0=Math.min.apply(null,cs.map(function(c){return c[1];}));\n  return cs.map(function(c){return [c[0]-r0,c[1]-c0];});\n}\nfunction rotate(cs){ return norm(cs.map(function(c){ return [c[1],-c[0]]; })); }\nfunction flipped(cs){ return norm(cs.map(function(c){ return [c[0],-c[1]]; })); }\nfunction occupied(skip){\n  var o={};\n  for(var k in placed){\n    if(k===skip) continue;\n    placed[k].forEach(function(c){ o[c[0]+\",\"+c[1]]=k; });\n  }\n  if(disc \u0026\u0026 skip!==\"disc\") o[disc[0]+\",\"+disc[1]]=\"disc\";\n  return o;\n}\nfunction inside(cs){\n  return cs.every(function(c){ return c[0]\u003e=0\u0026\u0026c[0]\u003cH\u0026\u0026c[1]\u003e=0\u0026\u0026c[1]\u003cW; });\n}\nfunction fits(name,cells){\n  if(!inside(cells)) return false;\n  var occ=occupied(name);\n  for(var i=0;i\u003ccells.length;i++) if(occ[cells[i][0]+\",\"+cells[i][1]]) return false;\n  return true;\n}\nfunction reset(){\n  phase=\"pack\"; placed={}; shapeOf={}; disc=START.slice(); drag=null; picked=null;\n  slideFrom=null;\n  tray={}; ORDER.forEach(function(n){ tray[n]=SHAPES[n].map(function(c){return c.slice();}); });\n  msg=\"Click a piece then click the tray, or just drag it in. The disc moves too - drag it, or click it and click where it should go.\";\n  draw();\n}\nfunction packed(){ return ORDER.every(function(n){ return !!placed[n]; }); }\nfunction atGoal(p){ return p[0]===GOAL[0] \u0026\u0026 p[1]===GOAL[1]; }\nfunction setDisc(p){\n  disc=[p[0],p[1]];\n  \/* leaving the target square gives the disc a run to make, so a player who\n     packed with it already home only has to move it off and bring it back *\/\n  if(phase===\"slide\" \u0026\u0026 !atGoal(disc)) slideFrom=disc.slice();\n}\n\/* The disc roams while you pack, so parking it on the far square and then\n   packing around it is not a solved puzzle - it still has to make the trip. *\/\nfunction won(){ return phase===\"slide\" \u0026\u0026 atGoal(disc) \u0026\u0026 !atGoal(slideFrom||START); }\n\n\/* ---------- solid outlines ---------- *\/\nfunction outline(cells){\n  \/* Draw the piece as one shape. Rendering cell by cell left seams across the\n     middle of every piece, which made them hard to read as single objects. *\/\n  var has={}; cells.forEach(function(c){ has[c[0]+\",\"+c[1]]=1; });\n  var seg=[];\n  cells.forEach(function(c){\n    var r=c[0], k=c[1];\n    if(!has[(r-1)+\",\"+k]) seg.push([[k,r],[k+1,r]]);\n    if(!has[(r+1)+\",\"+k]) seg.push([[k,r+1],[k+1,r+1]]);\n    if(!has[r+\",\"+(k-1)]) seg.push([[k,r],[k,r+1]]);\n    if(!has[r+\",\"+(k+1)]) seg.push([[k+1,r],[k+1,r+1]]);\n  });\n  return seg;\n}\nfunction loops(cells){\n  \/* Chain the boundary segments into closed rings. A single path per piece is\n     what lets the corners round and the shadow sit under the whole shape,\n     instead of each cell being its own little square. *\/\n  var segs=outline(cells).map(function(e){ return [e[0].slice(),e[1].slice()]; });\n  var out=[];\n  while(segs.length){\n    var ring=[segs[0][0],segs[0][1]]; segs.splice(0,1);\n    var guard=0;\n    while(guard++\u003c400){\n      var head=ring[ring.length-1], found=-1;\n      for(var i=0;i\u003csegs.length;i++){\n        if(segs[i][0][0]===head[0]\u0026\u0026segs[i][0][1]===head[1]){ ring.push(segs[i][1]); found=i; break; }\n        if(segs[i][1][0]===head[0]\u0026\u0026segs[i][1][1]===head[1]){ ring.push(segs[i][0]); found=i; break; }\n      }\n      if(found\u003c0) break;\n      segs.splice(found,1);\n      var a=ring[0], b=ring[ring.length-1];\n      if(a[0]===b[0]\u0026\u0026a[1]===b[1]){ ring.pop(); break; }\n    }\n    if(ring.length\u003e2) out.push(ring);\n  }\n  return out;\n}\nfunction roundedPath(ring,r){\n  \/* walk the ring, cutting each corner with a quadratic *\/\n  var d=\"\", n=ring.length;\n  for(var i=0;i\u003cn;i++){\n    var p0=ring[(i-1+n)%n], p1=ring[i], p2=ring[(i+1)%n];\n    var v1=[p1[0]-p0[0],p1[1]-p0[1]], v2=[p2[0]-p1[0],p2[1]-p1[1]];\n    var l1=Math.hypot(v1[0],v1[1])||1, l2=Math.hypot(v2[0],v2[1])||1;\n    var rr=Math.min(r,l1\/2,l2\/2);\n    var a=[p1[0]-v1[0]\/l1*rr, p1[1]-v1[1]\/l1*rr];\n    var b=[p1[0]+v2[0]\/l2*rr, p1[1]+v2[1]\/l2*rr];\n    d += (i===0 ? \"M\"+a[0].toFixed(2)+\" \"+a[1].toFixed(2)\n                : \"L\"+a[0].toFixed(2)+\" \"+a[1].toFixed(2));\n    d += \"Q\"+p1[0].toFixed(2)+\" \"+p1[1].toFixed(2)+\" \"+b[0].toFixed(2)+\" \"+b[1].toFixed(2);\n  }\n  return d+\"Z\";\n}\nfunction svg(t,a){ var e=document.createElementNS(NS,t);\n  for(var k in a) e.setAttribute(k,a[k]); return e; }\nfunction pieceNode(name,cells,opts){\n  var g=svg(\"g\",{style:\"cursor:grab;touch-action:none\"});\n  g.setAttribute(\"data-p\",name);\n  var rings=loops(cells).map(function(ring){\n    return roundedPath(ring.map(function(p){ return [p[0]*S,p[1]*S]; }), S*0.17);\n  });\n  var d=rings.join(\" \");\n  if(!opts.ghost){\n    g.appendChild(svg(\"path\",{d:d,fill:\"rgba(18,32,40,.22)\",transform:\"translate(0.5,0.9)\",\n      filter:\"url(#owSoft)\"}));\n  }\n  g.appendChild(svg(\"path\",{d:d,fill:\"url(#ow_\"+name+\")\",\n    \"fill-opacity\":opts.ghost?\".45\":\"1\",\n    stroke:opts.bad?\"#C2544C\":(opts.sel?\"#0B7FA8\":\"rgba(10,26,34,.42)\"),\n    \"stroke-width\":opts.sel?\"1.1\":\".45\",\"stroke-linejoin\":\"round\"}));\n  if(!opts.ghost){\n    g.appendChild(svg(\"path\",{d:d,fill:\"none\",stroke:\"rgba(255,255,255,.34)\",\n      \"stroke-width\":\".5\",\"stroke-linejoin\":\"round\",transform:\"translate(0,0.45)\",\n      \"clip-path\":\"url(#owClip_\"+name+\")\"}));\n  }\n  return g;\n}\n\/* ---------- drawing ---------- *\/\nfunction syncButtons(){\n  var t=$(\"owTake\");\n  if(t) t.disabled = !(phase===\"slide\" \u0026\u0026 picked \u0026\u0026 placed[picked]);\n}\nfunction draw(){\n  var s=svg(\"svg\",{viewBox:(-PAD)+\" \"+(-PAD)+\" \"+(W*S+PAD*2)+\" \"+(H*S+PAD*2),\n    width:\"100%\",height:\"100%\",style:\"touch-action:none\"});\n  var defs=svg(\"defs\",{});\n  var grads=\"\";\n  for(var nm in COL){\n    grads+='\u003clinearGradient id=\"ow_'+nm+'\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\"\u003e'\n      +'\u003cstop offset=\"0\" stop-color=\"'+LIGHT[nm]+'\"\/\u003e'\n      +'\u003cstop offset=\"1\" stop-color=\"'+COL[nm]+'\"\/\u003e\u003c\/linearGradient\u003e';\n  }\n  defs.innerHTML=grads\n    +'\u003cfilter id=\"owSoft\" x=\"-20%\" y=\"-20%\" width=\"140%\" height=\"140%\"\u003e'\n    +'\u003cfeGaussianBlur stdDeviation=\"0.5\"\/\u003e\u003c\/filter\u003e'\n    +'\u003cfilter id=\"owGrain\" x=\"0\" y=\"0\" width=\"100%\" height=\"100%\"\u003e'\n    +'\u003cfeTurbulence type=\"fractalNoise\" baseFrequency=\"0.9\" numOctaves=\"3\" seed=\"4\"\/\u003e'\n    +'\u003cfeColorMatrix type=\"saturate\" values=\"0\"\/\u003e'\n    +'\u003cfeComponentTransfer\u003e\u003cfeFuncA type=\"discrete\" tableValues=\"0 0 0 0 .5\"\/\u003e'\n    +'\u003c\/feComponentTransfer\u003e\u003c\/filter\u003e'\n    +'\u003cradialGradient id=\"owDisc\" cx=\"0.35\" cy=\"0.3\" r=\"0.8\"\u003e'\n    +'\u003cstop offset=\"0\" stop-color=\"#3E63D8\"\/\u003e\u003cstop offset=\"1\" stop-color=\"#15308C\"\/\u003e'\n    +'\u003c\/radialGradient\u003e';\n  s.appendChild(defs);\n  \/* the tray: a speckled rim with a recessed floor, like the printed one *\/\n  s.appendChild(svg(\"rect\",{x:-PAD,y:-PAD,width:W*S+PAD*2,height:H*S+PAD*2,rx:\"3\",fill:\"#EDEAE3\"}));\n  s.appendChild(svg(\"rect\",{x:-PAD,y:-PAD,width:W*S+PAD*2,height:H*S+PAD*2,rx:\"3\",\n    fill:\"#8A8275\",\"fill-opacity\":\".5\",filter:\"url(#owGrain)\"}));\n  s.appendChild(svg(\"rect\",{x:-0.6,y:-0.6,width:W*S+1.2,height:H*S+1.2,rx:\"1.6\",\n    fill:\"#F6F4EF\",stroke:\"rgba(80,74,64,.30)\",\"stroke-width\":\".5\"}));\n  s.appendChild(svg(\"rect\",{x:-0.6,y:-0.6,width:W*S+1.2,height:H*S+1.2,rx:\"1.6\",\n    fill:\"#8A8275\",\"fill-opacity\":\".28\",filter:\"url(#owGrain)\"}));\n  s.appendChild(svg(\"rect\",{x:GOAL[1]*S+1.4,y:GOAL[0]*S+1.4,width:S-2.8,height:S-2.8,rx:\"1.4\",\n    fill:\"none\",stroke:\"#0B7FA8\",\"stroke-opacity\":\".75\",\"stroke-width\":\".65\",\n    \"stroke-dasharray\":\"1.8 1.4\"}));\n  ORDER.forEach(function(n){\n    if(!placed[n]) return;\n    if(drag\u0026\u0026drag.name===n\u0026\u0026drag.live) return;      \/* drawn as the ghost instead *\/\n    s.appendChild(pieceNode(n,placed[n],{sel:picked===n}));\n  });\n  if(disc \u0026\u0026 !(drag\u0026\u0026drag.name===\"disc\"\u0026\u0026drag.live)){\n    s.appendChild(svg(\"circle\",{cx:disc[1]*S+S\/2+0.5,cy:disc[0]*S+S\/2+0.9,r:S*0.36,\n      fill:\"rgba(18,32,40,.26)\",filter:\"url(#owSoft)\",\"pointer-events\":\"none\"}));\n    var d=svg(\"circle\",{cx:disc[1]*S+S\/2,cy:disc[0]*S+S\/2,r:S*0.36,\n      fill:\"url(#owDisc)\",stroke:picked===\"disc\"?\"#0B7FA8\":\"rgba(8,20,60,.5)\",\n      \"stroke-width\":picked===\"disc\"?\".9\":\".4\",style:\"cursor:pointer\"});\n    d.setAttribute(\"data-p\",\"disc\");\n    d.setAttribute(\"style\",\"touch-action:none\");\n    s.appendChild(d);\n    \/* the sheen is decoration: it must not swallow the click meant for the disc *\/\n    s.appendChild(svg(\"ellipse\",{cx:disc[1]*S+S\/2-S*0.1,cy:disc[0]*S+S\/2-S*0.13,\n      rx:S*0.15,ry:S*0.09,fill:\"rgba(255,255,255,.28)\",\"pointer-events\":\"none\"}));\n  }\n  if(drag\u0026\u0026drag.live){\n    if(drag.name===\"disc\"){\n      var dc=(drag.cells\u0026\u0026drag.cells[0])||disc;\n      s.appendChild(svg(\"circle\",{cx:dc[1]*S+S\/2,cy:dc[0]*S+S\/2,r:S*0.36,\n        fill:\"#1B3FAE\",\"fill-opacity\":\".78\",stroke:\"#0B7FA8\",\"stroke-width\":\".7\"}));\n    } else {\n      s.appendChild(pieceNode(drag.name,drag.cells,{ghost:true,bad:!drag.ok,sel:true}));\n    }\n  }\n  svgEl=s;\n  $(\"owBoard\").innerHTML=\"\"; $(\"owBoard\").appendChild(s);\n  wire(s);\n  syncButtons();\n  drawTray();\n  $(\"owSay\").textContent = won()? \"The disc is across. That is the whole puzzle.\" : msg;\n  $(\"owPhase\").textContent = phase===\"pack\" ? \"Step one: pack the tray\"\n                                            : \"Step two: move the disc\";\n}\nfunction drawTray(){\n  var box=$(\"owTray\"); box.innerHTML=\"\";\n  ORDER.forEach(function(n){\n    if(!tray[n]) return;\n    var cs=tray[n];\n    var hh=Math.max.apply(null,cs.map(function(c){return c[0];}))+1;\n    var ww=Math.max.apply(null,cs.map(function(c){return c[1];}))+1;\n    var s=svg(\"svg\",{viewBox:\"-.6 -.6 \"+(ww*S+1.2)+\" \"+(hh*S+1.2),\n      width:(ww*19)+\"px\",height:(hh*19)+\"px\",style:\"cursor:grab;touch-action:none\"});\n    s.appendChild(pieceNode(n,cs,{sel:picked===n}));\n    if(picked===n) s.style.outline=\"2px solid #0B7FA8\";\n    s.style.outlineOffset=\"2px\"; s.style.borderRadius=\"4px\";\n    s.addEventListener(\"pointerdown\",function(e){ startDrag(n,cs,e,true); });\n    box.appendChild(s);\n  });\n  if(!Object.keys(tray).length) box.innerHTML='\u003cspan class=\"empty\"\u003eAll packed\u003c\/span\u003e';\n}\n\/* ---------- dragging ---------- *\/\nvar PAD=3;                                   \/* the tray rim, in view units *\/\nfunction cellAt(ev){\n  \/* Derived from the viewBox rather than hardcoded. Adding the rim changed the\n     viewBox from -1 to -3 and this kept using the old numbers, so every\n     pointer position mapped to the wrong square. *\/\n  var b=svgEl.getBoundingClientRect();\n  var vw=W*S+PAD*2, vh=H*S+PAD*2;\n  var vx=-PAD+((ev.clientX-b.left)\/b.width)*vw;\n  var vy=-PAD+((ev.clientY-b.top)\/b.height)*vh;\n  return [Math.floor(vy\/S), Math.floor(vx\/S)];\n}\nfunction originOf(cells){\n  return [Math.min.apply(null,cells.map(function(c){return c[0];})),\n          Math.min.apply(null,cells.map(function(c){return c[1];}))];\n}\nfunction startDrag(name,cells,ev,fromRack){\n  ev.preventDefault();\n  var base=norm(cells.map(function(c){return c.slice();}));\n  var anchor=fromRack?[0,0]:null;\n  drag={name:name,base:base,fromRack:fromRack,live:false,cells:cells,ok:true,anchor:anchor};\n  if(!fromRack \u0026\u0026 name!==\"disc\" \u0026\u0026 placed[name]){\n    \/* which square of the piece the pointer came down on, so the piece follows\n       the hand instead of assuming it was grabbed by its first cell *\/\n    var gc=cellAt(ev), og=originOf(placed[name]);\n    drag.grab=[gc[0]-og[0], gc[1]-og[1]];\n  }\n  if(!fromRack\u0026\u0026name!==\"disc\"){\n    drag.start=cells.map(function(c){return c.slice();});\n  }\n  window.addEventListener(\"pointermove\",onMove);\n  window.addEventListener(\"pointerup\",onUp);\n  window.addEventListener(\"pointercancel\",onCancel);\n}\nfunction onCancel(){\n  window.removeEventListener(\"pointermove\",onMove);\n  window.removeEventListener(\"pointerup\",onUp);\n  window.removeEventListener(\"pointercancel\",onCancel);\n  if(!drag) return;\n  var d=drag; drag=null;\n  if(d.restore){                     \/* it was lifted off the board - put it back *\/\n    placed[d.name]=d.restore.cells; shapeOf[d.name]=d.restore.shape; delete tray[d.name];\n  }\n  picked=null; draw();\n}\nfunction onMove(ev){\n  if(!drag||!svgEl) return;\n  var rc=cellAt(ev);\n  drag.live=true;\n  if(drag.name===\"disc\"){\n    \/* the disc never jumps: it only follows as far as empty squares reach *\/\n    var occ=occupied(\"disc\");\n    if(rc[0]\u003e=0\u0026\u0026rc[0]\u003cH\u0026\u0026rc[1]\u003e=0\u0026\u0026rc[1]\u003cW\u0026\u0026!occ[rc[0]+\",\"+rc[1]]\n       \u0026\u0026reachable(disc,rc,occ)) drag.cells=[rc];\n    else if(!drag.cells) drag.cells=[disc.slice()];\n    drag.ok=true; draw(); return;\n  }\n  if(phase===\"pack\"||drag.fromRack){\n    var cells=drag.base.map(function(c){ return [c[0]+rc[0],c[1]+rc[1]]; });\n    drag.cells=cells; drag.ok=fits(drag.name,cells);\n  } else {\n    \/* sliding: step toward the pointer, pushing anything in the way *\/\n    var guard=0, grab=drag.grab||[0,0];\n    while(guard++\u003c12){\n      var cur=originOf(placed[drag.name]);\n      var want=[rc[0]-grab[0], rc[1]-grab[1]];\n      var dr=Math.sign(want[0]-cur[0]), dc=Math.sign(want[1]-cur[1]);\n      if(!dr\u0026\u0026!dc) break;\n      \/* try the bigger pull first, then the other axis, so a mostly sideways\n         drag is not abandoned just because the vertical step is blocked *\/\n      var tries=(Math.abs(want[0]-cur[0])\u003e=Math.abs(want[1]-cur[1]))\n        ? [[dr,0],[0,dc]] : [[0,dc],[dr,0]];\n      var mv=null, step=null;\n      for(var ti=0;ti\u003ctries.length;ti++){\n        var t=tries[ti];\n        if(!t[0]\u0026\u0026!t[1]) continue;\n        mv=chainMove(drag.name,t[0],t[1]);\n        if(mv){ step=t; break; }\n      }\n      if(!mv) break;\n      applyChain(mv,step[0],step[1]);\n      if(Object.keys(mv).length\u003e1) msg=\"Pushed \"+(Object.keys(mv).length-1)\n        +\" piece\"+(Object.keys(mv).length\u003e2?\"s\":\"\")+\" along.\";\n    }\n    drag.cells=placed[drag.name].map(function(c){return c.slice();});\n    drag.ok=true;\n  }\n  draw();\n}\nfunction onUp(){\n  window.removeEventListener(\"pointermove\",onMove);\n  window.removeEventListener(\"pointerup\",onUp);\n  window.removeEventListener(\"pointercancel\",onCancel);\n  if(!drag){ return; }\n  var d=drag; drag=null;\n  if(!d.live){\n    \/* a tap, not a drag *\/\n    if(d.name===\"disc\"){\n      picked=(picked===\"disc\")?null:\"disc\";\n      msg=(picked===\"disc\")?\"Disc picked up. Click an empty square to send it there.\":\"\";\n      draw(); return;\n    }\n    if(d.fromRack){ picked=d.name; }           \/* hold it until the tray is tapped *\/\n    else if(phase===\"slide\"){\n      if(picked===d.name){ picked=null; msg=\"\"; }\n      else {\n        picked=d.name;\n        msg=\"Tap a square to nudge it that way, or drag it. \"\n           +\"Take out puts it back in the tray.\";\n      }\n    }\n    draw(); return;\n  }\n  if(d.live){\n    picked=null;\n    if(d.name===\"disc\"){\n      var t=d.cells\u0026\u0026d.cells[0];\n      var occ3=occupied(\"disc\");\n      if(t\u0026\u0026!occ3[t[0]+\",\"+t[1]]\u0026\u0026reachable(disc,t,occ3)){ setDisc(t); msg=\"\"; }\n      draw(); return;\n    }\n    if(phase===\"pack\"||d.fromRack){\n      if(d.ok){ placed[d.name]=d.cells; shapeOf[d.name]=d.base; delete tray[d.name];\n        msg = packed()? \"\" : \"\";\n        if(packed()){ phase=\"slide\"; slideFrom=disc.slice();\n          msg = atGoal(disc)\n            ? \"Packed, but the disc is already sitting on its target. Start it \"\n              +\"somewhere else so it has a run to make.\"\n            : \"Packed. Drag the disc, or click it and click where it should go. \"\n              +\"Arrow keys work too. Click a piece to take it back out.\"; }\n      } else { msg=\"That will not fit there.\"; }\n    }\n  }\n  draw();\n}\nfunction discStep(dr,dc){\n  var n=[disc[0]+dr,disc[1]+dc];\n  if(n[0]\u003c0||n[0]\u003e=H||n[1]\u003c0||n[1]\u003e=W) return false;\n  var occ=occupied(\"disc\");\n  if(occ[n[0]+\",\"+n[1]]){ msg=\"The disc is blocked. Drag a piece out of its way.\"; return false; }\n  setDisc(n); msg=\"\"; return true;\n}\nfunction occupantAt(cell,movers){\n  var k=cell[0]+\",\"+cell[1];\n  for(var n in placed){\n    if(movers[n]) continue;\n    for(var i=0;i\u003cplaced[n].length;i++)\n      if(placed[n][i][0]===cell[0]\u0026\u0026placed[n][i][1]===cell[1]) return n;\n  }\n  if(!movers.disc \u0026\u0026 disc \u0026\u0026 disc[0]===cell[0] \u0026\u0026 disc[1]===cell[1]) return \"disc\";\n  return null;\n}\nfunction stepToward(name,rc){\n  var cs=placed[name];\n  var rs=cs.map(function(c){return c[0];}), cl=cs.map(function(c){return c[1];});\n  var top=Math.min.apply(null,rs), bot=Math.max.apply(null,rs);\n  var lef=Math.min.apply(null,cl), rig=Math.max.apply(null,cl);\n  var dr=rc[0]\u003ctop?-1:(rc[0]\u003ebot?1:0);\n  var dc=rc[1]\u003clef?-1:(rc[1]\u003erig?1:0);\n  if(!dr\u0026\u0026!dc) return false;\n  \/* the bigger offset first, then the other axis, so a tap that is mostly\n     sideways still moves the piece when the vertical step is blocked *\/\n  var dRow=Math.min(Math.abs(rc[0]-top),Math.abs(rc[0]-bot));\n  var dCol=Math.min(Math.abs(rc[1]-lef),Math.abs(rc[1]-rig));\n  var tries=(dRow\u003e=dCol)?[[dr,0],[0,dc]]:[[0,dc],[dr,0]];\n  for(var i=0;i\u003ctries.length;i++){\n    var t=tries[i];\n    if(!t[0]\u0026\u0026!t[1]) continue;\n    var mv=chainMove(name,t[0],t[1]);\n    if(mv){\n      applyChain(mv,t[0],t[1]);\n      msg = Object.keys(mv).length\u003e1\n        ? \"Pushed \"+(Object.keys(mv).length-1)+\" along.\"\n        : \"\";\n      return true;\n    }\n  }\n  msg=\"That piece has nowhere to go that way.\";\n  return false;\n}\nfunction chainMove(name,dr,dc){\n  \/* Slide one piece into another and the second one goes too, as long as it\n     has somewhere to go. The push carries on down the line, and the disc gets\n     shoved along with everything else, the way a loose disc in a tray would. *\/\n  var movers={}; movers[name]=1;\n  var queue=[name], guard=0;\n  while(queue.length \u0026\u0026 guard++\u003c30){\n    var n=queue.shift();\n    var cells=(n===\"disc\")?[disc]:placed[n];\n    for(var i=0;i\u003ccells.length;i++){\n      var t=[cells[i][0]+dr, cells[i][1]+dc];\n      if(t[0]\u003c0||t[0]\u003e=H||t[1]\u003c0||t[1]\u003e=W) return null;   \/* the tray wall stops it *\/\n      var occ=occupantAt(t,movers);\n      if(occ){ movers[occ]=1; queue.push(occ); }\n    }\n  }\n  if(queue.length) return null;\n  return movers;\n}\nfunction applyChain(movers,dr,dc){\n  for(var n in movers){\n    if(n===\"disc\"){ setDisc([disc[0]+dr, disc[1]+dc]); continue; }\n    placed[n]=placed[n].map(function(c){ return [c[0]+dr,c[1]+dc]; });\n  }\n}\nfunction reachable(from,to,occ){\n  \/* the disc travels through empty squares, it never jumps over a piece *\/\n  var seen={}, q=[from]; seen[from[0]+\",\"+from[1]]=1;\n  while(q.length){\n    var c=q.shift();\n    if(c[0]===to[0]\u0026\u0026c[1]===to[1]) return true;\n    var ds=[[1,0],[-1,0],[0,1],[0,-1]];\n    for(var i=0;i\u003cds.length;i++){\n      var n=[c[0]+ds[i][0],c[1]+ds[i][1]], k=n[0]+\",\"+n[1];\n      if(n[0]\u003c0||n[0]\u003e=H||n[1]\u003c0||n[1]\u003e=W||seen[k]||occ[k]) continue;\n      seen[k]=1; q.push(n);\n    }\n  }\n  return false;\n}\nfunction wire(s){\n  \/* Swiping the board walks the disc, so once everything is packed you can\n     play with flicks or the arrow keys and never have to grab the disc itself. *\/\n  s.addEventListener(\"click\",function(ev){\n    \/* Picking the disc up happens in onUp - see the tap branch there. The disc is\n       loose in the tray from the start, so it answers to clicks while you are\n       still packing, not only once the last piece is in. *\/\n    if(picked===\"disc\"){\n      var rc2=cellAt(ev);\n      var occ2=occupied(\"disc\");\n      if(rc2[0]\u003c0||rc2[0]\u003e=H||rc2[1]\u003c0||rc2[1]\u003e=W) return;\n      if(rc2[0]===disc[0]\u0026\u0026rc2[1]===disc[1]) return;   \/* the tap that picked it up *\/\n      if(occ2[rc2[0]+\",\"+rc2[1]]){ msg=\"Something is already there.\"; draw(); return; }\n      if(reachable(disc,rc2,occ2)){ setDisc(rc2); picked=null; msg=\"\"; }\n      else msg=\"No clear run of empty squares that way.\";\n      draw(); return;\n    }\n    if(phase===\"slide\"){\n      if(picked\u0026\u0026placed[picked]){\n        var rcp=cellAt(ev);\n        if(rcp[0]\u003c0||rcp[0]\u003e=H||rcp[1]\u003c0||rcp[1]\u003e=W) return;\n        stepToward(picked,rcp); draw();\n      }\n      return;\n    }\n    if(!picked||!tray[picked]) return;\n    var rc=cellAt(ev);\n    var base=norm(tray[picked].map(function(c){return c.slice();}));\n    var cells=base.map(function(c){ return [c[0]+rc[0],c[1]+rc[1]]; });\n    if(fits(picked,cells)){\n      placed[picked]=cells; shapeOf[picked]=base; delete tray[picked];\n      picked=null;\n      if(packed()){ phase=\"slide\"; slideFrom=disc.slice();\n        msg = atGoal(disc)\n          ? \"Packed, but the disc is already sitting on its target. Start it \"\n            +\"somewhere else so it has a run to make.\"\n          : \"Packed. Arrow keys or a swipe move the disc. Drag a piece to shift it.\"; }\n      else msg=\"\";\n    } else msg=\"That will not fit there.\";\n    draw();\n  });\n  var sw=null;\n  s.addEventListener(\"pointerdown\",function(ev){\n    \/* a swipe may start on the disc too - only a piece takes priority *\/\n    var hit=ev.target.closest\u0026\u0026ev.target.closest(\"[data-p]\");\n    if(hit\u0026\u0026hit.getAttribute(\"data-p\")!==\"disc\") return;\n    sw={x:ev.clientX,y:ev.clientY};\n  });\n  s.addEventListener(\"pointerup\",function(ev){\n    if(!sw) return;\n    var dx=ev.clientX-sw.x, dy=ev.clientY-sw.y; sw=null;\n    if(Math.abs(dx)\u003c12\u0026\u0026Math.abs(dy)\u003c12) return;\n    var step=Math.abs(dx)\u003eMath.abs(dy) ? [0,dx\u003e0?1:-1] : [dy\u003e0?1:-1,0];\n    var n=Math.max(1,Math.round(Math.max(Math.abs(dx),Math.abs(dy))\n          \/(s.getBoundingClientRect().width\/W)));\n    for(var k=0;k\u003cn;k++) if(!discStep(step[0],step[1])) break;\n    draw();\n  });\n  Array.prototype.forEach.call(s.querySelectorAll(\"[data-p]\"),function(e){\n    e.addEventListener(\"pointerdown\",function(ev){\n      var n=e.getAttribute(\"data-p\");\n      if(n===\"disc\"){\n        \/* a piece in hand wants to be placed, so let the click fall through\n           to the tray and report that the disc's square is taken *\/\n        if(picked\u0026\u0026picked!==\"disc\"\u0026\u0026tray[picked]) return;\n        startDrag(\"disc\",[disc.slice()],ev,false); return;\n      }\n      if(phase===\"pack\"){\n        var wasAt=placed[n], wasShape=shapeOf[n];\n        tray[n]=shapeOf[n]; delete placed[n]; delete shapeOf[n];\n        startDrag(n,tray[n],ev,true);\n        if(drag) drag.restore={cells:wasAt,shape:wasShape};\n      } else startDrag(n,placed[n],ev,false);\n    });\n  });\n}\ndocument.addEventListener(\"keydown\",function(e){\n  var d={ArrowUp:[-1,0],ArrowDown:[1,0],ArrowLeft:[0,-1],ArrowRight:[0,1]}[e.key];\n  if(!d) return;\n  e.preventDefault();\n  if(phase===\"slide\"\u0026\u0026picked\u0026\u0026placed[picked]){\n    var mv=chainMove(picked,d[0],d[1]);\n    if(mv){ applyChain(mv,d[0],d[1]); msg=\"\"; }\n    else msg=\"That piece has nowhere to go that way.\";\n  } else discStep(d[0],d[1]);\n  draw();\n});\n$(\"owRotate\").addEventListener(\"click\",function(){\n  var n=(picked\u0026\u0026tray[picked])?picked:Object.keys(tray)[0];\n  if(n){ tray[n]=rotate(tray[n]); draw(); }\n});\n$(\"owFlip\").addEventListener(\"click\",function(){\n  var n=(picked\u0026\u0026tray[picked])?picked:Object.keys(tray)[0];\n  if(n){ tray[n]=flipped(tray[n]); draw(); }\n});\nfunction backToPack(){\n  \/* The disc stays exactly where it is. Taking a piece out is a way to free it\n     up, so sending it home would undo the run you were in the middle of. *\/\n  phase=\"pack\";\n  slideFrom=null;\n}\nvar takeBtn=$(\"owTake\");\nif(takeBtn) takeBtn.addEventListener(\"click\",function(){\n  if(phase!==\"slide\"||!picked||!placed[picked]) return;\n  tray[picked]=shapeOf[picked];\n  delete placed[picked]; delete shapeOf[picked];\n  backToPack();\n  msg=\"Took that piece out. Place it again when you are ready.\";\n  draw();\n});\nvar emptyBtn=$(\"owUnpack\");\nif(emptyBtn) emptyBtn.addEventListener(\"click\",function(){\n  ORDER.forEach(function(n){\n    if(!placed[n]) return;\n    tray[n]=shapeOf[n];\n    delete placed[n]; delete shapeOf[n];\n  });\n  backToPack(); picked=null;\n  msg=\"Tray emptied. Pack it again however you like.\";\n  draw();\n});\n$(\"owReset\").addEventListener(\"click\",reset);\nreset();\n})();\n\n})();\n\u003c\/script\u003e\n\n\n\n\n\n\n\u003cp\u003ePut the disc in one corner. Pack the pieces in around it. Now slide them until the disc comes out in the opposite corner.\u003c\/p\u003e\n\u003cp\u003eGoal: fit every piece into the tray so one corner stays free for the disc, then move the disc to the diagonally opposite corner using sliding moves alone.\u003c\/p\u003e\n\u003cp\u003eAlexander Magyarics took a tray packing puzzle and gave it somewhere to go. Finding an arrangement that fits is the easy half. Finding the one that also leaves the disc a path across the tray is the part worth owning. It earned a Jury Honorable Mention at the 2026 Nob Yoshigahara Puzzle Design Competition in Assisi.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eWhat's special about One Way or Another?\u003c\/strong\u003e\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003eUnique puzzle in one tray: pack it, then slide to create a path\u003c\/li\u003e\n\u003cli\u003eJury Honorable Mention, 2026 Nob Yoshigahara Puzzle Design Competition\u003c\/li\u003e\n\u003cli\u003eFlat and light enough to take with you\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003eBest for: packing puzzle fans who have run out of tray puzzles that still surprise them, and gift buyers after a small desk puzzle with a real idea behind it.\u003c\/p\u003e\n\u003cp\u003eDesigned by \u003ca href=\"\/collections\/alexander-magyarics\"\u003eAlexander Magyarics\u003c\/a\u003e\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":51517396910247,"sku":"GP-ONEWAY","price":16.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/one_way_or_another___move_the_disc_corne_marble.png?v=1792040466"},{"product_id":"elbow-room-packing-puzzle","title":"Elbow Room | Packing Puzzle by Goh Pit Khiam","description":"\u003cp\u003ePack the pieces into the box. Voted both by Solvers and Competition Judges as the best new puzzle of 2026!\u003c\/p\u003e\n\u003cp\u003eElbow Room won twice at the 2026 Nob Yoshigahara Puzzle Design Competition in Assisi: the Jury Grand Prize, and the Puzzlers' Award, voted by the puzzlers themselves.\u003c\/p\u003e\n\u003cp\u003eGoal: pack all five pieces into the box, through its corner opening.\u003c\/p\u003e\n\u003cp\u003eThe competition original was made in wood and was roughly twice this size. We made ours 7 x 7 x 7 cm (2.75 in) and printed it dense, so it feels solid in the hand and is nice to play with.\u003c\/p\u003e\n\u003cp\u003eI was delighted when I found the solution, and immediately reached out to Goh Pit Khiam. To be honest, I was not a bit surprised when it won him the grand prize - but I was happy, since it most-definitely deserved it, in my opinion. Finally, it's ready to be enjoyed anywhere in the world. This puzzle fits exactly what I consider a beautiful packing puzzle, and I highly recommend anyone fond of packing puzzles to try it - beginners and pros alike.  \u003c\/p\u003e\n\u003cp\u003eShips disassembled.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eWhat's special about Elbow Room?\u003c\/strong\u003e\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003e2026 Puzzle of the Year: Jury Grand Prize and Puzzlers' Award\u003c\/li\u003e\n\u003cli\u003eAn incredible, artful balance of challenge and enjoyment   \u003c\/li\u003e\n\u003cli\u003eA one-line goal, and very little room to work with\u003cbr\u003e\n\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003eDesigned by \u003ca href=\"\/collections\/goh-pit-khiam\"\u003eGoh Pit Khiam\u003c\/a\u003e\u003c\/p\u003e\n\u003cp\u003eGoh Pit Khiam also designed \u003ca href=\"\/products\/chain-store\"\u003eChain Store\u003c\/a\u003e and \u003ca href=\"\/products\/fish-tank-3-piece-packing-puzzle\"\u003eFish Tank\u003c\/a\u003e.\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":52217464651943,"sku":null,"price":34.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/elbow_room_pieces_marble.png?v=1796378648"}],"url":"https:\/\/gregpuzzles.com\/collections\/award-winning-puzzles.oembed","provider":"Greg Puzzles","version":"1.0","type":"link"}