
/* Same team-board and flipping-card system as Unit 3, with pictures on both halves. */
.ie2-u4-memory .mm-shell{width:calc(100% - clamp(24px,4vw,72px));max-width:none;margin:0 auto;padding:2rem 0 4rem}
.mm-settings{display:flex;flex-wrap:wrap;gap:1rem;align-items:end;padding:1rem;background:white;border:1px solid var(--ie2-line);border-radius:16px;margin:1rem 0}
.mm-settings label{display:grid;gap:.4rem;flex:1;min-width:180px;font-weight:750}
.mm-settings select{font:inherit;padding:.7rem;min-height:44px;max-width:100%;border:1px solid var(--ie2-line);border-radius:8px;background:white}
.mm-round{display:flex;justify-content:space-between;gap:1rem;flex-wrap:wrap;font-weight:750;padding:.7rem}
.ie2-u4-memory .tg-board{grid-template-columns:repeat(6,minmax(0,1fr));padding:1.2rem;margin:1rem 0;background:#0e2e50;border-radius:20px;gap:1rem}
.ie2-u4-memory .tg-card{width:100%;min-width:0;height:clamp(150px,15vw,240px);aspect-ratio:auto;min-height:0}
.ie2-u4-memory .tg-front{display:block}
.mm-art{display:block;width:100%;height:100%;background:#e8eef5}
.mm-art svg{width:100%;height:100%;display:block;overflow:hidden}
.ie2-u4-memory .tg-card-label{font-size:clamp(.85rem,1.2vw,1.1rem);padding:.35rem .4rem;border-radius:7px;background:#092447e8;bottom:.35rem;line-height:1.2}
.ie2-u4-memory .tg-card-visual::after{display:none}
.ie2-u4-memory .tg-card.matched{box-shadow:0 0 0 3px #d9a441;cursor:pointer}
.ie2-u4-memory .tg-card.matched .tg-card-label::before{content:'✓ '}
.ie2-u4-memory .tg-team[data-team="1"] .tg-score{background:var(--tg-teal)}
.ie2-u4-memory .tg-team[data-team="0"].active{border-color:var(--tg-blue)}
.ie2-u4-memory .tg-team[data-team="1"].active{border-color:var(--tg-teal)}
.mm-history{margin-top:1rem}.mm-history li{padding:.4rem;line-height:1.5}
.mm-listen{font:inherit;line-height:1.4;color:var(--ie2-navy);background:transparent;border:0;border-bottom:2px dotted var(--ie2-teal);cursor:pointer;min-height:44px;padding:.2rem;max-width:100%;text-align:left}
.mm-listen span{font-size:.75em;color:var(--ie2-teal)}
.mm-listen[aria-pressed=true]{background:#dcefe8}
.mm-gate{width:min(1120px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;text-align:left}
.mm-gate[open]{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem}
.mm-gate-image{min-height:320px;align-self:stretch;display:grid;align-items:center;background:#edf2f7;border-radius:14px;overflow:hidden}
.mm-gate-image .mm-art{height:100%;min-height:300px}
.mm-gate h2{font-size:clamp(1.8rem,3vw,3rem);margin:.6rem 0}
.mm-gate p{font-size:1.1rem;line-height:1.55}
.ie2-u4-memory :focus-visible{outline:3px solid #d9a441;outline-offset:4px}
@media(min-width:1700px){.ie2-u4-memory .tg-board{grid-template-columns:repeat(8,minmax(0,1fr))}}
@media(max-width:1100px){.ie2-u4-memory .tg-board{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:700px){
.ie2-u4-memory .tg-board{grid-template-columns:repeat(3,minmax(0,1fr));gap:.55rem;padding:.6rem}
.ie2-u4-memory .tg-card{height:140px;min-height:0;aspect-ratio:auto}
.ie2-u4-memory .tg-card-label{font-size:.75rem;padding:.2rem;left:.15rem;right:.15rem}
.mm-settings label{min-width:100%}.mm-settings button{width:100%}
.ie2-u4-memory .tg-toolbar{grid-template-columns:1fr 1fr;gap:.5rem}
.ie2-u4-memory .tg-turn{grid-column:1/-1;grid-row:1}
.ie2-u4-memory .tg-team{padding:.5rem;gap:.3rem}
.mm-gate[open]{grid-template-columns:1fr}
.mm-gate-image{min-height:200px;height:30vh}
.mm-gate-image .mm-art{min-height:0}
}
@media(prefers-reduced-motion:reduce){.ie2-u4-memory .tg-card{transition:none}}

.mm-gate{position:fixed;inset:0;margin:auto}
.mm-gate .intermediate2-kicker{color:#79500d;background:#fff3d8}

.mm-card-number{position:absolute;z-index:2;top:.35rem;left:.35rem;display:grid;place-items:center;min-width:1.8rem;height:1.8rem;padding:0 .25rem;border-radius:50%;background:#fff;color:#071f4f;font-size:.95rem;font-weight:900;box-shadow:0 1px 5px #0005}
@media(min-width:1700px){.ie2-u4-memory .tg-board[data-pairs="6"],.ie2-u4-memory .tg-board[data-pairs="9"]{grid-template-columns:repeat(6,minmax(0,1fr))}}
@media(min-width:701px) and (max-width:1100px){.ie2-u4-memory .tg-board[data-pairs="9"]{grid-template-columns:repeat(3,minmax(0,1fr))}}
