.memory-example{display:flex;justify-content:center;gap:14px}.memory-example span,.memory-cards span{display:grid;place-items:center;background:#fff;border:1px solid #a9bdcf;border-radius:9px;font-weight:700;color:#17324d}.memory-example span{width:100px;height:90px;font-size:25px}.memory-solution{display:flex!important;align-items:center;gap:9px;font-weight:400!important;margin:15px 0!important}.memory-solution input{width:18px;height:18px;accent-color:#164f9d}.memory-result{margin:30px 0;border-top:1px solid #d5e4f3;padding-top:24px}.memory-result h2{margin:0 0 8px}.memory-result .game-actions{margin:18px 0}.memory-preview{max-width:720px}.memory-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.memory-cards span{min-height:72px;font-size:clamp(17px,3vw,23px)}@media(max-width:400px){.memory-cards{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* A playful pair of colours supports the matching game without obscuring the controls. */
#memory .worksheet-intro{position:relative;overflow:hidden;margin:28px 0 28px;padding:30px 34px;background:#f1ecfc;border:1px solid #d7c8ed;border-radius:24px}
#memory .worksheet-intro::after{content:"";position:absolute;width:180px;height:180px;right:-30px;top:-60px;border:26px solid #ddcef5;border-radius:50%;opacity:.65;pointer-events:none}
#memory .worksheet-intro>*{position:relative;z-index:1}
#memory .worksheet-kicker{color:#5f3b91}
#memory .worksheet-intro h1{color:#36234f;margin-bottom:10px}
#memory .worksheet-intro>p:not(.worksheet-kicker){color:#554270}
#memory .game-settings{background:#fff;border:1px solid #ddd1ed;box-shadow:0 10px 30px #4830690d;border-radius:22px}
#memory .game-settings h2{color:#38244f}
#memory .game-settings legend{color:#5d3e80}
#memory .game-settings fieldset{border-color:#e8dff2}
#memory .bingo-row-options span{min-height:46px;border-color:#c8b9db;color:#554270}
#memory .bingo-row-options input:checked+span{background:#69479b;border-color:#69479b;color:#fff}
#memory .quiet-button{color:#5f3b91}
#memory .game-primary{background:#69479b;border-color:#69479b;color:#fff}
#memory .game-primary:hover{background:#503473;border-color:#503473}
#memory .memory-solution input{accent-color:#69479b}
#memory .bingo-explainer{padding:26px;background:#fff8e5;border:1px solid #f0dfae;border-radius:22px}
#memory .bingo-explainer h2{color:#694600;margin:24px 0 14px}
#memory .bingo-explainer li{color:#544a37}
#memory .local-note{background:#fff0bf;color:#564826}
#memory .memory-example{justify-content:flex-start;gap:14px}
#memory .memory-example span{border:2px solid #8d70b4;border-radius:13px;background:#f4edff;box-shadow:0 5px 0 #ddd2f0;color:#53377b}
#memory .memory-example span+span{border-color:#d2a641;background:#fff1bf;box-shadow:0 5px 0 #f2dfad;color:#694600}
#memory .memory-result{padding:26px;margin:32px 0;border:1px solid #ddd1ed;border-radius:22px;background:#faf7ff}
#memory .memory-cards span{border-color:#c8b9db;color:#53377b;box-shadow:0 3px 0 #e7dcf5}
#memory .memory-cards span:nth-child(even){background:#fff9e5;border-color:#e1ce98;color:#694600;box-shadow:0 3px 0 #f4eacb}
@media(max-width:680px){#memory .worksheet-intro{margin:20px 0;padding:24px 22px;border-radius:18px}#memory .worksheet-intro::after{width:110px;height:110px;right:-42px;top:-45px;border-width:20px;opacity:.4}#memory .bingo-explainer{padding:22px}#memory .memory-result{padding:20px}}
@keyframes memoryExampleMatch{0%,100%{transform:translateY(0) rotate(0deg)}45%,55%{transform:translateY(-4px) rotate(-2deg);box-shadow:0 8px 16px #204d9a22}}
@keyframes memoryExampleMatchRight{0%,100%{transform:translateY(0) rotate(0deg)}45%,55%{transform:translateY(-4px) rotate(2deg);box-shadow:0 8px 16px #d2a64130}}
#memory .memory-example span:first-child{animation:memoryExampleMatch 4.2s ease-in-out infinite}
#memory .memory-example span+span{animation:memoryExampleMatchRight 4.2s ease-in-out infinite}
@media(prefers-reduced-motion:reduce){#memory .memory-example span{animation:none!important}}
