.mm { display: grid; gap: 16px; padding-top: 4px; }
.mm-header { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 10px; align-items: center; }
.mm-icon { width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); font-size: 1.2rem; }
.mm-icon:disabled { opacity: .4; cursor: default; }
.mm-brand { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
.mm-brand > svg { width: 30px; height: 30px; flex: none; }
.mm-brand span { color: var(--muted); font-size: .75rem; font-weight: 650; }
.mm-brand h1 { font-size: clamp(.95rem, 4vw, 1.2rem); margin: 0; line-height: 1.3; letter-spacing: -.02em; }
.mm-hud { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 16px; background: var(--surface); padding: 10px 0; }
.mm-hud > div { display: grid; justify-items: center; gap: 2px; }
.mm-hud > div + div { border-left: 1px solid var(--border); }
.mm-hud span { color: var(--muted); font-size: .8rem; }
.mm-hud strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.mm-panel { display: grid; gap: 14px; padding: 22px 18px; }
.mm-panel h2 { font-size: 1.4rem; line-height: 1.25; }
.mm-panel .chip { justify-self: start; }
.mm-panel .btn { width: 100%; }
.mm-preview { display: flex; justify-content: center; padding: 16px 0 12px; }
.mm-preview > span { display: grid; place-items: center; width: 64px; height: 80px; border: 1px solid #7460cf; border-radius: 12px; background: linear-gradient(145deg, #382775, #1b2051); transform: rotate(-12deg); }
.mm-preview > span + span { margin-left: -10px; transform: translateY(-8px); }
.mm-preview > span:last-child { transform: rotate(12deg); }
.mm-preview svg { width: 34px; height: 34px; }
.mm-rules { padding-left: 22px; display: grid; gap: 8px; font-size: .95rem; }
.mm-note, .mm-instruction { color: var(--muted); font-size: .85rem; line-height: 1.5; }
.mm-stage { position: relative; display: grid; gap: 12px; }
.mm-instruction, .mm-stage > .mm-note { text-align: center; }
.mm-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mm-card { position: relative; min-width: 0; min-height: 56px; aspect-ratio: 4 / 5; padding: 0; background: transparent; border: 0; border-radius: 14px; perspective: 700px; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.mm-turn { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .28s ease; border-radius: inherit; }
.mm-card.is-open .mm-turn { transform: rotateY(180deg); }
.mm-back, .mm-face { position: absolute; inset: 0; display: grid; place-items: center; border: 1px solid #57468e; border-radius: inherit; -webkit-backface-visibility: hidden; backface-visibility: hidden; overflow: hidden; }
.mm-back { background: radial-gradient(ellipse at 30% 10%, rgba(155,134,255,.22), transparent 75%), linear-gradient(145deg, #302166, #1b2051); }
.mm-back::after { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(195,178,255,.12); border-radius: 9px; pointer-events: none; }
.mm-back svg { width: 44%; height: 44%; max-width: 42px; }
.mm-face { transform: rotateY(180deg); background: var(--surface-2); border-color: var(--violet-soft); }
.mm-face svg { width: 78%; height: 78%; }
.mm-card.is-matched { cursor: default; }
.mm-card.is-matched .mm-face { border-color: var(--lime); background: #172e39; }
.mm-card.is-matched .mm-face::after { content: "✓"; position: absolute; right: 4px; bottom: 2px; color: var(--lime); font-weight: 800; font-size: .8rem; }
.mm-card:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
.mm-pause { position: absolute; inset: 0; z-index: 3; display: grid; align-items: center; padding: 10px; border-radius: 16px; background: rgba(10,15,36,.98); }
.mm-pause .mm-panel { padding: 18px 14px; gap: 12px; }
.mm-pause .mm-panel > svg { width: 38px; height: 38px; }
.mm-board.is-paused .mm-turn { transform: none; transition: none; }
.mm-result { text-align: center; }
.mm-result .chip { justify-self: center; }
.mm-win-logo { display: flex; justify-content: center; padding-top: 4px; }
.mm-win-logo svg { width: 56px; height: 56px; animation: mm-celebrate .45s ease-out; }
@keyframes mm-celebrate { 0% { transform: scale(.8) rotate(-8deg); } 65% { transform: scale(1.08) rotate(3deg); } 100% { transform: none; } }
.mm-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mm-summary > div { display: grid; gap: 6px; padding: 14px 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; }
.mm-summary span { font-size: .85rem; color: var(--muted); }
.mm-summary strong { font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.mm #mm-save-note { margin: 0; font-size: .9rem; }
@media (max-width: 340px) {
  .mm-board { gap: 7px; }
  .mm-card { border-radius: 11px; }
  .mm-brand > svg { width: 24px; height: 24px; }
  .mm-brand { gap: 5px; }
  .mm-summary strong { font-size: 1.35rem; }
  .mm-panel { padding: 18px 14px; }
}
@media (prefers-reduced-motion: reduce) { .mm-turn { transition: none; } .mm-win-logo svg { animation: none; } }
