/* Fully scoped additive styles; shared game shell, pause, language and library controls remain in place. */
.thinking-expansion{--te-ink:#284d48;--te-green:#28685c;--te-cream:#fffcf4;--te-line:#d6ded0;color:var(--te-ink);max-width:960px;margin-inline:auto;text-align:center;line-height:1.65}
.thinking-expansion *{box-sizing:border-box}
.thinking-expansion [hidden]{display:none!important}
.thinking-expansion .te-heading{font-size:clamp(1.15rem,2.5vw,1.7rem);line-height:1.55;margin:18px 0 12px;outline-offset:5px}
.thinking-expansion .te-button{font:inherit;line-height:1.4;min-width:48px;min-height:48px;border:2px solid var(--te-line);border-radius:18px;background:var(--te-cream);color:var(--te-ink);padding:10px 16px;cursor:pointer;box-shadow:0 3px 0 #d8d1bc33;touch-action:manipulation;overflow-wrap:anywhere}
.thinking-expansion .te-button:hover:not(:disabled){border-color:var(--te-green);background:#f4f7ed}
.thinking-expansion .te-button:focus-visible,.thinking-expansion select:focus-visible,.thinking-expansion summary:focus-visible{outline:3px solid #965528;outline-offset:4px}
.thinking-expansion .te-button:disabled{opacity:1;cursor:default;color:var(--te-ink)}
.thinking-expansion .te-primary{background:var(--te-green);border-color:var(--te-green);color:#fffdf4!important}
.thinking-expansion .te-primary:hover:not(:disabled){background:#1e544a;color:#fffdf4}
.thinking-expansion .te-controls{display:flex;flex-wrap:wrap;justify-content:center;gap:12px;margin:20px 0}
.thinking-expansion .te-levels{border:0;padding:0;margin:0 0 24px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;text-align:start}
.thinking-expansion .te-levels legend{font-weight:700;text-align:start;margin-bottom:12px}
.thinking-expansion .te-levels button{text-align:start;padding:16px}
.thinking-expansion .te-levels strong{display:block;font-size:1.15rem;margin-bottom:7px}
.thinking-expansion .te-levels span{display:block;font-size:.9rem;line-height:1.6}
.thinking-expansion .te-levels [aria-pressed=true],.thinking-expansion .is-selected{border-color:var(--te-green);box-shadow:inset 0 0 0 2px var(--te-green);background:#e7f0df}
.thinking-expansion .te-select-label{display:block;text-align:start;font-weight:700;margin-bottom:8px}
.thinking-expansion select{display:block;width:100%;min-height:52px;padding:10px 16px;border:2px solid var(--te-line);border-radius:15px;font:inherit;color:var(--te-ink);background:var(--te-cream)}
.thinking-expansion .te-preview{margin:20px 0;text-align:start;border:1px solid #e3d9c8;border-radius:20px;padding:14px 18px;background:#fcf8ed}
.thinking-expansion summary{cursor:pointer;font-weight:600;min-height:38px}
.thinking-expansion .te-preview-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(88px,1fr));gap:12px;margin-top:12px;text-align:center}
.thinking-expansion .te-preview figure{margin:0;min-width:0}
.thinking-expansion .te-preview img{max-width:84px;max-height:78px}
.thinking-expansion figcaption{font-size:.87rem;overflow-wrap:anywhere}
.thinking-expansion .te-art{width:100%;height:100%;max-width:145px;max-height:140px;object-fit:contain;display:block;margin:auto;pointer-events:none;user-select:none}
.thinking-expansion .te-progress{display:flex;align-items:center;gap:16px;flex-wrap:wrap;justify-content:center;font-size:.9rem;margin-bottom:16px}
.thinking-expansion progress{width:min(270px,65%);height:12px;border:0;border-radius:999px;overflow:hidden;accent-color:var(--te-green);background:#e9e5d9}
.thinking-expansion progress::-webkit-progress-bar{background:#e9e5d9}
.thinking-expansion progress::-webkit-progress-value{background:#648e72;border-radius:999px}
.thinking-expansion .te-choices{display:grid;grid-template-columns:repeat(var(--te-choices,3),minmax(0,1fr));gap:16px;max-width:740px;margin:20px auto}
.thinking-expansion .te-picture{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:14px 10px}
.thinking-expansion .te-picture span{font-weight:600;font-size:clamp(.85rem,2.3vw,1.05rem)}
.thinking-expansion .te-answer{min-height:88px}
.thinking-expansion .te-answer b{font-size:2rem}
.thinking-expansion .is-correct,.thinking-expansion .is-matched{border:3px solid #4b7b52;background:#eaf2dc}
.thinking-expansion .is-hinted{outline:3px dashed #966126;outline-offset:3px}
.thinking-expansion .te-target{display:flex;flex-direction:column;align-items:center;gap:12px;font-size:1.4rem;padding:12px}
.thinking-expansion .te-target .te-art{width:165px;height:165px;max-width:165px;max-height:165px}
.thinking-expansion .te-hint{border:2px dashed #c69b5f;border-radius:18px;background:#fff8dd;padding:16px;margin:16px 0}
.thinking-expansion .te-feedback{min-height:28px;margin:14px 0;font-weight:600}
.thinking-expansion .te-count-tray{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;max-width:680px;margin:18px auto;padding:22px;background:#f7edd7;border:3px solid #d4b48b;border-radius:28px;box-shadow:inset 0 0 0 4px #fff8ed}
.thinking-expansion .te-count-item{aspect-ratio:1;min-height:0;min-width:0;position:relative;padding:6px;border:2px solid transparent;background:#fffcf6}
.thinking-expansion .te-count-item.is-marked{border:3px solid #416d53;background:#dfead8}
.thinking-expansion .te-count-item.is-marked::after{content:'✓';position:absolute;inset-block-start:-8px;inset-inline-end:-8px;border-radius:50%;background:#416d53;color:white;width:25px;height:25px;font-size:18px;line-height:25px}
.thinking-expansion .te-count-number{position:absolute;bottom:2px;inset-inline-start:2px;background:#fffdf2;border:1px solid #7f6744;border-radius:50%;width:26px;height:26px;font-size:16px;line-height:24px}
.thinking-expansion .te-picnic{background:#e9dfc7 url('art/illustrated/expansion-01-thinking/pattern-picnic.webp') center/100% 100% no-repeat;padding:65px 8%;border-radius:24px;min-height:235px;display:flex;align-items:center}
.thinking-expansion .te-sequence{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;list-style:none;padding:0;margin:0;width:100%;gap:8px;padding-block:12px}
.thinking-expansion .te-sequence li{flex:1 0 50px;min-width:50px;max-width:90px;aspect-ratio:1;border-radius:14px;background:#fffdf5e8;padding:3px;position:relative}
.thinking-expansion .te-sequence .te-unit-start{border-inline-start:4px solid #ab7946}
.thinking-expansion .te-sequence li>small{display:block;position:absolute;bottom:0;inset-inline-start:0;padding:0 5px;background:#fffdf5;border-radius:6px;font-size:.65rem;line-height:1.5}
.thinking-expansion .te-sequence .te-missing{display:grid;place-items:center;font-size:2rem;font-weight:700;border:2px dashed #8f7651}
.thinking-expansion .te-unit{display:flex;justify-content:center;gap:10px;margin-top:14px}
.thinking-expansion .te-unit>span{width:72px}
.thinking-expansion .te-unit img{width:60px;height:60px}
.thinking-expansion .te-memory{display:grid;grid-template-columns:repeat(var(--te-memory-cols,4),minmax(0,1fr));gap:14px;max-width:680px;margin:20px auto}
.thinking-expansion .te-memory-card{display:flex;flex-direction:column;align-items:center;justify-content:center;aspect-ratio:1;gap:4px;padding:8px;min-height:80px}
.thinking-expansion .te-memory-card .te-art{height:calc(100% - 30px);max-height:115px}
.thinking-expansion .te-memory-card span{font-size:.9rem}
.thinking-expansion .te-memory-card .te-card-back{font-size:2.1rem;color:#678875}
.thinking-expansion .te-shelves{background:#e6d4b4 url('art/illustrated/expansion-01-thinking/discovery-shelves.webp') center/cover;border-radius:24px;padding:90px 5% 25px;min-height:320px}
.thinking-expansion .te-bins{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.thinking-expansion .te-bin{padding:10px;border:2px solid #a67c4f;border-radius:18px;background:#fff9eaf2;min-height:135px}
.thinking-expansion .te-bin-label{width:100%;font-weight:700;background:#f7edd8}
.thinking-expansion .te-placed{display:flex;justify-content:center;flex-wrap:wrap;gap:6px;margin-top:8px}
.thinking-expansion .te-placed .te-picture{width:75px;min-height:85px;padding:5px;border-radius:12px;gap:4px}
.thinking-expansion .te-placed .te-art{height:50px;width:50px}
.thinking-expansion .te-placed .te-picture span{font-size:.78rem}
.thinking-expansion .te-sort-pool{display:grid;grid-template-columns:repeat(auto-fit,minmax(95px,1fr));gap:12px;margin-top:15px}
.thinking-expansion .te-sort-pool .te-art{max-height:100px}
.thinking-expansion .te-board-viewport{overflow-x:auto;padding:6px 5px 14px;max-width:100%;scrollbar-width:thin}
.thinking-expansion .te-board-wrap{width:min(100%,680px);min-width:calc(var(--te-cols) * 51px);margin-inline:auto}
.thinking-expansion .te-board,.thinking-expansion .te-drop-row{display:grid;grid-template-columns:repeat(var(--te-cols),minmax(0,1fr));gap:6px}
.thinking-expansion .te-board{border:8px solid #a9bba5;border-radius:24px;padding:8px;background:#dfe7d6}
.thinking-expansion .te-drop-row{padding:0 16px;margin:8px 0 12px}
.thinking-expansion .te-drop-row .te-button{min-width:0;padding:4px;display:grid;justify-items:center;font-size:1.4rem}
.thinking-expansion .te-drop-row small{font-size:.7rem}
.thinking-expansion .te-cell{aspect-ratio:1;min-width:0;min-height:0;border:2px solid #c2cdb9;border-radius:50%;background:var(--te-cream);padding:3px;display:grid;place-items:center;font-size:1.6rem}
.thinking-expansion .te-cell .te-art{width:100%;height:100%;min-width:0}
.thinking-expansion .te-cell.is-line{border:3px solid #956025;box-shadow:0 0 0 2px #956025;background:#ffe3a7}
.thinking-expansion .te-completion{padding:32px 20px;border-radius:28px;background:#edf1e4;border:2px solid var(--te-line)}
.thinking-expansion .te-completion .te-controls{max-width:600px;margin-inline:auto}
@media(max-width:600px){
.thinking-expansion .te-levels{gap:8px;grid-template-columns:1fr}
.thinking-expansion .te-levels button{padding:12px 15px;display:grid;grid-template-columns:90px 1fr;gap:10px;align-items:center}
.thinking-expansion .te-levels strong{margin:0}
.thinking-expansion .te-levels span{font-size:.82rem}
.thinking-expansion .te-choices{gap:10px;grid-template-columns:repeat(2,minmax(0,1fr))}
.thinking-expansion .te-art{max-height:110px}
.thinking-expansion .te-picture{padding:10px 6px}
.thinking-expansion .te-memory{gap:8px}
.thinking-expansion .te-memory-card{border-radius:12px;padding:5px;min-height:75px;aspect-ratio:.8}
.thinking-expansion .te-memory-card span{font-size:.75rem}
.thinking-expansion .te-count-tray{grid-template-columns:repeat(3,minmax(0,1fr));padding:14px;gap:12px}
.thinking-expansion .te-count-item .te-art{max-height:100px}
.thinking-expansion .te-picnic{padding:45px 6%;min-height:180px}
.thinking-expansion .te-shelves{padding:70px 12px 20px}
.thinking-expansion .te-bins{gap:10px}
.thinking-expansion .te-bin{padding:7px}
.thinking-expansion .te-bin-label{padding:8px;font-size:.9rem}
.thinking-expansion .te-sort-pool{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.thinking-expansion .te-controls{gap:10px}
.thinking-expansion .te-controls button{flex:1 1 135px}
}
@media(prefers-reduced-motion:reduce){.thinking-expansion *{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
/* Depth wave 2: local quests, maker, memory themes and grouping. */
.thinking-expansion .te-depth-select{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;font-weight:600;margin:16px auto;max-width:700px}
.thinking-expansion .te-depth-select select{width:auto;max-width:100%;flex:1 1 180px}
.thinking-expansion .te-depth-settings{display:flex;gap:16px;flex-wrap:wrap;justify-content:center}
.thinking-expansion .te-quest-picker{border:2px solid #d2dfcb;padding:20px;border-radius:24px;background:#f4f6ec;margin:24px 0}
.thinking-expansion .te-quest-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.thinking-expansion .te-quest-options button{display:flex;flex-direction:column;gap:12px}
.thinking-expansion .te-quest-icons{display:flex;gap:4px;height:90px;width:100%}
.thinking-expansion .te-quest-icons img{width:30%;height:80px}
.thinking-expansion .te-quest-progress{padding:12px;border-radius:18px;background:#edf3e6;display:flex;justify-content:center;align-items:center;gap:18px;flex-wrap:wrap;margin-bottom:18px}
.thinking-expansion .te-quest-progress button{font-size:.85rem;min-height:44px}
.thinking-expansion .te-collage{background:#f5eddb;border:2px solid #c8b59a;border-radius:22px;padding:18px;margin:22px auto}
.thinking-expansion .te-collage-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:18px 0}
.thinking-expansion .te-collage-cards button,.thinking-expansion .te-collage-cards figure{margin:0;border-radius:18px;background:#fffdf7;padding:14px;display:flex;flex-direction:column;gap:10px;align-items:center}
.thinking-expansion .te-collage-cards img{height:120px;max-width:120px}
.thinking-expansion .te-hole{font-size:2.4rem;display:grid;place-items:center;height:100%;border:2px dashed #8b7551;border-radius:12px}
.thinking-expansion .te-builder-unit{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;max-width:520px;margin:24px auto}
.thinking-expansion .te-builder-unit button{aspect-ratio:1;min-width:0;position:relative;font-size:1.4rem}
.thinking-expansion .te-builder-unit [aria-pressed=true]{outline:3px dashed #97612d;background:#fff0cd}
.thinking-expansion .te-builder-palette{display:grid;grid-template-columns:repeat(auto-fit,minmax(85px,1fr));gap:10px;padding:12px;background:#f8f3e5;border-radius:22px}
.thinking-expansion .te-builder-palette .te-art{height:75px}
.thinking-expansion .te-builder-palette .te-picture span{font-size:.82rem}
.thinking-expansion .te-built-preview{display:flex;justify-content:center;flex-wrap:wrap;gap:14px;padding:24px;margin:20px 0;background:#f5edda;border-radius:22px;min-height:110px}
.thinking-expansion .te-built-preview>div{display:flex;flex-wrap:wrap;border-inline-start:3px solid #bc9766;padding-inline-start:10px;gap:5px;max-width:100%}
.thinking-expansion .te-built-preview img{height:65px;width:60px}
.thinking-expansion .te-pattern-shelf{border:1px solid #c7d6be;border-radius:18px;padding:16px;margin-top:22px}
.thinking-expansion .te-memory .te-card-back{height:70%;width:75%;opacity:.8}
.thinking-expansion .te-memory .te-card-back img{height:100%;width:100%}
.thinking-expansion .te-memory[data-theme=garden] .te-memory-card:not([aria-pressed=true]){background:#e4edda;border-color:#a6c394}
.thinking-expansion .te-memory[data-theme=sky] .te-memory-card:not([aria-pressed=true]){background:#e5edf4;border-color:#a5bdd1}
.thinking-expansion .te-memory[data-theme=wood] .te-memory-card:not([aria-pressed=true]){background:#f0e5d4;border-color:#c5ab83}
.thinking-expansion .te-count-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.thinking-expansion .te-count-group{padding:12px;background:#f7edd7;border:2px solid #b99d74;border-radius:20px}
.thinking-expansion .te-count-group>button{width:100%;margin-bottom:12px;font-weight:700}
.thinking-expansion .te-count-group>div{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;min-height:70px}
.thinking-expansion .te-count-group .te-count-item{width:70px;height:75px;min-height:48px}
.thinking-expansion .te-ungrouped:empty{min-height:30px;padding:10px;background:#f4f0e6}
@media(max-width:600px){.thinking-expansion .te-quest-options{grid-template-columns:1fr}.thinking-expansion .te-quest-options button{flex-direction:row;align-items:center}.thinking-expansion .te-quest-icons{max-width:100px;height:65px;flex-shrink:0}.thinking-expansion .te-quest-icons img{height:60px}.thinking-expansion .te-collage-cards{gap:7px}.thinking-expansion .te-collage-cards button,.thinking-expansion .te-collage-cards figure{padding:6px;font-size:.78rem}.thinking-expansion .te-collage-cards img{height:80px}.thinking-expansion .te-count-groups{gap:10px}.thinking-expansion .te-count-group{padding:8px}.thinking-expansion .te-count-group .te-count-item{width:52px;height:57px}.thinking-expansion .te-builder-unit{gap:8px}.thinking-expansion .te-builder-palette{grid-template-columns:repeat(3,minmax(0,1fr))}}
