#shapeGame{color:#344d48;scroll-margin-top:20px}#shapeGame *{box-sizing:border-box}#shapeGame button{font:inherit;font-weight:700;cursor:pointer;touch-action:manipulation;min-height:48px;color:inherit}#shapeGame button:disabled{cursor:default;filter:none}#shapeGame button:focus-visible{outline:4px solid #356e87;outline-offset:4px}#shapeGame [hidden]{display:none!important}.sg-shell{padding:24px;background:#fffaf0;border:2px solid #e6d9b9;border-radius:28px}.sg-heading{text-align:center}.sg-kicker{font-size:12px;font-weight:700;color:#677b58;letter-spacing:.1em}.sg-heading h2{font-size:clamp(20px,4vw,28px);margin:8px 0}.sg-heading p{font-size:14px;line-height:1.8;margin:8px 0 20px}.sg-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.sg-card{display:flex;flex-direction:column;text-align:left;background:#fffdf8;border:2px solid #ded8c6;border-radius:20px;padding:0 0 16px;overflow:hidden;box-shadow:0 4px 0 #e7e0cc}.sg-thumbnail{position:relative;display:block;aspect-ratio:16/10;width:100%;background:#e6f1ec;border-bottom:2px solid #ded8c6}.sg-card:nth-child(2) .sg-thumbnail{background:#f7edcd}.sg-card:nth-child(3) .sg-thumbnail{background:#e8e9f3}.sg-thumbnail>svg{height:100%;width:100%;padding:9px}.sg-play{position:absolute;right:10px;bottom:10px;display:grid;place-items:center;width:38px;height:38px;background:#fffdf2e8;border-radius:50%;font-size:16px;color:#527f70}.sg-card-name{font-size:20px;margin:12px 16px 4px}.sg-card-caption{font-size:13px;margin:0 16px}.sg-card-meta{font-size:11px;font-weight:400;margin:8px 16px 0;color:#647268}.sg-parent-note{text-align:center;font-size:12px;margin:22px 0 0;color:#647268}.sg-playing{max-width:740px;margin:auto}.sg-controls{display:flex;align-items:center;justify-content:space-between;gap:12px}.sg-back{border:0;background:#eeeada;padding:8px 15px;border-radius:14px;font-size:13px!important}.sg-progress{font-size:15px;font-weight:700;white-space:nowrap;background:#e5edda;padding:8px 14px;border-radius:20px}.sg-board{position:relative;aspect-ratio:3/2;width:min(100%,440px);margin:0 auto;background:linear-gradient(#ecf5ef,#e3f0e7);border-radius:24px;isolation:isolate}.sg-slot{position:absolute;border:0;background:none!important;padding:0;min-height:0!important;transition:filter .18s}.sg-slot>svg{display:block;width:100%;height:100%;overflow:visible;fill:#fffdf0;stroke:#718c81;stroke-width:3;stroke-dasharray:5 4}.sg-slot.sg-filled>svg{fill:var(--piece);stroke:#fff8e9;stroke-dasharray:none;stroke-width:2}.sg-slot:hover:not(:disabled)>svg{fill:#f9efd0}.sg-slot:active{transform:none}.sg-decoration{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.sg-status{font-size:15px;font-weight:700;min-height:3.6em;line-height:1.8;text-align:center;margin:14px 0 10px}.sg-tray{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;width:min(100%,440px);margin:auto}.sg-piece{position:relative;border:3px solid #ded9c8;background:#fffefa;border-radius:20px;padding:10px 5px;display:flex;flex-direction:column;align-items:center;gap:4px;box-shadow:0 4px 0 #e5deca;font-size:15px!important}.sg-piece>svg{width:60px;height:60px;fill:var(--piece);stroke:#fff8e9;stroke-width:2}.sg-piece[aria-pressed=true]{border-color:#356e87;background:#edf5f5;box-shadow:0 0 0 2px #356e87}.sg-piece:disabled{background:#efeee5;box-shadow:none;border-color:#dfddce}.sg-piece:disabled>svg{opacity:.3}.sg-check{position:absolute;right:7px;top:3px;font-size:24px;color:#287760}.sg-reset{display:block;background:none;border:0;text-decoration:underline;text-underline-offset:4px;font-size:12px!important;font-weight:400!important;margin:18px auto 0}.sg-finish{text-align:center;background:#fff0bf;border-radius:18px;padding:16px;margin-top:20px}.sg-finish p{font-weight:700;margin:0 0 12px;line-height:1.8}.sg-finish button{border:0;border-radius:14px;background:#367c62;color:#fff!important;padding:12px 18px;margin:4px}.sg-finish .sg-other{background:#fffaf0;color:#344d48!important}.sg-complete{box-shadow:0 0 0 4px #eac66e}.sg-complete .sg-decoration{animation:sg-bob 1.5s ease-in-out 2}@keyframes sg-bob{50%{transform:translateY(-3px)}}@media(max-width:680px){.sg-cards{grid-template-columns:1fr;max-width:400px;margin:auto}.sg-thumbnail{aspect-ratio:16/9}.sg-shell{padding:20px 16px}}@media(max-width:350px){.sg-shell{padding:15px 8px;border-radius:20px}.sg-heading p{font-size:12px}.sg-tray{gap:8px}.sg-piece{padding:8px 2px;font-size:13px!important}.sg-piece>svg{width:50px;height:50px}.sg-status{font-size:13px}.sg-back{padding:8px 10px}}@media(prefers-reduced-motion:reduce){#shapeGame *,#shapeGame *:before,#shapeGame *:after{animation:none!important;transition:none!important}}
.extra-thumbnail{display:flex;align-items:center;justify-content:center;font-size:clamp(2.5rem,5vw,4rem);min-height:180px;background:linear-gradient(145deg,#fff0d8,#d8ede7)}

.sg-levels{display:flex;justify-content:center;gap:10px;margin:16px 0 20px}.sg-levels button{border:2px solid #ded8c6;background:#fffdf8;border-radius:14px;padding:8px 18px;font-size:18px}.sg-levels button[aria-pressed=true]{background:#ffebae;border-color:#b38633;box-shadow:0 3px 0 #dfc16d}.sg-quantity{font-size:13px;color:#526b60}.sg-tray:has(.sg-piece:nth-child(2):last-child){grid-template-columns:repeat(2,minmax(0,1fr));max-width:300px}

.sg-tray:has(.sg-piece:only-child){grid-template-columns:1fr;max-width:150px}.sg-piece>svg{overflow:visible}

#shapeGame .sg-piece{touch-action:none;user-select:none;-webkit-user-select:none}.sg-drop-ready>svg{stroke:#347d65;stroke-width:5;fill:#fff0b8}.sg-drag-ghost{position:fixed;z-index:10000;pointer-events:none;transform:translate(-50%,-50%);filter:drop-shadow(0 5px 5px #345b4933)}.sg-drag-ghost>svg{width:100%;height:100%;overflow:visible;fill:var(--piece);stroke:#fff8e9;stroke-width:2}
.extra-thumbnail>img{display:block;width:100%;height:100%;object-fit:contain}

.sg-shell{position:relative;padding-bottom:78px}.sg-corner-back{position:absolute;right:16px;bottom:14px;min-width:66px;min-height:44px!important;font-size:13px!important}.sg-level-screen{min-height:360px}.sg-level-choices{display:flex;justify-content:center;gap:20px;flex-wrap:wrap;margin:52px auto}.sg-level-choices button{min-width:100px;min-height:100px!important;border:3px solid #dabd71;border-radius:24px;background:#fff0bd;font-size:30px!important;box-shadow:0 5px 0 #dfc990}.sg-round{font-weight:700;color:#5b796b}.sg-result{text-align:center;min-height:350px}.sg-result-stars{font-size:30px!important;color:#a97918;letter-spacing:4px}.sg-result>.sg-again{padding:14px 24px;background:#367c62;border:0;border-radius:16px;color:white!important}.sg-finish{margin-top:12px;padding:10px}.sg-finish p{margin:0}@media(max-width:400px){.sg-level-choices{gap:12px}.sg-level-choices button{min-width:74px;min-height:84px!important}}
.sg-level-choices button small{display:block;font-size:13px;margin-top:10px}.sg-level-choices button{font-size:24px!important}

/* Only geometric piece outlines are visible until the child assembles them. */
.sg-slot{z-index:1}.sg-decoration{z-index:2}.sg-piece small{display:block;font-size:10px;font-weight:500;margin-top:2px}.sg-tray{grid-template-columns:repeat(auto-fit,minmax(76px,1fr))}.sg-tray:has(.sg-piece:nth-child(4)){grid-template-columns:repeat(3,minmax(0,1fr))}.sg-slot:focus-visible{z-index:3}
/* Give the smallest phone viewport a little more board room. */
@media(max-width:350px){.sg-playing{padding-left:4px;padding-right:4px}}

/* Polygon clipping prevents overlapping triangular bounds from stealing taps. */
.sg-slot>svg{fill:#f2f6ed;stroke:#84998c;stroke-width:2;stroke-dasharray:4 3}.sg-slot:focus-visible>svg{stroke:#356e87;stroke-width:5;stroke-dasharray:none}.sg-slot.sg-filled>svg{fill:var(--piece);stroke:#fff8e9;stroke-width:1.5}.sg-piece small{font-size:11px}
/* SVG hidden is explicit: finishing details appear only after assembly. */
.sg-decoration[hidden]{display:none!important}

/* Compact tray: only the piece and remaining count are visible. */
.sg-playing .sg-tray{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;max-width:440px}
.sg-playing .sg-piece{min-height:76px!important;padding:6px 3px;gap:2px;border-width:2px;border-radius:15px}
.sg-playing .sg-piece>svg{width:46px;height:46px}
.sg-playing .sg-quantity{font-size:14px;line-height:1.25}
.sg-playing .sg-status{min-height:2.8em;margin:10px 0;line-height:1.5}
.sg-playing.sg-finished .sg-heading{visibility:hidden}
.sg-playing.sg-finished .sg-status{visibility:hidden}
@media(min-width:480px){.sg-playing .sg-tray:has(.sg-piece:nth-child(4)){grid-template-columns:repeat(4,minmax(0,1fr))}.sg-playing .sg-piece{min-height:82px!important}.sg-playing .sg-piece>svg{width:50px;height:50px}}
