.pg-shell{--ink:#674a30;--green:#528e65;color:var(--ink);max-width:1080px;margin:auto;background:#fff9eb;border:4px solid #cfb58e;border-radius:26px;padding:16px;box-shadow:0 8px 0 #c7ad8644;font-family:inherit}.pg-shell button{font-family:inherit;cursor:pointer;color:var(--ink);border:2px solid #d2b88e;border-radius:14px;background:#fffaf0;font-weight:800;min-height:46px;font-size:17px;box-shadow:0 3px 0 #c4a97e}.pg-shell button:focus-visible{outline:4px solid #2685b6;outline-offset:3px}.pg-shell button:disabled{opacity:.5;cursor:default}.pg-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}.pg-heading h2{font-size:clamp(20px,4vw,30px);margin:0;color:#43764c}.pg-heading button{padding:6px 12px}.pg-friends{display:flex;justify-content:center;gap:8px;margin:12px 0}.pg-friends button{width:84px;padding:4px}.pg-friends img{width:48px;height:50px;object-fit:contain;display:block;margin:auto}.pg-friends span{font-size:13px}.pg-friends button[aria-pressed=true]{border-color:#488f61;background:#e6f5d7;box-shadow:0 3px 0 #488f61}.pg-intro{text-align:center;max-width:650px;margin:12px auto}.pg-intro p{font-size:18px;font-weight:bold;line-height:1.8}.pg-levels{display:flex;justify-content:center;gap:15px;margin:28px 0}.pg-levels button{width:28%;font-size:30px;padding:22px 8px;color:#e5a32b;border:3px solid #d3b68b;background:#fff3ce}.pg-levels small{display:block;color:#795a35;font-size:20px}.pg-intro-art{display:flex;align-items:center;justify-content:center;gap:10px;background:#edf3ce;border-radius:25px;padding:12px}.pg-intro-art img{height:105px;max-width:25%;object-fit:contain}.pg-intro-art span{font-size:32px;color:#438b64}.pg-layout{display:grid;grid-template-columns:minmax(260px,1.15fr) minmax(300px,1fr);gap:18px;align-items:start}.pg-scene{padding:18px;border-radius:24px;background:#dbe8a4 center/cover;border:3px solid #9ab27b;position:relative}.pg-board{position:relative;aspect-ratio:1;display:grid;gap:0;border:3px solid #8b9c61;border-radius:15px;overflow:hidden;background:#d6e6b7ee;box-shadow:0 8px 16px #305b2933}.pg-cell{border:1px solid #a0ba7a88;position:relative;background:#f6f2cfbb}.pg-cell:nth-child(even){background:#e1ebbdc9}.pg-cell.pg-water{background:#8bd7e5;box-shadow:inset 0 -5px 0 #5eb8cf}.pg-water:after{content:'∿';color:#fff;font-size:35px;position:absolute;inset:0;text-align:center}.pg-rock svg{width:80%;height:80%;position:absolute;left:10%;top:10%}.pg-goal{background:#ffec9b!important;box-shadow:inset 0 0 0 3px #d6aa41}.pg-goal img{width:88%;height:88%;object-fit:contain;position:absolute;top:6%;left:6%}.pg-start:after{content:'★';color:#8aaf65;position:absolute;inset:0;font-size:30px;text-align:center}.pg-actor{position:absolute;left:0;top:0;z-index:5;pointer-events:none;transition:transform .65s cubic-bezier(.42,0,.24,1);display:flex;align-items:center;justify-content:center}.pg-actor img{width:92%;height:96%;object-fit:contain;filter:drop-shadow(0 3px 1px #4b573d55);transform-origin:50% 90%}.pg-actor.pg-step img{animation:pg-walk .32s ease-in-out 2}.pg-actor.pg-jump img{animation:pg-hop .75s ease-in-out}.pg-actor.pg-win img{animation:pg-hop .7s ease-in-out 3}.pg-target-label{text-align:center;padding:5px;background:#fff9dce8;border-radius:12px;font-weight:bold;font-size:17px;margin:8px 0 0}.pg-panel h3{font-size:18px;margin:2px 0 8px}.pg-queue{display:flex;align-content:flex-start;flex-wrap:wrap;gap:7px;min-height:146px;padding:10px;background:#fff;border:3px dashed #caad7b;border-radius:18px;position:relative}.pg-empty{width:100%;text-align:center;color:#997c55;align-self:center;line-height:1.6;margin:20px 0;font-weight:700}.pg-token{width:50px;height:51px;padding:0;position:relative;touch-action:none;user-select:none}.pg-token small{position:absolute;top:1px;left:4px;font-size:10px;color:#856946}.pg-token b{font-size:30px;line-height:1}.pg-token.pg-current{background:#ffe56b!important;border-color:#b88416!important;transform:scale(1.08)}.pg-token.pg-selected{outline:3px solid #3b92af}.pg-palette{display:flex;justify-content:center;flex-wrap:wrap;gap:9px;margin:12px 0}.pg-palette button{width:61px;height:72px;background:#e6f1d7;border-color:#84a569;touch-action:none;user-select:none}.pg-palette b{display:block;font-size:30px;line-height:1}.pg-palette span{font-size:13px}.pg-palette .pg-jump-button{background:#e6dcf4;border-color:#ad91c2;width:80px}.pg-hint{font-size:14px;line-height:1.5;min-height:22px;margin:6px 0;text-align:center}.pg-edit{display:flex;gap:7px;justify-content:center;margin:10px 0}.pg-edit button{font-size:14px;padding:7px 10px;min-height:44px}.pg-actions{display:flex;justify-content:center;gap:10px}.pg-actions button{padding:10px 17px;min-height:52px}.pg-actions .pg-run{background:#639962;color:#fff;border-color:#3e7042;box-shadow:0 4px 0 #3e7042;min-width:145px;font-size:23px}.pg-status{font-size:18px;font-weight:bold;text-align:center;line-height:1.6;margin:12px 0;min-height:29px}.pg-progress{font-weight:bold;font-size:16px;white-space:nowrap}.pg-ghost{position:fixed;z-index:10000;width:52px;height:52px;display:grid;place-items:center;background:#ffef9c;border:3px solid #c8a340;border-radius:13px;pointer-events:none;font-size:30px;box-shadow:0 7px 18px #0003}.pg-drop{border-color:#318b65;background:#eaf8dd}.pg-finish{text-align:center;padding:35px 8px}.pg-finish img{height:170px;object-fit:contain}.pg-finish h3{font-size:30px}.pg-finish .pg-stars{font-size:38px;color:#e4b232}.pg-card-art{background:linear-gradient(135deg,#cce7ab,#fff0b4);display:flex!important;align-items:center;justify-content:center;gap:10px}.pg-card-art img{width:48%!important;height:85%!important;object-fit:contain!important}.pg-card-art b{font-size:44px;color:#477c50}.pg-preview{margin:15px auto;max-width:1080px}.pg-preview h1{font-size:22px;text-align:center}@keyframes pg-walk{50%{transform:translateY(-8%) rotate(3deg)}}@keyframes pg-hop{45%{transform:translateY(-45%) rotate(-5deg)}75%{transform:translateY(-15%) rotate(2deg)}}@media(max-width:720px){.pg-layout{grid-template-columns:1fr;gap:12px}.pg-shell{padding:10px;border-radius:20px}.pg-scene{max-width:430px;width:100%;box-sizing:border-box;margin:auto;padding:10px}.pg-heading h2{font-size:20px}.pg-friends{gap:5px}.pg-friends button{width:62px}.pg-friends img{width:40px;height:44px}.pg-friends span{font-size:11px}.pg-queue{min-height:112px}.pg-heading button{font-size:14px}.pg-levels{gap:9px}.pg-levels button{font-size:26px}.pg-token{width:46px;height:47px}.pg-status{font-size:17px}.pg-panel{padding:0 2px}}@media(prefers-reduced-motion:reduce){.pg-actor{transition:transform .15s}.pg-actor img{animation:none!important}}

.pg-scene{padding-top:80px}.pg-edit button{white-space:nowrap;font-size:13px}.pg-edit [data-edit=left],.pg-edit [data-edit=right]{min-width:44px;font-size:22px}.pg-actions .pg-run{color:#fff!important}.pg-scene .pg-target-label{font-size:16px}@media(max-width:720px){.pg-scene{padding-top:65px}}

.pg-board-status{position:absolute;top:9px;left:12px;right:12px;text-align:center;background:#fff9e9e8;padding:7px;border-radius:12px;font-weight:bold;font-size:15px;line-height:1.4;margin:0}

.pg-levels button{min-width:74px;min-height:100px;border:3px solid #dabd71;border-radius:24px;background:#fff0bd;box-shadow:0 5px 0 #dfc990;font-size:30px;color:#674a30}.pg-levels small{font-size:13px;margin-top:10px}@media(max-width:720px){.pg-levels button{font-size:24px;min-height:84px}}
/* Compact board programming: all arrows and reset stay beside/below the centered board. */
#shapeGame .pg-shell,#shapeGame .pg-shell *{box-sizing:border-box;min-width:0}
#shapeGame .pg-shell{width:100%;max-width:850px;margin:0 auto;padding:12px}
#shapeGame .pg-layout{grid-template-columns:minmax(0,1fr) minmax(0,.75fr);gap:14px;align-items:center}
#shapeGame .pg-scene{width:100%;max-width:430px;margin:0 auto;padding:42px 8px 8px}
#shapeGame .pg-board{width:100%;margin:auto}
#shapeGame button.pg-cell{padding:0;min-height:0;border:1px solid #a0ba7a88;border-radius:0;box-shadow:none;background:#f6f2cfbb;opacity:1;touch-action:manipulation}
#shapeGame button.pg-cell:nth-child(even){background:#e1ebbdc9}
#shapeGame .pg-cell-code{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#327e61;font-size:clamp(22px,5vw,40px);font-weight:900;text-shadow:0 1px #fff;z-index:2;pointer-events:none}
#shapeGame .pg-start.pg-coded .pg-cell-code{align-items:flex-start;justify-content:flex-start;font-size:24px;padding-left:2px}
#shapeGame .pg-actor img{width:76%;height:88%}
#shapeGame .pg-facing{position:absolute;right:0;bottom:0;min-width:22px;background:#fff6a3;border:2px solid #b68e36;border-radius:50%;font-size:21px;font-weight:900;line-height:1.05;color:#70531c;padding:1px 3px}
#shapeGame .pg-palette{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:4px 0}
#shapeGame .pg-palette button{width:100%;height:60px;min-height:44px;padding:2px;font-size:14px}
#shapeGame .pg-palette b{font-size:28px}#shapeGame .pg-palette span{font-size:12px}
#shapeGame .pg-palette [aria-pressed=true]{outline:3px solid #348562;background:#ffed9c}
#shapeGame .pg-board-status{font-size:14px;top:7px;left:8px;right:8px;padding:4px}
#shapeGame .pg-actions{gap:7px;margin-top:5px}#shapeGame .pg-actions button{font-size:17px;padding:7px;min-height:44px;flex:1}
#shapeGame .pg-status{font-size:14px;line-height:1.3;margin:6px 0 0;min-height:2.6em}
#shapeGame .pg-cell.pg-drop{background:#fff19e!important;box-shadow:inset 0 0 0 4px #318b65}
@media(max-width:720px){
#shapeGame .pg-shell{padding:7px;border-width:3px;border-radius:18px}
#shapeGame .pg-layout{grid-template-columns:minmax(0,1fr);gap:5px}
#shapeGame .pg-scene{max-width:min(100%,360px);padding:35px 6px 6px}
#shapeGame .pg-board{max-width:min(100%,calc(100dvh - 300px));min-height:180px;min-width:180px}
#shapeGame .pg-heading{gap:4px;margin-bottom:5px}#shapeGame .pg-heading h2{font-size:17px;white-space:nowrap}
#shapeGame .pg-heading button{min-height:36px;padding:3px 7px;font-size:12px}#shapeGame .pg-progress{font-size:12px}
#shapeGame .pg-palette{grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;margin:4px 0}
#shapeGame .pg-palette:has(.pg-jump-button){grid-template-columns:repeat(6,minmax(0,1fr))}
#shapeGame .pg-palette button{height:49px;min-height:44px;box-shadow:0 2px 0 #c4a97e}
#shapeGame .pg-palette b{font-size:24px}#shapeGame .pg-palette span{font-size:10px;white-space:nowrap}
#shapeGame .pg-hint{font-size:11px;min-height:0;margin:3px 0}
#shapeGame .pg-status{font-size:12px;min-height:1.3em;margin:5px 0 0}
}
/* Sequential tap-only programming. Every press appends one command. */
#shapeGame .pg-cell{padding:0;min-height:0;border:1px solid #a0ba7a88;box-shadow:none;opacity:1}
#shapeGame .pg-queue{flex-wrap:nowrap;overflow-x:auto;align-items:center;gap:5px;min-height:66px;height:66px;padding:6px;border:2px dashed #c8b282;border-radius:14px;margin:3px 0 8px;scrollbar-width:thin}
#shapeGame .pg-queue .pg-token{display:flex;flex:none;align-items:center;justify-content:center;width:43px;height:44px;background:#fff0b3;border:2px solid #dbb660;border-radius:12px;box-shadow:0 2px 0 #d6b161;color:#54794b}
#shapeGame .pg-queue .pg-token small{font-size:10px}#shapeGame .pg-queue .pg-token b{font-size:28px;line-height:1}
#shapeGame .pg-empty{white-space:nowrap;font-size:13px;margin:0;text-align:center;line-height:1.4}
#shapeGame .pg-palette{grid-template-columns:repeat(4,minmax(0,1fr))}
#shapeGame .pg-palette:has(.pg-dir-J){grid-template-columns:repeat(5,minmax(0,1fr))}
#shapeGame .pg-direction{border:2px solid #8faf7a;border-radius:18px;box-shadow:0 4px 0 #809c62;background:#e9f3cb;transition:transform .1s,box-shadow .1s}
#shapeGame .pg-direction:active{transform:translateY(3px);box-shadow:0 1px 0 #809c62}
#shapeGame .pg-dir-U{background:#fff0bf;border-color:#d9b261;color:#7c5a22}
#shapeGame .pg-dir-R{background:#d9efdf;border-color:#83ac8f;color:#3b7051}
#shapeGame .pg-dir-D{background:#deedfb;border-color:#8db4d7;color:#386c99}
#shapeGame .pg-dir-L{background:#ffe0d5;border-color:#d5a28e;color:#9b634b}
#shapeGame .pg-dir-J{background:#e9def6;border-color:#ae95c5;color:#715291}
#shapeGame .pg-actions{flex-wrap:wrap}#shapeGame .pg-actions .pg-run{flex:1 0 100%}#shapeGame .pg-actions [data-undo],#shapeGame .pg-actions [data-reset]{font-size:13px;min-height:39px}
@media(max-width:720px){
#shapeGame .pg-board{max-width:min(100%,calc(100dvh - 370px))}
#shapeGame .pg-queue{height:56px;min-height:56px;margin:2px 0 5px;padding:4px;gap:4px}
#shapeGame .pg-queue .pg-token{height:40px;width:38px}
#shapeGame .pg-queue .pg-token b{font-size:25px}
#shapeGame .pg-palette{grid-template-columns:repeat(4,minmax(0,1fr))}
#shapeGame .pg-palette:has(.pg-dir-J){grid-template-columns:repeat(5,minmax(0,1fr))}
#shapeGame .pg-actions{gap:4px}#shapeGame .pg-actions .pg-run{flex:1 1 38%;font-size:16px}#shapeGame .pg-actions [data-undo],#shapeGame .pg-actions [data-reset]{flex:1 1 24%;font-size:11px;padding:3px}
}

/* Show the leading car of the original full train without changing its art. */
.pg-goal-train img{width:100%;height:100%;object-fit:cover;object-position:right center;transform:scale(1.3);transform-origin:right center}.pg-goal-train{overflow:hidden}
