.egel-memory [hidden]{display:none!important}
.egel-memory .garden-scene{padding:10px 2%;}
.egel-play{display:flex;flex:1;min-height:0;flex-direction:column}
.egel-board{display:grid;grid-template-columns:repeat(var(--cols),minmax(0,1fr));grid-template-rows:repeat(var(--rows),minmax(0,1fr));gap:clamp(6px,.8vw,12px);flex:1;min-height:0}
.egel-board .garden-tile{border-radius:20px 6px 20px 6px}
.egel-board .garden-back svg{width:45%;height:65%;filter:drop-shadow(0 0 8px #bef2ba66)}
.egel-board .garden-front{inset:3px;padding:4px;border-radius:15px 4px 15px 4px}
.egel-board .garden-word{font-size:clamp(10px,1vw,15px);padding:3px 0 0;line-height:1.05}
.egel-board .garden-match-mark{width:19px;height:19px;font-size:14px;top:4px;right:4px}
.house-peek{display:flex;align-items:center;gap:8px;border:1px solid #d6ddaa;border-radius:14px;background:#224e43;color:#fff3c6;padding:7px 12px;cursor:pointer;white-space:nowrap}
.house-peek span{font-size:28px}.house-peek b{font-size:14px}
.saved-pairs{display:flex;align-items:center;gap:10px;flex:none;height:49px;padding-top:6px;color:#fff3c6;font-size:13px}
.saved-images{display:flex;gap:4px;min-width:0;flex:1}
.saved-pair{position:relative;display:block;width:clamp(26px,4vw,50px);height:40px;background:#fffdf5;border:2px solid #e7cc83;border-radius:7px;overflow:hidden}
.saved-pair img{width:100%;height:100%;object-fit:contain}.saved-pair small{position:absolute;bottom:0;right:0;background:#406b53;color:white;border-radius:50%;width:13px;height:13px;text-align:center;font-size:10px}
.saved-hint{opacity:.8}.egel-layer{display:flex;flex:1;min-height:0;justify-content:center}
.egel-story,.egel-house-view,.egel-finished{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;min-height:0}
.house-art{position:relative;width:100%;aspect-ratio:16/9;max-height:100%;overflow:hidden;border-radius:18px;flex:1;min-height:0;background:#17352f}
.house-art>img{display:block;width:100%;height:100%;object-fit:contain}
.egel-story .house-art,.egel-finished .house-art,.egel-house-view .house-art{flex:none;width:auto;height:calc(100% - 116px);max-width:100%;aspect-ratio:1672/941}
.story-caption{flex:1;min-height:105px;width:100%;display:flex;align-items:center;justify-content:center;gap:18px;padding:8px;box-sizing:border-box}
.story-caption p{font-size:clamp(16px,1.8vw,25px);max-width:720px;margin:0;line-height:1.3;color:#fff6da}
.story-caption button,.exchange-caption button{background:linear-gradient(135deg,#4c8058,#224e3c);color:#fff5cf;border:2px solid #d6deaa;border-radius:24px 6px 24px 6px;padding:12px 22px;font:inherit;font-weight:800;cursor:pointer;white-space:nowrap;min-height:46px}
.story-pages{display:flex;gap:5px}.story-pages i{height:9px;width:9px;border-radius:50%;background:#648276}.story-pages i.active{background:#ffe6a0}
.wind-leaves{position:absolute;inset:0;pointer-events:none;overflow:hidden}.wind-leaves i{position:absolute;left:-10%;top:calc(var(--i)*7%);font-style:normal;font-size:clamp(20px,3vw,45px);animation:wind-leaf 2.6s calc(var(--i)*-.21s) linear infinite}
@keyframes wind-leaf{from{transform:translateX(0) rotate(0)}to{transform:translateX(1400px) rotate(220deg)}}
.house-restored{position:absolute;inset:0}.repair-piece{position:absolute;background-image:url('assets/memory-garden/house-intact-v189.webp');background-repeat:no-repeat;opacity:0;transition:opacity .8s ease}.repair-piece.restored{opacity:1}
.repair-shimmer{position:absolute;inset:0;pointer-events:none;opacity:0;background:radial-gradient(ellipse,#ffdd6f99,transparent 60%)}
.repair-shimmer.shine{animation:house-shine .9s ease-out}@keyframes house-shine{15%{opacity:.65}100%{opacity:0}}
.exchange-caption{position:relative;min-height:116px;width:100%;display:flex;align-items:center;justify-content:center;gap:25px}
.exchange-caption p{font-size:clamp(14px,1.3vw,20px);color:#fff2ca}
.exchange-pair{display:flex;align-items:center;gap:16px;transform-origin:center;opacity:1}
.exchange-pictures{display:flex;gap:9px}.exchange-pictures img{width:clamp(85px,11vw,160px);height:90px;object-fit:contain;background:white;border:3px solid #f3d582;border-radius:12px}
.exchange-pair strong{color:#fff5d1;font-size:clamp(16px,1.6vw,23px);max-width:220px}
.exchange-pair.in-flight{animation:pair-exchange 1.2s ease-in forwards}
@keyframes pair-exchange{40%{filter:drop-shadow(0 0 12px #ffe899);opacity:1}100%{transform:translate(var(--fly-x,0px),var(--fly-y,-140px)) scale(.08);filter:drop-shadow(0 0 24px #fff4b1);opacity:0}}
.egel-finished .story-caption{flex-direction:column;gap:4px}.egel-finished .garden-final-actions{padding:4px;gap:14px}.egel-finished .garden-final-actions button{font-size:clamp(14px,1.3vw,20px)}
@media(orientation:portrait){.egel-board{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(var(--portrait-rows),minmax(0,1fr))}.egel-memory .garden-heading strong{font-size:17px}.egel-memory .garden-heading span{font-size:11px}.egel-board .garden-word{font-size:10px}.egel-board .garden-front{padding:2px}.egel-story .house-art,.egel-house-view .house-art,.egel-finished .house-art{width:100%;height:auto;flex:none;margin:auto 0;aspect-ratio:1672/941}.story-caption{flex:none;flex-wrap:wrap;min-height:140px;padding:12px}.story-caption p{font-size:20px;flex-basis:85%;text-align:center}.exchange-caption{min-height:190px;flex-direction:column;gap:6px}.exchange-caption p{margin:0}.exchange-pictures img{width:130px;height:98px}.exchange-pair{flex-direction:column;gap:7px}.saved-pairs{gap:5px;font-size:11px}.saved-pair{height:32px}.saved-hint{display:none}.egel-finished .story-caption p{flex-basis:auto}}
@media(max-height:650px) and (orientation:landscape){.egel-memory .garden-heading{padding-bottom:4px}.egel-memory .garden-heading strong{font-size:17px}.egel-memory .garden-heading span{font-size:11px}.saved-pairs{height:35px}.saved-pair{height:29px}.egel-story .house-art,.egel-house-view .house-art,.egel-finished .house-art{height:calc(100% - 93px)}.story-caption,.exchange-caption{min-height:90px}.exchange-pictures img{height:69px}.story-caption p{font-size:17px}}
@media(prefers-reduced-motion:reduce){.egel-memory *{animation-duration:.01ms!important;animation-iteration-count:1!important;transition:none!important}}

/* Sixteen ordered repairs and child-controlled pause, v190. */
.repair-piece{transition:opacity 1.8s ease}
.repair-piece[data-piece="15"]{transition-duration:3s}
.grand-reveal{animation:home-warmth 3.4s ease-out}
@keyframes home-warmth{45%{filter:brightness(1.16) saturate(1.12)}100%{filter:none}}
.house-art .magic-continue{position:absolute;right:3%;bottom:4%;z-index:5;min-width:165px;min-height:52px;padding:16px 27px;border:1px solid #e0d699;border-radius:80% 8% 70% 12% / 65% 15% 70% 18%;background:radial-gradient(ellipse at 35% 20%,#9cb67766,transparent 60%),linear-gradient(140deg,#567c43,#1d472c 70%,#375836);color:#fff6c9;text-shadow:0 2px 3px #152919;box-shadow:inset 0 0 13px #d1e19444,0 0 16px #ffe69b88,0 6px 9px #0b201d88;font:inherit;font-weight:800;font-size:clamp(16px,1.6vw,23px);cursor:pointer;transform-origin:70% 70%;animation:magic-leaf-breathe 2.8s ease-in-out infinite}
.magic-continue:before{content:"";position:absolute;inset:5px;border:1px solid #d0df9c66;border-radius:inherit;pointer-events:none}
.magic-continue:after{content:"";position:absolute;width:28px;height:3px;background:#849459;right:-18px;bottom:11px;rotate:-25deg;border-radius:100%;box-shadow:0 1px 2px #132b1b}
.magic-continue i{font-style:normal;position:absolute;left:7px;top:-7px;color:#fff6ba;text-shadow:0 0 9px #ffe393}
@keyframes magic-leaf-breathe{0%,100%{scale:1;box-shadow:inset 0 0 13px #d1e19444,0 0 12px #ffe69b66,0 6px 9px #0b201d88}50%{scale:1.035;box-shadow:inset 0 0 16px #d1e19466,0 0 27px #ffeaacbb,0 6px 9px #0b201d88}}
@media(orientation:portrait){.house-art .magic-continue{min-width:150px;min-height:48px;padding:12px 22px;font-size:17px}}
@media(prefers-reduced-motion:reduce){.house-art .magic-continue{animation:none;box-shadow:0 0 20px #ffe69b99}}

/* Contour light follows each repaired object, never its rectangular repair tile. */
.repair-shimmer{width:100%;height:100%;background:none!important;overflow:visible;fill:none}
.repair-shimmer .contour-halo{stroke:#ffcf57;stroke-width:.8;filter:url(#repair-contour-glow);stroke-linejoin:round;stroke-linecap:round}
.repair-shimmer .contour-core{stroke:#fff5c0;stroke-width:.16;stroke-linejoin:round;stroke-linecap:round}
.repair-shimmer.shine{animation:contour-light 2s ease-out}
@keyframes contour-light{0%{opacity:0}18%,45%{opacity:1}100%{opacity:0}}

/* The story world fills the entire stage; no second garden behind it. */
.egel-layer{position:absolute;inset:0;overflow:hidden;background:#182625}
.egel-story,.egel-house-view,.egel-finished{position:absolute;inset:0;display:block;overflow:hidden}
.egel-layer .house-art{position:absolute!important;max-width:none!important;max-height:none!important;aspect-ratio:auto!important;margin:0!important;border-radius:0!important;min-height:0;transition:left 1s ease,top 1s ease}
.egel-layer .house-art>img{width:100%;height:100%;object-fit:fill}
.egel-layer .story-caption,.egel-layer .exchange-caption{position:absolute;z-index:3;bottom:0;left:0;width:100%;height:auto;min-height:110px;padding:20px 24px 14px;background:linear-gradient(transparent,#0b201ad9);text-shadow:0 2px 5px #071510;box-sizing:border-box}
.egel-layer .story-caption p{color:#fff5d6}
.egel-house-view>.magic-continue{position:absolute;right:4%;bottom:20px;z-index:5;min-width:165px;min-height:52px;padding:16px 27px;border:1px solid #e0d699;border-radius:80% 8% 70% 12% / 65% 15% 70% 18%;background:radial-gradient(ellipse at 35% 20%,#9cb67766,transparent 60%),linear-gradient(140deg,#567c43,#1d472c 70%,#375836);color:#fff6c9;text-shadow:0 2px 3px #152919;box-shadow:inset 0 0 13px #d1e19444,0 0 16px #ffe69b88,0 6px 9px #0b201d88;font:inherit;font-weight:800;font-size:clamp(16px,1.6vw,23px);cursor:pointer;animation:magic-leaf-breathe 2.8s ease-in-out infinite}
.egel-memory[data-garden-phase="repair-done"] .exchange-caption{justify-content:flex-start;padding-right:245px}
@media(orientation:portrait){.egel-layer .story-caption{min-height:155px}.egel-layer .exchange-caption{min-height:190px}.egel-memory[data-garden-phase="repair-done"] .exchange-caption{min-height:120px;padding:15px 205px 15px 20px;justify-content:center}.egel-house-view>.magic-continue{right:18px;bottom:28px;min-width:155px;font-size:17px}}
@media(prefers-reduced-motion:reduce){.egel-layer .house-art{transition:none}.egel-house-view>.magic-continue{animation:none;box-shadow:0 0 20px #ffe69b99}}


/* Full-canvas restoration with independent, softly blended damage-clearance masks. */
.repair-piece{inset:0;width:100%;height:100%;background-size:100% 100%;background-position:0 0;mask-image:var(--repair-mask,none);-webkit-mask-image:var(--repair-mask,none);mask-size:100% 100%;-webkit-mask-size:100% 100%;mask-repeat:no-repeat;-webkit-mask-repeat:no-repeat;clip-path:none}

/* cluster-colored embossed card backs; the same emblem on every card in a round */
.egel-board .garden-back{border-radius:inherit;color:#fff1c7;background:radial-gradient(ellipse at 25% 10%,#ffffff30,transparent 65%),repeating-linear-gradient(35deg,#ffffff05 0 1px,transparent 1px 5px),linear-gradient(145deg,var(--cluster),var(--cluster-dark));box-shadow:inset 0 0 0 3px #edce8b,inset 0 0 0 7px #ffffff25,inset 0 -8px 18px #0002}
.egel-board .garden-back:before{content:"";position:absolute;inset:10px;border:1px solid #ffeac77a;border-radius:10px}
.egel-board .garden-back svg{width:57%;height:68%;filter:drop-shadow(0 2px 1px #0005) drop-shadow(0 -1px 0 #fff5)}
.egel-board .garden-back>span{color:#fff1c7;font-size:11px;bottom:7px;right:10px}
.egel-board .garden-word{max-width:100%;width:100%;white-space:nowrap;word-break:normal;overflow-wrap:normal;hyphens:none}
.egel-board .garden-word .memory-article,.egel-board .garden-word .memory-concept{display:inline;white-space:nowrap}
.egel-board .garden-word.article-above .memory-article{display:block;font-size:.86em;line-height:1.05}
.bingo-finish-button{padding:18px 28px;border-radius:40px;border:3px solid #f5dd99;background:linear-gradient(#297d91,#144957);color:#fff4d6;font:700 clamp(18px,2vw,28px) system-ui;box-shadow:0 6px 20px #001e3e80,inset 0 2px 6px #fff6;cursor:pointer;animation:end-cue 2.4s ease-in-out infinite}
@keyframes end-cue{50%{box-shadow:0 0 22px #ffe8ab99,inset 0 2px 6px #fff6}}
@media(prefers-reduced-motion:reduce){.bingo-finish-button{animation:none}}
