.mm-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
/* Two players: Blue's score at the left end, Orange's at the right, the one whose turn it is lit up. */
.mm-turnbar { --p0: #2b6a93; --p1: #d07a2a; width: 100%; display: flex; align-items: center; justify-content: center; gap: 16px; }
.mm-turnbar .game-message { flex: 1; }
.mm-player {
  display: flex; align-items: center; gap: 12px; min-width: 170px; min-height: var(--tap); padding: 6px 18px;
  border-radius: 16px; background: var(--sand); color: var(--ink); border: 3px solid transparent; transition: background 0.2s, color 0.2s;
}
.mm-player[hidden] { display: none; }
.mm-player[data-player="1"] { flex-direction: row-reverse; }
.mm-player-name { font-family: var(--serif); font-size: 1.5rem; }
.mm-player-score { font-size: 1.8rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.mm-player[data-player="0"] { border-color: var(--p0); }
.mm-player[data-player="1"] { border-color: var(--p1); }
.mm-player[data-player="0"].is-turn { background: var(--p0); color: #fff; }
.mm-player[data-player="1"].is-turn { background: var(--p1); color: #fff; }
.mm-card.is-matched.by-0 .mm-face { box-shadow: inset 0 0 0 6px #2b6a93; }
.mm-card.is-matched.by-1 .mm-face { box-shadow: inset 0 0 0 6px #d07a2a; }
.game-credit { max-width: 94vw; }
.mm-wrap { flex: 1; min-height: 0; width: 100%; display: grid; place-items: center; }
.mm-board {
  --cw: 120px; --ch: 90px; --gap: 12px; --cols: 4;
  display: grid; grid-template-columns: repeat(var(--cols), var(--cw)); grid-auto-rows: var(--ch); gap: var(--gap);
  padding: var(--gap); border-radius: var(--radius); background: var(--sand);
}
.mm-card {
  position: relative; width: var(--cw); height: var(--ch); min-width: var(--tap); min-height: var(--tap);
  padding: 0; border: 0; background: none; cursor: pointer; perspective: 900px; touch-action: manipulation;
}
.mm-inner {
  position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.32s ease;
}
.mm-card.is-up .mm-inner { transform: rotateY(180deg); }
.mm-back, .mm-face {
  position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden;
  border-radius: 14px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.mm-back {
  background: var(--sea-deep);
  box-shadow: inset 0 0 0 5px var(--sea-deep), inset 0 0 0 7px rgba(250,247,242,0.28);
}
.mm-back svg { width: 38%; height: 38%; fill: none; stroke: var(--sand-deep); stroke-width: 5; stroke-linecap: round; opacity: 0.55; }
.mm-face { transform: rotateY(180deg); background: var(--cream); box-shadow: inset 0 0 0 2px var(--rule); }
.mm-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mm-face svg { width: 62%; height: 62%; }
.mm-card.is-matched .mm-face { box-shadow: inset 0 0 0 5px var(--good); }
.mm-card.is-matched .mm-face img { opacity: 0.88; }
.mm-card.is-matched { cursor: default; }
.mm-card.is-miss .mm-face { box-shadow: inset 0 0 0 5px var(--bad); }
.mm-card.is-pop .mm-inner { animation: mm-pop 0.35s ease-out; }
@keyframes mm-pop { 0% { scale: 1; } 50% { scale: 1.07; } 100% { scale: 1; } }
@media (prefers-reduced-motion: reduce) {
  .mm-inner { transition: none; }
  .mm-card.is-pop .mm-inner { animation: none; }
}
