/* Memory game only: the dessert shop is a real interactive 4x4 board. */
#fg-stage.memory-shop {
  --memory-ink:#71352d;
  min-height:calc(100dvh - var(--classroom-play-height,72px));
  padding:8px 16px 22px;
  color:var(--memory-ink);
  background:#f7c9c7 url("../memory-patisserie/background.0b370c63ac4d.webp") center top / cover no-repeat;
}
#fg-stage.memory-shop .memory-layout {
  display:grid;
  grid-template-columns:minmax(240px, .25fr) minmax(0, .75fr);
  align-items:center;
  gap:clamp(8px,1.5vw,22px);
  max-width:1600px;
  margin:0 auto;
}
#fg-stage.memory-shop .memory-sidebar {display:flex;flex-direction:column;align-items:stretch;align-self:stretch;justify-content:space-between;gap:clamp(6px,1.2vh,14px);min-width:0;}
#fg-stage.memory-shop .memory-heading {width:100%;aspect-ratio:3 / 1;display:grid;place-items:center;padding:0;background:url("../memory-patisserie/title.6680ffb71c9d.webp") center / contain no-repeat;}
#fg-stage.memory-shop .memory-heading h1 {position:relative;top:10%;margin:0;color:#71352d;font-size:clamp(25px,3.1vw,52px);font-weight:900;line-height:1.15;white-space:nowrap;text-align:center;text-shadow:0 2px #fff4dc;}
#fg-stage.memory-shop .memory-current-turn {position:relative;z-index:1;align-self:center;width:80%;min-height:54px;display:grid;place-items:center;margin:0 0 -4%;padding:8px 18px 8px 8px;color:#fff;font-size:clamp(15px,1.4vw,23px);font-weight:900;line-height:1.2;text-align:center;word-break:keep-all;background:#d83938 url("../memory-patisserie/turn.17c0d50c7724.webp") center / 100% 100% no-repeat;border-radius:24px;text-shadow:0 1px 2px #7d1818;}
#fg-stage.memory-shop:has(#fg-turn-top.active) .memory-current-turn {filter:hue-rotate(205deg);}
#fg-stage.memory-shop .memory-player {position:relative;display:grid;place-items:center;width:100%;min-height:86px;aspect-ratio:3 / 1;padding:8px 8% 8px 19%;border:0;border-radius:22px;background:#fff5e7 center / contain no-repeat;box-shadow:none;color:#963d36;}
#fg-stage.memory-shop .memory-player--red {background-image:url("../memory-patisserie/score-red.301a9ce88010.webp");}
#fg-stage.memory-shop .memory-player--blue {background-image:url("../memory-patisserie/score-blue.a8656e4ee06a.webp");color:#325c96;}
#fg-stage.memory-shop .memory-player > .fg-turn-dot {display:none;}
#fg-stage.memory-shop.memory-art-ready :is(.memory-player,.memory-restart,.memory-current-turn) {background-color:transparent;}
#fg-stage.memory-shop .memory-player.active {filter:drop-shadow(0 3px 3px #a73e3b55);}
#fg-stage.memory-shop .memory-player small {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);}
#fg-stage.memory-shop .memory-player .fg-score-chip {margin:0;padding:0;background:none;color:inherit;font-size:clamp(21px,2.3vw,38px);font-weight:900;line-height:1.1;white-space:nowrap;}
#fg-stage.memory-shop .memory-player .fg-score-chip strong {font-weight:900;}
#fg-stage.memory-shop .memory-restart {position:relative;align-self:center;width:72%;min-height:52px;aspect-ratio:2 / 1;border:0;border-radius:20px;background:#467960;color:#fff;font-size:clamp(18px,2.1vw,30px);font-weight:900;text-shadow:0 2px 2px #285039;cursor:pointer;}
#fg-stage.memory-shop .memory-restart img {position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none;}
#fg-stage.memory-shop .memory-restart img[hidden] {display:none;}
#fg-stage.memory-shop .memory-restart span {position:relative;z-index:1;}
html[data-classroom-playing] #fg-stage.memory-shop #fg-reset[data-play-native-control] {display:block!important;}
html[data-classroom-game="memory"] #classroom-play-toolbar [data-play-action="reset"] {display:none;}
#fg-stage.memory-shop .memory-more {width:100%;margin-top:0;}
#fg-stage.memory-shop .memory-more summary {width:min(100%,140px);min-height:44px;margin:0 auto;background:#fff8eee8;color:#75443c;}
#fg-stage.memory-shop .memory-board-shell {width:min(100%,calc(100dvh - var(--classroom-play-height,72px) - 22px),900px);aspect-ratio:1;justify-self:start;display:grid;place-items:center;padding:8.4%;background:url("../memory-patisserie/board.3e8d37b375ec.webp") center / 100% 100% no-repeat;}
#fg-stage.memory-shop #fg-board {--fg-cell-size:1fr!important;--fg-gap:clamp(3px,.6vw,8px);width:100%;height:100%;max-width:none;display:grid;grid-auto-rows:minmax(0,1fr);gap:var(--fg-gap);padding:0;margin:0;background:transparent;border:0;border-radius:0;}
#fg-stage.memory-shop .fg-memory-cell,#fg-stage.memory-shop .fg-memory-cell.dark {width:100%;height:100%;min-width:0;aspect-ratio:1;padding:0;background:transparent;border:0;border-radius:14%;}
#fg-stage.memory-shop .fg-memory-cell .fg-memory-card {position:relative;display:grid;place-items:center;width:100%;height:100%;margin:0;border-radius:14%;background:#e992a4 url("../memory-patisserie/card-back.c2065fc292f9.webp") center / 112% 112% no-repeat;color:#fff;box-shadow:none;font-size:clamp(24px,4vw,58px);}
#fg-stage.memory-shop.memory-art-ready .fg-memory-cell:not(.is-open):not(.is-matched) .fg-memory-card {background-color:transparent;}
#fg-stage.memory-shop.memory-art-ready .memory-back-fallback {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);}
#fg-stage.memory-shop .fg-memory-cell:is(.is-open,.is-matched) .fg-memory-card {background:#fff5e4;border:2px solid #f2dec0;box-shadow:0 3px 0 #b0a08f;}
#fg-stage.memory-shop .fg-memory-cell .fg-memory-card img {display:block;width:90%;height:90%;object-fit:contain;}
#fg-stage.memory-shop .fg-memory-cell .fg-memory-card img[hidden],#fg-stage.memory-shop .memory-art-fallback[hidden] {display:none;}
#fg-stage.memory-shop .memory-art-fallback {font-size:clamp(30px,5vw,70px);}
#fg-stage.memory-shop .fg-memory-cell.is-matched .fg-memory-card {transform:none;animation:memory-match .35s ease-out both;}
#fg-stage.memory-shop :is(.fg-memory-cell,.memory-restart):focus-visible {outline:4px solid #254f81;outline-offset:3px;z-index:2;}
#fg-stage.memory-shop .fg-memory-cell:hover {filter:brightness(1.04);}
#fg-stage.memory-shop .fg-memory-cell:active {transform:scale(.96);}
@keyframes memory-match {0%{transform:scale(.90)} 70%{transform:scale(1.04)} 100%{transform:scale(1)}}
html[data-classroom-game="memory"] :is(#fg-result-modal,#fg-reset-confirm) .fg-modal {background:#fff5e9;border:5px solid #efb6bd;border-radius:28px;color:#71352d;}
html[data-classroom-game="memory"] #fg-result-restart {min-height:54px;background:#467960 url("../memory-patisserie/reset.be99b44fa71e.webp") center / 100% 100% no-repeat;color:#fff;border:0;text-shadow:0 2px 2px #285039;}
@media(max-width:900px){
 #fg-stage.memory-shop {padding:8px 8px 20px;}
 #fg-stage.memory-shop .memory-layout {grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:'heading heading' 'status status' 'red blue' 'board board' 'reset more';align-items:center;gap:6px;}
 #fg-stage.memory-shop .memory-sidebar {display:contents;}
 #fg-stage.memory-shop .memory-heading {grid-area:heading;justify-self:center;width:min(100%,350px);min-width:0;}
 #fg-stage.memory-shop .memory-heading h1 {font-size:clamp(27px,7vw,36px);}
 #fg-stage.memory-shop .memory-current-turn {grid-area:status;width:min(74%,280px);min-height:44px;margin:0;padding:5px 16px 5px 5px;font-size:15px;justify-self:center;}
 #fg-stage.memory-shop .memory-player--red {grid-area:red;}
 #fg-stage.memory-shop .memory-player--blue {grid-area:blue;}
 #fg-stage.memory-shop .memory-player {min-width:0;min-height:58px;padding-left:19%;}
 #fg-stage.memory-shop .memory-player .fg-score-chip {font-size:clamp(18px,5vw,24px);}
 #fg-stage.memory-shop .memory-player small {font-size:10px;}
 #fg-stage.memory-shop .memory-board-shell {grid-area:board;width:min(100%,600px);min-width:0;justify-self:center;padding:8.4%;}
 #fg-stage.memory-shop .memory-restart {grid-area:reset;width:min(100%,190px);justify-self:center;font-size:19px;}
 #fg-stage.memory-shop .memory-more {grid-area:more;align-self:center;}
}
@media(prefers-reduced-motion:reduce){#fg-stage.memory-shop :is(.fg-cell,.fg-memory-card) {animation:none!important;transition:none!important;}}
