/* Distinct worlds share controls, not their materials. */
body[data-material]{background:var(--world);background-image:radial-gradient(ellipse at 20% 0%,#fff9,transparent 65%);color:#353d3b}
body[data-material] .shell{max-width:1240px}body[data-material] header{border-bottom:1px solid #39443a25}body[data-material] .brand-mark{background:var(--accent);color:#fff8e9}
.game-menu{display:grid;grid-template-columns:minmax(280px,1.1fr) minmax(300px,1fr);align-items:center;gap:clamp(24px,5vw,70px);min-height:65vh;padding:32px 0}.menu-art{border-radius:38% 42% 28% 35%;overflow:hidden;box-shadow:0 24px 70px #3d453323;transform:rotate(-2deg)}.menu-copy h1{font-family:Georgia,serif;font-size:clamp(32px,4vw,55px);line-height:1.08;letter-spacing:-1.6px;margin:15px 0}.menu-copy #heroTitle{font-size:20px;line-height:1.4;max-width:400px;margin:18px 0 12px}.menu-copy #heroDescription{font-size:15px;line-height:1.7;max-width:420px;color:#535e56}.menu-copy .eyebrow{color:var(--accent);letter-spacing:1.8px}.menu-copy .actions{gap:10px}.menu-copy .actions button{min-height:48px}.difficulty-label{display:grid;gap:7px;margin:23px 0;font-size:13px;font-weight:bold;max-width:290px}.difficulty-label select{font:inherit;color:inherit;background:#fff9ed;min-height:48px;border:1px solid #65725866;border-radius:10px;padding:10px 14px}.advanced-play{border-top:1px solid #39443a25;padding:16px 0}.advanced-play summary{min-height:44px;cursor:pointer;font-size:13px}.advanced-play #allLevels{margin:14px 0}.advanced-play .generated-section{background:#fff5}.motion-setting{display:flex;gap:10px;align-items:center;padding:15px 0}.motion-setting input{width:22px;height:22px}
.illustrated-scene{display:block;width:100%;height:auto}.scene-object{transform-box:fill-box;transform-origin:center;animation:scene-float 5s ease-in-out infinite alternate}.object-1{animation-delay:-2s}.object-2{animation-delay:-3.5s}.scene-fabric .scene-object,.scene-woven .scene-object,.scene-ceramic .scene-object,.scene-wood .scene-object{animation-name:scene-rock}.scene-caption{position:relative;min-height:85px;padding-right:170px;overflow:hidden;background:#fff8}.scene-vignette{position:absolute;right:0;top:0;bottom:0;width:155px;pointer-events:none;mask-image:linear-gradient(90deg,transparent,#000 20%)}.scene-vignette .illustrated-scene{width:100%;height:100%;object-fit:cover}.scene-card{border:1px solid #39443a33;border-radius:22px;background:#fff9ed;overflow:hidden;box-shadow:0 16px 45px #35473216}.board{position:relative;isolation:isolate;min-height:340px;border-radius:0;padding:28px;gap:18px}.art-sprite{display:block;width:74%;height:74%;max-width:88px;max-height:88px;margin:auto;pointer-events:none;filter:drop-shadow(0 3px 1px #35443b1c)}.sprite-cell{padding:3px}.sprite-cell .art-sprite{width:90%;height:90%;min-width:25px}.cell{transition:background .15s,box-shadow .15s,filter .15s;box-shadow:0 2px 0 #37433115}.cell:active{transform:translateY(1px)}.cell.selected{outline:3px solid var(--accent);outline-offset:2px}.board .grid{gap:5px}.tools:empty,.readout:empty{display:none}.play-top h1{font-family:Georgia,serif}.play-top{margin-top:12px}.play-top #chapter{color:var(--accent)}.status{min-height:42px}body[data-material] .sidebar{border:1px solid #35433522;background:#fff8ed;border-radius:18px;padding:18px}.action-dock>button:disabled{opacity:.45;cursor:default}
/* The sewing table: real fabric shapes with stitching and a paper pattern. */
body[data-material=fabric]{background-image:repeating-linear-gradient(0deg,#fff1 0 1px,transparent 1px 5px),repeating-linear-gradient(90deg,#7a594509 0 1px,transparent 1px 5px)}.patchwork-parade{background:#d5b68b;background-image:repeating-linear-gradient(3deg,transparent 0 28px,#a47d4e18 29px 30px)}.patchwork-parade .grid{padding:20px;max-width:580px;background:#f4ead0;box-shadow:0 7px 16px #78522c2c;transform:rotate(-.6deg);border:1px solid #aa865759;gap:3px}.patchwork-parade .cloth-outline{border:1px dashed #9c8663;background:#e9ddc1;border-radius:2px}.patchwork-parade .stitched{background:var(--patch-color)!important;border:1px dashed #fff3d3;border-radius:3px;box-shadow:inset 0 0 0 3px #fff2;background-image:repeating-linear-gradient(45deg,#fff2 0 2px,transparent 2px 7px)!important}.patch-tray{gap:10px;background:#efdfbe;padding:18px}.patch-piece{display:grid;justify-items:center;align-content:center;gap:9px;min-width:90px;max-width:130px;min-height:115px!important;padding:10px!important;touch-action:none;cursor:grab;background:#fff8df!important;border:1px solid #b89a6e!important;border-radius:9px!important}.patch-shape{display:block;width:90px;max-height:80px;overflow:visible;pointer-events:none}.patch-piece .patch-shape *{pointer-events:auto}.patch-piece>span{font-size:11px}.piece-placed{opacity:.4;cursor:default}.patchwork-parade .stitched{touch-action:none;cursor:grab}.drop-valid{box-shadow:inset 0 0 0 3px #3a896b!important;background:#99c8aa!important}.drop-invalid{box-shadow:inset 0 0 0 3px #ba6553!important;background:#eab1a1!important}.drag-ghost{position:fixed;z-index:10000;pointer-events:none;opacity:.87;filter:drop-shadow(0 9px 9px #34291955)}.drag-ghost .patch-shape{width:100%;max-height:none}.patch-dragging{cursor:grabbing!important;user-select:none}
/* Copper gutters laid in moss. Each animated segment follows the water graph. */
.puddle-engineers{background-color:#9caf81;background-image:radial-gradient(ellipse at 15% 10%,#e1e6bb 0 3px,transparent 4px),radial-gradient(ellipse at 80% 70%,#637c4b55 0 4px,transparent 5px);background-size:47px 39px,61px 53px;overflow:hidden}.puddle-engineers .grid{max-width:570px;gap:0;border:10px solid #7b8c63;border-radius:18px;overflow:visible;box-shadow:0 13px 20px #34492c35}.puddle-engineers .cell{background:linear-gradient(140deg,#a9ba8a,#c5d0a0);border:1px solid #6b815a44;border-radius:0;overflow:visible;aspect-ratio:1;min-height:70px;box-shadow:inset 0 0 15px #657c4733}.puddle-engineers .cell>svg{width:100%;height:100%;position:absolute;inset:0}.gutter-shadow{fill:none;stroke:#70583d;stroke-width:20;stroke-linecap:round}.gutter-bed{fill:none;stroke:#c4a279;stroke-width:13;stroke-linecap:round}.water-stream{fill:none;stroke:#55aebe;stroke-width:10;stroke-linecap:round;animation:water-arrive .35s var(--flow-delay) both}.water-sparkle{fill:none;stroke:#c4f3f1;stroke-width:2;stroke-dasharray:3 12;animation:water-run .8s linear infinite,water-visible .35s var(--flow-delay) both}.puddle-engineers .wet{background:linear-gradient(140deg,#a9ba8a,#c5d0a0)}.puddle-engineers .marker{position:absolute;top:-14px;left:-12px;width:47px;height:47px;z-index:2;pointer-events:none}.puddle-engineers .marker.end{top:auto;left:auto;right:-12px;bottom:-10px}.puddle-engineers .marker .art-sprite{width:100%;height:100%}.puddle-engineers .thirsty{filter:saturate(.5);transform:rotate(12deg)}.puddle-engineers .bloomed{animation:flower-drink .6s calc(var(--flow-delay) + .2s) both}.puddle-engineers.raining:after{content:'';position:absolute;inset:0;pointer-events:none;z-index:-1;background-image:repeating-linear-gradient(112deg,transparent 0 29px,#d4edf075 30px 32px,transparent 34px 74px);background-size:90px 90px;animation:rain-fall .6s linear infinite}
/* Open sky, translucent movement squares and soft clouds. */
.cloud-shepherd{background:radial-gradient(ellipse at 90% 4%,#fff4bd 0 35px,transparent 110px),linear-gradient(#93bada,#c3dceb 70%,#a4bfaa);padding:35px 25px}.cloud-shepherd .grid{gap:7px}.cloud-shepherd .cell{background:#eef6fc29;border:1px solid #fff5;border-radius:20%;position:relative;box-shadow:none;aspect-ratio:1}.cloud-shepherd .cloud-target{border:2px dashed #fffbd2;background:#fff8d51c}.cloud-shepherd .rock{background:#6d8d9a15}.cloud-shepherd .art-sprite{width:95%;height:95%;filter:drop-shadow(0 6px 3px #426e9344)}.cloud-puff{animation:cloud-breathe 4s ease-in-out infinite}.puff-count{position:absolute;left:0;right:0;top:38%;color:#57758f;font-size:18px;pointer-events:none}.cloud-goal-count{position:absolute;bottom:2px!important;left:0;right:0;font-size:10px!important;color:#405d76}.cloud-shepherd .selected{background:#fff5;box-shadow:0 0 20px #fff5}
/* Ceramic tiles, pale grout, and a reference at the upper right. */
.mosaic-courtyard{background:#b9c7b6;background-image:linear-gradient(45deg,#fff1 25%,transparent 25% 75%,#fff1 75%);background-size:28px 28px;align-items:flex-start;display:flex;gap:22px;flex-wrap:nowrap}.mosaic-layout{flex:1;min-width:calc(88px + var(--tiles)*44px + (var(--tiles) + 1)*5px)}.mosaic-reference{flex:0 0 130px;display:grid;justify-items:center;gap:13px;padding:15px 10px;background:#f0e8cf;border-radius:9px;box-shadow:0 4px 8px #344f4126}.mosaic-reference strong{font-size:12px;letter-spacing:.3px}.mosaic-reference .target-preview{width:105px;min-width:0;gap:3px;margin:0;max-width:100%;border:5px solid #d6caac}.mosaic-reference .target-preview span{border-radius:2px;aspect-ratio:1;display:grid;place-items:center;font-size:14px;color:#ffedc1}.mosaic-row{gap:5px}.mosaic-row .tile{border:3px solid #ffffff45;border-bottom-color:#0002;box-shadow:inset 0 1px 10px #fff4,0 2px 4px #264f4126;border-radius:6px;color:#f4deb0;text-shadow:0 2px 1px #0002;position:relative;aspect-ratio:1}.mosaic-row .tile:after{content:'';position:absolute;inset:5px;border:1px solid #ffedc16b;border-radius:2px;pointer-events:none}.column-tools button,.mosaic-row button{border:1px solid #798c7588;background:#ede8d3;color:#3c6861;box-shadow:0 2px 0 #74866b55;border-radius:7px}.column-tools{margin-block:6px}.mosaic-rows{gap:5px}
/* Picnic blanket: card backs, flip reveals, and a little celebration. */
.picnic-pairs{background-color:#94ac76;background-image:repeating-linear-gradient(0deg,transparent 0 24px,#56754415 25px 26px);padding:25px}.picnic-pairs .grid{background-color:#f0d4c5;background-image:repeating-linear-gradient(0deg,#a94c5e15 0 18px,transparent 18px 36px),repeating-linear-gradient(90deg,#a94c5e15 0 18px,transparent 18px 36px);padding:18px;border:5px dashed #fff3dc;gap:10px;border-radius:7px;box-shadow:0 7px 16px #445a3d33}.picnic-pairs .cell{aspect-ratio:4/5;min-height:70px;border:2px solid #fff2da;background:#b96470;border-radius:10px;color:#fbf0d7;box-shadow:0 4px 0 #854e58;transition:background .2s}.picnic-pairs .cell.flipped{background:#fff8e9;border-color:#d9c7a5;color:#59483c;animation:card-reveal .25s ease-out}.picnic-pairs .matched{background:#e3eccb!important;border-color:#87a16a!important;box-shadow:0 3px 0 #8fa775!important;animation:pair-found .5s ease-out}.picnic-pairs .cell:not(.flipped) .art-sprite{opacity:.8;width:58%;height:58%}
/* A woven workshop floor. Rugs show their anchors and rollout direction. */
.carpet-unroll{background:#bd9879;background-image:repeating-linear-gradient(0deg,transparent 0 37px,#8d654c35 38px 40px);padding:25px}.carpet-unroll .grid{gap:3px;max-width:580px;padding:12px;background:#795e50;border:7px solid #ad815a;border-radius:6px;box-shadow:0 8px 18px #4c342f3b}.carpet-unroll .cell{aspect-ratio:1;background:#d7c4a4;border:1px solid #b9a483;border-radius:1px;color:#8e795a;position:relative}.carpet-unroll .woven-tile{background-color:var(--rug-color)!important;background-image:repeating-linear-gradient(90deg,#fff2 0 2px,#0001 2px 4px),repeating-linear-gradient(0deg,transparent 0 7px,#efd29d9c 7px 9px);box-shadow:inset 0 0 0 3px #eed1a07a;animation:rug-open .3s ease-out}.carpet-unroll .room-obstacle{background:#795e50;border:0;box-shadow:none}.carpet-unroll .rug-anchor{background:#ead6b5}.rug-anchor .art-sprite{width:80%;height:80%}.rug-label{position:absolute;inset:auto 0 3px;text-align:center;font-size:12px;color:#563f3c;background:#f8edcecd}
/* Additional worlds have their own drawing surfaces and tile materials. */
body[data-material=night] .board{background:radial-gradient(circle at 70% 10%,#989ac355,transparent 60%),#45475f;color:#f1e5ba}body[data-material=night] .cell{background:#777b9b;color:#fff2c8;border-color:#b5b3ca66}body[data-material=night] .cell.selected{outline-color:#edce87}body[data-material=wood] .board{background:repeating-linear-gradient(0deg,#b69770 0 48px,#a2835e 49px 51px)}body[data-material=wood] .cell{background:#e6d1a9;border:2px solid #b59a6c;border-radius:5px}body[data-material=paper] .board{background:#c1baa3;background-image:repeating-linear-gradient(0deg,transparent 0 21px,#eee7cf25 22px 23px)}body[data-material=paper] .cell{background:#f5e9cb;border:1px solid #bcb69c;border-radius:2px;box-shadow:2px 3px 0 #74725d33}body[data-material=clockwork] .board{background:#6a7880;background-image:radial-gradient(#a7b2ac55 1px,transparent 2px);background-size:15px 15px}body[data-material=clockwork] .cell{border:3px double #a8a27d;border-radius:12px;background:#c1c7bf}body[data-material=blueprint] .board{background-color:#466d7c;background-image:linear-gradient(#8fafb333 1px,transparent 1px),linear-gradient(90deg,#8fafb333 1px,transparent 1px);background-size:23px 23px}body[data-material=blueprint] .cell{background:#d1e0d1;border:1px solid #9bbfb4;border-radius:2px}body[data-material=desert] .board{background:repeating-linear-gradient(174deg,#e2c58c 0 18px,#dabc8455 19px 36px)}body[data-material=desert] .cell{border:2px solid #c79c62;background:#f2dfb6;border-radius:12px 4px}body[data-material=ocean] .board{background:repeating-radial-gradient(ellipse at 0 0,#80b4bf 0 14px,#8fbec6 16px 19px,#80b4bf 21px 30px)}body[data-material=ocean] .cell{background:#cce2df;border:2px solid #78a1a8;border-radius:12px}body[data-material=theatre] .board{background:linear-gradient(90deg,#724358 0 7%,#403e58 7% 93%,#724358 93%);border-bottom:16px solid #a57e52}body[data-material=shadow] .board{background:radial-gradient(ellipse at 35% 15%,#ebcc8b88,transparent 60%),#665c58}body[data-material=rooftop] .board{background:linear-gradient(#b5bad5,#ddc7bd)}body[data-material=garden] .board:not(.puddle-engineers){background-color:#a9bd87;background-image:radial-gradient(#587d4b44 1px,transparent 2px);background-size:13px 17px}body[data-material=garden] .cell{background:#d8dfb4;border:1px solid #8b9c6d;border-radius:22% 18% 20% 12%}body[data-material=woven] .board:not(.carpet-unroll){background:repeating-linear-gradient(45deg,#c9b0ab 0 6px,#d6c1b7 6px 12px)}body[data-material=sky] .board:not(.cloud-shepherd){background:linear-gradient(#a0c5da,#dde8dd)}.board .ally{box-shadow:inset 0 -5px 0 #467c9b55}.board .enemy{box-shadow:inset 0 -5px 0 #ac5a5155}.cell.reachable{border:2px dashed #3e8658;background:#dce9b9!important}.cell.selected{z-index:2}
@keyframes scene-float{to{translate:0 -6px}}@keyframes scene-rock{to{rotate:3deg}}@keyframes cloud-breathe{50%{translate:0 -3px;scale:1.03}}@keyframes water-run{to{stroke-dashoffset:-30}}@keyframes water-arrive{from{opacity:0;stroke-dasharray:0 100}to{opacity:1;stroke-dasharray:100 0}}@keyframes rain-fall{to{background-position:-30px 90px}}@keyframes flower-drink{from{filter:saturate(.3);transform:rotate(12deg) scale(.8)}to{filter:saturate(1.3);transform:rotate(0) scale(1.12)}}@keyframes card-reveal{from{transform:rotateY(80deg)}to{transform:rotateY(0)}}@keyframes pair-found{50%{transform:translateY(-5px)}}@keyframes rug-open{from{clip-path:inset(0 80% 0 0)}to{clip-path:inset(0)}}
.reduce-motion *,.reduce-motion *:before,.reduce-motion *:after{animation:none!important;transition:none!important}
@media(max-width:1050px){.mosaic-courtyard{flex-wrap:wrap}.mosaic-reference{order:-1;flex:0 0 auto;margin-left:auto;display:flex;align-items:center;padding:8px 12px}.mosaic-reference .target-preview{width:85px}.mosaic-layout{flex-basis:100%}.mosaic-courtyard{gap:10px}}
@media(max-width:700px){.game-menu{grid-template-columns:1fr;gap:20px;min-height:0;padding:20px 0 30px}.menu-art{max-width:430px;width:100%;margin:auto;border-radius:24px;transform:none}.menu-art .illustrated-scene{max-height:220px}.menu-copy h1{font-size:36px;letter-spacing:-1px}.menu-copy #heroTitle{font-size:17px}.menu-copy #heroDescription{font-size:14px}.menu-copy .eyebrow{font-size:10px;margin:0}.difficulty-label{margin:17px 0;max-width:100%}.scene-caption{padding-right:105px;min-height:75px;font-size:13px}.scene-vignette{width:100px}.board{padding:20px 12px}.patchwork-parade .grid{padding:10px}.patch-tray{gap:7px;padding:12px}.patch-piece{min-width:75px;max-width:95px;min-height:105px!important}.patch-shape{width:65px;max-height:65px}.puddle-engineers .cell{min-height:55px}.puddle-engineers .marker{width:34px;height:34px;top:-6px;left:-6px}.puddle-engineers .marker.end{bottom:-6px;right:-6px}.picnic-pairs .grid{padding:10px;gap:7px}.picnic-pairs .cell{min-height:58px}.puff-count{font-size:14px}.cloud-goal-count{font-size:8px!important}body[data-material] .sidebar{padding:10px}.mosaic-courtyard{padding:15px 10px}.mosaic-layout{min-width:calc(88px + var(--tiles)*44px + (var(--tiles) + 1)*5px)}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
/* Keep the fabric tray beside the pattern so dragging needs no page scrolling. */
.scene-card:has(> .patchwork-parade){display:grid;grid-template-columns:minmax(0,1fr) 210px;align-items:start}.scene-card:has(> .patchwork-parade)>.scene-caption,.scene-card:has(> .patchwork-parade)>.readout,.scene-card:has(> .patchwork-parade)>.status{grid-column:1/-1}.scene-card:has(> .patchwork-parade)>.readout{padding:8px 18px}.scene-card:has(> .patchwork-parade)>.readout>.grid{display:none}.patchwork-parade{padding:20px 12px;min-height:0}.patchwork-parade .grid{max-width:410px;margin:auto;padding:12px}.patch-tray{display:grid;grid-template-columns:1fr 1fr;padding:16px 10px;align-content:start;min-height:100%;margin:0}.patch-piece{min-width:0;width:100%;max-width:none;min-height:105px!important}.patch-tray>.tool:last-child{grid-column:1/-1}.patchwork-parade .cloth-outline{color:#9c866355}.board .grid>.cell.empty-patch{box-shadow:none}
@media(max-width:700px){.scene-card:has(> .patchwork-parade){grid-template-columns:1fr}.patch-tray{grid-template-columns:repeat(3,minmax(0,1fr));min-height:0;padding:10px}.patch-piece{min-height:95px!important}.patchwork-parade .grid{max-width:330px}.patchwork-parade{padding-block:14px}.patch-tray>.tool:last-child{grid-column:auto}.scene-card:has(> .patchwork-parade)>.readout{font-size:12px}.menu-copy h1{margin:8px 0}}

.cloud-shepherd .grid{max-width:530px;margin:auto}.cloud-shepherd .cell{min-height:44px}.patch-piece .patch-shape{max-width:100%;width:75px;height:65px}.patch-tray{align-items:start;grid-auto-rows:min-content}.patch-piece{padding:9px 6px!important;gap:5px;min-height:100px!important}.cloud-shepherd .cloud-goal-count{font-weight:700}
.illustrated-unit{position:relative;display:grid;place-items:center;padding:4px 4px 17px}.illustrated-unit .art-sprite{width:90%;height:90%;max-width:70px;max-height:70px}.entity-badge{position:absolute;bottom:1px!important;left:0;right:0;background:#fff8dcbd;color:#3e554c;font-size:9px!important;line-height:1.3;font-weight:700;padding:2px}.cloud-shepherd .cell>small.cloud-goal-count{bottom:3px!important}
.mosaic-courtyard{flex-direction:row;justify-content:center;align-items:flex-start}.mosaic-layout{flex:0 1 400px;max-width:400px}.cloud-shepherd{padding:22px}.cloud-shepherd .grid{max-width:420px}.cloud-shepherd .cell{border-radius:20px}
@media(max-width:1050px){.mosaic-courtyard{justify-content:flex-start}.mosaic-layout{flex-basis:100%;max-width:none}.mosaic-reference{margin-left:auto}}
.puddle-engineers .grid{max-width:380px;margin:auto}body[data-material=garden] .puddle-engineers .cell{border-radius:0;background:linear-gradient(140deg,#a9ba8a,#c5d0a0)}

@keyframes water-visible{from{opacity:0}to{opacity:1}}
@media(max-width:700px){.sidebar .field-guide:not([open]){display:none}.picnic-pairs .grid{max-width:330px}.cloud-shepherd .grid{max-width:350px}}
