:root{--mm-blue:#2563eb;--mm-blue-dark:#1d4ed8;--mm-page:#eef4ff;--mm-card:#fff;--mm-text:#14213d;--mm-muted:#68748a;--mm-line:#dbe5f3;--mm-green:#16a34a;--mm-red:#dc2626}
*{box-sizing:border-box}.mm-manager-head{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;margin-bottom:18px}.mm-manager-head h2{margin:4px 0}.mm-manager-head p{margin:5px 0;color:var(--mm-muted)}.mm-manager-search{display:flex;gap:10px;margin-bottom:18px}.mm-manager-search input{width:min(480px,100%);padding:11px 13px;border:1px solid var(--mm-line);border-radius:12px;background:#fff}.mm-set-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(310px,1fr));gap:16px}.mm-set-card,.mm-empty{border:1px solid var(--mm-line);border-radius:17px;background:#fff}.mm-set-card{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:14px;align-items:center;padding:17px}.mm-set-card-icon{display:grid;width:48px;height:48px;place-items:center;border-radius:14px;background:#eef4ff;font-size:25px}.mm-set-card-copy{min-width:0}.mm-set-card-copy h3{margin:0 0 5px}.mm-set-card-copy p{height:35px;margin:0 0 7px;overflow:hidden;color:var(--mm-muted);font-size:12px}.mm-set-card-copy span{color:var(--mm-blue);font-size:12px;font-weight:800}.mm-empty{grid-column:1/-1;padding:50px 24px;text-align:center}.mm-empty-icon{font-size:50px}
.mm-play-body{min-height:100dvh;margin:0;color:var(--mm-text);background:var(--mm-page);font-family:Arial,sans-serif}.mm-game-shell{width:min(100%,580px);min-height:100dvh;margin:0 auto;padding:14px 14px 22px}.mm-game-header{display:flex;justify-content:space-between;align-items:flex-start;gap:15px;margin-bottom:12px}.mm-game-header span{font-size:10px;font-weight:800;letter-spacing:.12em;text-transform:uppercase}.mm-game-header h1{margin:4px 0 0;font-size:25px}.mm-game-header a{display:grid;width:37px;height:37px;place-items:center;border-radius:11px;color:var(--mm-text);background:#fff;text-decoration:none}.mm-scorebar{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:9px}.mm-scorebar>div{padding:9px;border-radius:12px;background:#fff;text-align:center}.mm-scorebar small{display:block;color:var(--mm-muted);font-size:10px}.mm-scorebar strong{font-size:17px}.mm-progress{height:7px;overflow:hidden;border-radius:999px;background:#d7e2f2}.mm-progress i{display:block;width:0;height:100%;border-radius:inherit;background:var(--mm-blue);transition:width .25s}.mm-instruction{min-height:20px;margin:9px 0;text-align:center;color:var(--mm-muted);font-size:13px;font-weight:700}.mm-board{display:grid;grid-template-columns:repeat(var(--memory-columns,3),minmax(0,1fr));gap:9px;justify-content:center;margin-inline:auto}.mm-card{position:relative;aspect-ratio:1/1.18;padding:0;border:0;background:transparent;perspective:900px;cursor:pointer}.mm-card-inner{position:absolute;inset:0;display:block;transform-style:preserve-3d;transition:transform .42s ease}.mm-card.is-open .mm-card-inner,.mm-card.is-matched .mm-card-inner{transform:rotateY(180deg)}.mm-card-face{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;overflow:hidden;border:2px solid #fff;border-radius:15px;box-shadow:0 8px 22px rgba(52,78,124,.13);backface-visibility:hidden;-webkit-backface-visibility:hidden}.mm-card-cover{color:#fff;background:linear-gradient(145deg,#4f7df0,#2456cc);font-size:31px;font-weight:900}.mm-card-content{padding:6px;background:#fff;transform:rotateY(180deg)}.mm-card-content img{width:100%;height:100%;object-fit:contain}.mm-card-content.is-word strong{font-size:clamp(15px,4vw,24px);line-height:1.05;text-align:center;word-break:break-word}.mm-card-letter{color:var(--mm-blue);font-size:46px;font-weight:900}.mm-card.is-matched .mm-card-face{border-color:#34c56a;box-shadow:0 0 0 3px rgba(52,197,106,.18)}.mm-card.is-matched{pointer-events:none}.mm-card.is-wrong .mm-card-face{border-color:#ef4444;animation:mmShake .28s linear 2}.mm-game-footer{display:flex;justify-content:center;margin-top:12px}.mm-game-footer button{min-width:130px;padding:11px 18px;border:1px solid var(--mm-line);border-radius:12px;background:#fff;font-weight:800;cursor:pointer}.mm-finish{position:fixed;inset:0;z-index:50;display:grid;place-items:center;padding:20px;background:rgba(15,23,42,.48)}.mm-finish[hidden]{display:none}.mm-finish-card{width:min(390px,100%);padding:28px;border-radius:24px;background:#fff;box-shadow:0 30px 90px rgba(15,23,42,.3);text-align:center}.mm-finish-icon{font-size:60px}.mm-finish-card h2{margin:7px 0}.mm-finish-card p{color:var(--mm-muted)}.mm-final-score{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:18px 0}.mm-final-score span{padding:12px;border-radius:13px;background:#f3f7ff}.mm-final-score small{display:block;color:var(--mm-muted)}.mm-final-score strong{font-size:22px}.mm-finish-card button{width:100%;padding:13px;border:0;border-radius:13px;color:#fff;background:var(--mm-blue);font-weight:800;cursor:pointer}.mm-finish-card a{display:block;margin-top:14px;color:var(--mm-blue)}.mm-game-empty{padding:50px 24px;border-radius:20px;background:#fff;text-align:center}.mm-game-empty>div{font-size:52px}
@keyframes mmShake{0%,100%{transform:translateX(0)}25%{transform:translateX(-4px)}75%{transform:translateX(4px)}}
@media(max-width:650px){.mm-game-shell{width:100%;padding:10px}.mm-game-header h1{font-size:22px}.mm-board{gap:7px}.mm-card-face{border-radius:12px}.mm-card-content{padding:4px}.mm-card-content.is-word strong{font-size:clamp(13px,4.2vw,19px)}}
@media(max-width:390px){.mm-card{aspect-ratio:auto}}

/* Memory responsive layout: 4–5 pairs = 2 columns, 6–8 pairs = 3 columns */
.mm-board[data-columns="2"]{
    width:min(100%,390px);
}

.mm-board[data-columns="3"]{
    width:min(100%,520px);
}

.mm-board[data-columns="2"] .mm-card{
    height:clamp(74px,10.5dvh,108px);
    aspect-ratio:auto;
}

.mm-board[data-columns="3"] .mm-card{
    height:clamp(72px,11.5dvh,112px);
    aspect-ratio:auto;
}

.mm-board[data-columns="2"] .mm-card-content.is-word strong{
    font-size:clamp(15px,4.4vw,22px);
}

.mm-board[data-columns="3"] .mm-card-content.is-word strong{
    font-size:clamp(13px,3.8vw,19px);
}

@media(max-width:650px){
    .mm-board{
        grid-template-columns:repeat(var(--memory-columns,3),minmax(0,1fr));
        gap:7px;
    }

    .mm-board[data-columns="2"]{
        width:min(100%,360px);
    }

    .mm-board[data-columns="3"]{
        width:100%;
    }

    .mm-board[data-columns="2"] .mm-card{
        height:clamp(68px,10dvh,98px);
    }

    .mm-board[data-columns="3"] .mm-card{
        height:clamp(66px,10.8dvh,94px);
    }

    .mm-card-face{
        border-radius:12px;
    }

    .mm-card-cover{
        font-size:clamp(23px,7vw,31px);
    }
}

@media(max-width:360px){
    .mm-board{
        gap:6px;
    }

    .mm-board[data-columns="2"] .mm-card{
        height:clamp(64px,9.5dvh,90px);
    }

    .mm-board[data-columns="3"] .mm-card{
        height:clamp(60px,9.8dvh,84px);
    }
}

@media(max-height:700px){
    .mm-board[data-columns="2"] .mm-card{
        height:clamp(58px,9dvh,78px);
    }

    .mm-board[data-columns="3"] .mm-card{
        height:clamp(56px,9.2dvh,76px);
    }
}

