/* Un petit joc de regals dins de la fitxa original. */
.activity-copy .memory-game{color:#fff;background:#31704f;isolation:isolate;overflow:hidden}
.activity-copy .memory-game .memory-intro{position:relative;text-align:center;padding:28px 28px 22px;background:linear-gradient(#31704fe6,#31704ff0),url('motius/estrelles.svg') center/240px}
.activity-copy .memory-game .memory-date{font:700 18px/1.5 var(--sans);color:#fff6df;margin:0 0 8px}
.activity-copy .memory-game .memory-title{font:700 clamp(40px,6vw,54px)/1.02 'Caveat',cursive;letter-spacing:0;color:#fff;max-width:520px;margin:0 auto;text-wrap:balance}
.memory-cast{position:relative;display:flex;justify-content:center;align-items:center;gap:12px;max-width:360px;margin:32px auto 26px;padding:0 12px}
.memory-portrait{width:95px;height:116px;display:block;position:relative;border:3px solid #edf4ef;border-radius:8px;box-shadow:0 5px 15px #001c2160;transform:rotate(-8deg);overflow:hidden;background:#357753}
.memory-portrait:nth-child(2){transform:rotate(4deg) translateY(-9px);z-index:1}
.memory-portrait:nth-child(3){transform:rotate(9deg)}
.memory-portrait img{width:100%;height:100%;display:block;object-fit:cover}
.memory-cast-star{position:absolute;right:1px;top:-18px;width:32px;height:32px;color:#e2cc91;transform:rotate(12deg);z-index:2}
.memory-cast-star svg,.memory-light svg,.memory-gift-star svg{display:block;width:100%;height:100%}
.activity-copy .memory-game .memory-intro-text{font:400 16px/1.65 var(--sans);max-width:350px;color:#e9f1e9;margin:0 auto 24px}
.memory-levels{display:flex;justify-content:center;gap:12px}
.memory-level{display:flex;flex-direction:column;gap:3px;align-items:center;justify-content:center;min-height:76px;min-width:132px;padding:12px 24px;border:1px solid #e2cc91;border-radius:9px;background:#edf4ef;color:#10543a;cursor:pointer}
.memory-level strong{font:700 19px/1.3 var(--sans)}
.memory-level span{font:400 13px/1.4 var(--sans)}
.memory-level+ .memory-level{background:transparent;color:#fff;border-color:#afc7b6}
.memory-level:hover{background:#fff}
.memory-level+ .memory-level:hover{background:#357753}
.memory-play{padding:24px 28px 18px}
.memory-play-heading{text-align:center}
.activity-copy .memory-game .memory-play .memory-title{font-size:42px}
.activity-copy .memory-game .memory-help{font:400 16px/1.5 var(--sans);color:#e9f1e9;margin:10px 0 16px}
.memory-progress{display:flex;justify-content:space-between;align-items:center;gap:12px;max-width:490px;margin:0 auto 20px}
.memory-lights{display:flex;gap:8px}
.memory-light{display:block;width:23px;height:23px;color:#779b89}
.memory-light.is-lit{color:#ffe4a4;animation:memory-light-up .45s ease-out both}
.memory-count{font:600 13px/1.5 var(--sans);white-space:nowrap;color:#e4eee5}
.memory-board{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;max-width:490px;margin:0 auto;perspective:1000px}
.memory-board[data-pairs="6"]{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.memory-card{position:relative;min-width:0;min-height:72px;width:100%;aspect-ratio:.8;padding:0;border:0;border-radius:9px;background:transparent;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.memory-card-turn{display:block;position:absolute;inset:0;transform-style:preserve-3d;transition:transform .24s cubic-bezier(.23,1,.32,1)}
.memory-card.is-revealed .memory-card-turn{transform:rotateY(180deg)}
.memory-card-back,.memory-card-face{display:block;position:absolute;inset:0;border-radius:9px;overflow:hidden;backface-visibility:hidden;-webkit-backface-visibility:hidden}
.memory-card-back{border:1px solid #e2cc91;background:#edf4ef url('motius/estrelles.svg') center/150px;color:#10543a;box-shadow:0 3px 8px #001b1740}
.memory-card-back::before{content:'';position:absolute;top:0;bottom:0;left:13px;width:6px;background:#c6af70b3}
.memory-card-back::after{content:'';position:absolute;top:8px;left:calc(50% - 22px);width:44px;height:23px;background:url('cartell/llac-regal.svg') center/contain no-repeat}
.memory-gift-star{position:absolute;left:calc(50% - 18px);top:calc(50% - 12px);width:36px;height:36px;color:#10543a}
.memory-card-face{transform:rotateY(180deg);background:#edf4ef;border:2px solid #edf4ef;display:flex;flex-direction:column}
.memory-card-face img{display:block;object-fit:cover;min-height:0;width:100%;flex:1}
.memory-card-face>span{font:700 13px/1.4 var(--sans);color:#10543a;padding:5px 2px;flex-shrink:0;overflow-wrap:anywhere}
.memory-card-face.without-photo{justify-content:center;background:#edf4ef url('motius/estrelles.svg') center/130px}
.memory-card.is-matched .memory-card-face{border-color:#e2cc91;box-shadow:inset 0 0 0 1px #e2cc91}
.memory-card.is-matched{cursor:default}
.activity-copy .memory-game .memory-feedback{font:400 14px/1.6 var(--sans);min-height:48px;color:#e9f1e9;max-width:490px;margin:18px auto 4px;text-align:center}
.memory-tools{display:flex;justify-content:center;gap:12px 24px;flex-wrap:wrap}
.memory-tools button,.memory-menu-link{border:0;border-bottom:1px solid #a1c3af;background:none;color:#e9f1e9;min-height:44px;padding:8px 0;font:600 13px/1.5 var(--sans);cursor:pointer}
.memory-finish{text-align:center;padding:32px 28px;background:linear-gradient(#31704fe6,#31704fe6),url('motius/estrelles.svg') center/240px}
.memory-finish-stars{display:flex;justify-content:center;align-items:center;gap:12px;color:#e2cc91;margin:0 auto 20px}
.memory-finish-stars svg{width:28px;height:28px;animation:memory-light-up .6s ease-out both}
.memory-finish-stars svg:nth-child(2){width:44px;height:44px;animation-delay:.12s}
.memory-finish-stars svg:nth-child(3){animation-delay:.24s}
.memory-finish-portrait{display:block;width:130px;height:145px;object-fit:cover;object-position:50% 28%;border:3px solid #e2cc91;border-radius:50%;margin:0 auto 24px}
.activity-copy .memory-game .memory-finish-text{font:400 17px/1.65 var(--sans);margin:16px auto 28px;max-width:310px;color:#e9f1e9}
.memory-again,.memory-more{display:block;width:min(300px,100%);min-height:52px;border:1px solid #e2cc91;border-radius:9px;padding:12px 16px;background:#edf4ef;color:#10543a;font:700 16px/1.5 var(--sans);margin:12px auto 0;cursor:pointer}
.memory-more{background:#357753;color:#fff}
.memory-menu-link{display:block;margin:12px auto 0}
.memory-game button:focus-visible{outline:3px solid #ffe4a4;outline-offset:4px}
.memory-game [tabindex="-1"]:focus{outline:none}
.memory-game .memory-nojs{padding:20px;font-size:16px}
@keyframes memory-light-up{0%{transform:scale(.65);opacity:.4}60%{transform:scale(1.2);opacity:1}100%{transform:scale(1);opacity:1}}
@media(max-width:640px){
 .activity-copy .memory-game .memory-intro{padding:24px 24px 20px}
 .activity-copy .memory-game .memory-title{font-size:44px}
 .memory-cast{margin-top:26px;margin-bottom:22px}
 .memory-portrait{width:85px;height:106px}
 .memory-level{min-width:0;flex:1;padding:12px 16px}
 .memory-play{padding:18px 20px 12px}
 .activity-copy .memory-game .memory-play .memory-title{font-size:39px}
 .activity-copy .memory-game .memory-help{font-size:15px;margin:8px 0 14px}
 .memory-progress{margin-bottom:16px}
 .memory-board{gap:12px}
 .memory-board[data-pairs="6"]{gap:9px}
 .memory-card-face>span{font-size:12px;padding:5px 1px}
 .memory-card-back::before{left:9px;width:5px}
 .memory-board[data-pairs="6"] .memory-card-back::after{width:34px;left:calc(50% - 17px)}
 .memory-light{width:19px;height:19px}
 .memory-lights{gap:5px}
 .activity-copy .memory-game .memory-feedback{font-size:14px;margin-top:14px}
}
@media(max-width:350px){.memory-board[data-pairs="6"]{grid-template-columns:repeat(3,minmax(0,1fr))}.memory-play{padding-inline:16px}.memory-board[data-pairs="6"]{gap:7px}.memory-light{width:17px;height:17px}.memory-lights{gap:3px}.memory-card-face>span{font-size:11px}.memory-count{font-size:12px}}
@media(prefers-reduced-motion:reduce){.memory-card-turn{transition:none}.memory-light.is-lit,.memory-finish-stars svg{animation:none}}
