/* Memory: readable projection, concise feedback and a reusable personal library. */
.memory-library-heading{display:flex;align-items:baseline;justify-content:space-between;gap:20px;margin:25px 0 20px}.memory-library-heading h2,.memory-create-section h2{font-size:24px;margin:0}.memory-library-heading>span,.memory-modified{font-size:12px;color:#66758d}.activity-card h3{font-size:25px;line-height:1.2;margin:10px 0;overflow-wrap:break-word}.activity-card-copy .memory-modified{margin:0 0 17px}.memory-create-section{margin-top:35px;padding:25px;border:1px solid #dbe2f0;border-radius:17px;background:#f3f6ff}.memory-create-shortcuts{display:flex;gap:12px;flex-wrap:wrap;margin-top:18px}.activity-card-main{align-items:center}.memory-card-menu{position:relative;margin-left:auto}.memory-card-menu summary{cursor:pointer;list-style:none;padding:6px 14px;border:1px solid #d6dfef;border-radius:9px;font-size:24px;line-height:1.1}.memory-card-menu summary::-webkit-details-marker{display:none}.memory-card-menu[open]>div{position:absolute;right:0;bottom:calc(100% + 8px);z-index:5;background:white;padding:8px;box-shadow:0 8px 25px #142b5133;border:1px solid #dbe2f0;border-radius:12px;min-width:175px;display:grid;gap:5px}.memory-card-menu button{text-align:left;border:0}.memory-card-menu button:last-child{color:#a23c37}.memory-image-warning{padding:12px 15px;background:#fff9e9;color:#78571f;border:1px solid #eeddaf;border-radius:10px;font-size:13px;line-height:1.5}.activity-card-copy .memory-image-warning{padding:7px 10px;margin-bottom:12px}.memory-image-actions{display:flex;gap:6px;flex-wrap:wrap}.memory-image-actions button{font-size:11px;padding:7px 9px}.memory-no-image{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;text-align:center;color:#65748c;max-width:100%}.memory-no-image>span{font-size:25px}.memory-no-image>strong{font-size:14px;line-height:1.2;overflow-wrap:normal;word-break:normal}.memory-no-image small{font-size:10px;line-height:1.3;max-width:150px}.memory-pictogram-dialog{max-width:720px}.memory-pictogram-dialog input,.memory-link-dialog input{width:100%;border:1px solid #ccd6e8;padding:12px;border-radius:9px;font:inherit}.memory-pictogram-results{display:grid;grid-template-columns:repeat(auto-fill,minmax(100px,1fr));gap:9px;max-height:45vh;overflow:auto;padding:8px 2px}.memory-pictogram-results button{display:flex;flex-direction:column;align-items:center;gap:6px;padding:13px 8px;white-space:normal;font-size:12px;min-height:100px}.memory-pictogram-results button>span{font-size:32px}.memory-pictogram-results img{width:38px;height:38px;object-fit:contain}.memory-pictogram-results small{font-weight:400;font-size:10px;color:#687893}.memory-pictogram-results>p{grid-column:1/-1;line-height:1.6}.memory-game-grid{grid-template-columns:repeat(var(--memory-columns),minmax(0,1fr));gap:clamp(8px,1.1vw,16px);flex:0 0 auto}.memory-game-card{height:max(110px,calc((100dvh - 210px)/var(--memory-rows) - 16px));max-height:250px;min-height:110px;transition:background-color .18s,border-color .18s,box-shadow .18s;isolation:isolate}.memory-game-card .memory-word{display:block;max-width:100%;word-break:normal;overflow-wrap:normal;hyphens:none;line-height:1.15;text-wrap:balance}.memory-pair-review .memory-word,.activity-cover .memory-word{word-break:normal;overflow-wrap:normal;hyphens:none;line-height:1.2;font-size:clamp(13px,1.4vw,18px)}.memory-game-card.is-turning{animation:memory-flip .24s ease-out}.memory-game-card.is-returning{animation:memory-flip-back .24s ease-out}.memory-game-card.is-mismatch{border-color:#e4b584;background:#fff9f1}.memory-game-card.is-celebrating{animation:memory-correct .65s ease-out;box-shadow:0 0 0 3px #50b98966,0 7px 24px #238c5c22}.memory-match-check{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#f0fff3df;color:#198c52;font-size:clamp(48px,7vw,88px);font-weight:750;animation:memory-check .8s ease-out;pointer-events:none}.memory-game-card.is-matched:not(.is-celebrating)::after{content:'✓';position:absolute;top:6px;right:9px;color:#228759;font-size:17px}.memory-card-back{width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:radial-gradient(circle,#ffffff0d 2px,transparent 3px) center/20px 20px}.memory-card-back>b{border:2px solid #ffffff50;border-radius:20%;padding:2px 15px;font-weight:650}.memory-game-finished{margin:25px auto 0;width:min(600px,100%);border:1px solid #b3dac4;background:#f1fff6;padding:24px;text-align:center;border-radius:18px;animation:memory-complete .4s ease-out}.memory-game-finished h2{font-size:27px;margin:10px 0}.memory-game-finished p{color:#567365;margin:10px 0 20px}.memory-game-finished .actions{justify-content:center}.memory-finish-check{margin:auto;width:54px;height:54px;display:grid;place-items:center;background:#249a63;color:white;border-radius:50%;font-size:36px}.memory-play:fullscreen .memory-game-grid{flex:0 0 auto}
@keyframes memory-flip{from{transform:perspective(600px) rotateY(-80deg);opacity:.5}to{transform:perspective(600px) rotateY(0);opacity:1}}@keyframes memory-flip-back{from{transform:perspective(600px) rotateY(80deg);opacity:.6}to{transform:perspective(600px) rotateY(0);opacity:1}}@keyframes memory-correct{0%,100%{transform:scale(1)}35%{transform:scale(1.045)}65%{transform:scale(.985)}}@keyframes memory-check{0%{opacity:0;transform:scale(.7)}20%,60%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(1.1)}}@keyframes memory-complete{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:850px){.memory-game-grid{grid-template-columns:repeat(var(--memory-columns),minmax(0,1fr))}.memory-game-card{height:max(115px,calc((100dvh - 250px)/var(--memory-rows) - 14px));padding:12px}.memory-play-header{gap:12px}.memory-play-header .actions{flex-wrap:wrap}.memory-library-heading{flex-wrap:wrap;gap:8px}.memory-game-finished h2{font-size:23px}}
@media(max-width:520px){.memory-game-card{height:120px;padding:9px}.memory-game-card .memory-symbol{font-size:48px}.memory-play-message{margin:14px 0}.memory-card-back>b{padding:4px 12px}.memory-create-section{padding:20px}}
@media(prefers-reduced-motion:reduce){.memory-game-card,.memory-match-check,.memory-game-finished{animation:none!important;transition:none!important}.memory-match-check{background:#f0fff3ee}}
/* v273: progressive editor, existing canvas dimensions unchanged. */
.memory-wizard [hidden]{display:none!important}.m273-steps{display:flex;gap:8px;flex-wrap:wrap;margin:18px 0}.m273-steps button{border:1px solid #dbe2ef;border-radius:20px;padding:9px 14px}.m273-steps [aria-current=step]{background:#163be0;color:white}.memory-wizard .memory-creation-modes button{display:flex;flex-direction:column;gap:20px;padding:28px;text-align:left;border-radius:20px;min-height:150px}.m273-example{font-size:26px}.m273-navigation{display:flex;justify-content:space-between;margin-top:20px}.m273-examples{display:flex;gap:8px;flex-wrap:wrap}.m273-examples button{font-size:12px;padding:8px}.memory-wizard textarea[data-memory-paste]{width:100%;min-height:160px}.m273-review-cards .memory-pair-block{border-radius:18px;background:#f5f8ff}.memory-wizard .memory-image-preview{min-height:100px}.ac-type-choice small{display:block;line-height:1.5;font-size:13px;font-weight:400;max-width:32ch}.memory-game-card.is-celebrating{outline:4px solid #24a56a;outline-offset:-4px;animation:m273-success 950ms ease-out}.memory-game-card.is-matched{opacity:1}.memory-game-finished{animation:m273-success 950ms ease-out}.ac-memory progress,.memory-play progress{height:6px;width:100%;accent-color:#24a56a}@keyframes m273-success{0%{box-shadow:0 0 0 0 #24a56a77;transform:scale(.97)}45%{box-shadow:0 0 0 8px #24a56a22;transform:scale(1.025)}100%{box-shadow:0 0 0 0 transparent;transform:scale(1)}}@media(prefers-reduced-motion:reduce){.memory-game-card.is-celebrating,.memory-game-finished{animation:none}}
/* v274 compact review and the shared player, including editor testing. */
.memory-wizard{max-width:1200px;margin:auto}.memory-wizard .pagehead{margin-bottom:8px}.memory-wizard .pagehead h1{font-size:clamp(21px,3vw,30px)}.memory-wizard .m273-steps{gap:6px;margin:12px 0}.memory-wizard .m273-steps button{font-size:12px;padding:8px 10px}.memory-wizard .memory-settings{padding:12px;gap:12px;margin-bottom:12px}.memory-wizard .memory-ai-panel{padding:16px}.memory-wizard .memory-ai-input textarea{min-height:86px}.memory-wizard .memory-pairs-editor{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;max-height:none;overflow:visible}.memory-wizard .memory-pair-block{padding:12px;background:#fff;min-width:0}.memory-wizard .memory-pair-block>header{margin-bottom:8px}.memory-wizard .memory-pair-fields{display:grid!important;grid-template-columns:minmax(0,1fr) 18px minmax(0,1fr)!important;gap:8px;align-items:center}.memory-wizard .memory-pair-fields label{min-width:0}.memory-wizard .memory-pair-fields input{width:100%;box-sizing:border-box;min-width:0;padding:12px 8px;font-size:16px;text-align:center}.memory-wizard .memory-pair-fields label>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.memory-wizard .memory-image-preview{width:100%;height:100px;min-height:100px;padding:7px;background:#f1f6ff;border:1px solid #d5e1f2;border-radius:12px}.memory-wizard .memory-image-preview img{width:100%;height:100%;object-fit:contain}.memory-wizard .memory-image-preview .memory-symbol{font-size:60px}.memory-wizard .memory-image-editor details{font-size:11px;margin-top:5px}.memory-wizard .memory-no-image small{font-size:10px}.memory-wizard>.help{font-size:11px;margin:8px 0}.memory-wizard .memory-image-warning{padding:8px;font-size:12px}.memory-wizard .memory-pair-review{gap:10px}.memory-wizard .memory-pair-review>div{padding:10px;min-height:100px}.memory-wizard .memory-review-image{height:86px}.memory-wizard .memory-image-confidence{font-size:10px}.memory-wizard .memory-editor-footer{position:static;padding:10px;margin:10px 0}.memory-wizard .m273-navigation{margin-top:12px}.ac-editor-dialog.m274-playing{width:100vw!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;inset:0!important}.ac-editor-dialog.m274-playing>header,.ac-editor-dialog.m274-playing>.ac-editor-footer,.m274-playing .ac-associations,.m274-playing .ac-shared{display:none!important}.ac-editor-dialog.m274-playing>.b-dialog-body{padding:0!important;overflow:visible!important;display:flex;flex-direction:column}.m274-playing [data-ac-edit-content]{flex:1;min-height:0}.m274-playing .ac-editor-footer{display:none!important}.memory-play{box-sizing:border-box;min-height:100dvh;padding:12px!important;display:flex;flex-direction:column;gap:8px}.memory-play-header{flex:none;margin:0!important;gap:10px!important;align-items:center}.memory-play-header h1{font-size:clamp(18px,2vw,26px)!important;margin:0!important;line-height:1.2}.memory-play-header .actions{gap:6px!important}.memory-play-header .actions button{padding:8px!important;font-size:12px!important}.memory-play-stats{font-size:13px!important}.memory-play-message{margin:0!important;font-size:13px}.memory-play>.memory-game-grid{width:100%;max-width:1400px;flex:1;min-height:0;gap:8px;margin:0 auto!important;padding:4px!important;grid-template-rows:repeat(var(--memory-rows),minmax(64px,1fr))}.memory-play .memory-game-card{height:100%!important;min-height:64px;aspect-ratio:auto!important;padding:8px!important}.memory-play .memory-game-finished{position:relative;margin:4px auto;padding:12px;flex:none}.memory-play .memory-game-finished h2{font-size:20px}.memory-play .memory-image-credits{flex:none;padding:4px;margin:0}.memory-play .memory-card-back>b{font-size:28px}.memory-play .memory-card-back>small{font-size:10px}.memory-play{height:100dvh;overflow:auto}.memory-play .memory-music-volume{display:none}@media(max-width:650px){.memory-wizard .memory-pairs-editor{grid-template-columns:1fr}.memory-wizard .memory-pair-block{padding:10px}.memory-play{height:auto;min-height:100dvh}.memory-play-header{flex-wrap:wrap}.memory-play>.memory-game-grid{flex:none;grid-template-rows:repeat(var(--memory-rows),minmax(90px,1fr))}.memory-play .memory-game-card{min-height:90px}.memory-wizard .m273-steps button{font-size:11px}}@media(prefers-reduced-motion:reduce){.memory-wizard *,.memory-play *{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
.ac-editor-dialog .memory-wizard [data-activity=save]{display:inline-flex;align-items:center;min-height:44px;margin:8px 0}.memory-wizard .m274-pair-status{font-size:11px;color:#587089;margin-left:auto}.memory-wizard .m274-pair-status.pending{color:#a56a13}
.ac-editor-dialog.m274-playing{overflow-y:auto!important;overflow-x:hidden!important}@media(max-width:650px){.m274-playing .memory-play{overflow:visible}.m274-playing>.b-dialog-body{flex:none!important}.memory-play .memory-game-grid{overflow:visible!important}}
/* v276: fullscreen must grow the board; override legacy flex:0 fullscreen rule. */
.memory-play:fullscreen>.memory-game-grid,.memory-play.m276-immersive>.memory-game-grid{flex:1 1 0!important;min-height:0}.memory-play:fullscreen,.memory-play.m276-immersive{box-sizing:border-box;width:100vw;max-width:none;height:100dvh;min-height:100dvh;margin:0;padding:12px!important;background:#f3f5fc;display:flex;flex-direction:column}.memory-play.m276-immersive{position:fixed;inset:0;z-index:1000}.memory-play>.memory-game-grid{max-width:none!important;align-content:stretch;grid-auto-rows:1fr}.m276-stats{display:inline-block;white-space:normal;line-height:1.4;font-size:13px;font-variant-numeric:tabular-nums}.m276-stats b{font-weight:650}.ac-memory>header{flex-wrap:wrap}.ac-memory>header .m276-stats{font-size:clamp(10px,2.6cqw,16px);margin-left:auto}.ac-memory.is-compact>header strong{max-width:35%}.m276-languages{display:flex;gap:12px;flex-wrap:wrap;margin:8px 0 14px}.m276-languages label{flex:1;min-width:150px}.memory-ai-panel [data-activity=generate]{background:#163be0;color:#fff;border-color:#163be0;min-height:44px}.ac-editor-dialog.m276-immersive>header,.ac-editor-dialog.m274-playing .b-split-close,.ac-editor-dialog.m274-playing [data-split-close]{display:none!important}@media(max-width:650px){.memory-play:fullscreen,.memory-play.m276-immersive{height:100dvh;overflow:auto}.memory-play:fullscreen>.memory-game-grid,.memory-play.m276-immersive>.memory-game-grid{flex:1 0 auto!important;grid-template-rows:repeat(var(--memory-rows),minmax(64px,1fr))}.m276-languages{gap:8px}.memory-play-header .m276-stats{font-size:12px}}
/* v278: contained image picker; no inherited global form sizing. */
dialog.memory-image-dialog[open]{display:flex;flex-direction:column;gap:14px;width:min(760px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:22px;box-sizing:border-box;overflow:auto}
.memory-image-dialog>h2{margin:0;font-size:22px;overflow-wrap:anywhere;flex-shrink:0}
.memory-image-dialog form{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:10px;align-items:end;margin:0;flex-shrink:0}
.memory-image-dialog form label{display:flex;flex-direction:column;gap:7px;min-width:0;font-size:13px;line-height:1.4}
.memory-image-dialog input[type=search]{width:100%;min-width:0;box-sizing:border-box;margin:0}
.memory-image-dialog form button{margin:0;min-height:44px;white-space:normal}
.memory-image-dialog>.help,.memory-image-dialog>[role=status]{margin:0;font-size:12px;line-height:1.5;flex-shrink:0}
.memory-image-dialog>[role=status]:empty{display:none}
.memory-image-dialog .memory-pictogram-results{min-height:100px;max-height:45dvh;overflow:auto;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));margin:0;flex:1 1 auto;align-content:start}
.memory-image-dialog .memory-pictogram-results button{max-width:100%;min-height:150px;justify-content:center}
.memory-image-dialog .memory-pictogram-results img{height:120px;max-width:100%}
.memory-image-dialog .memory-pictogram-results button>span{font-size:56px}
.memory-image-dialog>.actions{display:flex;flex-wrap:wrap;gap:8px;margin:0;padding-top:12px;border-top:1px solid #dce6ef;flex-shrink:0}
.memory-image-dialog button:focus-visible,.memory-image-dialog input:focus-visible{outline:3px solid #3479cb;outline-offset:2px}
.memory-game-card .m278-image-face{display:flex;flex-direction:column;gap:5px;align-items:center;width:100%;height:100%;min-height:0}
.memory-game-card .m278-image-art{display:flex;align-items:center;justify-content:center;flex:1 1 0;min-height:0;width:100%;overflow:hidden}
.memory-game-card .m278-image-art img{width:100%;height:100%;object-fit:contain}
.memory-game-card .m278-image-art .memory-symbol{font-size:clamp(28px,5vw,90px);line-height:1}
.memory-game-card .m278-image-label{flex:0 0 auto;max-width:100%;font-size:clamp(11px,1.25vw,18px);font-weight:650;line-height:1.2;overflow-wrap:anywhere;text-align:center;color:#25384f}
@media(max-width:600px){dialog.memory-image-dialog[open]{padding:16px;gap:12px}.memory-image-dialog form{grid-template-columns:1fr 1fr}.memory-image-dialog form label{grid-column:1/-1}.memory-image-dialog .memory-pictogram-results{grid-template-columns:repeat(2,minmax(0,1fr))}.memory-image-dialog>.actions button{flex:1 1 auto}}
/* Shared completion panel, visible in the canvas as well as the full player. */
.ac-memory,.memory-play{position:relative}
.ac-memory .memory-game-finished,.memory-play .memory-game-finished{position:absolute;z-index:4;left:50%;bottom:12px;transform:translateX(-50%);margin:0;box-sizing:border-box;width:min(520px,calc(100% - 24px));max-height:90%;overflow:auto;padding:14px 20px;box-shadow:0 8px 28px #234c3830;animation:none;pointer-events:auto}
.ac-memory .memory-game-finished h2,.memory-play .memory-game-finished h2{font-size:clamp(16px,2vw,24px);margin:4px 0}
.ac-memory .memory-game-finished p,.memory-play .memory-game-finished p{margin:7px 0;font-size:14px}
.memory-game-finished .memory-finish-check{width:34px;height:34px;font-size:25px}
.memory-game-finished.is-celebrating-finish .memory-finish-check{animation:m280-celebrate 1.8s ease-out both}
.memory-game-finished.is-celebrating-finish{border-color:#43ab79}
@keyframes m280-celebrate{0%{scale:.5;box-shadow:0 0 0 0 #46b98466}25%{scale:1.2;box-shadow:0 0 0 18px #46b98422}55%{scale:1;box-shadow:0 0 0 30px #46b98400}75%{scale:1.12}100%{scale:1}}
@media(prefers-reduced-motion:reduce){.memory-game-finished.is-celebrating-finish .memory-finish-check{animation:none}}
.memory-image-editor label{display:flex;flex-direction:column;gap:5px;min-width:0;font-size:12px}
.memory-image-editor input{box-sizing:border-box;max-width:100%;min-width:0;width:100%}

/* Step 3 only: do not inherit full-width text-input sizing for the checkbox. */
.memory-wizard .memory-ai-panel .memory-label-options{display:flex;flex-wrap:wrap;align-items:center;gap:10px 20px;margin:12px 0;padding:0;min-height:0}
.memory-wizard .memory-ai-panel .memory-label-options>label{display:flex;align-items:center;gap:8px;flex:0 1 auto;margin:0;padding:0;min-width:0;min-height:0;line-height:1.4}
.memory-wizard .memory-ai-panel .memory-label-options input[type=checkbox]{appearance:auto;box-sizing:border-box;width:19px;height:19px;min-width:19px;min-height:19px;max-width:19px;max-height:19px;flex:0 0 19px;margin:0;padding:0;accent-color:#163be0}
.memory-wizard .memory-ai-panel .memory-label-options select{width:auto;min-width:110px;max-width:100%;height:38px;min-height:38px;margin:0;padding:6px 10px}
.memory-wizard .memory-ai-panel .memory-label-options+.actions{margin-top:10px}
@media(max-width:480px){.memory-wizard .memory-ai-panel .memory-label-options{flex-direction:column;align-items:flex-start;gap:10px}.memory-wizard .memory-ai-panel .memory-label-options>label{max-width:100%;flex-wrap:wrap}.memory-wizard .memory-ai-panel .memory-label-options>label:first-child{flex-wrap:nowrap}}
