/* Zählwiese Memory V221 – hand-drawn art, responsive play-surface proportions, touch polish. */
#app .memory218-select .memory218-choice img{
 filter:drop-shadow(0 3px 3px #6a482c61)!important;
 transform:translateZ(0)!important;
 transition:transform .18s cubic-bezier(.19,.8,.25,1.14),filter .18s ease!important;
}
#app .memory218-select .memory218-choice:active img{
 transform:translateY(2px) scale(.93)!important;
 filter:drop-shadow(0 1px 2px #6a482c50) brightness(1.04)!important;
}
@media(hover:hover) and (pointer:fine){
 #app .memory218-select .memory218-choice:hover img{
   transform:translateY(-3px) scale(1.025)!important;
   filter:drop-shadow(0 5px 3px #6a482c65)!important;
 }
}
#app .memory127-page.memory127-game .memory127-card.is-matched .memory127-front{
 filter:saturate(1.04)!important;
}
#app .memory127-page.memory127-game .memory127-card:focus-visible{
 outline:3px solid #ffda79!important;outline-offset:2px!important;
}
/* Desktop has a portrait-width 430px game surface inside a wide browser.
   Match the CSS layout to that surface, not window orientation. */
@media(orientation:landscape) and (min-height:540px){
 #app .memory127-page.memory127-game.main-content{
  display:flex!important;flex-direction:column!important;
  grid-template-columns:none!important;grid-template-rows:none!important;
  align-items:center!important;justify-content:flex-start!important;
  gap:6px!important;
  padding:8px 10px 14px!important;
  background:#9bd2b5 url('/home-v126/background-portrait.webp') center/100% 100% no-repeat!important;
 }
 #app .memory127-page.memory127-game .memory127-header{
  grid-area:auto!important;flex-direction:row!important;
  width:100%!important;height:64px!important;
  max-width:none!important;min-height:54px!important;
  justify-content:space-between!important;gap:8px!important;
 }
 #app .memory127-page.memory127-game .memory127-header .memory127-title{
  min-width:0!important;max-width:62%!important;
  font-size:clamp(19px,4.6vw,25px)!important;
  min-height:44px!important;
 }
 #app .memory127-page.memory127-game .memory214-progress{
  position:relative!important;left:auto!important;bottom:auto!important;
  top:auto!important;right:auto!important;transform:none!important;
  width:130px!important;height:50px!important;
  grid-area:auto!important;flex:0 0 auto!important;
 }
 #app .memory127-page.memory127-game .memory127-grid{
  grid-area:auto!important;align-self:center!important;
  margin:0 auto!important;display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  grid-template-rows:repeat(5,minmax(0,1fr))!important;
  width:min(94%,390px)!important;
  height:min(75%,580px)!important;
  max-height:calc(100% - 140px)!important;
  padding:4px!important;gap:7px!important;
  min-height:0!important;flex:0 1 auto!important;
  justify-content:stretch!important;align-content:center!important;
 }
 #app .memory127-page.memory127-game .memory127-grid:has(>.memory127-card:nth-child(18):last-child),
 #app .memory127-page.memory127-game .memory127-grid:has(>.memory127-card:nth-child(20):last-child){
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  grid-template-rows:repeat(5,minmax(0,1fr))!important;
  width:min(94%,390px)!important;height:min(75%,580px)!important;
 }
 #app .memory127-page.memory127-game .memory127-grid:has(>.memory127-card:nth-child(14):last-child),
 #app .memory127-page.memory127-game .memory127-grid:has(>.memory127-card:nth-child(16):last-child){
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  grid-template-rows:repeat(4,minmax(0,1fr))!important;
  width:min(94%,390px)!important;height:min(69%,540px)!important;
 }
 #app .memory127-page.memory127-game .memory127-grid:has(>.memory127-card:nth-child(10):last-child),
 #app .memory127-page.memory127-game .memory127-grid:has(>.memory127-card:nth-child(12):last-child){
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  grid-template-rows:repeat(3,minmax(0,1fr))!important;
  width:min(90%,380px)!important;height:min(60%,410px)!important;
 }
 #app .memory127-page.memory127-game .memory127-grid:has(>.memory127-card:nth-child(8):last-child){
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  grid-template-rows:repeat(2,minmax(0,1fr))!important;
  width:min(90%,370px)!important;height:min(49%,312px)!important;
 }
 #app .memory127-page.memory127-game .memory127-grid:has(>.memory127-card:nth-child(6):last-child){
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-template-rows:repeat(2,minmax(0,1fr))!important;
  width:min(82%,336px)!important;height:min(49%,310px)!important;
 }
 #app .memory127-page.memory127-game .memory127-grid:has(>.memory127-card:nth-child(4):last-child){
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  grid-template-rows:repeat(2,minmax(0,1fr))!important;
  width:min(70%,284px)!important;height:min(49%,330px)!important;
 }
 #app .memory127-page.memory127-game .memory127-grid:has(>.memory127-card:nth-child(2):last-child){
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  grid-template-rows:1fr!important;
  width:min(77%,286px)!important;height:min(33%,215px)!important;
  max-height:33%!important;flex:0 0 auto!important;
 }
 #app .memory127-page.memory127-game .memory127-controls{
  grid-area:auto!important;flex:0 0 auto!important;
  align-self:center!important;justify-content:center!important;
  margin:0!important;padding:0!important;
 }
 #app:has(.memory127-game) #homeBtn{
  position:absolute!important;top:6px!important;right:8px!important;
  left:auto!important;z-index:60!important;
 }
}
/* Lightweight animations still honor accessibility preferences. */
@media(prefers-reduced-motion:reduce){
 #app .memory218-select .memory218-choice img{transition:none!important}
}
