/* Scoped to the memory board. Does not restyle other games or the library. */
[data-memory-game]{max-width:1000px;margin:24px auto 50px;padding:24px;border:1px solid #dde7d5;border-radius:28px;background:#f6f9f0;color:#263e31}
.memory-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:22px}.memory-heading h2{font-size:22px;margin:0}.memory-heading p{margin:5px 0 0;font-size:13px;color:#586854}
.memory-theme{display:inline-flex;align-items:center;justify-content:center;min-height:46px;padding:10px 18px;background:white;border:1px solid #dbe5d5;border-radius:30px;font-size:18px;font-weight:750;white-space:nowrap}
.memory-journey{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));list-style:none;padding:0;margin:0 0 13px;gap:10px}.memory-journey li{background:#fff;border:1px solid #dce4d6;border-radius:14px;padding:12px 9px;text-align:center}.memory-journey strong{display:block;font-size:16px}.memory-journey small{font-size:11px;color:#61715b}.memory-journey [data-state=current]{background:#417d2b;border-color:#417d2b;color:white}.memory-journey [data-state=current] small{color:#f0f8eb}.memory-journey [data-state=locked]{background:#edf1e8;color:#667362}
.memory-progress-track{width:100%;height:8px;border:0;border-radius:20px;overflow:hidden;display:block;accent-color:#417d2b;background:#e1e9d9}.memory-progress-track::-webkit-progress-bar{background:#e1e9d9}.memory-progress-track::-webkit-progress-value{background:#417d2b}.memory-progress-track::-moz-progress-bar{background:#417d2b}
.memory-progress-text{font-size:12px;margin:10px 0;color:#586854}.memory-statline{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:18px 0}.memory-statline span{border:1px solid #e3e8db;border-radius:20px;padding:6px 12px;background:white;font-size:12px;font-weight:650}
[data-memory-game] .memory-board{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;max-width:780px;margin:0 auto;min-height:120px}
[data-memory-game] .memory-board[data-size="24"]{grid-template-columns:repeat(6,minmax(0,1fr));max-width:920px}
[data-memory-game] .memory-card{position:relative;display:block;aspect-ratio:1.05;min-width:0;min-height:56px;width:100%;padding:6px;overflow:hidden;background:#fffef7;border:2px solid #c7d9bb;border-radius:18px;cursor:pointer;transition:background-color .12s,border-color .12s;touch-action:manipulation;box-shadow:0 3px 0 #d4dfc9}
[data-memory-game] .memory-card.covered{background:linear-gradient(145deg,#eff7e5,#dceacb)}
[data-memory-game] .memory-card.covered:after{display:none;content:none}
.memory-face{height:100%;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px}
.memory-symbol{font-size:clamp(36px,5vw,68px);line-height:1.05;display:flex;align-items:center;justify-content:center;font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif}
.memory-symbol>svg{width:clamp(38px,6vw,90px);height:clamp(38px,6vw,90px)}.memory-number{font-family:inherit;font-size:clamp(38px,5vw,64px);font-weight:850;color:#345f42}
.memory-label{display:block;font-size:clamp(10px,1.15vw,14px);font-weight:650;line-height:1.15;text-align:center;overflow-wrap:anywhere;color:#263e31}
.memory-back{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#72965b;font-size:clamp(30px,4vw,54px);font-weight:800}
.memory-card:not(.covered) .memory-back{display:none}.memory-card.covered .memory-face{visibility:hidden}
[data-memory-game] .memory-card.matched{background:#fff2ce;border-color:#d8a941;box-shadow:0 2px 0 #ebdba9;opacity:1;cursor:default}
[data-memory-game] .memory-card.matched:before{content:'✓';position:absolute;right:6px;top:3px;color:#345c31;font-size:12px;font-weight:800}
[data-memory-game] .memory-card:focus-visible{outline:3px solid #956bb0;outline-offset:3px}
.memory-status{min-height:46px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:650;text-align:center;padding:12px 6px;margin:8px 0}
.memory-actions{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:12px;margin:8px 0 16px}
.memory-result{padding:22px 20px;border:1px solid #d5e3c5;border-radius:20px;background:#fff9e9;text-align:center;margin-bottom:18px}.memory-result h3{font-size:24px;margin:0 0 8px}.memory-result p{font-size:14px;line-height:1.6;margin:0;max-width:600px;margin-inline:auto}
.memory-parent{border-top:1px solid #dbe4d3;margin-top:22px;padding-top:14px;font-size:12px;color:#5a6d51}.memory-parent summary{cursor:pointer;font-weight:700;padding:8px 0}.memory-parent p{font-size:12px;line-height:1.6}.memory-parent button{font:inherit;border:1px solid #ccdac2;border-radius:10px;background:white;color:#3e602f;padding:10px 14px;cursor:pointer}.memory-save-note{font-size:11px;text-align:center;color:#61715b;margin:14px 0 0}
@media(max-width:680px){[data-memory-game]{padding:16px 12px;border-radius:20px}.memory-heading{gap:10px}.memory-heading h2{font-size:19px}.memory-theme{font-size:15px;min-height:40px;padding:8px 13px}.memory-journey{gap:6px}.memory-journey li{padding:10px 3px}.memory-journey strong{font-size:14px}.memory-journey small{font-size:10px}[data-memory-game] .memory-board,[data-memory-game] .memory-board[data-size="24"]{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}[data-memory-game] .memory-card{padding:5px 3px;border-radius:11px;aspect-ratio:.88}.memory-symbol{font-size:clamp(27px,7vw,45px)}.memory-number{font-size:clamp(29px,8vw,48px)}.memory-symbol>svg{width:clamp(36px,10vw,60px);height:clamp(36px,10vw,60px)}.memory-label{font-size:10px}.memory-status{font-size:12px;min-height:54px}.memory-statline{margin:14px 0}.memory-statline span{padding:6px 9px;font-size:11px}.memory-actions .btn{padding:11px 13px;font-size:12px}.memory-result h3{font-size:21px}}
@media(prefers-reduced-motion:reduce){[data-memory-game] .memory-card{transition:none}}
