/* Two visual themes, identical on every hidden card in a round. */
.mg-memory .mg-cards{display:flex;flex-wrap:wrap;justify-content:center;gap:10px}
.mg-memory .mg-card{flex:0 0 calc((100% - 20px)/3);aspect-ratio:0.72;min-height:0;font:inherit}
.mg-memory .mg-card>span{border-radius:13px}
/* Crop the approved two-card artwork in CSS, retaining the original artwork. */
.mg-memory .mg-card-back{padding:0;overflow:hidden;background-color:#32885e;background-image:url('images/memory-card-backs-plain.webp');background-repeat:no-repeat;background-size:244% 115%;background-position:12.6% 50%;box-shadow:0 3px 0 #23724c}
.mg-memory[data-memory-theme="nabawi"] .mg-card-back{background-position:87.5% 50%}
.mg-memory .mg-card-face{padding:10px 6px;font-size:13px;line-height:1.35;overflow-wrap:anywhere;overflow-y:auto}
.mg-memory .mg-card:hover:not(:disabled){transform:none}
html.jejak-app-phone dialog#dialog:has(.mg-memory){position:fixed;inset:0!important;width:100%!important;max-width:none!important;height:100dvh!important;max-height:100dvh!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:linear-gradient(155deg,#e8f5e9,#fff9ed);overflow-y:auto;scrollbar-gutter:auto}
html.jejak-app-phone #dialog:has(.mg-memory) #dialogBody{padding:0!important}
html.jejak-app-phone .mg-memory{max-width:520px;padding:calc(max(env(safe-area-inset-top),var(--jejak-app-inset-top,0px)) + 10px) 16px calc(max(env(safe-area-inset-bottom),var(--jejak-app-inset-bottom,0px)) + 12px);gap:10px}
html.jejak-app-phone .mg-memory .eyebrow{font-size:10px;letter-spacing:1.4px;margin:0}
html.jejak-app-phone .mg-memory h2{font-size:28px}
html.jejak-app-phone .mg-memory .mg-chapter{justify-self:center;margin:0;font-size:12px;padding:5px 12px}
html.jejak-app-phone .mg-memory .mg-clue{font-size:13px;line-height:1.4}
html.jejak-app-phone .mg-memory .mg-top{font-size:13px}
html.jejak-app-phone .mg-memory .small{margin:0;font-size:11px;line-height:1.4}
html.jejak-app-phone .mg-memory .actions button{min-height:44px}
@media(max-height:650px) and (orientation:portrait){html.jejak-app-phone .mg-memory{gap:7px}.mg-memory .mg-cards{gap:7px}.mg-memory .mg-card{flex-basis:calc((100% - 14px)/3);aspect-ratio:.76}.mg-memory .mg-card-face{font-size:12px}}
@media(orientation:landscape) and (max-height:600px){html.jejak-app-phone .mg-memory{max-width:760px}.mg-memory .mg-card{flex-basis:calc((100% - 70px)/8);aspect-ratio:.68}.mg-memory .mg-card-face{font-size:12px}}
/* This selector also overrides the shared mini-game top-padding reset. */
html.jejak-app-phone #dialog:has(.mg-memory) .mg-memory{padding-top:calc(max(env(safe-area-inset-top),var(--jejak-app-inset-top,0px)) + 10px)!important;gap:8px}
html.jejak-app-phone .mg-memory .mg-card{aspect-ratio:.76}

@media(orientation:portrait){html.jejak-app-phone .mg-memory[data-memory-count="6"] .mg-card{flex-basis:min(calc((100% - 10px)/2),128px)}}
