:root{font-family:ui-rounded,system-ui,sans-serif;color:#253d3b;background:#fbf1dd;line-height:1.4;--ink:#284b46;--rose:#994776;--line:#d5c7a7}*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}main{max-width:1020px;margin:auto;padding:12px}header{display:flex;flex-wrap:wrap;align-items:center;gap:6px 18px;padding:6px 4px 14px}h1{font-size:clamp(1.45rem,5vw,2rem);line-height:1.15;margin:0;flex:1 1 auto}.site-link{font-size:.78rem;color:#32665f;width:100%}.tools{display:flex;gap:6px;flex-wrap:wrap}.tools button{font-size:.85rem;padding:7px 10px;min-height:44px}h2{font-size:clamp(1.3rem,5vw,1.75rem);line-height:1.2;margin:.15em 0}h3{font-size:1.05rem;margin:.8em 0 .3em}p{margin:.5em 0}.eyebrow{text-transform:uppercase;letter-spacing:.06em;font-size:.72rem;color:#6f6b55;font-weight:800;margin:0 0 4px}button{font:inherit;font-weight:750;min-width:44px;min-height:48px;padding:9px 12px;background:#fffdf5;border:2px solid #62847b;color:var(--ink);border-radius:13px;cursor:pointer;touch-action:manipulation}button:hover{background:#f0f6e6}button:disabled{opacity:.5;cursor:default}button:focus-visible,summary:focus-visible,input:focus-visible{outline:4px solid var(--rose);outline-offset:3px}button[aria-pressed=true]{box-shadow:inset 0 0 0 2px var(--rose);background:#fff0f7}section{background:#fffdf8;border-radius:22px;padding:16px;border:2px solid var(--line)}.heading-row{display:flex;justify-content:space-between;align-items:center;gap:8px}.welcome{display:flex;align-items:center;gap:12px;margin:3px 0 20px}.welcome img{object-fit:contain;max-width:25%}.home-buttons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.home-buttons button{display:flex;align-items:center;gap:12px;text-align:left;border-color:#c3b797;padding:15px 12px;min-height:100px;font-size:1.12rem}.home-buttons svg{width:70px;height:64px;flex:0 0 70px}.home-buttons small{display:block;font-weight:500;font-size:.8rem;margin-top:5px;color:#53635d}.home-buttons button:nth-child(1){background:#fff1e6}.home-buttons button:nth-child(2){background:#eaf2ff}.home-buttons button:nth-child(3){background:#f4edf9}.home-buttons button:nth-child(4){background:#f1f5dd}.home-note{font-size:.92rem;margin:18px 0 0}.workbench{display:grid;grid-template-columns:minmax(260px,400px) minmax(230px,1fr);gap:26px;align-items:start}.board-column{min-width:0}.board{display:grid;grid-template-columns:repeat(4,minmax(56px,1fr));width:100%;max-width:400px;aspect-ratio:1;gap:0;background:#92aaa0;border:4px solid #708f7f;border-radius:10px;padding:2px;overflow:visible}.cell{position:relative;padding:0;border:0;border-radius:2px;min-width:0;min-height:56px;background:#f8f5e9;outline:1px solid #deded1;outline-offset:-1px}.cell svg{width:100%;height:100%;display:block}.cell:focus-visible{z-index:2;outline-offset:-4px;outline:4px solid var(--rose)}.cell.anchor{box-shadow:inset 0 0 0 4px var(--rose)}.tray{display:flex;gap:7px;flex-wrap:wrap;margin:8px 0}.tray button{min-width:58px;display:flex;gap:4px;align-items:center;justify-content:center;padding:7px 10px;font-size:.85rem}.piece-icon{display:inline-block;width:36px;height:36px;flex:0 0 36px;vertical-align:middle}.selection-summary{display:flex;gap:8px;align-items:center;min-height:48px;font-size:.85rem}.selection-summary svg{width:44px;height:44px}.selection-summary strong{display:block}.manipulator{position:sticky;bottom:max(0px,env(safe-area-inset-bottom));background:#fff9e9f5;border:1px solid #e0d4b7;border-radius:14px;margin-top:8px;padding:5px 8px;z-index:3;backdrop-filter:blur(5px)}.primary-actions{display:flex;gap:6px}.primary-actions button{flex:1;min-height:48px;padding:7px 8px}.primary-actions #place{background:#e7f3cc;border-color:#708f41}.steps{display:flex;gap:4px;margin:0 0 12px}.steps span{font-size:.8rem;flex:1;text-align:center;padding:7px 2px;border-bottom:3px solid #d6d9cc;color:#607469}.steps .current{color:#80305b;border-color:#a23f77;background:#fff0f6;border-radius:6px 6px 0 0;font-weight:800}.action-grid{display:flex;gap:7px;flex-wrap:wrap;margin-top:8px}.action-grid button{font-size:.9rem}.feedback{font-weight:700;min-height:1.5em;color:#7b3f63;font-size:.9rem;margin:8px 2px}.guide{font-size:.8rem;color:#52685e;line-height:1.5}.result-heading{display:flex;gap:8px;align-items:center}.result-heading img{object-fit:contain;flex:0 0 72px}.result-heading p{font-size:.9rem}#result{background:#eef5d9;border:1px solid #d2dfb4;border-radius:14px;padding:10px;margin:12px 0}#see-joins{font-size:.85rem;margin-top:6px}.filters{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0}.filters button{font-size:.9rem}.project-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:12px 0}.project-card{display:flex;flex-direction:column;align-items:center;padding:10px 6px;text-align:center;font-size:.9rem;border-color:#d1c3a7}.project-card svg{display:block;width:100%;max-width:145px;aspect-ratio:1;background:#f7f2e5;border-radius:10px;margin-bottom:8px}.project-card small{font-weight:500;font-size:.75rem;color:#5d6b5f;margin-top:4px}.saved-card{min-width:0;background:#fff6e0;border:1px solid #ddceb1;border-radius:14px;padding:8px}.saved-card .project-card{width:100%}.delete-picture{font-size:.78rem;min-height:44px;margin-top:6px;width:100%;border-color:#a79b8b}.compare-pictures{display:grid;grid-template-columns:1fr 1fr;gap:10px}.compare-pictures svg{width:100%;max-width:150px;aspect-ratio:1;background:#f5f0e4;border-radius:10px}.compare-pictures p{font-size:.78rem;text-align:center}.compare-pictures>div{text-align:center}#comparison{background:#f5eef6;border-radius:14px;padding:10px;margin-top:10px}#after{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}#status:empty{display:none}#status{padding:.6em;background:#fff0b7;border-radius:8px;margin-bottom:8px}#parent{margin-top:12px}summary{cursor:pointer;min-height:48px;padding:12px 4px;font-weight:700}details{margin-top:8px;border-top:1px solid #e7dcc4}label{display:block;padding:10px 0}input{width:22px;height:22px;vertical-align:middle}#replace-options{padding:10px;background:#fff0cc}#replace-options button{margin:4px}.turn-cue{animation:turn-cue .22s ease-out}@keyframes turn-cue{from{transform:rotate(-90deg)}to{transform:rotate(0)}}.whole-view .piece-edge{opacity:0}.whole-view .guide-edge{opacity:0}.hint-cell{filter:drop-shadow(0 0 2px #bd8c2d)}@media(max-width:650px){main{padding:9px}header{padding-bottom:9px}section{padding:12px}.tools{width:100%;justify-content:flex-end;position:absolute;right:11px;top:8px;width:auto}.tools button{font-size:.75rem;min-width:44px;min-height:44px;padding:6px 8px}.site-link{height:23px}h1{font-size:1.45rem;margin-top:4px}header .site-link{font-size:.7rem}.workbench{display:flex;flex-direction:column;gap:6px}.board-column,.workshop-side{width:100%}.board{max-width:400px;margin:auto}.tray{gap:6px;margin:6px 0}.tray button{min-height:48px;font-size:.78rem;padding:5px 8px}.tray .piece-icon{width:28px;height:28px;flex-basis:28px}.selection-summary{min-height:34px;font-size:.76rem}.selection-summary svg{width:30px;height:30px}.steps{margin:3px 0}.steps span{padding:4px 2px;font-size:.73rem}.home-buttons{gap:9px}.home-buttons button{flex-direction:column;align-items:flex-start;gap:4px;padding:11px;min-height:146px;font-size:1rem}.home-buttons svg{width:62px;height:50px;flex:0 0 50px}.welcome{margin-bottom:12px}.welcome p{font-size:.86rem}.welcome img{max-width:23%;height:auto}.project-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.project-card{font-size:.88rem}#instruction{font-size:.85rem;margin:.35em 0}.action-grid{margin-top:5px}.action-grid button{font-size:.83rem;min-height:46px;padding:7px 9px}.feedback{font-size:.83rem}.workshop-side .guide{margin-bottom:0}.eyebrow{font-size:.66rem}.heading-row h2{font-size:1.25rem}.heading-row button{min-height:44px;font-size:.85rem}.manipulator{margin-top:6px}.primary-actions button{min-height:46px}}
@media(max-width:345px){.tools{gap:3px}.tools button{font-size:.68rem;padding:5px}.home-buttons small{font-size:.75rem}.home-buttons button{padding:9px}.tray button{padding:4px 6px}.board{grid-template-columns:repeat(4,minmax(56px,1fr))}}@media(orientation:landscape)and(max-height:500px){.workbench{display:grid;grid-template-columns:minmax(248px,1fr) minmax(220px,1fr);gap:16px}.board{max-width:330px}.manipulator{position:static}.steps{margin-top:10px}.home-buttons{grid-template-columns:repeat(4,minmax(0,1fr))}.home-buttons button{font-size:.85rem;padding:9px}.project-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
/* Text enlargement keeps labels and controls inside their containers. */
button{max-width:100%;overflow-wrap:anywhere}.heading-row{flex-wrap:wrap}.heading-row>button{flex-shrink:0}.primary-actions{flex-wrap:wrap}.primary-actions button{flex:1 1 78px;min-width:max-content}
@media(max-width:650px){header{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:4px 6px}.site-link{grid-column:1;grid-row:1;width:auto;height:auto}header h1{grid-column:1/-1;grid-row:2}.tools{grid-column:2;grid-row:1;position:static;min-width:0;width:auto;right:auto;top:auto;justify-content:flex-end}}
/* Keep every board cell available: the tool dock never overlays the work. */
.manipulator{position:static}
@media(max-width:345px){.make-palette{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.make-palette button{flex-direction:column;gap:1px;min-width:0;padding:5px 2px;font-size:.73rem}.make-palette .piece-icon{width:25px;height:25px;flex-basis:25px}}

/* Optional reasoning stays separate from placing, with the same large input targets. */
#predict-turn{font-size:.85rem}.join-choices{display:flex;gap:8px;flex-wrap:wrap}.join-choices button{display:flex;align-items:center;gap:5px;min-height:52px;font-size:.85rem}.join-choices .piece-icon{width:32px;height:32px;flex-basis:32px}.join-mark{pointer-events:none}.paper-link{display:inline-block;min-height:48px;padding:10px;color:#235d50;font-weight:700}dialog{border:2px solid #a49278;border-radius:20px;background:#fffdf4;color:#253d3b;padding:20px;width:min(94vw,540px);max-height:94vh;overflow:auto}dialog::backdrop{background:#243e3a99}#turn-title{font-size:1.35rem}.turn-before{display:flex;align-items:center;justify-content:center;gap:18px;margin:15px 0}.turn-before>div{width:75px;height:75px}.turn-before .piece-icon{width:75px;height:75px}.turn-before>b{font-size:2rem}.turn-options{display:flex;justify-content:center;gap:10px;margin:16px 0}.turn-options button{width:100px;min-height:100px;display:grid;place-items:center}.turn-options .piece-icon{width:68px;height:68px}.turn-probe-actions{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}#turn-result{display:grid;grid-template-columns:1fr 1fr;gap:15px;margin:15px 0;text-align:center}#turn-result>div>div{display:grid;place-items:center;min-height:110px;background:#f3f0e3;border-radius:10px;margin-top:8px}#turn-result .piece-icon{width:90px;height:90px}#turn-prompt{min-height:3em;font-weight:650}@media(max-width:380px){dialog{padding:13px}.turn-options{gap:7px}.turn-options button{width:82px;min-width:0;min-height:85px;padding:5px}.turn-options .piece-icon{width:60px;height:60px}.turn-before{gap:10px}}
.probe-tools{display:flex;gap:6px;flex-wrap:wrap}
/* The optional prediction also reflows when text is enlarged. */
dialog{max-width:94vw}.turn-before{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:7px 14px;text-align:center}.turn-before>#turn-before-label{grid-column:1;grid-row:1}.turn-before>#turn-before{grid-column:1;grid-row:2;justify-self:center}.turn-before>b{grid-column:2;grid-row:2}.turn-before>#turn-next-label{grid-column:2;grid-row:1}.turn-options{display:grid;grid-template-columns:repeat(var(--choices,3),minmax(0,1fr));gap:8px}.turn-options button{width:100%;min-width:0}.turn-options .piece-icon{width:min(100%,68px);max-width:100%;height:68px}
