/* Zählwiese: textured, storybook hand-painted memory cards */
#app .memory100-page.main-content{box-sizing:border-box!important;position:relative!important;display:flex!important;flex-direction:column!important;align-items:center!important;gap:10px!important;overflow:auto!important;min-height:0!important;background:#f5edda!important;padding:14px clamp(9px,3vw,18px) max(14px,env(safe-area-inset-bottom,0px))!important}
.memory100-page h1{font:900 clamp(25px,7vw,37px)/1.1 "Chalkboard SE","Marker Felt",sans-serif!important;color:#8a6e59!important;margin:0!important}
.memory100-chooser{width:min(100%,420px);display:flex;align-items:center;justify-content:center;gap:clamp(13px,4vw,24px);margin-top:clamp(20px,6vh,55px)}
.memory100-chooser>button{display:flex;flex-direction:column;align-items:center;gap:10px;width:min(43%,170px);border:0!important;background:transparent!important;padding:4px!important;color:#8a6e59;font:900 20px "Chalkboard SE","Marker Felt",sans-serif}
.memory100-choice-ring{display:grid;place-items:center;width:clamp(117px,35vw,160px);height:clamp(117px,35vw,160px);max-width:100%;aspect-ratio:1;border:6px solid #c5a382;border-radius:50%;background:radial-gradient(circle,#fff4d9,#e7d0a7);box-shadow:inset 0 0 0 4px #fff9e9,0 5px #cdbb9e;overflow:hidden}
.memory100-choice-ring img{width:90%;height:93%;object-fit:contain}
.memory100-choice-digits{display:flex;justify-content:center;gap:6px;align-items:center;color:#a983bd;font:900 64px "Chalkboard SE","Marker Felt",sans-serif}
.memory100-choice-digits b:last-child{color:#82af8f;transform:translateY(10px) rotate(5deg)}
.memory100-greeting{display:flex;gap:24px;margin-top:30px}
.memory100-greeting span{width:68px;height:90px;border-radius:12px;border:5px solid #c6ab8b;background:repeating-linear-gradient(-25deg,#e8c9ac 0 6px,#f3dcc0 6px 14px);box-shadow:0 4px #ad957d}
.memory100-header{width:min(100%,430px);display:flex;align-items:center;justify-content:space-between;gap:14px;flex:0 0 auto}
.memory100-level{display:flex;align-items:center;gap:4px;min-width:70px;height:48px;border-radius:24px;border:2px dashed #c5ad8c;background:#fff4d5;padding:3px 8px;color:#94775c;font:900 18px "Chalkboard SE","Marker Felt",sans-serif}
.memory100-level img{height:43px;width:43px;object-fit:contain}.memory100-level b{font-size:28px;color:#8ea785}
.memory100-grid{width:min(100%,430px);display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:auto;gap:clamp(6px,1.8vw,10px);align-items:start;justify-items:stretch;flex:0 0 auto;perspective:1000px}
.memory100-numbers .memory100-grid:has(.memory100-card:nth-child(-n+4):last-child){grid-template-columns:repeat(2,minmax(0,1fr));width:min(100%,250px)}
.memory100-numbers .memory100-grid:has(.memory100-card:nth-child(6):last-child){grid-template-columns:repeat(3,minmax(0,1fr));width:min(100%,315px)}
.memory100-card{display:block!important;aspect-ratio:4/5.1;width:100%;height:auto!important;padding:0!important;margin:0!important;border:0!important;border-radius:12px!important;background:transparent!important;box-shadow:none!important;cursor:pointer;touch-action:manipulation!important;-webkit-tap-highlight-color:transparent;perspective:800px}
.memory100-inner{display:block;position:relative;width:100%;height:100%;transform-style:preserve-3d;transition:transform .53s cubic-bezier(.23,.75,.33,1.08);will-change:transform}
.memory100-card.is-flipped .memory100-inner,.memory100-card.is-matched .memory100-inner{transform:rotateY(180deg)}
.memory100-back,.memory100-front{position:absolute;inset:0;display:grid;place-items:center;box-sizing:border-box;border:4px solid #c69d7a;border-radius:13px;overflow:hidden;backface-visibility:hidden;-webkit-backface-visibility:hidden;box-shadow:inset 0 0 0 3px #fbedcf,1px 3px 0 #b5a18a8a}
.memory100-back{background:repeating-linear-gradient(8deg,#eed6b5 0 12px,#e9cfb0 12px 15px,#f3ddc0 15px 25px)}
.memory100-back svg{width:78%;height:75%;filter:drop-shadow(1px 1px 1px #90705044)}
.memory100-front{transform:rotateY(180deg);background:radial-gradient(ellipse at 40% 28%,#fffaf0,#f3e6cb);border-color:#8db399}
.memory100-front img{width:93%;height:94%;object-fit:contain;pointer-events:none}
.memory100-number,.memory100-front>b{font:900 clamp(33px,10vw,63px)/1 "Chalkboard SE","Marker Felt",sans-serif;color:#997dc0;text-shadow:2px 3px #f1e8cf;transform:rotate(-4deg)}
.memory100-card:nth-child(3n+2) .memory100-front>b{color:#85a98a;transform:rotate(5deg)}
.memory100-card:nth-child(3n+3) .memory100-front>b{color:#bd9977;transform:rotate(-2deg)}
.memory100-card.is-matched .memory100-front{border-color:#80b58d;background:#e6efd6}
.memory100-card.is-matched{animation:memory100-joy .55s ease-out}
.memory100-card:focus-visible{outline:4px solid #baa5dc;outline-offset:3px}
.memory100-controls{flex:0 0 auto;display:flex;gap:25px;justify-content:center;margin-top:4px}
.memory100-controls button{width:54px;height:54px;padding:0;border:4px solid #b99578;border-radius:50%;background:#f5e0c0;color:#8c6b53;box-shadow:0 3px #c4ac8e;font:900 30px "Chalkboard SE",sans-serif}
.memory100-controls button:last-child{background:#dcebcf;border-color:#a5bd94;color:#638b78}
.memory100-fx{position:absolute;inset:0;z-index:30;pointer-events:none;overflow:hidden}
.memory100-confetti{position:absolute;width:11px;height:11px;border-radius:2px;animation:memory100-pop 1.2s cubic-bezier(.16,.8,.4,1) forwards}
.memory100-won{animation:memory100-win 1s ease-in-out infinite alternate}
@keyframes memory100-pop{0%{opacity:0;transform:scale(.3)}15%{opacity:1}85%{opacity:1}100%{opacity:0;transform:translate(var(--mx),var(--my)) rotate(170deg) scale(.65)}}
@keyframes memory100-joy{50%{filter:brightness(1.1);transform:scale(1.03)}}
@keyframes memory100-win{to{filter:drop-shadow(0 0 10px #e4d49b)}}
@media(orientation:portrait) and (max-height:740px){#app .memory100-page.main-content{gap:5px!important;padding-top:4px!important}.memory100-grid{width:min(100%,340px)}.memory100-game .memory100-card{max-height:77px}.memory100-animals .memory100-grid{width:min(100%,330px)}}
@media(orientation:landscape) and (max-height:550px){#app .memory100-page.main-content{display:grid!important;grid-template-columns:minmax(140px,30%) minmax(0,1fr)!important;grid-template-rows:auto 1fr auto!important;gap:5px 14px!important;align-items:center}.memory100-header{grid-area:1/1}.memory100-grid{grid-area:1/2/4/3;grid-template-columns:repeat(5,minmax(0,1fr))!important;width:min(100%,520px)}.memory100-card{aspect-ratio:1.0!important;max-height:60px}.memory100-controls{grid-area:3/1}.memory100-chooser{grid-column:1/3;margin:0}.memory100-greeting{display:none}}
@media(prefers-reduced-motion:reduce){.memory100-inner{transition:none!important}.memory100-card,.memory100-won,.memory100-confetti{animation-duration:.01ms!important;animation-iteration-count:1!important}}

/* Make restarting perceptible even at level 1 (two visually identical card backs). */
.memory100-grid.memory100-restarted .memory100-card{animation:memory100-deal .62s cubic-bezier(.2,.9,.28,1.14) both;transform-origin:center 80%}
.memory100-grid.memory100-restarted .memory100-card:nth-child(2n){animation-delay:.07s}
@keyframes memory100-deal{0%{opacity:.35;transform:translateY(-12px) scale(.9) rotate(-3deg)}65%{opacity:1;transform:translateY(2px) scale(1.025)}100%{opacity:1;transform:translateY(0) scale(1) rotate(0)}}
