/* 形状颜色配对游戏 /tool/shape-color-match */

.scm-mode {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background: var(--calc-soft, #f1f5f9);
    padding: 5px;
    border-radius: 12px;
}
.scm-mode button {
    flex: 1;
    padding: 12px 4px;
    border: none;
    border-radius: 9px;
    background: transparent;
    font-size: 17px;
    font-weight: 700;
    color: var(--calc-muted, #64748b);
    cursor: pointer;
    transition: all .2s;
}
.scm-mode button.is-active {
    background: #fff;
    color: #db2777;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
}

.scm-seg { display: flex; gap: 8px; margin-bottom: 14px; }
.scm-seg button {
    flex: 1;
    padding: 10px 6px;
    border: 2px solid var(--calc-border, #e2e8f0);
    border-radius: 999px;
    background: #fff;
    font-size: 14px;
    font-weight: 700;
    color: var(--calc-text, #334155);
    cursor: pointer;
    transition: all .15s;
}
.scm-seg button.is-active { border-color: #db2777; background: #fdf2f8; color: #be185d; }

.scm-find-top {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    color: var(--calc-muted, #64748b);
    margin-bottom: 12px;
}
.scm-score b { color: #db2777; font-size: 20px; }

/* 目标图案 */
.scm-target {
    display: flex;
    justify-content: center;
    padding: 14px;
    background: var(--calc-soft, #f1f5f9);
    border-radius: 18px;
    margin-bottom: 10px;
}
.scm-target-svg {
    width: 110px;
    height: 110px;
    animation: scmBob 2.4s ease-in-out infinite;
}
@keyframes scmBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.scm-say {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--calc-text, #1e293b);
    margin: 0 0 14px;
}

/* 选项棋盘 */
.scm-board { display: grid; gap: 12px; }
.scm-board.is-easy { grid-template-columns: repeat(2, 1fr); }
.scm-board.is-hard { grid-template-columns: repeat(3, 1fr); }
.scm-cell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 4px solid var(--calc-border, #e2e8f0);
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    transition: all .15s;
}
.scm-cell:active { transform: scale(.94); }
.scm-cell-svg { width: 100%; max-width: 92px; height: auto; aspect-ratio: 1; pointer-events: none; }
.scm-board.is-hard .scm-cell-svg { max-width: 72px; }
.scm-cell.is-right { border-color: #22c55e; background: #f0fdf4; animation: scmPop .45s ease; }
.scm-cell.is-nope { border-color: #fca5a5; animation: scmShake .4s ease; }
.scm-cell.is-sel { border-color: #db2777; box-shadow: 0 0 0 4px rgba(219, 39, 119, .18); }
.scm-cell.is-done { border-color: #22c55e; background: #f0fdf4; opacity: .55; cursor: default; }
.scm-cell.is-done::after {
    content: '✔';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #22c55e;
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}
@keyframes scmPop {
    0% { transform: scale(1); }
    40% { transform: scale(1.12); }
    100% { transform: scale(1); }
}
@keyframes scmShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* 配配对 */
.scm-match-tip {
    font-size: 15px;
    line-height: 1.8;
    color: var(--calc-text, #334155);
    background: var(--calc-soft, #f1f5f9);
    border-radius: 12px;
    padding: 10px 14px;
    margin: 0 0 14px;
}
.scm-match-top, .scm-match-bottom {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}
.scm-match-mid {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--calc-text, #1e293b);
    min-height: 30px;
    padding: 10px 4px;
}
.scm-match-top .scm-cell-svg, .scm-match-bottom .scm-cell-svg { max-width: 56px; }

/* 右侧表扬区 + 贴纸墙 */
.scm-side { display: grid; gap: 16px; }
.scm-praise {
    text-align: center;
    padding: 18px 12px;
    border-radius: 18px;
    background: linear-gradient(160deg, #fdf2f8, #fce7f3);
}
.scm-praise-e { font-size: 56px; line-height: 1.2; margin-bottom: 8px; }
.scm-praise p { margin: 0; font-size: 18px; font-weight: 700; color: var(--calc-text, #1e293b); line-height: 1.7; }
.scm-praise small { font-size: 14px; font-weight: 400; color: var(--calc-muted, #64748b); }
.scm-praise b { color: #db2777; }

.scm-wall-wrap {
    border: 2px dashed var(--calc-border, #e2e8f0);
    border-radius: 16px;
    padding: 12px;
}
.scm-wall-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
    color: var(--calc-text, #334155);
    margin-bottom: 8px;
}
.scm-wall-head button {
    border: none;
    background: transparent;
    font-size: 16px;
    cursor: pointer;
    opacity: .5;
}
.scm-wall-head button:hover { opacity: 1; }
.scm-wall {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 40px;
}
.scm-wall span {
    font-size: 24px;
    animation: scmPop .4s ease;
}
.scm-wall-empty {
    font-size: 13px !important;
    color: var(--calc-muted, #94a3b8);
    animation: none !important;
}
.scm-wall-count { margin: 8px 0 0; font-size: 13px; font-weight: 700; color: #db2777; }

.scm-burst { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.scm-burst span {
    position: absolute;
    top: 30%;
    font-size: 26px;
    animation: scmFly 1.4s ease-out forwards;
}
@keyframes scmFly {
    0% { transform: translateY(0) scale(.4); opacity: 1; }
    100% { transform: translateY(-150px) scale(1.3) rotate(20deg); opacity: 0; }
}

.calc-result-body { position: relative; }
[hidden] { display: none !important; }

@media (max-width: 640px) {
    .scm-match-top, .scm-match-bottom { grid-template-columns: repeat(5, 1fr); gap: 6px; }
    .scm-target-svg { width: 88px; height: 88px; }
    .scm-say { font-size: 17px; }
}

/* 黑夜模式 */
body.dark-mode .scm-mode { background: #1e293b; }
body.dark-mode .scm-mode button { color: #94a3b8; }
body.dark-mode .scm-mode button.is-active { background: #0f172a; color: #f472b6; }
body.dark-mode .scm-seg button { background: #1e293b; border-color: #334155; color: #e2e8f0; }
body.dark-mode .scm-seg button.is-active { background: #2a0f1e; border-color: #f472b6; color: #f472b6; }
body.dark-mode .scm-find-top { color: #94a3b8; }
body.dark-mode .scm-target { background: #1e293b; }
body.dark-mode .scm-say { color: #f1f5f9; }
body.dark-mode .scm-cell { background: #1e293b; border-color: #334155; }
body.dark-mode .scm-cell.is-right { background: #052e16; border-color: #22c55e; }
body.dark-mode .scm-cell.is-done { background: #052e16; border-color: #22c55e; }
body.dark-mode .scm-cell.is-sel { border-color: #f472b6; }
body.dark-mode .scm-match-tip { background: #1e293b; color: #cbd5e1; }
body.dark-mode .scm-match-mid { color: #f1f5f9; }
body.dark-mode .scm-praise { background: linear-gradient(160deg, #2a0f1e, #1e293b); }
body.dark-mode .scm-praise p { color: #f1f5f9; }
body.dark-mode .scm-praise small { color: #94a3b8; }
body.dark-mode .scm-wall-wrap { border-color: #334155; }
body.dark-mode .scm-wall-head { color: #e2e8f0; }
body.dark-mode .scm-wall-count { color: #f472b6; }
