/* Memosa memory games. Uses the site's Garden variables, so it follows light and dark. */
.mg{max-width:640px;margin:0 auto;background:var(--surface);color:var(--ink);border-radius:var(--r-lg);padding:22px 18px;border:1px solid var(--card-line);box-shadow:var(--shadow);font:400 1rem/1.5 var(--font);text-align:center;min-height:360px;display:flex;flex-direction:column;justify-content:center}
.mg *{box-sizing:border-box}
.mg-body{display:flex;flex-direction:column;align-items:center;gap:14px;outline:none;width:100%}
.mg-say{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.mg h3{font:600 clamp(1.3rem,4vw,1.6rem)/1.2 var(--font-display);margin:0;color:var(--ink)}
.mg-result{font-size:clamp(1.5rem,5vw,1.9rem)!important}
.mg-kicker{margin:0;font-size:.8rem;letter-spacing:.1em;text-transform:uppercase;font-weight:700;color:var(--ink-soft)}
.mg-note{margin:0;color:var(--ink-soft);font-size:1rem;max-width:34em}
.mg-status{margin:0;font-weight:700;color:var(--ink)}
.mg-word{margin:0;font:600 1.6rem/1.2 var(--font-display)}
.mg-big{font-size:6rem;line-height:1.1}
.mg-em{font-size:1.9rem;line-height:1}

.mg button{font:inherit;color:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
.mg button:focus-visible{outline:3px solid var(--flower);outline-offset:3px}
.mg-btn{min-height:52px;min-width:120px;padding:12px 28px;border:0;border-radius:var(--r-pill);background:var(--accent);color:var(--accent-ink)!important;font-weight:700!important}
.mg-btn:hover{filter:brightness(1.06)}
.mg-soft{background:var(--accent-soft);color:var(--ink)!important;border:2px solid transparent}
.mg-soft:hover{border-color:var(--accent)}
.mg-ghost{background:transparent;color:var(--ink-soft)!important;text-decoration:underline;text-underline-offset:3px;font-weight:500!important}
.mg-row{display:flex;flex-wrap:wrap;gap:12px;justify-content:center}
.mg-choices{display:grid;gap:10px;width:100%;max-width:420px}
.mg-choices .mg-btn{width:100%;font-size:1.15rem}

.mg-bar{display:flex;gap:5px;width:100%;max-width:300px}
.mg-bar i{flex:1;height:6px;border-radius:3px;background:var(--surface-2)}
.mg-bar i.on{background:var(--accent)}
.mg-time{width:100%;max-width:300px;height:6px;border-radius:3px;background:var(--surface-2);overflow:hidden}
.mg-time i{display:block;height:100%;width:100%;background:var(--accent)}

/* matching pairs */
.mg-board{display:grid;grid-template-columns:repeat(var(--cols),1fr);gap:8px;width:100%;max-width:440px}
.mg-card{aspect-ratio:1;min-height:48px;border-radius:var(--r-md);border:2px solid var(--tile-line);background:var(--accent);box-shadow:var(--shadow-tile);display:grid;place-items:center;padding:0;font-size:clamp(1.5rem,7vw,2.2rem)!important}
.mg-card.mg-up{background:var(--surface-2);border-color:var(--accent)}
.mg-card.mg-got{background:var(--good-soft);border-color:var(--good)}

/* odd one out */
.mg-odd{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;width:100%;max-width:330px;padding:4px;border-radius:var(--r-md)}
.mg-tile{aspect-ratio:1;min-height:72px;border-radius:var(--r-md);border:2px solid var(--tile-line);background:var(--surface-2);font-size:2.2rem!important;display:grid;place-items:center;padding:0}
.mg-shake{background:var(--bad-soft)}

/* shopping list */
.mg-shelf{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;width:100%}
@media (min-width:480px){.mg-shelf{grid-template-columns:repeat(3,1fr)}}
.mg-opt{min-height:72px;border-radius:var(--r-md);border:2px solid var(--tile-line);background:var(--surface-2);padding:8px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-weight:600!important}
.mg-opt.mg-pick{background:var(--pick);border-color:var(--accent)}
.mg-opt.mg-pick::after{content:"\2713";color:var(--good-ink);font-size:.85rem}
.mg-ticks{list-style:none;margin:0;padding:0;display:grid;gap:8px;width:100%;max-width:380px;text-align:left}
.mg-ticks li{border-radius:var(--r-sm);padding:10px 14px;display:flex;justify-content:space-between;gap:10px}
.mg-ticks b{font-weight:600;white-space:nowrap}
.mg-ok{background:var(--good-soft);color:var(--good-ink)}
.mg-miss{background:var(--bad-soft);color:var(--bad-ink)}

/* numbers */
.mg-number{font:600 clamp(2.4rem,11vw,3.6rem)/1.2 var(--font-display);letter-spacing:.12em;min-height:1.2em;word-break:break-all}
.mg-entry{background:var(--surface-2);border-radius:var(--r-md);padding:6px 18px;min-width:60%}
.mg-pad{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;width:100%;max-width:300px}
.mg-key{min-height:56px;border-radius:var(--r-md);border:2px solid var(--tile-line);background:var(--surface-2);font:600 1.5rem var(--font)!important;padding:0}
.mg-key:hover{border-color:var(--accent)}
.mg-key.mg-go{background:var(--accent);color:var(--accent-ink)}

/* word pairs */
.mg-pair{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px 14px;margin:6px 0;font:600 clamp(1.7rem,8vw,2.4rem)/1.2 var(--font-display)}
.mg-pair em{font-style:normal;color:var(--accent)}

/* faces */
.mg-face{display:block;width:100%;max-width:170px;height:auto;aspect-ratio:1;border-radius:var(--r-md);background:var(--surface-2)}
.mg-lineup{display:grid;grid-template-columns:1fr 1fr;gap:12px;width:100%;max-width:380px}
@media (min-width:520px){.mg-lineup{grid-template-columns:repeat(4,1fr);max-width:600px}}
.mg-who{padding:6px;border-radius:var(--r-md);border:3px solid transparent;background:var(--surface-2);min-height:48px}
.mg-who:hover{border-color:var(--accent)}
.mg-seenrow{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;width:100%;max-width:420px}
.mg-seen{margin:0;padding:6px;border-radius:var(--r-sm);font-size:.8rem;gap:4px}
.mg-seen figcaption{font-weight:600}

@media (prefers-reduced-motion:reduce){.mg *{transition:none!important;animation:none!important}}
