body.thread-adventure .yarn-world{position:absolute;inset:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(190px,25%);grid-template-rows:auto minmax(0,1fr) auto;gap:8px 14px;padding:12px;overflow:hidden;color:#173c61;background:linear-gradient(120deg,#fff6e9ee,#ffe7dfe6),url('art/02-board-room-v1.webp') center/cover;container-type:size}
.yarn-world *{box-sizing:border-box}.yarn-heading{grid-column:1/-1;display:flex;align-items:center;gap:12px;min-height:48px}.yarn-heading>div:first-child{flex:1}.yarn-heading small{font:800 11px/1.2 'Trebuchet MS',sans-serif;letter-spacing:1px;color:#9a526b}.yarn-heading h3{font:clamp(23px,2.7vw,35px)/1.05 Froople,'Trebuchet MS',sans-serif;margin:2px 0}.yarn-dots{display:flex;gap:6px}.yarn-dots i{width:13px;height:13px;border:2px solid #cc9fac;border-radius:50%;background:#fffaf0}.yarn-dots .current{background:#f68ca2}.yarn-dots .done{background:#ffda66;border-color:#dca82b}
.yarn-world button{color:#173c61;font:800 16px/1.1 'Trebuchet MS',sans-serif;min-width:44px;min-height:44px;border:2px solid #fffaf0;border-radius:16px;box-shadow:0 4px #bd8f90;background:#ffdf75;padding:8px 12px;cursor:pointer}.yarn-world button:disabled{cursor:default;opacity:.55}.yarn-world button:focus-visible{outline:3px solid #146faa;outline-offset:3px}.yarn-heading .yarn-hear{height:48px;width:48px;padding:0;border-radius:50%;background:#c7edf5;font-size:24px;box-shadow:0 3px #7ab1c5}
.yarn-playarea{position:relative;min-width:0;min-height:0;container-type:size}.yarn-table{position:absolute;left:50%;top:50%;translate:-50% -50%;width:min(100cqw,100cqh);aspect-ratio:1;border:10px solid #d58d9d;border-radius:18%;box-shadow:inset 0 0 0 4px #fff8e8,0 6px #ad738a,0 12px 20px #98665322;background:repeating-linear-gradient(92deg,#fff7e626 0 2px,transparent 2px 8px),repeating-linear-gradient(0deg,#edafbb55 0 2px,transparent 2px 8px),radial-gradient(ellipse at 40% 20%,#ffe8d9,#f9c7d0);touch-action:none;isolation:isolate}
.yarn-lines{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;z-index:4}.yarn-route{stroke:#fffbe6;stroke-width:12;stroke-linecap:round;stroke-dasharray:15 25;fill:none;opacity:0;filter:drop-shadow(0 2px 1px #ad6a7a)}.yarn-assisted .yarn-route,.yarn-demoing .yarn-route{opacity:.85;animation:yarn-dashes 2s linear infinite}.yarn-aim{fill:none;stroke:#207eaa;stroke-width:12;stroke-linecap:round;stroke-dasharray:8 22}
.yarn-world .yarn-sprite{background-image:url('art/yarn-sprites-v1.png?v=adventure-01e3525620e1');background-size:300% 200%;background-repeat:no-repeat}.yarn-table .yarn-ball{position:absolute;z-index:7;width:11%;aspect-ratio:1;min-width:44px;min-height:44px;height:auto;border:0;border-radius:50%;padding:0;background-color:transparent;background-position:var(--sprite-x) 0;box-shadow:none;translate:-50% -50%;transform:rotate(var(--roll,0deg));filter:drop-shadow(0 5px 2px #794b652f);touch-action:none;cursor:grab;transition:filter .15s}.yarn-table .yarn-ball:disabled{opacity:1}.yarn-pulling .yarn-ball{cursor:grabbing;filter:drop-shadow(0 0 8px #ffdc58)}.yarn-world[data-shot="ready"] .yarn-ball{outline:3px dashed #fffcdf;outline-offset:3px;animation:yarn-ready 1.6s ease-in-out infinite}.yarn-table .yarn-demo-ball{display:none;position:absolute;z-index:6;width:11%;aspect-ratio:1;translate:-50% -50%;background-position:0 0;opacity:.45;pointer-events:none}.yarn-demoing .yarn-demo-ball{display:block}.yarn-demoing .yarn-ball{opacity:.25}
.yarn-hole{position:absolute;translate:-50% -50%;width:14%;aspect-ratio:1;border-radius:50%;border:5px solid #ffeec6;background:radial-gradient(ellipse at 50% 65%,#221c38 20%,#6b3b61 62%,#c3889b);box-shadow:0 4px 0 #a96c83,inset 0 6px 10px #28172e;display:grid;place-items:center;z-index:2;color:#fce9b7;font-size:clamp(18px,3vw,30px)}.yarn-hole.hole-ready{box-shadow:0 0 0 5px #fedd7777,0 4px 0 #a96c83,inset 0 6px 10px #28172e}.yarn-hole span{opacity:.65}
.yarn-block{position:absolute;z-index:3;border-radius:24%;border:3px solid #f9deaf;background:repeating-linear-gradient(90deg,#d59a5c66 0 3px,transparent 3px 12px),linear-gradient(100deg,#e9b879,#ffe3a6,#d99d58);box-shadow:inset 0 0 0 4px #f7dba2,0 6px #b97646,0 10px 10px #754f5c22}.yarn-block::after{content:'';position:absolute;inset:10%;border:2px dashed #b8764566;border-radius:20%}.yarn-cushion{position:absolute;top:8%;bottom:8%;width:4%;background:repeating-linear-gradient(0deg,#fff8d666 0 3px,transparent 3px 7px),#c8e5ed;border:2px solid #fff5e0;border-radius:14px;box-shadow:0 3px #83b5c3}.cushion-left{left:0}.cushion-right{right:0}.yarn-world[data-kind="aim"] .yarn-cushion{display:none}.yarn-side-label{position:absolute;top:4%;font:800 clamp(11px,1.6vw,18px)/1 'Trebuchet MS',sans-serif;background:#fff7e7de;padding:5px 8px;border-radius:20px;z-index:5;pointer-events:none}.yarn-left-label{left:9%}.yarn-right-label{right:9%}
.yarn-star{position:absolute;translate:-50% -50%;width:13%;aspect-ratio:1;background-position:50% 100%;z-index:5;filter:drop-shadow(0 0 8px #fff5be);animation:yarn-ready 1.4s ease-in-out infinite}.yarn-star.collected{opacity:0;transform:translateY(-35px) scale(1.5);transition:opacity .3s,transform .3s}.yarn-burst{position:absolute;left:50%;top:45%;translate:-50% -50%;display:none;z-index:9;white-space:nowrap;color:#fff5be;font-size:clamp(30px,6vw,70px);pointer-events:none}.yarn-won .yarn-burst{display:block;animation:yarn-burst .8s ease-out both}.yarn-won .yarn-ball{animation:yarn-drop .45s ease-in forwards!important}.yarn-bumped[data-hit="block"] .yarn-block,.yarn-bumped[data-hit="left"] .cushion-left,.yarn-bumped[data-hit="right"] .cushion-right{animation:yarn-bump .25s ease-out}.yarn-retry .yarn-ball{opacity:.5;transition:opacity .3s}
.yarn-coach{display:flex;flex-direction:column;justify-content:center;gap:10px;min-height:0;min-width:0;text-align:center}.yarn-prompt{font:700 clamp(18px,2vw,25px)/1.25 'Trebuchet MS',sans-serif;margin:0;background:#fffaf0bd;border-radius:22px;padding:12px}.yarn-prompt b{color:#a64a73}.yarn-gesture{display:flex;align-items:center;justify-content:center;gap:12px;font-size:40px}.yarn-gesture span{font:800 15px/1.3 'Trebuchet MS',sans-serif;color:#9b5870}.yarn-choice{display:grid;grid-template-columns:1fr 1fr;gap:8px}.yarn-choice button{background:#d3edf2;box-shadow:0 4px #8eb6c7}.yarn-choice button[aria-pressed="true"]{border-color:#e3ac31;background:#ffdc75;box-shadow:0 4px #d79e35}.yarn-roll{font-size:23px!important}.yarn-hint{font-size:13px!important;background:#fffaf0!important}.yarn-start{background:#f9c5d7!important}.yarn-start[hidden]{display:none!important}.yarn-friends{display:flex;justify-content:center;align-items:flex-end;height:100px;min-height:0;gap:10px;overflow:hidden}.yarn-friends img{height:100%;width:auto;max-width:48%;object-fit:contain}.yarn-won .yarn-friends{animation:yarn-cheer .5s ease-in-out 2}.yarn-status{grid-column:1/-1;text-align:center;font:700 14px/1.2 'Trebuchet MS',sans-serif;margin:0;min-height:18px}
body.thread-adventure.rrdd-game-shell #playScreen:has(.yarn-world) .mission-card,body.thread-adventure.rrdd-game-shell #playScreen:has(.stitch-world) .mission-card{display:none!important}body.thread-adventure.rrdd-game-shell #playScreen:has(.yarn-world) .game-grid,body.thread-adventure.rrdd-game-shell #playScreen:has(.stitch-world) .game-grid{grid-template-rows:minmax(0,1fr)!important;gap:0!important}
@keyframes yarn-dashes{to{stroke-dashoffset:-80}}@keyframes yarn-ready{50%{filter:drop-shadow(0 0 9px #ffd966)}}@keyframes yarn-drop{to{transform:rotate(170deg) scale(.1);opacity:0}}@keyframes yarn-burst{from{opacity:0;scale:.3}65%{opacity:1;scale:1.2}to{opacity:0;scale:1.4}}@keyframes yarn-bump{40%{transform:translateY(3px) scale(.97)}}@keyframes yarn-cheer{50%{transform:translateY(-8px)}}
@media(orientation:portrait) and (max-width:900px){body.thread-adventure .yarn-world{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto auto!important;padding:8px;gap:5px}.yarn-heading{min-height:44px}.yarn-heading h3{font-size:25px}.yarn-heading .yarn-hear{width:44px;height:44px;min-height:44px}.yarn-coach{display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px;align-items:center}.yarn-prompt{grid-column:1/-1;padding:5px;font-size:16px;border-radius:12px}.yarn-choice{grid-column:1/3;gap:6px}.yarn-roll{grid-column:3;font-size:19px!important}.yarn-world .yarn-hint{grid-column:1/3;padding:6px;min-height:44px}.yarn-world .yarn-start{grid-column:3;padding:6px;min-height:44px;font-size:13px}.yarn-gesture,.yarn-friends{display:none}.yarn-status{font-size:12px;min-height:14px}.yarn-table{border-width:6px}.yarn-hole{border-width:3px}.yarn-block{border-width:2px}}
@media(orientation:portrait) and (max-height:700px){body.thread-adventure .yarn-world{padding:5px;gap:3px}.yarn-heading h3{font-size:21px}.yarn-heading small{font-size:10px}.yarn-heading{gap:6px}.yarn-coach{gap:4px}.yarn-prompt{font-size:13px;padding:3px}.yarn-choice button{font-size:14px;padding:5px}.yarn-status{font-size:11px}.yarn-side-label{font-size:10px;padding:3px 6px}}
@media(orientation:landscape) and (max-height:600px){body.thread-adventure .yarn-world{padding:5px 8px;gap:3px 8px;grid-template-columns:minmax(0,1fr) 210px}.yarn-heading{min-height:44px}.yarn-heading h3{font-size:23px}.yarn-heading small{font-size:9px}.yarn-heading .yarn-hear{width:44px;height:44px;min-height:44px}.yarn-coach{gap:6px}.yarn-prompt{font-size:15px;padding:6px}.yarn-gesture,.yarn-friends{display:none}.yarn-status{font-size:11px;min-height:13px}.yarn-table{border-width:5px}.yarn-side-label{font-size:10px;padding:3px 5px}}
@media(prefers-reduced-motion:reduce){.yarn-world *{animation:none!important;transition:none!important}}body.reduce-motion .yarn-world *{animation:none!important;transition:none!important}

body.thread-adventure .board-stage:has(.yarn-world)>#sceneImage{display:none!important}
@media(orientation:landscape) and (max-height:600px){.yarn-coach{display:grid;grid-template-columns:1fr 1fr;gap:5px;align-content:center}.yarn-prompt,.yarn-choice{grid-column:1/-1}.yarn-world .yarn-roll{grid-column:1;font-size:18px!important}.yarn-world .yarn-hint{grid-column:2;font-size:11px!important;padding:4px}.yarn-world .yarn-start{grid-column:1/-1;font-size:13px;padding:6px}.yarn-prompt{font-size:13px;padding:3px}.yarn-choice button{font-size:13px;padding:5px}}

.yarn-world[data-phase='intro'] :is(.yarn-choice,.yarn-roll,.yarn-hint){display:none!important}.yarn-hole{min-width:44px}
@media(orientation:landscape) and (max-height:600px){body.thread-adventure .yarn-world{grid-template-columns:minmax(0,1fr) 230px;grid-template-rows:auto minmax(0,1fr) auto}.yarn-heading{grid-column:2;grid-row:1;gap:5px}.yarn-heading h3{font-size:19px}.yarn-heading small{font-size:9px}.yarn-heading .yarn-hear{min-width:44px}.yarn-dots{display:none}.yarn-playarea{grid-column:1;grid-row:1/4}.yarn-coach{grid-column:2;grid-row:2}.yarn-status{grid-column:2;grid-row:3;font-size:10px}.yarn-block{border-width:1px}.yarn-hole{border-width:3px}}

@media(prefers-reduced-motion:reduce){.yarn-demo-ball{display:none!important}}body.reduce-motion .yarn-demo-ball{display:none!important}

/* Open-ended rolling: a single gesture, with an explicit star checkpoint. */
.yarn-sequence{display:flex;align-items:center;justify-content:center;gap:12px;margin:0;font:800 21px/1.1 'Trebuchet MS',sans-serif}.yarn-sequence span{padding:7px 12px;border:2px solid #e3b6c2;border-radius:15px;background:#fffaf0}.yarn-sequence .step-done{background:#dcf4d6;border-color:#9ac59e}.yarn-sequence .step-done::after{content:' ✓'}.yarn-sequence .step-current{background:#fff1b0;border-color:#dcb13c}.yarn-checkpoint .yarn-ball{filter:drop-shadow(0 0 14px #ffdb55)}.yarn-world[data-kind='safe'] .yarn-cushion{display:none}.yarn-world[data-step='star'] .yarn-hole{opacity:.65}
@media(orientation:portrait) and (max-width:900px){.yarn-coach{grid-template-columns:minmax(0,1fr) auto;gap:5px}.yarn-prompt,.yarn-sequence{grid-column:1/-1}.yarn-sequence{font-size:18px;gap:12px}.yarn-sequence span{padding:5px 12px}.yarn-world .yarn-hint{grid-column:1;min-height:44px}.yarn-world .yarn-start{grid-column:2;min-height:44px}.yarn-world[data-phase='intro'] .yarn-start{grid-column:1/-1}.yarn-status{line-height:1.2}}
@media(orientation:landscape) and (max-height:600px){.yarn-coach{display:flex;flex-direction:column;justify-content:center;gap:5px}.yarn-sequence{font-size:16px;gap:8px}.yarn-sequence span{padding:4px 9px}.yarn-world .yarn-hint,.yarn-world .yarn-start{width:100%;min-height:44px}.yarn-gesture,.yarn-friends{display:none}}