{"id":990,"date":"2026-11-26T06:12:08","date_gmt":"2026-11-26T06:12:08","guid":{"rendered":"https:\/\/pruebas.escacimat.com\/?page_id=990"},"modified":"2026-11-26T06:43:05","modified_gmt":"2026-11-26T06:43:05","slug":"memoria-descacs","status":"publish","type":"page","link":"https:\/\/escacimat.com\/es\/juga-i-apren\/memoria-descacs\/","title":{"rendered":"Memoria de ajedrez"},"content":{"rendered":"\n<style>\n.ec-games{color:#f4f8ff;margin:35px 0;padding:clamp(16px,3vw,34px);border-radius:24px;background:radial-gradient(ellipse at 10% 5%,#405ca4 0%,transparent 50%),radial-gradient(ellipse at 92% 25%,#235989 0%,transparent 56%),#152443;scroll-margin-top:100px}\n.ec-games h2,.ec-games h3{color:#fff;margin:0 0 12px}.ec-games h2{font-size:clamp(1.45rem,3vw,2.1rem)}\n.ec-game-menu{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:16px}\n.ec-game-menu>a,.ec-game-menu>div{display:grid;align-content:start;gap:3px;min-width:0;padding:13px;background:#203859;border:1px solid #6280aa;border-radius:14px;color:#fff;text-decoration:none;overflow-wrap:anywhere}\n.ec-game-menu>a:hover{background:#2e4d75}.ec-game-menu span{color:#ffdc8a;font-size:1.7rem;line-height:1.2}.ec-game-menu small{color:#e0eeff;line-height:1.35}\n.ec-games details{background:#10213b;border:1px solid #6583a9;border-radius:12px;margin:8px 0;scroll-margin-top:105px}\n.ec-games summary{padding:12px 15px;cursor:pointer;font-weight:800;color:#fff}.ec-games summary:hover{background:#263f64;border-radius:12px}\n.ec-game-body{padding:0 15px 15px}.ec-game-body>p{margin:4px 0 13px}.ec-game-layout{display:grid;grid-template-columns:minmax(0,400px) minmax(0,1fr);gap:15px;align-items:start;margin-top:12px}\n.ec-game-controls{display:flex;flex-wrap:wrap;align-items:end;gap:9px}.ec-game-controls label{display:grid;gap:3px;font-size:.85rem}\n.ec-games button,.ec-games select{font:inherit}.ec-game-controls button,.ec-game-controls select,.ec-game-stats button{min-height:40px;padding:5px 10px;border:1px solid #9db7d5;border-radius:7px;background:#edF5ff;color:#182e4c;font-weight:700;cursor:pointer}\n.ec-games button[hidden]{display:none}.ec-game-stats{padding:12px;border-radius:10px;background:#203859;min-width:0}.ec-game-stats p{margin:0 0 7px}.ec-game-stats h3{font-size:1rem;margin:13px 0 6px}\n.ec-board,.ec-memory-grid{display:grid;grid-template-columns:repeat(var(--ec-board-size,8),minmax(0,1fr));gap:2px;width:100%;border-radius:9px;overflow:hidden;background:#0c192d;border:2px solid #7896bc}\n.ec-games .ec-cell{display:grid;place-items:center;aspect-ratio:1;min-width:0;padding:0;border:0;border-radius:0;background:#e3efff;color:#152640;font-family:system-ui,'Segoe UI Symbol',sans-serif;font-size:clamp(15px,5vw,39px);line-height:1;cursor:pointer}\n.ec-games .ec-cell.ec-dark{background:#85abdc}.ec-games .ec-cell.ec-void{background:#1b2d46;cursor:default}.ec-games .ec-cell.ec-visited{background:#4e749f}.ec-games .ec-cell.ec-current,.ec-games .ec-cell.ec-matched{background:#ffda86;color:#182b49}.ec-games .ec-cell:focus-visible{outline:3px solid #fa9d21;outline-offset:-3px;z-index:1}\n.ec-memory-grid{--ec-board-size:4;gap:5px;padding:4px}.ec-memory-grid .ec-cell{background:#365783;color:#fff;border-radius:6px}.ec-memory-grid .ec-cell.ec-revealed{background:#dcecff;color:#132c4c}\n.ec-game-resources{display:flex;flex-wrap:wrap;gap:10px 16px;margin-top:15px}.ec-game-resources a{color:#dcecff}\n@media(max-width:720px){.ec-game-menu{grid-template-columns:repeat(2,minmax(0,1fr))}.ec-game-layout{grid-template-columns:minmax(0,1fr)}.ec-games .ec-cell{font-size:clamp(16px,6vw,35px)}}\n<\/style><style>\n#content:has(.ec-solo)>.container.entry-content{max-width:900px}\n.ec-solo.ec-games{container-type:inline-size;margin-top:12px;padding:clamp(14px,3vw,28px)}\n.ec-solo .ec-game-body{padding:0;min-width:0}\n.ec-solo .ec-game-layout{grid-template-columns:minmax(0,1fr);gap:13px}\n.ec-solo .ec-board,.ec-solo .ec-memory-grid{max-width:440px;margin-inline:auto}\n.ec-solo .ec-game-back{display:inline-block;margin-bottom:15px;color:#e2efff;font-weight:700}\n@container (min-width:590px){.ec-solo .ec-game-layout{grid-template-columns:minmax(0,1.65fr) minmax(180px,1fr);align-items:start}.ec-solo .ec-board,.ec-solo .ec-memory-grid{margin-inline:0}}\n<\/style><style>\nbody:has(.ec-solo) .interior-hero{padding-block:clamp(13px,2.5vh,24px);text-align:center}\nbody:has(.ec-solo) .interior-hero .eyebrow{margin-bottom:4px}\nbody:has(.ec-solo) .interior-hero h1{margin:0;font-size:clamp(1.65rem,4vw,2.5rem);line-height:1.15}\n#content:has(.ec-solo)>.container.entry-content{margin-top:clamp(10px,2vh,20px)}\n.ec-solo.ec-games{margin-top:0;padding:clamp(14px,2.5vw,22px)}\n.ec-solo .ec-game-back{margin-bottom:8px}\n.ec-solo .ec-game-layout{width:100%;max-width:720px;margin:10px auto 0;overflow-anchor:none}\n.ec-solo .ec-game-stats [data-restart]{display:block;margin-top:15px}\n.ec-solo .ec-game-stats [data-restart]+h3{margin-top:17px}\n.ec-solo .ec-game-stats [data-message]{min-height:1.55em}\n@container (min-width:590px){.ec-solo .ec-game-layout{grid-template-columns:minmax(0,440px) minmax(180px,1fr);gap:14px}.ec-solo .ec-board,.ec-solo .ec-memory-grid{max-width:clamp(265px,calc(100svh - 320px),440px);margin-inline:auto}}\n<\/style><section class=\"ec-games ec-solo\" id=\"ec-solo-2\" aria-label=\"Mem\u00f2ria d\u2019escacs\"><nav class=\"ec-game-nav\" aria-label=\"Navegaci\u00f3 entre reptes\"><a class=\"ec-game-back\" href=\"\/juga-i-apren\/#jocs-escacimat\">\u2190 Tots els jocs d\u2019Escacimat<\/a><a class=\"ec-game-next-link\" href=\"https:\/\/escacimat.com\/juga-i-apren\/el-repte-del-cavall\/\">Seg\u00fcent repte <span aria-hidden=\"true\">\u2192<\/span><\/a><\/nav><div id=\"ec-memory\"><div class=\"ec-game-body\"><p>Gira dues cartes i troba les sis parelles de peces.<\/p><div class=\"ec-game-layout\"><div class=\"ec-memory-grid\" data-board role=\"group\" aria-label=\"Cartes de mem\u00f2ria\"><\/div><div class=\"ec-game-stats\"><p data-message role=\"status\"><\/p><button data-restart type=\"button\">Torna a barrejar<\/button><\/div><\/div><\/div><\/div><\/section><script>(function(){const root=document.getElementById(\"ec-solo-2\");if(!root)return;\n const playArea=root.querySelector('.ec-game-layout');\n playArea.addEventListener('wheel',function(event){\n   if(!event.ctrlKey&&!event.metaKey)event.preventDefault();\n },{passive:false}); const by=(element,name)=>element.querySelector('[data-'+name+']');\n const cellName=(i,size)=>'abcdefgh'[i%size]+(size-Math.floor(i\/size));\n function cells(board,size,render){\n   board.style.setProperty('--ec-board-size',size);\n   board.replaceChildren(...Array.from({length:size*size},function(_,index){\n     const button=document.createElement('button');\n     button.type='button';button.className='ec-cell';button.dataset.cell=index;\n     if((index%size+Math.floor(index\/size))%2)button.classList.add('ec-dark');\n     render(button,index);\n     return button;\n   }));\n }\n function knob(board,handler){board.addEventListener('click',function(event){const button=event.target.closest('[data-cell]');if(button)handler(Number(button.dataset.cell));});}\n const memory=root.querySelector('#ec-memory'),mb=by(memory,'board'),symbols=['\u265a','\u265b','\u265c','\u265d','\u265e','\u265f'];\n let deck,openCards,matched,turns,flip;\n function memoryDraw(){\n   mb.replaceChildren(...deck.map(function(symbol,i){const visible=openCards.includes(i)||matched.has(i),button=document.createElement('button');button.type='button';button.dataset.cell=i;button.className='ec-cell'+(matched.has(i)?' ec-matched':visible?' ec-revealed':'');button.textContent=visible?symbol:'?';button.setAttribute('aria-label','Carta '+(i+1)+(visible?', '+symbol:''));button.setAttribute('aria-pressed',String(visible));return button;}));\n   by(memory,'message').textContent=(matched.size===12?'Repte superat! ':matched.size\/2+' \/ 6 parelles \u00b7 ')+turns+(turns===1?' intent':' intents');\n }\n function resetMemory(){clearTimeout(flip);flip=0;deck=[...symbols,...symbols];for(let i=deck.length-1;i>0;i--){const j=Math.floor(Math.random()*(i+1));[deck[i],deck[j]]=[deck[j],deck[i]];}openCards=[];matched=new Set();turns=0;memoryDraw();}\n knob(mb,function(i){\n   if(flip||matched.has(i)||openCards.includes(i))return;\n   openCards.push(i);\n   if(openCards.length===2){turns++;if(deck[openCards[0]]===deck[openCards[1]]){openCards.forEach(x=>matched.add(x));openCards=[];}else flip=setTimeout(function(){const focused=Number(document.activeElement?.dataset?.cell);const restore=mb.contains(document.activeElement);openCards=[];flip=0;memoryDraw();if(restore)mb.querySelector('[data-cell=\"'+focused+'\"]').focus();},750);}\n   memoryDraw();mb.querySelector('[data-cell=\"'+i+'\"]').focus();\n });\n by(memory,'restart').addEventListener('click',resetMemory);resetMemory();\n})();<\/script>\n","protected":false},"excerpt":{"rendered":"<p>\u2190 Tots els jocs d\u2019EscacimatSeg\u00fcent repte \u2192 Gira dues cartes i troba les sis parelles de peces. Torna a barrejar<\/p>","protected":false},"author":1,"featured_media":0,"parent":13,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-990","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/escacimat.com\/es\/wp-json\/wp\/v2\/pages\/990","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/escacimat.com\/es\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/escacimat.com\/es\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/escacimat.com\/es\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/escacimat.com\/es\/wp-json\/wp\/v2\/comments?post=990"}],"version-history":[{"count":3,"href":"https:\/\/escacimat.com\/es\/wp-json\/wp\/v2\/pages\/990\/revisions"}],"predecessor-version":[{"id":1008,"href":"https:\/\/escacimat.com\/es\/wp-json\/wp\/v2\/pages\/990\/revisions\/1008"}],"up":[{"embeddable":true,"href":"https:\/\/escacimat.com\/es\/wp-json\/wp\/v2\/pages\/13"}],"wp:attachment":[{"href":"https:\/\/escacimat.com\/es\/wp-json\/wp\/v2\/media?parent=990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}