#game-root {
    --rm-accent: #10B981;
    --rm-accent-dark: #0e9c6f;
    --rm-accent-light: #e3f9ef;
    --rm-accent-border: #a7f3d0;
    border-radius: var(--kw-radius, 16px);
}

.rm-wrap {
    max-width: 460px;
    margin: 0 auto;
    padding: 20px 16px 28px;
    text-align: center;
}

.rm-loading,
.rm-error {
    text-align: center;
    padding: 48px 16px;
}

.rm-loading-icon,
.rm-error-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.rm-loading-icon {
    animation: rm-pulse 1.2s ease-in-out infinite;
}

.rm-loading-text {
    font-size: 15px;
    color: #666;
}

.rm-error-text {
    font-size: 15px;
    font-weight: 700;
    color: #EF4444;
}

.rm-stat-row {
    justify-content: center;
    margin-bottom: 14px;
}

.rm-stat {
    background: var(--rm-accent-light);
    color: var(--rm-accent-dark);
    border-radius: 999px;
    padding: 6px 14px;
    font-weight: 700;
    font-size: 13px;
}

.rm-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.rm-card {
    aspect-ratio: 1;
    font-size: 13px;
    font-weight: 800;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--rm-accent), var(--rm-accent-dark));
    color: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 0 rgba(0, 0, 0, .12);
    transition: transform .12s ease;
}

.rm-card:hover:not(.flipped):not(.matched) {
    transform: translateY(-2px);
}

.rm-card.flipped {
    background: #fff;
    color: var(--rm-accent-dark);
    border: 2px solid var(--rm-accent-border);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}

.rm-card.matched {
    background: #DCFCE7;
    color: #0e9c6f;
    border: 2px solid #10B981;
    opacity: .7;
    cursor: default;
}

.rm-done {
    font-size: 15px;
    font-weight: 700;
    color: var(--rm-accent-dark);
    background: var(--rm-accent-light);
    border-radius: var(--kw-radius, 16px);
    padding: 14px;
    margin-bottom: 14px;
}

.rm-done-share {
    justify-content: center;
    margin-top: 10px;
}

.rm-restart-btn {
    border: none;
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    background: var(--rm-accent);
    color: #fff;
    box-shadow: 0 3px 0 var(--rm-accent-dark);
    transition: transform .1s ease;
}

.rm-restart-btn:hover {
    transform: translateY(-1px);
}

@keyframes rm-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: .7; }
}

@media (max-width: 380px) {
    .rm-card {
        font-size: 11px;
    }
}
