.fm-page{
    max-width:1160px;
    margin:32px auto 70px;
    padding:0 14px;
    color:#20252b;
}
.fm-screen{
    background:#fff;
    border:1px solid #dde1e5;
    border-radius:24px;
    box-shadow:0 14px 42px rgba(32,37,43,.07);
    overflow:hidden;
}
.fm-intro,.fm-end{
    min-height:580px;
    padding:42px 24px;
    display:grid;
    place-items:center;
    align-content:center;
    text-align:center;
    gap:18px;
}
.fm-kicker{
    display:inline-flex;
    align-items:center;
    padding:6px 12px;
    border:1px solid #d9dde1;
    border-radius:999px;
    background:#f5f6f4;
    color:#626971;
    font-size:13px;
    font-weight:800;
}
.fm-intro h1,.fm-end h2{
    margin:0;
    font-size:clamp(30px,5vw,44px);
    line-height:1.25;
}
.fm-intro p,.fm-end p{
    max-width:760px;
    margin:0;
    color:#66707a;
    line-height:1.9;
}
.fm-demo{
    width:min(100%,540px);
    padding:24px;
    border:1px solid #e0e3e6;
    border-radius:20px;
    background:#fafaf8;
    display:flex;
    justify-content:center;
    align-items:center;
    gap:16px;
}
.fm-demo-card{
    width:95px;
    aspect-ratio:1;
    border-radius:14px;
    background:#54769a;
    border:3px solid #3e5d79;
    display:grid;
    place-items:center;
}
.fm-demo-card-target{
    box-shadow:0 0 0 5px rgba(84,118,154,.13);
}
.fm-demo-equals{
    font-size:32px;
    font-weight:900;
    color:#7b838b;
}
.fm-demo-symbol{
    width:58px;
    height:58px;
    display:block;
}
.fm-symbol svg{
    width:100%;
    height:100%;
    display:block;
}
.fm-rules{
    display:flex;
    justify-content:center;
    gap:10px;
    flex-wrap:wrap;
}
.fm-rules div{
    min-width:110px;
    padding:12px 15px;
    border:1px solid #e1e4e7;
    border-radius:14px;
    background:#fafaf8;
}
.fm-rules strong,.fm-rules span{
    display:block;
}
.fm-rules strong{
    font-size:24px;
    line-height:1.1;
}
.fm-rules span{
    margin-top:5px;
    color:#747c84;
    font-size:12px;
    font-weight:700;
}
.fm-btn{
    min-height:46px;
    padding:11px 19px;
    border-radius:12px;
    border:1px solid #cfd4d9;
    background:#fff;
    color:#252a2f;
    font:inherit;
    font-weight:800;
    text-decoration:none;
    display:inline-flex;
    justify-content:center;
    align-items:center;
    cursor:pointer;
    transition:transform .14s ease,background .14s ease,box-shadow .14s ease;
}
.fm-btn:hover{
    transform:translateY(-1px);
    background:#f7f8f7;
}
.fm-btn:focus-visible,.fm-card:focus-visible{
    outline:3px solid #9da7b1;
    outline-offset:2px;
}
.fm-primary{
    min-width:190px;
    background:#2f3439;
    color:#fff;
    border-color:#2f3439;
}
.fm-primary:hover{
    background:#23282d;
}
.fm-secondary{
    background:#edf0f3;
}
.fm-light{
    background:#f7f7f5;
}

#fmGame{
    padding:20px;
}
.fm-game-header{
    display:grid;
    grid-template-columns:minmax(240px,1fr) auto;
    gap:16px;
    align-items:end;
    margin-bottom:14px;
}
.fm-title-block h2{
    margin:7px 0 0;
    font-size:28px;
}
.fm-stats{
    display:flex;
    flex-wrap:wrap;
    justify-content:flex-end;
    gap:8px;
}
.fm-stats span{
    min-width:82px;
    padding:9px 10px;
    border:1px solid #e0e4e7;
    border-radius:12px;
    background:#fafaf8;
    text-align:center;
    color:#737a82;
    font-size:12px;
    font-weight:700;
}
.fm-stats b{
    display:block;
    margin-top:3px;
    color:#24292e;
    font-size:16px;
}
.fm-stats span:nth-child(3) b{
    min-width:76px;
    color:#24292e;
}
.fm-stats span:nth-child(3) b.is-countdown{
    color:#a33a2f;
    animation:fm-pulse .8s ease-in-out infinite;
}
.fm-board.fm-stage-complete{
    box-shadow:0 0 0 4px rgba(107,158,117,.16);
}
@keyframes fm-pulse{
    0%,100%{transform:scale(1);opacity:1}
    50%{transform:scale(1.08);opacity:.72}
}
.fm-instruction{
    min-height:28px;
    margin:8px auto 14px;
    text-align:center;
    color:#555e67;
    font-weight:800;
}
.fm-board-shell{
    display:flex;
    justify-content:center;
}
.fm-board{
    width:min(100%,760px);
    display:grid;
    grid-template-columns:repeat(var(--fm-cols),minmax(0,1fr));
    gap:7px;
    padding:10px;
    border:1px solid #dde2e6;
    border-radius:18px;
    background:#eef1f3;
}
.fm-card{
    aspect-ratio:1;
    min-width:0;
    padding:10px;
    border:2px solid #4e708f;
    border-radius:12px;
    background:#54769a;
    cursor:pointer;
    display:grid;
    place-items:center;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.14),0 2px 4px rgba(29,48,65,.08);
    transition:transform .11s ease,box-shadow .11s ease,border-color .11s ease,background .11s ease;
}
.fm-card:hover{
    transform:translateY(-1px);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.18),0 6px 12px rgba(29,48,65,.12);
}
.fm-card.is-selected{
    border-color:#f0c85b;
    box-shadow:0 0 0 4px rgba(240,200,91,.19);
}
.fm-card.is-match{
    border-color:#6b9e75;
    background:#6f8f78;
    animation:fm-pop .24s ease;
}
.fm-card.is-wrong{
    border-color:#d27676;
    background:#8c6161;
    animation:fm-shake .16s linear 2;
}
.fm-symbol{
    width:62%;
    height:62%;
    max-width:74px;
    max-height:74px;
    display:grid;
    place-items:center;
    pointer-events:none;
}
.fm-card .fm-symbol{
    visibility:hidden;
    opacity:0;
    transform:scale(.82);
    transition:opacity .14s ease,transform .14s ease,visibility 0s linear .14s;
}
.fm-card.is-revealed .fm-symbol{
    visibility:visible;
    opacity:1;
    transform:scale(1);
    transition-delay:0s;
}
.fm-emoji{
    display:block;
    font-size:clamp(32px,6vw,68px);
    line-height:1;
    font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;
    text-align:center;
    filter:saturate(1.05);
}
.fm-demo .fm-symbol{
    visibility:visible;
    opacity:1;
    transform:none;
}
.fm-card:not(:has(.fm-symbol)){
    opacity:.98;
}
.fm-game-actions{
    display:flex;
    justify-content:center;
    gap:9px;
    flex-wrap:wrap;
    margin-top:14px;
}

.fm-end-icon{
    width:78px;
    height:78px;
    border-radius:50%;
    display:grid;
    place-items:center;
    background:#eceee9;
    font-size:36px;
    font-weight:900;
}
.fm-result-grid{
    width:min(100%,760px);
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:10px;
    margin:6px auto 4px;
}
.fm-result-grid div{
    border:1px solid #e0e4e7;
    border-radius:14px;
    background:#fafaf8;
    padding:14px 8px;
}
.fm-result-grid b,.fm-result-grid span{
    display:block;
}
.fm-result-grid b{
    font-size:22px;
}
.fm-result-grid span{
    margin-top:4px;
    color:#737b83;
    font-size:12px;
}
.fm-end-actions{
    display:flex;
    justify-content:center;
    gap:9px;
    flex-wrap:wrap;
}
@keyframes fm-pop{
    0%{transform:scale(.98)}
    55%{transform:scale(1.03)}
    100%{transform:scale(1)}
}
@keyframes fm-shake{
    0%,100%{transform:translateX(0)}
    50%{transform:translateX(4px)}
}
[hidden]{display:none!important}

@media (max-width:900px){
    .fm-game-header{
        grid-template-columns:1fr;
        align-items:start;
    }
    .fm-stats{justify-content:flex-start}
    .fm-board{width:min(100%,720px)}
}
@media (max-width:620px){
    .fm-page{margin-top:20px;padding:0 8px 50px}
    .fm-screen{border-radius:18px}
    .fm-intro,.fm-end{padding:30px 15px;min-height:520px}
    .fm-demo{padding:18px}
    .fm-demo-card{width:76px}
    .fm-demo-symbol{width:48px;height:48px}
    #fmGame{padding:12px}
    .fm-title-block h2{font-size:23px}
    .fm-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}
    .fm-stats span{min-width:0}
    .fm-board{gap:5px;padding:7px;border-radius:14px}
    .fm-card{padding:6px;border-radius:9px}
    .fm-symbol{width:66%;height:66%}
    .fm-result-grid{grid-template-columns:repeat(2,1fr)}
}
