body.on-memory{background:#f4dcbb}
.on-memory main{min-height:calc(100svh - 84px);background:linear-gradient(#fbf4e312,#fbf4e322),url('assets/memoria/cenario.webp') center top/cover no-repeat;background-attachment:fixed}
.on-memory footer{display:none}
.memory-page{max-width:1060px;margin:auto;padding:16px 24px 30px;color:#373b59}
.memory-nav{display:flex;align-items:center;justify-content:space-between;gap:16px}
.memory-return,.memory-time{border:2px solid #fff8ee;border-radius:40px;background:#fff9eef5;padding:8px 18px;font-family:Fredoka,Arial,sans-serif;box-shadow:0 4px 0 #a6b5b87a;font-size:1rem}
.memory-return{min-height:48px;font-weight:500;display:flex;align-items:center;gap:9px}
.memory-return span{font-size:1.35rem}.memory-time{font-size:.9rem;white-space:nowrap}
.memory-heading{text-align:center;margin:-28px auto 8px;width:min(420px,60%);pointer-events:none}
.memory-heading h1{margin:0;line-height:1}.memory-heading img{width:100%;height:132px;object-fit:contain;display:block}
.memory-guide{display:flex;align-items:center;gap:16px;max-width:800px;min-height:100px;margin:0 auto 18px;padding:12px 22px 12px 12px;border:3px solid #fffdf3;border-radius:28px;background:#fffaf2f5;box-shadow:0 5px 0 #c7d6bfa6,0 9px 18px #684d4620}
.memory-flu{width:82px;flex-shrink:0}.memory-flu img{display:block;width:100%;height:82px;object-fit:contain}
#memory-message h2{font-size:1.35rem;font-weight:500;line-height:1.2;margin-bottom:5px}
#memory-message p{font-size:1rem;line-height:1.35;color:#454d66}
.memory-layout{display:grid;grid-template-columns:minmax(0,690px) 220px;gap:28px;max-width:940px;margin:auto;align-items:start}
.memory-game{min-width:0}
.memory-progress{display:flex;gap:6px;justify-content:center;align-items:center;font-size:.95rem;background:#fffaf1ed;width:max-content;max-width:100%;padding:5px 18px;border:2px solid #fff;border-radius:30px;margin:0 auto 14px;box-shadow:0 3px 0 #cebdde55}
.memory-progress>span{font-size:1.2rem;margin-right:3px}
.memory-board{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;max-width:600px;margin:auto}
.memory-board[data-pairs="4"],.memory-board[data-pairs="6"]{grid-template-columns:repeat(4,minmax(0,1fr));max-width:none}
.memory-card{position:relative;min-width:0;height:184px;padding:0;border:4px solid #fffbef;border-radius:26px;background:linear-gradient(155deg,#d9c8f4,#bba3de);color:#46316a;box-shadow:0 7px 0 #8d74ae,0 10px 14px #71605724;transition:transform .16s,box-shadow .16s;isolation:isolate}
.memory-card:hover:not([aria-disabled="true"]){transform:translateY(-3px)}
.memory-card:focus-visible{outline:4px solid #254f8b;outline-offset:5px;z-index:2}
.memory-card-number{position:absolute;top:6px;left:7px;display:grid;place-items:center;width:24px;height:24px;line-height:1;background:#fffaf0c9;border-radius:50%;font-size:.82rem;z-index:1}
.memory-card-back{display:flex;align-items:center;justify-content:center;height:100%}
.memory-card-back b{font-family:Fredoka,Arial,sans-serif;font-size:4.2rem;font-weight:600;color:#fff9ed;text-shadow:0 4px 0 #9b7dbe,0 7px 0 #755494;line-height:1}
.memory-card-face{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px 8px 8px;gap:3px}
.memory-card-face img{width:100%;height:108px;object-fit:contain;min-height:0}
.memory-card-name{font-family:Fredoka,Arial,sans-serif;display:flex;align-items:center;justify-content:center;min-height:36px;font-size:1rem;line-height:1.08;color:#37364f;text-align:center}
.memory-card-mark{position:absolute;top:5px;right:5px;background:#e9f4e7;border:1px solid #bdd4b7;color:#365332;padding:2px 6px;border-radius:30px;font-size:.75rem;font-weight:bold;line-height:1.25;z-index:1}
.memory-card [hidden]{display:none}
.memory-card.is-open{background:linear-gradient(145deg,#fffefa,#fff0d6);box-shadow:0 7px 0 #cbb492,0 10px 14px #71605720}
.memory-card.is-chosen{border-color:#7754a4;box-shadow:0 7px 0 #674989,0 10px 14px #71605720}
.memory-card.is-chosen .memory-card-mark{background:#eee3f6;color:#58347c;border-color:#c8b0de}
.memory-card.is-matched{background:linear-gradient(145deg,#fffefa,#eff3df);border-color:#d5e6c4;box-shadow:0 7px 0 #9db785,0 10px 14px #71605720}
.memory-card[aria-disabled="true"]{cursor:default}
.memory-actions{min-height:74px;display:flex;align-items:center;justify-content:center;text-align:center;margin:20px 0 4px}
.memory-result{background:#fffaf1f5;border:3px solid #fff;border-radius:25px;padding:16px 20px;width:100%}.memory-result p{font-size:1rem;line-height:1.4;margin-bottom:12px}.memory-result button,.memory-finish button,.memory-card{scroll-margin-bottom:120px;scroll-margin-top:16px}
.memory-primary,.memory-secondary{display:inline-flex;justify-content:center;align-items:center;gap:16px;min-height:52px;padding:10px 24px;border:3px solid #fff9e9;border-radius:30px;font-family:Fredoka,Arial,sans-serif;font-size:1.13rem;font-weight:500;line-height:1.25}
.memory-primary{background:#7754a4;color:#fff;box-shadow:0 5px 0 #513574}
.memory-primary:hover{background:#66428f}.memory-secondary{color:#4d4264;background:#fff9ec;box-shadow:0 4px 0 #bcb18e}
.memory-gentle-note{font-size:.875rem;background:#fffaf0ec;border-radius:24px;padding:7px 16px}
.memory-side{padding-top:30px}
.memory-dentim{text-align:center}.memory-dentim img{display:block;width:190px;height:204px;object-fit:contain;margin:0 auto}
.memory-dentim span{display:inline-block;background:#fff9efed;border:2px solid white;border-radius:20px;padding:6px 12px;font-family:Fredoka,Arial,sans-serif;font-size:1rem}
.memory-options{margin-top:20px;background:#fffaf3f7;border:3px solid #fff;border-radius:24px;padding:8px 12px;box-shadow:0 4px 0 #d0b8d6}
.memory-options summary{cursor:pointer;font-family:Fredoka,Arial,sans-serif;font-size:1rem;min-height:40px;align-content:center;line-height:1.2;padding:5px 0}
.memory-options summary:focus-visible{outline:4px solid #254f8b;outline-offset:3px;border-radius:8px}
.memory-options fieldset{border:0;padding:10px 0 8px;margin:0}.memory-options legend{font-size:1rem;font-weight:bold;padding-top:10px}
.memory-sizes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
.memory-sizes button{border:2px solid #dacde8;background:#f5edf9;min-height:48px;border-radius:14px;font-size:.875rem;padding:4px 3px;line-height:1.15}
.memory-sizes button[aria-pressed="true"]{border-color:#7754a4;background:#e2d3ef;font-weight:bold}
.memory-options fieldset p{font-size:.875rem;line-height:1.35;margin-top:9px}
.memory-support,.memory-restart{width:100%;min-height:50px;padding:7px;border:2px solid #dacde8;border-radius:16px;background:#fffaf2;font-size:.94rem;line-height:1.2;margin-bottom:9px}
.memory-support[aria-pressed="true"]{background:#e5efd9;border-color:#607d48}
.memory-adult{background:#fffaf1f5;border:3px solid #d5c3e3;border-radius:25px;padding:24px;margin-top:24px;font-size:1rem;line-height:1.5}
.memory-adult h2{font-size:1.35rem;margin-bottom:12px}.memory-adult p+p{margin-top:12px}.memory-sources{font-size:.875rem}.memory-sources a{color:#553884;text-decoration:underline;text-underline-offset:3px}
.memory-finish{background:#fffcf0f5;border:3px solid #fff;border-radius:26px;padding:18px 20px;width:100%}
.memory-finish-mark{display:inline-grid;place-items:center;background:#e0efcc;color:#41652a;width:44px;height:44px;border:2px solid #95b975;border-radius:50%;font-size:1.8rem}
.memory-finish p{font-family:Fredoka,Arial,sans-serif;margin:8px 0 16px;font-size:1.25rem}.memory-finish>div{display:flex;flex-wrap:wrap;gap:12px;justify-content:center}
body.calm .memory-card:hover{transform:none}
body.calm.on-memory main{background-image:linear-gradient(#f1e9d53b,#f1e9d53b),url('assets/memoria/cenario.webp')}
@media(max-width:900px){.memory-layout{display:block;max-width:680px}.memory-side{padding-top:0}.memory-dentim{display:none}.memory-options{margin-top:10px}.memory-options[open]{max-width:460px;margin-left:auto;margin-right:auto}.memory-heading{margin-top:-20px}.memory-card{height:174px}}
@media(max-width:600px){
 .memory-page{padding:12px 12px 22px}.memory-nav{gap:8px}.memory-return{font-size:.94rem;padding:7px 13px}.memory-time{font-size:.875rem;padding:7px 10px}
 .memory-heading{width:82%;margin:10px auto 8px}.memory-heading img{height:98px}
 .memory-guide{gap:9px;min-height:116px;padding:9px 12px 9px 6px;border-radius:23px;margin-bottom:12px}.memory-flu{width:58px}.memory-flu img{height:65px}#memory-message h2{font-size:1.16rem}#memory-message p{font-size:1rem;line-height:1.25}
 .memory-progress{font-size:.875rem;padding:4px 12px;margin-bottom:12px}.memory-board,.memory-board[data-pairs="6"]{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 10px}.memory-board[data-pairs="4"]{grid-template-columns:repeat(2,minmax(0,1fr));max-width:420px}
 .memory-card{height:148px;border-width:3px;border-radius:21px}.memory-card-face{padding:24px 4px 7px;gap:2px}.memory-card-face img{height:75px}.memory-card-name{font-size:.94rem;min-height:36px}.memory-card-number{width:19px;height:19px;font-size:.75rem;top:5px;left:5px}.memory-card-mark{font-size:.7rem;right:3px;padding:2px 4px}.memory-card-back b{font-size:3.5rem}
 .memory-actions{margin-top:17px;min-height:62px}.memory-primary,.memory-secondary{font-size:1.06rem;min-height:52px;padding:9px 20px}.memory-gentle-note{font-size:.875rem;line-height:1.35;padding:7px 12px}
 .memory-options{border-radius:20px}.memory-options summary{font-size:1rem}.memory-adult{padding:18px}.memory-finish{padding:16px 12px}.memory-finish>div{flex-direction:column}.memory-finish button{width:100%}
 .on-memory main{background-attachment:scroll;background-size:auto 100svh;background-color:#f5dcba}
}
@media(prefers-reduced-motion:reduce){.memory-card:hover{transform:none}}
