{"title":"פאזלים מתחת ל-25 דולר","description":"\u003cp\u003eמחפשים פאזל מכני במחיר סביר? קולקציה זו מציגה פאזלים מודפסים בתלת מימד שנבחרו בקפידה, כולם מתומחרים מתחת ל-25 דולר - מבלי לוותר על איכות או אתגר. בין אם אתם רוצים פאזל סימטריה שטוח כמו שינובי, אתגר אריזה כמו טרימיני פריימ, או הפתעת פאזל מסתורין, תמצאו כאן משהו ששווה לפתור. כל פאזל נועד לאתגר את החשיבה המרחבית שלכם ומהווה מתנה נהדרת לאוהבי פאזלים בכל רמה. עיינו למטה - ממוין לפי רמת קושי - ומצאו את הפתרון הבא שלכם.\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eלא בטוחים איפה להתחיל?\u003c\/strong\u003e הנה ארבעה ששווה להכיר:\u003c\/p\u003e\u003cul\u003e\n\n\u003cli\u003e\n\n\u003cstrong\u003eהטוב ביותר למתנה:\u003c\/strong\u003e \u003ca href=\"\/he\/products\/tower-of-hanoi-puzzle\"\u003eמגדל האנוי\u003c\/a\u003e - קלאסיקה מסיבה טובה. קל להעניק למישהו שחושב שהוא לא אוהב פאזלים.\u003c\/li\u003e\n\n\u003cli\u003e\n\n\u003cstrong\u003eהטוב ביותר למתחילים:\u003c\/strong\u003e \u003ca href=\"\/he\/products\/baby-puzzle\"\u003eפאזל תינוק\u003c\/a\u003e - אל תתנו לשם להטעות אתכם. זהו פאזל אמיתי. רק ידידותי.\u003c\/li\u003e\n\n\u003cli\u003e\n\n\u003cstrong\u003eהטוב ביותר לאוהבי אתגרים:\u003c\/strong\u003e \u003ca href=\"\/he\/products\/alpacka-1\"\u003eאלפאקה 1\u003c\/a\u003e - נראה פשוט. הוא לא. רוב האנשים מבלים על זה הרבה יותר זמן ממה שהם מצפים.\u003c\/li\u003e\n\n\u003cli\u003e\n\n\u003cstrong\u003eהטוב ביותר לאמיצים:\u003c\/strong\u003e \u003ca href=\"\/he\/products\/minima-tower\"\u003eמגדל מינימה\u003c\/a\u003e - זה יכניע אתכם. הוזהרתם.\u003c\/li\u003e\n\n\n\u003c\/ul\u003e","products":[{"product_id":"6-piece-star-puzzle","title":"פאזל כוכב 6 חלקים | חידת הכוכב","description":"\u003cp style=\";text-align: right; direction: rtl;\"\u003eפאזל הכוכב בן 6 החלקים היה אחד הפאזלים הראשונים שפתרתי אי פעם.\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eאני זוכר שפירקתי את הפאזל הזה בפעם הראשונה - איזו הפתעה זו הייתה!\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eלהרכיב את זה מחדש זה האתגר האמיתי\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"381\" data-start=\"360\"\u003e🛡️ תשלום מאובטח\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"405\" data-start=\"385\"\u003e🌍 משלוחים לישראל עם מעקב\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"447\" data-start=\"409\"\u003e✏️ עוצב על ידי ממציאים ברמה עולמית\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"475\" data-start=\"451\"\u003e🔁 החזרות חינם תוך 30 יום\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"475\" data-start=\"451\"\u003e🏅אחריות לכל החיים\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eמה מיוחד בפאזל הכוכב?\u003c\/p\u003e\n\u003cul style=\";text-align: right; direction: rtl;\"\u003e\n\u003cli style=\";text-align: right; direction: rtl;\"\u003eמפתח דמיון תלת-ממדי\u003c\/li\u003e\n\u003cli style=\";text-align: right; direction: rtl;\"\u003eנדרשת חשיבה יצירתית\u003c\/li\u003e\n\u003cli style=\";text-align: right; direction: rtl;\"\u003eבחן את סבלנותך\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eכשתנסה, תבין למה ;)\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Marble White","offer_id":46556039053479,"sku":"GP-6STAR-MARWHI","price":15.0,"currency_code":"USD","in_stock":true},{"title":"Oreo","offer_id":46556039086247,"sku":"GP-6STAR-ORE","price":17.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/6_piece_star_marble.png?v=1782038337"},{"product_id":"baby-puzzle","title":"פאזל תינוק | פאזל קליל 2 חלקים","description":"\u003cp style=\";text-align: right; direction: rtl;\"\u003eפאזל עם רק 2 חלקים?\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eהמטרה שלך פשוטה - לארוז את שני חלקי הפאזל בתוך המגש.\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eאיך? את זה נשאיר לכם!\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"381\" data-start=\"360\"\u003e🛡️ תשלום מאובטח\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"405\" data-start=\"385\"\u003e🌍 משלוחים לישראל עם מעקב\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"447\" data-start=\"409\"\u003e✏️ עוצב על ידי ממציאים ברמה עולמית\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"475\" data-start=\"451\"\u003e🔁 החזרות חינם תוך 30 יום\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"475\" data-start=\"451\"\u003e🏅אחריות לכל החיים\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eמה מיוחד בפאזל הזה?\u003c\/p\u003e\n\u003cul style=\";text-align: right; direction: rtl;\"\u003e\n\u003cli style=\";text-align: right; direction: rtl;\"\u003eמגביר את הדמיון המרחבי\u003c\/li\u003e\n\u003cli style=\";text-align: right; direction: rtl;\"\u003eנהדר להראות לחברים\u003c\/li\u003e\n\u003cli style=\";text-align: right; direction: rtl;\"\u003eפתרון מהנה\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eעוצב על ידי Katarn\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":46738701811879,"sku":"GP-BABY","price":12.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/baby_puzzle_marble.png?v=1781972086"},{"product_id":"three-piece-block-puzzle","title":"בלוק שלושה חלקים | חידה גיאומטרית","description":"\u003cp style=\";text-align: right; direction: rtl;\"\u003eפאזל בלוק שלושה חלקים הוא פשוט כמו שהוא מבלבל.\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eהמטרה היא ליצור פירמידה מ-3 חלקים שונים. כל חלק בנוי מקוביות מוצקות המחוברות יחד בדרכים שונות.\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eאיך? אשאיר את זה לכם!\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"381\" data-start=\"360\"\u003e🛡️ תשלום מאובטח\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"405\" data-start=\"385\"\u003e🌍 משלוחים לישראל עם מעקב\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"447\" data-start=\"409\"\u003e✏️ עוצב על ידי ממציאים ברמה עולמית\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"475\" data-start=\"451\"\u003e🔁 החזרות חינם תוך 30 יום\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"475\" data-start=\"451\"\u003e🏅אחריות לכל החיים\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eמה מיוחד בפאזל הזה?\u003c\/p\u003e\n\u003cul style=\";text-align: right; direction: rtl;\"\u003e\n\u003cli style=\";text-align: right; direction: rtl;\"\u003eמגביר את הדמיון המרחבי\u003cbr\u003e\u003c\/li\u003e\n\u003cli style=\";text-align: right; direction: rtl;\"\u003eצורות יפות\u003cbr\u003e\u003c\/li\u003e\n\u003cli style=\";text-align: right; direction: rtl;\"\u003eכיף לא מקוון\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eעוצב על ידי מעצב הפאזלים האגדי, סטיוארט קופין.\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":46738790252711,"sku":"GP-THREBLOC","price":11.25,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/three_piece_block_marble.png?v=1781971412"},{"product_id":"infinity-chocolate","title":"שוקולד אינסופי ∞","description":"\u003cp style=\";text-align: right; direction: rtl;\"\u003eהסוד לאספקה בלתי נגמרת של שוקולד:\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eהזיזו את החתיכות בצורה מסוימת כדי לראות חתיכת שוקולד נוספת מופיעה יש מאין.\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eהטריק יוצא הדופן הזה יגרום להם לתהות, לחשוב ולשאול אתכם... \"איך זה אפשרי?\"\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"381\" data-start=\"360\"\u003e🛡️ תשלום מאובטח\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"405\" data-start=\"385\"\u003e🌍 משלוחים לישראל עם מעקב\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"447\" data-start=\"409\"\u003e✏️ עוצב על ידי ממציאים ברמה עולמית\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"475\" data-start=\"451\"\u003e🔁 החזרות חינם תוך 30 יום\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"475\" data-start=\"451\"\u003e🏅אחריות לכל החיים\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eמה מיוחד במוצר הזה?\u003c\/p\u003e\n\u003cul style=\";text-align: right; direction: rtl;\"\u003e\n\u003cli style=\";text-align: right; direction: rtl;\"\u003eטריק מגניב למסיבה\u003cbr\u003e\u003c\/li\u003e\n\u003cli style=\";text-align: right; direction: rtl;\"\u003eכיף מחוץ למסכים\u003c\/li\u003e\n\u003cli style=\";text-align: right; direction: rtl;\"\u003eמעורר מחשבה\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":46754795847847,"sku":"GP-INFICHOC","price":18.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/infinity_chocolate_marble.png?v=1782150398"},{"product_id":"spiral-cone-fidget-toy","title":"צעצוע פידג'ט חרוטי ספירלי","description":"\u003cp\u003eצפו בקונוס הספירלי מסתובב בצורה חלקה מלמעלה למטה - תנועה מהפנטת שתרצו לחזור אליה שוב ושוב. בהתחלה זה נראה בלתי אפשרי. ואז אתם עושים את זה פעם אחת, ואתם פשוט ממשיכים.\u003c\/p\u003e\u003cp\u003eזה מיועד לאדם שצריך משהו לעשות עם הידיים שלו. עובד המשרד שבוהה במסכים כל היום. מישהו שמתמודד עם חרדה או הפרעת קשב וריכוז שרוצה פורקן מרגיע ומוחשי שבאמת עובד. או בכנות - זו מתנה ייחודית באמת לכל מי שמעריך משהו קצת שונה.\u003c\/p\u003e\u003cp\u003eהוא בגודל ג'מבו - גובה 110 מ\"מ, קוטר 80 מ\"מ - כך שיש לו משקל ונוכחות מספקים באמת. מודפס בתלת מימד, עם אותה פעולה מכנית חלקה שפשוט מרגישה נכונה.\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eתנועה חוזרת ומרגיעה.\u003c\/strong\u003e יש משהו בסיבוב הספירלי - מלמעלה למטה, שוב ושוב - שפשוט מרגיע את מערכת העצבים שלכם. קשה להסביר עד שמנסים.\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eפעולה מכנית מספקת.\u003c\/strong\u003e זה לא ספינר או קליקר. התנועה מכוונת וחלקה. כל סיבוב מרגיש מושג.\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eעיסוק ללא מסך.\u003c\/strong\u003e מעסיק את הידיים שלכם מבלי למשוך אתכם לטלפון או לפיד. זה לבד שווה משהו.\u003c\/p\u003e\u003cp\u003eצעצוע הפידג'ט \"קונוס ספירלי ג'מבו\" הוא התקן פידג'ט מודפס בתלת מימד בגודל 110 מ\"מ עם תנועת סיבוב ספירלית מהפנטת - מיועד להרגעה, תחושה טקטילית ושחרור מתחים ללא מסך.\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":46754832973991,"sku":"GP-SPIRCONE","price":15.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/spiral_cone_marble.png?v=1782131220"},{"product_id":"tower-of-hanoi-puzzle","title":"מגדלי האנוי | פאזל טיולים","description":"\u003cp style=\";text-align: right; direction: rtl;\"\u003eמגדלי האנוי הוא פאזל מכני קלאסי שהומצא בשנת 1883 בצרפת על ידי המתמטיקאי אדוארד לוקאס.\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eהרעיון נבע מאגדה על מקדש הינדי שבו כמרים מעבירים 64 דיסקיות זהב, משימה שתארך 585 מיליארד שנים להשלמה בקצב של תנועה אחת בשנייה! במקרה, 585 מיליארד שנים הם פי 42 מהגיל המשוער הנוכחי של היקום שלנו, על פי המדע.\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eמטרת הפאזל היא להעביר את כל ערימת הדיסקים ממוט אחד לאחר, בעזרת 3 כללים:\u003c\/p\u003e\n\u003col style=\";text-align: right; direction: rtl;\"\u003e\n\u003cli style=\";text-align: right; direction: rtl;\"\u003eרק דיסק אחד יכול לנוע כל פעם\u003c\/li\u003e\n\u003cli style=\";text-align: right; direction: rtl;\"\u003e\u003cspan style=\"font-size: 0.875rem;\"\u003eכל מהלך מורכב מלקיחת דיסק והזזתו למוט או ערימה אחרים\u003c\/span\u003e\u003c\/li\u003e\n\u003cli style=\";text-align: right; direction: rtl;\"\u003e\u003cspan style=\"font-size: 0.875rem;\"\u003eניתן להניח דיסק רק על גבי מוט ריק או דיסק גדול יותר.\u003c\/span\u003e\u003cspan style=\"font-size: 0.875rem;\"\u003e\u003c\/span\u003e\u003c\/li\u003e\n\u003c\/ol\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eהגרסה שלנו מגיעה עם 7 דיסקים, כך שברגע שמבינים איך זה עובד, זה לגמרי פתיר.\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eכמו כן, המוטות ניתנים להסרה, מה שמאפשר לשאת בקלות את הפאזל ממקום למקום.\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eפאזל זה מפתח מאוד את הקשר בין שרירים למוח, חשיבה מתמטית ולוגית וגם התמדה אצל בנים. אל דאגה - זהו גם אתגר מהנה למבוגרים. אי אפשר לטעות עם הפאזל הזה כמתנה!\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"381\" data-start=\"360\"\u003e🛡️ תשלום מאובטח\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"405\" data-start=\"385\"\u003e🌍 משלוחים לישראל עם מעקב\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"447\" data-start=\"409\"\u003e✏️ עוצב על ידי ממציאים ברמה עולמית\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"475\" data-start=\"451\"\u003e🔁 החזרות חינם תוך 30 יום\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"475\" data-start=\"451\"\u003e🏅אחריות לכל החיים\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eגודל: 150 x 52 x 42 מ\"מ\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":47103748800679,"sku":"GP-TOWEHANO","price":18.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/tower_of_hanoi_marble.png?v=1782070667"},{"product_id":"jigsaw-traffic-puzzle","title":"פקק הפאזלים | ארוז 4 חלקי פאזל","description":"\u003cp style=\";text-align: right; direction: rtl;\"\u003eפקק הפאזלים הוא פאזל אריזה חדש לגמרי מאת מעצב פאזלים חדש, סמואל קוק!\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eבהשראת מעצב הפאזל חיים הירש, המטרה היא לארוז 4 חלקי פאזל בתוך מסגרת מצומצמת. שילוב מעניין של חלקי חיים הירש עם אתגר אריזה בסגנון קואיצ'י מיורה.\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eהמטרה שלך היא לארוז את החלקים בתוך המסגרת. כלל מאוד נוקשה לפתרון - הכניסה והחיתוכים לא יכולים לשמש לכיוון הסופי. ישנם קווים בתוך המסגרת שיעזרו לך לזהות את חלל היעד.\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eסיבובים מותרים.\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eגודל: 90 מ\"מ x 90 מ\"מ x 11 מ\"מ\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"381\" data-start=\"360\"\u003e🛡️ תשלום מאובטח\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"405\" data-start=\"385\"\u003e🌍 משלוחים לישראל עם מעקב\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"447\" data-start=\"409\"\u003e✏️ עוצב על ידי ממציאים ברמה עולמית\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"475\" data-start=\"451\"\u003e🔁 החזרות חינם תוך 30 יום\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"475\" data-start=\"451\"\u003e🏅אחריות לכל החיים\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":47305112125607,"sku":"GP-JIGSTRAF","price":24.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/jigsaw_traffic_marble.png?v=1782043988"},{"product_id":"6-piece-cross-puzzle","title":"פאזל משמיד הכבידה של ניוטון","description":"\u003cp style=\";text-align: right; direction: rtl;\"\u003eפאזל ניוטון המאתגר את כוח המשיכה, הוא פאזל פשוט עם פתרון מדהים.\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eהמטרה שלכם היא להוציא את הטיל מהבסיס שלו מבלי לגעת בבסיס. עליכם להניח אותו ישר על שולחן ולאחר מכן להוציא את הטיל.\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eאין להשתמש בכלים חיצוניים.\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"381\" data-start=\"360\"\u003e🛡️ תשלום מאובטח\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"405\" data-start=\"385\"\u003e🌍 משלוחים לישראל עם מעקב\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"447\" data-start=\"409\"\u003e✏️ עוצב על ידי ממציאים ברמה עולמית\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"475\" data-start=\"451\"\u003e🔁 החזרות חינם תוך 30 יום\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"475\" data-start=\"451\"\u003e🏅אחריות לכל החיים\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eמה מיוחד בפאזל הזה?\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eמפתח בחשיבה יצירתית\u003cbr\u003e\u003cspan style=\"font-size: 0.875rem;\"\u003eחוויה יוצאת דופן\u003cbr\u003e\u003c\/span\u003e \u003cspan style=\"font-size: 0.875rem;\"\u003eכיף מחוץ למסכים\u003cbr\u003e\u003c\/span\u003e\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003e\u003cspan style=\"font-size: 0.875rem;\"\u003eעדכון גרסה 1.1: צבעי עץ ואדום שונו לשיש וטורקיז\u003c\/span\u003e\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":47842463744167,"sku":"GP-6CROS","price":13.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/6_piece_cross_marble.png?v=1782067074"},{"product_id":"impossible-dovetail-box","title":"פאזל משמיד הכבידה של ניוטון","description":"\u003cp style=\";text-align: right; direction: rtl;\"\u003eפאזל ניוטון המאתגר את כוח המשיכה, הוא פאזל פשוט עם פתרון מדהים.\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eהמטרה שלכם היא להוציא את הטיל מהבסיס שלו מבלי לגעת בבסיס. עליכם להניח אותו ישר על שולחן ולאחר מכן להוציא את הטיל.\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eאין להשתמש בכלים חיצוניים.\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"381\" data-start=\"360\"\u003e🛡️ תשלום מאובטח\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"405\" data-start=\"385\"\u003e🌍 משלוחים לישראל עם מעקב\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"447\" data-start=\"409\"\u003e✏️ עוצב על ידי ממציאים ברמה עולמית\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"475\" data-start=\"451\"\u003e🔁 החזרות חינם תוך 30 יום\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"475\" data-start=\"451\"\u003e🏅אחריות לכל החיים\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eמה מיוחד בפאזל הזה?\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eמפתח בחשיבה יצירתית\u003cbr\u003e\u003cspan style=\"font-size: 0.875rem;\"\u003eחוויה יוצאת דופן\u003cbr\u003e\u003c\/span\u003e \u003cspan style=\"font-size: 0.875rem;\"\u003eכיף מחוץ למסכים\u003cbr\u003e\u003c\/span\u003e\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003e\u003cspan style=\"font-size: 0.875rem;\"\u003eעדכון גרסה 1.1: צבעי עץ ואדום שונו לשיש וטורקיז\u003c\/span\u003e\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":47889408098471,"sku":"GP-IMPODOVE","price":15.2,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/dovetail_marble.png?v=1782069042"},{"product_id":"3-piece-cross-puzzle","title":"פאזל משמיד הכבידה של ניוטון","description":"\u003cp style=\";text-align: right; direction: rtl;\"\u003eפאזל ניוטון המאתגר את כוח המשיכה, הוא פאזל פשוט עם פתרון מדהים.\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eהמטרה שלכם היא להוציא את הטיל מהבסיס שלו מבלי לגעת בבסיס. עליכם להניח אותו ישר על שולחן ולאחר מכן להוציא את הטיל.\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eאין להשתמש בכלים חיצוניים.\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"381\" data-start=\"360\"\u003e🛡️ תשלום מאובטח\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"405\" data-start=\"385\"\u003e🌍 משלוחים לישראל עם מעקב\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"447\" data-start=\"409\"\u003e✏️ עוצב על ידי ממציאים ברמה עולמית\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"475\" data-start=\"451\"\u003e🔁 החזרות חינם תוך 30 יום\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\" class=\"\" data-end=\"475\" data-start=\"451\"\u003e🏅אחריות לכל החיים\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eמה מיוחד בפאזל הזה?\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003eמפתח בחשיבה יצירתית\u003cbr\u003e\u003cspan style=\"font-size: 0.875rem;\"\u003eחוויה יוצאת דופן\u003cbr\u003e\u003c\/span\u003e \u003cspan style=\"font-size: 0.875rem;\"\u003eכיף מחוץ למסכים\u003cbr\u003e\u003c\/span\u003e\u003c\/p\u003e\n\u003cp style=\";text-align: right; direction: rtl;\"\u003e\u003cspan style=\"font-size: 0.875rem;\"\u003eעדכון גרסה 1.1: צבעי עץ ואדום שונו לשיש וטורקיז\u003c\/span\u003e\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":47889552638119,"sku":"GP-3CROS","price":14.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/3_piece_cross_marble.png?v=1782067350"},{"product_id":"cube-alchemy","title":"קוביית האלכימיה | 180 אתגרים באחד!","description":"\u003cp\u003eבהשראת חידת \"קוביות סומה\" הקלאסית - מוצר זה מגיע עם החוברת הבלעדית שלנו המכילה 180 אתגרים ייחודיים שנבחרו ואצרו על ידי גרג.\u003c\/p\u003e\n\u003cp\u003eשבעה חלקים פשוטים. קובייה אחת בגודל 3X3X3. אתגרים רבים ושונים. רוב האנשים יכולים לפרק אותה בשניות. הרכבתה חזרה היא סיפור שונה לחלוטין.\u003c\/p\u003e\n\u003cp\u003eהמטרה: להרכיב את כל 7 החלקים לקובייה מושלמת בגודל 3X3X3 (אתגר 1\/180)\u003cbr\u003e\u003c\/p\u003e\n\u003cp\u003eעובדה משעשעת - יש 240 פתרונות לאתגר הראשון לבדו!\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eמה מיוחד ב-Cube Alchemy?\u003c\/strong\u003e\u003c\/p\u003e\n\u003cul\u003e\n\n\u003cli\u003eמפתח דמיון מרחבי תלת מימדי\u003c\/li\u003e\n\n\u003cli\u003eכולל חוברת עם 180 אתגרים מועדפים\u003c\/li\u003e\n\n\u003cli\u003eקשיי האתגר יכולים להשתנות!\u003c\/li\u003e\n\n\n\u003c\/ul\u003e\n\u003cdiv class=\"gpca\" data-handle=\"cube-alchemy\"\u003e\n\u003cstyle\u003e\n.gpca{--gpca-fg:rgb(var(--color-foreground,18,18,18));\n --gpca-line:rgba(var(--color-foreground,18,18,18),.18);\n --gpca-muted:rgba(var(--color-foreground,18,18,18),.7);\n --gpca-accent:#02A9F7;--gpca-ink:#0B7FA8;\n font-family:inherit;color:var(--gpca-fg);margin:1.2em 0;max-width:30em}\n.gpca *{box-sizing:border-box}\n.gpca .gpca-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(--gpca-fg)}\n.gpca .gpca-intro{font-size:.92em;line-height:1.5;margin:0 0 .8em;color:var(--gpca-muted);max-width:36em}\n.gpca button{appearance:none;-webkit-appearance:none;margin:0;font-family:inherit;letter-spacing:normal;\n text-transform:none;box-shadow:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent;\n color:var(--gpca-fg);cursor:pointer}\n.gpca .gpca-tabs{display:flex;flex-wrap:wrap;gap:.4em;margin:0 0 .6em}\n.gpca .gpca-tabs button{font-size:.88em;line-height:1.2;min-height:2.6em;padding:.45em 1em;\n border:1px solid var(--gpca-line);border-radius:6px;background:transparent}\n.gpca .gpca-tabs button[aria-pressed=true]{background:var(--gpca-accent);border-color:var(--gpca-accent);\n color:#fff;font-weight:600}\n.gpca .gpca-stage{position:relative;direction:ltr;border:1px solid var(--gpca-line);border-radius:8px;\n overflow:hidden;background:#F1F5F8}\n.gpca .gpca-view{display:block;width:100%;max-width:none;cursor:grab;outline:none;\n \/* asleep, a finger on the view scrolls the page; awake, it turns the view *\/\n touch-action:pan-y;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;\n -webkit-tap-highlight-color:transparent}\n.gpca[data-live] .gpca-view{touch-action:none}\n.gpca .gpca-view:active{cursor:grabbing}\n.gpca .gpca-play{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);\n padding:.55em 1.2em;border:1px solid var(--gpca-line);border-radius:999px;background:rgba(255,255,255,.92);\n box-shadow:0 .1em .6em rgba(0,0,0,.08);font-size:.95em;line-height:1.2;font-weight:600;white-space:nowrap;\n color:var(--gpca-fg);pointer-events:none;opacity:1;transition:opacity .25s}\n.gpca[data-live] .gpca-play{opacity:0}\n.gpca .gpca-stage:focus-within{border-color:var(--gpca-accent)}\n.gpca .gpca-turn{position:absolute;top:.5em;right:.5em;font-size:.8em;line-height:1.2;min-height:2.5em;\n padding:.45em .85em;border:1px solid var(--gpca-line);border-radius:999px;background:rgba(255,255,255,.9)}\n.gpca .gpca-turn:hover{border-color:var(--gpca-accent)}\n.gpca .gpca-say{font-size:.88em;line-height:1.45;color:var(--gpca-muted);min-height:2.9em;margin:.55em 0 0}\n.gpca .gpca-say[data-done]{color:var(--gpca-ink);font-weight:600;font-size:.95em}\n.gpca .gpca-tray{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:.3em;margin:.35em 0 0;\n direction:ltr;border-radius:8px;transition:box-shadow .2s}\n.gpca .gpca-tray[data-nudge]{box-shadow:0 0 0 2px var(--gpca-accent)}\n.gpca .gpca-tile{display:flex;flex-direction:column;align-items:center;min-width:0;padding:.2em 0 .15em;\n border:1px solid var(--gpca-line);border-radius:7px;background:transparent;-webkit-user-select:none;user-select:none}\n.gpca .gpca-tile canvas{display:block;width:100%;max-width:none;pointer-events:none}\n.gpca .gpca-tile span{font-size:.72em;line-height:1.2;color:var(--gpca-muted)}\n.gpca .gpca-tile[aria-pressed=true]{border-color:var(--gpca-accent);background:rgba(2,169,247,.1);\n box-shadow:0 0 0 1px var(--gpca-accent) inset}\n.gpca .gpca-tile[data-in]{opacity:.3}\n.gpca .gpca-ctl{display:flex;flex-wrap:wrap;gap:.4em;margin:.7em 0 0}\n.gpca .gpca-ctl button{flex:1 1 auto;font-size:.85em;line-height:1.2;min-height:2.9em;padding:.55em .8em;\n border:1px solid var(--gpca-line);border-radius:6px;background:transparent}\n.gpca .gpca-ctl button:hover{border-color:var(--gpca-accent)}\n.gpca .gpca-ctl .gpca-go{background:var(--gpca-accent);border-color:var(--gpca-accent);color:#fff;font-weight:600}\n.gpca .gpca-ctl button:disabled{opacity:.38;cursor:default}\n.gpca .gpca-ctl button:disabled:hover{border-color:var(--gpca-line)}\n.gpca .gpca-ctl .gpca-go:disabled:hover{border-color:var(--gpca-accent)}\n.gpca button:focus-visible{outline:2px solid var(--gpca-accent);outline-offset:2px}\n@media (prefers-reduced-motion:reduce){.gpca .gpca-play{transition:none}}\n\u003c\/style\u003e\n\u003c\/div\u003e\n\u003cscript\u003e\n\/* Greg Puzzles Cube Alchemy (.gpca) - build a Soma figure by hand, in 3D.\n   The target shape is drawn as light glass cubes; each placed piece is a solid\n   coloured block. Drag the view to turn it.\n\n   How a piece goes in: pick one of the seven, tap a glass cube, and a ghost of\n   the piece appears covering that cube. Tapping the same cube again (or Turn\n   piece) steps through every other way the piece can cover it that FITS: all\n   of it inside the shape and none of it on a placed piece. Nothing else is\n   used to choose or order them. Place drops it; tapping a placed piece takes\n   it back out.\n\n   The page carries the piece shapes and the target shapes, nothing more: no\n   arrangement that finishes a shape, no search, no counts. A shape is done\n   when every glass cube is covered, checked by that rule alone.\n\n   Written to live inside a Shopify product description:\n   - every DOM node is made with createElement, so no closing tag ever appears\n     inside a JS string (Shopify reparses body_html);\n   - nothing relies on an empty div being visible (the theme hides div:empty);\n   - sizes are in em (the theme root is 10px) and the font is inherited;\n   - taps are tested against the polygons of the last frame actually drawn,\n     never against restated numbers. *\/\n(function () {\n  \"use strict\";\n  if (window.GPCA) return;\n\n  var TXT = {\n    en: {\n      title: \"Build it yourself\",\n      intro: \"Pick a piece below, then tap a glass cube where it should go. Tap the same cube again to try it another way. Drag the view to turn it.\",\n      shape: \"Shape\",\n      shapes: { castle: \"Castle\", sofa: \"Sofa\", tower: \"Tower\" },\n      view: \"3D view of the {shape}. Drag to turn it.\",\n      play: \"Tap to play\",\n      turnView: \"Turn view\", turnPiece: \"Turn piece\", place: \"Place\", undo: \"Undo\", reset: \"Start over\",\n      tray: \"The seven pieces\", piece: \"Piece {k}\",\n      start: \"Pick a piece below, then tap a glass cube.\",\n      pickFirst: \"Pick a piece below first.\",\n      picked: \"Now tap a glass cube where it should go.\",\n      ways: \"Way {i} of {n} that fits here. Tap the cube again, or press Place.\",\n      onlyWay: \"The only way it fits here. Press Place to put it in.\",\n      nofit: \"That piece does not fit over this cube.\",\n      placed: \"In. {k} of 7 placed.\",\n      out: \"Taken out. {k} of 7 placed.\",\n      undone: \"Undone. {k} of 7 placed.\",\n      cleared: \"Cleared. Undo brings the pieces back.\",\n      already: \"Already in. Tap it in the view to take it out.\",\n      done: \"You built the {shape}! Every glass cube is filled.\"\n    },\n    he: {\n      title: \"בנו את זה בעצמכם\",\n      intro: \"בחרו חלק למטה, ואז הקישו על קובייה שקופה במקום שבו הוא צריך להיות. הקישו שוב על אותה קובייה כדי לנסות אותו אחרת. גררו את התצוגה כדי לסובב אותה.\",\n      shape: \"צורה\",\n      shapes: { castle: \"טירה\", sofa: \"ספה\", tower: \"מגדל\" },\n      view: \"תצוגת תלת־ממד של ה{shape}. גררו כדי לסובב.\",\n      play: \"הקישו כדי לשחק\",\n      turnView: \"סובבו את התצוגה\", turnPiece: \"סובבו את החלק\", place: \"הניחו\", undo: \"בטלו\", reset: \"התחילו מחדש\",\n      tray: \"שבעת החלקים\", piece: \"חלק {k}\",\n      start: \"בחרו חלק למטה, ואז הקישו על קובייה שקופה.\",\n      pickFirst: \"בחרו קודם חלק למטה.\",\n      picked: \"עכשיו הקישו על קובייה שקופה במקום שבו הוא צריך להיות.\",\n      ways: \"אפשרות {i} מתוך {n} שנכנסת כאן. הקישו שוב על הקובייה, או הניחו אותו.\",\n      onlyWay: \"רק כך הוא נכנס כאן. הניחו אותו.\",\n      nofit: \"החלק הזה לא נכנס על הקובייה הזו.\",\n      placed: \"בפנים. {k} מתוך 7 הונחו.\",\n      out: \"החלק הוצא. {k} מתוך 7 הונחו.\",\n      undone: \"בוטל. {k} מתוך 7 הונחו.\",\n      cleared: \"נוקה. בטלו כדי להחזיר את החלקים.\",\n      already: \"החלק כבר בפנים. הקישו עליו בתצוגה כדי להוציא אותו.\",\n      done: \"בניתם את ה{shape}! כל הקוביות השקופות מלאות.\"\n    },\n    ja: {\n      title: \"自分で組み立ててみてください\",\n      intro: \"下のピースを選び、置きたい場所のガラスのキューブをタップしてください。同じキューブをもう一度タップすると別の置き方になります。ドラッグすると向きを変えられます。\",\n      shape: \"形\",\n      shapes: { castle: \"城\", sofa: \"ソファ\", tower: \"塔\" },\n      view: \"{shape}の3D表示。ドラッグで回せます。\",\n      play: \"タップして遊ぶ\",\n      turnView: \"視点を回す\", turnPiece: \"ピースを回す\", place: \"置く\", undo: \"元に戻す\", reset: \"最初から\",\n      tray: \"7つのピース\", piece: \"ピース{k}\",\n      start: \"下のピースを選んでから、ガラスのキューブをタップしてください。\",\n      pickFirst: \"先に下のピースを選んでください。\",\n      picked: \"置きたい場所のガラスのキューブをタップしてください。\",\n      ways: \"ここに収まる置き方{n}通りのうち{i}番目。もう一度タップするか、「置く」を押してください。\",\n      onlyWay: \"ここに収まる置き方はこれだけです。「置く」を押してください。\",\n      nofit: \"このピースはこのキューブには収まりません。\",\n      placed: \"置きました。7個中{k}個。\",\n      out: \"取り出しました。7個中{k}個。\",\n      undone: \"元に戻しました。7個中{k}個。\",\n      cleared: \"空にしました。「元に戻す」でピースが戻ります。\",\n      already: \"このピースはもう置いてあります。取り出すには、表示の中でタップしてください。\",\n      done: \"{shape}が完成しました！ガラスのキューブがすべて埋まりました。\"\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\n  \/* ---------- cells ---------- *\/\n  function K(c) { return c[0] + \",\" + c[1] + \",\" + c[2]; }\n  function norm(cs) {\n    var m = [Infinity, Infinity, Infinity];\n    cs.forEach(function (c) { for (var i = 0; i !== 3; i++) if (c[i] \u003c m[i]) m[i] = c[i]; });\n    var out = cs.map(function (c) { return [c[0] - m[0], c[1] - m[1], c[2] - m[2]]; });\n    out.sort(function (a, b) { return a[2] - b[2] || a[1] - b[1] || a[0] - b[0]; });\n    return out;\n  }\n  function setKey(cells) { return cells.map(K).sort().join(\";\"); }\n\n  \/* the 24 turns of a solid block; no mirror images, because nobody can\n     reflect a piece of plastic *\/\n  var ROTS = (function () {\n    function mul(a, b) {\n      var r = [];\n      for (var i = 0; i !== 3; i++) {\n        r.push([]);\n        for (var j = 0; j !== 3; j++) {\n          var s = 0;\n          for (var k = 0; k !== 3; k++) s += a[i][k] * b[k][j];\n          r[i].push(s);\n        }\n      }\n      return r;\n    }\n    var X = [[1, 0, 0], [0, 0, -1], [0, 1, 0]], Y = [[0, 0, 1], [0, 1, 0], [-1, 0, 0]];\n    var seen = {}, out = [], q = [[[1, 0, 0], [0, 1, 0], [0, 0, 1]]];\n    while (q.length) {\n      var m = q.shift(), k = JSON.stringify(m);\n      if (seen[k]) continue;\n      seen[k] = 1; out.push(m);\n      q.push(mul(X, m)); q.push(mul(Y, m));\n    }\n    return out;\n  })();\n  function orientations(cells) {\n    var seen = {}, out = [];\n    ROTS.forEach(function (m) {\n      var o = norm(cells.map(function (c) {\n        return [m[0][0] * c[0] + m[0][1] * c[1] + m[0][2] * c[2],\n                m[1][0] * c[0] + m[1][1] * c[1] + m[1][2] * c[2],\n                m[2][0] * c[0] + m[2][1] * c[1] + m[2][2] * c[2]];\n      }));\n      var k = o.map(K).join(\";\");\n      if (!seen[k]) { seen[k] = 1; out.push(o); }\n    });\n    return out;\n  }\n\n  \/* ---------- drawing: unit cubes, orthographic, painter's order ----------\n     Cubes on a grid never interpenetrate, so drawing whole cubes far to near\n     by the depth of their centres is exact in an orthographic view, and the\n     front faces of one cube never overlap each other. *\/\n  var FACES = [\n    { n: [1, 0, 0],  q: [[1, 0, 0], [1, 1, 0], [1, 1, 1], [1, 0, 1]] },\n    { n: [-1, 0, 0], q: [[0, 0, 0], [0, 0, 1], [0, 1, 1], [0, 1, 0]] },\n    { n: [0, 1, 0],  q: [[0, 1, 0], [0, 1, 1], [1, 1, 1], [1, 1, 0]] },\n    { n: [0, -1, 0], q: [[0, 0, 0], [1, 0, 0], [1, 0, 1], [0, 0, 1]] },\n    { n: [0, 0, 1],  q: [[0, 0, 1], [1, 0, 1], [1, 1, 1], [0, 1, 1]] },\n    { n: [0, 0, -1], q: [[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]] }\n  ];\n  function dot(a, b) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; }\n  \/* yaw turns about the vertical, pitch lifts the eye above the table.\n     R x U = V, so the view is never a mirror image (A and B stay themselves). *\/\n  function cam(yaw, pitch) {\n    var sa = Math.sin(yaw), ca = Math.cos(yaw), sb = Math.sin(pitch), cb = Math.cos(pitch);\n    var R = [ca, sa, 0], U = [-sb * sa, sb * ca, cb], V = [cb * sa, -cb * ca, sb], L = [0, 0, 0];\n    for (var i = 0; i !== 3; i++) L[i] = -0.42 * R[i] + 0.8 * U[i] + 0.45 * V[i];\n    var n = Math.sqrt(dot(L, L));\n    return { R: R, U: U, V: V, L: [L[0] \/ n, L[1] \/ n, L[2] \/ n] };\n  }\n  function hexRGB(hex) {\n    var n = parseInt(hex.slice(1), 16);\n    return [(n \u003e\u003e 16) \u0026 255, (n \u003e\u003e 8) \u0026 255, n \u0026 255];\n  }\n  function rgba(rgb, f, a) {\n    return \"rgba(\" + Math.min(255, Math.round(rgb[0] * f)) + \",\" + Math.min(255, Math.round(rgb[1] * f)) + \",\" +\n      Math.min(255, Math.round(rgb[2] * f)) + \",\" + a + \")\";\n  }\n  function project(C, S, ctr, off) {\n    return function (p) {\n      var q = [p[0] - ctr[0], p[1] - ctr[1], p[2] - ctr[2]];\n      return [off[0] + dot(q, C.R) * S, off[1] - dot(q, C.U) * S];\n    };\n  }\n  \/* items: {c, kind: solid|ghost|glass, show[6], rgb, mark}. Fills in .polys\n     (screen quads actually drawn) and returns the items in drawing order. *\/\n  function paint(ctx, items, C, S, ctr, off) {\n    var P = project(C, S, ctr, off), V = C.V, lw = Math.max(1, S * 0.028);\n    items.forEach(function (it) {\n      it.d = (it.c[0] + 0.5 - ctr[0]) * V[0] + (it.c[1] + 0.5 - ctr[1]) * V[1] + (it.c[2] + 0.5 - ctr[2]) * V[2];\n      it.polys = [];\n    });\n    items.sort(function (a, b) { return a.d - b.d; });\n    ctx.lineJoin = \"round\";\n    items.forEach(function (it) {\n      for (var f = 0; f !== 6; f++) {\n        if (!it.show[f] || dot(FACES[f].n, V) \u003c= 1e-6) continue;\n        var pts = FACES[f].q.map(function (q) { return P([it.c[0] + q[0], it.c[1] + q[1], it.c[2] + q[2]]); });\n        it.polys.push(pts);\n        var lit = 0.62 + 0.38 * Math.max(0, dot(FACES[f].n, C.L));\n        ctx.beginPath();\n        ctx.moveTo(pts[0][0], pts[0][1]);\n        for (var j = 1; j !== 4; j++) ctx.lineTo(pts[j][0], pts[j][1]);\n        ctx.closePath();\n        if (it.kind === \"solid\") {\n          ctx.fillStyle = rgba(it.rgb, lit, 1); ctx.fill();\n          ctx.strokeStyle = \"rgba(0,0,0,.30)\"; ctx.lineWidth = lw * 0.8; ctx.stroke();\n        } else if (it.kind === \"ghost\") {\n          ctx.fillStyle = rgba(it.rgb, lit, Math.min(1, (it.a || 0.75) + (it.mark ? 0.1 : 0))); ctx.fill();\n          ctx.strokeStyle = rgba(it.rgb, 0.45, 1); ctx.lineWidth = lw * 1.5; ctx.stroke();\n        } else {\n          ctx.fillStyle = \"rgba(2,169,247,\" + (0.035 + 0.26 * (1 - lit)).toFixed(3) + \")\"; ctx.fill();\n          ctx.strokeStyle = it.mark ? \"rgba(2,130,200,1)\" : \"rgba(20,96,140,.4)\";\n          ctx.lineWidth = it.mark ? lw * 1.6 : lw * 0.75; ctx.stroke();\n        }\n      }\n    });\n    return items;\n  }\n  function inPoly(p, x, y) {\n    var s = 0;\n    for (var i = 0; i !== p.length; i++) {\n      var a = p[i], b = p[(i + 1) % p.length];\n      var c = (b[0] - a[0]) * (y - a[1]) - (b[1] - a[1]) * (x - a[0]);\n      if (c !== 0) {\n        var sg = c \u003e 0 ? 1 : -1;\n        if (s \u0026\u0026 sg !== s) return false;\n        s = sg;\n      }\n    }\n    return true;\n  }\n  \/* nearest first. Glass is see-through, so a ghost seen through glass still\n     takes the tap; a solid piece stops the search. *\/\n  function hit(list, x, y) {\n    var glass = null;\n    for (var i = list.length - 1; i \u003e= 0; i--) {\n      var it = list[i];\n      for (var j = 0; j !== it.polys.length; j++) {\n        if (!inPoly(it.polys[j], x, y)) continue;\n        if (it.kind === \"ghost\") return it;\n        if (it.kind === \"solid\") return glass || it;\n        if (!glass) glass = it;\n        break;\n      }\n    }\n    return glass;\n  }\n  function extent(cells, C) {\n    var P = project(C, 1, [0, 0, 0], [0, 0]), b = [Infinity, Infinity, -Infinity, -Infinity];\n    cells.forEach(function (c) {\n      for (var i = 0; i !== 8; i++) {\n        var p = P([c[0] + (i \u0026 1), c[1] + ((i \u003e\u003e 1) \u0026 1), c[2] + ((i \u003e\u003e 2) \u0026 1)]);\n        if (p[0] \u003c b[0]) b[0] = p[0]; if (p[1] \u003c b[1]) b[1] = p[1];\n        if (p[0] \u003e b[2]) b[2] = p[0]; if (p[1] \u003e b[3]) b[3] = p[1];\n      }\n    });\n    return b;\n  }\n\n  \/* ---------- the block ---------- *\/\n  function mount(root, cfg) {\n    if (!root || root.getAttribute(\"data-gpca-on\")) return;\n    root.setAttribute(\"data-gpca-on\", \"1\");\n    var lang = langOf(), T = TXT[lang];\n    root.setAttribute(\"dir\", lang === \"he\" ? \"rtl\" : \"ltr\");\n    var reduce = window.matchMedia \u0026\u0026 window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n\n    var PIECES = cfg.pieces.map(function (p) {\n      return { k: p.k, rgb: hexRGB(p.c), cells: norm(p.cells), ors: orientations(p.cells) };\n    });\n    var SHAPES = cfg.shapes.map(function (s) {\n      var cells = norm(s.cells), inS = {}, ext = [0, 0, 0];\n      cells.forEach(function (c) {\n        inS[K(c)] = 1;\n        for (var i = 0; i !== 3; i++) if (c[i] + 1 \u003e ext[i]) ext[i] = c[i] + 1;\n      });\n      return { id: s.id, cells: cells, inS: inS, ctr: [ext[0] \/ 2, ext[1] \/ 2, ext[2] \/ 2],\n               rad: Math.sqrt(ext[0] * ext[0] + ext[1] * ext[1] + ext[2] * ext[2]) \/ 2,\n               at: {}, occ: {}, hist: [], yaw: s.view[0], pitch: s.view[1] };\n    });\n    var cur = 0, sel = -1, anchor = null, opts = [], oi = 0, list = [], W = 0, H = 0;\n    function shp() { return SHAPES[cur]; }\n\n    \/* ----- DOM ----- *\/\n    var title = el(\"h3\", \"gpca-h\", T.title);\n    var intro = el(\"p\", \"gpca-intro\", T.intro);\n    var tabs = el(\"div\", \"gpca-tabs\");\n    tabs.setAttribute(\"role\", \"group\"); tabs.setAttribute(\"aria-label\", T.shape);\n    var tabBtns = SHAPES.map(function (s, i) {\n      var b = el(\"button\", null, T.shapes[s.id] || s.id);\n      b.type = \"button\"; b.setAttribute(\"data-shape\", s.id);\n      b.addEventListener(\"click\", function () { pickShape(i); });\n      tabs.appendChild(b);\n      return b;\n    });\n    var stage = el(\"div\", \"gpca-stage\");\n    var cv = el(\"canvas\", \"gpca-view\");\n    cv.tabIndex = 0; cv.setAttribute(\"role\", \"img\");\n    var turnBtn = el(\"button\", \"gpca-turn\", \"↻ \" + T.turnView);\n    turnBtn.type = \"button\"; turnBtn.setAttribute(\"data-act\", \"view\");\n    \/* until the visitor taps the view (or a piece), a finger on it scrolls the\n       page like anywhere else; this label says how to start *\/\n    var wakeLabel = el(\"span\", \"gpca-play\", T.play);\n    wakeLabel.setAttribute(\"aria-hidden\", \"true\");\n    stage.appendChild(cv); stage.appendChild(wakeLabel); stage.appendChild(turnBtn);\n    var say = el(\"p\", \"gpca-say\", T.start);\n    say.setAttribute(\"aria-live\", \"polite\");\n    var tray = el(\"div\", \"gpca-tray\");\n    tray.setAttribute(\"role\", \"group\"); tray.setAttribute(\"aria-label\", T.tray);\n    var tiles = PIECES.map(function (p, i) {\n      var b = el(\"button\", \"gpca-tile\"), c = el(\"canvas\");\n      b.type = \"button\"; b.setAttribute(\"data-piece\", p.k); b.setAttribute(\"aria-label\", fmt(T.piece, { k: p.k }));\n      b.appendChild(c); b.appendChild(el(\"span\", null, p.k));\n      b.addEventListener(\"click\", function () { wake(); pickPiece(i); });\n      tray.appendChild(b);\n      return { b: b, cv: c };\n    });\n    var ctl = el(\"div\", \"gpca-ctl\");\n    function mk(act, label, cls, fn) {\n      var b = el(\"button\", cls, label);\n      b.type = \"button\"; b.setAttribute(\"data-act\", act);\n      b.addEventListener(\"click\", fn);\n      ctl.appendChild(b);\n      return b;\n    }\n    var bTurn = mk(\"turn\", T.turnPiece, null, function () { turnPiece(); });\n    var bPlace = mk(\"place\", T.place, \"gpca-go\", function () { place(); });\n    var bUndo = mk(\"undo\", T.undo, null, function () { undo(); });\n    var bReset = mk(\"reset\", T.reset, null, function () { reset(); });\n    [title, intro, tabs, stage, say, tray, ctl].forEach(function (n) { root.appendChild(n); });\n\n    \/* ----- rules ----- *\/\n    function fits(cells) {\n      var S = shp();\n      for (var i = 0; i !== cells.length; i++) {\n        var k = K(cells[i]);\n        if (!S.inS[k] || S.occ[k] !== undefined) return false;\n      }\n      return true;\n    }\n    \/* every way piece p can cover cell c and fit; order is plain enumeration\n       (turn, then which of its cubes sits on c), nothing smarter *\/\n    function optionsAt(p, c) {\n      var out = [], seen = {};\n      PIECES[p].ors.forEach(function (o) {\n        o.forEach(function (oc) {\n          var cells = o.map(function (q) { return [q[0] + c[0] - oc[0], q[1] + c[1] - oc[1], q[2] + c[2] - oc[2]]; });\n          if (!fits(cells)) return;\n          var k = setKey(cells);\n          if (seen[k]) return;\n          seen[k] = 1; out.push(cells);\n        });\n      });\n      return out;\n    }\n    function indexOf(cells) {\n      if (!cells) return -1;\n      var k = setKey(cells);\n      for (var i = 0; i !== opts.length; i++) if (setKey(opts[i]) === k) return i;\n      return -1;\n    }\n    function count() { return Object.keys(shp().at).length; }\n    function complete() { var S = shp(); return Object.keys(S.occ).length === S.cells.length; }\n    function put(p, cells) {\n      var S = shp();\n      S.at[p] = cells;\n      cells.forEach(function (c) { S.occ[K(c)] = p; });\n    }\n    function lift(p) {\n      var S = shp(), cells = S.at[p];\n      cells.forEach(function (c) { delete S.occ[K(c)]; });\n      delete S.at[p];\n      return cells;\n    }\n    function tell(text, isDone) {\n      say.textContent = text;\n      if (isDone) say.setAttribute(\"data-done\", \"1\"); else say.removeAttribute(\"data-done\");\n    }\n    function tellWays() {\n      tell(opts.length === 1 ? T.onlyWay : fmt(T.ways, { i: oi + 1, n: opts.length }));\n    }\n    function tellCount(key) {\n      if (complete()) tell(fmt(T.done, { shape: T.shapes[shp().id] || shp().id }), true);\n      else tell(fmt(T[key], { k: count() }));\n    }\n    function clearGhost() { anchor = null; opts = []; oi = 0; }\n    \/* after anything changes underneath a ghost, keep it if it still fits *\/\n    function refresh() {\n      if (sel \u003e= 0 \u0026\u0026 shp().at[sel]) sel = -1;\n      if (!anchor) return;\n      if (shp().occ[anchor.k] !== undefined) { clearGhost(); return; }\n      if (sel \u003c 0) { opts = []; oi = 0; return; }\n      var was = opts[oi];\n      opts = optionsAt(sel, anchor.c);\n      var j = indexOf(was);\n      oi = j \u003e= 0 ? j : 0;\n    }\n    function aim(c, from) {\n      anchor = { k: K(c), c: c };\n      if (sel \u003c 0) { opts = []; oi = 0; tell(T.pickFirst); nudge(); return; }\n      opts = optionsAt(sel, c);\n      if (!opts.length) { oi = 0; tell(T.nofit); return; }\n      var j = indexOf(from);\n      oi = j \u003e= 0 ? (j + 1) % opts.length : 0;\n      tellWays();\n    }\n    function tapGlass(c) { aim(c, null); sync(); }\n    function tapGhost(c) {\n      if (anchor \u0026\u0026 K(c) === anchor.k) {\n        if (opts.length \u003e 1) oi = (oi + 1) % opts.length;\n        tellWays();\n      } else aim(c, opts[oi]);\n      sync();\n    }\n    function turnPiece() {\n      if (!opts.length) return;\n      oi = (oi + 1) % opts.length;\n      tellWays(); sync();\n    }\n    function place() {\n      if (sel \u003c 0 || !opts.length) return;\n      var cells = opts[oi];\n      if (!fits(cells)) return;               \/* cannot happen: ghosts only ever fit *\/\n      put(sel, cells);\n      shp().hist.push({ t: \"put\", p: sel, cells: cells });\n      sel = -1; clearGhost();\n      tellCount(\"placed\"); sync();\n    }\n    function takeOut(p) {\n      var cells = lift(p);\n      shp().hist.push({ t: \"take\", p: p, cells: cells });\n      refresh(); tellCount(\"out\"); sync();\n    }\n    function undo() {\n      var S = shp(), h = S.hist.pop();\n      if (!h) return;\n      if (h.t === \"put\") lift(h.p);\n      else if (h.t === \"take\") put(h.p, h.cells);\n      else Object.keys(h.at).forEach(function (p) { put(+p, h.at[p]); });\n      refresh(); tellCount(\"undone\"); sync();\n    }\n    function reset() {\n      var S = shp();\n      if (count()) {\n        S.hist.push({ t: \"clear\", at: S.at });\n        S.at = {}; S.occ = {};\n        tell(T.cleared);\n      } else tell(T.start);\n      sel = -1; clearGhost(); sync();\n    }\n    function pickPiece(i) {\n      if (shp().at[i]) { tell(T.already); return; }\n      if (sel === i) { sel = -1; opts = []; oi = 0; tell(T.start); sync(); return; }\n      sel = i;\n      if (anchor) aim(anchor.c, null); else tell(T.picked);\n      sync();\n    }\n    function pickShape(i) {\n      if (i === cur) return;\n      stopSpin(); cur = i; sel = -1; clearGhost();\n      if (complete()) tellCount(\"placed\"); else tell(T.start);\n      sync();\n    }\n    var nudgeT = 0;\n    function nudge() {\n      tray.setAttribute(\"data-nudge\", \"1\");\n      clearTimeout(nudgeT);\n      nudgeT = setTimeout(function () { tray.removeAttribute(\"data-nudge\"); }, 900);\n    }\n\n    \/* ----- view ----- *\/\n    function scene() {\n      var S = shp(), gh = {}, out = [];\n      if (opts.length) opts[oi].forEach(function (c) { gh[K(c)] = 1; });\n      S.cells.forEach(function (c) {\n        var k = K(c), solid = S.occ[k] !== undefined, kind = solid ? \"solid\" : (gh[k] ? \"ghost\" : \"glass\");\n        var show = FACES.map(function (F) {\n          var nk = K([c[0] + F.n[0], c[1] + F.n[1], c[2] + F.n[2]]);\n          if (kind === \"solid\") return S.occ[nk] === undefined;\n          if (kind === \"ghost\") return S.occ[nk] === undefined \u0026\u0026 !gh[nk];\n          return !S.inS[nk];                  \/* glass: only where the shape ends *\/\n        });\n        var p = solid ? S.occ[k] : (kind === \"ghost\" ? sel : -1);\n        out.push({ c: c, k: k, kind: kind, show: show, piece: p, rgb: p \u003e= 0 ? PIECES[p].rgb : null,\n                   mark: !!anchor \u0026\u0026 anchor.k === k, a: ghostA });\n      });\n      return out;\n    }\n    function size(c, ratio) {\n      var w = c.clientWidth || 300, h = Math.round(w * ratio), dpr = window.devicePixelRatio || 1;\n      c.style.height = h + \"px\";\n      if (c.width !== Math.round(w * dpr) || c.height !== Math.round(h * dpr)) {\n        c.width = Math.round(w * dpr); c.height = Math.round(h * dpr);\n      }\n      var ctx = c.getContext(\"2d\");\n      ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n      ctx.clearRect(0, 0, w, h);\n      return { ctx: ctx, w: w, h: h };\n    }\n    function render() {\n      var g = size(cv, 0.9), S = shp();\n      W = g.w; H = g.h;\n      var scale = Math.min(W, H) \/ (2 * S.rad + 0.5);\n      list = paint(g.ctx, scene(), cam(S.yaw, S.pitch), scale, S.ctr, [W \/ 2, H \/ 2]);\n    }\n    var raf = 0;\n    function draw() {\n      if (raf) return;\n      raf = requestAnimationFrame(function () { raf = 0; render(); });\n    }\n    \/* the ghost breathes, so it never reads as a piece already put in *\/\n    var ghostA = 0.75, pulse = 0, seen = true;\n    function breathe(now) {\n      pulse = 0;\n      if (!opts.length || reduce) { ghostA = 0.75; return; }\n      ghostA = 0.72 + 0.14 * Math.sin(now \/ 260);\n      if (seen) render();\n      pulse = requestAnimationFrame(breathe);\n    }\n    if (window.IntersectionObserver)\n      new IntersectionObserver(function (es) { seen = es[es.length - 1].isIntersecting; }).observe(cv);\n    var TILE_CAM = cam(0.62, 0.6);\n    function drawTiles() {\n      var fit = Infinity, boxes = PIECES.map(function (p) {\n        var b = extent(p.cells, TILE_CAM);\n        return b;\n      });\n      tiles.forEach(function (t, i) {\n        var g = size(t.cv, 1), b = boxes[i];\n        fit = Math.min(fit, (g.w - 8) \/ Math.max(b[2] - b[0], 2.6), (g.h - 8) \/ Math.max(b[3] - b[1], 2.6));\n      });\n      tiles.forEach(function (t, i) {\n        var g = size(t.cv, 1), p = PIECES[i], b = boxes[i], own = {};\n        p.cells.forEach(function (c) { own[K(c)] = 1; });\n        var items = p.cells.map(function (c) {\n          return { c: c, kind: \"solid\", rgb: p.rgb, show: FACES.map(function (F) {\n            return !own[K([c[0] + F.n[0], c[1] + F.n[1], c[2] + F.n[2]])];\n          }) };\n        });\n        var off = [g.w \/ 2 - (b[0] + b[2]) \/ 2 * fit, g.h \/ 2 - (b[1] + b[3]) \/ 2 * fit];\n        paint(g.ctx, items, TILE_CAM, fit, [0, 0, 0], off);\n      });\n    }\n    function sync() {\n      var S = shp();\n      tabBtns.forEach(function (b, i) { b.setAttribute(\"aria-pressed\", i === cur ? \"true\" : \"false\"); });\n      tiles.forEach(function (t, i) {\n        t.b.setAttribute(\"aria-pressed\", i === sel ? \"true\" : \"false\");\n        if (S.at[i]) t.b.setAttribute(\"data-in\", \"1\"); else t.b.removeAttribute(\"data-in\");\n      });\n      bTurn.disabled = opts.length \u003c 2;\n      bPlace.disabled = !opts.length;\n      bUndo.disabled = !S.hist.length;\n      bReset.disabled = !count() \u0026\u0026 sel \u003c 0 \u0026\u0026 !anchor;\n      cv.setAttribute(\"aria-label\", fmt(T.view, { shape: T.shapes[S.id] || S.id }));\n      if (complete()) root.setAttribute(\"data-done\", S.id); else root.removeAttribute(\"data-done\");\n      if (opts.length \u0026\u0026 !pulse \u0026\u0026 !reduce) pulse = requestAnimationFrame(breathe);\n      draw();\n    }\n\n    \/* ----- turning ----- *\/\n    var spin = 0;\n    function stopSpin() { if (spin) cancelAnimationFrame(spin); spin = 0; }\n    function turnView() {\n      var S = shp(), from = S.yaw, to = from - Math.PI \/ 2, t0 = null;\n      stopSpin();\n      if (reduce) { S.yaw = to; draw(); return; }\n      function step(now) {\n        if (t0 === null) t0 = now;\n        var u = Math.min(1, (now - t0) \/ 380);\n        u = u \u003c 0.5 ? 2 * u * u : 1 - Math.pow(-2 * u + 2, 2) \/ 2;\n        S.yaw = from + (to - from) * u;\n        render();\n        spin = u \u003c 1 ? requestAnimationFrame(step) : 0;\n      }\n      spin = requestAnimationFrame(step);\n    }\n    turnBtn.addEventListener(\"click\", turnView);\n\n    function tapAt(x, y) {\n      render();                               \/* test against exactly what is on screen *\/\n      var r = cv.getBoundingClientRect(), it = hit(list, x - r.left - cv.clientLeft, y - r.top - cv.clientTop);\n      if (!it) return;\n      if (it.kind === \"solid\") takeOut(it.piece);\n      else if (it.kind === \"ghost\") tapGhost(it.c);\n      else tapGlass(it.c);\n    }\n    \/* Asleep, the view leaves a finger to the page (touch-action pan-y, nothing\n       prevented), so a visitor scrolling past is never caught. A tap wakes it and\n       only wakes it; from then on a finger turns it (touch-action none). Once the\n       block has left the screen entirely it falls asleep again. A mouse never\n       fights the page, so it can drag at once; its first click or drag wakes it. *\/\n    var live = false, drag = null;\n    function wake() {\n      if (live) return;\n      live = true; root.setAttribute(\"data-live\", \"1\");\n    }\n    function sleep() {\n      if (!live) return;\n      live = false; drag = null; root.removeAttribute(\"data-live\");\n    }\n    if (window.IntersectionObserver)\n      new IntersectionObserver(function (es) { if (!es[es.length - 1].isIntersecting) sleep(); }).observe(root);\n    else window.addEventListener(\"scroll\", function () {\n      var r = root.getBoundingClientRect();\n      if (r.bottom \u003c= 0 || r.top \u003e= window.innerHeight) sleep();\n    }, { passive: true });\n    cv.addEventListener(\"pointerdown\", function (e) {\n      var mouse = e.pointerType === \"mouse\";\n      if (drag || (mouse \u0026\u0026 e.button !== 0)) return;\n      drag = { id: e.pointerId, x: e.clientX, y: e.clientY, yaw: shp().yaw, pitch: shp().pitch, moved: false,\n               waking: !live, mouse: mouse };\n      if (!live \u0026\u0026 !mouse) return;            \/* asleep: the page may scroll on this finger *\/\n      try { cv.setPointerCapture(e.pointerId); } catch (err) { \/* old browsers *\/ }\n      e.preventDefault();\n    });\n    cv.addEventListener(\"pointermove\", function (e) {\n      if (!drag || e.pointerId !== drag.id) return;\n      var dx = e.clientX - drag.x, dy = e.clientY - drag.y;\n      if (!drag.moved \u0026\u0026 dx * dx + dy * dy \u003c 64) return;\n      drag.moved = true;\n      if (drag.waking \u0026\u0026 !drag.mouse) return; \/* a finger passing over a sleeping view *\/\n      wake(); stopSpin();\n      var S = shp();\n      S.yaw = drag.yaw - dx * 0.011;\n      S.pitch = Math.max(-0.5, Math.min(1.45, drag.pitch + dy * 0.011));\n      draw();\n    });\n    function release(e) {\n      if (!drag || e.pointerId !== drag.id) return;\n      var d = drag;\n      drag = null;\n      if (e.type !== \"pointerup\" || d.moved) return;\n      if (d.waking) wake();                   \/* the waking tap does nothing else *\/\n      else tapAt(e.clientX, e.clientY);\n    }\n    cv.addEventListener(\"pointerup\", release);\n    cv.addEventListener(\"pointercancel\", release);\n    \/* awake, a finger on the view turns it and never scrolls the page *\/\n    cv.addEventListener(\"touchmove\", function (e) { if (live) e.preventDefault(); }, { passive: false });\n    cv.addEventListener(\"keydown\", function (e) {\n      var S = shp(), k = e.key;\n      if (k === \"ArrowLeft\") S.yaw += 0.2;\n      else if (k === \"ArrowRight\") S.yaw -= 0.2;\n      else if (k === \"ArrowUp\") S.pitch = Math.max(-0.5, S.pitch - 0.15);\n      else if (k === \"ArrowDown\") S.pitch = Math.min(1.45, S.pitch + 0.15);\n      else if (k === \"Enter\") { wake(); place(); e.preventDefault(); return; }\n      else return;\n      e.preventDefault(); wake(); stopSpin(); draw();\n    });\n\n    \/* redraw only when the width changes: the canvases set their own heights,\n       which must not feed back into the observer *\/\n    var lastW = -1;\n    function onResize() {\n      var w = root.clientWidth;\n      if (w === lastW) return;\n      lastW = w;\n      requestAnimationFrame(function () { drawTiles(); render(); });\n    }\n    if (window.ResizeObserver) new ResizeObserver(onResize).observe(root);\n    else window.addEventListener(\"resize\", onResize);\n\n        function area(p) {\n      var s = 0;\n      for (var i = 0; i !== p.length; i++) { var a = p[i], b = p[(i + 1) % p.length]; s += a[0] * b[1] - b[0] * a[1]; }\n      return Math.abs(s) \/ 2;\n    }\n\n    sync(); drawTiles(); render();\n  }\n\n  window.GPCA = { mount: mount };\n})();\n(function(){var C={\"v\":1,\"pieces\":[{\"k\":\"V\",\"c\":\"#E8833A\",\"cells\":[[0,0,0],[1,0,0],[0,1,0]]},{\"k\":\"L\",\"c\":\"#02A9F7\",\"cells\":[[0,0,0],[1,0,0],[2,0,0],[0,1,0]]},{\"k\":\"T\",\"c\":\"#3BAA6E\",\"cells\":[[0,0,0],[1,0,0],[2,0,0],[1,1,0]]},{\"k\":\"Z\",\"c\":\"#D9465B\",\"cells\":[[0,0,0],[1,0,0],[1,1,0],[2,1,0]]},{\"k\":\"A\",\"c\":\"#8A63D2\",\"cells\":[[0,0,0],[1,0,0],[0,1,0],[1,0,1]]},{\"k\":\"B\",\"c\":\"#E8C33A\",\"cells\":[[0,0,0],[1,0,0],[0,1,0],[0,1,1]]},{\"k\":\"P\",\"c\":\"#2BB3A6\",\"cells\":[[0,0,0],[1,0,0],[0,1,0],[0,0,1]]}],\"shapes\":[{\"id\":\"castle\",\"cells\":[[0,0,0],[1,0,0],[2,0,0],[3,0,0],[0,1,0],[1,1,0],[2,1,0],[3,1,0],[0,0,1],[1,0,1],[2,0,1],[3,0,1],[0,1,1],[1,1,1],[2,1,1],[3,1,1],[0,0,2],[1,0,2],[2,0,2],[3,0,2],[0,1,2],[1,1,2],[2,1,2],[3,1,2],[0,0,3],[3,0,3],[0,1,3]],\"view\":[0.55,0.5]},{\"id\":\"sofa\",\"cells\":[[0,0,0],[1,0,0],[2,0,0],[3,0,0],[4,0,0],[0,1,0],[1,1,0],[2,1,0],[3,1,0],[4,1,0],[0,0,1],[1,0,1],[2,0,1],[3,0,1],[4,0,1],[0,1,1],[1,1,1],[2,1,1],[3,1,1],[4,1,1],[0,0,2],[1,0,2],[2,0,2],[3,0,2],[4,0,2],[0,1,2],[4,1,2]],\"view\":[2.5916,0.52]},{\"id\":\"tower\",\"cells\":[[0,0,0],[1,0,0],[0,1,0],[1,1,0],[0,0,1],[1,0,1],[0,1,1],[1,1,1],[0,0,2],[1,0,2],[0,1,2],[1,1,2],[0,0,3],[1,0,3],[0,1,3],[1,1,3],[0,0,4],[1,0,4],[0,1,4],[1,1,4],[0,0,5],[1,0,5],[0,1,5],[1,1,5],[0,0,6],[1,0,6],[0,1,6]],\"view\":[0.6,0.36]}]};var s=document.currentScript,r=s\u0026\u0026s.previousElementSibling;if(!r||(\" \"+r.className+\" \").indexOf(\" gpca \")===-1)r=document.querySelector(\".gpca:not([data-gpca-on])\");function go(){if(r\u0026\u0026window.GPCA\u0026\u0026!r.hasAttribute(\"data-gpca-on\"))window.GPCA.mount(r,C);}if(r\u0026\u0026window.IntersectionObserver){var io=new IntersectionObserver(function(es){for(var i=0;i!==es.length;i++)if(es[i].isIntersecting){io.disconnect();go();return;}},{rootMargin:\"600px 0px\"});io.observe(r);}else go();})();\n\u003c\/script\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":50034802294951,"sku":"GP-CUBEALCH","price":17.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/cube_alchemy_marble.png?v=1782222961"},{"product_id":"loach-bed","title":"Loach Bed | Pack 3 Pieces in Box","description":"\u003cp\u003eThis brand-new Osanori puzzle is one of the most elegant, brilliant packing puzzles I've ever seen in my life.\u003c\/p\u003e\n\u003cp\u003eGoal: fit all three pieces inside the box so nothing sticks out.\u003c\/p\u003e\n\u003cp\u003eShips disassembled.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eWhy Loach Bed is my favorite Osanori to start with:\u003c\/strong\u003e it uses only one hole, a small MINIMA-style box, two identical pieces and one bigger piece. It's the perfect difficulty for someone enjoying their first Osanori puzzle.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eWhat's special about Loach Bed?\u003c\/strong\u003e\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003eThe best Osanori puzzle for beginners, in my opinion\u003c\/li\u003e\n\u003cli\u003eSmall MINIMA-style box - great desk footprint\u003c\/li\u003e\n\u003cli\u003eDevelops spatial imagination through a single hole\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003eDesigned by \u003ca href=\"\/he\/collections\/osanori-yamamoto\"\u003eOsanori Yamamoto\u003c\/a\u003e\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":50973123149991,"sku":"GP-LOACBED","price":24.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/loach_bed_marble.png?v=1783947884"},{"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=\"\/he\/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":"conga-line","title":"Conga Line | 6-Piece Packing Puzzle","description":"\u003cp\u003eSix unusually shaped turquoise pieces. One marble-white frame. This innocent-looking puzzle may be tricky to figure out!\u003c\/p\u003e\n\u003cp\u003eGoal: pack all the blue pieces into the frame so nothing sticks out.\u003c\/p\u003e\n\u003cp\u003eThird puzzle from the rising designer \u003ca href=\"\/he\/collections\/samuel-cook\"\u003eSamuel Cook\u003c\/a\u003e following Jigsaw Traffic and Turbulence. \u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eWhat's special about Conga Line?\u003c\/strong\u003e\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003eDevelops advanced spatial imagination\u003c\/li\u003e\n\u003cli\u003eDeceptively tricky piece interactions\u003c\/li\u003e\n\u003cli\u003eSatisfying and clean when solved\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003eDesigned by Samuel Cook\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":51109616156839,"sku":"GP-CONGLINE","price":24.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/conga_line_marble.png?v=1786011102"},{"product_id":"snake-cube-puzzle","title":"Snake Cube Puzzle | Fold It Back Into a Cube","description":"\u003ch2\u003eSnake Cube Puzzle - Quick Summary\u003c\/h2\u003e\n\u003cp\u003eThe Snake Cube Puzzle is a 3D-printed puzzle built from 27 cubes linked by an elastic cord into one continuous piece. You unfold the chain freely in seconds. Getting it back into a perfect 3x3x3 cube is the real challenge. Medium difficulty, 30-60 min solve time. Ships assembled.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eOne of the best gifts in the shop.\u003c\/strong\u003e Best for: gift buyers shopping for a colleague, a teenager, or a parent, and first-time solvers picking up their first mechanical puzzle.\u003c\/p\u003e\n\u003ch2\u003eWhat Makes It Tricky\u003c\/h2\u003e\n\u003cp\u003eThere is one correct solution hidden inside the sequence of cube orientations - and finding it is harder than it sounds. The elastic cord holds all 27 cubes together so nothing gets lost. But that same cord means every wrong fold compounds on itself. Undo one cube and you may need to unravel five more before you can correct course.\u003c\/p\u003e\n\u003cp\u003eThe puzzle does not forgive half-measures. You either have it or you do not. That moment when the final piece locks into place - the satisfying snap that tells you the cube is whole again - is the payoff for every failed attempt before it.\u003c\/p\u003e\n\u003ch2\u003ePuzzle Specs\u003c\/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\n\u003cstrong\u003ePieces:\u003c\/strong\u003e 1 (27 linked cubes)\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eDifficulty:\u003c\/strong\u003e Medium\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eSolve Time:\u003c\/strong\u003e 30-60 min\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eTrains:\u003c\/strong\u003e Spatial Thinking\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eShips:\u003c\/strong\u003e Assembled\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003ch2\u003eFrequently Asked Questions\u003c\/h2\u003e\n\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWhat is a snake cube puzzle?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eA snake cube puzzle is a chain of 27 linked cubes connected by an elastic cord that runs through each piece. The goal is to fold that chain back into a solid 3x3x3 cube - with only one correct sequence of folds that gets you there.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eHow hard is the Snake Cube Puzzle?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eMedium difficulty. Most solvers can expect to spend 30-60 minutes working through the correct fold sequence before the cube comes together.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWho is the Snake Cube Puzzle best for?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eIt is one of the best gifts in the shop - recognisable enough that anyone picks it up, hard enough that it holds them. It also works well as a desk object between solves, compact enough to sit out and satisfying enough to pick up whenever you have a few minutes.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\n\u003cdiv class=\"gpsc\" id=\"gpscRoot\" data-runs=\"[3, 2, 2, 3, 2, 3, 2, 2, 3, 3, 2, 2, 2, 3, 3, 3, 3]\" data-hint=\"0\"\u003e\n\u003ch3\u003eFold the Snake Cube\u003c\/h3\u003e\n\u003cp class=\"gpsc-sub\"\u003eThis is the chain in the photographs, on screen. The opening is placed for you, which only chooses which way up the cube sits; after that every bend is yours.\u003c\/p\u003e\n\u003cdiv class=\"gpsc-bar\"\u003e\n\u003cbutton type=\"button\" data-act=\"undo\"\u003eUndo\u003c\/button\u003e\u003cbutton type=\"button\" data-act=\"turn\"\u003eTurn\u003c\/button\u003e\u003cbutton type=\"button\" data-act=\"reset\"\u003eStart over\u003c\/button\u003e\n\u003c\/div\u003e\n\u003csvg id=\"gpscBoard\" class=\"gpsc-board\" viewbox=\"-110 -105 220 230\"\u003e\u003c\/svg\u003e\u003cp class=\"gpsc-chaincap\"\u003eThe chain laid out flat, the way you would put the real one on a table. Each number is how many cubes are in that straight run, and a dot marks the cube the chain bends at. Filled cubes are the ones you have placed.\u003c\/p\u003e\n\u003csvg id=\"gpscChain\" class=\"gpsc-chain\" viewbox=\"0 0 270 29\"\u003e\u003c\/svg\u003e\u003cp class=\"gpsc-chainlab\" id=\"gpscChainLab\"\u003e\u003c\/p\u003e\n\u003cdiv class=\"gpsc-score\"\u003e\n\u003cdiv\u003e\n\u003cb id=\"gpscDone\"\u003e0\u003c\/b\u003e\u003cspan\u003eof 27 cubes placed\u003c\/span\u003e\n\u003c\/div\u003e\n\u003cdiv\u003e\n\u003cb id=\"gpscBends\"\u003e0\u003c\/b\u003e\u003cspan\u003ebends to go\u003c\/span\u003e\n\u003c\/div\u003e\n\u003c\/div\u003e\n\u003cp class=\"gpsc-say\" id=\"gpscSay\"\u003e\u003c\/p\u003e\n\u003cp class=\"gpsc-foot\"\u003eThe same puzzle in 3D printed plastic is on this page, and there are more to play on the \u003ca href=\"https:\/\/gregpuzzles.com\/pages\/games\"\u003egames\u003c\/a\u003e page.\u003c\/p\u003e\n\u003cstyle\u003e\n\/* em, never rem: this theme sets the root font to 10px. *\/\n.gpsc{--a:#02A9F7;--marble:#F4F3EF;\n --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),.62);\n font-family:inherit;border:1px solid var(--line);border-radius:14px;\n padding:1.1em 1.2em 1em;margin:2em 0;background:var(--marble);color:var(--fg)}\n.gpsc *{box-sizing:border-box;font-family:inherit}\n.gpsc h3{margin:0 0 .2em;font-size:1.25em;line-height:1.25;font-weight:600}\n.gpsc .gpsc-sub{margin:0 0 .9em;color:var(--muted);font-size:.95em;line-height:1.55}\n.gpsc .gpsc-bar{display:flex;flex-wrap:wrap;gap:.4em;align-items:center;margin-bottom:.8em}\n.gpsc button{font:inherit;font-size:.95em;color:var(--fg);background:#fff;\n border:1px solid var(--line);border-radius:8px;padding:.3em .7em;cursor:pointer;line-height:1.3}\n.gpsc button:hover:not(:disabled){border-color:var(--a)}\n.gpsc button:disabled{opacity:.45;cursor:default}\n.gpsc button:focus-visible{outline:2px solid var(--a);outline-offset:2px}\n.gpsc .gpsc-board{background:#fff;border:1px solid var(--line);border-radius:10px;\n touch-action:manipulation;width:100%;max-width:330px;margin:0 auto;display:block}\n.gpsc .gpsc-board .gh{cursor:pointer}\n.gpsc .gpsc-board .gh:hover polygon{fill:#02A9F7;fill-opacity:.55}\n\/* The strip gets the whole block width, not the board's. Capped to the board\n   it rendered at about 12px a cube and the run numbers were unreadable. *\/\n.gpsc .gpsc-chain{width:100%;margin:1em auto .1em;display:block}\n.gpsc .gpsc-chaincap{margin:1.1em 0 0;color:var(--muted);font-size:.86em;line-height:1.45}\n.gpsc .gpsc-chainlab{margin:.3em 0 0;color:var(--muted);font-size:.9em;line-height:1.45}\n.gpsc .gpsc-chainlab b{color:var(--a)}\n.gpsc .gpsc-score{display:flex;gap:1.6em;margin:.9em 0 .2em;flex-wrap:wrap}\n.gpsc .gpsc-score div{display:flex;flex-direction:column;line-height:1.2}\n.gpsc .gpsc-score b{font-size:1.3em;font-weight:600;font-variant-numeric:tabular-nums}\n.gpsc .gpsc-score span{color:var(--muted);font-size:.85em}\n.gpsc .gpsc-say{min-height:1.6em;margin:.5em 0 0;font-size:.98em;line-height:1.5}\n.gpsc .gpsc-say b{color:var(--a)}\n.gpsc .gpsc-own{margin:.7em 0 0;font-size:.92em;line-height:1.5;color:var(--muted)}\n.gpsc .gpsc-own summary{cursor:pointer;color:var(--a)}\n.gpsc .gpsc-own input{font:inherit;font-size:.95em;width:100%;max-width:26em;margin:.5em .4em .4em 0;\n padding:.35em .5em;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--fg)}\n.gpsc .gpsc-foot{margin:.8em 0 0;font-size:.95em;line-height:1.6;color:var(--muted)}\n.gpsc .gpsc-foot a{color:var(--a)}\n@media(max-width:480px){.gpsc{padding:.9em .85em}\/* The strip gets the whole block width, not the board's. Capped to the board\n   it rendered at about 12px a cube and the run numbers were unreadable. *\/\n.gpsc .gpsc-chain{width:100%;margin:1em auto .1em;display:block}\n.gpsc .gpsc-chaincap{margin:1.1em 0 0;color:var(--muted);font-size:.86em;line-height:1.45}\n.gpsc .gpsc-chainlab{margin:.3em 0 0;color:var(--muted);font-size:.9em;line-height:1.45}\n.gpsc .gpsc-chainlab b{color:var(--a)}\n.gpsc .gpsc-score{gap:1.1em}}\n\u003c\/style\u003e\n\u003cscript\u003e\n(function(){\n  var root = document.getElementById('gpscRoot');\n  if(!root || root.dataset.ready) return;\n  root.dataset.ready = '1';\n\n  var N = 3, CELLS = 27;\n  var DIRS = [[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]];\n  var runs = JSON.parse(root.dataset.runs);\n  var allowHint = root.dataset.hint === '1';\n\n  var path, runAt, dir, view, solution, say;\n  var elBoard, elChain, elChainLab, elDone, elBends, elSay;\n\n  function key(p){ return p[0]+','+p[1]+','+p[2]; }\n  function inside(p){ return p[0]\u003e=0\u0026\u0026p[0]\u003cN\u0026\u0026p[1]\u003e=0\u0026\u0026p[1]\u003cN\u0026\u0026p[2]\u003e=0\u0026\u0026p[2]\u003cN; }\n  function perp(d){\n    var o=[]; for(var i=0;i\u003cDIRS.length;i++){\n      var e=DIRS[i]; if(e[0]*d[0]+e[1]*d[1]+e[2]*d[2]===0) o.push(e);\n    } return o;\n  }\n  function cubeCount(r){ var s=0; for(var i=0;i\u003cr.length;i++) s+=r[i]; return s-(r.length-1); }\n\n  \/* Lay run ri going d from pos, with the bend cube already down.\n     Returns a completed path or null. Same search the board uses for hints. *\/\n  function search(occ, pathSoFar, ri, pos, d){\n    if(ri === runs.length) return pathSoFar.slice();\n    var need = runs[ri]-1, added = [], p = pos, i, q;\n    for(i=0;i\u003cneed;i++){\n      p = [p[0]+d[0], p[1]+d[1], p[2]+d[2]];\n      if(!inside(p) || occ[key(p)]){\n        for(q=0;q\u003cadded.length;q++){ delete occ[key(added[q])]; pathSoFar.pop(); }\n        return null;\n      }\n      occ[key(p)] = 1; pathSoFar.push(p); added.push(p);\n    }\n    var opts = perp(d);\n    for(i=0;i\u003copts.length;i++){\n      var r = search(occ, pathSoFar, ri+1, p, opts[i]);\n      if(r) return r;\n    }\n    for(q=0;q\u003cadded.length;q++){ delete occ[key(added[q])]; pathSoFar.pop(); }\n    return null;\n  }\n\n  function solveFrom(pathSoFar, ri, d){\n    var occ = {}, i;\n    for(i=0;i\u003cpathSoFar.length;i++) occ[key(pathSoFar[i])] = 1;\n    var work = pathSoFar.slice();\n    var opts = (d === null) ? DIRS : perp(d);\n    for(i=0;i\u003copts.length;i++){\n      var r = search(occ, work, ri, pathSoFar[pathSoFar.length-1], opts[i]);\n      if(r) return {path:r, first:opts[i]};\n    }\n    return null;\n  }\n\n  function openingFor(r){\n    \/* Take the opening from a real solution so the board always starts legally. *\/\n    var occ, x, y, z, i, j;\n    for(x=0;x\u003cN;x++) for(y=0;y\u003cN;y++) for(z=0;z\u003cN;z++){\n      for(i=0;i\u003cDIRS.length;i++){\n        occ = {}; occ[key([x,y,z])] = 1;\n        var res = search(occ, [[x,y,z]], 0, [x,y,z], DIRS[i]);\n        if(res) return {start:[x,y,z], dir:DIRS[i], solution:res};\n      }\n    }\n    return null;\n  }\n\n  function isCorner(p){\n    return (p[0]===0||p[0]===N-1)\u0026\u0026(p[1]===0||p[1]===N-1)\u0026\u0026(p[2]===0||p[2]===N-1);\n  }\n\n  function reset(){\n    var open = openingFor(runs);\n    if(!open){\n      path=[]; runAt=0; dir=null; solution=null;\n      tell('That chain cannot be folded into a 3 by 3 cube.');\n      draw(); return;\n    }\n    solution = open.solution;\n    path = solution.slice(0, runs[0]);\n    runAt = 1;\n    dir = open.dir;\n    tell(isCorner(open.start)\n      ? 'The first three cubes are placed. That only chooses which way up the cube sits. Now tap a ghost to bend.'\n      : 'The opening is placed to get you going. Tap a ghost cube to bend.');\n    draw();\n  }\n\n  function tell(h){ say = h; if(elSay) elSay.innerHTML = h; }\n\n  function legalMoves(){\n    if(runAt \u003e= runs.length) return [];\n    var occ = {}, i;\n    for(i=0;i\u003cpath.length;i++) occ[key(path[i])] = 1;\n    var head = path[path.length-1], out = [], opts = perp(dir);\n    for(i=0;i\u003copts.length;i++){\n      var d = opts[i], need = runs[runAt]-1, p = head, cells = [], ok = true;\n      for(var k=0;k\u003cneed;k++){\n        p = [p[0]+d[0], p[1]+d[1], p[2]+d[2]];\n        if(!inside(p) || occ[key(p)]){ ok = false; break; }\n        cells.push(p);\n      }\n      if(ok) out.push({dir:d, cells:cells});\n    }\n    return out;\n  }\n\n  \/* ---- isometric drawing ---- *\/\n  function rot(p){\n    var x=p[0], y=p[1], z=p[2], t;\n    for(var i=0;i\u003cview;i++){ t=x; x=y; y=N-1-t; }\n    return [x,y,z];\n  }\n  \/* True isometric: 30 degrees, z straight up. Fit is computed from the box's\n     own projected bounds rather than guessed, so the drawing fills the frame. *\/\n  var S = 34;\n  function proj(x,y,z){\n    return [(x-y)*0.866*S, (x+y)*0.5*S - z*S];\n  }\n  function viewBox(){\n    var xs=[], ys=[], x, y, z;\n    for(x=0;x\u003c=N;x++) for(y=0;y\u003c=N;y++) for(z=0;z\u003c=N;z++){\n      var p = proj(x,y,z); xs.push(p[0]); ys.push(p[1]);\n    }\n    var pad = 10;\n    var x0 = Math.min.apply(null,xs)-pad, x1 = Math.max.apply(null,xs)+pad;\n    var y0 = Math.min.apply(null,ys)-pad, y1 = Math.max.apply(null,ys)+pad;\n    return [x0, y0, x1-x0, y1-y0].map(function(v){ return Math.round(v*10)\/10; }).join(' ');\n  }\n  function faces(c){\n    var x=c[0], y=c[1], z=c[2];\n    var P=function(a,b,d){ return proj(a,b,d).join(','); };\n    return [\n      [P(x,y,z+1),P(x+1,y,z+1),P(x+1,y+1,z+1),P(x,y+1,z+1)],   \/* top *\/\n      [P(x+1,y,z),P(x+1,y+1,z),P(x+1,y+1,z+1),P(x+1,y,z+1)],   \/* +x  *\/\n      [P(x,y+1,z),P(x+1,y+1,z),P(x+1,y+1,z+1),P(x,y+1,z+1)]    \/* +y  *\/\n    ];\n  }\n  function cubeSvg(c, fills, cls, extra){\n    var f = faces(c), s = '', cls2 = cls;\n    s += '\u003cg'+(cls?' class=\"'+cls+'\"':'')+(extra||'')+'\u003e';\n    for(var i=0;i\u003c3;i++){\n      s += '\u003cpolygon points=\"'+f[i].join(' ')+'\" fill=\"'+fills[i]+'\" stroke=\"'+\n           (cls === 'gh' ? 'rgba(2,169,247,.75)\" stroke-dasharray=\"3 2' : 'rgba(0,0,0,.22)')+\n           '\" stroke-width=\"0.9\" stroke-linejoin=\"round\"\/\u003e';\n    }\n    s += '\u003c\/g\u003e';\n    return s;\n  }\n  var SHADE = {\n    \/* two shades for the two parities: the alternating pattern of the box *\/\n    even: ['#7FD8FC','#17A5E8','#0C83BC'],\n    odd:  ['#CFEFFB','#8ED4F2','#64B6DC'],\n    ghost:['rgba(2,169,247,.20)','rgba(2,169,247,.16)','rgba(2,169,247,.12)']\n  };\n\n  \/* The whole chain, laid out flat the way you would lay the real one on a\n     table: 27 cubes, every bend marked, every straight run labelled with its\n     length. Without it a player can see neither the numbers nor what is\n     coming, which the board alone cannot show. *\/\n  function drawChain(){\n    var CW = 10, Y = 15, H = 11, i, j;\n    var w = CELLS*CW, s = ['\u003csvg id=\"gpscChain\" class=\"gpsc-chain\" viewBox=\"-2 0 '+(w+4)+\n      ' 29\" role=\"img\" aria-label=\"The chain, flat, with each straight run labelled\"\u003e'];\n    \/* which cube index ends each run: those are the bends *\/\n    var ends = {}, starts = [], idx = 0;\n    for(i=0;i\u003cruns.length;i++){\n      starts.push(idx);\n      idx = idx + runs[i] - 1;\n      if(i \u003c runs.length-1) ends[idx] = 1;\n    }\n    for(i=0;i\u003cCELLS;i++){\n      var placed = i \u003c path.length;\n      var fill = '#fff', stroke = 'rgba(0,0,0,.22)', sw = '0.8';\n      if(placed){\n        var c = path[i], par = (c[0]+c[1]+c[2]) % 2;\n        fill = par ? SHADE.odd[0] : SHADE.even[1];\n      }\n      if(i === path.length-1){ stroke = '#02A9F7'; sw = '1.8'; }\n      s.push('\u003crect x=\"'+(i*CW+0.8)+'\" y=\"'+Y+'\" width=\"'+(CW-1.6)+'\" height=\"'+H+\n             '\" rx=\"1.6\" fill=\"'+fill+'\" stroke=\"'+stroke+'\" stroke-width=\"'+sw+'\"\/\u003e');\n      if(ends[i]){\n        \/* a bend happens AT this cube: mark it *\/\n        s.push('\u003ccircle cx=\"'+(i*CW+CW\/2)+'\" cy=\"'+(Y+H\/2)+'\" r=\"1.7\" fill=\"'+\n               (placed ? 'rgba(0,0,0,.45)' : 'rgba(0,0,0,.3)')+'\"\/\u003e');\n      }\n    }\n    for(i=0;i\u003cruns.length;i++){\n      var a = starts[i], b = a + runs[i] - 1, mid = (a+b)\/2*CW + CW\/2;\n      var done = (b \u003c path.length);\n      var current = (i === runAt);\n      s.push('\u003ctext x=\"'+mid+'\" y=\"10.5\" text-anchor=\"middle\" font-size=\"9\" '+\n             'font-weight=\"'+(current?'700':'400')+'\" fill=\"'+\n             (current ? '#02A9F7' : (done ? 'rgba(0,0,0,.34)' : 'rgba(0,0,0,.62)'))+\n             '\"\u003e'+runs[i]+'\u003c\/text\u003e');\n    }\n    s.push('\u003c\/svg\u003e');\n    elChain.outerHTML = s.join('');\n    elChain = document.getElementById('gpscChain');\n    if(elChainLab){\n      elChainLab.innerHTML = (runAt \u003c runs.length)\n        ? ('Next: a run of \u003cb\u003e'+runs[runAt]+'\u003c\/b\u003e, then a bend.')\n        : 'Every run is placed.';\n    }\n  }\n\n  function draw(){\n    var items = [], i;\n    for(i=0;i\u003cpath.length;i++){\n      var r = rot(path[i]);\n      items.push({d:r[0]+r[1]+r[2], c:r, kind:'solid', idx:i});\n    }\n    var moves = legalMoves();\n    for(i=0;i\u003cmoves.length;i++){\n      for(var k=0;k\u003cmoves[i].cells.length;k++){\n        var g = rot(moves[i].cells[k]);\n        items.push({d:g[0]+g[1]+g[2], c:g, kind:'ghost', move:i});\n      }\n    }\n    \/* Solids in depth order, then ghosts on top. Depth-sorting the ghosts in\n       with the solids hides any bend that goes behind what is already built,\n       and a hidden ghost cannot be tapped, so the move becomes unreachable.\n       They are translucent and dashed, so reading them as \"possible next\"\n       rather than as solid geometry still works. *\/\n    items.sort(function(a,b){\n      if(a.kind !== b.kind) return a.kind === 'ghost' ? 1 : -1;\n      return a.d - b.d;\n    });\n    var s = ['\u003csvg id=\"gpscBoard\" class=\"gpsc-board\" viewBox=\"'+viewBox()+'\" role=\"img\"'+\n             ' aria-label=\"Snake cube board\"\u003e'];\n    \/* the box it has to fit inside *\/\n    s.push('\u003cg stroke=\"rgba(0,0,0,.18)\" stroke-width=\"1\" fill=\"none\"\u003e');\n    var E = [[[0,0,0],[N,0,0]],[[0,0,0],[0,N,0]],[[0,0,0],[0,0,N]],\n             [[N,0,0],[N,N,0]],[[N,0,0],[N,0,N]],[[0,N,0],[N,N,0]],[[0,N,0],[0,N,N]],\n             [[0,0,N],[N,0,N]],[[0,0,N],[0,N,N]],[[N,N,0],[N,N,N]],[[N,0,N],[N,N,N]],\n             [[0,N,N],[N,N,N]]];\n    for(i=0;i\u003cE.length;i++){\n      var a = proj(E[i][0][0],E[i][0][1],E[i][0][2]), b = proj(E[i][1][0],E[i][1][1],E[i][1][2]);\n      s.push('\u003cline x1=\"'+a[0]+'\" y1=\"'+a[1]+'\" x2=\"'+b[0]+'\" y2=\"'+b[1]+'\"\/\u003e');\n    }\n    s.push('\u003c\/g\u003e');\n    for(i=0;i\u003citems.length;i++){\n      var it = items[i];\n      if(it.kind === 'solid'){\n        var par = (path[it.idx][0]+path[it.idx][1]+path[it.idx][2]) % 2;\n        s.push(cubeSvg(it.c, par ? SHADE.odd : SHADE.even, null, ''));\n      } else {\n        s.push(cubeSvg(it.c, SHADE.ghost, 'gh', ' data-move=\"'+it.move+'\"'));\n      }\n    }\n    s.push('\u003c\/svg\u003e');\n    elBoard.outerHTML = s.join('');\n    elBoard = document.getElementById('gpscBoard');\n    elDone.textContent = path.length;\n    elBends.textContent = Math.max(0, runs.length - runAt);\n    drawChain();\n    elBoard.addEventListener('click', onBoard);\n    if(elSay) elSay.innerHTML = say;\n  }\n\n  function onBoard(e){\n    var g = e.target.closest('g.gh');\n    if(!g) return;\n    play(+g.dataset.move);\n  }\n\n  function play(mi){\n    var moves = legalMoves();\n    if(mi \u003c 0 || mi \u003e= moves.length) return;\n    var m = moves[mi], i;\n    for(i=0;i\u003cm.cells.length;i++) path.push(m.cells[i]);\n    dir = m.dir; runAt++;\n    if(path.length === CELLS){\n      tell('\u003cb\u003eSolved.\u003c\/b\u003e All 27 cubes are in the box, and the colours alternate '+\n           'right through it. That checker pattern is the first thing to watch '+\n           'on the real one.');\n    } else if(legalMoves().length === 0){\n      tell('Stuck: no legal bend from here. Undo and try the other way.');\n    } else {\n      tell('');\n    }\n    draw();\n  }\n\n  function undo(){\n    if(runAt \u003c= 1) return;\n    runAt--;\n    path = path.slice(0, path.length - (runs[runAt]-1));\n    \/* recover the heading from the last two cubes *\/\n    var a = path[path.length-2], b = path[path.length-1];\n    dir = [b[0]-a[0], b[1]-a[1], b[2]-a[2]];\n    tell('');\n    draw();\n  }\n\n  function hint(){\n    var res = solveFrom(path, runAt, dir);\n    if(!res){ tell('No bend from here can finish it. Undo a move or two.'); draw(); return; }\n    var moves = legalMoves();\n    for(var i=0;i\u003cmoves.length;i++){\n      var d = moves[i].dir;\n      if(d[0]===res.first[0] \u0026\u0026 d[1]===res.first[1] \u0026\u0026 d[2]===res.first[2]){\n        play(i);\n        \/* play() has already said something better if that finished it *\/\n        if(path.length \u003c CELLS){\n          tell('\u003cb\u003eThat bend keeps a solution alive.\u003c\/b\u003e The method matters more '+\n               'than the move: keep the chain off its own path, and build the '+\n               'layer you can see.');\n          draw();\n        }\n        return;\n      }\n    }\n  }\n\n  function setRuns(r){\n    runs = r;\n    root.dataset.runs = JSON.stringify(r);\n    reset();\n  }\n\n  root.addEventListener('click', function(e){\n    var b = e.target.closest('button[data-act]');\n    if(!b) return;\n    var a = b.dataset.act;\n    if(a === 'undo') undo();\n    else if(a === 'reset') reset();\n    else if(a === 'turn'){ view = (view+1) % 4; draw(); }\n    else if(a === 'hint') hint();\n    else if(a === 'own'){\n      var raw = root.querySelector('[data-own]').value;\n      var parts = raw.split(\/[^0-9]+\/).filter(function(x){ return x.length; }).map(Number);\n      if(!parts.length){ tell('Type the run lengths, like 3 3 2 3 3 2.'); draw(); return; }\n      for(var i=0;i\u003cparts.length;i++){\n        if(parts[i] \u003c 2){ tell('Every straight run is at least 2 cubes.'); draw(); return; }\n      }\n      if(cubeCount(parts) !== CELLS){\n        tell('That comes to '+cubeCount(parts)+' cubes. A 3 by 3 snake cube has 27.');\n        draw(); return;\n      }\n      setRuns(parts);\n    }\n  });\n\n  elBoard = document.getElementById('gpscBoard');\n  elChain = document.getElementById('gpscChain');\n  elChainLab = document.getElementById('gpscChainLab');\n  elDone = document.getElementById('gpscDone');\n  elBends = document.getElementById('gpscBends');\n  elSay = document.getElementById('gpscSay');\n  view = 0;\n  reset();\n})();\n\u003c\/script\u003e\n\u003c\/div\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":51109725765799,"sku":"GP-SNAKCUBE","price":18.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/snake_cube___fold_it_back_into_a_cube_marble.png?v=1786012063"},{"product_id":"turbulence-4-piece-packing-puzzle","title":"Turbulence | 4-Piece Packing Puzzle","description":"\u003cp\u003eSecond puzzle by \u003ca href=\"\/he\/collections\/samuel-cook\"\u003eSamuel Cook\u003c\/a\u003e. Minimal, clean and elegant.  \u003c\/p\u003e\n\u003cp\u003eGoal: pack all 4 blue pieces flat inside the frame so nothing sticks out.\u003c\/p\u003e\n\u003cp\u003eSamuel's sequel to Jigsaw Traffic uses 4 pieces and a sneaky square frame yet again. This time, the pieces are geometric shapes. How would they interact with each other? That is the question! \u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eWhat's special about Turbulence?\u003c\/strong\u003e\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003eDeceptively simple - hard in practice\u003c\/li\u003e\n\u003cli\u003eDevelops 2D spatial reasoning and logic\u003c\/li\u003e\n\u003cli\u003eCompact and satisfying to solve\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003eDesigned by Samuel Cook\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":51109743100071,"sku":"GP-TURB","price":22.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/turbulence___4-piece_packing_puzzle_marble.png?v=1786012228"},{"product_id":"fish-tank-3-piece-packing-puzzle","title":"Fish Tank | 3-Piece Packing Puzzle","description":"\u003ch2\u003eQuick Summary\u003c\/h2\u003e\u003cp\u003eFish Tank is a 3-piece packing puzzle designed by Goh Pit Khiam. Pack two fish and a staircase flat inside a square frame so nothing sticks out. Medium difficulty, 3 pieces plus frame, 30-60 min solve time.\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eBest for:\u003c\/strong\u003e solvers who like small, clean packing puzzles, and gift buyers who want a compact puzzle that still puts up a fight.\u003c\/p\u003e\n\u003cp\u003eTwo fish and a staircase, one square tank. Three pieces, and they still will not go in.\u003c\/p\u003e\n\u003cp\u003eGoal: pack all 3 pieces flat inside the frame so nothing sticks out.\u003c\/p\u003e\n\u003cp\u003eWith only three pieces there is nowhere to hide. Every wrong attempt is obvious, which is exactly what makes finding the right one feel so good.\u003c\/p\u003e\n\u003cp\u003eIf three pieces are not enough, \u003ca href=\"\/he\/products\/wild-west-4-piece-packing-puzzle\"\u003eWild West\u003c\/a\u003e is the same idea with four: four simple shapes, one square frame, and a fourth piece that ruins everything.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eWhat's special about Fish Tank?\u003c\/strong\u003e\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003eOnly 3 pieces and still a real challenge\u003c\/li\u003e\n\u003cli\u003eDevelops 2D spatial reasoning\u003c\/li\u003e\n\u003cli\u003ePlayful shapes, serious puzzle\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003eDesigned by \u003ca href=\"\/he\/collections\/goh-pit-khiam\"\u003eGoh Pit Khiam\u003c\/a\u003e\u003c\/p\u003e\n\u003cdiv class=\"gptr\" data-handle=\"fish-tank-3-piece-packing-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   Two modes, chosen by the config:\n   - \"place\": pieces come from a rack and go anywhere inside the tray grid.\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\";\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      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    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 (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 = (cw - W) \/ 2, offY = (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 pieceNode(p, cells, 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      g.setAttribute(\"data-cells\", cells.map(function (c) { return c[0] + \",\" + c[1]; }).join(\" \"));\n      if (opts.sel) g.setAttribute(\"data-sel\", \"1\");\n      var d = piecePath(cells);\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 cells[p.hole]) {\n        var hc = cells[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 drag \u0026\u0026 drag.live \u0026\u0026 drag.p === p) return;   \/* lifted: the ghost shows it *\/\n        pieceG.appendChild(pieceNode(p, cellsOf(p), { sel: sel === p }));\n      });\n      if (!SLIDE \u0026\u0026 drag \u0026\u0026 drag.live \u0026\u0026 !drag.off) {\n        pieceG.appendChild(pieceNode(drag.p, drag.cells, { 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, { 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    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      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); 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 (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) {\n      if (!sel) { render(); return; }\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 grab = nearestCell(p.shape, [cell[0] - p.at[0], cell[1] - p.at[1]]);\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        return;\n      }\n      tap = { x: ev.clientX, y: ev.clientY, pid: ev.pointerId, cell: cell };\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);\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      });\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 {\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\":\"place\",\"grid\":[5,5],\"rim\":0.3,\"pieces\":[{\"cells\":[[0,1],[1,0],[1,1],[1,2],[2,1],[2,2]],\"hole\":[3,0.2327]},{\"cells\":[[0,1],[1,0],[1,1],[1,2],[2,1],[2,2]],\"hole\":[3,0.2327]},{\"cells\":[[0,0],[0,1],[1,1],[1,2],[2,2],[2,3]]}],\"cavity\":[5.0133,5.0133]};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":51325795827879,"sku":"GP-FISHTANK","price":15.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/fish_tank_marble.png?v=1789059479"},{"product_id":"wild-west-4-piece-packing-puzzle","title":"Wild West | 4-Piece Packing Puzzle","description":"\u003cp\u003eFour blocky pieces and a square frame. It looks like it should fall together on the first try.\u003c\/p\u003e\n\u003cp\u003eGoal: pack all 4 pieces flat inside the frame so nothing sticks out.\u003c\/p\u003e\n\u003cp\u003eThe shapes are chunky and simple, so three of them go in almost immediately. The fourth is where the puzzle actually starts, and fitting it means going back and undoing the three you were happy with.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eWhat's special about Wild West?\u003c\/strong\u003e\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003eSimple shapes, stubborn solution\u003c\/li\u003e\n\u003cli\u003eDevelops 2D spatial reasoning and planning\u003c\/li\u003e\n\u003cli\u003eCompact and clean when solved\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003eDesigned by \u003ca href=\"\/he\/collections\/goh-pit-khiam\"\u003eGoh Pit Khiam\u003c\/a\u003e\u003c\/p\u003e\n\u003cdiv class=\"gptr\" data-handle=\"wild-west-4-piece-packing-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   Two modes, chosen by the config:\n   - \"place\": pieces come from a rack and go anywhere inside the tray grid.\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\";\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      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    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 (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 = (cw - W) \/ 2, offY = (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 pieceNode(p, cells, 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      g.setAttribute(\"data-cells\", cells.map(function (c) { return c[0] + \",\" + c[1]; }).join(\" \"));\n      if (opts.sel) g.setAttribute(\"data-sel\", \"1\");\n      var d = piecePath(cells);\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 cells[p.hole]) {\n        var hc = cells[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 drag \u0026\u0026 drag.live \u0026\u0026 drag.p === p) return;   \/* lifted: the ghost shows it *\/\n        pieceG.appendChild(pieceNode(p, cellsOf(p), { sel: sel === p }));\n      });\n      if (!SLIDE \u0026\u0026 drag \u0026\u0026 drag.live \u0026\u0026 !drag.off) {\n        pieceG.appendChild(pieceNode(drag.p, drag.cells, { 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, { 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    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      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); 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 (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) {\n      if (!sel) { render(); return; }\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 grab = nearestCell(p.shape, [cell[0] - p.at[0], cell[1] - p.at[1]]);\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        return;\n      }\n      tap = { x: ev.clientX, y: ev.clientY, pid: ev.pointerId, cell: cell };\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);\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      });\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 {\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\":\"place\",\"grid\":[5,5],\"rim\":0.3,\"pieces\":[{\"cells\":[[0,0],[0,1],[1,1],[1,2],[2,2]]},{\"cells\":[[0,0],[0,1],[1,1],[1,2],[2,2]]},{\"cells\":[[0,0],[0,1],[1,1],[1,2]]},{\"cells\":[[0,3],[1,0],[1,1],[1,2],[1,3],[2,3]]}],\"cavity\":[5.01,5.01]};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":51325796450471,"sku":"GP-WILDWEST","price":15.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/wild_west_marble.png?v=1789059488"},{"product_id":"trivial-3-piece-packing-puzzle","title":"Trivial Puzzle | 3-Piece Packing Puzzle","description":"\u003cp\u003eTrivial Puzzle, but is it really? Three pieces, one tray, nothing hidden, and it still stops people.\u003c\/p\u003e\n\u003cp\u003eGoal: pack all 3 pieces flat inside the frame so nothing sticks out.\u003c\/p\u003e\n\u003cp\u003eGoh Pit Khiam is known for designs where the setup looks obvious and the solution is anything but. You can see every piece and every corner of the tray from the first second. That is what makes it uncomfortable.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eWhat's special about Trivial?\u003c\/strong\u003e\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003eNothing is hidden and it still gets you\u003c\/li\u003e\n\u003cli\u003eDevelops 2D spatial reasoning\u003c\/li\u003e\n\u003cli\u003eA quiet, absorbing desk challenge\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003eDesigned by \u003ca href=\"\/he\/collections\/goh-pit-khiam\"\u003eGoh Pit Khiam\u003c\/a\u003e\u003c\/p\u003e\n\u003cdiv class=\"gptr\" data-handle=\"trivial-3-piece-packing-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   Two modes, chosen by the config:\n   - \"place\": pieces come from a rack and go anywhere inside the tray grid.\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\";\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      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    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 (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 = (cw - W) \/ 2, offY = (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 pieceNode(p, cells, 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      g.setAttribute(\"data-cells\", cells.map(function (c) { return c[0] + \",\" + c[1]; }).join(\" \"));\n      if (opts.sel) g.setAttribute(\"data-sel\", \"1\");\n      var d = piecePath(cells);\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 cells[p.hole]) {\n        var hc = cells[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 drag \u0026\u0026 drag.live \u0026\u0026 drag.p === p) return;   \/* lifted: the ghost shows it *\/\n        pieceG.appendChild(pieceNode(p, cellsOf(p), { sel: sel === p }));\n      });\n      if (!SLIDE \u0026\u0026 drag \u0026\u0026 drag.live \u0026\u0026 !drag.off) {\n        pieceG.appendChild(pieceNode(drag.p, drag.cells, { 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, { 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    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      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); 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 (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) {\n      if (!sel) { render(); return; }\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 grab = nearestCell(p.shape, [cell[0] - p.at[0], cell[1] - p.at[1]]);\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        return;\n      }\n      tap = { x: ev.clientX, y: ev.clientY, pid: ev.pointerId, cell: cell };\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);\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      });\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 {\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\":\"place\",\"grid\":[6,6],\"rim\":0.3,\"pieces\":[{\"cells\":[[0,3],[0,4],[1,0],[1,1],[1,2],[1,3],[2,3]]},{\"cells\":[[0,3],[0,4],[1,0],[1,1],[1,2],[1,3],[2,3]]},{\"cells\":[[0,3],[0,4],[1,0],[1,1],[1,2],[1,3],[2,3]]}],\"cavity\":[6.01,6.01]};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":51325796909223,"sku":"GP-TRIV","price":16.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/trivial_marble.png?v=1789059498"},{"product_id":"slidely-trivial-3-piece-packing-puzzle","title":"Slidely Trivial | 3-Piece Packing Puzzle","description":"\u003ch2\u003eQuick Summary\u003c\/h2\u003e\u003cp\u003eSlidely Trivial is a 3-piece packing puzzle designed by Goh Pit Khiam. Pack all 3 pieces into the tray, but every piece has to go in flat through the opening and slide into place, so the order matters as much as the fit. Medium difficulty, 3 pieces plus tray, 30-60 min solve time.\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eBest for:\u003c\/strong\u003e packing puzzle fans who already solved Trivial and want the same tray with a harder rule, and gift buyers looking for a small puzzle with a twist.\u003c\/p\u003e\u003cp\u003e\u003ca href=\"\/he\/products\/trivial-3-piece-packing-puzzle\"\u003eTrivial\u003c\/a\u003e's sibling, with one restriction that changes everything: pieces can only go into the tray flat, through the opening.\u003c\/p\u003e\n\u003cp\u003eGoal: pack all 3 pieces inside the tray.\u003c\/p\u003e\n\u003cp\u003eYou cannot drop a piece straight into its spot or tilt it in. Every piece enters flat through the opening and has to travel from there, so the puzzle is as much about the order you go in as it is about where each shape ends up. \u003ca href=\"\/he\/collections\/goh-pit-khiam\"\u003eGoh Pit Khiam\u003c\/a\u003e is known for exactly this kind of sliding-move design.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eWhat's special about Slidely Trivial?\u003c\/strong\u003e\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003eOne restriction turns a simple pack into a sliding challenge\u003c\/li\u003e\n\u003cli\u003eDevelops planning and 2D spatial reasoning\u003c\/li\u003e\n\u003cli\u003eLightweight and travel-friendly\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003eDesigned by Goh Pit Khiam\u003c\/p\u003e\n\u003cdiv class=\"gptr\" data-handle=\"slidely-trivial-3-piece-packing-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   Two modes, chosen by the config:\n   - \"place\": pieces come from a rack and go anywhere inside the tray grid.\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\";\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      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    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 (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 = (cw - W) \/ 2, offY = (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 pieceNode(p, cells, 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      g.setAttribute(\"data-cells\", cells.map(function (c) { return c[0] + \",\" + c[1]; }).join(\" \"));\n      if (opts.sel) g.setAttribute(\"data-sel\", \"1\");\n      var d = piecePath(cells);\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 cells[p.hole]) {\n        var hc = cells[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 drag \u0026\u0026 drag.live \u0026\u0026 drag.p === p) return;   \/* lifted: the ghost shows it *\/\n        pieceG.appendChild(pieceNode(p, cellsOf(p), { sel: sel === p }));\n      });\n      if (!SLIDE \u0026\u0026 drag \u0026\u0026 drag.live \u0026\u0026 !drag.off) {\n        pieceG.appendChild(pieceNode(drag.p, drag.cells, { 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, { 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    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      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); 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 (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) {\n      if (!sel) { render(); return; }\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 grab = nearestCell(p.shape, [cell[0] - p.at[0], cell[1] - p.at[1]]);\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        return;\n      }\n      tap = { x: ev.clientX, y: ev.clientY, pid: ev.pointerId, cell: cell };\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);\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      });\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 {\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\":\"slide\",\"grid\":[4,4],\"rim\":0.473,\"pieces\":[{\"cells\":[[0,0],[0,1],[1,1],[1,2]]},{\"cells\":[[0,0],[0,1],[1,1],[1,2]]},{\"cells\":[[0,0],[0,1],[1,1],[1,2]]}],\"opening\":{\"cols\":[1,2],\"from\":1.0,\"to\":3.013,\"wall\":0.473},\"zone\":{\"top\":-5,\"left\":-2,\"right\":5},\"start\":[[-3,-2],[-3,3],[-5,-2]],\"cavity\":[4.0133,4.0337]};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":51325797531815,"sku":"GP-SLIDTRIV","price":13.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/slidely_trivial_marble.png?v=1789059508"},{"product_id":"multi-grain-burr","title":"Multi-Grain Burr | 4-Piece Geometric Puzzle","description":"\u003ch2\u003eMulti-Grain Burr - Quick Summary\u003c\/h2\u003e\n\u003cp\u003eThe Multi-Grain Burr is a four-piece geometric assembly puzzle designed by \u003ca href=\"\/he\/collections\/stewart-coffin\"\u003eStewart Coffin\u003c\/a\u003e. Four pieces come together into a very peculiar shape. Despite the name it is not a burr - there are no notched sticks and nothing interlocks. The difficulty is purely geometric: working out how four solids occupy one space. The next level of the \u003ca href=\"https:\/\/gregpuzzles.com\/products\/three-piece-block-puzzle\"\u003eThree Piece Block puzzle.\u003c\/a\u003e\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eBest for:\u003c\/strong\u003e People with highly developed spatial perception.\u003c\/p\u003e\n\u003ch2\u003eAbout the Designer\u003c\/h2\u003e\n\u003cp\u003eStewart Coffin is one of the most respected names in mechanical puzzle design. His work is known for geometric elegance rather than brute complexity - puzzles that look like they should come apart easily and then decline to.\u003c\/p\u003e\n\u003ch2\u003eFrequently Asked Questions\u003c\/h2\u003e\n\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eHow hard is the Multi-Grain Burr?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eHard. Most solvers spend one to four hours on it. If you have solved a standard six-piece burr, expect this one to take longer despite having fewer pieces - and expect the burr method to be no help, because this is a different kind of problem.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eIs the Multi-Grain Burr actually a burr?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eNo. The name comes from the design, not the mechanism. A burr is built from notched sticks that interlock along three axes. This is four solid pieces assembling into a geometric shape, which is why the usual burr techniques do not apply.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWho designed the Multi-Grain Burr?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eStewart Coffin, a designer whose mechanical puzzles are widely collected for their geometric precision.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":51347709427879,"sku":"GP-MULTGRAI","price":19.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/multi-grain_burr_marble.png?v=1789665707"},{"product_id":"extreme-torture","title":"Extreme Torture | 69-Move Board Burr","description":"\u003cp\u003eTo be frank, I highly doubt anyone will ever solve our version of this puzzle without outside help.\u003c\/p\u003e\n\u003cp\u003eThat is not a sales line. The version most people have met came assembled in a box with a solution booklet. Ours arrives as six loose boards and nothing else.\u003c\/p\u003e\n\u003ch2\u003eExtreme Torture - Quick Summary\u003c\/h2\u003e\n\u003cp\u003eExtreme Torture is a six-piece separated board burr designed by Frans de Vreugd in 2002. It takes 69 moves to take apart - burr level 28-21-9-8-3 - the hardest form found in de Vreugd's research. Expert difficulty, 4+ hour solve time. Ships disassembled. It is the same design ThinkFun later mass-produced as Gordian's Knot.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eBest for:\u003c\/strong\u003e solvers who have finished the hard puzzles in their collection and want something that will genuinely beat them for a while, and collectors who measure a puzzle by how long it held out.\u003c\/p\u003e\n\u003ch2\u003e69 Moves\u003c\/h2\u003e\n\u003cp\u003eDe Vreugd did not design this by hand. He fed separated board burrs into \u003cstrong\u003eBurrgrower\u003c\/strong\u003e, a program written to raise the level of a puzzle - first drafted by Dic Sonneveld and rewritten in C++ by \u003ca href=\"\/he\/collections\/goh-pit-khiam\"\u003eGoh Pit-Khiam\u003c\/a\u003e, whose own packing puzzles we carry. Extreme Torture is what came back.\u003c\/p\u003e\u003cp\u003eThe level notation reads 28-21-9-8-3: twenty-eight moves just to free the first board, then twenty-one more for the second, then nine, then eight, then three.\u003c\/p\u003e\n\u003cp\u003eNothing about it yields early. You can make twenty correct moves and have nothing visible to show for it.\u003c\/p\u003e\u003ch2\u003eThe Scale of the Search\u003c\/h2\u003e\u003cp\u003eDe Vreugd published the numbers himself. He narrowed the design space to \u003cstrong\u003eeleven\u003c\/strong\u003e usable board shapes, which give \u003cstrong\u003e8,008\u003c\/strong\u003e possible six-piece sets. Those sets can be fitted together in \u003cstrong\u003e1,364,932\u003c\/strong\u003e ways.\u003c\/p\u003e\u003cp\u003eOnly \u003cstrong\u003e2,394\u003c\/strong\u003e of those can be taken apart again - \u003cstrong\u003e0.18%\u003c\/strong\u003e.\u003c\/p\u003e\u003cp\u003eThat is the context this puzzle sits in. Almost everything that looks like a solved board burr is a dead end, and Extreme Torture is the hardest thing that survived the search.\u003c\/p\u003e\n\u003ch2\u003eWhere the Design Came From\u003c\/h2\u003e\n\u003cp\u003eIt started with a suggestion. Jim Gooch told de Vreugd that you could take a standard six board burr and pull the two boards in each pair one unit apart. De Vreugd wrote a search to find piece sets that would still assemble. \u003ca href=\"\/he\/products\/zigzag\"\u003eZigZag\u003c\/a\u003e came out first, then \u003ca href=\"\/he\/products\/torture\"\u003eTorture\u003c\/a\u003e at level 17.4, and then he made one last push with the software. Extreme Torture is the end of that road.\u003c\/p\u003e\n\u003ch2\u003eSold for Years as Gordian's Knot\u003c\/h2\u003e\n\u003cp\u003eThis design went into commercial production in 2002 under the name Gordian's Knot, made by ThinkFun, now part of Ravensburger. That is where most people ran into it, on a toy shop shelf rather than in a puzzle collection. It has since been discontinued.\u003c\/p\u003e\n\u003cp\u003eGreg Puzzles is not affiliated with ThinkFun or Ravensburger. We list the design under the name Frans de Vreugd gave it, and ours comes out of the box in pieces.\u003c\/p\u003e\n\u003ch2\u003eIt Arrives in Pieces\u003c\/h2\u003e\n\u003cp\u003eThis puzzle ships disassembled, and that is deliberate. Assembly is the challenge, and handing it to you already solved would remove the entire point. It also means you are working those 69 moves in reverse, with no solved reference state to copy and no photograph to work backwards from. You get six boards and the knowledge that they fit.\u003c\/p\u003e\n\u003cp\u003eExpect to put it down and come back to it. Most people do.\u003c\/p\u003e\n\u003cp\u003eIf you would rather work up to this one, all three are sold together as the \u003ca href=\"\/he\/products\/separated-board-burr-set\"\u003eSeparated Board Burr Set\u003c\/a\u003e.\u003c\/p\u003e\n\u003ch2\u003eHow Many Solutions Does Extreme Torture Have?\u003c\/h2\u003e\n\u003cp\u003eSix. Ivan (Puzzle Guy) ran our boards through BurrTools, and the six pieces fit together in six different ways that still come apart. Only one of them is the 69-move puzzle.\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003e17 moves (4-6-3-3), two different assemblies\u003c\/li\u003e\n\u003cli\u003e18 moves (6-5-1-3-3)\u003c\/li\u003e\n\u003cli\u003e21 moves (6-6-3-3-3)\u003c\/li\u003e\n\u003cli\u003e32 moves (14-12-1-2-3)\u003c\/li\u003e\n\u003cli\u003e\u003cstrong\u003e69 moves (28-21-9-8-3), the Extreme Torture\u003c\/strong\u003e\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003eBecause the boards ship loose, you can build one of the easier five first. Count the moves. If your assembly took less than 69, you still haven't found the ultimate solution.\u003c\/p\u003e\n\u003ch2\u003eFrequently Asked Questions\u003c\/h2\u003e\n\u003ch3\u003eHow many moves does Extreme Torture take?\u003c\/h3\u003e\n\u003cp\u003e69 moves to disassemble. The burr level is 28-21-9-8-3 - the first board alone takes 28 moves to free.\u003c\/p\u003e\n\u003ch3\u003eDoes Extreme Torture arrive assembled?\u003c\/h3\u003e\n\u003cp\u003eNo. It ships disassembled, as six separate boards. Assembling it is the puzzle - a solved puzzle in the box would be no puzzle at all.\u003c\/p\u003e\n\u003ch3\u003eHow hard is Extreme Torture?\u003c\/h3\u003e\n\u003cp\u003eExpert, and at the top of that band. Plan on four hours or more spread across more than one sitting, and do not treat it as a reasonable first attempt at interlocking designs. It is the hardest form found in de Vreugd's research.\u003c\/p\u003e\n\u003ch3\u003eIs Extreme Torture the same as Gordian's Knot?\u003c\/h3\u003e\n\u003cp\u003eIt is the same design. Frans de Vreugd named it Extreme Torture in 2002, and it went into commercial production that year as Gordian's Knot, which has since been discontinued. We use the designer's original name.\u003c\/p\u003e\n\u003ch3\u003eWho designed Extreme Torture?\u003c\/h3\u003e\n\u003cp\u003eFrans de Vreugd, a Dutch puzzle designer, in 2002, working from Jim Gooch's separated board burr idea and using Burrgrower, the level-raising software written by Dic Sonneveld and \u003ca href=\"\/he\/collections\/goh-pit-khiam\"\u003eGoh Pit-Khiam\u003c\/a\u003e.\u003c\/p\u003e\n\u003ch3\u003eHow many solutions does Extreme Torture have?\u003c\/h3\u003e\n\u003cp\u003eSix assemblies come apart: two take 17 moves, the others 18, 21, 32 and 69. Only the 69-move assembly, level 28-21-9-8-3, is the full Extreme Torture.\u003c\/p\u003e\n\u003cdiv class=\"gpbr\" data-handle=\"extreme-torture\"\u003e\n\u003cstyle\u003e\n.gpbr{--gpbr-fg:rgb(var(--color-foreground,18,18,18));\n --gpbr-line:rgba(var(--color-foreground,18,18,18),.18);\n --gpbr-muted:rgba(var(--color-foreground,18,18,18),.72);\n --gpbr-accent:#02A9F7;\n font-family:inherit;color:var(--gpbr-fg);margin:1.2em 0;max-width:32em}\n.gpbr *{box-sizing:border-box}\n.gpbr .gpbr-h{font-family:inherit;font-size:1.2em;line-height:1.3;font-weight:600;\n letter-spacing:normal;text-transform:none;margin:0 0 .3em;color:var(--gpbr-fg)}\n.gpbr .gpbr-goal{font-size:1em;line-height:1.4;font-weight:600;margin:0 0 .2em;color:var(--gpbr-fg)}\n.gpbr .gpbr-rule{font-size:.86em;line-height:1.45;margin:0 0 .75em;color:var(--gpbr-muted);max-width:36em}\n.gpbr .gpbr-stage{display:flex;flex-direction:column;gap:.5em;direction:ltr}\n.gpbr .gpbr-view{position:relative;width:100%;border-radius:8px;overflow:hidden;\n background:radial-gradient(ellipse at 50% 42%,#FFFFFF 0%,#F3F2EE 70%,#ECEAE4 100%);border:1px solid var(--gpbr-line)}\n.gpbr canvas.gpbr-cv{display:block;width:100%;height:auto;aspect-ratio:1\/0.8;touch-action:pan-y;cursor:grab;\n -webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;outline:none}\n.gpbr canvas.gpbr-cv:active{cursor:grabbing}\n.gpbr[data-play=\"1\"] canvas.gpbr-cv{touch-action:none}\n.gpbr .gpbr-veil{position:absolute;left:0;right:0;bottom:.8em;display:flex;justify-content:center;pointer-events:none;\n opacity:1;transition:opacity .25s}\n.gpbr[data-play=\"1\"] .gpbr-veil{opacity:0}\n.gpbr .gpbr-veil-t{font-size:.85em;line-height:1.2;font-weight:600;color:var(--gpbr-fg);padding:.5em 1em;border-radius:999px;\n background:rgba(255,255,255,.88);border:1px solid var(--gpbr-line);box-shadow:0 1px 3px rgba(0,0,0,.08)}\n.gpbr .gpbr-tray{display:flex;flex-wrap:wrap;align-items:center;gap:.4em;min-height:3.6em;padding:.35em .5em;\n border-radius:8px;border:1px dashed var(--gpbr-line)}\n.gpbr .gpbr-tray-h{font-size:.75em;line-height:1;color:var(--gpbr-muted);margin-inline-end:.3em}\n.gpbr button.gpbr-slot{position:relative;appearance:none;-webkit-appearance:none;margin:0;padding:0;width:3.4em;height:3.4em;\n border:1px solid var(--gpbr-line);border-radius:7px;background:#FAFAF8;cursor:pointer;box-shadow:none;\n -webkit-tap-highlight-color:transparent}\n.gpbr button.gpbr-slot[hidden]{display:none}\n.gpbr button.gpbr-slot:hover{border-color:var(--gpbr-accent)}\n.gpbr button.gpbr-slot:disabled{opacity:.5;cursor:default}\n.gpbr canvas.gpbr-thumb{display:block;width:100%;height:100%;pointer-events:none}\n.gpbr .gpbr-num{position:absolute;top:.15em;left:.3em;font-size:.68em;line-height:1;font-weight:600;color:var(--gpbr-muted);pointer-events:none}\n.gpbr .gpbr-ctl{display:flex;flex-wrap:wrap;align-items:center;gap:.6em 1em;margin-top:.6em;direction:ltr}\n.gpbr .gpbr-pad{position:relative;width:9.6em;height:9.6em;flex:none;border-radius:50%;background:rgba(var(--color-foreground,18,18,18),.035)}\n.gpbr button.gpbr-mv{position:absolute;appearance:none;-webkit-appearance:none;margin:0;padding:.45em;width:2.9em;height:2.9em;\n border:2px solid;border-radius:50%;background:#fff;cursor:pointer;box-shadow:0 1px 2px rgba(0,0,0,.12);\n -webkit-tap-highlight-color:transparent;touch-action:manipulation;transition:left .12s,top .12s}\n.gpbr button.gpbr-mv svg{display:block;pointer-events:none}\n.gpbr button.gpbr-mv[aria-disabled=\"true\"]{opacity:.55}\n.gpbr button.gpbr-mv:disabled{opacity:.3;cursor:default}\n.gpbr .gpbr-side{display:flex;flex-wrap:wrap;gap:.45em;flex:1 1 9em;align-content:center}\n.gpbr .gpbr-side button,.gpbr .gpbr-bar button,.gpbr button.gpbr-tog{appearance:none;-webkit-appearance:none;margin:0;border:1px solid var(--gpbr-line);\n background:transparent;color:var(--gpbr-fg);font-family:inherit;font-size:.85em;line-height:1.2;\n letter-spacing:normal;text-transform:none;min-height:2.9em;padding:.6em .9em;border-radius:6px;\n cursor:pointer;box-shadow:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}\n.gpbr .gpbr-side button{flex:1 1 4.2em;padding:.6em .4em;white-space:nowrap}\n.gpbr .gpbr-side button:hover,.gpbr .gpbr-bar button:hover,.gpbr button.gpbr-tog:hover{border-color:var(--gpbr-accent)}\n.gpbr .gpbr-side button:disabled,.gpbr .gpbr-bar button:disabled{opacity:.38;cursor:default}\n.gpbr .gpbr-side button:disabled:hover,.gpbr .gpbr-bar button:disabled:hover{border-color:var(--gpbr-line)}\n.gpbr .gpbr-sayrow{display:flex;flex-wrap:wrap;align-items:center;gap:.4em .8em;margin:.6em 0 0;min-height:1.45em}\n.gpbr .gpbr-say{flex:1 1 14em;font-size:.88em;line-height:1.45;color:var(--gpbr-muted);min-height:1.45em;margin:0}\n.gpbr button.gpbr-tog{border-color:var(--gpbr-accent);font-weight:600}\n.gpbr button.gpbr-tog[hidden]{display:none}\n.gpbr .gpbr-win{font-size:.98em;line-height:1.45;font-weight:600;color:var(--gpbr-fg);margin:.5em 0 0;\n padding:.55em .8em;border-radius:6px;background:#E8F7FD;border-inline-start:3px solid var(--gpbr-accent)}\n.gpbr .gpbr-win[hidden]{display:none}\n.gpbr .gpbr-bar{display:flex;flex-wrap:wrap;align-items:center;gap:.45em;margin-top:.75em}\n.gpbr .gpbr-stat{display:flex;flex-direction:column;gap:.1em;margin-inline-end:auto}\n.gpbr .gpbr-count{font-size:.95em;line-height:1.2;font-weight:600;font-variant-numeric:tabular-nums;color:var(--gpbr-fg)}\n.gpbr .gpbr-free{font-size:.8em;line-height:1.25;font-weight:400;color:var(--gpbr-muted)}\n.gpbr .gpbr-lock{display:flex;flex-wrap:wrap;align-items:center;gap:.6em .9em;margin-top:.75em;\n padding:.8em .9em;border-radius:7px;background:#E8F7FD;border:1px solid rgba(2,169,247,.35)}\n.gpbr .gpbr-lock[hidden]{display:none}\n.gpbr .gpbr-lock-line{flex:1 1 12em;margin:0;font-size:.95em;line-height:1.4;font-weight:600;color:var(--gpbr-fg)}\n.gpbr a.gpbr-buy,.gpbr a.gpbr-buy:visited{display:inline-block;flex:none;padding:.7em 1.2em;border-radius:6px;\n background:var(--gpbr-accent);color:#121212;font-family:inherit;font-size:.92em;line-height:1.2;font-weight:600;\n letter-spacing:normal;text-decoration:none;text-transform:none;cursor:pointer;-webkit-tap-highlight-color:transparent}\n.gpbr a.gpbr-buy:hover{background:#2BB8F8;color:#121212;text-decoration:none}\n.gpbr .gpbr-credit{font-size:.72em;line-height:1.4;color:var(--gpbr-muted);margin:.9em 0 0;opacity:.85}\n@media (min-width:600px){\n .gpbr .gpbr-stage{flex-direction:row;align-items:stretch}\n .gpbr .gpbr-view{flex:1 1 auto;min-width:0}\n .gpbr .gpbr-tray{flex-direction:column;flex-wrap:nowrap;justify-content:flex-start;width:4.6em;flex:none;padding:.5em .4em}\n .gpbr .gpbr-tray-h{margin:0 0 .2em}\n}\n\u003c\/style\u003e\n\u003c\/div\u003e\n\u003cscript\u003e\n(function () {\n\"use strict\";\nif (window.GPBR_ENGINE) return;\nvar DIRS = [[1, 0, 0], [-1, 0, 0], [0, 1, 0], [0, -1, 0], [0, 0, 1], [0, 0, -1]];\nvar FAR = 6;\nfunction det(m) {\nreturn m[0][0] * (m[1][1] * m[2][2] - m[1][2] * m[2][1]) -\nm[0][1] * (m[1][0] * m[2][2] - m[1][2] * m[2][0]) +\nm[0][2] * (m[1][0] * m[2][1] - m[1][1] * m[2][0]);\n}\nvar ROTS = [];\n(function () {\nvar perms = [[0, 1, 2], [0, 2, 1], [1, 0, 2], [1, 2, 0], [2, 0, 1], [2, 1, 0]];\nfor (var p = 0; p \u003c 6; p++) {\nfor (var s = 0; s \u003c 8; s++) {\nvar m = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];\nfor (var r = 0; r \u003c 3; r++) m[r][perms[p][r]] = (s \u003e\u003e r \u0026 1) ? -1 : 1;\nif (det(m) === 1) ROTS.push(m);\n}\n}\n})();\nfunction mmul(a, b) {\nvar o = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];\nfor (var r = 0; r \u003c 3; r++) for (var c = 0; c \u003c 3; c++)\nfor (var k = 0; k \u003c 3; k++) o[r][c] += a[r][k] * b[k][c];\nreturn o;\n}\nfunction rotIndex(m) {\nfor (var i = 0; i \u003c ROTS.length; i++) {\nvar R = ROTS[i], same = true;\nfor (var r = 0; r \u003c 3 \u0026\u0026 same; r++) for (var c = 0; c \u003c 3; c++) if (R[r][c] !== m[r][c]) { same = false; break; }\nif (same) return i;\n}\nreturn -1;\n}\nvar MUL = ROTS.map(function (a) { return ROTS.map(function (b) { return rotIndex(mmul(a, b)); }); });\nvar QT = [rotIndex([[1, 0, 0], [0, 0, -1], [0, 1, 0]]),\nrotIndex([[0, 0, 1], [0, 1, 0], [-1, 0, 0]]),\nrotIndex([[0, -1, 0], [1, 0, 0], [0, 0, 1]])];\nvar ID = rotIndex([[1, 0, 0], [0, 1, 0], [0, 0, 1]]);\nfunction dot(a, b) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; }\nfunction key(x, y, z) { return ((x + 512) * 1024 + (y + 512)) * 1024 + (z + 512); }\nfunction axisOf(d) { return d[0] ? 0 : d[1] ? 1 : 2; }\nfunction signOf(d) { return d[0] + d[1] + d[2]; }\nfunction gaps(a, b) {\nvar g = [];\nfor (var k = 0; k \u003c 3; k++) g.push(Math.max(a.lo[k] - b.hi[k] - 1, b.lo[k] - a.hi[k] - 1));\nreturn g;\n}\nfunction Game(C) {\nthis.C = C;\nthis.n = C.pieces.length;\nthis.shapes = {};\nthis.reset();\n}\nvar G = Game.prototype;\nG.reset = function () {\nthis.P = [];\nfor (var i = 0; i \u003c this.n; i++) this.P.push({ on: false, r: ID, p: [0, 0, 0] });\nthis.moves = 0;\nthis.hist = [];\n};\nG.snap = function () {\nreturn { P: this.P.map(function (q) { return { on: q.on, r: q.r, p: q.p.slice() }; }), moves: this.moves };\n};\nG.save = function () { this.hist.push(this.snap()); };\nG.canUndo = function () { return this.hist.length \u003e 0; };\nG.undo = function () {\nvar s = this.hist.pop();\nif (!s) return false;\nthis.P = s.P;\nreturn true;\n};\nG.shape = function (i, r) {\nvar k = i + \"\/\" + r, sh = this.shapes[k];\nif (sh) return sh;\nvar R = ROTS[r], cs = this.C.pieces[i], out = [], lo = [1e9, 1e9, 1e9], hi = [-1e9, -1e9, -1e9];\nfor (var j = 0; j \u003c cs.length; j++) {\nvar c = cs[j], v = [0, 0, 0];\nfor (var a = 0; a \u003c 3; a++) {\nv[a] = R[a][0] * c[0] + R[a][1] * c[1] + R[a][2] * c[2];\nif (v[a] \u003c lo[a]) lo[a] = v[a];\nif (v[a] \u003e hi[a]) hi[a] = v[a];\n}\nout.push(v);\n}\nfor (j = 0; j \u003c out.length; j++) for (a = 0; a \u003c 3; a++) out[j][a] -= lo[a];\nsh = { c: out, s: [hi[0] - lo[0] + 1, hi[1] - lo[1] + 1, hi[2] - lo[2] + 1] };\nthis.shapes[k] = sh;\nreturn sh;\n};\nG.cells = function (i) {\nvar q = this.P[i], sh = this.shape(i, q.r);\nreturn sh.c.map(function (c) { return [c[0] + q.p[0], c[1] + q.p[1], c[2] + q.p[2]]; });\n};\nG.box = function (i) {\nvar q = this.P[i], s = this.shape(i, q.r).s;\nreturn { lo: q.p.slice(), hi: [q.p[0] + s[0] - 1, q.p[1] + s[1] - 1, q.p[2] + s[2] - 1] };\n};\nG.boxOf = function (list) {\nvar lo = [1e9, 1e9, 1e9], hi = [-1e9, -1e9, -1e9];\nfor (var j = 0; j \u003c list.length; j++) {\nvar b = this.box(list[j]);\nfor (var a = 0; a \u003c 3; a++) {\nif (b.lo[a] \u003c lo[a]) lo[a] = b.lo[a];\nif (b.hi[a] \u003e hi[a]) hi[a] = b.hi[a];\n}\n}\nreturn { lo: lo, hi: hi };\n};\nG.inPlay = function () {\nvar o = [];\nfor (var i = 0; i \u003c this.n; i++) if (this.P[i].on) o.push(i);\nreturn o;\n};\nG.occ = function (skip) {\nvar m = {};\nfor (var i = 0; i \u003c this.n; i++) {\nif (!this.P[i].on || (skip \u0026\u0026 skip[i])) continue;\nvar cs = this.cells(i);\nfor (var j = 0; j \u003c cs.length; j++) m[key(cs[j][0], cs[j][1], cs[j][2])] = i;\n}\nreturn m;\n};\nG.blockers = function (group, d) {\nvar inG = {}, j;\nfor (j = 0; j \u003c group.length; j++) inG[group[j]] = 1;\nvar occ = this.occ(inG), hit = {}, out = [];\nfor (j = 0; j \u003c group.length; j++) {\nvar cs = this.cells(group[j]);\nfor (var k = 0; k \u003c cs.length; k++) {\nvar o = occ[key(cs[k][0] + d[0], cs[k][1] + d[1], cs[k][2] + d[2])];\nif (o !== undefined \u0026\u0026 !hit[o]) { hit[o] = 1; out.push(o); }\n}\n}\nreturn out.sort(function (a, b) { return a - b; });\n};\nG.closure = function (i, d) {\nvar g = [i];\nfor (;;) {\nvar b = this.blockers(g, d);\nif (!b.length) return g.sort(function (a, c) { return a - c; });\ng = g.concat(b);\n}\n};\nG.clearWay = function (i, mine) {\nvar on = this.inPlay(), others = [], k, j;\nmine = mine || this.cells(i);\nfor (k = 0; k \u003c on.length; k++) if (on[k] !== i) {\nvar cs = this.cells(on[k]);\nfor (j = 0; j \u003c cs.length; j++) others.push(cs[j]);\n}\nif (!others.length) return 1;\nfor (var di = 0; di \u003c 6; di++) {\nvar d = DIRS[di], a = axisOf(d), s = signOf(d), free = true;\nfor (j = 0; j \u003c mine.length \u0026\u0026 free; j++) {\nvar c = mine[j];\nfor (k = 0; k \u003c others.length; k++) {\nvar o = others[k], same = true;\nfor (var b = 0; b \u003c 3; b++) if (b !== a \u0026\u0026 o[b] !== c[b]) { same = false; break; }\nif (same \u0026\u0026 (o[a] - c[a]) * s \u003e 0) { free = false; break; }\n}\n}\nif (free) return di + 1;\n}\nreturn 0;\n};\nG.hits = function (i, cells) {\nvar occ = this.occ(null);\nfor (var j = 0; j \u003c cells.length; j++) {\nvar o = occ[key(cells[j][0], cells[j][1], cells[j][2])];\nif (o !== undefined \u0026\u0026 o !== i) return true;\n}\nreturn false;\n};\nG.place = function (i, r, p) {\nreturn this.shape(i, r).c.map(function (c) { return [c[0] + p[0], c[1] + p[1], c[2] + p[2]]; });\n};\nG.spawn = function (i, side) {\nvar q = this.P[i];\nif (q.on) return { ok: false, why: \"on\" };\nvar sh = this.shape(i, q.r), on = this.inPlay(), p = [0, 0, 0];\nif (!on.length) {\nfor (var a = 0; a \u003c 3; a++) p[a] = -Math.floor(sh.s[a] \/ 2);\n} else {\nvar O = this.boxOf(on), d = DIRS[side], ax = axisOf(d);\nfor (a = 0; a \u003c 3; a++) {\nif (a === ax) continue;\np[a] = Math.floor((O.lo[a] + O.hi[a] + 1 - sh.s[a]) \/ 2);\n}\np[ax] = signOf(d) \u003e 0 ? O.hi[ax] + 2 : O.lo[ax] - 1 - sh.s[ax];\n}\nreturn this.spawnAt(i, q.r, p);\n};\nG.spawnAt = function (i, r, p) {\nvar q = this.P[i];\nif (q.on || r \u003c 0 || r \u003e= 24) return { ok: false, why: \"on\" };\nvar cells = this.place(i, r, p);\nif (this.hits(i, cells) || !this.clearWay(i, cells)) return { ok: false, why: \"inside\" };\nthis.save();\nthis.P[i] = { on: true, r: r, p: p.slice() };\nreturn { ok: true, i: i };\n};\nG.slide = function (i, di) {\nvar q = this.P[i], d = DIRS[di];\nif (!q || !q.on) return { ok: false, why: \"pick\" };\nvar on = this.inPlay();\nif (on.length \u003c 2) return { ok: false, why: \"alone\" };\nvar by = this.blockers([i], d);\nif (by.length) {\nvar g = this.closure(i, d);\nreturn { ok: false, why: \"blocked\", by: by, group: g.length \u003c on.length ? g : null };\n}\nvar others = on.filter(function (j) { return j !== i; });\nvar O = this.boxOf(others), before = gaps(this.box(i), O);\nthis.save();\nq.p = [q.p[0] + d[0], q.p[1] + d[1], q.p[2] + d[2]];\nthis.moves++;\nvar after = gaps(this.box(i), O), ax = axisOf(d), res = { ok: true, moved: [i], d: di };\nif (after[ax] \u003e FAR \u0026\u0026 after[ax] \u003e before[ax]) {\nq.on = false;\nres.out = i;\n}\nreturn res;\n};\nG.slideGroup = function (group, di) {\nvar d = DIRS[di], on = this.inPlay(), j;\nif (!group.length || group.length \u003e= on.length) return { ok: false, why: \"all\" };\nfor (j = 0; j \u003c group.length; j++) if (!this.P[group[j]].on) return { ok: false, why: \"pick\" };\nvar by = this.blockers(group, d);\nif (by.length) return { ok: false, why: \"blocked\", by: by, group: null };\nvar inG = {};\nfor (j = 0; j \u003c group.length; j++) inG[group[j]] = 1;\nvar rest = on.filter(function (k) { return !inG[k]; });\nvar O = this.boxOf(rest), B = this.boxOf(group), ax = axisOf(d), before = gaps(B, O);\nvar after = gaps({ lo: [B.lo[0] + d[0], B.lo[1] + d[1], B.lo[2] + d[2]], hi: [B.hi[0] + d[0], B.hi[1] + d[1], B.hi[2] + d[2]] }, O);\nif (after[ax] \u003e FAR \u0026\u0026 after[ax] \u003e before[ax]) return { ok: false, why: \"far\" };\nthis.save();\nfor (j = 0; j \u003c group.length; j++) {\nvar q = this.P[group[j]];\nq.p = [q.p[0] + d[0], q.p[1] + d[1], q.p[2] + d[2]];\n}\nthis.moves++;\nreturn { ok: true, moved: group.slice(), d: di };\n};\nG.free = function (i) {\nvar q = this.P[i];\nreturn !!(q \u0026\u0026 q.on \u0026\u0026 this.clearWay(i));\n};\nG.turn = function (i, ax, back) {\nif (!this.free(i)) return { ok: false, why: \"turn\" };\nvar q = this.P[i], old = this.box(i);\nvar Q = QT[ax];\nif (back) Q = MUL[Q][MUL[Q][Q]];\nvar r = MUL[Q][q.r], s = this.shape(i, r).s, p0 = [0, 0, 0], a;\nfor (a = 0; a \u003c 3; a++) p0[a] = Math.floor((old.lo[a] + old.hi[a] + 1 - s[a]) \/ 2);\nvar on = this.inPlay(), mid = [0, 0, 0], self = this;\nif (on.length \u003e 1) {\nvar O = this.boxOf(on.filter(function (j) { return j !== i; }));\nfor (a = 0; a \u003c 3; a++) mid[a] = (O.lo[a] + O.hi[a] + 1) \/ 2 - (old.lo[a] + old.hi[a] + 1) \/ 2;\n}\nvar order = [0, 1, 2, 3, 4, 5].sort(function (x, y) { return dot(DIRS[x], mid) - dot(DIRS[y], mid); });\nvar tries = [p0];\nfor (var k = 1; k \u003c= 8; k++) order.forEach(function (di) {\nvar d = DIRS[di];\ntries.push([p0[0] + d[0] * k, p0[1] + d[1] * k, p0[2] + d[2] * k]);\n});\nfor (var t = 0; t \u003c tries.length; t++) {\nvar cells = self.place(i, r, tries[t]);\nif (self.hits(i, cells) || !self.clearWay(i, cells)) continue;\nthis.save();\nq.r = r;\nq.p = tries[t];\nreturn { ok: true };\n}\nreturn { ok: false, why: \"room\" };\n};\nG.toTray = function (i) {\nvar q = this.P[i];\nif (!q || !q.on) return { ok: false, why: \"pick\" };\nif (this.inPlay().length \u003e 1 \u0026\u0026 !this.clearWay(i)) return { ok: false, why: \"stuck\" };\nthis.save();\nq.on = false;\nreturn { ok: true, out: i };\n};\nG.won = function () {\nvar on = this.inPlay(), gl = this.C.goal;\nif (on.length !== this.n) return false;\nvar B = this.boxOf(on), dims = [0, 1, 2].map(function (a) { return B.hi[a] - B.lo[a] + 1; });\nif (gl.type === \"box\") {\nvar num = function (x, y) { return x - y; };\nvar want = gl.size.slice().sort(num), got = dims.slice().sort(num);\nreturn want[0] === got[0] \u0026\u0026 want[1] === got[1] \u0026\u0026 want[2] === got[2];\n}\nif (gl.type === \"slots\") {\nfor (var a = 0; a \u003c 3; a++) if (dims[a] !== gl.span[a]) return false;\nvar self = this;\nreturn [0, 1].some(function (mirror) {\nvar want = {};\ngl.slots.forEach(function (sl) {\nvar c = sl[0], s = sl[1];\nif (mirror) { c = [c[1], c[0], c[2]]; s = [s[1], s[0], s[2]]; }\nwant[c.join(\",\") + \"\/\" + s.join(\",\")] = 1;\n});\nreturn on.every(function (i) {\nvar b = self.box(i), lo = [b.lo[0] - B.lo[0], b.lo[1] - B.lo[1], b.lo[2] - B.lo[2]];\nvar s = [b.hi[0] - b.lo[0] + 1, b.hi[1] - b.lo[1] + 1, b.hi[2] - b.lo[2] + 1];\nreturn want[lo.join(\",\") + \"\/\" + s.join(\",\")] === 1;\n});\n});\n}\nreturn false;\n};\nwindow.GPBR_ENGINE = { Game: Game, DIRS: DIRS, ROTS: ROTS, MUL: MUL, QT: QT, ID: ID, gaps: gaps, v: 1 };\n})();\n(function () {\n\"use strict\";\nif (window.GPBR) return;\nvar E = window.GPBR_ENGINE;\nif (!E) return;\nvar NS = \"http:\/\/www.w3.org\/2000\/svg\";\nvar ACC = \"#02A9F7\", BAD = \"#E0533D\";\nvar AXC = [\"#C8553D\", \"#3E8E5A\", \"#3569B8\"];\nvar DIRS = E.DIRS;\nvar seq = 0;\nvar TXT = {\nen: {\ntitle: \"Try it yourself\", play: \"Tap to play\",\nhow: \"Drag the view to turn it. Tap a piece in the tray to bring it in, tap a piece to pick it, then slide it with the arrows.\",\nmoves: \"Moves: {n}\", undo: \"Undo\", reset: \"Start over\", tray: \"Tray\", toTray: \"To tray\",\nturnY: \"Turn\", turnX: \"Tip\", turnZ: \"Spin\", together: \"Move together\",\nslide: \"Slide\", view: \"Puzzle view, drag to turn\",\nempty: \"Tap a piece in the tray to bring it in.\",\npick: \"Tap a piece first.\",\ninNow: \"{Name} is in. Turn it while it is clear, then slide it.\",\nalone: \"Bring in another piece to slide against.\",\nblocked: \"Blocked by {list}.\",\npush: \"It would push {list} too.\",\npushAll: \"Blocked by {list}. Pushing it would move the whole puzzle.\",\nfar: \"That's as far as it goes.\",\nout: \"{Name} is back in the tray.\",\nnoTurn: \"It's held in place. Slide it clear of the others first, then turn it.\",\nnoRoom: \"No room to turn it here. Slide it further out first.\",\nstuck: \"It can't come out from here yet.\",\nnoun: { block: [\"piece {p}\", \"Piece {p}\", \"pieces {a} and {b}\"], boards: [\"board {p}\", \"Board {p}\", \"boards {a} and {b}\"] }, and: \", \",\nfree: \"{n} free moves left\", freeOne: \"1 free move left\", freeNone: \"No free moves left\",\nlockLine: \"That's the free part. Finish it with the real one.\", buy: \"Add to cart\",\ncredit: \"Moves follow the rules of BurrTools, Andreas Röver's free puzzle program.\",\nblock: { goal: \"Put the five pieces together into one solid block.\",\nrule: \"Pieces only slide in straight lines, and a piece can only be turned while it is clear of the others.\",\nwin: \"Done in {n} moves. The block is complete.\" },\nboards: { goal: \"Fit the six boards together into the finished burr.\",\nrule: \"Boards only slide in straight lines, and a board can only be turned while it is clear of the others.\",\nwin: \"Done in {n} moves. All six boards are in place.\" }\n},\nhe: {\ntitle: \"נסו בעצמכם\", play: \"הקישו כדי לשחק\",\nhow: \"גררו את התצוגה כדי לסובב אותה. הקישו על חלק במגש כדי להכניס אותו, הקישו על חלק כדי לבחור בו, ואז הזיזו אותו עם החצים.\",\nmoves: \"מהלכים: {n}\", undo: \"ביטול מהלך\", reset: \"התחלה מחדש\", tray: \"מגש\", toTray: \"למגש\",\nturnY: \"סיבוב\", turnX: \"הטיה\", turnZ: \"גלגול\", together: \"הזיזו יחד\",\nslide: \"הזזה\", view: \"תצוגת הפאזל, גררו כדי לסובב\",\nempty: \"הקישו על חלק במגש כדי להכניס אותו.\",\npick: \"הקישו קודם על חלק.\",\ninNow: \"{Name} בפנים. סובבו אותו כל עוד הוא רחוק מהאחרים, ואז הזיזו אותו.\",\nalone: \"הכניסו עוד חלק כדי שיהיה מול מה להזיז.\",\nblocked: \"חסום על ידי {list}.\",\npush: \"הוא ידחוף גם את {list}.\",\npushAll: \"חסום על ידי {list}. דחיפה תזיז את כל הפאזל.\",\nfar: \"עד כאן אפשר להרחיק אותו.\",\nout: \"{Name} חזר למגש.\",\nnoTurn: \"הוא תקוע במקומו. הרחיקו אותו קודם מהחלקים האחרים, ואז סובבו אותו.\",\nnoRoom: \"אין כאן מקום לסובב אותו. הרחיקו אותו עוד קודם.\",\nstuck: \"עדיין אי אפשר להוציא אותו מכאן.\",\nnoun: { block: [\"חלק {p}\", \"חלק {p}\", \"חלקים {a} ו-{b}\"], boards: [\"לוח {p}\", \"לוח {p}\", \"לוחות {a} ו-{b}\"] }, and: \", \",\nfree: \"נותרו {n} מהלכים חינם\", freeOne: \"נותר מהלך חינם אחד\", freeNone: \"לא נותרו מהלכים חינם\",\nlockLine: \"זה החלק החינמי. סיימו אותו עם הפאזל האמיתי.\", buy: \"הוספה לעגלה\",\ncredit: \"המהלכים פועלים לפי הכללים של BurrTools, תוכנת הפאזלים החופשית של אנדראס רובר.\",\nblock: { goal: \"חברו את חמשת החלקים לקובייה אחת מלאה.\",\nrule: \"החלקים זזים רק בקווים ישרים, ואפשר לסובב חלק רק כשהוא רחוק מהאחרים.\",\nwin: \"הצלחתם ב-{n} מהלכים. הקובייה שלמה.\" },\nboards: { goal: \"חברו את ששת הלוחות לפאזל השלם.\",\nrule: \"הלוחות זזים רק בקווים ישרים, ואפשר לסובב לוח רק כשהוא רחוק מהאחרים.\",\nwin: \"הצלחתם ב-{n} מהלכים. כל ששת הלוחות במקומם.\" }\n},\nja: {\ntitle: \"試してみてください\", play: \"タップして遊ぶ\",\nhow: \"画面をドラッグすると向きが変わります。トレイのピースをタップして入れ、ピースをタップして選び、矢印でスライドさせてください。\",\nmoves: \"手数：{n}\", undo: \"1手戻す\", reset: \"最初から\", tray: \"トレイ\", toTray: \"トレイへ\",\nturnY: \"回す\", turnX: \"倒す\", turnZ: \"ひねる\", together: \"一緒に動かす\",\nslide: \"スライド\", view: \"パズルの表示（ドラッグで回転）\",\nempty: \"トレイのピースをタップして入れてください。\",\npick: \"まずピースをタップしてください。\",\ninNow: \"{Name}が入りました。離れているうちに向きを変えてから、スライドさせてください。\",\nalone: \"もう1つピースを入れてから動かしてください。\",\nblocked: \"{list}に当たって動けません。\",\npush: \"{list}も一緒に押すことになります。\",\npushAll: \"{list}に当たって動けません。押すとパズル全体が動いてしまいます。\",\nfar: \"これ以上は離せません。\",\nout: \"{Name}がトレイに戻りました。\",\nnoTurn: \"今は固定されています。向きを変えるには、まず他のピースから離してください。\",\nnoRoom: \"ここでは回す場所がありません。もう少し離してください。\",\nstuck: \"ここからはまだ取り出せません。\",\nnoun: { block: [\"ピース{p}\", \"ピース{p}\", \"ピース{a}と{b}\"], boards: [\"板{p}\", \"板{p}\", \"板{a}と{b}\"] }, and: \"、\",\nfree: \"無料であと{n}手\", freeOne: \"無料であと1手\", freeNone: \"無料の手はここまで\",\nlockLine: \"無料で遊べるのはここまでです。続きは本物のパズルでどうぞ。\", buy: \"カートに追加\",\ncredit: \"動きのルールは、Andreas Röver さんの無料パズルソフト BurrTools に従っています。\",\nblock: { goal: \"5つのピースを組み合わせて、すき間のない1つのブロックにしてください。\",\nrule: \"ピースはまっすぐスライドするだけです。向きを変えられるのは、他のピースから離れているときだけです。\",\nwin: \"{n}手で完成！ブロックができあがりました。\" },\nboards: { goal: \"6枚の板を組み合わせて、パズルを完成させてください。\",\nrule: \"板はまっすぐスライドするだけです。向きを変えられるのは、他の板から離れているときだけです。\",\nwin: \"{n}手で完成！6枚の板がすべて収まりました。\" }\n}\n};\nfunction langOf() {\nvar l = (document.documentElement.getAttribute(\"lang\") || \"\").toLowerCase();\nif (l.indexOf(\"he\") === 0 || l.indexOf(\"iw\") === 0) return \"he\";\nif (l.indexOf(\"ja\") === 0) return \"ja\";\nreturn \"en\";\n}\nfunction fmt(s, o) {\nreturn s.replace(\/\\{(\\w+)\\}\/g, function (m, k) { return (k in o) ? String(o[k]) : m; });\n}\nfunction el(tag, cls, txt) {\nvar e = document.createElement(tag);\nif (cls) e.className = cls;\nif (txt != null) e.textContent = txt;\nreturn e;\n}\nfunction sv(tag, attrs) {\nvar e = document.createElementNS(NS, tag);\nfor (var k in attrs) if (Object.prototype.hasOwnProperty.call(attrs, k)) e.setAttribute(k, attrs[k]);\nreturn e;\n}\nfunction track(name, handle) {\ntry { if (typeof window.gtag === \"function\") window.gtag(\"event\", name, { product: handle }); } catch (e) {  }\n}\nfunction buyButton(root) {\nvar scopes = [], sec = root.closest ? root.closest(\"section, .shopify-section, product-info\") : null;\nif (sec) scopes.push(sec);\nscopes.push(document);\nfor (var k = 0; k \u003c scopes.length; k++) {\nvar b = scopes[k].querySelector('[id^=\"ProductSubmitButton-\"]');\nif (b \u0026\u0026 !root.contains(b)) return b;\nvar forms = scopes[k].querySelectorAll('form[action*=\"\/cart\/add\"]');\nfor (var i = 0; i \u003c forms.length; i++) {\nif (root.contains(forms[i])) continue;\nvar x = forms[i].querySelector('[type=\"submit\"], button:not([type])');\nif (x) return x;\n}\n}\nreturn null;\n}\nfunction rgb(h) {\nvar n = parseInt(h.slice(1), 16);\nreturn [n \u003e\u003e 16 \u0026 255, n \u003e\u003e 8 \u0026 255, n \u0026 255];\n}\nfunction dot(a, b) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; }\nvar now = (window.performance \u0026\u0026 performance.now) ? function () { return performance.now(); } : function () { return Date.now(); };\nvar CORN = [[0, 0], [1, 0], [1, 1], [0, 1]];\nvar OUTW = [[0, -1], [1, 0], [0, 1], [-1, 0]];\nfunction facesOf(cells) {\nvar has = {}, F = [];\nfunction k(x, y, z) { return x + \",\" + y + \",\" + z; }\ncells.forEach(function (c) { has[k(c[0], c[1], c[2])] = 1; });\ncells.forEach(function (c) {\nfor (var n = 0; n \u003c 6; n++) {\nvar d = DIRS[n];\nif (has[k(c[0] + d[0], c[1] + d[1], c[2] + d[2])]) continue;\nvar a = d[0] ? 0 : d[1] ? 1 : 2, s = d[0] + d[1] + d[2], b = (a + 1) % 3, e = (a + 2) % 3;\nvar pts = CORN.map(function (uv) {\nvar p = [0, 0, 0];\np[a] = c[a] + (s \u003e 0 ? 1 : 0); p[b] = c[b] + uv[0]; p[e] = c[e] + uv[1];\nreturn p;\n});\nvar mask = 0;\nfor (var j = 0; j \u003c 4; j++) {\nvar u = [0, 0, 0];\nu[b] = OUTW[j][0]; u[e] = OUTW[j][1];\nvar m = [c[0] + u[0], c[1] + u[1], c[2] + u[2]];\nvar flat = has[k(m[0], m[1], m[2])] \u0026\u0026 !has[k(m[0] + d[0], m[1] + d[1], m[2] + d[2])];\nif (!flat) mask |= 1 \u003c\u003c j;\n}\nF.push({ n: n, pts: pts, cc: [c[0] + 0.5, c[1] + 0.5, c[2] + 0.5], m: mask });\n}\n});\nreturn F;\n}\nfunction mount(root, C) {\nif (!root || root.getAttribute(\"data-gpbr-on\")) return;\nroot.setAttribute(\"data-gpbr-on\", \"1\");\nvar L = langOf(), t = TXT[L], T = t[C.text] || t.block;\nroot.setAttribute(\"lang\", L);\nroot.setAttribute(\"dir\", L === \"he\" ? \"rtl\" : \"ltr\");\nvar handle = root.getAttribute(\"data-handle\") || \"\";\nvar game = new E.Game(C), n = game.n;\nvar FREE = C.free \u003e 0 ? C.free : Infinity;\nvar COL = (C.colors || []).map(rgb);\nvar yaw = -0.62, pitch = 0.52;\nvar sel = null, pending = null, flash = {}, anim = {}, msg = t.empty, won = false;\nvar faceCache = {};\nvar view = { s: 0, c: [0, 0, 0], ts: 0, tc: [0, 0, 0] };\nvar drawn = [];\nvar dirty = false, raf = 0;\nfunction locked() { return game.moves \u003e= FREE; }\nfunction label(i) { return String(i + 1); }\nvar NOUN = t.noun[C.text] || t.noun.block;\nfunction names(list) {\nif (list.length === 1) return fmt(NOUN[0], { p: label(list[0]) });\nvar head = list.slice(0, -1).map(label).join(t.and);\nreturn fmt(NOUN[2], { a: head, b: label(list[list.length - 1]) });\n}\nfunction Name(i) { return fmt(NOUN[1], { p: label(i) }); }\nroot.appendChild(el(\"h3\", \"gpbr-h\", t.title));\nroot.appendChild(el(\"p\", \"gpbr-goal\", T.goal));\nroot.appendChild(el(\"p\", \"gpbr-rule\", T.rule + (L === \"ja\" ? \"\" : \" \") + t.how));\nvar stage = el(\"div\", \"gpbr-stage\");\nroot.appendChild(stage);\nvar viewEl = el(\"div\", \"gpbr-view\");\nstage.appendChild(viewEl);\nvar cv = el(\"canvas\", \"gpbr-cv\");\ncv.setAttribute(\"role\", \"img\");\ncv.setAttribute(\"aria-label\", t.view);\nviewEl.appendChild(cv);\nvar veil = el(\"div\", \"gpbr-veil\");\nveil.appendChild(el(\"span\", \"gpbr-veil-t\", t.play));\nviewEl.appendChild(veil);\nvar ctx = cv.getContext(\"2d\");\nvar trayEl = el(\"div\", \"gpbr-tray\");\nstage.appendChild(trayEl);\ntrayEl.appendChild(el(\"span\", \"gpbr-tray-h\", t.tray));\nvar slots = [];\nfor (var i = 0; i \u003c n; i++) {\nvar b = el(\"button\", \"gpbr-slot\");\nb.type = \"button\";\nb.setAttribute(\"data-piece\", String(i));\nvar tc = el(\"canvas\", \"gpbr-thumb\");\nb.appendChild(tc);\nb.appendChild(el(\"span\", \"gpbr-num\", label(i)));\ntrayEl.appendChild(b);\nslots.push({ b: b, cv: tc });\n}\nvar ctl = el(\"div\", \"gpbr-ctl\");\nroot.appendChild(ctl);\nvar pad = el(\"div\", \"gpbr-pad\");\nctl.appendChild(pad);\nvar mvb = [];\nDIRS.forEach(function (d, di) {\nvar bt = el(\"button\", \"gpbr-mv\");\nbt.type = \"button\";\nbt.setAttribute(\"data-dir\", String(di));\nvar ax = d[0] ? 0 : d[1] ? 1 : 2;\nbt.style.borderColor = AXC[ax];\nvar svg = sv(\"svg\", { viewBox: \"-12 -12 24 24\", width: \"100%\", height: \"100%\", \"aria-hidden\": \"true\", focusable: \"false\" });\nvar g = sv(\"g\", {});\ng.appendChild(sv(\"path\", { d: \"M-7 0H6M1-5L6 0L1 5\", fill: \"none\", stroke: AXC[ax], \"stroke-width\": \"2.6\", \"stroke-linecap\": \"round\", \"stroke-linejoin\": \"round\" }));\nsvg.appendChild(g);\nvar mark = sv(\"circle\", { cx: \"0\", cy: \"0\", r: \"3.2\", fill: AXC[ax] });\nsvg.appendChild(mark);\nbt.appendChild(svg);\npad.appendChild(bt);\nmvb.push({ b: bt, g: g, mark: mark, ax: ax });\n});\nvar side = el(\"div\", \"gpbr-side\");\nctl.appendChild(side);\nfunction sideBtn(txt, cls) {\nvar bt = el(\"button\", \"gpbr-sb \" + cls, txt);\nbt.type = \"button\";\nside.appendChild(bt);\nreturn bt;\n}\nvar bTurnY = sideBtn(t.turnY, \"gpbr-turn\");\nvar bTurnX = sideBtn(t.turnX, \"gpbr-turn\");\nvar bTurnZ = sideBtn(t.turnZ, \"gpbr-turn\");\nvar bTray = sideBtn(t.toTray, \"gpbr-out\");\nvar sayRow = el(\"div\", \"gpbr-sayrow\");\nroot.appendChild(sayRow);\nvar sayEl = el(\"p\", \"gpbr-say\", \"\");\nsayEl.setAttribute(\"aria-live\", \"polite\");\nsayRow.appendChild(sayEl);\nvar bTog = el(\"button\", \"gpbr-tog\", t.together);\nbTog.type = \"button\";\nbTog.hidden = true;\nsayRow.appendChild(bTog);\nvar winEl = el(\"p\", \"gpbr-win\", \"\");\nwinEl.hidden = true;\nwinEl.setAttribute(\"aria-live\", \"polite\");\nroot.appendChild(winEl);\nvar bar = el(\"div\", \"gpbr-bar\");\nroot.appendChild(bar);\nvar stat = el(\"div\", \"gpbr-stat\");\nbar.appendChild(stat);\nvar countEl = el(\"span\", \"gpbr-count\", \"\");\nstat.appendChild(countEl);\nvar freeEl = el(\"span\", \"gpbr-free\", \"\");\nif (FREE !== Infinity) stat.appendChild(freeEl);\nvar bUndo = el(\"button\", \"\", t.undo);\nbUndo.type = \"button\";\nbar.appendChild(bUndo);\nvar bReset = el(\"button\", \"\", t.reset);\nbReset.type = \"button\";\nbar.appendChild(bReset);\nvar lockEl = el(\"div\", \"gpbr-lock\");\nlockEl.hidden = true;\nlockEl.setAttribute(\"aria-live\", \"polite\");\nlockEl.appendChild(el(\"p\", \"gpbr-lock-line\", t.lockLine));\nvar buyEl = el(\"a\", \"gpbr-buy\", t.buy);\nbuyEl.setAttribute(\"href\", \"\/products\/\" + handle);\nbuyEl.setAttribute(\"role\", \"button\");\nlockEl.appendChild(buyEl);\nroot.appendChild(lockEl);\nroot.appendChild(el(\"p\", \"gpbr-credit\", t.credit));\nfunction basis() {\nvar cy = Math.cos(yaw), sy = Math.sin(yaw), cp = Math.cos(pitch), sp = Math.sin(pitch);\nreturn { X: [cy, -sy, 0], Y: [sp * sy, sp * cy, cp], D: [cp * sy, cp * cy, -sp] };\n}\nvar LIGHT = [-0.42, 0.74, -0.52];\nfunction faces(i, r) {\nvar k = i + \"\/\" + r;\nif (!faceCache[k]) faceCache[k] = facesOf(game.shape(i, r).c);\nreturn faceCache[k];\n}\nfunction offsetOf(i, tnow) {\nvar q = game.P[i], o = [q.p[0], q.p[1], q.p[2]], a = anim[i];\nif (a) {\nvar e = Math.min(1, (tnow - a.t0) \/ a.ms);\nif (e \u003e= 1) delete anim[i];\nelse {\nvar f = 1 - (1 - e) * (1 - e);\nfor (var k = 0; k \u003c 3; k++) o[k] += a.v[k] * (1 - f);\n}\n}\nreturn o;\n}\nfunction table() { return !game.inPlay().length; }\nfunction scene(tnow) {\nvar on = game.inPlay(), list = [], lo = [1e9, 1e9, 1e9], hi = [-1e9, -1e9, -1e9], k;\nif (on.length) {\non.forEach(function (i) { list.push({ i: i, r: game.P[i].r, off: tnow == null ? game.P[i].p.slice() : offsetOf(i, tnow) }); });\n} else {\nvar sp = 0, cols = n \u003c= 4 ? 2 : 3;\nfor (k = 0; k \u003c n; k++) { var s0 = game.shape(k, game.P[k].r).s; sp = Math.max(sp, s0[0], s0[1], s0[2]); }\nsp += 2;\nfor (k = 0; k \u003c n; k++) {\nvar sz = game.shape(k, game.P[k].r).s, col = k % cols, row = Math.floor(k \/ cols);\nlist.push({ i: k, r: game.P[k].r, off: [Math.round(col * sp - sz[0] \/ 2), Math.round(-row * sp - sz[1] \/ 2), Math.round(-sz[2] \/ 2)] });\n}\n}\nlist.forEach(function (it) {\nvar s1 = game.shape(it.i, it.r).s;\nfor (var a = 0; a \u003c 3; a++) {\nlo[a] = Math.min(lo[a], it.off[a]);\nhi[a] = Math.max(hi[a], it.off[a] + s1[a] - 1);\n}\n});\nreturn { list: list, lo: lo, hi: hi };\n}\nvar lastTable = null;\nfunction fitTarget() {\nvar B = scene(null), c = [], r2 = 0;\nif (!B.list.length) return;\nif (lastTable !== table()) { lastTable = table(); view.s = 0; }\nfor (var k = 0; k \u003c 3; k++) {\nc.push((B.lo[k] + B.hi[k] + 1) \/ 2);\nvar h = (B.hi[k] - B.lo[k] + 1) \/ 2;\nr2 += h * h;\n}\nvar r = Math.sqrt(r2) + 0.35, W = cv.clientWidth || 300, H = cv.clientHeight || 260;\nview.ts = Math.min(W, H) \/ (2 * r);\nview.tc = c;\nif (!view.s) { view.s = view.ts; view.c = c.slice(); }\n}\nfunction shade(rgbv, f) {\nreturn \"rgb(\" + Math.round(rgbv[0] * f) + \",\" + Math.round(rgbv[1] * f) + \",\" + Math.round(rgbv[2] * f) + \")\";\n}\nfunction paint(g2, list, B, s, c, W, H, dpr, pick) {\nvar items = [];\nlist.forEach(function (it) {\nvar F = faces(it.i, it.r), col = COL[it.i % COL.length] || [200, 200, 200];\nfor (var j = 0; j \u003c F.length; j++) {\nvar f = F[j], nd = DIRS[f.n];\nvar nz = dot(nd, B.D);\nif (nz \u003e -1e-6) continue;\nvar pts = [];\nfor (var k = 0; k \u003c 4; k++) {\nvar p = [f.pts[k][0] + it.off[0] - c[0], f.pts[k][1] + it.off[1] - c[1], f.pts[k][2] + it.off[2] - c[2]];\npts.push([W \/ 2 + s * dot(p, B.X), H \/ 2 - s * dot(p, B.Y)]);\n}\nvar cc = [f.cc[0] + it.off[0], f.cc[1] + it.off[1], f.cc[2] + it.off[2]];\nvar fc = [cc[0] + nd[0] * 0.5, cc[1] + nd[1] * 0.5, cc[2] + nd[2] * 0.5];\nvar nv = [dot(nd, B.X), dot(nd, B.Y), nz];\nvar lum = 0.6 + 0.4 * Math.max(0, dot(nv, LIGHT));\nitems.push({ i: it.i, pts: pts, m: f.m, z: dot(cc, B.D), z2: dot(fc, B.D), fill: shade(col, lum) });\n}\n});\nitems.sort(function (a, b) { return (b.z - a.z) || (b.z2 - a.z2); });\ng2.lineJoin = \"round\";\ng2.lineCap = \"round\";\nfor (var q = 0; q \u003c items.length; q++) {\nvar it = items[q], P = it.pts;\nvar mx = (P[0][0] + P[1][0] + P[2][0] + P[3][0]) \/ 4, my = (P[0][1] + P[1][1] + P[2][1] + P[3][1]) \/ 4;\ng2.beginPath();\nfor (var k2 = 0; k2 \u003c 4; k2++) {\nvar ex = P[k2][0] - mx, ey = P[k2][1] - my, el2 = Math.sqrt(ex * ex + ey * ey) || 1;\nvar gx = P[k2][0] + ex \/ el2 * 0.6, gy = P[k2][1] + ey \/ el2 * 0.6;\nif (k2) g2.lineTo(gx, gy); else g2.moveTo(gx, gy);\n}\ng2.closePath();\ng2.fillStyle = it.fill;\ng2.fill();\nvar hot = pick \u0026\u0026 (it.i === sel ? ACC : flash[it.i] ? BAD : null);\ng2.strokeStyle = hot || \"rgba(30,30,30,.55)\";\ng2.lineWidth = (hot ? 2.2 : 1) * dpr;\ng2.beginPath();\nfor (k2 = 0; k2 \u003c 4; k2++) {\nif (!(it.m \u003e\u003e k2 \u0026 1)) continue;\ng2.moveTo(P[k2][0], P[k2][1]);\ng2.lineTo(P[(k2 + 1) % 4][0], P[(k2 + 1) % 4][1]);\n}\ng2.stroke();\n}\nreturn items;\n}\nfunction size() {\nvar dpr = Math.min(window.devicePixelRatio || 1, 2.5);\nvar W = cv.clientWidth, H = cv.clientHeight;\nif (cv.width !== Math.round(W * dpr) || cv.height !== Math.round(H * dpr)) {\ncv.width = Math.round(W * dpr);\ncv.height = Math.round(H * dpr);\n}\nreturn dpr;\n}\nfunction draw() {\nraf = 0;\nvar tnow = now(), dpr = size(), W = cv.width, H = cv.height, B = basis(), more = false;\nfitTarget();\nif (view.s) {\nvar ds = view.ts - view.s;\nview.s += ds * 0.28;\nif (Math.abs(ds) \u003e view.ts * 0.004) more = true; else view.s = view.ts;\nfor (var k = 0; k \u003c 3; k++) {\nvar dc = view.tc[k] - view.c[k];\nview.c[k] += dc * 0.28;\nif (Math.abs(dc) \u003e 0.01) more = true; else view.c[k] = view.tc[k];\n}\n}\nctx.clearRect(0, 0, W, H);\nvar list = scene(tnow).list;\nfor (var a in anim) if (Object.prototype.hasOwnProperty.call(anim, a)) more = true;\nfor (var f in flash) if (Object.prototype.hasOwnProperty.call(flash, f)) {\nif (tnow \u003e flash[f]) delete flash[f]; else more = true;\n}\ndrawn = list.length ? paint(ctx, list, B, view.s * dpr, view.c, W, H, dpr, true) : [];\nif (more) schedule();\n}\nfunction schedule() { if (!raf) raf = (window.requestAnimationFrame || function (cb) { return setTimeout(cb, 16); })(draw); }\nfunction drawTray() {\nvar B = basis(), dpr = Math.min(window.devicePixelRatio || 1, 2.5);\nslots.forEach(function (sl, i) {\nvar q = game.P[i];\nsl.b.hidden = q.on;\nsl.b.disabled = locked() || won;\nif (q.on) return;\nvar W = Math.round((sl.cv.clientWidth || 48) * dpr), H = Math.round((sl.cv.clientHeight || 48) * dpr);\nif (sl.cv.width !== W) sl.cv.width = W;\nif (sl.cv.height !== H) sl.cv.height = H;\nvar g2 = sl.cv.getContext(\"2d\"), s = game.shape(i, q.r).s;\ng2.clearRect(0, 0, W, H);\nvar r = Math.sqrt(s[0] * s[0] + s[1] * s[1] + s[2] * s[2]) \/ 2 + 0.2;\npaint(g2, [{ i: i, r: q.r, off: [0, 0, 0] }], B, Math.min(W, H) \/ (2 * r), [s[0] \/ 2, s[1] \/ 2, s[2] \/ 2], W, H, dpr * 0.8, false);\n});\n}\nfunction layoutPad() {\nvar B = basis(), R = 3.15, ring = [], mid = [];\nmvb.forEach(function (m, di) {\nvar d = DIRS[di], vx = dot(d, B.X), vy = dot(d, B.Y), len = Math.sqrt(vx * vx + vy * vy);\nvar ang = Math.atan2(vy, vx);\nm.g.setAttribute(\"transform\", \"rotate(\" + (-ang * 180 \/ Math.PI).toFixed(1) + \") scale(\" + Math.max(0.45, Math.min(1, len)).toFixed(2) + \")\");\nm.mark.setAttribute(\"r\", len \u003c 0.35 ? (dot(d, B.D) \u003c 0 ? \"3.4\" : \"0\") : \"0\");\nm.b.setAttribute(\"aria-label\", t.slide + \" \" + [\"x\", \"y\", \"z\"][m.ax] + (di % 2 ? \"-\" : \"+\"));\nif (len \u003c 0.3) mid.push({ m: m, toward: dot(d, B.D) \u003c 0 });\nelse ring.push({ m: m, a: ang });\n});\nring.sort(function (p, q) { return p.a - q.a; });\nvar MIN = 1.0;\nfor (var it = 0; it \u003c 60; it++) {\nfor (var j = 0; j \u003c ring.length; j++) {\nvar p = ring[j], q = ring[(j + 1) % ring.length];\nvar gap = q.a - p.a + (j === ring.length - 1 ? 2 * Math.PI : 0);\nif (gap \u003c MIN) { var push = (MIN - gap) \/ 2; p.a -= push; q.a += push; }\n}\n}\nring.forEach(function (o) {\no.m.b.style.left = (4.8 + R * Math.cos(o.a) - 1.45).toFixed(2) + \"em\";\no.m.b.style.top = (4.8 - R * Math.sin(o.a) - 1.45).toFixed(2) + \"em\";\n});\nmid.forEach(function (o, j) {\nvar x = mid.length === 1 ? 0 : (o.toward ? -0.8 : 0.8);\no.m.b.style.left = (4.8 + x * 1.9 - 1.45).toFixed(2) + \"em\";\no.m.b.style.top = (4.8 - 1.45).toFixed(2) + \"em\";\n});\n}\nfunction upSide() {\nvar B = basis(), best = 4, bv = -9;\nDIRS.forEach(function (d, di) { var v = dot(d, B.Y); if (v \u003e bv + 1e-9) { bv = v; best = di; } });\nreturn best;\n}\nfunction turnAxis(vec) {\nvar best = 0, bv = 0;\nfor (var a = 0; a \u003c 3; a++) if (Math.abs(vec[a]) \u003e Math.abs(bv)) { bv = vec[a]; best = a; }\nreturn [best, bv \u003c 0];\n}\nfunction render() {\nvar lk = locked();\nvar on = game.inPlay();\ncountEl.textContent = fmt(t.moves, { n: game.moves });\nif (FREE !== Infinity) {\nvar left = FREE - game.moves;\nfreeEl.textContent = left \u003c= 0 ? t.freeNone : left === 1 ? t.freeOne : fmt(t.free, { n: left });\n}\nlockEl.hidden = !lk;\nvar can = sel != null \u0026\u0026 game.P[sel] \u0026\u0026 game.P[sel].on \u0026\u0026 !lk \u0026\u0026 !won;\nmvb.forEach(function (m) { m.b.disabled = lk || won; m.b.setAttribute(\"aria-disabled\", can ? \"false\" : \"true\"); });\nvar fr = can \u0026\u0026 game.free(sel);\nbTurnX.disabled = bTurnY.disabled = bTurnZ.disabled = !fr;\nbTray.disabled = !can || (on.length \u003e 1 \u0026\u0026 !game.clearWay(sel));\nbUndo.disabled = lk || !game.canUndo();\nbTog.hidden = !pending;\nsayEl.textContent = msg;\nif (won) { winEl.hidden = false; winEl.textContent = fmt(T.win, { n: game.moves }); }\nelse winEl.hidden = true;\nroot.setAttribute(\"data-state\", won ? \"done\" : lk ? \"locked\" : \"play\");\nroot.setAttribute(\"data-moves\", String(game.moves));\nlayoutPad();\ndrawTray();\nschedule();\n}\nfunction after(res, di) {\nif (res.ok \u0026\u0026 res.moved) {\nvar d = DIRS[di], tnow = now();\nres.moved.forEach(function (i) { if (game.P[i].on) anim[i] = { v: [-d[0], -d[1], -d[2]], t0: tnow, ms: 130 }; });\n}\nif (res.ok \u0026\u0026 res.out != null) {\nif (sel === res.out) sel = null;\nmsg = fmt(t.out, { Name: Name(res.out) });\n}\nif (res.ok) {\nwon = game.won();\nif (locked() \u0026\u0026 !won) { msg = \"\"; track(\"demo_limit_reached\", handle); }\n}\n}\nfunction act(di) {\npending = null;\nif (locked() || won) return;\nif (sel == null || !game.P[sel].on) { msg = t.pick; render(); return; }\nvar res = game.slide(sel, di);\nif (res.ok) { msg = \"\"; after(res, di); render(); return; }\nif (res.why === \"alone\") msg = t.alone;\nelse if (res.why === \"blocked\") {\nvar tend = now() + 700;\nres.by.forEach(function (j) { flash[j] = tend; });\nif (res.group) {\nvar others = res.group.filter(function (j) { return j !== sel; });\nmsg = fmt(t.push, { list: names(others) });\npending = { group: res.group, di: di };\n} else msg = fmt(t.pushAll, { list: names(res.by) });\n} else msg = t.pick;\nrender();\n}\nfunction together() {\nif (!pending || locked() || won) return;\nvar p = pending;\npending = null;\nvar res = game.slideGroup(p.group, p.di);\nif (res.ok) { msg = \"\"; after(res, p.di); }\nelse msg = res.why === \"far\" ? t.far : fmt(t.blocked, { list: names(res.by || []) });\nrender();\n}\nfunction bringIn(i) {\npending = null;\nif (locked() || won || game.P[i].on) return;\nvar sideDi = upSide(), res = game.spawn(i, sideDi);\nif (!res.ok) return;\nsel = i;\nvar d = DIRS[sideDi];\nif (game.inPlay().length \u003e 1) anim[i] = { v: [d[0] * 2, d[1] * 2, d[2] * 2], t0: now(), ms: 180 };\nmsg = fmt(t.inNow, { Name: Name(i) });\nrender();\n}\nfunction turn(vec) {\npending = null;\nif (sel == null || locked() || won) return;\nvar ta = turnAxis(vec), res = game.turn(sel, ta[0], ta[1]);\nmsg = res.ok ? \"\" : res.why === \"room\" ? t.noRoom : t.noTurn;\nrender();\n}\nvar awake = false, drag = null;\nfunction wake(on) {\nif (awake === on) return;\nawake = on;\nroot.setAttribute(\"data-play\", on ? \"1\" : \"0\");\n}\nroot.setAttribute(\"data-play\", \"0\");\nif (window.IntersectionObserver) {\nnew window.IntersectionObserver(function (es) {\nfor (var k = 0; k \u003c es.length; k++) if (!es[k].isIntersecting) { drag = null; wake(false); }\n}, { threshold: 0 }).observe(root);\n} else {\nwindow.addEventListener(\"scroll\", function () {\nvar r = root.getBoundingClientRect();\nif (r.bottom \u003c 0 || r.top \u003e (window.innerHeight || 0)) { drag = null; wake(false); }\n}, { passive: true });\n}\ncv.addEventListener(\"pointerdown\", function (e) {\nvar touch = e.pointerType \u0026\u0026 e.pointerType !== \"mouse\";\nif (!touch) wake(true);\ndrag = { x: e.clientX, y: e.clientY, yaw: yaw, pitch: pitch, moved: false, id: e.pointerId, sleep: !awake };\nif (!awake) return;\ntry { cv.setPointerCapture(e.pointerId); } catch (er) {  }\ne.preventDefault();\n});\ncv.addEventListener(\"pointermove\", function (e) {\nif (!drag || e.pointerId !== drag.id) return;\nvar dx = e.clientX - drag.x, dy = e.clientY - drag.y;\nif (drag.sleep) { if (dx * dx + dy * dy \u003e= 100) drag.moved = true; return; }\nif (!drag.moved \u0026\u0026 dx * dx + dy * dy \u003c 36) return;\ndrag.moved = true;\nyaw = drag.yaw - dx * 0.011;\npitch = Math.max(-1.45, Math.min(1.45, drag.pitch + dy * 0.011));\nlayoutPad();\ndrawTray();\nschedule();\ne.preventDefault();\n});\nfunction hitAt(x, y) {\nfor (var j = drawn.length - 1; j \u003e= 0; j--) {\nvar P = drawn[j].pts, inside = true, sgn = 0;\nfor (var k = 0; k \u003c 4; k++) {\nvar a = P[k], b = P[(k + 1) % 4];\nvar cr = (b[0] - a[0]) * (y - a[1]) - (b[1] - a[1]) * (x - a[0]);\nif (Math.abs(cr) \u003c 1e-9) continue;\nif (!sgn) sgn = cr \u003e 0 ? 1 : -1;\nelse if ((cr \u003e 0 ? 1 : -1) !== sgn) { inside = false; break; }\n}\nif (inside) return drawn[j].i;\n}\nreturn null;\n}\nfunction up(e) {\nif (!drag || e.pointerId !== drag.id) return;\nvar d = drag;\ndrag = null;\nif (d.moved) return;\nif (d.sleep) { wake(true); return; }\nvar r = cv.getBoundingClientRect(), dpr = cv.width \/ (r.width || 1);\nvar hit = hitAt((e.clientX - r.left) * dpr, (e.clientY - r.top) * dpr);\npending = null;\nif (table()) {\nif (hit != null) bringIn(hit);\nreturn;\n}\nsel = hit;\nmsg = \"\";\nrender();\n}\ncv.addEventListener(\"pointerup\", up);\ncv.addEventListener(\"pointercancel\", function () { drag = null; });\nmvb.forEach(function (m, di) { m.b.addEventListener(\"click\", function () { wake(true); act(di); }); });\nslots.forEach(function (sl, i) { sl.b.addEventListener(\"click\", function () { wake(true); bringIn(i); }); });\nbTurnY.addEventListener(\"click\", function () { turn(basis().Y); });\nbTurnX.addEventListener(\"click\", function () { turn(basis().X); });\nbTurnZ.addEventListener(\"click\", function () { var D = basis().D; turn([-D[0], -D[1], -D[2]]); });\nbTray.addEventListener(\"click\", function () {\npending = null;\nif (sel == null || locked() || won) return;\nvar res = game.toTray(sel);\nif (res.ok) { msg = fmt(t.out, { Name: Name(sel) }); sel = null; }\nelse msg = t.stuck;\nrender();\n});\nbTog.addEventListener(\"click\", together);\nbUndo.addEventListener(\"click\", function () {\nif (locked()) return;\nif (game.undo()) {\npending = null; won = false; msg = \"\";\nif (sel != null \u0026\u0026 !game.P[sel].on) sel = null;\nrender();\n}\n});\nbReset.addEventListener(\"click\", function () {\ngame.reset(); sel = null; pending = null; won = false; anim = {}; msg = t.empty;\nview.s = 0;\nrender();\n});\nbuyEl.addEventListener(\"click\", function (e) {\ntrack(\"demo_limit_atc\", handle);\nvar b = buyButton(root);\nif (!b) return;\ne.preventDefault();\nif (b.disabled) { if (b.scrollIntoView) b.scrollIntoView({ block: \"center\" }); return; }\nb.click();\n});\nif (window.ResizeObserver) new window.ResizeObserver(function () { drawTray(); schedule(); }).observe(viewEl);\nelse window.addEventListener(\"resize\", function () { drawTray(); schedule(); });\nrender();\n}\nwindow.GPBR = { mount: mount, v: 1 };\n})();\n(function(){var C={\"v\":1,\"text\":\"boards\",\"pieces\":[[[0,0,0],[0,1,0],[0,2,0],[0,3,0],[0,4,0],[1,0,0],[1,2,0],[1,4,0],[2,0,0],[2,3,0],[2,4,0],[3,0,0],[3,4,0],[4,0,0],[5,0,0],[5,2,0],[5,4,0],[6,0,0],[6,1,0],[6,2,0],[6,3,0],[6,4,0]],[[0,0,0],[0,1,0],[0,2,0],[0,3,0],[0,4,0],[1,0,0],[1,2,0],[1,4,0],[2,2,0],[3,0,0],[3,2,0],[3,3,0],[3,4,0],[4,0,0],[4,2,0],[5,0,0],[5,2,0],[5,4,0],[6,0,0],[6,1,0],[6,2,0],[6,3,0],[6,4,0]],[[0,0,0],[0,1,0],[0,2,0],[0,3,0],[0,4,0],[1,0,0],[1,2,0],[1,4,0],[2,0,0],[2,2,0],[2,4,0],[3,0,0],[3,2,0],[3,4,0],[4,0,0],[4,2,0],[4,4,0],[5,0,0],[5,2,0],[5,4,0],[6,0,0],[6,1,0],[6,2,0],[6,3,0],[6,4,0]],[[0,0,0],[0,1,0],[0,2,0],[0,3,0],[0,4,0],[1,0,0],[1,2,0],[1,4,0],[2,0,0],[2,4,0],[3,0,0],[3,4,0],[4,0,0],[5,0,0],[5,2,0],[5,4,0],[6,0,0],[6,1,0],[6,2,0],[6,3,0],[6,4,0]],[[0,0,0],[0,1,0],[0,2,0],[0,3,0],[0,4,0],[1,0,0],[1,2,0],[1,4,0],[2,0,0],[2,4,0],[3,0,0],[3,4,0],[4,0,0],[5,0,0],[5,2,0],[5,4,0],[6,0,0],[6,1,0],[6,2,0],[6,3,0],[6,4,0]],[[0,0,0],[0,1,0],[0,2,0],[0,3,0],[0,4,0],[1,0,0],[1,2,0],[1,4,0],[2,0,0],[2,2,0],[2,4,0],[3,0,0],[3,4,0],[4,0,0],[5,0,0],[5,2,0],[5,4,0],[6,0,0],[6,1,0],[6,2,0],[6,3,0],[6,4,0]]],\"colors\":[\"#E8E4DA\",\"#E9A07E\",\"#9CC5A6\",\"#F0CF86\",\"#8FA6D6\",\"#C99BC4\"],\"goal\":{\"type\":\"slots\",\"span\":[7,7,7],\"slots\":[[[0,1,2],[7,5,1]],[[2,0,1],[1,7,5]],[[1,2,0],[5,1,7]],[[0,1,4],[7,5,1]],[[4,0,1],[1,7,5]],[[1,4,0],[5,1,7]]]},\"free\":0};var s=document.currentScript,r=s\u0026\u0026s.previousElementSibling;if(!r||(\" \"+r.className+\" \").indexOf(\" gpbr \")\u003c0)r=document.querySelector(\".gpbr:not([data-gpbr-on])\");if(!r||!window.GPBR)return;var go=function(){window.GPBR.mount(r,C);};if(window.IntersectionObserver){var o=new IntersectionObserver(function(e){if(e[0]\u0026\u0026e[0].isIntersecting){o.disconnect();go();}},{rootMargin:\"600px 0px\"});o.observe(r);}else go();})();\n\u003c\/script\u003e\n\u003cp class=\"gp-tm-note\" style=\"font-size:1.2rem;opacity:.7;margin-top:2.4rem\"\u003eGordian's Knot is a trademark of ThinkFun. Greg Puzzles is not affiliated with ThinkFun.\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":51347709919399,"sku":"GP-EXTRTORT","price":20.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/extreme_torture_marble.png?v=1790218328"},{"product_id":"microma","title":"Microma | Pack 3 Pieces in a Small Box","description":"\u003ch2\u003eMicroma - Quick Summary\u003c\/h2\u003e\n\u003cp\u003eMicroma is a 3D dynamic packing puzzle designed by \u003ca href=\"\/he\/collections\/andreas-rover\"\u003eAndreas Röver\u003c\/a\u003e. Your goal: pack all of the pieces into the box. Rotations are allowed. Do not disassemble the pieces.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eBest for:\u003c\/strong\u003e MINIMA puzzle lovers, and as a gift for clever people who assume they will crack it in five minutes. It is waaay harder than it looks.\u003c\/p\u003e\n\u003ch2\u003eWhy We Carry It\u003c\/h2\u003e\n\u003cp\u003eMicroma was Andreas Röver's exchange puzzle at the 2026 International Puzzle Party in Assisi - an international gathering of a closed circle of puzzle collectors, where brand-new puzzles are introduced and exchanged.\u003c\/p\u003e\n\u003cp\u003eI solved it there, and I immediately knew I wanted to share this design with you all. \u003ca href=\"\/he\/collections\/frederic-boucher\"\u003eFrederic Boucher\u003c\/a\u003e's MINIMA series has inspired a whole wave of designers, and this could be one of the most brilliant MINIMA-inspired designs out there.\u003c\/p\u003e\n\u003ch2\u003eThe Rules\u003c\/h2\u003e\n\u003cp\u003ePack every piece into the box. Rotations are allowed, which is where the difficulty lives - a piece that clearly does not fit in one orientation may fit perfectly in another, and finding which is the whole puzzle.\u003c\/p\u003e\n\u003cp\u003eOne rule matters more than the rest: do not disassemble the pieces. A smart guy I know did it once. Don't do it. They are meant to stay whole. If you find yourself pulling one apart, you have left the puzzle and started a different one.\u003c\/p\u003e\n\u003ch2\u003eFrequently Asked Questions\u003c\/h2\u003e\n\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWhat is Microma?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eMicroma is a 3D dynamic packing puzzle designed by Andreas Röver. The goal is to pack all of the pieces into the box, with rotations allowed and no disassembly of the pieces themselves.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eAre rotations allowed?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eYes. Rotating pieces is part of the intended solution, not a workaround.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eCan I take the pieces apart?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eNo. The pieces are meant to stay intact - disassembling them is not part of the solution.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWho designed Microma?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eAndreas Röver. Microma was his exchange puzzle at the 2026 International Puzzle Party in Assisi, Italy.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":51349310636199,"sku":"GP-MICR","price":21.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/microma_marble.png?v=1789665715"},{"product_id":"zigzag","title":"ZigZag | The First Separated Board Burr","description":"\u003ch2\u003eZigZag - Quick Summary\u003c\/h2\u003e\n\u003cp\u003eZigZag is the first separated board burr ever built, designed by Frans de Vreugd in 2002 from an idea by Jim Gooch. Six flat boards, level 7.8: seven moves to split the puzzle into two identical halves, then eight more to free a board from each half. Hard difficulty, 1-4 hour solve time. Ships disassembled.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eBest for:\u003c\/strong\u003e burr collectors who want the puzzle that started a whole family of designs, and solvers stepping up from standard six-piece burrs into board burrs for the first time.\u003c\/p\u003e\n\u003ch2\u003eIt Started With One Sentence\u003c\/h2\u003e\n\u003cp\u003eA standard six board burr has six flat pieces grouped in three pairs. Jim Gooch, a puzzle maker from Oregon, suggested to Frans de Vreugd that you could pull the two boards in each pair one unit apart and see what happened. The shape that came back was more open, with far more room for complicated movement, and nobody knew whether a working set of pieces even existed.\u003c\/p\u003e\n\u003cp\u003eDe Vreugd spent a full day on it. Hundreds of combinations came apart into nothing. Then he tried two zigzag-shaped boards, and this puzzle fell out of it. George Miller had a small run made within days, and it was introduced at the fifth Gathering for Gardner in Atlanta.\u003c\/p\u003e\n\u003ch2\u003eSeven Moves, Then It Splits\u003c\/h2\u003e\n\u003cp\u003eThe piece set is completely symmetrical, and so is the solution. Seven moves in, the whole lattice comes apart into two identical halves. Then you need another eight to get a board out of each half.\u003c\/p\u003e\n\u003cp\u003eThat symmetry is why ZigZag is the right place to start with this family. There is a logic you can actually see once you find it, which is not something you can say about \u003ca href=\"\/he\/products\/torture\"\u003eTorture\u003c\/a\u003e or \u003ca href=\"\/he\/products\/extreme-torture\"\u003eExtreme Torture\u003c\/a\u003e. It is also not the only way through - there is a shorter route and a couple of longer ones - so the puzzle forgives you a little.\u003c\/p\u003e\n\u003cp\u003eOurs is printed in two colours, which makes it much easier to keep track of which board you just moved.\u003c\/p\u003e\n\u003ch2\u003eIt Arrives in Pieces\u003c\/h2\u003e\n\u003cp\u003eSix loose boards, no solved reference to copy and no photograph to work backwards from. Assembly is the puzzle. Handing it over already built would remove the point of it.\u003c\/p\u003e\n\u003cp\u003eIf you already know you want the whole family, ZigZag, Torture and Extreme Torture are sold together as the \u003ca href=\"\/he\/products\/separated-board-burr-set\"\u003eSeparated Board Burr Set\u003c\/a\u003e.\u003c\/p\u003e\n\u003ch2\u003eFrequently Asked Questions\u003c\/h2\u003e\n\u003ch3\u003eWhat is a separated board burr?\u003c\/h3\u003e\n\u003cp\u003eA standard six board burr has six flat pieces in three pairs. In a separated board burr the two boards in each pair sit one unit apart instead of flush together. The gap opens the shape up and leaves room for far longer move sequences. Jim Gooch suggested the idea in 2002, Frans de Vreugd designed the puzzles that came out of it.\u003c\/p\u003e\n\u003ch3\u003eHow hard is ZigZag?\u003c\/h3\u003e\n\u003cp\u003eHard, not Expert. Seven moves to split it and eight more after that, with a symmetry you can lean on. It is the gentlest of de Vreugd's three separated board burrs, and the one to own first.\u003c\/p\u003e\n\u003ch3\u003eDoes ZigZag arrive assembled?\u003c\/h3\u003e\n\u003cp\u003eNo. It ships as six separate boards. Assembling it is the challenge.\u003c\/p\u003e\n\u003ch3\u003eWho designed ZigZag?\u003c\/h3\u003e\n\u003cp\u003eFrans de Vreugd, in 2002, from a suggestion by Jim Gooch. The original run was made by George Miller for the fifth Gathering for Gardner.\u003c\/p\u003e\n\u003cdiv class=\"gpbr\" data-handle=\"zigzag\"\u003e\n\u003cstyle\u003e\n.gpbr{--gpbr-fg:rgb(var(--color-foreground,18,18,18));\n --gpbr-line:rgba(var(--color-foreground,18,18,18),.18);\n --gpbr-muted:rgba(var(--color-foreground,18,18,18),.72);\n --gpbr-accent:#02A9F7;\n font-family:inherit;color:var(--gpbr-fg);margin:1.2em 0;max-width:32em}\n.gpbr *{box-sizing:border-box}\n.gpbr .gpbr-h{font-family:inherit;font-size:1.2em;line-height:1.3;font-weight:600;\n letter-spacing:normal;text-transform:none;margin:0 0 .3em;color:var(--gpbr-fg)}\n.gpbr .gpbr-goal{font-size:1em;line-height:1.4;font-weight:600;margin:0 0 .2em;color:var(--gpbr-fg)}\n.gpbr .gpbr-rule{font-size:.86em;line-height:1.45;margin:0 0 .75em;color:var(--gpbr-muted);max-width:36em}\n.gpbr .gpbr-stage{display:flex;flex-direction:column;gap:.5em;direction:ltr}\n.gpbr .gpbr-view{position:relative;width:100%;border-radius:8px;overflow:hidden;\n background:radial-gradient(ellipse at 50% 42%,#FFFFFF 0%,#F3F2EE 70%,#ECEAE4 100%);border:1px solid var(--gpbr-line)}\n.gpbr canvas.gpbr-cv{display:block;width:100%;height:auto;aspect-ratio:1\/0.8;touch-action:pan-y;cursor:grab;\n -webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;outline:none}\n.gpbr canvas.gpbr-cv:active{cursor:grabbing}\n.gpbr[data-play=\"1\"] canvas.gpbr-cv{touch-action:none}\n.gpbr .gpbr-veil{position:absolute;left:0;right:0;bottom:.8em;display:flex;justify-content:center;pointer-events:none;\n opacity:1;transition:opacity .25s}\n.gpbr[data-play=\"1\"] .gpbr-veil{opacity:0}\n.gpbr .gpbr-veil-t{font-size:.85em;line-height:1.2;font-weight:600;color:var(--gpbr-fg);padding:.5em 1em;border-radius:999px;\n background:rgba(255,255,255,.88);border:1px solid var(--gpbr-line);box-shadow:0 1px 3px rgba(0,0,0,.08)}\n.gpbr .gpbr-tray{display:flex;flex-wrap:wrap;align-items:center;gap:.4em;min-height:3.6em;padding:.35em .5em;\n border-radius:8px;border:1px dashed var(--gpbr-line)}\n.gpbr .gpbr-tray-h{font-size:.75em;line-height:1;color:var(--gpbr-muted);margin-inline-end:.3em}\n.gpbr button.gpbr-slot{position:relative;appearance:none;-webkit-appearance:none;margin:0;padding:0;width:3.4em;height:3.4em;\n border:1px solid var(--gpbr-line);border-radius:7px;background:#FAFAF8;cursor:pointer;box-shadow:none;\n -webkit-tap-highlight-color:transparent}\n.gpbr button.gpbr-slot[hidden]{display:none}\n.gpbr button.gpbr-slot:hover{border-color:var(--gpbr-accent)}\n.gpbr button.gpbr-slot:disabled{opacity:.5;cursor:default}\n.gpbr canvas.gpbr-thumb{display:block;width:100%;height:100%;pointer-events:none}\n.gpbr .gpbr-num{position:absolute;top:.15em;left:.3em;font-size:.68em;line-height:1;font-weight:600;color:var(--gpbr-muted);pointer-events:none}\n.gpbr .gpbr-ctl{display:flex;flex-wrap:wrap;align-items:center;gap:.6em 1em;margin-top:.6em;direction:ltr}\n.gpbr .gpbr-pad{position:relative;width:9.6em;height:9.6em;flex:none;border-radius:50%;background:rgba(var(--color-foreground,18,18,18),.035)}\n.gpbr button.gpbr-mv{position:absolute;appearance:none;-webkit-appearance:none;margin:0;padding:.45em;width:2.9em;height:2.9em;\n border:2px solid;border-radius:50%;background:#fff;cursor:pointer;box-shadow:0 1px 2px rgba(0,0,0,.12);\n -webkit-tap-highlight-color:transparent;touch-action:manipulation;transition:left .12s,top .12s}\n.gpbr button.gpbr-mv svg{display:block;pointer-events:none}\n.gpbr button.gpbr-mv[aria-disabled=\"true\"]{opacity:.55}\n.gpbr button.gpbr-mv:disabled{opacity:.3;cursor:default}\n.gpbr .gpbr-side{display:flex;flex-wrap:wrap;gap:.45em;flex:1 1 9em;align-content:center}\n.gpbr .gpbr-side button,.gpbr .gpbr-bar button,.gpbr button.gpbr-tog{appearance:none;-webkit-appearance:none;margin:0;border:1px solid var(--gpbr-line);\n background:transparent;color:var(--gpbr-fg);font-family:inherit;font-size:.85em;line-height:1.2;\n letter-spacing:normal;text-transform:none;min-height:2.9em;padding:.6em .9em;border-radius:6px;\n cursor:pointer;box-shadow:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}\n.gpbr .gpbr-side button{flex:1 1 4.2em;padding:.6em .4em;white-space:nowrap}\n.gpbr .gpbr-side button:hover,.gpbr .gpbr-bar button:hover,.gpbr button.gpbr-tog:hover{border-color:var(--gpbr-accent)}\n.gpbr .gpbr-side button:disabled,.gpbr .gpbr-bar button:disabled{opacity:.38;cursor:default}\n.gpbr .gpbr-side button:disabled:hover,.gpbr .gpbr-bar button:disabled:hover{border-color:var(--gpbr-line)}\n.gpbr .gpbr-sayrow{display:flex;flex-wrap:wrap;align-items:center;gap:.4em .8em;margin:.6em 0 0;min-height:1.45em}\n.gpbr .gpbr-say{flex:1 1 14em;font-size:.88em;line-height:1.45;color:var(--gpbr-muted);min-height:1.45em;margin:0}\n.gpbr button.gpbr-tog{border-color:var(--gpbr-accent);font-weight:600}\n.gpbr button.gpbr-tog[hidden]{display:none}\n.gpbr .gpbr-win{font-size:.98em;line-height:1.45;font-weight:600;color:var(--gpbr-fg);margin:.5em 0 0;\n padding:.55em .8em;border-radius:6px;background:#E8F7FD;border-inline-start:3px solid var(--gpbr-accent)}\n.gpbr .gpbr-win[hidden]{display:none}\n.gpbr .gpbr-bar{display:flex;flex-wrap:wrap;align-items:center;gap:.45em;margin-top:.75em}\n.gpbr .gpbr-stat{display:flex;flex-direction:column;gap:.1em;margin-inline-end:auto}\n.gpbr .gpbr-count{font-size:.95em;line-height:1.2;font-weight:600;font-variant-numeric:tabular-nums;color:var(--gpbr-fg)}\n.gpbr .gpbr-free{font-size:.8em;line-height:1.25;font-weight:400;color:var(--gpbr-muted)}\n.gpbr .gpbr-lock{display:flex;flex-wrap:wrap;align-items:center;gap:.6em .9em;margin-top:.75em;\n padding:.8em .9em;border-radius:7px;background:#E8F7FD;border:1px solid rgba(2,169,247,.35)}\n.gpbr .gpbr-lock[hidden]{display:none}\n.gpbr .gpbr-lock-line{flex:1 1 12em;margin:0;font-size:.95em;line-height:1.4;font-weight:600;color:var(--gpbr-fg)}\n.gpbr a.gpbr-buy,.gpbr a.gpbr-buy:visited{display:inline-block;flex:none;padding:.7em 1.2em;border-radius:6px;\n background:var(--gpbr-accent);color:#121212;font-family:inherit;font-size:.92em;line-height:1.2;font-weight:600;\n letter-spacing:normal;text-decoration:none;text-transform:none;cursor:pointer;-webkit-tap-highlight-color:transparent}\n.gpbr a.gpbr-buy:hover{background:#2BB8F8;color:#121212;text-decoration:none}\n.gpbr .gpbr-credit{font-size:.72em;line-height:1.4;color:var(--gpbr-muted);margin:.9em 0 0;opacity:.85}\n@media (min-width:600px){\n .gpbr .gpbr-stage{flex-direction:row;align-items:stretch}\n .gpbr .gpbr-view{flex:1 1 auto;min-width:0}\n .gpbr .gpbr-tray{flex-direction:column;flex-wrap:nowrap;justify-content:flex-start;width:4.6em;flex:none;padding:.5em .4em}\n .gpbr .gpbr-tray-h{margin:0 0 .2em}\n}\n\u003c\/style\u003e\n\u003c\/div\u003e\n\u003cscript\u003e\n(function () {\n\"use strict\";\nif (window.GPBR_ENGINE) return;\nvar DIRS = [[1, 0, 0], [-1, 0, 0], [0, 1, 0], [0, -1, 0], [0, 0, 1], [0, 0, -1]];\nvar FAR = 6;\nfunction det(m) {\nreturn m[0][0] * (m[1][1] * m[2][2] - m[1][2] * m[2][1]) -\nm[0][1] * (m[1][0] * m[2][2] - m[1][2] * m[2][0]) +\nm[0][2] * (m[1][0] * m[2][1] - m[1][1] * m[2][0]);\n}\nvar ROTS = [];\n(function () {\nvar perms = [[0, 1, 2], [0, 2, 1], [1, 0, 2], [1, 2, 0], [2, 0, 1], [2, 1, 0]];\nfor (var p = 0; p \u003c 6; p++) {\nfor (var s = 0; s \u003c 8; s++) {\nvar m = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];\nfor (var r = 0; r \u003c 3; r++) m[r][perms[p][r]] = (s \u003e\u003e r \u0026 1) ? -1 : 1;\nif (det(m) === 1) ROTS.push(m);\n}\n}\n})();\nfunction mmul(a, b) {\nvar o = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];\nfor (var r = 0; r \u003c 3; r++) for (var c = 0; c \u003c 3; c++)\nfor (var k = 0; k \u003c 3; k++) o[r][c] += a[r][k] * b[k][c];\nreturn o;\n}\nfunction rotIndex(m) {\nfor (var i = 0; i \u003c ROTS.length; i++) {\nvar R = ROTS[i], same = true;\nfor (var r = 0; r \u003c 3 \u0026\u0026 same; r++) for (var c = 0; c \u003c 3; c++) if (R[r][c] !== m[r][c]) { same = false; break; }\nif (same) return i;\n}\nreturn -1;\n}\nvar MUL = ROTS.map(function (a) { return ROTS.map(function (b) { return rotIndex(mmul(a, b)); }); });\nvar QT = [rotIndex([[1, 0, 0], [0, 0, -1], [0, 1, 0]]),\nrotIndex([[0, 0, 1], [0, 1, 0], [-1, 0, 0]]),\nrotIndex([[0, -1, 0], [1, 0, 0], [0, 0, 1]])];\nvar ID = rotIndex([[1, 0, 0], [0, 1, 0], [0, 0, 1]]);\nfunction dot(a, b) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; }\nfunction key(x, y, z) { return ((x + 512) * 1024 + (y + 512)) * 1024 + (z + 512); }\nfunction axisOf(d) { return d[0] ? 0 : d[1] ? 1 : 2; }\nfunction signOf(d) { return d[0] + d[1] + d[2]; }\nfunction gaps(a, b) {\nvar g = [];\nfor (var k = 0; k \u003c 3; k++) g.push(Math.max(a.lo[k] - b.hi[k] - 1, b.lo[k] - a.hi[k] - 1));\nreturn g;\n}\nfunction Game(C) {\nthis.C = C;\nthis.n = C.pieces.length;\nthis.shapes = {};\nthis.reset();\n}\nvar G = Game.prototype;\nG.reset = function () {\nthis.P = [];\nfor (var i = 0; i \u003c this.n; i++) this.P.push({ on: false, r: ID, p: [0, 0, 0] });\nthis.moves = 0;\nthis.hist = [];\n};\nG.snap = function () {\nreturn { P: this.P.map(function (q) { return { on: q.on, r: q.r, p: q.p.slice() }; }), moves: this.moves };\n};\nG.save = function () { this.hist.push(this.snap()); };\nG.canUndo = function () { return this.hist.length \u003e 0; };\nG.undo = function () {\nvar s = this.hist.pop();\nif (!s) return false;\nthis.P = s.P;\nreturn true;\n};\nG.shape = function (i, r) {\nvar k = i + \"\/\" + r, sh = this.shapes[k];\nif (sh) return sh;\nvar R = ROTS[r], cs = this.C.pieces[i], out = [], lo = [1e9, 1e9, 1e9], hi = [-1e9, -1e9, -1e9];\nfor (var j = 0; j \u003c cs.length; j++) {\nvar c = cs[j], v = [0, 0, 0];\nfor (var a = 0; a \u003c 3; a++) {\nv[a] = R[a][0] * c[0] + R[a][1] * c[1] + R[a][2] * c[2];\nif (v[a] \u003c lo[a]) lo[a] = v[a];\nif (v[a] \u003e hi[a]) hi[a] = v[a];\n}\nout.push(v);\n}\nfor (j = 0; j \u003c out.length; j++) for (a = 0; a \u003c 3; a++) out[j][a] -= lo[a];\nsh = { c: out, s: [hi[0] - lo[0] + 1, hi[1] - lo[1] + 1, hi[2] - lo[2] + 1] };\nthis.shapes[k] = sh;\nreturn sh;\n};\nG.cells = function (i) {\nvar q = this.P[i], sh = this.shape(i, q.r);\nreturn sh.c.map(function (c) { return [c[0] + q.p[0], c[1] + q.p[1], c[2] + q.p[2]]; });\n};\nG.box = function (i) {\nvar q = this.P[i], s = this.shape(i, q.r).s;\nreturn { lo: q.p.slice(), hi: [q.p[0] + s[0] - 1, q.p[1] + s[1] - 1, q.p[2] + s[2] - 1] };\n};\nG.boxOf = function (list) {\nvar lo = [1e9, 1e9, 1e9], hi = [-1e9, -1e9, -1e9];\nfor (var j = 0; j \u003c list.length; j++) {\nvar b = this.box(list[j]);\nfor (var a = 0; a \u003c 3; a++) {\nif (b.lo[a] \u003c lo[a]) lo[a] = b.lo[a];\nif (b.hi[a] \u003e hi[a]) hi[a] = b.hi[a];\n}\n}\nreturn { lo: lo, hi: hi };\n};\nG.inPlay = function () {\nvar o = [];\nfor (var i = 0; i \u003c this.n; i++) if (this.P[i].on) o.push(i);\nreturn o;\n};\nG.occ = function (skip) {\nvar m = {};\nfor (var i = 0; i \u003c this.n; i++) {\nif (!this.P[i].on || (skip \u0026\u0026 skip[i])) continue;\nvar cs = this.cells(i);\nfor (var j = 0; j \u003c cs.length; j++) m[key(cs[j][0], cs[j][1], cs[j][2])] = i;\n}\nreturn m;\n};\nG.blockers = function (group, d) {\nvar inG = {}, j;\nfor (j = 0; j \u003c group.length; j++) inG[group[j]] = 1;\nvar occ = this.occ(inG), hit = {}, out = [];\nfor (j = 0; j \u003c group.length; j++) {\nvar cs = this.cells(group[j]);\nfor (var k = 0; k \u003c cs.length; k++) {\nvar o = occ[key(cs[k][0] + d[0], cs[k][1] + d[1], cs[k][2] + d[2])];\nif (o !== undefined \u0026\u0026 !hit[o]) { hit[o] = 1; out.push(o); }\n}\n}\nreturn out.sort(function (a, b) { return a - b; });\n};\nG.closure = function (i, d) {\nvar g = [i];\nfor (;;) {\nvar b = this.blockers(g, d);\nif (!b.length) return g.sort(function (a, c) { return a - c; });\ng = g.concat(b);\n}\n};\nG.clearWay = function (i, mine) {\nvar on = this.inPlay(), others = [], k, j;\nmine = mine || this.cells(i);\nfor (k = 0; k \u003c on.length; k++) if (on[k] !== i) {\nvar cs = this.cells(on[k]);\nfor (j = 0; j \u003c cs.length; j++) others.push(cs[j]);\n}\nif (!others.length) return 1;\nfor (var di = 0; di \u003c 6; di++) {\nvar d = DIRS[di], a = axisOf(d), s = signOf(d), free = true;\nfor (j = 0; j \u003c mine.length \u0026\u0026 free; j++) {\nvar c = mine[j];\nfor (k = 0; k \u003c others.length; k++) {\nvar o = others[k], same = true;\nfor (var b = 0; b \u003c 3; b++) if (b !== a \u0026\u0026 o[b] !== c[b]) { same = false; break; }\nif (same \u0026\u0026 (o[a] - c[a]) * s \u003e 0) { free = false; break; }\n}\n}\nif (free) return di + 1;\n}\nreturn 0;\n};\nG.hits = function (i, cells) {\nvar occ = this.occ(null);\nfor (var j = 0; j \u003c cells.length; j++) {\nvar o = occ[key(cells[j][0], cells[j][1], cells[j][2])];\nif (o !== undefined \u0026\u0026 o !== i) return true;\n}\nreturn false;\n};\nG.place = function (i, r, p) {\nreturn this.shape(i, r).c.map(function (c) { return [c[0] + p[0], c[1] + p[1], c[2] + p[2]]; });\n};\nG.spawn = function (i, side) {\nvar q = this.P[i];\nif (q.on) return { ok: false, why: \"on\" };\nvar sh = this.shape(i, q.r), on = this.inPlay(), p = [0, 0, 0];\nif (!on.length) {\nfor (var a = 0; a \u003c 3; a++) p[a] = -Math.floor(sh.s[a] \/ 2);\n} else {\nvar O = this.boxOf(on), d = DIRS[side], ax = axisOf(d);\nfor (a = 0; a \u003c 3; a++) {\nif (a === ax) continue;\np[a] = Math.floor((O.lo[a] + O.hi[a] + 1 - sh.s[a]) \/ 2);\n}\np[ax] = signOf(d) \u003e 0 ? O.hi[ax] + 2 : O.lo[ax] - 1 - sh.s[ax];\n}\nreturn this.spawnAt(i, q.r, p);\n};\nG.spawnAt = function (i, r, p) {\nvar q = this.P[i];\nif (q.on || r \u003c 0 || r \u003e= 24) return { ok: false, why: \"on\" };\nvar cells = this.place(i, r, p);\nif (this.hits(i, cells) || !this.clearWay(i, cells)) return { ok: false, why: \"inside\" };\nthis.save();\nthis.P[i] = { on: true, r: r, p: p.slice() };\nreturn { ok: true, i: i };\n};\nG.slide = function (i, di) {\nvar q = this.P[i], d = DIRS[di];\nif (!q || !q.on) return { ok: false, why: \"pick\" };\nvar on = this.inPlay();\nif (on.length \u003c 2) return { ok: false, why: \"alone\" };\nvar by = this.blockers([i], d);\nif (by.length) {\nvar g = this.closure(i, d);\nreturn { ok: false, why: \"blocked\", by: by, group: g.length \u003c on.length ? g : null };\n}\nvar others = on.filter(function (j) { return j !== i; });\nvar O = this.boxOf(others), before = gaps(this.box(i), O);\nthis.save();\nq.p = [q.p[0] + d[0], q.p[1] + d[1], q.p[2] + d[2]];\nthis.moves++;\nvar after = gaps(this.box(i), O), ax = axisOf(d), res = { ok: true, moved: [i], d: di };\nif (after[ax] \u003e FAR \u0026\u0026 after[ax] \u003e before[ax]) {\nq.on = false;\nres.out = i;\n}\nreturn res;\n};\nG.slideGroup = function (group, di) {\nvar d = DIRS[di], on = this.inPlay(), j;\nif (!group.length || group.length \u003e= on.length) return { ok: false, why: \"all\" };\nfor (j = 0; j \u003c group.length; j++) if (!this.P[group[j]].on) return { ok: false, why: \"pick\" };\nvar by = this.blockers(group, d);\nif (by.length) return { ok: false, why: \"blocked\", by: by, group: null };\nvar inG = {};\nfor (j = 0; j \u003c group.length; j++) inG[group[j]] = 1;\nvar rest = on.filter(function (k) { return !inG[k]; });\nvar O = this.boxOf(rest), B = this.boxOf(group), ax = axisOf(d), before = gaps(B, O);\nvar after = gaps({ lo: [B.lo[0] + d[0], B.lo[1] + d[1], B.lo[2] + d[2]], hi: [B.hi[0] + d[0], B.hi[1] + d[1], B.hi[2] + d[2]] }, O);\nif (after[ax] \u003e FAR \u0026\u0026 after[ax] \u003e before[ax]) return { ok: false, why: \"far\" };\nthis.save();\nfor (j = 0; j \u003c group.length; j++) {\nvar q = this.P[group[j]];\nq.p = [q.p[0] + d[0], q.p[1] + d[1], q.p[2] + d[2]];\n}\nthis.moves++;\nreturn { ok: true, moved: group.slice(), d: di };\n};\nG.free = function (i) {\nvar q = this.P[i];\nreturn !!(q \u0026\u0026 q.on \u0026\u0026 this.clearWay(i));\n};\nG.turn = function (i, ax, back) {\nif (!this.free(i)) return { ok: false, why: \"turn\" };\nvar q = this.P[i], old = this.box(i);\nvar Q = QT[ax];\nif (back) Q = MUL[Q][MUL[Q][Q]];\nvar r = MUL[Q][q.r], s = this.shape(i, r).s, p0 = [0, 0, 0], a;\nfor (a = 0; a \u003c 3; a++) p0[a] = Math.floor((old.lo[a] + old.hi[a] + 1 - s[a]) \/ 2);\nvar on = this.inPlay(), mid = [0, 0, 0], self = this;\nif (on.length \u003e 1) {\nvar O = this.boxOf(on.filter(function (j) { return j !== i; }));\nfor (a = 0; a \u003c 3; a++) mid[a] = (O.lo[a] + O.hi[a] + 1) \/ 2 - (old.lo[a] + old.hi[a] + 1) \/ 2;\n}\nvar order = [0, 1, 2, 3, 4, 5].sort(function (x, y) { return dot(DIRS[x], mid) - dot(DIRS[y], mid); });\nvar tries = [p0];\nfor (var k = 1; k \u003c= 8; k++) order.forEach(function (di) {\nvar d = DIRS[di];\ntries.push([p0[0] + d[0] * k, p0[1] + d[1] * k, p0[2] + d[2] * k]);\n});\nfor (var t = 0; t \u003c tries.length; t++) {\nvar cells = self.place(i, r, tries[t]);\nif (self.hits(i, cells) || !self.clearWay(i, cells)) continue;\nthis.save();\nq.r = r;\nq.p = tries[t];\nreturn { ok: true };\n}\nreturn { ok: false, why: \"room\" };\n};\nG.toTray = function (i) {\nvar q = this.P[i];\nif (!q || !q.on) return { ok: false, why: \"pick\" };\nif (this.inPlay().length \u003e 1 \u0026\u0026 !this.clearWay(i)) return { ok: false, why: \"stuck\" };\nthis.save();\nq.on = false;\nreturn { ok: true, out: i };\n};\nG.won = function () {\nvar on = this.inPlay(), gl = this.C.goal;\nif (on.length !== this.n) return false;\nvar B = this.boxOf(on), dims = [0, 1, 2].map(function (a) { return B.hi[a] - B.lo[a] + 1; });\nif (gl.type === \"box\") {\nvar num = function (x, y) { return x - y; };\nvar want = gl.size.slice().sort(num), got = dims.slice().sort(num);\nreturn want[0] === got[0] \u0026\u0026 want[1] === got[1] \u0026\u0026 want[2] === got[2];\n}\nif (gl.type === \"slots\") {\nfor (var a = 0; a \u003c 3; a++) if (dims[a] !== gl.span[a]) return false;\nvar self = this;\nreturn [0, 1].some(function (mirror) {\nvar want = {};\ngl.slots.forEach(function (sl) {\nvar c = sl[0], s = sl[1];\nif (mirror) { c = [c[1], c[0], c[2]]; s = [s[1], s[0], s[2]]; }\nwant[c.join(\",\") + \"\/\" + s.join(\",\")] = 1;\n});\nreturn on.every(function (i) {\nvar b = self.box(i), lo = [b.lo[0] - B.lo[0], b.lo[1] - B.lo[1], b.lo[2] - B.lo[2]];\nvar s = [b.hi[0] - b.lo[0] + 1, b.hi[1] - b.lo[1] + 1, b.hi[2] - b.lo[2] + 1];\nreturn want[lo.join(\",\") + \"\/\" + s.join(\",\")] === 1;\n});\n});\n}\nreturn false;\n};\nwindow.GPBR_ENGINE = { Game: Game, DIRS: DIRS, ROTS: ROTS, MUL: MUL, QT: QT, ID: ID, gaps: gaps, v: 1 };\n})();\n(function () {\n\"use strict\";\nif (window.GPBR) return;\nvar E = window.GPBR_ENGINE;\nif (!E) return;\nvar NS = \"http:\/\/www.w3.org\/2000\/svg\";\nvar ACC = \"#02A9F7\", BAD = \"#E0533D\";\nvar AXC = [\"#C8553D\", \"#3E8E5A\", \"#3569B8\"];\nvar DIRS = E.DIRS;\nvar seq = 0;\nvar TXT = {\nen: {\ntitle: \"Try it yourself\", play: \"Tap to play\",\nhow: \"Drag the view to turn it. Tap a piece in the tray to bring it in, tap a piece to pick it, then slide it with the arrows.\",\nmoves: \"Moves: {n}\", undo: \"Undo\", reset: \"Start over\", tray: \"Tray\", toTray: \"To tray\",\nturnY: \"Turn\", turnX: \"Tip\", turnZ: \"Spin\", together: \"Move together\",\nslide: \"Slide\", view: \"Puzzle view, drag to turn\",\nempty: \"Tap a piece in the tray to bring it in.\",\npick: \"Tap a piece first.\",\ninNow: \"{Name} is in. Turn it while it is clear, then slide it.\",\nalone: \"Bring in another piece to slide against.\",\nblocked: \"Blocked by {list}.\",\npush: \"It would push {list} too.\",\npushAll: \"Blocked by {list}. Pushing it would move the whole puzzle.\",\nfar: \"That's as far as it goes.\",\nout: \"{Name} is back in the tray.\",\nnoTurn: \"It's held in place. Slide it clear of the others first, then turn it.\",\nnoRoom: \"No room to turn it here. Slide it further out first.\",\nstuck: \"It can't come out from here yet.\",\nnoun: { block: [\"piece {p}\", \"Piece {p}\", \"pieces {a} and {b}\"], boards: [\"board {p}\", \"Board {p}\", \"boards {a} and {b}\"] }, and: \", \",\nfree: \"{n} free moves left\", freeOne: \"1 free move left\", freeNone: \"No free moves left\",\nlockLine: \"That's the free part. Finish it with the real one.\", buy: \"Add to cart\",\ncredit: \"Moves follow the rules of BurrTools, Andreas Röver's free puzzle program.\",\nblock: { goal: \"Put the five pieces together into one solid block.\",\nrule: \"Pieces only slide in straight lines, and a piece can only be turned while it is clear of the others.\",\nwin: \"Done in {n} moves. The block is complete.\" },\nboards: { goal: \"Fit the six boards together into the finished burr.\",\nrule: \"Boards only slide in straight lines, and a board can only be turned while it is clear of the others.\",\nwin: \"Done in {n} moves. All six boards are in place.\" }\n},\nhe: {\ntitle: \"נסו בעצמכם\", play: \"הקישו כדי לשחק\",\nhow: \"גררו את התצוגה כדי לסובב אותה. הקישו על חלק במגש כדי להכניס אותו, הקישו על חלק כדי לבחור בו, ואז הזיזו אותו עם החצים.\",\nmoves: \"מהלכים: {n}\", undo: \"ביטול מהלך\", reset: \"התחלה מחדש\", tray: \"מגש\", toTray: \"למגש\",\nturnY: \"סיבוב\", turnX: \"הטיה\", turnZ: \"גלגול\", together: \"הזיזו יחד\",\nslide: \"הזזה\", view: \"תצוגת הפאזל, גררו כדי לסובב\",\nempty: \"הקישו על חלק במגש כדי להכניס אותו.\",\npick: \"הקישו קודם על חלק.\",\ninNow: \"{Name} בפנים. סובבו אותו כל עוד הוא רחוק מהאחרים, ואז הזיזו אותו.\",\nalone: \"הכניסו עוד חלק כדי שיהיה מול מה להזיז.\",\nblocked: \"חסום על ידי {list}.\",\npush: \"הוא ידחוף גם את {list}.\",\npushAll: \"חסום על ידי {list}. דחיפה תזיז את כל הפאזל.\",\nfar: \"עד כאן אפשר להרחיק אותו.\",\nout: \"{Name} חזר למגש.\",\nnoTurn: \"הוא תקוע במקומו. הרחיקו אותו קודם מהחלקים האחרים, ואז סובבו אותו.\",\nnoRoom: \"אין כאן מקום לסובב אותו. הרחיקו אותו עוד קודם.\",\nstuck: \"עדיין אי אפשר להוציא אותו מכאן.\",\nnoun: { block: [\"חלק {p}\", \"חלק {p}\", \"חלקים {a} ו-{b}\"], boards: [\"לוח {p}\", \"לוח {p}\", \"לוחות {a} ו-{b}\"] }, and: \", \",\nfree: \"נותרו {n} מהלכים חינם\", freeOne: \"נותר מהלך חינם אחד\", freeNone: \"לא נותרו מהלכים חינם\",\nlockLine: \"זה החלק החינמי. סיימו אותו עם הפאזל האמיתי.\", buy: \"הוספה לעגלה\",\ncredit: \"המהלכים פועלים לפי הכללים של BurrTools, תוכנת הפאזלים החופשית של אנדראס רובר.\",\nblock: { goal: \"חברו את חמשת החלקים לקובייה אחת מלאה.\",\nrule: \"החלקים זזים רק בקווים ישרים, ואפשר לסובב חלק רק כשהוא רחוק מהאחרים.\",\nwin: \"הצלחתם ב-{n} מהלכים. הקובייה שלמה.\" },\nboards: { goal: \"חברו את ששת הלוחות לפאזל השלם.\",\nrule: \"הלוחות זזים רק בקווים ישרים, ואפשר לסובב לוח רק כשהוא רחוק מהאחרים.\",\nwin: \"הצלחתם ב-{n} מהלכים. כל ששת הלוחות במקומם.\" }\n},\nja: {\ntitle: \"試してみてください\", play: \"タップして遊ぶ\",\nhow: \"画面をドラッグすると向きが変わります。トレイのピースをタップして入れ、ピースをタップして選び、矢印でスライドさせてください。\",\nmoves: \"手数：{n}\", undo: \"1手戻す\", reset: \"最初から\", tray: \"トレイ\", toTray: \"トレイへ\",\nturnY: \"回す\", turnX: \"倒す\", turnZ: \"ひねる\", together: \"一緒に動かす\",\nslide: \"スライド\", view: \"パズルの表示（ドラッグで回転）\",\nempty: \"トレイのピースをタップして入れてください。\",\npick: \"まずピースをタップしてください。\",\ninNow: \"{Name}が入りました。離れているうちに向きを変えてから、スライドさせてください。\",\nalone: \"もう1つピースを入れてから動かしてください。\",\nblocked: \"{list}に当たって動けません。\",\npush: \"{list}も一緒に押すことになります。\",\npushAll: \"{list}に当たって動けません。押すとパズル全体が動いてしまいます。\",\nfar: \"これ以上は離せません。\",\nout: \"{Name}がトレイに戻りました。\",\nnoTurn: \"今は固定されています。向きを変えるには、まず他のピースから離してください。\",\nnoRoom: \"ここでは回す場所がありません。もう少し離してください。\",\nstuck: \"ここからはまだ取り出せません。\",\nnoun: { block: [\"ピース{p}\", \"ピース{p}\", \"ピース{a}と{b}\"], boards: [\"板{p}\", \"板{p}\", \"板{a}と{b}\"] }, and: \"、\",\nfree: \"無料であと{n}手\", freeOne: \"無料であと1手\", freeNone: \"無料の手はここまで\",\nlockLine: \"無料で遊べるのはここまでです。続きは本物のパズルでどうぞ。\", buy: \"カートに追加\",\ncredit: \"動きのルールは、Andreas Röver さんの無料パズルソフト BurrTools に従っています。\",\nblock: { goal: \"5つのピースを組み合わせて、すき間のない1つのブロックにしてください。\",\nrule: \"ピースはまっすぐスライドするだけです。向きを変えられるのは、他のピースから離れているときだけです。\",\nwin: \"{n}手で完成！ブロックができあがりました。\" },\nboards: { goal: \"6枚の板を組み合わせて、パズルを完成させてください。\",\nrule: \"板はまっすぐスライドするだけです。向きを変えられるのは、他の板から離れているときだけです。\",\nwin: \"{n}手で完成！6枚の板がすべて収まりました。\" }\n}\n};\nfunction langOf() {\nvar l = (document.documentElement.getAttribute(\"lang\") || \"\").toLowerCase();\nif (l.indexOf(\"he\") === 0 || l.indexOf(\"iw\") === 0) return \"he\";\nif (l.indexOf(\"ja\") === 0) return \"ja\";\nreturn \"en\";\n}\nfunction fmt(s, o) {\nreturn s.replace(\/\\{(\\w+)\\}\/g, function (m, k) { return (k in o) ? String(o[k]) : m; });\n}\nfunction el(tag, cls, txt) {\nvar e = document.createElement(tag);\nif (cls) e.className = cls;\nif (txt != null) e.textContent = txt;\nreturn e;\n}\nfunction sv(tag, attrs) {\nvar e = document.createElementNS(NS, tag);\nfor (var k in attrs) if (Object.prototype.hasOwnProperty.call(attrs, k)) e.setAttribute(k, attrs[k]);\nreturn e;\n}\nfunction track(name, handle) {\ntry { if (typeof window.gtag === \"function\") window.gtag(\"event\", name, { product: handle }); } catch (e) {  }\n}\nfunction buyButton(root) {\nvar scopes = [], sec = root.closest ? root.closest(\"section, .shopify-section, product-info\") : null;\nif (sec) scopes.push(sec);\nscopes.push(document);\nfor (var k = 0; k \u003c scopes.length; k++) {\nvar b = scopes[k].querySelector('[id^=\"ProductSubmitButton-\"]');\nif (b \u0026\u0026 !root.contains(b)) return b;\nvar forms = scopes[k].querySelectorAll('form[action*=\"\/cart\/add\"]');\nfor (var i = 0; i \u003c forms.length; i++) {\nif (root.contains(forms[i])) continue;\nvar x = forms[i].querySelector('[type=\"submit\"], button:not([type])');\nif (x) return x;\n}\n}\nreturn null;\n}\nfunction rgb(h) {\nvar n = parseInt(h.slice(1), 16);\nreturn [n \u003e\u003e 16 \u0026 255, n \u003e\u003e 8 \u0026 255, n \u0026 255];\n}\nfunction dot(a, b) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; }\nvar now = (window.performance \u0026\u0026 performance.now) ? function () { return performance.now(); } : function () { return Date.now(); };\nvar CORN = [[0, 0], [1, 0], [1, 1], [0, 1]];\nvar OUTW = [[0, -1], [1, 0], [0, 1], [-1, 0]];\nfunction facesOf(cells) {\nvar has = {}, F = [];\nfunction k(x, y, z) { return x + \",\" + y + \",\" + z; }\ncells.forEach(function (c) { has[k(c[0], c[1], c[2])] = 1; });\ncells.forEach(function (c) {\nfor (var n = 0; n \u003c 6; n++) {\nvar d = DIRS[n];\nif (has[k(c[0] + d[0], c[1] + d[1], c[2] + d[2])]) continue;\nvar a = d[0] ? 0 : d[1] ? 1 : 2, s = d[0] + d[1] + d[2], b = (a + 1) % 3, e = (a + 2) % 3;\nvar pts = CORN.map(function (uv) {\nvar p = [0, 0, 0];\np[a] = c[a] + (s \u003e 0 ? 1 : 0); p[b] = c[b] + uv[0]; p[e] = c[e] + uv[1];\nreturn p;\n});\nvar mask = 0;\nfor (var j = 0; j \u003c 4; j++) {\nvar u = [0, 0, 0];\nu[b] = OUTW[j][0]; u[e] = OUTW[j][1];\nvar m = [c[0] + u[0], c[1] + u[1], c[2] + u[2]];\nvar flat = has[k(m[0], m[1], m[2])] \u0026\u0026 !has[k(m[0] + d[0], m[1] + d[1], m[2] + d[2])];\nif (!flat) mask |= 1 \u003c\u003c j;\n}\nF.push({ n: n, pts: pts, cc: [c[0] + 0.5, c[1] + 0.5, c[2] + 0.5], m: mask });\n}\n});\nreturn F;\n}\nfunction mount(root, C) {\nif (!root || root.getAttribute(\"data-gpbr-on\")) return;\nroot.setAttribute(\"data-gpbr-on\", \"1\");\nvar L = langOf(), t = TXT[L], T = t[C.text] || t.block;\nroot.setAttribute(\"lang\", L);\nroot.setAttribute(\"dir\", L === \"he\" ? \"rtl\" : \"ltr\");\nvar handle = root.getAttribute(\"data-handle\") || \"\";\nvar game = new E.Game(C), n = game.n;\nvar FREE = C.free \u003e 0 ? C.free : Infinity;\nvar COL = (C.colors || []).map(rgb);\nvar yaw = -0.62, pitch = 0.52;\nvar sel = null, pending = null, flash = {}, anim = {}, msg = t.empty, won = false;\nvar faceCache = {};\nvar view = { s: 0, c: [0, 0, 0], ts: 0, tc: [0, 0, 0] };\nvar drawn = [];\nvar dirty = false, raf = 0;\nfunction locked() { return game.moves \u003e= FREE; }\nfunction label(i) { return String(i + 1); }\nvar NOUN = t.noun[C.text] || t.noun.block;\nfunction names(list) {\nif (list.length === 1) return fmt(NOUN[0], { p: label(list[0]) });\nvar head = list.slice(0, -1).map(label).join(t.and);\nreturn fmt(NOUN[2], { a: head, b: label(list[list.length - 1]) });\n}\nfunction Name(i) { return fmt(NOUN[1], { p: label(i) }); }\nroot.appendChild(el(\"h3\", \"gpbr-h\", t.title));\nroot.appendChild(el(\"p\", \"gpbr-goal\", T.goal));\nroot.appendChild(el(\"p\", \"gpbr-rule\", T.rule + (L === \"ja\" ? \"\" : \" \") + t.how));\nvar stage = el(\"div\", \"gpbr-stage\");\nroot.appendChild(stage);\nvar viewEl = el(\"div\", \"gpbr-view\");\nstage.appendChild(viewEl);\nvar cv = el(\"canvas\", \"gpbr-cv\");\ncv.setAttribute(\"role\", \"img\");\ncv.setAttribute(\"aria-label\", t.view);\nviewEl.appendChild(cv);\nvar veil = el(\"div\", \"gpbr-veil\");\nveil.appendChild(el(\"span\", \"gpbr-veil-t\", t.play));\nviewEl.appendChild(veil);\nvar ctx = cv.getContext(\"2d\");\nvar trayEl = el(\"div\", \"gpbr-tray\");\nstage.appendChild(trayEl);\ntrayEl.appendChild(el(\"span\", \"gpbr-tray-h\", t.tray));\nvar slots = [];\nfor (var i = 0; i \u003c n; i++) {\nvar b = el(\"button\", \"gpbr-slot\");\nb.type = \"button\";\nb.setAttribute(\"data-piece\", String(i));\nvar tc = el(\"canvas\", \"gpbr-thumb\");\nb.appendChild(tc);\nb.appendChild(el(\"span\", \"gpbr-num\", label(i)));\ntrayEl.appendChild(b);\nslots.push({ b: b, cv: tc });\n}\nvar ctl = el(\"div\", \"gpbr-ctl\");\nroot.appendChild(ctl);\nvar pad = el(\"div\", \"gpbr-pad\");\nctl.appendChild(pad);\nvar mvb = [];\nDIRS.forEach(function (d, di) {\nvar bt = el(\"button\", \"gpbr-mv\");\nbt.type = \"button\";\nbt.setAttribute(\"data-dir\", String(di));\nvar ax = d[0] ? 0 : d[1] ? 1 : 2;\nbt.style.borderColor = AXC[ax];\nvar svg = sv(\"svg\", { viewBox: \"-12 -12 24 24\", width: \"100%\", height: \"100%\", \"aria-hidden\": \"true\", focusable: \"false\" });\nvar g = sv(\"g\", {});\ng.appendChild(sv(\"path\", { d: \"M-7 0H6M1-5L6 0L1 5\", fill: \"none\", stroke: AXC[ax], \"stroke-width\": \"2.6\", \"stroke-linecap\": \"round\", \"stroke-linejoin\": \"round\" }));\nsvg.appendChild(g);\nvar mark = sv(\"circle\", { cx: \"0\", cy: \"0\", r: \"3.2\", fill: AXC[ax] });\nsvg.appendChild(mark);\nbt.appendChild(svg);\npad.appendChild(bt);\nmvb.push({ b: bt, g: g, mark: mark, ax: ax });\n});\nvar side = el(\"div\", \"gpbr-side\");\nctl.appendChild(side);\nfunction sideBtn(txt, cls) {\nvar bt = el(\"button\", \"gpbr-sb \" + cls, txt);\nbt.type = \"button\";\nside.appendChild(bt);\nreturn bt;\n}\nvar bTurnY = sideBtn(t.turnY, \"gpbr-turn\");\nvar bTurnX = sideBtn(t.turnX, \"gpbr-turn\");\nvar bTurnZ = sideBtn(t.turnZ, \"gpbr-turn\");\nvar bTray = sideBtn(t.toTray, \"gpbr-out\");\nvar sayRow = el(\"div\", \"gpbr-sayrow\");\nroot.appendChild(sayRow);\nvar sayEl = el(\"p\", \"gpbr-say\", \"\");\nsayEl.setAttribute(\"aria-live\", \"polite\");\nsayRow.appendChild(sayEl);\nvar bTog = el(\"button\", \"gpbr-tog\", t.together);\nbTog.type = \"button\";\nbTog.hidden = true;\nsayRow.appendChild(bTog);\nvar winEl = el(\"p\", \"gpbr-win\", \"\");\nwinEl.hidden = true;\nwinEl.setAttribute(\"aria-live\", \"polite\");\nroot.appendChild(winEl);\nvar bar = el(\"div\", \"gpbr-bar\");\nroot.appendChild(bar);\nvar stat = el(\"div\", \"gpbr-stat\");\nbar.appendChild(stat);\nvar countEl = el(\"span\", \"gpbr-count\", \"\");\nstat.appendChild(countEl);\nvar freeEl = el(\"span\", \"gpbr-free\", \"\");\nif (FREE !== Infinity) stat.appendChild(freeEl);\nvar bUndo = el(\"button\", \"\", t.undo);\nbUndo.type = \"button\";\nbar.appendChild(bUndo);\nvar bReset = el(\"button\", \"\", t.reset);\nbReset.type = \"button\";\nbar.appendChild(bReset);\nvar lockEl = el(\"div\", \"gpbr-lock\");\nlockEl.hidden = true;\nlockEl.setAttribute(\"aria-live\", \"polite\");\nlockEl.appendChild(el(\"p\", \"gpbr-lock-line\", t.lockLine));\nvar buyEl = el(\"a\", \"gpbr-buy\", t.buy);\nbuyEl.setAttribute(\"href\", \"\/products\/\" + handle);\nbuyEl.setAttribute(\"role\", \"button\");\nlockEl.appendChild(buyEl);\nroot.appendChild(lockEl);\nroot.appendChild(el(\"p\", \"gpbr-credit\", t.credit));\nfunction basis() {\nvar cy = Math.cos(yaw), sy = Math.sin(yaw), cp = Math.cos(pitch), sp = Math.sin(pitch);\nreturn { X: [cy, -sy, 0], Y: [sp * sy, sp * cy, cp], D: [cp * sy, cp * cy, -sp] };\n}\nvar LIGHT = [-0.42, 0.74, -0.52];\nfunction faces(i, r) {\nvar k = i + \"\/\" + r;\nif (!faceCache[k]) faceCache[k] = facesOf(game.shape(i, r).c);\nreturn faceCache[k];\n}\nfunction offsetOf(i, tnow) {\nvar q = game.P[i], o = [q.p[0], q.p[1], q.p[2]], a = anim[i];\nif (a) {\nvar e = Math.min(1, (tnow - a.t0) \/ a.ms);\nif (e \u003e= 1) delete anim[i];\nelse {\nvar f = 1 - (1 - e) * (1 - e);\nfor (var k = 0; k \u003c 3; k++) o[k] += a.v[k] * (1 - f);\n}\n}\nreturn o;\n}\nfunction table() { return !game.inPlay().length; }\nfunction scene(tnow) {\nvar on = game.inPlay(), list = [], lo = [1e9, 1e9, 1e9], hi = [-1e9, -1e9, -1e9], k;\nif (on.length) {\non.forEach(function (i) { list.push({ i: i, r: game.P[i].r, off: tnow == null ? game.P[i].p.slice() : offsetOf(i, tnow) }); });\n} else {\nvar sp = 0, cols = n \u003c= 4 ? 2 : 3;\nfor (k = 0; k \u003c n; k++) { var s0 = game.shape(k, game.P[k].r).s; sp = Math.max(sp, s0[0], s0[1], s0[2]); }\nsp += 2;\nfor (k = 0; k \u003c n; k++) {\nvar sz = game.shape(k, game.P[k].r).s, col = k % cols, row = Math.floor(k \/ cols);\nlist.push({ i: k, r: game.P[k].r, off: [Math.round(col * sp - sz[0] \/ 2), Math.round(-row * sp - sz[1] \/ 2), Math.round(-sz[2] \/ 2)] });\n}\n}\nlist.forEach(function (it) {\nvar s1 = game.shape(it.i, it.r).s;\nfor (var a = 0; a \u003c 3; a++) {\nlo[a] = Math.min(lo[a], it.off[a]);\nhi[a] = Math.max(hi[a], it.off[a] + s1[a] - 1);\n}\n});\nreturn { list: list, lo: lo, hi: hi };\n}\nvar lastTable = null;\nfunction fitTarget() {\nvar B = scene(null), c = [], r2 = 0;\nif (!B.list.length) return;\nif (lastTable !== table()) { lastTable = table(); view.s = 0; }\nfor (var k = 0; k \u003c 3; k++) {\nc.push((B.lo[k] + B.hi[k] + 1) \/ 2);\nvar h = (B.hi[k] - B.lo[k] + 1) \/ 2;\nr2 += h * h;\n}\nvar r = Math.sqrt(r2) + 0.35, W = cv.clientWidth || 300, H = cv.clientHeight || 260;\nview.ts = Math.min(W, H) \/ (2 * r);\nview.tc = c;\nif (!view.s) { view.s = view.ts; view.c = c.slice(); }\n}\nfunction shade(rgbv, f) {\nreturn \"rgb(\" + Math.round(rgbv[0] * f) + \",\" + Math.round(rgbv[1] * f) + \",\" + Math.round(rgbv[2] * f) + \")\";\n}\nfunction paint(g2, list, B, s, c, W, H, dpr, pick) {\nvar items = [];\nlist.forEach(function (it) {\nvar F = faces(it.i, it.r), col = COL[it.i % COL.length] || [200, 200, 200];\nfor (var j = 0; j \u003c F.length; j++) {\nvar f = F[j], nd = DIRS[f.n];\nvar nz = dot(nd, B.D);\nif (nz \u003e -1e-6) continue;\nvar pts = [];\nfor (var k = 0; k \u003c 4; k++) {\nvar p = [f.pts[k][0] + it.off[0] - c[0], f.pts[k][1] + it.off[1] - c[1], f.pts[k][2] + it.off[2] - c[2]];\npts.push([W \/ 2 + s * dot(p, B.X), H \/ 2 - s * dot(p, B.Y)]);\n}\nvar cc = [f.cc[0] + it.off[0], f.cc[1] + it.off[1], f.cc[2] + it.off[2]];\nvar fc = [cc[0] + nd[0] * 0.5, cc[1] + nd[1] * 0.5, cc[2] + nd[2] * 0.5];\nvar nv = [dot(nd, B.X), dot(nd, B.Y), nz];\nvar lum = 0.6 + 0.4 * Math.max(0, dot(nv, LIGHT));\nitems.push({ i: it.i, pts: pts, m: f.m, z: dot(cc, B.D), z2: dot(fc, B.D), fill: shade(col, lum) });\n}\n});\nitems.sort(function (a, b) { return (b.z - a.z) || (b.z2 - a.z2); });\ng2.lineJoin = \"round\";\ng2.lineCap = \"round\";\nfor (var q = 0; q \u003c items.length; q++) {\nvar it = items[q], P = it.pts;\nvar mx = (P[0][0] + P[1][0] + P[2][0] + P[3][0]) \/ 4, my = (P[0][1] + P[1][1] + P[2][1] + P[3][1]) \/ 4;\ng2.beginPath();\nfor (var k2 = 0; k2 \u003c 4; k2++) {\nvar ex = P[k2][0] - mx, ey = P[k2][1] - my, el2 = Math.sqrt(ex * ex + ey * ey) || 1;\nvar gx = P[k2][0] + ex \/ el2 * 0.6, gy = P[k2][1] + ey \/ el2 * 0.6;\nif (k2) g2.lineTo(gx, gy); else g2.moveTo(gx, gy);\n}\ng2.closePath();\ng2.fillStyle = it.fill;\ng2.fill();\nvar hot = pick \u0026\u0026 (it.i === sel ? ACC : flash[it.i] ? BAD : null);\ng2.strokeStyle = hot || \"rgba(30,30,30,.55)\";\ng2.lineWidth = (hot ? 2.2 : 1) * dpr;\ng2.beginPath();\nfor (k2 = 0; k2 \u003c 4; k2++) {\nif (!(it.m \u003e\u003e k2 \u0026 1)) continue;\ng2.moveTo(P[k2][0], P[k2][1]);\ng2.lineTo(P[(k2 + 1) % 4][0], P[(k2 + 1) % 4][1]);\n}\ng2.stroke();\n}\nreturn items;\n}\nfunction size() {\nvar dpr = Math.min(window.devicePixelRatio || 1, 2.5);\nvar W = cv.clientWidth, H = cv.clientHeight;\nif (cv.width !== Math.round(W * dpr) || cv.height !== Math.round(H * dpr)) {\ncv.width = Math.round(W * dpr);\ncv.height = Math.round(H * dpr);\n}\nreturn dpr;\n}\nfunction draw() {\nraf = 0;\nvar tnow = now(), dpr = size(), W = cv.width, H = cv.height, B = basis(), more = false;\nfitTarget();\nif (view.s) {\nvar ds = view.ts - view.s;\nview.s += ds * 0.28;\nif (Math.abs(ds) \u003e view.ts * 0.004) more = true; else view.s = view.ts;\nfor (var k = 0; k \u003c 3; k++) {\nvar dc = view.tc[k] - view.c[k];\nview.c[k] += dc * 0.28;\nif (Math.abs(dc) \u003e 0.01) more = true; else view.c[k] = view.tc[k];\n}\n}\nctx.clearRect(0, 0, W, H);\nvar list = scene(tnow).list;\nfor (var a in anim) if (Object.prototype.hasOwnProperty.call(anim, a)) more = true;\nfor (var f in flash) if (Object.prototype.hasOwnProperty.call(flash, f)) {\nif (tnow \u003e flash[f]) delete flash[f]; else more = true;\n}\ndrawn = list.length ? paint(ctx, list, B, view.s * dpr, view.c, W, H, dpr, true) : [];\nif (more) schedule();\n}\nfunction schedule() { if (!raf) raf = (window.requestAnimationFrame || function (cb) { return setTimeout(cb, 16); })(draw); }\nfunction drawTray() {\nvar B = basis(), dpr = Math.min(window.devicePixelRatio || 1, 2.5);\nslots.forEach(function (sl, i) {\nvar q = game.P[i];\nsl.b.hidden = q.on;\nsl.b.disabled = locked() || won;\nif (q.on) return;\nvar W = Math.round((sl.cv.clientWidth || 48) * dpr), H = Math.round((sl.cv.clientHeight || 48) * dpr);\nif (sl.cv.width !== W) sl.cv.width = W;\nif (sl.cv.height !== H) sl.cv.height = H;\nvar g2 = sl.cv.getContext(\"2d\"), s = game.shape(i, q.r).s;\ng2.clearRect(0, 0, W, H);\nvar r = Math.sqrt(s[0] * s[0] + s[1] * s[1] + s[2] * s[2]) \/ 2 + 0.2;\npaint(g2, [{ i: i, r: q.r, off: [0, 0, 0] }], B, Math.min(W, H) \/ (2 * r), [s[0] \/ 2, s[1] \/ 2, s[2] \/ 2], W, H, dpr * 0.8, false);\n});\n}\nfunction layoutPad() {\nvar B = basis(), R = 3.15, ring = [], mid = [];\nmvb.forEach(function (m, di) {\nvar d = DIRS[di], vx = dot(d, B.X), vy = dot(d, B.Y), len = Math.sqrt(vx * vx + vy * vy);\nvar ang = Math.atan2(vy, vx);\nm.g.setAttribute(\"transform\", \"rotate(\" + (-ang * 180 \/ Math.PI).toFixed(1) + \") scale(\" + Math.max(0.45, Math.min(1, len)).toFixed(2) + \")\");\nm.mark.setAttribute(\"r\", len \u003c 0.35 ? (dot(d, B.D) \u003c 0 ? \"3.4\" : \"0\") : \"0\");\nm.b.setAttribute(\"aria-label\", t.slide + \" \" + [\"x\", \"y\", \"z\"][m.ax] + (di % 2 ? \"-\" : \"+\"));\nif (len \u003c 0.3) mid.push({ m: m, toward: dot(d, B.D) \u003c 0 });\nelse ring.push({ m: m, a: ang });\n});\nring.sort(function (p, q) { return p.a - q.a; });\nvar MIN = 1.0;\nfor (var it = 0; it \u003c 60; it++) {\nfor (var j = 0; j \u003c ring.length; j++) {\nvar p = ring[j], q = ring[(j + 1) % ring.length];\nvar gap = q.a - p.a + (j === ring.length - 1 ? 2 * Math.PI : 0);\nif (gap \u003c MIN) { var push = (MIN - gap) \/ 2; p.a -= push; q.a += push; }\n}\n}\nring.forEach(function (o) {\no.m.b.style.left = (4.8 + R * Math.cos(o.a) - 1.45).toFixed(2) + \"em\";\no.m.b.style.top = (4.8 - R * Math.sin(o.a) - 1.45).toFixed(2) + \"em\";\n});\nmid.forEach(function (o, j) {\nvar x = mid.length === 1 ? 0 : (o.toward ? -0.8 : 0.8);\no.m.b.style.left = (4.8 + x * 1.9 - 1.45).toFixed(2) + \"em\";\no.m.b.style.top = (4.8 - 1.45).toFixed(2) + \"em\";\n});\n}\nfunction upSide() {\nvar B = basis(), best = 4, bv = -9;\nDIRS.forEach(function (d, di) { var v = dot(d, B.Y); if (v \u003e bv + 1e-9) { bv = v; best = di; } });\nreturn best;\n}\nfunction turnAxis(vec) {\nvar best = 0, bv = 0;\nfor (var a = 0; a \u003c 3; a++) if (Math.abs(vec[a]) \u003e Math.abs(bv)) { bv = vec[a]; best = a; }\nreturn [best, bv \u003c 0];\n}\nfunction render() {\nvar lk = locked();\nvar on = game.inPlay();\ncountEl.textContent = fmt(t.moves, { n: game.moves });\nif (FREE !== Infinity) {\nvar left = FREE - game.moves;\nfreeEl.textContent = left \u003c= 0 ? t.freeNone : left === 1 ? t.freeOne : fmt(t.free, { n: left });\n}\nlockEl.hidden = !lk;\nvar can = sel != null \u0026\u0026 game.P[sel] \u0026\u0026 game.P[sel].on \u0026\u0026 !lk \u0026\u0026 !won;\nmvb.forEach(function (m) { m.b.disabled = lk || won; m.b.setAttribute(\"aria-disabled\", can ? \"false\" : \"true\"); });\nvar fr = can \u0026\u0026 game.free(sel);\nbTurnX.disabled = bTurnY.disabled = bTurnZ.disabled = !fr;\nbTray.disabled = !can || (on.length \u003e 1 \u0026\u0026 !game.clearWay(sel));\nbUndo.disabled = lk || !game.canUndo();\nbTog.hidden = !pending;\nsayEl.textContent = msg;\nif (won) { winEl.hidden = false; winEl.textContent = fmt(T.win, { n: game.moves }); }\nelse winEl.hidden = true;\nroot.setAttribute(\"data-state\", won ? \"done\" : lk ? \"locked\" : \"play\");\nroot.setAttribute(\"data-moves\", String(game.moves));\nlayoutPad();\ndrawTray();\nschedule();\n}\nfunction after(res, di) {\nif (res.ok \u0026\u0026 res.moved) {\nvar d = DIRS[di], tnow = now();\nres.moved.forEach(function (i) { if (game.P[i].on) anim[i] = { v: [-d[0], -d[1], -d[2]], t0: tnow, ms: 130 }; });\n}\nif (res.ok \u0026\u0026 res.out != null) {\nif (sel === res.out) sel = null;\nmsg = fmt(t.out, { Name: Name(res.out) });\n}\nif (res.ok) {\nwon = game.won();\nif (locked() \u0026\u0026 !won) { msg = \"\"; track(\"demo_limit_reached\", handle); }\n}\n}\nfunction act(di) {\npending = null;\nif (locked() || won) return;\nif (sel == null || !game.P[sel].on) { msg = t.pick; render(); return; }\nvar res = game.slide(sel, di);\nif (res.ok) { msg = \"\"; after(res, di); render(); return; }\nif (res.why === \"alone\") msg = t.alone;\nelse if (res.why === \"blocked\") {\nvar tend = now() + 700;\nres.by.forEach(function (j) { flash[j] = tend; });\nif (res.group) {\nvar others = res.group.filter(function (j) { return j !== sel; });\nmsg = fmt(t.push, { list: names(others) });\npending = { group: res.group, di: di };\n} else msg = fmt(t.pushAll, { list: names(res.by) });\n} else msg = t.pick;\nrender();\n}\nfunction together() {\nif (!pending || locked() || won) return;\nvar p = pending;\npending = null;\nvar res = game.slideGroup(p.group, p.di);\nif (res.ok) { msg = \"\"; after(res, p.di); }\nelse msg = res.why === \"far\" ? t.far : fmt(t.blocked, { list: names(res.by || []) });\nrender();\n}\nfunction bringIn(i) {\npending = null;\nif (locked() || won || game.P[i].on) return;\nvar sideDi = upSide(), res = game.spawn(i, sideDi);\nif (!res.ok) return;\nsel = i;\nvar d = DIRS[sideDi];\nif (game.inPlay().length \u003e 1) anim[i] = { v: [d[0] * 2, d[1] * 2, d[2] * 2], t0: now(), ms: 180 };\nmsg = fmt(t.inNow, { Name: Name(i) });\nrender();\n}\nfunction turn(vec) {\npending = null;\nif (sel == null || locked() || won) return;\nvar ta = turnAxis(vec), res = game.turn(sel, ta[0], ta[1]);\nmsg = res.ok ? \"\" : res.why === \"room\" ? t.noRoom : t.noTurn;\nrender();\n}\nvar awake = false, drag = null;\nfunction wake(on) {\nif (awake === on) return;\nawake = on;\nroot.setAttribute(\"data-play\", on ? \"1\" : \"0\");\n}\nroot.setAttribute(\"data-play\", \"0\");\nif (window.IntersectionObserver) {\nnew window.IntersectionObserver(function (es) {\nfor (var k = 0; k \u003c es.length; k++) if (!es[k].isIntersecting) { drag = null; wake(false); }\n}, { threshold: 0 }).observe(root);\n} else {\nwindow.addEventListener(\"scroll\", function () {\nvar r = root.getBoundingClientRect();\nif (r.bottom \u003c 0 || r.top \u003e (window.innerHeight || 0)) { drag = null; wake(false); }\n}, { passive: true });\n}\ncv.addEventListener(\"pointerdown\", function (e) {\nvar touch = e.pointerType \u0026\u0026 e.pointerType !== \"mouse\";\nif (!touch) wake(true);\ndrag = { x: e.clientX, y: e.clientY, yaw: yaw, pitch: pitch, moved: false, id: e.pointerId, sleep: !awake };\nif (!awake) return;\ntry { cv.setPointerCapture(e.pointerId); } catch (er) {  }\ne.preventDefault();\n});\ncv.addEventListener(\"pointermove\", function (e) {\nif (!drag || e.pointerId !== drag.id) return;\nvar dx = e.clientX - drag.x, dy = e.clientY - drag.y;\nif (drag.sleep) { if (dx * dx + dy * dy \u003e= 100) drag.moved = true; return; }\nif (!drag.moved \u0026\u0026 dx * dx + dy * dy \u003c 36) return;\ndrag.moved = true;\nyaw = drag.yaw - dx * 0.011;\npitch = Math.max(-1.45, Math.min(1.45, drag.pitch + dy * 0.011));\nlayoutPad();\ndrawTray();\nschedule();\ne.preventDefault();\n});\nfunction hitAt(x, y) {\nfor (var j = drawn.length - 1; j \u003e= 0; j--) {\nvar P = drawn[j].pts, inside = true, sgn = 0;\nfor (var k = 0; k \u003c 4; k++) {\nvar a = P[k], b = P[(k + 1) % 4];\nvar cr = (b[0] - a[0]) * (y - a[1]) - (b[1] - a[1]) * (x - a[0]);\nif (Math.abs(cr) \u003c 1e-9) continue;\nif (!sgn) sgn = cr \u003e 0 ? 1 : -1;\nelse if ((cr \u003e 0 ? 1 : -1) !== sgn) { inside = false; break; }\n}\nif (inside) return drawn[j].i;\n}\nreturn null;\n}\nfunction up(e) {\nif (!drag || e.pointerId !== drag.id) return;\nvar d = drag;\ndrag = null;\nif (d.moved) return;\nif (d.sleep) { wake(true); return; }\nvar r = cv.getBoundingClientRect(), dpr = cv.width \/ (r.width || 1);\nvar hit = hitAt((e.clientX - r.left) * dpr, (e.clientY - r.top) * dpr);\npending = null;\nif (table()) {\nif (hit != null) bringIn(hit);\nreturn;\n}\nsel = hit;\nmsg = \"\";\nrender();\n}\ncv.addEventListener(\"pointerup\", up);\ncv.addEventListener(\"pointercancel\", function () { drag = null; });\nmvb.forEach(function (m, di) { m.b.addEventListener(\"click\", function () { wake(true); act(di); }); });\nslots.forEach(function (sl, i) { sl.b.addEventListener(\"click\", function () { wake(true); bringIn(i); }); });\nbTurnY.addEventListener(\"click\", function () { turn(basis().Y); });\nbTurnX.addEventListener(\"click\", function () { turn(basis().X); });\nbTurnZ.addEventListener(\"click\", function () { var D = basis().D; turn([-D[0], -D[1], -D[2]]); });\nbTray.addEventListener(\"click\", function () {\npending = null;\nif (sel == null || locked() || won) return;\nvar res = game.toTray(sel);\nif (res.ok) { msg = fmt(t.out, { Name: Name(sel) }); sel = null; }\nelse msg = t.stuck;\nrender();\n});\nbTog.addEventListener(\"click\", together);\nbUndo.addEventListener(\"click\", function () {\nif (locked()) return;\nif (game.undo()) {\npending = null; won = false; msg = \"\";\nif (sel != null \u0026\u0026 !game.P[sel].on) sel = null;\nrender();\n}\n});\nbReset.addEventListener(\"click\", function () {\ngame.reset(); sel = null; pending = null; won = false; anim = {}; msg = t.empty;\nview.s = 0;\nrender();\n});\nbuyEl.addEventListener(\"click\", function (e) {\ntrack(\"demo_limit_atc\", handle);\nvar b = buyButton(root);\nif (!b) return;\ne.preventDefault();\nif (b.disabled) { if (b.scrollIntoView) b.scrollIntoView({ block: \"center\" }); return; }\nb.click();\n});\nif (window.ResizeObserver) new window.ResizeObserver(function () { drawTray(); schedule(); }).observe(viewEl);\nelse window.addEventListener(\"resize\", function () { drawTray(); schedule(); });\nrender();\n}\nwindow.GPBR = { mount: mount, v: 1 };\n})();\n(function(){var C={\"v\":1,\"text\":\"boards\",\"pieces\":[[[0,0,0],[0,1,0],[0,2,0],[0,3,0],[0,4,0],[1,0,0],[1,2,0],[1,4,0],[2,4,0],[3,0,0],[3,1,0],[3,2,0],[3,3,0],[3,4,0],[4,0,0],[5,0,0],[5,2,0],[5,4,0],[6,0,0],[6,1,0],[6,2,0],[6,3,0],[6,4,0]],[[0,0,0],[0,1,0],[0,2,0],[0,3,0],[0,4,0],[1,0,0],[1,2,0],[1,4,0],[2,4,0],[3,0,0],[3,1,0],[3,2,0],[3,3,0],[3,4,0],[4,0,0],[5,0,0],[5,2,0],[5,4,0],[6,0,0],[6,1,0],[6,2,0],[6,3,0],[6,4,0]],[[0,0,0],[0,1,0],[0,2,0],[0,3,0],[0,4,0],[1,0,0],[1,2,0],[1,4,0],[2,4,0],[3,0,0],[3,4,0],[4,0,0],[4,4,0],[5,0,0],[5,2,0],[5,4,0],[6,0,0],[6,1,0],[6,2,0],[6,3,0],[6,4,0]],[[0,0,0],[0,1,0],[0,2,0],[0,3,0],[0,4,0],[1,0,0],[1,2,0],[1,4,0],[2,4,0],[3,0,0],[3,4,0],[4,0,0],[4,4,0],[5,0,0],[5,2,0],[5,4,0],[6,0,0],[6,1,0],[6,2,0],[6,3,0],[6,4,0]],[[0,0,0],[0,1,0],[0,2,0],[0,3,0],[0,4,0],[1,0,0],[1,2,0],[1,4,0],[2,2,0],[2,4,0],[3,0,0],[3,2,0],[3,4,0],[4,0,0],[4,2,0],[4,4,0],[5,0,0],[5,2,0],[5,4,0],[6,0,0],[6,1,0],[6,2,0],[6,3,0],[6,4,0]],[[0,0,0],[0,1,0],[0,2,0],[0,3,0],[0,4,0],[1,0,0],[1,2,0],[1,4,0],[2,2,0],[2,4,0],[3,0,0],[3,2,0],[3,4,0],[4,0,0],[4,2,0],[4,4,0],[5,0,0],[5,2,0],[5,4,0],[6,0,0],[6,1,0],[6,2,0],[6,3,0],[6,4,0]]],\"colors\":[\"#E8E4DA\",\"#E9A07E\",\"#9CC5A6\",\"#F0CF86\",\"#8FA6D6\",\"#C99BC4\"],\"goal\":{\"type\":\"slots\",\"span\":[7,7,7],\"slots\":[[[0,1,2],[7,5,1]],[[2,0,1],[1,7,5]],[[1,2,0],[5,1,7]],[[0,1,4],[7,5,1]],[[4,0,1],[1,7,5]],[[1,4,0],[5,1,7]]]},\"free\":0};var s=document.currentScript,r=s\u0026\u0026s.previousElementSibling;if(!r||(\" \"+r.className+\" \").indexOf(\" gpbr \")\u003c0)r=document.querySelector(\".gpbr:not([data-gpbr-on])\");if(!r||!window.GPBR)return;var go=function(){window.GPBR.mount(r,C);};if(window.IntersectionObserver){var o=new IntersectionObserver(function(e){if(e[0]\u0026\u0026e[0].isIntersecting){o.disconnect();go();}},{rootMargin:\"600px 0px\"});o.observe(r);}else go();})();\n\u003c\/script\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":51411264110759,"sku":"GP-ZIGZ","price":20.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/zigzag_marble.png?v=1790218141"},{"product_id":"torture","title":"Torture | One Solution Out of 7,680 Assemblies","description":"\u003ch2\u003eTorture - Quick Summary\u003c\/h2\u003e\n\u003cp\u003eTorture is a six-piece separated board burr designed by Frans de Vreugd in 2002, burr level 17.4. The six boards form 7,680 assemblies, and exactly one of those is a solution. Expert difficulty, 4+ hour solve time. Ships disassembled.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eBest for:\u003c\/strong\u003e burr collectors who already own a board burr or two and want the one with a genuinely unique solution, and solvers who have finished \u003ca href=\"\/he\/products\/zigzag\"\u003eZigZag\u003c\/a\u003e and want the next step up.\u003c\/p\u003e\n\u003ch2\u003eOne Solution Out of 7,680 Assemblies\u003c\/h2\u003e\n\u003cp\u003eMost interlocking puzzles let you wander a bit. Torture does not. De Vreugd ran a computer search across every combination of pieces this shape allows. 7,680 of them are assemblies, meaning the boards genuinely form the finished shape. Exactly one of those assemblies is a solution, meaning it can actually be built and taken apart. Everything else is a dead end that looks correct right up until the last board will not drop in.\u003c\/p\u003e\n\u003cp\u003eThe level reads 17.4. Seventeen moves to free the first board, four more for the second.\u003c\/p\u003e\n\u003ch2\u003eMoves That Look Like Nothing\u003c\/h2\u003e\n\u003cp\u003eDe Vreugd noticed a mechanism that keeps turning up in high level puzzles. Boards slide back and forth, apparently getting nowhere, purely to shift one other board a few units across. In Torture it takes seven moves to move a single board three units. Nothing is wasted and nothing looks like progress, which is most of what makes it hard.\u003c\/p\u003e\n\u003cp\u003eIt is also the design that made \u003ca href=\"\/he\/products\/extreme-torture\"\u003eExtreme Torture\u003c\/a\u003e possible. Torture came first, and once de Vreugd had it he pushed the same search as far as it would go.\u003c\/p\u003e\n\u003ch2\u003eIt Arrives in Pieces\u003c\/h2\u003e\n\u003cp\u003eSix loose boards and the knowledge that they fit. There is no solved state to copy, and with one solution out of 7,680 assemblies there is not much room to guess your way in. Expect to put it down and come back to it.\u003c\/p\u003e\n\u003cp\u003eTorture sits in the middle of the three. If you want all of them, they come together as the \u003ca href=\"\/he\/products\/separated-board-burr-set\"\u003eSeparated Board Burr Set\u003c\/a\u003e.\u003c\/p\u003e\n\u003ch2\u003eFrequently Asked Questions\u003c\/h2\u003e\n\u003ch3\u003eWhat is a separated board burr?\u003c\/h3\u003e\n\u003cp\u003eA standard six board burr has six flat pieces in three pairs. In a separated board burr the two boards in each pair sit one unit apart rather than flush. The gap opens the shape up and allows much longer move sequences. Jim Gooch suggested the idea in 2002, Frans de Vreugd designed the puzzles.\u003c\/p\u003e\n\u003ch3\u003eWhy is Torture so hard to assemble?\u003c\/h3\u003e\n\u003cp\u003eBecause almost every arrangement that looks right is wrong. The six boards form 7,680 assemblies and only one of those is a solution that can actually be built, so recognising the correct arrangement is a real part of the puzzle, not just executing the moves.\u003c\/p\u003e\n\u003ch3\u003eDoes Torture arrive assembled?\u003c\/h3\u003e\n\u003cp\u003eNo. It ships as six separate boards, and assembling them is the challenge.\u003c\/p\u003e\n\u003ch3\u003eIs Torture harder than Extreme Torture?\u003c\/h3\u003e\n\u003cp\u003eNo. Torture is level 17.4, Extreme Torture is level 28-21-9-8-3. Torture is the one to solve first.\u003c\/p\u003e\n\u003cdiv class=\"gpbr\" data-handle=\"torture\"\u003e\n\u003cstyle\u003e\n.gpbr{--gpbr-fg:rgb(var(--color-foreground,18,18,18));\n --gpbr-line:rgba(var(--color-foreground,18,18,18),.18);\n --gpbr-muted:rgba(var(--color-foreground,18,18,18),.72);\n --gpbr-accent:#02A9F7;\n font-family:inherit;color:var(--gpbr-fg);margin:1.2em 0;max-width:32em}\n.gpbr *{box-sizing:border-box}\n.gpbr .gpbr-h{font-family:inherit;font-size:1.2em;line-height:1.3;font-weight:600;\n letter-spacing:normal;text-transform:none;margin:0 0 .3em;color:var(--gpbr-fg)}\n.gpbr .gpbr-goal{font-size:1em;line-height:1.4;font-weight:600;margin:0 0 .2em;color:var(--gpbr-fg)}\n.gpbr .gpbr-rule{font-size:.86em;line-height:1.45;margin:0 0 .75em;color:var(--gpbr-muted);max-width:36em}\n.gpbr .gpbr-stage{display:flex;flex-direction:column;gap:.5em;direction:ltr}\n.gpbr .gpbr-view{position:relative;width:100%;border-radius:8px;overflow:hidden;\n background:radial-gradient(ellipse at 50% 42%,#FFFFFF 0%,#F3F2EE 70%,#ECEAE4 100%);border:1px solid var(--gpbr-line)}\n.gpbr canvas.gpbr-cv{display:block;width:100%;height:auto;aspect-ratio:1\/0.8;touch-action:pan-y;cursor:grab;\n -webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;outline:none}\n.gpbr canvas.gpbr-cv:active{cursor:grabbing}\n.gpbr[data-play=\"1\"] canvas.gpbr-cv{touch-action:none}\n.gpbr .gpbr-veil{position:absolute;left:0;right:0;bottom:.8em;display:flex;justify-content:center;pointer-events:none;\n opacity:1;transition:opacity .25s}\n.gpbr[data-play=\"1\"] .gpbr-veil{opacity:0}\n.gpbr .gpbr-veil-t{font-size:.85em;line-height:1.2;font-weight:600;color:var(--gpbr-fg);padding:.5em 1em;border-radius:999px;\n background:rgba(255,255,255,.88);border:1px solid var(--gpbr-line);box-shadow:0 1px 3px rgba(0,0,0,.08)}\n.gpbr .gpbr-tray{display:flex;flex-wrap:wrap;align-items:center;gap:.4em;min-height:3.6em;padding:.35em .5em;\n border-radius:8px;border:1px dashed var(--gpbr-line)}\n.gpbr .gpbr-tray-h{font-size:.75em;line-height:1;color:var(--gpbr-muted);margin-inline-end:.3em}\n.gpbr button.gpbr-slot{position:relative;appearance:none;-webkit-appearance:none;margin:0;padding:0;width:3.4em;height:3.4em;\n border:1px solid var(--gpbr-line);border-radius:7px;background:#FAFAF8;cursor:pointer;box-shadow:none;\n -webkit-tap-highlight-color:transparent}\n.gpbr button.gpbr-slot[hidden]{display:none}\n.gpbr button.gpbr-slot:hover{border-color:var(--gpbr-accent)}\n.gpbr button.gpbr-slot:disabled{opacity:.5;cursor:default}\n.gpbr canvas.gpbr-thumb{display:block;width:100%;height:100%;pointer-events:none}\n.gpbr .gpbr-num{position:absolute;top:.15em;left:.3em;font-size:.68em;line-height:1;font-weight:600;color:var(--gpbr-muted);pointer-events:none}\n.gpbr .gpbr-ctl{display:flex;flex-wrap:wrap;align-items:center;gap:.6em 1em;margin-top:.6em;direction:ltr}\n.gpbr .gpbr-pad{position:relative;width:9.6em;height:9.6em;flex:none;border-radius:50%;background:rgba(var(--color-foreground,18,18,18),.035)}\n.gpbr button.gpbr-mv{position:absolute;appearance:none;-webkit-appearance:none;margin:0;padding:.45em;width:2.9em;height:2.9em;\n border:2px solid;border-radius:50%;background:#fff;cursor:pointer;box-shadow:0 1px 2px rgba(0,0,0,.12);\n -webkit-tap-highlight-color:transparent;touch-action:manipulation;transition:left .12s,top .12s}\n.gpbr button.gpbr-mv svg{display:block;pointer-events:none}\n.gpbr button.gpbr-mv[aria-disabled=\"true\"]{opacity:.55}\n.gpbr button.gpbr-mv:disabled{opacity:.3;cursor:default}\n.gpbr .gpbr-side{display:flex;flex-wrap:wrap;gap:.45em;flex:1 1 9em;align-content:center}\n.gpbr .gpbr-side button,.gpbr .gpbr-bar button,.gpbr button.gpbr-tog{appearance:none;-webkit-appearance:none;margin:0;border:1px solid var(--gpbr-line);\n background:transparent;color:var(--gpbr-fg);font-family:inherit;font-size:.85em;line-height:1.2;\n letter-spacing:normal;text-transform:none;min-height:2.9em;padding:.6em .9em;border-radius:6px;\n cursor:pointer;box-shadow:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}\n.gpbr .gpbr-side button{flex:1 1 4.2em;padding:.6em .4em;white-space:nowrap}\n.gpbr .gpbr-side button:hover,.gpbr .gpbr-bar button:hover,.gpbr button.gpbr-tog:hover{border-color:var(--gpbr-accent)}\n.gpbr .gpbr-side button:disabled,.gpbr .gpbr-bar button:disabled{opacity:.38;cursor:default}\n.gpbr .gpbr-side button:disabled:hover,.gpbr .gpbr-bar button:disabled:hover{border-color:var(--gpbr-line)}\n.gpbr .gpbr-sayrow{display:flex;flex-wrap:wrap;align-items:center;gap:.4em .8em;margin:.6em 0 0;min-height:1.45em}\n.gpbr .gpbr-say{flex:1 1 14em;font-size:.88em;line-height:1.45;color:var(--gpbr-muted);min-height:1.45em;margin:0}\n.gpbr button.gpbr-tog{border-color:var(--gpbr-accent);font-weight:600}\n.gpbr button.gpbr-tog[hidden]{display:none}\n.gpbr .gpbr-win{font-size:.98em;line-height:1.45;font-weight:600;color:var(--gpbr-fg);margin:.5em 0 0;\n padding:.55em .8em;border-radius:6px;background:#E8F7FD;border-inline-start:3px solid var(--gpbr-accent)}\n.gpbr .gpbr-win[hidden]{display:none}\n.gpbr .gpbr-bar{display:flex;flex-wrap:wrap;align-items:center;gap:.45em;margin-top:.75em}\n.gpbr .gpbr-stat{display:flex;flex-direction:column;gap:.1em;margin-inline-end:auto}\n.gpbr .gpbr-count{font-size:.95em;line-height:1.2;font-weight:600;font-variant-numeric:tabular-nums;color:var(--gpbr-fg)}\n.gpbr .gpbr-free{font-size:.8em;line-height:1.25;font-weight:400;color:var(--gpbr-muted)}\n.gpbr .gpbr-lock{display:flex;flex-wrap:wrap;align-items:center;gap:.6em .9em;margin-top:.75em;\n padding:.8em .9em;border-radius:7px;background:#E8F7FD;border:1px solid rgba(2,169,247,.35)}\n.gpbr .gpbr-lock[hidden]{display:none}\n.gpbr .gpbr-lock-line{flex:1 1 12em;margin:0;font-size:.95em;line-height:1.4;font-weight:600;color:var(--gpbr-fg)}\n.gpbr a.gpbr-buy,.gpbr a.gpbr-buy:visited{display:inline-block;flex:none;padding:.7em 1.2em;border-radius:6px;\n background:var(--gpbr-accent);color:#121212;font-family:inherit;font-size:.92em;line-height:1.2;font-weight:600;\n letter-spacing:normal;text-decoration:none;text-transform:none;cursor:pointer;-webkit-tap-highlight-color:transparent}\n.gpbr a.gpbr-buy:hover{background:#2BB8F8;color:#121212;text-decoration:none}\n.gpbr .gpbr-credit{font-size:.72em;line-height:1.4;color:var(--gpbr-muted);margin:.9em 0 0;opacity:.85}\n@media (min-width:600px){\n .gpbr .gpbr-stage{flex-direction:row;align-items:stretch}\n .gpbr .gpbr-view{flex:1 1 auto;min-width:0}\n .gpbr .gpbr-tray{flex-direction:column;flex-wrap:nowrap;justify-content:flex-start;width:4.6em;flex:none;padding:.5em .4em}\n .gpbr .gpbr-tray-h{margin:0 0 .2em}\n}\n\u003c\/style\u003e\n\u003c\/div\u003e\n\u003cscript\u003e\n(function () {\n\"use strict\";\nif (window.GPBR_ENGINE) return;\nvar DIRS = [[1, 0, 0], [-1, 0, 0], [0, 1, 0], [0, -1, 0], [0, 0, 1], [0, 0, -1]];\nvar FAR = 6;\nfunction det(m) {\nreturn m[0][0] * (m[1][1] * m[2][2] - m[1][2] * m[2][1]) -\nm[0][1] * (m[1][0] * m[2][2] - m[1][2] * m[2][0]) +\nm[0][2] * (m[1][0] * m[2][1] - m[1][1] * m[2][0]);\n}\nvar ROTS = [];\n(function () {\nvar perms = [[0, 1, 2], [0, 2, 1], [1, 0, 2], [1, 2, 0], [2, 0, 1], [2, 1, 0]];\nfor (var p = 0; p \u003c 6; p++) {\nfor (var s = 0; s \u003c 8; s++) {\nvar m = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];\nfor (var r = 0; r \u003c 3; r++) m[r][perms[p][r]] = (s \u003e\u003e r \u0026 1) ? -1 : 1;\nif (det(m) === 1) ROTS.push(m);\n}\n}\n})();\nfunction mmul(a, b) {\nvar o = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];\nfor (var r = 0; r \u003c 3; r++) for (var c = 0; c \u003c 3; c++)\nfor (var k = 0; k \u003c 3; k++) o[r][c] += a[r][k] * b[k][c];\nreturn o;\n}\nfunction rotIndex(m) {\nfor (var i = 0; i \u003c ROTS.length; i++) {\nvar R = ROTS[i], same = true;\nfor (var r = 0; r \u003c 3 \u0026\u0026 same; r++) for (var c = 0; c \u003c 3; c++) if (R[r][c] !== m[r][c]) { same = false; break; }\nif (same) return i;\n}\nreturn -1;\n}\nvar MUL = ROTS.map(function (a) { return ROTS.map(function (b) { return rotIndex(mmul(a, b)); }); });\nvar QT = [rotIndex([[1, 0, 0], [0, 0, -1], [0, 1, 0]]),\nrotIndex([[0, 0, 1], [0, 1, 0], [-1, 0, 0]]),\nrotIndex([[0, -1, 0], [1, 0, 0], [0, 0, 1]])];\nvar ID = rotIndex([[1, 0, 0], [0, 1, 0], [0, 0, 1]]);\nfunction dot(a, b) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; }\nfunction key(x, y, z) { return ((x + 512) * 1024 + (y + 512)) * 1024 + (z + 512); }\nfunction axisOf(d) { return d[0] ? 0 : d[1] ? 1 : 2; }\nfunction signOf(d) { return d[0] + d[1] + d[2]; }\nfunction gaps(a, b) {\nvar g = [];\nfor (var k = 0; k \u003c 3; k++) g.push(Math.max(a.lo[k] - b.hi[k] - 1, b.lo[k] - a.hi[k] - 1));\nreturn g;\n}\nfunction Game(C) {\nthis.C = C;\nthis.n = C.pieces.length;\nthis.shapes = {};\nthis.reset();\n}\nvar G = Game.prototype;\nG.reset = function () {\nthis.P = [];\nfor (var i = 0; i \u003c this.n; i++) this.P.push({ on: false, r: ID, p: [0, 0, 0] });\nthis.moves = 0;\nthis.hist = [];\n};\nG.snap = function () {\nreturn { P: this.P.map(function (q) { return { on: q.on, r: q.r, p: q.p.slice() }; }), moves: this.moves };\n};\nG.save = function () { this.hist.push(this.snap()); };\nG.canUndo = function () { return this.hist.length \u003e 0; };\nG.undo = function () {\nvar s = this.hist.pop();\nif (!s) return false;\nthis.P = s.P;\nreturn true;\n};\nG.shape = function (i, r) {\nvar k = i + \"\/\" + r, sh = this.shapes[k];\nif (sh) return sh;\nvar R = ROTS[r], cs = this.C.pieces[i], out = [], lo = [1e9, 1e9, 1e9], hi = [-1e9, -1e9, -1e9];\nfor (var j = 0; j \u003c cs.length; j++) {\nvar c = cs[j], v = [0, 0, 0];\nfor (var a = 0; a \u003c 3; a++) {\nv[a] = R[a][0] * c[0] + R[a][1] * c[1] + R[a][2] * c[2];\nif (v[a] \u003c lo[a]) lo[a] = v[a];\nif (v[a] \u003e hi[a]) hi[a] = v[a];\n}\nout.push(v);\n}\nfor (j = 0; j \u003c out.length; j++) for (a = 0; a \u003c 3; a++) out[j][a] -= lo[a];\nsh = { c: out, s: [hi[0] - lo[0] + 1, hi[1] - lo[1] + 1, hi[2] - lo[2] + 1] };\nthis.shapes[k] = sh;\nreturn sh;\n};\nG.cells = function (i) {\nvar q = this.P[i], sh = this.shape(i, q.r);\nreturn sh.c.map(function (c) { return [c[0] + q.p[0], c[1] + q.p[1], c[2] + q.p[2]]; });\n};\nG.box = function (i) {\nvar q = this.P[i], s = this.shape(i, q.r).s;\nreturn { lo: q.p.slice(), hi: [q.p[0] + s[0] - 1, q.p[1] + s[1] - 1, q.p[2] + s[2] - 1] };\n};\nG.boxOf = function (list) {\nvar lo = [1e9, 1e9, 1e9], hi = [-1e9, -1e9, -1e9];\nfor (var j = 0; j \u003c list.length; j++) {\nvar b = this.box(list[j]);\nfor (var a = 0; a \u003c 3; a++) {\nif (b.lo[a] \u003c lo[a]) lo[a] = b.lo[a];\nif (b.hi[a] \u003e hi[a]) hi[a] = b.hi[a];\n}\n}\nreturn { lo: lo, hi: hi };\n};\nG.inPlay = function () {\nvar o = [];\nfor (var i = 0; i \u003c this.n; i++) if (this.P[i].on) o.push(i);\nreturn o;\n};\nG.occ = function (skip) {\nvar m = {};\nfor (var i = 0; i \u003c this.n; i++) {\nif (!this.P[i].on || (skip \u0026\u0026 skip[i])) continue;\nvar cs = this.cells(i);\nfor (var j = 0; j \u003c cs.length; j++) m[key(cs[j][0], cs[j][1], cs[j][2])] = i;\n}\nreturn m;\n};\nG.blockers = function (group, d) {\nvar inG = {}, j;\nfor (j = 0; j \u003c group.length; j++) inG[group[j]] = 1;\nvar occ = this.occ(inG), hit = {}, out = [];\nfor (j = 0; j \u003c group.length; j++) {\nvar cs = this.cells(group[j]);\nfor (var k = 0; k \u003c cs.length; k++) {\nvar o = occ[key(cs[k][0] + d[0], cs[k][1] + d[1], cs[k][2] + d[2])];\nif (o !== undefined \u0026\u0026 !hit[o]) { hit[o] = 1; out.push(o); }\n}\n}\nreturn out.sort(function (a, b) { return a - b; });\n};\nG.closure = function (i, d) {\nvar g = [i];\nfor (;;) {\nvar b = this.blockers(g, d);\nif (!b.length) return g.sort(function (a, c) { return a - c; });\ng = g.concat(b);\n}\n};\nG.clearWay = function (i, mine) {\nvar on = this.inPlay(), others = [], k, j;\nmine = mine || this.cells(i);\nfor (k = 0; k \u003c on.length; k++) if (on[k] !== i) {\nvar cs = this.cells(on[k]);\nfor (j = 0; j \u003c cs.length; j++) others.push(cs[j]);\n}\nif (!others.length) return 1;\nfor (var di = 0; di \u003c 6; di++) {\nvar d = DIRS[di], a = axisOf(d), s = signOf(d), free = true;\nfor (j = 0; j \u003c mine.length \u0026\u0026 free; j++) {\nvar c = mine[j];\nfor (k = 0; k \u003c others.length; k++) {\nvar o = others[k], same = true;\nfor (var b = 0; b \u003c 3; b++) if (b !== a \u0026\u0026 o[b] !== c[b]) { same = false; break; }\nif (same \u0026\u0026 (o[a] - c[a]) * s \u003e 0) { free = false; break; }\n}\n}\nif (free) return di + 1;\n}\nreturn 0;\n};\nG.hits = function (i, cells) {\nvar occ = this.occ(null);\nfor (var j = 0; j \u003c cells.length; j++) {\nvar o = occ[key(cells[j][0], cells[j][1], cells[j][2])];\nif (o !== undefined \u0026\u0026 o !== i) return true;\n}\nreturn false;\n};\nG.place = function (i, r, p) {\nreturn this.shape(i, r).c.map(function (c) { return [c[0] + p[0], c[1] + p[1], c[2] + p[2]]; });\n};\nG.spawn = function (i, side) {\nvar q = this.P[i];\nif (q.on) return { ok: false, why: \"on\" };\nvar sh = this.shape(i, q.r), on = this.inPlay(), p = [0, 0, 0];\nif (!on.length) {\nfor (var a = 0; a \u003c 3; a++) p[a] = -Math.floor(sh.s[a] \/ 2);\n} else {\nvar O = this.boxOf(on), d = DIRS[side], ax = axisOf(d);\nfor (a = 0; a \u003c 3; a++) {\nif (a === ax) continue;\np[a] = Math.floor((O.lo[a] + O.hi[a] + 1 - sh.s[a]) \/ 2);\n}\np[ax] = signOf(d) \u003e 0 ? O.hi[ax] + 2 : O.lo[ax] - 1 - sh.s[ax];\n}\nreturn this.spawnAt(i, q.r, p);\n};\nG.spawnAt = function (i, r, p) {\nvar q = this.P[i];\nif (q.on || r \u003c 0 || r \u003e= 24) return { ok: false, why: \"on\" };\nvar cells = this.place(i, r, p);\nif (this.hits(i, cells) || !this.clearWay(i, cells)) return { ok: false, why: \"inside\" };\nthis.save();\nthis.P[i] = { on: true, r: r, p: p.slice() };\nreturn { ok: true, i: i };\n};\nG.slide = function (i, di) {\nvar q = this.P[i], d = DIRS[di];\nif (!q || !q.on) return { ok: false, why: \"pick\" };\nvar on = this.inPlay();\nif (on.length \u003c 2) return { ok: false, why: \"alone\" };\nvar by = this.blockers([i], d);\nif (by.length) {\nvar g = this.closure(i, d);\nreturn { ok: false, why: \"blocked\", by: by, group: g.length \u003c on.length ? g : null };\n}\nvar others = on.filter(function (j) { return j !== i; });\nvar O = this.boxOf(others), before = gaps(this.box(i), O);\nthis.save();\nq.p = [q.p[0] + d[0], q.p[1] + d[1], q.p[2] + d[2]];\nthis.moves++;\nvar after = gaps(this.box(i), O), ax = axisOf(d), res = { ok: true, moved: [i], d: di };\nif (after[ax] \u003e FAR \u0026\u0026 after[ax] \u003e before[ax]) {\nq.on = false;\nres.out = i;\n}\nreturn res;\n};\nG.slideGroup = function (group, di) {\nvar d = DIRS[di], on = this.inPlay(), j;\nif (!group.length || group.length \u003e= on.length) return { ok: false, why: \"all\" };\nfor (j = 0; j \u003c group.length; j++) if (!this.P[group[j]].on) return { ok: false, why: \"pick\" };\nvar by = this.blockers(group, d);\nif (by.length) return { ok: false, why: \"blocked\", by: by, group: null };\nvar inG = {};\nfor (j = 0; j \u003c group.length; j++) inG[group[j]] = 1;\nvar rest = on.filter(function (k) { return !inG[k]; });\nvar O = this.boxOf(rest), B = this.boxOf(group), ax = axisOf(d), before = gaps(B, O);\nvar after = gaps({ lo: [B.lo[0] + d[0], B.lo[1] + d[1], B.lo[2] + d[2]], hi: [B.hi[0] + d[0], B.hi[1] + d[1], B.hi[2] + d[2]] }, O);\nif (after[ax] \u003e FAR \u0026\u0026 after[ax] \u003e before[ax]) return { ok: false, why: \"far\" };\nthis.save();\nfor (j = 0; j \u003c group.length; j++) {\nvar q = this.P[group[j]];\nq.p = [q.p[0] + d[0], q.p[1] + d[1], q.p[2] + d[2]];\n}\nthis.moves++;\nreturn { ok: true, moved: group.slice(), d: di };\n};\nG.free = function (i) {\nvar q = this.P[i];\nreturn !!(q \u0026\u0026 q.on \u0026\u0026 this.clearWay(i));\n};\nG.turn = function (i, ax, back) {\nif (!this.free(i)) return { ok: false, why: \"turn\" };\nvar q = this.P[i], old = this.box(i);\nvar Q = QT[ax];\nif (back) Q = MUL[Q][MUL[Q][Q]];\nvar r = MUL[Q][q.r], s = this.shape(i, r).s, p0 = [0, 0, 0], a;\nfor (a = 0; a \u003c 3; a++) p0[a] = Math.floor((old.lo[a] + old.hi[a] + 1 - s[a]) \/ 2);\nvar on = this.inPlay(), mid = [0, 0, 0], self = this;\nif (on.length \u003e 1) {\nvar O = this.boxOf(on.filter(function (j) { return j !== i; }));\nfor (a = 0; a \u003c 3; a++) mid[a] = (O.lo[a] + O.hi[a] + 1) \/ 2 - (old.lo[a] + old.hi[a] + 1) \/ 2;\n}\nvar order = [0, 1, 2, 3, 4, 5].sort(function (x, y) { return dot(DIRS[x], mid) - dot(DIRS[y], mid); });\nvar tries = [p0];\nfor (var k = 1; k \u003c= 8; k++) order.forEach(function (di) {\nvar d = DIRS[di];\ntries.push([p0[0] + d[0] * k, p0[1] + d[1] * k, p0[2] + d[2] * k]);\n});\nfor (var t = 0; t \u003c tries.length; t++) {\nvar cells = self.place(i, r, tries[t]);\nif (self.hits(i, cells) || !self.clearWay(i, cells)) continue;\nthis.save();\nq.r = r;\nq.p = tries[t];\nreturn { ok: true };\n}\nreturn { ok: false, why: \"room\" };\n};\nG.toTray = function (i) {\nvar q = this.P[i];\nif (!q || !q.on) return { ok: false, why: \"pick\" };\nif (this.inPlay().length \u003e 1 \u0026\u0026 !this.clearWay(i)) return { ok: false, why: \"stuck\" };\nthis.save();\nq.on = false;\nreturn { ok: true, out: i };\n};\nG.won = function () {\nvar on = this.inPlay(), gl = this.C.goal;\nif (on.length !== this.n) return false;\nvar B = this.boxOf(on), dims = [0, 1, 2].map(function (a) { return B.hi[a] - B.lo[a] + 1; });\nif (gl.type === \"box\") {\nvar num = function (x, y) { return x - y; };\nvar want = gl.size.slice().sort(num), got = dims.slice().sort(num);\nreturn want[0] === got[0] \u0026\u0026 want[1] === got[1] \u0026\u0026 want[2] === got[2];\n}\nif (gl.type === \"slots\") {\nfor (var a = 0; a \u003c 3; a++) if (dims[a] !== gl.span[a]) return false;\nvar self = this;\nreturn [0, 1].some(function (mirror) {\nvar want = {};\ngl.slots.forEach(function (sl) {\nvar c = sl[0], s = sl[1];\nif (mirror) { c = [c[1], c[0], c[2]]; s = [s[1], s[0], s[2]]; }\nwant[c.join(\",\") + \"\/\" + s.join(\",\")] = 1;\n});\nreturn on.every(function (i) {\nvar b = self.box(i), lo = [b.lo[0] - B.lo[0], b.lo[1] - B.lo[1], b.lo[2] - B.lo[2]];\nvar s = [b.hi[0] - b.lo[0] + 1, b.hi[1] - b.lo[1] + 1, b.hi[2] - b.lo[2] + 1];\nreturn want[lo.join(\",\") + \"\/\" + s.join(\",\")] === 1;\n});\n});\n}\nreturn false;\n};\nwindow.GPBR_ENGINE = { Game: Game, DIRS: DIRS, ROTS: ROTS, MUL: MUL, QT: QT, ID: ID, gaps: gaps, v: 1 };\n})();\n(function () {\n\"use strict\";\nif (window.GPBR) return;\nvar E = window.GPBR_ENGINE;\nif (!E) return;\nvar NS = \"http:\/\/www.w3.org\/2000\/svg\";\nvar ACC = \"#02A9F7\", BAD = \"#E0533D\";\nvar AXC = [\"#C8553D\", \"#3E8E5A\", \"#3569B8\"];\nvar DIRS = E.DIRS;\nvar seq = 0;\nvar TXT = {\nen: {\ntitle: \"Try it yourself\", play: \"Tap to play\",\nhow: \"Drag the view to turn it. Tap a piece in the tray to bring it in, tap a piece to pick it, then slide it with the arrows.\",\nmoves: \"Moves: {n}\", undo: \"Undo\", reset: \"Start over\", tray: \"Tray\", toTray: \"To tray\",\nturnY: \"Turn\", turnX: \"Tip\", turnZ: \"Spin\", together: \"Move together\",\nslide: \"Slide\", view: \"Puzzle view, drag to turn\",\nempty: \"Tap a piece in the tray to bring it in.\",\npick: \"Tap a piece first.\",\ninNow: \"{Name} is in. Turn it while it is clear, then slide it.\",\nalone: \"Bring in another piece to slide against.\",\nblocked: \"Blocked by {list}.\",\npush: \"It would push {list} too.\",\npushAll: \"Blocked by {list}. Pushing it would move the whole puzzle.\",\nfar: \"That's as far as it goes.\",\nout: \"{Name} is back in the tray.\",\nnoTurn: \"It's held in place. Slide it clear of the others first, then turn it.\",\nnoRoom: \"No room to turn it here. Slide it further out first.\",\nstuck: \"It can't come out from here yet.\",\nnoun: { block: [\"piece {p}\", \"Piece {p}\", \"pieces {a} and {b}\"], boards: [\"board {p}\", \"Board {p}\", \"boards {a} and {b}\"] }, and: \", \",\nfree: \"{n} free moves left\", freeOne: \"1 free move left\", freeNone: \"No free moves left\",\nlockLine: \"That's the free part. Finish it with the real one.\", buy: \"Add to cart\",\ncredit: \"Moves follow the rules of BurrTools, Andreas Röver's free puzzle program.\",\nblock: { goal: \"Put the five pieces together into one solid block.\",\nrule: \"Pieces only slide in straight lines, and a piece can only be turned while it is clear of the others.\",\nwin: \"Done in {n} moves. The block is complete.\" },\nboards: { goal: \"Fit the six boards together into the finished burr.\",\nrule: \"Boards only slide in straight lines, and a board can only be turned while it is clear of the others.\",\nwin: \"Done in {n} moves. All six boards are in place.\" }\n},\nhe: {\ntitle: \"נסו בעצמכם\", play: \"הקישו כדי לשחק\",\nhow: \"גררו את התצוגה כדי לסובב אותה. הקישו על חלק במגש כדי להכניס אותו, הקישו על חלק כדי לבחור בו, ואז הזיזו אותו עם החצים.\",\nmoves: \"מהלכים: {n}\", undo: \"ביטול מהלך\", reset: \"התחלה מחדש\", tray: \"מגש\", toTray: \"למגש\",\nturnY: \"סיבוב\", turnX: \"הטיה\", turnZ: \"גלגול\", together: \"הזיזו יחד\",\nslide: \"הזזה\", view: \"תצוגת הפאזל, גררו כדי לסובב\",\nempty: \"הקישו על חלק במגש כדי להכניס אותו.\",\npick: \"הקישו קודם על חלק.\",\ninNow: \"{Name} בפנים. סובבו אותו כל עוד הוא רחוק מהאחרים, ואז הזיזו אותו.\",\nalone: \"הכניסו עוד חלק כדי שיהיה מול מה להזיז.\",\nblocked: \"חסום על ידי {list}.\",\npush: \"הוא ידחוף גם את {list}.\",\npushAll: \"חסום על ידי {list}. דחיפה תזיז את כל הפאזל.\",\nfar: \"עד כאן אפשר להרחיק אותו.\",\nout: \"{Name} חזר למגש.\",\nnoTurn: \"הוא תקוע במקומו. הרחיקו אותו קודם מהחלקים האחרים, ואז סובבו אותו.\",\nnoRoom: \"אין כאן מקום לסובב אותו. הרחיקו אותו עוד קודם.\",\nstuck: \"עדיין אי אפשר להוציא אותו מכאן.\",\nnoun: { block: [\"חלק {p}\", \"חלק {p}\", \"חלקים {a} ו-{b}\"], boards: [\"לוח {p}\", \"לוח {p}\", \"לוחות {a} ו-{b}\"] }, and: \", \",\nfree: \"נותרו {n} מהלכים חינם\", freeOne: \"נותר מהלך חינם אחד\", freeNone: \"לא נותרו מהלכים חינם\",\nlockLine: \"זה החלק החינמי. סיימו אותו עם הפאזל האמיתי.\", buy: \"הוספה לעגלה\",\ncredit: \"המהלכים פועלים לפי הכללים של BurrTools, תוכנת הפאזלים החופשית של אנדראס רובר.\",\nblock: { goal: \"חברו את חמשת החלקים לקובייה אחת מלאה.\",\nrule: \"החלקים זזים רק בקווים ישרים, ואפשר לסובב חלק רק כשהוא רחוק מהאחרים.\",\nwin: \"הצלחתם ב-{n} מהלכים. הקובייה שלמה.\" },\nboards: { goal: \"חברו את ששת הלוחות לפאזל השלם.\",\nrule: \"הלוחות זזים רק בקווים ישרים, ואפשר לסובב לוח רק כשהוא רחוק מהאחרים.\",\nwin: \"הצלחתם ב-{n} מהלכים. כל ששת הלוחות במקומם.\" }\n},\nja: {\ntitle: \"試してみてください\", play: \"タップして遊ぶ\",\nhow: \"画面をドラッグすると向きが変わります。トレイのピースをタップして入れ、ピースをタップして選び、矢印でスライドさせてください。\",\nmoves: \"手数：{n}\", undo: \"1手戻す\", reset: \"最初から\", tray: \"トレイ\", toTray: \"トレイへ\",\nturnY: \"回す\", turnX: \"倒す\", turnZ: \"ひねる\", together: \"一緒に動かす\",\nslide: \"スライド\", view: \"パズルの表示（ドラッグで回転）\",\nempty: \"トレイのピースをタップして入れてください。\",\npick: \"まずピースをタップしてください。\",\ninNow: \"{Name}が入りました。離れているうちに向きを変えてから、スライドさせてください。\",\nalone: \"もう1つピースを入れてから動かしてください。\",\nblocked: \"{list}に当たって動けません。\",\npush: \"{list}も一緒に押すことになります。\",\npushAll: \"{list}に当たって動けません。押すとパズル全体が動いてしまいます。\",\nfar: \"これ以上は離せません。\",\nout: \"{Name}がトレイに戻りました。\",\nnoTurn: \"今は固定されています。向きを変えるには、まず他のピースから離してください。\",\nnoRoom: \"ここでは回す場所がありません。もう少し離してください。\",\nstuck: \"ここからはまだ取り出せません。\",\nnoun: { block: [\"ピース{p}\", \"ピース{p}\", \"ピース{a}と{b}\"], boards: [\"板{p}\", \"板{p}\", \"板{a}と{b}\"] }, and: \"、\",\nfree: \"無料であと{n}手\", freeOne: \"無料であと1手\", freeNone: \"無料の手はここまで\",\nlockLine: \"無料で遊べるのはここまでです。続きは本物のパズルでどうぞ。\", buy: \"カートに追加\",\ncredit: \"動きのルールは、Andreas Röver さんの無料パズルソフト BurrTools に従っています。\",\nblock: { goal: \"5つのピースを組み合わせて、すき間のない1つのブロックにしてください。\",\nrule: \"ピースはまっすぐスライドするだけです。向きを変えられるのは、他のピースから離れているときだけです。\",\nwin: \"{n}手で完成！ブロックができあがりました。\" },\nboards: { goal: \"6枚の板を組み合わせて、パズルを完成させてください。\",\nrule: \"板はまっすぐスライドするだけです。向きを変えられるのは、他の板から離れているときだけです。\",\nwin: \"{n}手で完成！6枚の板がすべて収まりました。\" }\n}\n};\nfunction langOf() {\nvar l = (document.documentElement.getAttribute(\"lang\") || \"\").toLowerCase();\nif (l.indexOf(\"he\") === 0 || l.indexOf(\"iw\") === 0) return \"he\";\nif (l.indexOf(\"ja\") === 0) return \"ja\";\nreturn \"en\";\n}\nfunction fmt(s, o) {\nreturn s.replace(\/\\{(\\w+)\\}\/g, function (m, k) { return (k in o) ? String(o[k]) : m; });\n}\nfunction el(tag, cls, txt) {\nvar e = document.createElement(tag);\nif (cls) e.className = cls;\nif (txt != null) e.textContent = txt;\nreturn e;\n}\nfunction sv(tag, attrs) {\nvar e = document.createElementNS(NS, tag);\nfor (var k in attrs) if (Object.prototype.hasOwnProperty.call(attrs, k)) e.setAttribute(k, attrs[k]);\nreturn e;\n}\nfunction track(name, handle) {\ntry { if (typeof window.gtag === \"function\") window.gtag(\"event\", name, { product: handle }); } catch (e) {  }\n}\nfunction buyButton(root) {\nvar scopes = [], sec = root.closest ? root.closest(\"section, .shopify-section, product-info\") : null;\nif (sec) scopes.push(sec);\nscopes.push(document);\nfor (var k = 0; k \u003c scopes.length; k++) {\nvar b = scopes[k].querySelector('[id^=\"ProductSubmitButton-\"]');\nif (b \u0026\u0026 !root.contains(b)) return b;\nvar forms = scopes[k].querySelectorAll('form[action*=\"\/cart\/add\"]');\nfor (var i = 0; i \u003c forms.length; i++) {\nif (root.contains(forms[i])) continue;\nvar x = forms[i].querySelector('[type=\"submit\"], button:not([type])');\nif (x) return x;\n}\n}\nreturn null;\n}\nfunction rgb(h) {\nvar n = parseInt(h.slice(1), 16);\nreturn [n \u003e\u003e 16 \u0026 255, n \u003e\u003e 8 \u0026 255, n \u0026 255];\n}\nfunction dot(a, b) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; }\nvar now = (window.performance \u0026\u0026 performance.now) ? function () { return performance.now(); } : function () { return Date.now(); };\nvar CORN = [[0, 0], [1, 0], [1, 1], [0, 1]];\nvar OUTW = [[0, -1], [1, 0], [0, 1], [-1, 0]];\nfunction facesOf(cells) {\nvar has = {}, F = [];\nfunction k(x, y, z) { return x + \",\" + y + \",\" + z; }\ncells.forEach(function (c) { has[k(c[0], c[1], c[2])] = 1; });\ncells.forEach(function (c) {\nfor (var n = 0; n \u003c 6; n++) {\nvar d = DIRS[n];\nif (has[k(c[0] + d[0], c[1] + d[1], c[2] + d[2])]) continue;\nvar a = d[0] ? 0 : d[1] ? 1 : 2, s = d[0] + d[1] + d[2], b = (a + 1) % 3, e = (a + 2) % 3;\nvar pts = CORN.map(function (uv) {\nvar p = [0, 0, 0];\np[a] = c[a] + (s \u003e 0 ? 1 : 0); p[b] = c[b] + uv[0]; p[e] = c[e] + uv[1];\nreturn p;\n});\nvar mask = 0;\nfor (var j = 0; j \u003c 4; j++) {\nvar u = [0, 0, 0];\nu[b] = OUTW[j][0]; u[e] = OUTW[j][1];\nvar m = [c[0] + u[0], c[1] + u[1], c[2] + u[2]];\nvar flat = has[k(m[0], m[1], m[2])] \u0026\u0026 !has[k(m[0] + d[0], m[1] + d[1], m[2] + d[2])];\nif (!flat) mask |= 1 \u003c\u003c j;\n}\nF.push({ n: n, pts: pts, cc: [c[0] + 0.5, c[1] + 0.5, c[2] + 0.5], m: mask });\n}\n});\nreturn F;\n}\nfunction mount(root, C) {\nif (!root || root.getAttribute(\"data-gpbr-on\")) return;\nroot.setAttribute(\"data-gpbr-on\", \"1\");\nvar L = langOf(), t = TXT[L], T = t[C.text] || t.block;\nroot.setAttribute(\"lang\", L);\nroot.setAttribute(\"dir\", L === \"he\" ? \"rtl\" : \"ltr\");\nvar handle = root.getAttribute(\"data-handle\") || \"\";\nvar game = new E.Game(C), n = game.n;\nvar FREE = C.free \u003e 0 ? C.free : Infinity;\nvar COL = (C.colors || []).map(rgb);\nvar yaw = -0.62, pitch = 0.52;\nvar sel = null, pending = null, flash = {}, anim = {}, msg = t.empty, won = false;\nvar faceCache = {};\nvar view = { s: 0, c: [0, 0, 0], ts: 0, tc: [0, 0, 0] };\nvar drawn = [];\nvar dirty = false, raf = 0;\nfunction locked() { return game.moves \u003e= FREE; }\nfunction label(i) { return String(i + 1); }\nvar NOUN = t.noun[C.text] || t.noun.block;\nfunction names(list) {\nif (list.length === 1) return fmt(NOUN[0], { p: label(list[0]) });\nvar head = list.slice(0, -1).map(label).join(t.and);\nreturn fmt(NOUN[2], { a: head, b: label(list[list.length - 1]) });\n}\nfunction Name(i) { return fmt(NOUN[1], { p: label(i) }); }\nroot.appendChild(el(\"h3\", \"gpbr-h\", t.title));\nroot.appendChild(el(\"p\", \"gpbr-goal\", T.goal));\nroot.appendChild(el(\"p\", \"gpbr-rule\", T.rule + (L === \"ja\" ? \"\" : \" \") + t.how));\nvar stage = el(\"div\", \"gpbr-stage\");\nroot.appendChild(stage);\nvar viewEl = el(\"div\", \"gpbr-view\");\nstage.appendChild(viewEl);\nvar cv = el(\"canvas\", \"gpbr-cv\");\ncv.setAttribute(\"role\", \"img\");\ncv.setAttribute(\"aria-label\", t.view);\nviewEl.appendChild(cv);\nvar veil = el(\"div\", \"gpbr-veil\");\nveil.appendChild(el(\"span\", \"gpbr-veil-t\", t.play));\nviewEl.appendChild(veil);\nvar ctx = cv.getContext(\"2d\");\nvar trayEl = el(\"div\", \"gpbr-tray\");\nstage.appendChild(trayEl);\ntrayEl.appendChild(el(\"span\", \"gpbr-tray-h\", t.tray));\nvar slots = [];\nfor (var i = 0; i \u003c n; i++) {\nvar b = el(\"button\", \"gpbr-slot\");\nb.type = \"button\";\nb.setAttribute(\"data-piece\", String(i));\nvar tc = el(\"canvas\", \"gpbr-thumb\");\nb.appendChild(tc);\nb.appendChild(el(\"span\", \"gpbr-num\", label(i)));\ntrayEl.appendChild(b);\nslots.push({ b: b, cv: tc });\n}\nvar ctl = el(\"div\", \"gpbr-ctl\");\nroot.appendChild(ctl);\nvar pad = el(\"div\", \"gpbr-pad\");\nctl.appendChild(pad);\nvar mvb = [];\nDIRS.forEach(function (d, di) {\nvar bt = el(\"button\", \"gpbr-mv\");\nbt.type = \"button\";\nbt.setAttribute(\"data-dir\", String(di));\nvar ax = d[0] ? 0 : d[1] ? 1 : 2;\nbt.style.borderColor = AXC[ax];\nvar svg = sv(\"svg\", { viewBox: \"-12 -12 24 24\", width: \"100%\", height: \"100%\", \"aria-hidden\": \"true\", focusable: \"false\" });\nvar g = sv(\"g\", {});\ng.appendChild(sv(\"path\", { d: \"M-7 0H6M1-5L6 0L1 5\", fill: \"none\", stroke: AXC[ax], \"stroke-width\": \"2.6\", \"stroke-linecap\": \"round\", \"stroke-linejoin\": \"round\" }));\nsvg.appendChild(g);\nvar mark = sv(\"circle\", { cx: \"0\", cy: \"0\", r: \"3.2\", fill: AXC[ax] });\nsvg.appendChild(mark);\nbt.appendChild(svg);\npad.appendChild(bt);\nmvb.push({ b: bt, g: g, mark: mark, ax: ax });\n});\nvar side = el(\"div\", \"gpbr-side\");\nctl.appendChild(side);\nfunction sideBtn(txt, cls) {\nvar bt = el(\"button\", \"gpbr-sb \" + cls, txt);\nbt.type = \"button\";\nside.appendChild(bt);\nreturn bt;\n}\nvar bTurnY = sideBtn(t.turnY, \"gpbr-turn\");\nvar bTurnX = sideBtn(t.turnX, \"gpbr-turn\");\nvar bTurnZ = sideBtn(t.turnZ, \"gpbr-turn\");\nvar bTray = sideBtn(t.toTray, \"gpbr-out\");\nvar sayRow = el(\"div\", \"gpbr-sayrow\");\nroot.appendChild(sayRow);\nvar sayEl = el(\"p\", \"gpbr-say\", \"\");\nsayEl.setAttribute(\"aria-live\", \"polite\");\nsayRow.appendChild(sayEl);\nvar bTog = el(\"button\", \"gpbr-tog\", t.together);\nbTog.type = \"button\";\nbTog.hidden = true;\nsayRow.appendChild(bTog);\nvar winEl = el(\"p\", \"gpbr-win\", \"\");\nwinEl.hidden = true;\nwinEl.setAttribute(\"aria-live\", \"polite\");\nroot.appendChild(winEl);\nvar bar = el(\"div\", \"gpbr-bar\");\nroot.appendChild(bar);\nvar stat = el(\"div\", \"gpbr-stat\");\nbar.appendChild(stat);\nvar countEl = el(\"span\", \"gpbr-count\", \"\");\nstat.appendChild(countEl);\nvar freeEl = el(\"span\", \"gpbr-free\", \"\");\nif (FREE !== Infinity) stat.appendChild(freeEl);\nvar bUndo = el(\"button\", \"\", t.undo);\nbUndo.type = \"button\";\nbar.appendChild(bUndo);\nvar bReset = el(\"button\", \"\", t.reset);\nbReset.type = \"button\";\nbar.appendChild(bReset);\nvar lockEl = el(\"div\", \"gpbr-lock\");\nlockEl.hidden = true;\nlockEl.setAttribute(\"aria-live\", \"polite\");\nlockEl.appendChild(el(\"p\", \"gpbr-lock-line\", t.lockLine));\nvar buyEl = el(\"a\", \"gpbr-buy\", t.buy);\nbuyEl.setAttribute(\"href\", \"\/products\/\" + handle);\nbuyEl.setAttribute(\"role\", \"button\");\nlockEl.appendChild(buyEl);\nroot.appendChild(lockEl);\nroot.appendChild(el(\"p\", \"gpbr-credit\", t.credit));\nfunction basis() {\nvar cy = Math.cos(yaw), sy = Math.sin(yaw), cp = Math.cos(pitch), sp = Math.sin(pitch);\nreturn { X: [cy, -sy, 0], Y: [sp * sy, sp * cy, cp], D: [cp * sy, cp * cy, -sp] };\n}\nvar LIGHT = [-0.42, 0.74, -0.52];\nfunction faces(i, r) {\nvar k = i + \"\/\" + r;\nif (!faceCache[k]) faceCache[k] = facesOf(game.shape(i, r).c);\nreturn faceCache[k];\n}\nfunction offsetOf(i, tnow) {\nvar q = game.P[i], o = [q.p[0], q.p[1], q.p[2]], a = anim[i];\nif (a) {\nvar e = Math.min(1, (tnow - a.t0) \/ a.ms);\nif (e \u003e= 1) delete anim[i];\nelse {\nvar f = 1 - (1 - e) * (1 - e);\nfor (var k = 0; k \u003c 3; k++) o[k] += a.v[k] * (1 - f);\n}\n}\nreturn o;\n}\nfunction table() { return !game.inPlay().length; }\nfunction scene(tnow) {\nvar on = game.inPlay(), list = [], lo = [1e9, 1e9, 1e9], hi = [-1e9, -1e9, -1e9], k;\nif (on.length) {\non.forEach(function (i) { list.push({ i: i, r: game.P[i].r, off: tnow == null ? game.P[i].p.slice() : offsetOf(i, tnow) }); });\n} else {\nvar sp = 0, cols = n \u003c= 4 ? 2 : 3;\nfor (k = 0; k \u003c n; k++) { var s0 = game.shape(k, game.P[k].r).s; sp = Math.max(sp, s0[0], s0[1], s0[2]); }\nsp += 2;\nfor (k = 0; k \u003c n; k++) {\nvar sz = game.shape(k, game.P[k].r).s, col = k % cols, row = Math.floor(k \/ cols);\nlist.push({ i: k, r: game.P[k].r, off: [Math.round(col * sp - sz[0] \/ 2), Math.round(-row * sp - sz[1] \/ 2), Math.round(-sz[2] \/ 2)] });\n}\n}\nlist.forEach(function (it) {\nvar s1 = game.shape(it.i, it.r).s;\nfor (var a = 0; a \u003c 3; a++) {\nlo[a] = Math.min(lo[a], it.off[a]);\nhi[a] = Math.max(hi[a], it.off[a] + s1[a] - 1);\n}\n});\nreturn { list: list, lo: lo, hi: hi };\n}\nvar lastTable = null;\nfunction fitTarget() {\nvar B = scene(null), c = [], r2 = 0;\nif (!B.list.length) return;\nif (lastTable !== table()) { lastTable = table(); view.s = 0; }\nfor (var k = 0; k \u003c 3; k++) {\nc.push((B.lo[k] + B.hi[k] + 1) \/ 2);\nvar h = (B.hi[k] - B.lo[k] + 1) \/ 2;\nr2 += h * h;\n}\nvar r = Math.sqrt(r2) + 0.35, W = cv.clientWidth || 300, H = cv.clientHeight || 260;\nview.ts = Math.min(W, H) \/ (2 * r);\nview.tc = c;\nif (!view.s) { view.s = view.ts; view.c = c.slice(); }\n}\nfunction shade(rgbv, f) {\nreturn \"rgb(\" + Math.round(rgbv[0] * f) + \",\" + Math.round(rgbv[1] * f) + \",\" + Math.round(rgbv[2] * f) + \")\";\n}\nfunction paint(g2, list, B, s, c, W, H, dpr, pick) {\nvar items = [];\nlist.forEach(function (it) {\nvar F = faces(it.i, it.r), col = COL[it.i % COL.length] || [200, 200, 200];\nfor (var j = 0; j \u003c F.length; j++) {\nvar f = F[j], nd = DIRS[f.n];\nvar nz = dot(nd, B.D);\nif (nz \u003e -1e-6) continue;\nvar pts = [];\nfor (var k = 0; k \u003c 4; k++) {\nvar p = [f.pts[k][0] + it.off[0] - c[0], f.pts[k][1] + it.off[1] - c[1], f.pts[k][2] + it.off[2] - c[2]];\npts.push([W \/ 2 + s * dot(p, B.X), H \/ 2 - s * dot(p, B.Y)]);\n}\nvar cc = [f.cc[0] + it.off[0], f.cc[1] + it.off[1], f.cc[2] + it.off[2]];\nvar fc = [cc[0] + nd[0] * 0.5, cc[1] + nd[1] * 0.5, cc[2] + nd[2] * 0.5];\nvar nv = [dot(nd, B.X), dot(nd, B.Y), nz];\nvar lum = 0.6 + 0.4 * Math.max(0, dot(nv, LIGHT));\nitems.push({ i: it.i, pts: pts, m: f.m, z: dot(cc, B.D), z2: dot(fc, B.D), fill: shade(col, lum) });\n}\n});\nitems.sort(function (a, b) { return (b.z - a.z) || (b.z2 - a.z2); });\ng2.lineJoin = \"round\";\ng2.lineCap = \"round\";\nfor (var q = 0; q \u003c items.length; q++) {\nvar it = items[q], P = it.pts;\nvar mx = (P[0][0] + P[1][0] + P[2][0] + P[3][0]) \/ 4, my = (P[0][1] + P[1][1] + P[2][1] + P[3][1]) \/ 4;\ng2.beginPath();\nfor (var k2 = 0; k2 \u003c 4; k2++) {\nvar ex = P[k2][0] - mx, ey = P[k2][1] - my, el2 = Math.sqrt(ex * ex + ey * ey) || 1;\nvar gx = P[k2][0] + ex \/ el2 * 0.6, gy = P[k2][1] + ey \/ el2 * 0.6;\nif (k2) g2.lineTo(gx, gy); else g2.moveTo(gx, gy);\n}\ng2.closePath();\ng2.fillStyle = it.fill;\ng2.fill();\nvar hot = pick \u0026\u0026 (it.i === sel ? ACC : flash[it.i] ? BAD : null);\ng2.strokeStyle = hot || \"rgba(30,30,30,.55)\";\ng2.lineWidth = (hot ? 2.2 : 1) * dpr;\ng2.beginPath();\nfor (k2 = 0; k2 \u003c 4; k2++) {\nif (!(it.m \u003e\u003e k2 \u0026 1)) continue;\ng2.moveTo(P[k2][0], P[k2][1]);\ng2.lineTo(P[(k2 + 1) % 4][0], P[(k2 + 1) % 4][1]);\n}\ng2.stroke();\n}\nreturn items;\n}\nfunction size() {\nvar dpr = Math.min(window.devicePixelRatio || 1, 2.5);\nvar W = cv.clientWidth, H = cv.clientHeight;\nif (cv.width !== Math.round(W * dpr) || cv.height !== Math.round(H * dpr)) {\ncv.width = Math.round(W * dpr);\ncv.height = Math.round(H * dpr);\n}\nreturn dpr;\n}\nfunction draw() {\nraf = 0;\nvar tnow = now(), dpr = size(), W = cv.width, H = cv.height, B = basis(), more = false;\nfitTarget();\nif (view.s) {\nvar ds = view.ts - view.s;\nview.s += ds * 0.28;\nif (Math.abs(ds) \u003e view.ts * 0.004) more = true; else view.s = view.ts;\nfor (var k = 0; k \u003c 3; k++) {\nvar dc = view.tc[k] - view.c[k];\nview.c[k] += dc * 0.28;\nif (Math.abs(dc) \u003e 0.01) more = true; else view.c[k] = view.tc[k];\n}\n}\nctx.clearRect(0, 0, W, H);\nvar list = scene(tnow).list;\nfor (var a in anim) if (Object.prototype.hasOwnProperty.call(anim, a)) more = true;\nfor (var f in flash) if (Object.prototype.hasOwnProperty.call(flash, f)) {\nif (tnow \u003e flash[f]) delete flash[f]; else more = true;\n}\ndrawn = list.length ? paint(ctx, list, B, view.s * dpr, view.c, W, H, dpr, true) : [];\nif (more) schedule();\n}\nfunction schedule() { if (!raf) raf = (window.requestAnimationFrame || function (cb) { return setTimeout(cb, 16); })(draw); }\nfunction drawTray() {\nvar B = basis(), dpr = Math.min(window.devicePixelRatio || 1, 2.5);\nslots.forEach(function (sl, i) {\nvar q = game.P[i];\nsl.b.hidden = q.on;\nsl.b.disabled = locked() || won;\nif (q.on) return;\nvar W = Math.round((sl.cv.clientWidth || 48) * dpr), H = Math.round((sl.cv.clientHeight || 48) * dpr);\nif (sl.cv.width !== W) sl.cv.width = W;\nif (sl.cv.height !== H) sl.cv.height = H;\nvar g2 = sl.cv.getContext(\"2d\"), s = game.shape(i, q.r).s;\ng2.clearRect(0, 0, W, H);\nvar r = Math.sqrt(s[0] * s[0] + s[1] * s[1] + s[2] * s[2]) \/ 2 + 0.2;\npaint(g2, [{ i: i, r: q.r, off: [0, 0, 0] }], B, Math.min(W, H) \/ (2 * r), [s[0] \/ 2, s[1] \/ 2, s[2] \/ 2], W, H, dpr * 0.8, false);\n});\n}\nfunction layoutPad() {\nvar B = basis(), R = 3.15, ring = [], mid = [];\nmvb.forEach(function (m, di) {\nvar d = DIRS[di], vx = dot(d, B.X), vy = dot(d, B.Y), len = Math.sqrt(vx * vx + vy * vy);\nvar ang = Math.atan2(vy, vx);\nm.g.setAttribute(\"transform\", \"rotate(\" + (-ang * 180 \/ Math.PI).toFixed(1) + \") scale(\" + Math.max(0.45, Math.min(1, len)).toFixed(2) + \")\");\nm.mark.setAttribute(\"r\", len \u003c 0.35 ? (dot(d, B.D) \u003c 0 ? \"3.4\" : \"0\") : \"0\");\nm.b.setAttribute(\"aria-label\", t.slide + \" \" + [\"x\", \"y\", \"z\"][m.ax] + (di % 2 ? \"-\" : \"+\"));\nif (len \u003c 0.3) mid.push({ m: m, toward: dot(d, B.D) \u003c 0 });\nelse ring.push({ m: m, a: ang });\n});\nring.sort(function (p, q) { return p.a - q.a; });\nvar MIN = 1.0;\nfor (var it = 0; it \u003c 60; it++) {\nfor (var j = 0; j \u003c ring.length; j++) {\nvar p = ring[j], q = ring[(j + 1) % ring.length];\nvar gap = q.a - p.a + (j === ring.length - 1 ? 2 * Math.PI : 0);\nif (gap \u003c MIN) { var push = (MIN - gap) \/ 2; p.a -= push; q.a += push; }\n}\n}\nring.forEach(function (o) {\no.m.b.style.left = (4.8 + R * Math.cos(o.a) - 1.45).toFixed(2) + \"em\";\no.m.b.style.top = (4.8 - R * Math.sin(o.a) - 1.45).toFixed(2) + \"em\";\n});\nmid.forEach(function (o, j) {\nvar x = mid.length === 1 ? 0 : (o.toward ? -0.8 : 0.8);\no.m.b.style.left = (4.8 + x * 1.9 - 1.45).toFixed(2) + \"em\";\no.m.b.style.top = (4.8 - 1.45).toFixed(2) + \"em\";\n});\n}\nfunction upSide() {\nvar B = basis(), best = 4, bv = -9;\nDIRS.forEach(function (d, di) { var v = dot(d, B.Y); if (v \u003e bv + 1e-9) { bv = v; best = di; } });\nreturn best;\n}\nfunction turnAxis(vec) {\nvar best = 0, bv = 0;\nfor (var a = 0; a \u003c 3; a++) if (Math.abs(vec[a]) \u003e Math.abs(bv)) { bv = vec[a]; best = a; }\nreturn [best, bv \u003c 0];\n}\nfunction render() {\nvar lk = locked();\nvar on = game.inPlay();\ncountEl.textContent = fmt(t.moves, { n: game.moves });\nif (FREE !== Infinity) {\nvar left = FREE - game.moves;\nfreeEl.textContent = left \u003c= 0 ? t.freeNone : left === 1 ? t.freeOne : fmt(t.free, { n: left });\n}\nlockEl.hidden = !lk;\nvar can = sel != null \u0026\u0026 game.P[sel] \u0026\u0026 game.P[sel].on \u0026\u0026 !lk \u0026\u0026 !won;\nmvb.forEach(function (m) { m.b.disabled = lk || won; m.b.setAttribute(\"aria-disabled\", can ? \"false\" : \"true\"); });\nvar fr = can \u0026\u0026 game.free(sel);\nbTurnX.disabled = bTurnY.disabled = bTurnZ.disabled = !fr;\nbTray.disabled = !can || (on.length \u003e 1 \u0026\u0026 !game.clearWay(sel));\nbUndo.disabled = lk || !game.canUndo();\nbTog.hidden = !pending;\nsayEl.textContent = msg;\nif (won) { winEl.hidden = false; winEl.textContent = fmt(T.win, { n: game.moves }); }\nelse winEl.hidden = true;\nroot.setAttribute(\"data-state\", won ? \"done\" : lk ? \"locked\" : \"play\");\nroot.setAttribute(\"data-moves\", String(game.moves));\nlayoutPad();\ndrawTray();\nschedule();\n}\nfunction after(res, di) {\nif (res.ok \u0026\u0026 res.moved) {\nvar d = DIRS[di], tnow = now();\nres.moved.forEach(function (i) { if (game.P[i].on) anim[i] = { v: [-d[0], -d[1], -d[2]], t0: tnow, ms: 130 }; });\n}\nif (res.ok \u0026\u0026 res.out != null) {\nif (sel === res.out) sel = null;\nmsg = fmt(t.out, { Name: Name(res.out) });\n}\nif (res.ok) {\nwon = game.won();\nif (locked() \u0026\u0026 !won) { msg = \"\"; track(\"demo_limit_reached\", handle); }\n}\n}\nfunction act(di) {\npending = null;\nif (locked() || won) return;\nif (sel == null || !game.P[sel].on) { msg = t.pick; render(); return; }\nvar res = game.slide(sel, di);\nif (res.ok) { msg = \"\"; after(res, di); render(); return; }\nif (res.why === \"alone\") msg = t.alone;\nelse if (res.why === \"blocked\") {\nvar tend = now() + 700;\nres.by.forEach(function (j) { flash[j] = tend; });\nif (res.group) {\nvar others = res.group.filter(function (j) { return j !== sel; });\nmsg = fmt(t.push, { list: names(others) });\npending = { group: res.group, di: di };\n} else msg = fmt(t.pushAll, { list: names(res.by) });\n} else msg = t.pick;\nrender();\n}\nfunction together() {\nif (!pending || locked() || won) return;\nvar p = pending;\npending = null;\nvar res = game.slideGroup(p.group, p.di);\nif (res.ok) { msg = \"\"; after(res, p.di); }\nelse msg = res.why === \"far\" ? t.far : fmt(t.blocked, { list: names(res.by || []) });\nrender();\n}\nfunction bringIn(i) {\npending = null;\nif (locked() || won || game.P[i].on) return;\nvar sideDi = upSide(), res = game.spawn(i, sideDi);\nif (!res.ok) return;\nsel = i;\nvar d = DIRS[sideDi];\nif (game.inPlay().length \u003e 1) anim[i] = { v: [d[0] * 2, d[1] * 2, d[2] * 2], t0: now(), ms: 180 };\nmsg = fmt(t.inNow, { Name: Name(i) });\nrender();\n}\nfunction turn(vec) {\npending = null;\nif (sel == null || locked() || won) return;\nvar ta = turnAxis(vec), res = game.turn(sel, ta[0], ta[1]);\nmsg = res.ok ? \"\" : res.why === \"room\" ? t.noRoom : t.noTurn;\nrender();\n}\nvar awake = false, drag = null;\nfunction wake(on) {\nif (awake === on) return;\nawake = on;\nroot.setAttribute(\"data-play\", on ? \"1\" : \"0\");\n}\nroot.setAttribute(\"data-play\", \"0\");\nif (window.IntersectionObserver) {\nnew window.IntersectionObserver(function (es) {\nfor (var k = 0; k \u003c es.length; k++) if (!es[k].isIntersecting) { drag = null; wake(false); }\n}, { threshold: 0 }).observe(root);\n} else {\nwindow.addEventListener(\"scroll\", function () {\nvar r = root.getBoundingClientRect();\nif (r.bottom \u003c 0 || r.top \u003e (window.innerHeight || 0)) { drag = null; wake(false); }\n}, { passive: true });\n}\ncv.addEventListener(\"pointerdown\", function (e) {\nvar touch = e.pointerType \u0026\u0026 e.pointerType !== \"mouse\";\nif (!touch) wake(true);\ndrag = { x: e.clientX, y: e.clientY, yaw: yaw, pitch: pitch, moved: false, id: e.pointerId, sleep: !awake };\nif (!awake) return;\ntry { cv.setPointerCapture(e.pointerId); } catch (er) {  }\ne.preventDefault();\n});\ncv.addEventListener(\"pointermove\", function (e) {\nif (!drag || e.pointerId !== drag.id) return;\nvar dx = e.clientX - drag.x, dy = e.clientY - drag.y;\nif (drag.sleep) { if (dx * dx + dy * dy \u003e= 100) drag.moved = true; return; }\nif (!drag.moved \u0026\u0026 dx * dx + dy * dy \u003c 36) return;\ndrag.moved = true;\nyaw = drag.yaw - dx * 0.011;\npitch = Math.max(-1.45, Math.min(1.45, drag.pitch + dy * 0.011));\nlayoutPad();\ndrawTray();\nschedule();\ne.preventDefault();\n});\nfunction hitAt(x, y) {\nfor (var j = drawn.length - 1; j \u003e= 0; j--) {\nvar P = drawn[j].pts, inside = true, sgn = 0;\nfor (var k = 0; k \u003c 4; k++) {\nvar a = P[k], b = P[(k + 1) % 4];\nvar cr = (b[0] - a[0]) * (y - a[1]) - (b[1] - a[1]) * (x - a[0]);\nif (Math.abs(cr) \u003c 1e-9) continue;\nif (!sgn) sgn = cr \u003e 0 ? 1 : -1;\nelse if ((cr \u003e 0 ? 1 : -1) !== sgn) { inside = false; break; }\n}\nif (inside) return drawn[j].i;\n}\nreturn null;\n}\nfunction up(e) {\nif (!drag || e.pointerId !== drag.id) return;\nvar d = drag;\ndrag = null;\nif (d.moved) return;\nif (d.sleep) { wake(true); return; }\nvar r = cv.getBoundingClientRect(), dpr = cv.width \/ (r.width || 1);\nvar hit = hitAt((e.clientX - r.left) * dpr, (e.clientY - r.top) * dpr);\npending = null;\nif (table()) {\nif (hit != null) bringIn(hit);\nreturn;\n}\nsel = hit;\nmsg = \"\";\nrender();\n}\ncv.addEventListener(\"pointerup\", up);\ncv.addEventListener(\"pointercancel\", function () { drag = null; });\nmvb.forEach(function (m, di) { m.b.addEventListener(\"click\", function () { wake(true); act(di); }); });\nslots.forEach(function (sl, i) { sl.b.addEventListener(\"click\", function () { wake(true); bringIn(i); }); });\nbTurnY.addEventListener(\"click\", function () { turn(basis().Y); });\nbTurnX.addEventListener(\"click\", function () { turn(basis().X); });\nbTurnZ.addEventListener(\"click\", function () { var D = basis().D; turn([-D[0], -D[1], -D[2]]); });\nbTray.addEventListener(\"click\", function () {\npending = null;\nif (sel == null || locked() || won) return;\nvar res = game.toTray(sel);\nif (res.ok) { msg = fmt(t.out, { Name: Name(sel) }); sel = null; }\nelse msg = t.stuck;\nrender();\n});\nbTog.addEventListener(\"click\", together);\nbUndo.addEventListener(\"click\", function () {\nif (locked()) return;\nif (game.undo()) {\npending = null; won = false; msg = \"\";\nif (sel != null \u0026\u0026 !game.P[sel].on) sel = null;\nrender();\n}\n});\nbReset.addEventListener(\"click\", function () {\ngame.reset(); sel = null; pending = null; won = false; anim = {}; msg = t.empty;\nview.s = 0;\nrender();\n});\nbuyEl.addEventListener(\"click\", function (e) {\ntrack(\"demo_limit_atc\", handle);\nvar b = buyButton(root);\nif (!b) return;\ne.preventDefault();\nif (b.disabled) { if (b.scrollIntoView) b.scrollIntoView({ block: \"center\" }); return; }\nb.click();\n});\nif (window.ResizeObserver) new window.ResizeObserver(function () { drawTray(); schedule(); }).observe(viewEl);\nelse window.addEventListener(\"resize\", function () { drawTray(); schedule(); });\nrender();\n}\nwindow.GPBR = { mount: mount, v: 1 };\n})();\n(function(){var C={\"v\":1,\"text\":\"boards\",\"pieces\":[[[0,0,0],[0,1,0],[0,2,0],[0,3,0],[0,4,0],[1,0,0],[1,2,0],[1,4,0],[2,4,0],[3,0,0],[3,4,0],[4,0,0],[4,4,0],[5,0,0],[5,2,0],[5,4,0],[6,0,0],[6,1,0],[6,2,0],[6,3,0],[6,4,0]],[[0,0,0],[0,1,0],[0,2,0],[0,3,0],[0,4,0],[1,0,0],[1,2,0],[1,4,0],[2,4,0],[3,0,0],[3,4,0],[4,0,0],[4,4,0],[5,0,0],[5,2,0],[5,4,0],[6,0,0],[6,1,0],[6,2,0],[6,3,0],[6,4,0]],[[0,0,0],[0,1,0],[0,2,0],[0,3,0],[0,4,0],[1,0,0],[1,2,0],[1,4,0],[2,2,0],[3,0,0],[3,2,0],[3,4,0],[4,0,0],[4,2,0],[4,4,0],[5,0,0],[5,2,0],[5,4,0],[6,0,0],[6,1,0],[6,2,0],[6,3,0],[6,4,0]],[[0,0,0],[0,1,0],[0,2,0],[0,3,0],[0,4,0],[1,0,0],[1,2,0],[1,4,0],[2,0,0],[2,2,0],[3,0,0],[3,2,0],[3,4,0],[4,2,0],[4,4,0],[5,0,0],[5,2,0],[5,4,0],[6,0,0],[6,1,0],[6,2,0],[6,3,0],[6,4,0]],[[0,0,0],[0,1,0],[0,2,0],[0,3,0],[0,4,0],[1,0,0],[1,2,0],[1,4,0],[2,2,0],[2,4,0],[3,0,0],[3,2,0],[3,4,0],[4,0,0],[4,2,0],[4,4,0],[5,0,0],[5,2,0],[5,4,0],[6,0,0],[6,1,0],[6,2,0],[6,3,0],[6,4,0]],[[0,0,0],[0,1,0],[0,2,0],[0,3,0],[0,4,0],[1,0,0],[1,2,0],[1,4,0],[2,2,0],[2,4,0],[3,0,0],[3,2,0],[3,4,0],[4,0,0],[4,2,0],[4,4,0],[5,0,0],[5,2,0],[5,4,0],[6,0,0],[6,1,0],[6,2,0],[6,3,0],[6,4,0]]],\"colors\":[\"#E8E4DA\",\"#E9A07E\",\"#9CC5A6\",\"#F0CF86\",\"#8FA6D6\",\"#C99BC4\"],\"goal\":{\"type\":\"slots\",\"span\":[7,7,7],\"slots\":[[[0,1,2],[7,5,1]],[[2,0,1],[1,7,5]],[[1,2,0],[5,1,7]],[[0,1,4],[7,5,1]],[[4,0,1],[1,7,5]],[[1,4,0],[5,1,7]]]},\"free\":0};var s=document.currentScript,r=s\u0026\u0026s.previousElementSibling;if(!r||(\" \"+r.className+\" \").indexOf(\" gpbr \")\u003c0)r=document.querySelector(\".gpbr:not([data-gpbr-on])\");if(!r||!window.GPBR)return;var go=function(){window.GPBR.mount(r,C);};if(window.IntersectionObserver){var o=new IntersectionObserver(function(e){if(e[0]\u0026\u0026e[0].isIntersecting){o.disconnect();go();}},{rootMargin:\"600px 0px\"});o.observe(r);}else go();})();\n\u003c\/script\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":51411272269991,"sku":"GP-TORT","price":20.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/torture_marble.png?v=1790218238"},{"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=\"\/he\/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":"6l-puzzle","title":"6L Puzzle | Hide the Holes","description":"\u003cp\u003eSix identical L-shaped pieces. One cube with holes in its walls. Getting them inside is only half the job.\u003c\/p\u003e\n\u003cp\u003eGoal: pack all 6 L-shaped pieces into the cube so that every hole is hidden.\u003c\/p\u003e\n\u003cp\u003eShips disassembled.\u003c\/p\u003e\n\u003cp\u003eDesigned by Osanori Yamamoto. Each window in the cube has to end up covered by a piece - no hole you can see through.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eWhat's special about 6L?\u003c\/strong\u003e\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003eDevelops 3D spatial imagination\u003c\/li\u003e\n\u003cli\u003eSix identical pieces, one box to fill\u003c\/li\u003e\n\u003cli\u003eA hide-the-holes puzzle, like Osanori's A6L and 6N\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003eDesigned by \u003ca href=\"\/he\/collections\/osanori-yamamoto\"\u003eOsanori Yamamoto\u003c\/a\u003e\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":51858012766375,"sku":null,"price":24.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/6l_puzzle___hide_the_holes_marble.png?v=1794451855"},{"product_id":"acorn","title":"Acorn | Pack 3 Pieces in Box","description":"\u003cp\u003eThree pieces. One cube with an open corner. Looks simple - it is not.\u003c\/p\u003e\n\u003cp\u003eGoal: pack all 3 pieces inside the cube.\u003c\/p\u003e\n\u003cp\u003eShips disassembled.\u003c\/p\u003e\n\u003cp\u003eDesigned by Osanori Yamamoto. Everything has to go in through the opening in one corner of the cube.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eWhat's special about Acorn?\u003c\/strong\u003e\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003eDevelops 3D spatial imagination\u003c\/li\u003e\n\u003cli\u003eOnly three pieces - and still a real puzzle\u003c\/li\u003e\n\u003cli\u003eSmall cube that sits well on a desk\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003eDesigned by \u003ca href=\"\/he\/collections\/osanori-yamamoto\"\u003eOsanori Yamamoto\u003c\/a\u003e\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":51858031575207,"sku":null,"price":22.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/acorn_marble_v2.png?v=1794817341"},{"product_id":"superdia","title":"Superdia | Pack 3 Pieces in Box","description":"\u003cp\u003eGoal: pack all 3 pieces inside the cube.\u003c\/p\u003e\n\u003cp\u003eShips disassembled.\u003c\/p\u003e\n\u003cp\u003eDesigned by Osanori Yamamoto. The window sits across the corner of the cube, and that changes how every piece has to go in. There is also a hole on the opposite corner. Why is it there?\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eWhat's special about Superdia?\u003c\/strong\u003e\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003eDevelops 3D spatial imagination\u003c\/li\u003e\n\u003cli\u003eOnly three pieces\u003c\/li\u003e\n\u003cli\u003eA window cut across the corner instead of a face\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003eDesigned by \u003ca href=\"\/he\/collections\/osanori-yamamoto\"\u003eOsanori Yamamoto\u003c\/a\u003e\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":51858037145767,"sku":null,"price":22.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/superdia___pack_the_pieces_in_box_marble.png?v=1794452171"},{"product_id":"voz-2","title":"Voz 2 | Pack 3 Pieces in Box","description":"\u003cp\u003ePack three pieces inside an apparent cube. The shape of this cube may be tricky to fill! \u003c\/p\u003e\n\u003cp\u003eGoal: pack all 3 pieces inside the cube.\u003c\/p\u003e\n\u003cp\u003eShips disassembled.\u003c\/p\u003e\n\u003cp\u003eDesigned by Osanori Yamamoto. The cube has more than one opening, and working out which one each piece needs is just one part of the puzzle.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eWhat's special about Voz 2?\u003c\/strong\u003e\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003eDevelops 3D spatial imagination\u003c\/li\u003e\n\u003cli\u003eOnly three pieces\u003c\/li\u003e\n\u003cli\u003eSmall cube that sits well on a desk\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003eDesigned by \u003ca href=\"\/he\/collections\/osanori-yamamoto\"\u003eOsanori Yamamoto\u003c\/a\u003e\u003c\/p\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":51858052350119,"sku":null,"price":22.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/voz_2_scattered_marble_00d98bc7-fa41-4c5e-95ca-2968c6280e4b.png?v=1794733165"},{"product_id":"minima-1","title":"MINIMA 1 | Pack 3 Pieces in Box","description":"\u003ch2\u003eMINIMA 1 - Quick Summary\u003c\/h2\u003e\u003cp\u003eMINIMA 1 is a packing puzzle by \u003ca href=\"\/he\/collections\/frederic-boucher\"\u003eFrederic Boucher\u003c\/a\u003e, from his MINIMA series. Your goal: fit all 3 turquoise pieces inside the small marble-white box. The box is open at one top corner and has a square window in its side.\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eBest for:\u003c\/strong\u003e solvers who like packing puzzles with very few pieces, and anyone who already owns \u003ca href=\"\/he\/products\/minima-tower\"\u003eMINIMA Tower\u003c\/a\u003e or \u003ca href=\"\/he\/products\/minima-slider\"\u003eMINIMA Slider\u003c\/a\u003e.\u003c\/p\u003e\u003ch2\u003eThe MINIMA Series\u003c\/h2\u003e\u003cp\u003eMINIMA is my favorite series of Frederic's. Every one is the same idea: a small box, a handful of pieces, and nothing else to hide behind. Frederic lives in Tokyo and works out many of his puzzles in his head on the Tokyo Metro. I make these with his blessing.\u003c\/p\u003e\u003cp\u003eMINIMA 1 is one of four new MINIMA puzzles, along with \u003ca href=\"\/he\/products\/minima-2\"\u003eMINIMA 2\u003c\/a\u003e, \u003ca href=\"\/he\/products\/minima-3\"\u003eMINIMA 3\u003c\/a\u003e and \u003ca href=\"\/he\/products\/minima-4\"\u003eMINIMA 4\u003c\/a\u003e. If you want all four, they come together as the \u003ca href=\"\/he\/products\/minima-1-4-set\"\u003eMINIMA 1-4 Set\u003c\/a\u003e. The next four, MINIMA 5 to 8, come together as the \u003ca href=\"\/he\/products\/minima-5-8-set\"\u003eMINIMA 5-8 Set\u003c\/a\u003e.\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eShips:\u003c\/strong\u003e Disassembled - the 3 pieces arrive outside the box.\u003c\/p\u003e\u003ch2\u003eFrequently Asked Questions\u003c\/h2\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWhat is MINIMA 1?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eA packing puzzle by Frederic Boucher: fit 3 pieces inside a small box. It is part of his MINIMA series, along with MINIMA 2, MINIMA 3, MINIMA 4, MINIMA 5 to 8, MINIMA Tower and MINIMA Slider.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eDoes MINIMA 1 come assembled?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eNo. It ships disassembled, with the 3 pieces outside the box. Getting them in is the puzzle.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWho designed MINIMA 1?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eFrederic Boucher, a Canadian puzzle designer living in Tokyo. You can find all his puzzles in the \u003ca href=\"\/he\/collections\/frederic-boucher\"\u003eFrederic Boucher collection\u003c\/a\u003e.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":51928454561959,"sku":null,"price":24.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/minima_1_scattered_marble.png?v=1795073506"},{"product_id":"minima-2","title":"MINIMA 2 | Pack 4 Pieces in Box","description":"\u003ch2\u003eMINIMA 2 - Quick Summary\u003c\/h2\u003e\u003cp\u003eMINIMA 2 is a packing puzzle by \u003ca href=\"\/he\/collections\/frederic-boucher\"\u003eFrederic Boucher\u003c\/a\u003e, from his MINIMA series. Your goal: fit all 4 turquoise pieces inside the small marble-white box. The box has two windows in its front, so you can watch the pieces settle in.\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eBest for:\u003c\/strong\u003e solvers who like packing puzzles with very few pieces, and anyone who already owns \u003ca href=\"\/he\/products\/minima-tower\"\u003eMINIMA Tower\u003c\/a\u003e or \u003ca href=\"\/he\/products\/minima-slider\"\u003eMINIMA Slider\u003c\/a\u003e.\u003c\/p\u003e\u003ch2\u003eThe MINIMA Series\u003c\/h2\u003e\u003cp\u003eMINIMA is my favorite series of Frederic's. Every one is the same idea: a small box, a handful of pieces, and nothing else to hide behind. Frederic lives in Tokyo and works out many of his puzzles in his head on the Tokyo Metro. I make these with his blessing.\u003c\/p\u003e\u003cp\u003eMINIMA 2 is one of four new MINIMA puzzles, along with \u003ca href=\"\/he\/products\/minima-1\"\u003eMINIMA 1\u003c\/a\u003e, \u003ca href=\"\/he\/products\/minima-3\"\u003eMINIMA 3\u003c\/a\u003e and \u003ca href=\"\/he\/products\/minima-4\"\u003eMINIMA 4\u003c\/a\u003e. If you want all four, they come together as the \u003ca href=\"\/he\/products\/minima-1-4-set\"\u003eMINIMA 1-4 Set\u003c\/a\u003e. The next four, MINIMA 5 to 8, come together as the \u003ca href=\"\/he\/products\/minima-5-8-set\"\u003eMINIMA 5-8 Set\u003c\/a\u003e.\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eShips:\u003c\/strong\u003e Disassembled - the 4 pieces arrive outside the box.\u003c\/p\u003e\u003ch2\u003eFrequently Asked Questions\u003c\/h2\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWhat is MINIMA 2?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eA packing puzzle by Frederic Boucher: fit 4 pieces inside a small box. It is part of his MINIMA series, along with MINIMA 1, MINIMA 3, MINIMA 4, MINIMA 5 to 8, MINIMA Tower and MINIMA Slider.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eDoes MINIMA 2 come assembled?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eNo. It ships disassembled, with the 4 pieces outside the box. Getting them in is the puzzle.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWho designed MINIMA 2?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eFrederic Boucher, a Canadian puzzle designer living in Tokyo. You can find all his puzzles in the \u003ca href=\"\/he\/collections\/frederic-boucher\"\u003eFrederic Boucher collection\u003c\/a\u003e.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":51928548343975,"sku":null,"price":24.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/minima_2_scattered_marble.png?v=1795073510"},{"product_id":"minima-3","title":"MINIMA 3 | Pack 3 Pieces in Box","description":"\u003ch2\u003eMINIMA 3 - Quick Summary\u003c\/h2\u003e\u003cp\u003eMINIMA 3 is a packing puzzle by \u003ca href=\"\/he\/collections\/frederic-boucher\"\u003eFrederic Boucher\u003c\/a\u003e, from his MINIMA series. Your goal: fit all 3 turquoise pieces inside the small marble-white box. The box has two small slots in its top and open sections in its walls.\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eBest for:\u003c\/strong\u003e solvers who like packing puzzles with very few pieces, and anyone who already owns \u003ca href=\"\/he\/products\/minima-tower\"\u003eMINIMA Tower\u003c\/a\u003e or \u003ca href=\"\/he\/products\/minima-slider\"\u003eMINIMA Slider\u003c\/a\u003e.\u003c\/p\u003e\u003ch2\u003eThe MINIMA Series\u003c\/h2\u003e\u003cp\u003eMINIMA is my favorite series of Frederic's. Every one is the same idea: a small box, a handful of pieces, and nothing else to hide behind. Frederic lives in Tokyo and works out many of his puzzles in his head on the Tokyo Metro. I make these with his blessing.\u003c\/p\u003e\u003cp\u003eMINIMA 3 is one of four new MINIMA puzzles, along with \u003ca href=\"\/he\/products\/minima-1\"\u003eMINIMA 1\u003c\/a\u003e, \u003ca href=\"\/he\/products\/minima-2\"\u003eMINIMA 2\u003c\/a\u003e and \u003ca href=\"\/he\/products\/minima-4\"\u003eMINIMA 4\u003c\/a\u003e. If you want all four, they come together as the \u003ca href=\"\/he\/products\/minima-1-4-set\"\u003eMINIMA 1-4 Set\u003c\/a\u003e. The next four, MINIMA 5 to 8, come together as the \u003ca href=\"\/he\/products\/minima-5-8-set\"\u003eMINIMA 5-8 Set\u003c\/a\u003e.\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eShips:\u003c\/strong\u003e Disassembled - the 3 pieces arrive outside the box.\u003c\/p\u003e\u003ch2\u003eFrequently Asked Questions\u003c\/h2\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWhat is MINIMA 3?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eA packing puzzle by Frederic Boucher: fit 3 pieces inside a small box. It is part of his MINIMA series, along with MINIMA 1, MINIMA 2, MINIMA 4, MINIMA 5 to 8, MINIMA Tower and MINIMA Slider.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eDoes MINIMA 3 come assembled?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eNo. It ships disassembled, with the 3 pieces outside the box. Getting them in is the puzzle.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWho designed MINIMA 3?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eFrederic Boucher, a Canadian puzzle designer living in Tokyo. You can find all his puzzles in the \u003ca href=\"\/he\/collections\/frederic-boucher\"\u003eFrederic Boucher collection\u003c\/a\u003e.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":51928931401895,"sku":null,"price":24.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/minima_3_scattered_marble.png?v=1795073514"},{"product_id":"minima-4","title":"MINIMA 4 | Pack 4 Pieces in Box","description":"\u003ch2\u003eMINIMA 4 - Quick Summary\u003c\/h2\u003e\u003cp\u003eMINIMA 4 is a packing puzzle by \u003ca href=\"\/he\/collections\/frederic-boucher\"\u003eFrederic Boucher\u003c\/a\u003e, from his MINIMA series. Your goal: fit all 4 turquoise pieces inside the small marble-white box. The box has two windows in its front and an open section on one side.\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eBest for:\u003c\/strong\u003e solvers who like packing puzzles with very few pieces, and anyone who already owns \u003ca href=\"\/he\/products\/minima-tower\"\u003eMINIMA Tower\u003c\/a\u003e or \u003ca href=\"\/he\/products\/minima-slider\"\u003eMINIMA Slider\u003c\/a\u003e.\u003c\/p\u003e\u003ch2\u003eThe MINIMA Series\u003c\/h2\u003e\u003cp\u003eMINIMA is my favorite series of Frederic's. Every one is the same idea: a small box, a handful of pieces, and nothing else to hide behind. Frederic lives in Tokyo and works out many of his puzzles in his head on the Tokyo Metro. I make these with his blessing.\u003c\/p\u003e\u003cp\u003eMINIMA 4 is one of four new MINIMA puzzles, along with \u003ca href=\"\/he\/products\/minima-1\"\u003eMINIMA 1\u003c\/a\u003e, \u003ca href=\"\/he\/products\/minima-2\"\u003eMINIMA 2\u003c\/a\u003e and \u003ca href=\"\/he\/products\/minima-3\"\u003eMINIMA 3\u003c\/a\u003e. If you want all four, they come together as the \u003ca href=\"\/he\/products\/minima-1-4-set\"\u003eMINIMA 1-4 Set\u003c\/a\u003e. The next four, MINIMA 5 to 8, come together as the \u003ca href=\"\/he\/products\/minima-5-8-set\"\u003eMINIMA 5-8 Set\u003c\/a\u003e.\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eShips:\u003c\/strong\u003e Disassembled - the 4 pieces arrive outside the box.\u003c\/p\u003e\u003ch2\u003eFrequently Asked Questions\u003c\/h2\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWhat is MINIMA 4?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eA packing puzzle by Frederic Boucher: fit 4 pieces inside a small box. It is part of his MINIMA series, along with MINIMA 1, MINIMA 2, MINIMA 3, MINIMA 5 to 8, MINIMA Tower and MINIMA Slider.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eDoes MINIMA 4 come assembled?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eNo. It ships disassembled, with the 4 pieces outside the box. Getting them in is the puzzle.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWho designed MINIMA 4?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eFrederic Boucher, a Canadian puzzle designer living in Tokyo. You can find all his puzzles in the \u003ca href=\"\/he\/collections\/frederic-boucher\"\u003eFrederic Boucher collection\u003c\/a\u003e.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":51929039241383,"sku":null,"price":24.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/minima_4_scattered_marble.png?v=1795073517"},{"product_id":"minima-5","title":"MINIMA 5 | Pack 4 Pieces in Box","description":"\u003ch2\u003eMINIMA 5 - Quick Summary\u003c\/h2\u003e\u003cp\u003eMINIMA 5 is a packing puzzle by \u003ca href=\"\/he\/collections\/frederic-boucher\"\u003eFrederic Boucher\u003c\/a\u003e, from his MINIMA series. Your goal: fit all 4 turquoise pieces inside the small marble-white box. It has two windows on top, and more openings cut into its front and side.\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eBest for:\u003c\/strong\u003e solvers who like packing puzzles with very few pieces, and anyone who has already solved \u003ca href=\"\/he\/products\/minima-1\"\u003eMINIMA 1\u003c\/a\u003e to \u003ca href=\"\/he\/products\/minima-4\"\u003e4\u003c\/a\u003e.\u003c\/p\u003e\u003ch2\u003eThe MINIMA Series\u003c\/h2\u003e\u003cp\u003eMINIMA is my favorite series of Frederic's. Every one is the same idea: a small box, a handful of pieces, and nothing else to hide behind. Frederic lives in Tokyo and works out many of his puzzles in his head on the Tokyo Metro. I make these with his blessing.\u003c\/p\u003e\u003cp\u003eThe boxes are all the same size. Only the openings change, and that is enough to make each one a new puzzle. Allard Walker wrote that everyone he handed the series to had the same reaction: \"How the heck can this simple little thing be \u003cem\u003ethat\u003c\/em\u003e difficult?\"\u003c\/p\u003e\u003cp\u003eMINIMA 5 is one of four new MINIMA puzzles, along with \u003ca href=\"\/he\/products\/minima-6\"\u003eMINIMA 6\u003c\/a\u003e, \u003ca href=\"\/he\/products\/minima-7\"\u003eMINIMA 7\u003c\/a\u003e and \u003ca href=\"\/he\/products\/minima-8\"\u003eMINIMA 8\u003c\/a\u003e. If you want all four, they come together as the \u003ca href=\"\/he\/products\/minima-5-8-set\"\u003eMINIMA 5-8 Set\u003c\/a\u003e. The first four are here as well, as the \u003ca href=\"\/he\/products\/minima-1-4-set\"\u003eMINIMA 1-4 Set\u003c\/a\u003e.\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eShips:\u003c\/strong\u003e Disassembled - the 4 pieces arrive outside the box.\u003c\/p\u003e\u003ch2\u003eFrequently Asked Questions\u003c\/h2\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWhat is MINIMA 5?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eA packing puzzle by Frederic Boucher: fit 4 pieces inside a small box. It is part of his MINIMA series, along with MINIMA 1 to 8, MINIMA Tower and MINIMA Slider.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eDoes MINIMA 5 come assembled?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eNo. It ships disassembled, with the 4 pieces outside the box. Getting them in is the puzzle.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWho designed MINIMA 5?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eFrederic Boucher, a Canadian puzzle designer living in Tokyo. You can find all his puzzles in the \u003ca href=\"\/he\/collections\/frederic-boucher\"\u003eFrederic Boucher collection\u003c\/a\u003e.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":52115714375847,"sku":null,"price":24.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/minima_5_scattered_marble.png?v=1795746632"},{"product_id":"minima-6","title":"MINIMA 6 | Pack 3 Pieces in Box","description":"\u003ch2\u003eMINIMA 6 - Quick Summary\u003c\/h2\u003e\u003cp\u003eMINIMA 6 is a packing puzzle by \u003ca href=\"\/he\/collections\/frederic-boucher\"\u003eFrederic Boucher\u003c\/a\u003e, from his MINIMA series. Your goal: fit all 3 turquoise pieces inside the small marble-white box. Its front is cut wide open, right up into the top, and one side is open too.\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eBest for:\u003c\/strong\u003e solvers who like packing puzzles with very few pieces, and anyone who has already solved \u003ca href=\"\/he\/products\/minima-1\"\u003eMINIMA 1\u003c\/a\u003e to \u003ca href=\"\/he\/products\/minima-4\"\u003e4\u003c\/a\u003e.\u003c\/p\u003e\u003ch2\u003eThe MINIMA Series\u003c\/h2\u003e\u003cp\u003eMINIMA is my favorite series of Frederic's. Every one is the same idea: a small box, a handful of pieces, and nothing else to hide behind. Frederic lives in Tokyo and works out many of his puzzles in his head on the Tokyo Metro. I make these with his blessing.\u003c\/p\u003e\u003cp\u003eThe boxes are all the same size. Only the openings change, and that is enough to make each one a new puzzle. Allard Walker wrote that everyone he handed the series to had the same reaction: \"How the heck can this simple little thing be \u003cem\u003ethat\u003c\/em\u003e difficult?\"\u003c\/p\u003e\u003cp\u003eMINIMA 6 is one of four new MINIMA puzzles, along with \u003ca href=\"\/he\/products\/minima-5\"\u003eMINIMA 5\u003c\/a\u003e, \u003ca href=\"\/he\/products\/minima-7\"\u003eMINIMA 7\u003c\/a\u003e and \u003ca href=\"\/he\/products\/minima-8\"\u003eMINIMA 8\u003c\/a\u003e. If you want all four, they come together as the \u003ca href=\"\/he\/products\/minima-5-8-set\"\u003eMINIMA 5-8 Set\u003c\/a\u003e. The first four are here as well, as the \u003ca href=\"\/he\/products\/minima-1-4-set\"\u003eMINIMA 1-4 Set\u003c\/a\u003e.\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eShips:\u003c\/strong\u003e Disassembled - the 3 pieces arrive outside the box.\u003c\/p\u003e\u003ch2\u003eFrequently Asked Questions\u003c\/h2\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWhat is MINIMA 6?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eA packing puzzle by Frederic Boucher: fit 3 pieces inside a small box. It is part of his MINIMA series, along with MINIMA 1 to 8, MINIMA Tower and MINIMA Slider.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eDoes MINIMA 6 come assembled?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eNo. It ships disassembled, with the 3 pieces outside the box. Getting them in is the puzzle.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWho designed MINIMA 6?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eFrederic Boucher, a Canadian puzzle designer living in Tokyo. You can find all his puzzles in the \u003ca href=\"\/he\/collections\/frederic-boucher\"\u003eFrederic Boucher collection\u003c\/a\u003e.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":52115742294183,"sku":null,"price":24.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/minima_6_scattered_marble.png?v=1795746739"},{"product_id":"minima-7","title":"MINIMA 7 | Pack 4 Pieces in Box","description":"\u003ch2\u003eMINIMA 7 - Quick Summary\u003c\/h2\u003e\u003cp\u003eMINIMA 7 is a packing puzzle by \u003ca href=\"\/he\/collections\/frederic-boucher\"\u003eFrederic Boucher\u003c\/a\u003e, from his MINIMA series. Your goal: fit all 4 turquoise pieces inside the small marble-white box. Two windows run up its front and over the top edge, split by a single thin column.\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eBest for:\u003c\/strong\u003e solvers who like packing puzzles with very few pieces, and anyone who has already solved \u003ca href=\"\/he\/products\/minima-1\"\u003eMINIMA 1\u003c\/a\u003e to \u003ca href=\"\/he\/products\/minima-4\"\u003e4\u003c\/a\u003e.\u003c\/p\u003e\u003ch2\u003eThe MINIMA Series\u003c\/h2\u003e\u003cp\u003eMINIMA is my favorite series of Frederic's. Every one is the same idea: a small box, a handful of pieces, and nothing else to hide behind. Frederic lives in Tokyo and works out many of his puzzles in his head on the Tokyo Metro. I make these with his blessing.\u003c\/p\u003e\u003cp\u003eThe boxes are all the same size. Only the openings change, and that is enough to make each one a new puzzle. Allard Walker wrote that everyone he handed the series to had the same reaction: \"How the heck can this simple little thing be \u003cem\u003ethat\u003c\/em\u003e difficult?\"\u003c\/p\u003e\u003cp\u003eMINIMA 7 is one of four new MINIMA puzzles, along with \u003ca href=\"\/he\/products\/minima-5\"\u003eMINIMA 5\u003c\/a\u003e, \u003ca href=\"\/he\/products\/minima-6\"\u003eMINIMA 6\u003c\/a\u003e and \u003ca href=\"\/he\/products\/minima-8\"\u003eMINIMA 8\u003c\/a\u003e. If you want all four, they come together as the \u003ca href=\"\/he\/products\/minima-5-8-set\"\u003eMINIMA 5-8 Set\u003c\/a\u003e. The first four are here as well, as the \u003ca href=\"\/he\/products\/minima-1-4-set\"\u003eMINIMA 1-4 Set\u003c\/a\u003e.\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eShips:\u003c\/strong\u003e Disassembled - the 4 pieces arrive outside the box.\u003c\/p\u003e\u003ch2\u003eFrequently Asked Questions\u003c\/h2\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWhat is MINIMA 7?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eA packing puzzle by Frederic Boucher: fit 4 pieces inside a small box. It is part of his MINIMA series, along with MINIMA 1 to 8, MINIMA Tower and MINIMA Slider.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eDoes MINIMA 7 come assembled?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eNo. It ships disassembled, with the 4 pieces outside the box. Getting them in is the puzzle.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWho designed MINIMA 7?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eFrederic Boucher, a Canadian puzzle designer living in Tokyo. You can find all his puzzles in the \u003ca href=\"\/he\/collections\/frederic-boucher\"\u003eFrederic Boucher collection\u003c\/a\u003e.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":52115754221735,"sku":null,"price":24.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/minima_7_scattered_marble.png?v=1795746868"},{"product_id":"minima-8","title":"MINIMA 8 | Pack 4 Pieces in Box","description":"\u003ch2\u003eMINIMA 8 - Quick Summary\u003c\/h2\u003e\u003cp\u003eMINIMA 8 is a packing puzzle by \u003ca href=\"\/he\/collections\/frederic-boucher\"\u003eFrederic Boucher\u003c\/a\u003e, from his MINIMA series. Your goal: fit all 4 turquoise pieces inside the small marble-white box. It has two windows on top and an opening that wraps around one corner.\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eBest for:\u003c\/strong\u003e solvers who like packing puzzles with very few pieces, and anyone who has already solved \u003ca href=\"\/he\/products\/minima-1\"\u003eMINIMA 1\u003c\/a\u003e to \u003ca href=\"\/he\/products\/minima-4\"\u003e4\u003c\/a\u003e.\u003c\/p\u003e\u003ch2\u003eThe Hardest of the Twelve\u003c\/h2\u003e\u003cp\u003eMINIMA 8 has a reputation. Allard Walker reviewed all twelve of the original series and got through most of them steadily, but of number 8 he wrote: \"that one keeps me thoroughly stumped for a long time\" (\u003ca href=\"https:\/\/allardspuzzlingtimes.blogspot.com\/2024\/03\/minima-series-1-12.html\"\u003ePuzzling Times\u003c\/a\u003e). Kevin Sadler wrote on \u003ca href=\"https:\/\/www.puzzlemad.co.uk\/2025\/03\/a-minima-that-is-anything-but.html\"\u003ePuzzleMad\u003c\/a\u003e that he had \"got quite badly stuck\" on it too.\u003c\/p\u003e\u003cp\u003eIt is still just a few pieces and a small box. That is what makes it so hard to put down.\u003c\/p\u003e\u003ch2\u003eThe MINIMA Series\u003c\/h2\u003e\u003cp\u003eMINIMA is my favorite series of Frederic's. Every one is the same idea: a small box, a handful of pieces, and nothing else to hide behind. Frederic lives in Tokyo and works out many of his puzzles in his head on the Tokyo Metro. I make these with his blessing.\u003c\/p\u003e\u003cp\u003eThe boxes are all the same size. Only the openings change, and that is enough to make each one a new puzzle. Allard Walker wrote that everyone he handed the series to had the same reaction: \"How the heck can this simple little thing be \u003cem\u003ethat\u003c\/em\u003e difficult?\"\u003c\/p\u003e\u003cp\u003eMINIMA 8 is one of four new MINIMA puzzles, along with \u003ca href=\"\/he\/products\/minima-5\"\u003eMINIMA 5\u003c\/a\u003e, \u003ca href=\"\/he\/products\/minima-6\"\u003eMINIMA 6\u003c\/a\u003e and \u003ca href=\"\/he\/products\/minima-7\"\u003eMINIMA 7\u003c\/a\u003e. If you want all four, they come together as the \u003ca href=\"\/he\/products\/minima-5-8-set\"\u003eMINIMA 5-8 Set\u003c\/a\u003e. The first four are here as well, as the \u003ca href=\"\/he\/products\/minima-1-4-set\"\u003eMINIMA 1-4 Set\u003c\/a\u003e.\u003c\/p\u003e\u003cp\u003e\u003cstrong\u003eShips:\u003c\/strong\u003e Disassembled - the 4 pieces arrive outside the box.\u003c\/p\u003e\u003ch2\u003eFrequently Asked Questions\u003c\/h2\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWhat is MINIMA 8?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eA packing puzzle by Frederic Boucher: fit 4 pieces inside a small box. It is part of his MINIMA series, along with MINIMA 1 to 8, MINIMA Tower and MINIMA Slider.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eDoes MINIMA 8 come assembled?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eNo. It ships disassembled, with the 4 pieces outside the box. Getting them in is the puzzle.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eIs MINIMA 8 harder than the other MINIMAs?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eOf the numbered MINIMAs, it has that reputation: it is the one both Allard Walker and Kevin Sadler got stuck on. That is why we rate it Expert, and MINIMA 5, 6 and 7 Hard. If you are new to the series, start with MINIMA 1.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e\u003cdetails class=\"gp-faq\"\u003e\u003csummary\u003e\u003ch3\u003eWho designed MINIMA 8?\u003c\/h3\u003e\u003c\/summary\u003e\u003cdiv class=\"gp-faq__a\"\u003e\u003cp\u003eFrederic Boucher, a Canadian puzzle designer living in Tokyo. You can find all his puzzles in the \u003ca href=\"\/he\/collections\/frederic-boucher\"\u003eFrederic Boucher collection\u003c\/a\u003e.\u003c\/p\u003e\u003c\/div\u003e\u003c\/details\u003e","brand":"Greg Puzzles","offers":[{"title":"Default Title","offer_id":52115764412583,"sku":null,"price":24.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0668\/2827\/1783\/files\/minima_8_scattered_marble.png?v=1795746978"}],"url":"https:\/\/gregpuzzles.com\/he\/collections\/puzzles-under-25.oembed?page=2","provider":"Greg Puzzles","version":"1.0","type":"link"}