.memory-game{position:relative;isolation:isolate;overflow:hidden;margin:1rem auto;border:5px solid #ad771b;border-radius:24px;max-width:1050px;background:radial-gradient(ellipse at 45% 60%,#ffe864 0,#f3b522 46%,#d79410 75%,#678b89 100%);color:#3d2d1c;min-height:580px;box-shadow:0 14px 30px #5a390b33}.memory-game:after{content:'';position:absolute;z-index:-1;bottom:-70px;left:-10%;width:120%;height:210px;border-radius:50%;background:linear-gradient(160deg,#b86c10,#e6ac29 50%,#8a4c12);transform:rotate(-4deg)}.memory-content{position:relative;z-index:1;padding:1.3rem;display:grid;grid-template-columns:160px minmax(0,1fr);gap:1rem}.adventure-arcade .memory-game .memory-heading{grid-column:1/-1;display:block;text-align:center}.adventure-arcade .memory-game h5{font-family:system-ui,sans-serif;font-size:clamp(2.8rem,6vw,4.6rem);font-weight:1000;letter-spacing:.035em;margin:0;color:#f4ffff;text-shadow:0 5px 0 #5ab8c1,0 9px 9px #654a1b80;transform:rotate(-2deg);line-height:1.12}.memory-heading>p{margin:.7rem 0;font-weight:800}.memory-controls{display:flex;justify-content:center;align-items:center;gap:.8rem;flex-wrap:wrap;font-size:.85rem}.memory-game .memory-small{background:#684019;color:#fff8de;border:2px solid #9c6221;border-radius:8px;padding:.5rem .8rem}.memory-controls label{display:flex;align-items:center;gap:.3rem;font-weight:700}.memory-controls input{width:18px;height:18px}.memory-decor{position:absolute;inset:0;z-index:-1;pointer-events:none}.memory-cloud{position:absolute;width:250px;height:70px;background:#fff8d1b8;filter:blur(4px);border-radius:50%;box-shadow:60px -15px 0 0 #fff3c0aa,-55px 10px 0 -5px #fff8d1a0;animation:memory-cloud 18s ease-in-out infinite alternate}.cloud-0{top:7%;left:0}.cloud-1{top:30%;right:-40px;animation-delay:-9s}.cloud-2{bottom:16%;left:0;animation-delay:-5s}.cloud-3{top:-10px;left:45%;animation-delay:-12s}.memory-float-card{position:absolute;display:grid;place-content:center;width:100px;height:150px;border:3px solid #925309;outline:2px solid #ffe487;border-radius:15px;background:radial-gradient(ellipse at center,#a8ecdb88,#14d1e3bb);box-shadow:inset 0 0 0 4px #fff7ba88;color:#ffffdf;font-size:3rem;transform:rotate(-18deg)}.float-0{top:22%;left:-35px}.float-1{top:12%;right:-30px;transform:rotate(17deg)}.float-2{bottom:15%;left:5%;transform:rotate(12deg)}.float-3{bottom:8%;right:2%;transform:rotate(-12deg)}.memory-mascot{align-self:center;text-align:center}.memory-game .memory-monkey{display:block;background:none;border:0;padding:0;width:100%;filter:drop-shadow(0 8px 3px #66431333);cursor:pointer}.memory-monkey svg{width:100%;overflow:visible}.memory-bubble{font-weight:800;font-size:.9rem;padding:.8rem;border-radius:20px;background:#fff6d8;border:2px solid #bd8e34;box-shadow:0 4px 0 #9e650d33}.milo-body{transform-origin:100px 225px;animation:milo-bob 2.8s ease-in-out infinite}.milo-head{transform-origin:105px 115px;animation:milo-tilt 6s ease-in-out infinite}.milo-eyes{transform-origin:100px 80px;animation:milo-blink 4.5s infinite}.milo-wave{transform-origin:138px 155px;animation:milo-wave 3.4s ease-in-out infinite}.milo-tail{transform-origin:145px 165px;animation:milo-tail 2.5s ease-in-out infinite}.memory-mascot[data-mood=happy] .milo-body,.memory-mascot[data-mood=dance] .milo-body{animation:milo-dance .35s ease-in-out infinite alternate}.memory-mascot[data-mood=oops] .milo-head{animation:milo-oops .2s ease-in-out 4 alternate}.memory-play{min-width:0}.memory-scorebar{display:flex;align-items:center;justify-content:center;gap:1rem;flex-wrap:wrap;margin:0 0 .7rem;font-weight:800}.memory-timer{padding:.3rem 1.3rem;border-radius:30px;background:linear-gradient(#57d9e6,#167eb6);color:white;font:900 1.65rem ui-monospace,monospace;box-shadow:0 3px 0 #245d72;border:2px solid #205879}.memory-time-low{background:linear-gradient(#ef9065,#b63835);border-color:#873a22}.memory-board{display:grid;grid-template-columns:repeat(var(--memory-columns),minmax(0,1fr));gap:9px;padding:14px;border-radius:18px;background:#463b27a6;box-shadow:inset 0 3px 15px #3c2b1733}.memory-game .memory-tile{border:2px solid #e2b976;min-width:0;min-height:86px;aspect-ratio:1.22;background:linear-gradient(158deg,#fff3e4 0 48%,#fbe6cb 49% 100%);border-radius:13px;box-shadow:0 5px 0 #6b451e66;padding:.6rem;color:#543615;transition:transform .2s,background .2s;display:flex;flex-direction:column;justify-content:center;align-items:center;word-break:normal;overflow-wrap:anywhere;font-size:clamp(.7rem,1.4vw,1rem);line-height:1.18}.memory-tile .memory-back-mark{font-size:2rem;color:#c79c60;opacity:.45}.memory-game .memory-tile:not(:disabled):hover{transform:translateY(-3px) rotate(-1deg);background:#fff9ed}.memory-game .memory-tile.is-open{background:linear-gradient(145deg,#ebffff,#92dfe1);border-color:#318a9a;color:#18394b}.memory-game .memory-tile.is-matched{background:linear-gradient(145deg,#edffd8,#a8df94);border-color:#548f41;color:#25482d;opacity:1}.memory-tile small{font-size:.55rem;letter-spacing:.08em;font-weight:900;opacity:.8;margin-bottom:.3rem}.memory-tile>span:last-child{max-width:100%}.memory-status{font-weight:800}.memory-start{margin:1.2rem auto;max-width:420px;background:#fff1c6d9;border:3px solid #d79b24;border-radius:18px;padding:1.6rem;text-align:center;box-shadow:0 10px 0 #77501933}.memory-game h6{font-size:1.35rem;margin:.3rem 0 .8rem}.memory-start label{display:block;font-weight:800}.memory-start select{display:block;width:100%;padding:.8rem;margin:.6rem 0;background:#794b1c;color:#fff;border:3px solid #ba7d29;font-size:1.3rem;font-weight:900}.memory-game .memory-start-button{display:inline-block;background:linear-gradient(#9d6528,#66401c);border:3px solid #c68a2b;color:#fff8dc;box-shadow:0 4px 0 #674017;padding:.7rem 1.2rem;font-weight:900;font-size:1.1rem;margin:.4rem}.memory-end{background:#fff2ccf2;border:3px solid #d5a035;border-radius:16px;padding:1rem;margin:.8rem 0;text-align:center}.memory-setup .memory-content{grid-template-columns:240px minmax(0,1fr);min-height:570px}.memory-setup .memory-mascot{align-self:end;padding-bottom:1rem}.memory-setup .memory-monkey{max-width:240px;margin:auto}.memory-setup .memory-play{align-self:center}.memory-calm *, .memory-calm *:before{animation:none!important;transition:none!important}@keyframes milo-blink{0%,43%,47%,100%{transform:scaleY(1)}45%{transform:scaleY(.05)}}@keyframes milo-bob{50%{transform:translateY(-5px) rotate(2deg)}}@keyframes milo-tilt{40%,60%{transform:rotate(-6deg)}50%{transform:rotate(5deg)}}@keyframes milo-wave{40%,70%{transform:rotate(-16deg)}55%{transform:rotate(9deg)}}@keyframes milo-tail{50%{transform:rotate(10deg)}}@keyframes milo-dance{to{transform:translateY(-17px) rotate(-10deg)}}@keyframes milo-oops{to{transform:rotate(12deg)}}@keyframes memory-cloud{to{transform:translateX(45px)}}@media(max-width:650px){.memory-content,.memory-setup .memory-content{grid-template-columns:minmax(0,1fr);padding:.7rem}.memory-mascot{display:flex;align-items:center;justify-content:center;gap:.6rem;grid-row:3}.memory-monkey{max-width:90px}.memory-bubble{max-width:210px}.memory-board{gap:5px;padding:7px}.memory-game .memory-tile{min-height:73px;padding:.25rem;font-size:.7rem}.memory-tile small{font-size:.45rem}.memory-setup .memory-mascot{padding:0}.memory-setup .memory-monkey{max-width:120px}.memory-setup .memory-content{min-height:0}.memory-game{min-height:0}.memory-start{padding:1rem}}@media(prefers-reduced-motion:reduce){.memory-game *{animation:none!important;transition:none!important}}

.memory-game{overflow:clip}.memory-board{height:clamp(350px,55vh,510px);grid-template-rows:repeat(var(--memory-rows),minmax(0,1fr))}.memory-game .memory-tile{min-height:0;aspect-ratio:auto}.memory-scorebar{position:sticky;top:8px;z-index:5;border-radius:14px;background:#ffedbce8;padding:.5rem}.memory-game .memory-tile.is-open>span{font-size:clamp(.68rem,1.2vw,.95rem)}
